#cbLaunch{position:fixed;left:18px;bottom:18px;z-index:9998;background:#a71935;color:white;border:0;border-radius:28px;padding:12px 18px;box-shadow:0 6px 24px #0004;cursor:pointer;font-weight:700}#cbOverlay{position:fixed;inset:0;z-index:9999;background:#081020ac;padding:14px;overflow:auto}#cbShell{max-width:1400px;margin:auto;background:#f7f8fb;color:#182032;border-radius:18px;padding:20px;min-height:85vh}#cbShell button,#cbShell select,#cbShell input,#cbShell textarea{font:inherit;padding:8px;border:1px solid #c9d1dd;border-radius:7px}#cbShell button{cursor:pointer}#cbShell .primary{background:#a71935;color:#fff;border-color:#a71935}#cbShell .bar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:14px 0}#cbShell .kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}#cbShell .kpi{background:white;padding:17px;border-radius:12px;border:1px solid #e2e7ef}#cbShell .kpi strong{display:block;font-size:22px}#cbShell table{width:100%;border-collapse:collapse;background:white;font-size:13px}#cbShell td,#cbShell th{text-align:left;padding:9px;border-bottom:1px solid #e4e8ed;vertical-align:top}#cbShell .scroll{overflow:auto;max-height:55vh}#cbShell .muted{color:#5e6879;font-size:12px}#cbShell .warn{color:#a04f00}#cbShell .good{color:#12673c}#cbShell .edit{background:#fff;border:1px solid #ccd4df;padding:16px;margin:15px 0;border-radius:12px}#cbShell .editgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}#cbShell label{display:flex;flex-direction:column;gap:5px}#cbShell #cbStatus{padding:8px;color:#18563d}#cbShell .badge{background:#f0e1e3;padding:3px 8px;border-radius:12px}@media(max-width:700px){#cbShell{padding:10px}#cbOverlay{padding:5px}#cbLaunch{left:8px;bottom:8px}}
#cbShell .cbFilters,#cbShell .cbBulk{display:flex;flex-wrap:wrap;align-items:end;gap:12px;background:#fff;border:1px solid #dde3ea;padding:12px;border-radius:12px;margin:12px 0}#cbShell .cbFilters label{min-width:170px;flex:1}#cbShell .cbBulk label{min-width:170px}#cbShell td:first-child,#cbShell th:first-child{width:32px;text-align:center}#cbShell input[type=checkbox]{width:17px;height:17px;cursor:pointer}
#cbShell .cbAI{margin:14px 0;padding:14px;background:#f0f2ff;border:1px solid #c9d2f1;border-radius:12px}#cbShell .cbAI .bar{margin:6px 0}#cbShell #cbAICommand{background:#fff}#cbShell #cbAISummary{white-space:pre-wrap;line-height:1.5}

.cbImportReview{margin:12px 0;padding:16px;border:1px solid #cbd5e1;border-radius:13px;background:#f8fafc;color:#1e293b}.cbImportReview .scroll{max-height:350px;overflow:auto}.cbImportReview select{min-width:200px;max-width:350px}.cbImportReview table{width:100%}.cbImportReview td{padding:7px} 

#cbSelloutPopup{position:fixed;inset:0;z-index:2147483000} .cbso-backdrop{position:absolute;inset:0;background:#101827aa;display:flex;justify-content:center;align-items:center;padding:18px}.cbso-modal{width:min(1050px,100%);max-height:94vh;overflow:auto;background:var(--card,#fff);color:var(--text,#1d2430);border-radius:16px;padding:24px;box-shadow:0 20px 65px #0005}.cbso-controls{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:12px;margin:16px 0}.cbso-controls label{display:grid;gap:5px;font-size:12px}.cbso-controls input,.cbso-controls select{width:100%;padding:10px;border:1px solid #cbd5e1;border-radius:8px}.cbso-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0}.cbso-summary>div{background:#f1f5f9;color:#263244;border-radius:10px;padding:13px;font-size:12px}.cbso-summary strong{font-size:17px}@media(max-width:750px){.cbso-controls{grid-template-columns:1fr 1fr}.cbso-summary{grid-template-columns:1fr}}

.cbtrend-modal{width:min(1500px,100%);background:#f7f9fc}.cbtrend-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:18px 0}.cbtrend-kpis>div{background:#fff;padding:16px;border:1px solid #dce3ec;border-radius:12px;color:#546072;font-size:12px}.cbtrend-kpis strong{display:block;color:#182233;font-size:22px;margin:7px 0}.cbtrend-kpis small{display:block;font-size:11px}.cbtrend-graphs{display:grid;grid-template-columns:1fr 1fr;gap:16px}.cbtrend-bars{background:#fff;padding:18px;border-radius:13px;border:1px solid #e1e7ef}.cbtrend-chart{display:flex;align-items:flex-end;justify-content:space-around;gap:5px;height:210px}.cbtrend-col{height:100%;display:flex;justify-content:flex-end;align-items:center;flex-direction:column;min-width:0;flex:1}.cbtrend-col span{font-size:9px;white-space:nowrap}.cbtrend-bar{background:#a71935;width:60%;max-width:32px;border-radius:5px 5px 0 0}.cbtrend-col small{font-size:11px}.cbtrend-modal table{width:100%;background:#fff;border-collapse:collapse}.cbtrend-modal th,.cbtrend-modal td{padding:9px;border-bottom:1px solid #e0e4ec;text-align:left}.cbtrend-modal h3{margin-top:20px}@media(max-width:800px){.cbtrend-kpis{grid-template-columns:1fr 1fr}.cbtrend-graphs{grid-template-columns:1fr}}@media print{body>*:not(#cbTrendPopup){display:none!important}#cbTrendPopup{position:static!important}.cbso-backdrop{position:static;background:#fff;padding:0;display:block}.cbtrend-modal{max-height:none;width:100%;box-shadow:none;padding:10px}.cbtrend-modal button,.cbtrend-modal .cbso-controls{display:none!important}.cbtrend-graphs{break-inside:avoid}}


/* Step 38.1: responsive Commercial Bonus overlay */
#cbOverlay{inset:0!important;box-sizing:border-box!important;width:100vw!important;max-width:100vw!important;overflow-x:hidden!important;overflow-y:auto!important;padding:clamp(6px,1vw,18px)!important;}
#cbShell{box-sizing:border-box!important;width:100%!important;max-width:min(1480px,100%)!important;min-width:0!important;margin:0 auto!important;overflow-x:hidden!important;}
#cbShell *,#cbShell *::before,#cbShell *::after{box-sizing:border-box;}
#cbShell .bar,#cbShell .cbFilters,#cbShell .cbBulk,#cbShell .kpis,#cbShell .editgrid{min-width:0;max-width:100%;}
#cbShell .bar>*{min-width:0;max-width:100%;}
#cbShell input:not([type=checkbox]),#cbShell select,#cbShell textarea{min-width:0;max-width:100%;}
#cbShell .scroll{max-width:100%;overflow-x:auto;}
#cbShell table{width:100%;}
#cbShell .cbFilters>*,#cbShell .cbBulk>*{min-width:min(170px,100%);}
@media(max-width:900px){#cbShell{padding:12px!important;}#cbShell .cbFilters label{min-width:0;flex-basis:220px;}#cbShell .kpi strong{font-size:clamp(16px,3vw,22px);}}
@media(max-width:540px){#cbShell .cbFilters label{flex-basis:100%;}#cbShell .bar button{max-width:100%;white-space:normal;}}

/* Step 39 — full-page Commercial workspace rather than modal overlay */
#cbLaunch{display:none!important;}
#cbOverlay{position:fixed!important;top:0!important;bottom:0!important;left:258px!important;right:0!important;width:auto!important;max-width:none!important;height:100dvh!important;z-index:900!important;background:#f7f8fb!important;padding:0!important;overflow-y:auto!important;overflow-x:hidden!important;}
#cbShell{width:100%!important;max-width:none!important;min-height:100%!important;margin:0!important;border-radius:0!important;padding:clamp(14px,2vw,30px)!important;overflow:visible!important;}
body.cb-page-open .sidebar{z-index:950!important;}
#cbShell .scroll{overflow-x:auto!important;}
@media(max-width:850px){#cbOverlay{left:210px!important;}}
@media(max-width:760px){#cbOverlay{left:0!important;top:0!important;z-index:900!important;}body.cb-page-open .sidebar{z-index:950!important;}}
@media print{#cbOverlay{position:static!important;width:100%!important;height:auto!important;overflow:visible!important;left:0!important;}}

/* STEP 40: standalone Journal Trend workspace, not a modal */
#cbTrendPopup{position:fixed;top:0;bottom:0;left:258px;right:0;width:auto;z-index:901;background:#f5f7fb;overflow-y:auto;overflow-x:hidden;padding:0;box-sizing:border-box}
#cbTrendPopup .cbtrend-page{width:100%;max-width:100%;min-height:100%;box-sizing:border-box;border-radius:0;padding:clamp(14px,2vw,32px);box-shadow:none;overflow:visible;background:#f7f9fc}
#cbTrendPopup .cbtrend-graphs{grid-template-columns:repeat(2,minmax(0,1fr))}
#cbTrendPopup .cbtrend-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}
#cbTrendPopup .scroll{overflow-x:auto;max-width:100%}
#cbTrendPopup table{min-width:690px}
body.cb-trend-open .sidebar{z-index:950!important}
@media(max-width:850px){#cbTrendPopup{left:210px}#cbTrendPopup .cbtrend-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){#cbTrendPopup{left:0}#cbTrendPopup .cbtrend-graphs{grid-template-columns:1fr}}
@media(max-width:480px){#cbTrendPopup .cbtrend-kpis{grid-template-columns:1fr}}
@media print{#cbTrendPopup{position:static!important;overflow:visible!important;left:0!important;max-height:none!important}#cbTrendPopup .cbtrend-page{padding:8px!important}body>*:not(#cbTrendPopup){display:none!important}}
