/* Reporting Portal: dark, near-black design system.
   Monochrome surfaces + one cool accent (--accent) for data/links/focus;
   status hues (ok/err/warn) are reserved for run + delivery states only. */
:root{
  --bg:#0a0a0b; --bg-soft:#0d0d0f;
  --surface:#111114; --surface-2:#17171b; --surface-3:#1d1d22;
  --line:#242429; --line-2:#30303a;
  --ink:#f3f3f5; --ink-2:#c4c4cc; --muted:#83838d; --muted-2:#666670;
  --accent:#5b8def; --accent-2:#7ba3f5; --accent-soft:rgba(91,141,239,.14); --accent-ink:#ffffff;
  --white:#fafafa; --white-ink:#0a0a0b;
  --ok:#4ec27f; --ok-soft:rgba(78,194,127,.13);
  --err:#e26d6d; --err-soft:rgba(226,109,109,.13);
  --warn:#d8b45a; --warn-soft:rgba(216,180,90,.13);
  --radius:14px; --radius-sm:10px; --radius-xs:8px;
  --shadow:0 1px 2px rgba(0,0,0,.45), 0 12px 32px -16px rgba(0,0,0,.75);
  --maxw:1360px;
  /* CSD brand mark, theme-aware (periwinkle brackets, ring, core) */
  --logo-bracket:#93a5d6; --logo-ring:#c9d1f0; --logo-disc:#93a5d6; --logo-dot:#0a0a0c; --logo-text:#f3f3f5;
}

/* ---------- light theme ---------- */
:root[data-theme="light"]{
  --bg:#f6f7f9; --bg-soft:#eceef2;
  --surface:#ffffff; --surface-2:#f3f4f7; --surface-3:#e9ebf0;
  --line:#e4e6ec; --line-2:#d3d6de;
  --ink:#191b22; --ink-2:#3d4049; --muted:#6b6e78; --muted-2:#9498a2;
  --accent:#4f7fe6; --accent-2:#3a63cf; --accent-soft:rgba(79,127,230,.12); --accent-ink:#ffffff;
  --white:#232659; --white-ink:#ffffff;              /* primary button becomes brand navy on light */
  --ok:#2f9e63; --ok-soft:rgba(47,158,99,.13);
  --err:#d0524f; --err-soft:rgba(208,82,79,.12);
  --warn:#a9781a; --warn-soft:rgba(169,120,26,.14);
  --shadow:0 1px 2px rgba(16,18,30,.06), 0 12px 30px -18px rgba(16,18,30,.22);
  --logo-bracket:#93a5d6; --logo-ring:#232659; --logo-disc:#93a5d6; --logo-dot:#0a0a0c; --logo-text:#232659;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
html,body{margin:0;background:var(--bg);color:var(--ink)}
body{
  font-family:"Satoshi",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  font-size:15px;line-height:1.55;font-weight:400;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
  background-image:radial-gradient(1200px 600px at 50% -280px,rgba(91,141,239,.06),transparent 70%);
  background-repeat:no-repeat;
}
a{color:inherit}
::selection{background:var(--accent-soft)}
.tnum{font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}

/* ---------- header / nav ---------- */
header{
  position:sticky;top:0;z-index:20;
  display:flex;align-items:center;gap:1.5rem;
  padding:.7rem 1.5rem;
  background:rgba(10,10,11,.72);backdrop-filter:saturate(160%) blur(12px);
  border-bottom:1px solid var(--line);
}
.brand{display:flex;align-items:center;gap:.55rem;text-decoration:none;white-space:nowrap}
.brand .mark{display:grid;place-items:center;width:28px;height:28px}
.brand .mark svg{display:block}
.brand-name{font-weight:700;letter-spacing:-.01em;font-size:1rem;color:var(--logo-text)}
.brand-name span{font-weight:500;color:var(--muted);margin-left:.12rem}
nav{display:flex;align-items:center;gap:.35rem;flex:1;flex-wrap:wrap}
nav a{color:var(--muted);text-decoration:none;font-size:.88rem;font-weight:500;padding:.34rem .6rem;border-radius:8px;transition:color .12s,background .12s}
nav a:hover{color:var(--ink);background:var(--surface-2)}
nav a.active{color:var(--ink);background:var(--surface-2)}
.spacer{flex:1}
.who{color:var(--muted);font-size:.85rem;padding-left:.2rem;text-decoration:none}
a.who:hover{color:var(--white)}
.who .dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--ok);margin-right:.45rem;vertical-align:middle}
/* accounts pages */
/* the global input{margin-top:.4rem} is for stacked label>input forms; inline rows need it off */
.inline-form{display:flex;gap:.7rem;flex-wrap:wrap;align-items:center}
.inline-form input,.inline-form label,.inline-form button,form.inline-form button[type=submit]{margin:0}
.inline-form{width:100%}
/* the global input{width:100%} makes the flex line-break basis the full row, wrapping the
   checkbox+button below; a definite width keeps all three on one line */
.inline-form input:not([type=checkbox]){width:220px;flex:0 0 auto}
.inline-form input[type=checkbox]{width:15px;height:15px}
.inline-form .chk{display:inline-flex;align-items:center;gap:.4rem;font-size:.88rem;color:var(--muted);white-space:nowrap}
.notice.ok-note{color:var(--ok);background:var(--ok-soft);border:1px solid rgba(90,190,140,.28);padding:.65rem .85rem;border-radius:var(--radius-xs);margin:.7rem 0;font-size:.9rem;word-break:break-all}
.btn.danger{color:var(--err)}
.stack{display:flex;flex-direction:column;gap:.9rem}
.chip{display:inline-block;padding:.12rem .55rem;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:.78rem;font-weight:600}
.nav-logout{color:var(--muted);font-size:.85rem;text-decoration:none;padding:.34rem .55rem;border-radius:8px}
.nav-logout:hover{color:var(--ink);background:var(--surface-2)}
.header-right{display:flex;align-items:center;gap:.55rem;margin-left:auto}
.theme-toggle{display:grid;place-items:center;width:34px;height:34px;padding:0;background:var(--surface-2);border:1px solid var(--line);border-radius:9px;color:var(--muted);cursor:pointer;transition:color .12s,border-color .12s,background .12s}
.theme-toggle:hover{color:var(--ink);border-color:var(--line-2);opacity:1}
.theme-toggle svg{display:block}
.theme-toggle .i-moon{display:none}
:root[data-theme="light"] .theme-toggle .i-sun{display:none}
:root[data-theme="light"] .theme-toggle .i-moon{display:block}

/* ---------- layout ---------- */
main{max-width:var(--maxw);margin:2.4rem auto 4rem;padding:0 1.5rem}
h1{font-size:1.6rem;font-weight:700;letter-spacing:-.025em;margin:.1rem 0 .35rem}
h2{font-size:1.02rem;font-weight:600;letter-spacing:-.01em;margin:2.2rem 0 .9rem;color:var(--ink)}
h3{font-size:1rem;font-weight:600;letter-spacing:-.01em;margin:0 0 .35rem}
p{margin:.4rem 0}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:1.6rem}
.page-head .sub{color:var(--muted);font-size:.92rem;margin:0}
.refresh-box{display:flex;flex-direction:column;align-items:flex-end;gap:.35rem}
.refresh-asof{color:var(--muted);font-size:.72rem}
/* page-head action rows hold sm buttons + the refresh box: top-align so the caption under
   the refresh button hangs below the row instead of pushing its button out of line */
.head-actions{align-items:flex-start;gap:.55rem}
.head-actions .dl-select{padding-top:.38rem;padding-bottom:.38rem;font-size:.82rem}
.eyebrow{display:inline-block;font-size:.72rem;font-weight:600;letter-spacing:.09em;text-transform:uppercase;color:var(--accent-2);margin-bottom:.5rem}

/* ---------- cards / panels ---------- */
.card,.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.card{padding:1.4rem 1.5rem;margin-bottom:1.1rem}
.panel{overflow:hidden}
.panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;padding:1.15rem 1.4rem .2rem}
.panel-title{font-size:.98rem;font-weight:600;letter-spacing:-.01em;margin:0}
.panel-sub{color:var(--muted);font-size:.82rem;margin:.15rem 0 0}
.card.narrow{max-width:370px;margin:6vh auto 0}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(272px,1fr));gap:1.1rem}
.muted{color:var(--muted)}.small{font-size:.84rem}
.row{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}.row.between{justify-content:space-between}

/* report index cards */
.report-card{display:flex;flex-direction:column;gap:.55rem;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:1.05rem 1.35rem 1.25rem;box-shadow:var(--shadow);transition:border-color .14s,transform .14s}
.report-card:hover{border-color:var(--line-2);transform:translateY(-2px)}
.report-card .card-top{display:flex;align-items:center;justify-content:space-between;gap:.6rem}
.report-card .card-top h3{margin:0}
.report-card .desc{color:var(--muted);font-size:.9rem;line-height:1.5;flex:1;margin:0}
.report-card .actions{display:flex;gap:.55rem;margin-top:.5rem}
/* A family card (several reports off one data source) lists each as a row instead of carrying a
   single actions strip. Rows are separated by a hairline, not boxed, so the card still reads as
   one object rather than a nested list. */
.report-card.multi .runs{display:flex;flex-direction:column;margin-top:.35rem}
.report-card.multi .run-row{
  display:flex;align-items:center;justify-content:space-between;gap:.7rem;
  padding:.6rem 0;border-top:1px solid var(--line);
}
.report-card.multi .rr-text{min-width:0}
.report-card.multi .rr-name{font-size:.88rem;font-weight:600;color:var(--ink)}
.report-card.multi .rr-meta{font-size:.78rem;color:var(--muted);margin-top:.1rem}
.report-card.multi .rr-actions{display:flex;gap:.4rem;flex:0 0 auto}
@media(max-width:640px){
  /* the two buttons plus a long report name overflow a 375px card, so the row stacks */
  .report-card.multi .run-row{flex-direction:column;align-items:stretch;gap:.45rem}
  .report-card.multi .rr-actions .btn{flex:1 1 auto;justify-content:center}
}
.report-card .badge{flex:0 0 auto;font-size:.7rem;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);background:var(--surface-2);border:1px solid var(--line);padding:.16rem .5rem;border-radius:999px}

/* ---------- KPI tiles ---------- */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:1rem;margin-bottom:1.2rem}
.kpi{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:1.05rem 1.2rem;box-shadow:var(--shadow);overflow:hidden}
.kpi::before{content:"";position:absolute;left:0;top:0;bottom:0;width:2px;background:linear-gradient(var(--accent-2),var(--accent));opacity:.55}
.kpi-lbl{color:var(--muted);font-size:.76rem;font-weight:500;letter-spacing:.05em;text-transform:uppercase}
.kpi-val{font-size:1.7rem;font-weight:700;letter-spacing:-.03em;margin-top:.4rem;line-height:1.05}
.kpi-foot{display:flex;align-items:center;gap:.45rem;margin-top:.45rem;font-size:.78rem;min-height:1.35rem}
.delta{display:inline-flex;align-items:center;gap:.28rem;font-weight:600;font-size:.78rem;padding:.06rem .4rem;border-radius:999px}
.delta.up{color:var(--ok);background:var(--ok-soft)}
.delta.down{color:var(--err);background:var(--err-soft)}
.delta.flat{color:var(--muted);background:var(--surface-2)}
.delta .tri{width:0;height:0;border-left:3.5px solid transparent;border-right:3.5px solid transparent}
.delta.up .tri{border-bottom:5px solid var(--ok)}
.delta.down .tri{border-top:5px solid var(--err)}
.delta-cap{color:var(--muted-2);font-size:.76rem}
.details{display:flex;flex-wrap:wrap;gap:.5rem;margin:-.2rem 0 1.4rem}
.detail{display:inline-flex;align-items:center;gap:.5rem;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:.35rem .85rem;font-size:.84rem;line-height:1}
.detail .k{color:var(--muted);font-size:.78rem}
.detail .v{display:inline-flex;align-items:center;gap:.32rem;color:var(--ink-2);font-weight:500}

/* ---------- chart ---------- */
.chart{padding:.4rem .6rem 1rem}
.chart .plotly-graph-div{width:100%!important}

/* ---------- forms ---------- */
label{display:block;margin:.9rem 0 0;font-size:.85rem;color:var(--muted);font-weight:500}
label.check{display:flex;gap:.55rem;align-items:center;color:var(--ink-2);margin-top:1rem}
input,select{width:100%;padding:.62rem .72rem;margin-top:.4rem;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-xs);color:var(--ink);font:inherit;transition:border-color .12s,box-shadow .12s}
input::placeholder{color:var(--muted-2)}
input:focus,select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
/* Keyboard focus was invisible on every button, link and tab (only fields had a ring), so
   tabbing through the app showed nothing. :focus-visible keeps mouse clicks ring-free. */
a:focus-visible,button:focus-visible,.btn:focus-visible,.tab:focus-visible,
.rowlink:focus-visible,summary:focus-visible{
  outline:2px solid var(--accent);outline-offset:2px;border-radius:var(--radius-xs)}

/* A transitioned background does NOT re-resolve when a custom property changes: toggling the
   theme at runtime left every button/tab/nav pill painted with the OLD theme's background
   while the text colour flipped, i.e. white-on-white buttons in light mode. Fresh loads were
   fine, only the toggle broke. Suppress transitions for the instant of the switch. */
:root.theme-switching *,
:root.theme-switching *::before,
:root.theme-switching *::after{transition:none!important}
input[type=checkbox]{width:auto;margin:0;accent-color:var(--accent)}
select{appearance:none;background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);background-position:calc(100% - 18px) 55%,calc(100% - 13px) 55%;background-size:5px 5px,5px 5px;background-repeat:no-repeat}

/* ---------- buttons ---------- */
button,.btn{display:inline-flex;align-items:center;gap:.4rem;background:var(--white);color:var(--white-ink);border:1px solid transparent;border-radius:var(--radius-xs);padding:.58rem 1.05rem;font:inherit;font-weight:600;font-size:.9rem;cursor:pointer;text-decoration:none;transition:opacity .12s,background .12s,border-color .12s,transform .06s}
button:active,.btn:active{transform:translateY(1px)}
button:hover,.btn:hover{opacity:.9}
.btn.ghost{background:transparent;color:var(--ink-2);border-color:var(--line-2)}
.btn.ghost:hover{background:var(--surface-2);color:var(--ink);opacity:1}
.btn.sm{padding:.36rem .7rem;font-size:.82rem}
form button[type=submit]{margin-top:1.3rem}
.sep{border:0;border-top:1px solid var(--line);margin:1.15rem 0}
.run-actions{display:flex;gap:.6rem;flex-wrap:wrap}
.run-actions form{margin:0}
.run-actions button[type=submit]{margin-top:0}
.field-row{display:flex;gap:.7rem;flex-wrap:wrap;align-items:flex-end}
.field-row label{flex:1 1 150px;margin:.9rem 0 0}

/* ---------- tables ---------- */
.tbl-wrap{border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.tbl-wrap.scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.tbl{width:100%;border-collapse:collapse;font-size:.9rem;background:var(--surface)}
.tbl th,.tbl td{text-align:left;padding:.6rem .7rem;border-bottom:1px solid var(--line);white-space:nowrap}
.tbl thead th{color:var(--muted);font-weight:500;font-size:.74rem;text-transform:uppercase;letter-spacing:.05em;background:var(--bg-soft)}
.tbl tbody tr{transition:background .1s}
.tbl tbody tr:hover{background:var(--surface-2)}
.tbl tbody tr:last-child td{border-bottom:0}
.tbl .num{text-align:right;font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1}
.tbl .empty td{color:var(--muted);text-align:center;padding:1.6rem;white-space:normal}
/* customer-first tables (new/returning/churned/acq list): let the Customer column absorb
   the slack so Rep / $ / date columns hug the right together instead of floating apart */
.tbl-fill td:first-child,.tbl-fill th:first-child{width:100%}
.linkish{color:var(--accent-2);text-decoration:none;font-weight:500}
.linkish:hover{text-decoration:underline}
.filechip{display:inline-flex;align-items:center;gap:.35rem;font-size:.8rem;color:var(--ink-2);background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:.2rem .6rem;text-decoration:none;transition:border-color .12s,color .12s}
.filechip:hover{border-color:var(--line-2);color:var(--ink)}
.filechip svg{opacity:.7}

/* ---------- section tabs ---------- */
.tabs{display:flex;gap:.25rem;flex-wrap:wrap;margin:0 0 1.7rem;padding:.3rem;background:var(--surface-2);border:1px solid var(--line);border-radius:12px}
.tab{display:inline-flex;align-items:center;background:transparent;color:var(--muted);border:0;border-radius:9px;padding:.5rem .95rem;font:inherit;font-weight:600;font-size:.88rem;cursor:pointer;transition:color .12s,background .12s}
.tab:hover{color:var(--ink);opacity:1}
.tab.active{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}
.tab .cnt{margin-left:.45rem;font-size:.76rem;font-weight:600;color:var(--muted-2);background:var(--bg-soft);border-radius:999px;padding:.02rem .4rem}
.tab.active .cnt{color:var(--accent-2);background:var(--accent-soft)}
.tabpanel[hidden]{display:none}
.tabpanel .panel-title-lg{margin-top:0}

.week-banner{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-bottom:1.2rem}

/* ---------- carrier chips (brand-tinted, no external logo fetches) ---------- */
.carrier-chips{display:flex;flex-wrap:wrap;gap:.45rem;margin-top:.55rem}
.carrier-chip{display:inline-flex;align-items:center;gap:.42rem;font-size:.86rem;font-weight:600;padding:.34rem .7rem;border-radius:9px;border:1px solid var(--line);background:var(--surface-2);color:var(--ink-2)}
.carrier-chip b{font-weight:700;color:var(--ink)}
.carrier-chip.ups{color:#f5b942;background:rgba(245,185,66,.12);border-color:rgba(245,185,66,.25)}
.carrier-chip.ups b{color:#f5b942}
.carrier-chip.fedex{color:#9d7bea;background:rgba(125,80,220,.14);border-color:rgba(125,80,220,.3)}
.carrier-chip.fedex b{color:#9d7bea}
.carrier-chip.usps{color:#7ba3f5;background:rgba(91,141,239,.13);border-color:rgba(91,141,239,.28)}
.carrier-chip.usps b{color:#7ba3f5}
.carrier-chip.dhl{color:#e6c04a;background:rgba(230,192,74,.12);border-color:rgba(230,192,74,.25)}
.carrier-chip.dhl b{color:#e6c04a}
:root[data-theme="light"] .carrier-chip.ups{color:#6b4a12;background:rgba(245,185,66,.18)}
:root[data-theme="light"] .carrier-chip.ups b{color:#6b4a12}
:root[data-theme="light"] .carrier-chip.fedex{color:#4d148c;background:rgba(77,20,140,.1)}
:root[data-theme="light"] .carrier-chip.fedex b{color:#4d148c}
:root[data-theme="light"] .carrier-chip.usps{color:#264f9e;background:rgba(38,79,158,.1)}
:root[data-theme="light"] .carrier-chip.usps b{color:#264f9e}

/* ---------- KPI foot (delta chip + clean YTD sub-metric) ---------- */
.kpi-ytd{font-size:.8rem;color:var(--muted)}
.kpi-ytd b{color:var(--ink-2);font-weight:600}

/* ---------- interactive datatables ---------- */
.dt{margin-bottom:1rem}
.dt-controls{display:flex;gap:.55rem;flex-wrap:wrap;align-items:center;margin-bottom:.75rem}
.dt-search{width:auto;min-width:210px;flex:0 1 260px;margin-top:0;padding:.5rem .7rem;font-size:.88rem}
.dt-filter,.dt-sort{width:auto;margin-top:0;padding:.5rem 1.8rem .5rem .7rem;font-size:.85rem;color:var(--ink-2)}
.dt-sort{font-weight:600}
.dt th.dt-sortable{cursor:pointer;user-select:none;white-space:nowrap}
.dt th.dt-sortable:hover{color:var(--ink)}
.dt th.dt-sortable::after{content:"";margin-left:.3rem;font-size:.7em}
.dt th.sorted-asc::after{content:"\25B2";opacity:.95;font-size:.7em}
.dt th.sorted-desc::after{content:"\25BC";opacity:.95;font-size:.7em}
.dt-foot{display:flex;align-items:center;gap:.9rem;margin-top:.7rem}
.dt-count{margin-left:auto}
.sev{display:inline-flex;align-items:center;gap:.35rem;font-size:.74rem;font-weight:600;padding:.12rem .5rem;border-radius:999px;text-transform:capitalize}
.sev::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.sev-high{color:var(--err);background:var(--err-soft)}
.sev-medium{color:#e0823b;background:rgba(224,130,59,.15)}
.sev-low{color:var(--warn);background:var(--warn-soft)}
.flag-yes{color:var(--warn);font-weight:600}
.grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:1.1rem}
.subtle-head{font-size:.82rem;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin:0 0 .6rem}

/* ---------- status pills ---------- */
.pill{display:inline-flex;align-items:center;gap:.4rem;font-size:.76rem;padding:.16rem .58rem;border-radius:999px;background:var(--surface-2);color:var(--muted);font-weight:500;text-transform:capitalize}
.pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
/* state classes are namespaced st-*: a bare .error here collided with the alert-box
   .error rule below, which sits later in the file and set padding/border/font-size the
   pill never declared, so error pills rendered as bordered boxes twice the size of the
   success ones. Do not rename these back to bare status words. */
.pill.st-success{background:var(--ok-soft);color:var(--ok)}
.pill.st-error{background:var(--err-soft);color:var(--err)}
.pill.st-running,.pill.st-queued{background:var(--warn-soft);color:var(--warn)}

/* ---------- alerts / log ---------- */
.error{color:var(--err);background:var(--err-soft);border:1px solid rgba(226,109,109,.28);padding:.65rem .85rem;border-radius:var(--radius-xs);margin:.7rem 0;font-size:.9rem}
/* run page: same visual weight as the success branch's output path (pill + one line) */
.run-failed{color:var(--err);font-size:.9rem;margin:.6rem 0 0}
/* shown only on phones, on the two pages that ship the whole catalogue */
.mobile-note{display:none}
.warn{color:var(--warn);background:var(--warn-soft);border:1px solid rgba(216,180,90,.26);padding:.75rem .9rem;border-radius:var(--radius-xs);margin:.8rem 0;font-size:.9rem}
.log{background:#060607;color:#c7d0dc;border:1px solid var(--line);padding:1rem;border-radius:var(--radius-sm);max-height:360px;overflow:auto;font:12px/1.6 ui-monospace,"Cascadia Code",Consolas,monospace;white-space:pre-wrap;margin-top:1rem}

/* ---------- login ---------- */
.login-mark{display:grid;place-items:center;width:56px;height:56px;margin:0 auto .9rem}
.card.narrow h1{text-align:center;font-size:1.3rem;margin-bottom:.3rem}
.card.narrow .sub{text-align:center;color:var(--muted);font-size:.9rem;margin-bottom:.6rem}
.card.narrow button{width:100%;justify-content:center}

/* ---------- chart carousel ---------- */
.chart-carousel .panel-head{align-items:center}
.cc-nav{display:flex;align-items:center;gap:.5rem}
.cc-btn{width:30px;height:30px;padding:0;display:grid;place-items:center;background:var(--surface-2);border:1px solid var(--line);border-radius:8px;color:var(--muted);cursor:pointer;transition:color .12s,border-color .12s}
.cc-btn:hover{color:var(--ink);border-color:var(--line-2);opacity:1}
.cc-dots{display:inline-flex;gap:.35rem;margin:0 .15rem}
.cc-dot{width:6px;height:6px;border-radius:50%;background:var(--line-2);transition:background .12s}
.cc-dot.active{background:var(--accent)}
.cc-slide[hidden]{display:none}
.seg{display:inline-flex;background:var(--surface-2);border:1px solid var(--line);border-radius:9px;padding:.2rem}
.seg-btn{background:transparent;color:var(--muted);border:0;border-radius:7px;padding:.34rem .7rem;font:inherit;font-weight:600;font-size:.82rem;cursor:pointer;transition:color .12s,background .12s}
.seg-btn:hover{color:var(--ink);opacity:1}
.seg-btn.active{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}
.acq-chart[hidden]{display:none}
/* .panel carries no padding of its own (only .panel-head does), so these two trailed off the
   panel's left edge while everything above them was inset. Match the header's inset. */
.acq-hint{padding:0 1.4rem}
.acq-list{padding:.1rem 1.4rem 1.25rem}
.acq-list[hidden]{display:none}
.acq-list .tbl-wrap{margin-top:.1rem}

/* ---------- weekly / monthly cadence ---------- */
/* show only the blocks tagged for the active timeframe. data-cadence takes a SPACE-SEPARATED
   list (e.g. data-cadence="week wtd") so a block can serve more than one timeframe. */
/* One line per timeframe. A value missing here hides NOTHING, so every timeframe's KPIs and
   subtitle render stacked on top of each other - that is exactly what happened when "custom"
   was added to the dropdown and not to this list. Add a line whenever a cadence is added. */
[data-cad="week"]   [data-cadence]:not([data-cadence~="week"]),
[data-cad="month"]  [data-cadence]:not([data-cadence~="month"]),
[data-cad="day"]    [data-cadence]:not([data-cadence~="day"]),
[data-cad="wtd"]    [data-cadence]:not([data-cadence~="wtd"]),
[data-cad="mtd"]    [data-cadence]:not([data-cadence~="mtd"]),
[data-cad="custom"] [data-cadence]:not([data-cadence~="custom"]){display:none}
.tabs .cad-select{margin-left:auto;width:auto;margin-top:0;align-self:center;padding:.42rem 2rem .42rem .8rem;font-size:.85rem;font-weight:600;color:var(--ink-2)}
.dl-select{width:auto;margin-top:0;padding:.42rem 2rem .42rem .8rem;font-size:.85rem;font-weight:600;color:var(--ink-2)}
.cad-toggle .cad-btn{min-width:64px;text-align:center}
.cad-lbl{font-size:.78rem;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}

/* ---------- dashboard alerts ---------- */
.alerts{display:flex;gap:.7rem;flex-wrap:wrap;margin-bottom:1.3rem}
.alert{display:flex;flex-direction:column;gap:.1rem;padding:.6rem .9rem;border-radius:var(--radius-xs);border:1px solid transparent;text-decoration:none;min-width:210px;transition:transform .06s,opacity .12s}
.alert:hover{opacity:.9}
.alert:active{transform:translateY(1px)}
.alert-title{font-weight:600;font-size:.9rem}
.alert .alert-detail{opacity:.85}
.alert-err{background:var(--err-soft);color:var(--err)}
.alert-warn{background:var(--warn-soft);color:var(--warn)}
.alert-err .alert-detail,.alert-warn .alert-detail{color:inherit}

/* ---------- clickable rows ---------- */
.rowlink{cursor:pointer}
tbody tr.rowlink:hover{background:var(--surface-3)}

/* ---------- modal + customer detail ---------- */
.modal{position:fixed;inset:0;z-index:50;display:flex;align-items:flex-start;justify-content:center;padding:6vh 1rem 2rem;background:rgba(5,5,7,.62);backdrop-filter:blur(3px);overflow:auto}
.modal[hidden]{display:none}
.modal-card{position:relative;width:100%;max-width:660px;background:var(--surface);border:1px solid var(--line-2);border-radius:var(--radius);box-shadow:0 24px 60px -24px rgba(0,0,0,.8);padding:1.6rem 1.7rem}
.modal-close{position:absolute;top:.75rem;right:.75rem;width:32px;height:32px;padding:0;display:grid;place-items:center;background:var(--surface-2);border:1px solid var(--line);border-radius:8px;color:var(--muted);font-size:1.25rem;line-height:1;cursor:pointer}
.modal-close:hover{color:var(--ink);opacity:1}
.cd-name{font-size:1.2rem;margin:0 0 .55rem;padding-right:2.2rem;letter-spacing:-.02em}
.cd-traits{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;margin-top:.15rem}
.trait{display:inline-flex;align-items:center;gap:.35rem;font-size:.78rem;font-weight:500;color:var(--ink-2);background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:.18rem .65rem;line-height:1.4}
.trait-k{color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.04em}
.trait-warn{color:var(--warn);background:var(--warn-soft);border-color:transparent}
.trait-ok{color:var(--ok);background:var(--ok-soft);border-color:transparent}
.cd-phone{display:flex;align-items:center;gap:.4rem;margin-top:1.1rem}
.cd-phone-num{font-size:1.75rem;font-weight:700;letter-spacing:-.02em;color:var(--ink);text-decoration:none;line-height:1.1}
.cd-phone-num:hover{color:var(--accent-2)}
.cd-copy{display:grid;place-items:center;width:38px;height:38px;padding:0;background:transparent;border:1px solid var(--line);border-radius:9px;color:var(--muted);cursor:pointer;transition:color .12s,border-color .12s,background .12s}
.cd-copy:hover{color:var(--ink);border-color:var(--line-2);background:var(--surface-2);opacity:1}
.cd-copy .i-check{display:none}
.cd-copy.copied{color:var(--ok);border-color:var(--ok)}
.cd-copy.copied .i-copy{display:none}
.cd-copy.copied .i-check{display:block}
.cd-copy.copy-failed{color:var(--err);border-color:var(--err)}
.cd-contact{margin:.4rem 0 0}
.cd-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:.6rem;margin-top:1.25rem}
.cd-gm{display:flex;align-items:baseline;gap:.6rem;flex-wrap:wrap;margin-top:.9rem;padding:.7rem .9rem;background:var(--accent-soft);border:1px solid transparent;border-radius:12px}
.cd-gm-l{font-size:.72rem;text-transform:uppercase;letter-spacing:.04em;color:var(--accent-2);font-weight:600}
.cd-gm-v{font-size:1.35rem;font-weight:700;letter-spacing:-.02em;color:var(--ink)}
.cd-gm-sub{margin-left:auto}
.cd-section{margin-top:1.4rem}
.cd-chart{margin-top:.1rem}
.cd-chart .plotly-graph-div{width:100%!important}
.cd-week-invoices{margin-top:.7rem}
.cd-week-invoices[hidden]{display:none}
.wk-inv{background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-xs);padding:.65rem .8rem}
.wk-inv-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:.35rem}
.wk-inv-title{font-size:.82rem;font-weight:600;color:var(--ink-2)}
.wk-inv-close{width:24px;height:24px;padding:0;display:grid;place-items:center;background:transparent;border:1px solid var(--line);border-radius:6px;color:var(--muted);font-size:1.05rem;line-height:1;cursor:pointer}
.wk-inv-close:hover{color:var(--ink);opacity:1}
.wk-inv .tbl{background:transparent}
.tbl.compact th,.tbl.compact td{padding:.34rem .55rem;font-size:.84rem;white-space:nowrap}
.tbl.compact tfoot td{border-top:1px solid var(--line-2);border-bottom:0;color:var(--ink)}
.cd-year-l{white-space:nowrap;display:flex;align-items:center;gap:.3rem}
.cd-ytd-tag{font-size:.62rem;font-weight:600;color:var(--accent-2);background:var(--accent-soft);border-radius:4px;padding:.05rem .3rem;letter-spacing:.03em}
.cd-stat{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:.6rem .75rem;display:flex;flex-direction:column;gap:.25rem}
.cd-l{font-size:.71rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.cd-v{font-size:1.05rem;font-weight:700;letter-spacing:-.02em}
.cd-spark{margin-top:.2rem}
.spark{display:block}
.cd-spark-x{display:flex;justify-content:space-between;margin-top:.1rem}
.cd-years{display:flex;flex-direction:column;gap:.42rem}
.cd-year{display:grid;grid-template-columns:76px 1fr 88px;align-items:center;gap:.7rem}
.cd-year-l{font-size:.82rem;color:var(--muted)}
.cd-year-bar{height:8px;background:var(--surface-3);border-radius:4px;overflow:hidden}
.cd-year-bar span{display:block;height:100%;background:linear-gradient(90deg,var(--accent-2),var(--accent));border-radius:4px}
.cd-year-v{font-size:.82rem;text-align:right;color:var(--ink-2);font-variant-numeric:tabular-nums}
.cd-flag{margin-top:1rem}
.cd-empty{padding:1rem}

/* ---------- QBWC bridge status widget (header) ---------- */
.qbwc-wrap{position:relative}
.qbwc-chip{display:inline-flex;align-items:center;gap:.42rem;background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:.32rem .7rem;font-size:.78rem;font-weight:600;color:var(--muted);cursor:pointer;font-family:inherit}
.qbwc-chip:hover{color:var(--ink);border-color:var(--line-2)}
.qdot{width:7px;height:7px;border-radius:50%;background:var(--muted-2);flex:0 0 auto}
.qdot-ok{background:var(--ok)}
.qdot-warn{background:var(--warn)}
.qdot-err{background:var(--err)}
.qbwc-pop{position:absolute;right:0;top:calc(100% + .55rem);width:272px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:.9rem 1rem;z-index:60}
.qbwc-sec+.qbwc-sec{margin-top:.75rem;padding-top:.75rem;border-top:1px solid var(--line)}
.qbwc-title{display:flex;align-items:center;gap:.45rem;font-size:.8rem;font-weight:700;color:var(--ink);margin-bottom:.35rem}
.qbwc-row{display:flex;justify-content:space-between;gap:.8rem;font-size:.78rem;color:var(--muted);padding:.12rem 0}
.qbwc-row b{color:var(--ink-2);font-weight:600;text-align:right;font-variant-numeric:tabular-nums}
/* the bridge is answering polls but QuickBooks is handing back nothing - the state the old
   chip reported as healthy */
.qbwc-row.qbwc-bad,.qbwc-row.qbwc-bad b{color:var(--err)}
.qbwc-row.qbwc-bad b{font-weight:600;max-width:15rem}
.qbwc-row.qbwc-warn,.qbwc-row.qbwc-warn b{color:var(--warn)}
.qbwc-row.qbwc-warn b{font-weight:600;max-width:15rem}
.qbwc-note{margin-top:.65rem;font-size:.7rem;color:var(--muted-2);line-height:1.4}

/* one-and-done toggle on the retention KPI */
a.ood-toggle{text-decoration:none;cursor:pointer}
a.ood-toggle:hover{color:var(--ink);text-decoration:underline}

/* first-login "set your password" gate */
.pw-gate{position:fixed;inset:0;background:rgba(0,0,0,.55);backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;z-index:200;padding:1rem}
.pw-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:1.6rem 1.7rem;width:100%;max-width:380px}
.pw-card h2{margin:0 0 .35rem;font-size:1.15rem}
.pw-form{display:flex;flex-direction:column;gap:.7rem;margin-top:1rem}
.pw-form label{display:flex;flex-direction:column;gap:.3rem;font-size:.82rem;color:var(--muted)}
.pw-form input{width:100%;margin-top:0}
.pw-form button{margin-top:.4rem}

/* light-theme surface tweaks (tokens above handle most of it) */
:root[data-theme="light"] body{background-image:radial-gradient(1100px 560px at 50% -280px,rgba(79,127,230,.07),transparent 70%)}
:root[data-theme="light"] header{background:rgba(246,247,249,.82)}
:root[data-theme="light"] .log{background:#0e0f13;color:#c7d0dc;border-color:#23242b}

/* ---------- custom date range (Sales Performance) ----------
   Lives inside the tab bar next to the timeframe dropdown and is revealed only when
   "Custom dates" is picked, so the default page carries no extra chrome. */
/* Sits in the tab bar beside the timeframe dropdown. Everything on this row - the two date
   fields, the "to", the Apply button and the dropdown itself - shares one height and one
   centre line, so it reads as a single control strip. */
.range-mini{display:flex;align-items:center;gap:.4rem;margin-left:.5rem;align-self:center}
.range-mini[hidden]{display:none}
.range-mini input[type=date]{width:auto;margin-top:0;height:34px;padding:0 .5rem;
  font-size:.82rem;color:var(--ink-2);background:var(--surface);border-radius:8px;
  border:1px solid var(--line)}
.range-dash{color:var(--muted);font-size:.8rem;line-height:1}
/* the global `form button[type=submit]{margin-top:1.3rem}` (for stacked forms) pushed Apply
   ~21px below the date fields; this row is inline, so zero it */
.range-mini .btn,.range-mini button[type=submit]{height:34px;padding:0 .8rem;font-size:.82rem;
  min-height:0;margin:0}

/* ---------- responsive ---------- */
/* Hidden on desktop; both are mobile-only affordances. The seven top-level nav links
   wrap to seven rows on a phone, and the header is sticky, so without a drawer the
   nav alone eats ~390px of an 812px screen before any data is visible. */
.nav-toggle{display:none}
.nav-acct{display:none}

/* Laptops: the seven links need ~722px but only get ~663px at 1280, so the nav wraps to a
   second row and the header grows to 94px. Tightening them (and dropping the wordmark's
   second word) keeps it one row down to ~1130px, where the drawer takes over. */
@media(min-width:1101px) and (max-width:1300px){
  header{gap:1rem}
  header>nav{gap:.15rem}
  header>nav a{padding:.34rem .4rem;font-size:.82rem}
  .brand-name span{display:none}
}

@media(max-width:1100px){
  header{gap:.7rem;padding:.55rem 1rem}
  .nav-toggle{
    display:grid;place-items:center;width:40px;height:40px;padding:0;
    background:var(--surface-2);border:1px solid var(--line);border-radius:9px;
    color:var(--muted);cursor:pointer;transition:color .12s,border-color .12s;
  }
  .nav-toggle:hover{color:var(--ink);border-color:var(--line-2);opacity:1}
  .nav-toggle .i-close{display:none}
  header.nav-open .nav-toggle .i-close{display:block}
  header.nav-open .nav-toggle .i-menu{display:none}
  /* direct child only - .tabs is also a <nav>, inside main */
  header>nav{
    position:absolute;top:100%;left:0;right:0;
    display:none;flex-direction:column;align-items:stretch;gap:.12rem;
    margin:0;padding:.5rem .8rem .85rem;
    background:var(--surface);border-bottom:1px solid var(--line);
    box-shadow:0 20px 44px -22px rgba(0,0,0,.8);
    max-height:calc(100vh - 3.6rem);overflow-y:auto;
  }
  header.nav-open>nav{display:flex}
  header>nav a{
    display:flex;align-items:center;min-height:44px;
    padding:.55rem .7rem;font-size:.95rem;border-radius:9px;
  }
  /* account links live in the drawer on mobile, in the header bar on desktop */
  .nav-acct{
    display:flex;flex-direction:column;gap:.12rem;
    margin-top:.45rem;padding-top:.5rem;border-top:1px solid var(--line);
  }
  .header-right .who,.header-right .nav-logout{display:none}
  .header-right{gap:.45rem;flex:0 0 auto}
  /* the wordmark is nowrap and 217px wide, which alone overflows a 375px row next to
     the controls - let it shrink, and drop the "Reporting" half on the narrowest screens */
  .brand{min-width:0;flex:0 1 auto;overflow:hidden}
  .brand-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .qbwc-chip{height:40px;padding:.32rem .8rem}
  .theme-toggle{width:40px;height:40px}
  .qbwc-pop{max-width:calc(100vw - 1.6rem)}

  /* iOS Safari zooms the whole page in when you focus a field smaller than 16px, and does
     not zoom back out. Applies to the login/password fields and the table search boxes. */
  input,select,textarea,
  .dt-search,.dt-filter,.dt-sort,.dl-select,.range-mini input[type=date],
  .tabs .cad-select{font-size:16px}   /* .tabs .cad-select is (0,2,0); a bare class loses */

  /* the pickers get their own row under the tabs rather than squeezing in. A date input has
     a wide intrinsic size at 16px, so the two of them plus the button overflow a 375px row -
     let them shrink (min-width:0), drop the "to", and give the button its own line. */
  .range-mini{order:10;flex:1 1 100%;margin-left:0;margin-top:.35rem;flex-wrap:wrap;gap:.35rem}
  /* the desktop row is 34px; on touch these have to reach the same 40px as everything else */
  .range-mini input[type=date]{flex:1 1 calc(50% - .2rem);min-width:0;width:auto;height:40px}
  .range-mini .btn,.range-mini button[type=submit]{height:40px}
  .range-dash{display:none}
  .range-mini .btn{flex:1 1 100%}

  /* Touch targets: everything tappable reaches ~40px. This sits at the drawer breakpoint,
     not the phone one, because a tablet showing the hamburger is a touch device too. */
  .btn.sm,.dt-export,.dt-more{min-height:40px;padding-left:.85rem;padding-right:.85rem}
  .cc-btn,.acq-prev,.acq-next{width:40px;height:40px}
  .filechip{min-height:40px;display:inline-flex;align-items:center}
  .linkish{display:inline-flex;align-items:center;min-height:40px}
  .chk{min-height:40px;padding:.3rem 0}   /* keep the 0 left inset from the base rule */
  .chk input[type="checkbox"]{width:18px;height:18px;flex-basis:18px}
  .seg-btn{min-height:38px}
}

@media(max-width:640px){
  main{margin-top:1.4rem;margin-bottom:3rem;padding:0 1rem}
  h1{font-size:1.4rem}
  .brand-name span{display:none}          /* "C Store Depot" is enough on a phone */
  .page-head{gap:.75rem;margin-bottom:1.15rem}
  .page-head .eyebrow{display:none}       /* the h1 already says where you are */
  .mobile-note{display:block;margin:.45rem 0 0;font-size:.82rem;color:var(--muted)}
  .page-head .row{width:100%}
  .page-head .row .btn{flex:1 1 auto;justify-content:center;text-align:center}
  .page-head .refresh-box{width:100%;align-items:stretch}
  .page-head .refresh-box form{display:flex}
  .page-head .refresh-box .btn{flex:1 1 auto;justify-content:center;text-align:center}
  .page-head .refresh-asof{text-align:center}

  /* two tiles per row: one-up turns five KPIs into five full-width cards */
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem;margin-bottom:1rem}
  .kpi{padding:.8rem .85rem}
  .kpi-val{font-size:1.3rem}
  .kpi-lbl{font-size:.72rem;letter-spacing:.04em}
  .kpi-foot,.kpi-ytd{font-size:.75rem}

  /* the four tabs fit one row once the timeframe select drops to its own full-width row */
  .tabs{gap:.15rem;padding:.25rem;margin-bottom:1.2rem}
  .tab{padding:.5rem .42rem;font-size:.8rem;min-height:40px;gap:.3rem}
  .tab .cnt{padding:.05rem .3rem;font-size:.68rem}
  .tabs .cad-select{order:9;width:100%;margin-left:0;margin-top:.3rem;min-height:42px}

  /* three stacked alert cards pushed the headline numbers below the fold */
  .alerts{gap:.4rem;margin-bottom:.9rem}
  .alert{min-width:0;flex:1 1 100%;flex-direction:row;align-items:baseline;
         gap:.45rem;padding:.5rem .7rem}
  .alert-title{font-size:.85rem}
  .alert .alert-detail{font-size:.78rem;margin-left:auto;text-align:right}

  .panel-head{padding:.95rem 1rem .2rem;gap:.6rem}
  .acq-hint{padding:0 1rem}
  .acq-list{padding:.1rem 1rem 1rem}
  .tbl th,.tbl td{padding:.5rem .55rem;font-size:.85rem}
  .sev{font-size:.75rem}
  .detail{font-size:.8rem;padding:.3rem .7rem}
  .grid-2{gap:.8rem}
  .dt-search{min-width:0;flex:1 1 100%}
  .dt-filter,.dt-sort{flex:1 1 45%;min-height:40px}

  .modal{padding:3vh .6rem 1.5rem}
  .modal-card{padding:1.25rem 1rem}
  .cd-stats{grid-template-columns:repeat(2,1fr)}

}

/* ---------- print ----------
   Tamara prints the call sheets, and the screen layout is wrong on paper: the site chrome
   comes along, the theme's ink can be white-on-white once the printer drops backgrounds, and
   a paginated table prints only the rows currently on screen (15 of 51 on the At-Risk sheet).
   Landscape by default because these tables are wide. */
@media print{
  @page{size:landscape;margin:11mm 9mm}

  /* black ink on white whatever theme the browser is in */
  :root,:root[data-theme="dark"],:root[data-theme="light"]{
    --bg:#fff; --bg-soft:#fff; --surface:#fff; --surface-2:#fff; --surface-3:#fff;
    --line:#b9bcc4; --line-2:#8f949e;
    --ink:#000; --ink-2:#1b1d23; --muted:#474a52; --muted-2:#5b5f68;
    --accent:#1b47a8; --accent-2:#1b47a8; --accent-soft:transparent;
    --shadow:none;
  }
  html,body{background:#fff!important;color:#000!important}
  body{background-image:none!important;font-size:11px}
  main{max-width:none;margin:0;padding:0}

  /* nothing you can click belongs on paper */
  header,.pw-gate,.modal,.tabs,.dt-controls,.dt-foot,.theme-toggle,.nav-toggle,
  .qbwc-wrap,.cc-nav,.cc-dots,.acq-nav,.run-actions,button,select,input,form{display:none!important}

  .card,.panel,.kpi,.tbl-wrap{box-shadow:none!important;border-radius:0!important}
  .tbl-wrap,.tbl-wrap.scroll{overflow:visible!important;max-height:none!important;border:0!important}

  /* the point of all this: print every row the current filters keep, not just the visible page.
     Paged-off rows carry an inline display:none, which only !important can beat. */
  .dt tbody tr:not(.dt-filtered-out){display:table-row!important}
  thead{display:table-header-group}                 /* repeat the header on every sheet */
  tr,.kpi,.card,.js-plotly-plot{break-inside:avoid;page-break-inside:avoid}
  .tbl th{border-bottom:1px solid #000}
  .tbl th,.tbl td{padding:.26rem .4rem}
  .rowlink{cursor:auto}

  /* the severity pill is a background colour on screen; printers drop those, so outline it */
  .sev{background:none!important;border:1px solid currentColor;padding:0 .3rem}

  .js-plotly-plot,.js-plotly-plot .main-svg{max-width:100%!important}
  [hidden]{display:none!important}                  /* you print the tab you are looking at */
  a{text-decoration:none}
}

/* ---------- nav dropdown (report families, e.g. Gopuff) ---------- */
.nav-drop{position:relative;display:inline-flex}
.nav-drop-btn{display:inline-flex;align-items:center;gap:.35rem;background:transparent;border:0;color:var(--muted);font:inherit;font-size:.88rem;font-weight:500;padding:.34rem .6rem;border-radius:8px;cursor:pointer;transition:color .12s,background .12s}
.nav-drop-btn:hover,.nav-drop.open .nav-drop-btn{color:var(--ink);background:var(--surface-2);opacity:1}
.nav-drop-btn.active{color:var(--ink);background:var(--surface-2)}
.nav-drop-btn .car{width:0;height:0;border-left:3.5px solid transparent;border-right:3.5px solid transparent;border-top:4.5px solid currentColor;opacity:.65}
.nav-drop-menu{position:absolute;top:calc(100% + 8px);left:0;min-width:210px;display:none;flex-direction:column;gap:.1rem;background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);padding:.35rem;z-index:30}
.nav-drop.open .nav-drop-menu{display:flex}
.nav-drop-menu a{display:block;white-space:nowrap;padding:.45rem .7rem;border-radius:7px}
@media(hover:hover) and (min-width:1101px){
  .nav-drop:hover .nav-drop-menu{display:flex}
  .nav-drop:hover .nav-drop-btn{color:var(--ink);background:var(--surface-2)}
}
@media(min-width:1101px) and (max-width:1300px){
  .nav-drop-btn{padding:.34rem .4rem;font-size:.82rem}
}
@media(max-width:1100px){
  .nav-drop{width:100%;flex-direction:column}
  .nav-drop-btn{min-height:44px;padding:.55rem .7rem;font-size:.95rem;border-radius:9px;justify-content:flex-start}
  .nav-drop-menu{position:static;box-shadow:none;border:0;background:transparent;padding:0 0 0 1rem;min-width:0}
}

/* ---------- alignment contract (2026-08-14) ----------
   Two legal table compositions and nothing else:
   BOXED  - .card/.panel padding > .tbl-wrap (bordered) > .tbl ; cells keep .6/.7rem.
   FLUSH  - .panel > .tbl running edge to edge; the first/last cells carry the panel's
            rail so the title, sub, and table content share ONE grid line.
   The rail matches .panel-head: 1.4rem, 1rem under 640px. Direct-child selectors mean
   BOXED tables cannot pick these up. */
:root{--rail:1.4rem}
@media(max-width:640px){:root{--rail:1rem}}
.panel>.tbl>thead>tr>th:first-child,.panel>.tbl>tbody>tr>td:first-child{padding-left:var(--rail)}
.panel>.tbl>thead>tr>th:last-child,.panel>.tbl>tbody>tr>td:last-child{padding-right:var(--rail)}
/* status chips and buttons are single-line objects; wrapping mid-text is never right */
.pill{white-space:nowrap}
button,.btn{white-space:nowrap}
/* the stacked-form submit offset (form button[type=submit]{margin-top:1.3rem}) is for
   label-over-field forms; inline rows must not inherit it */
.panel-head button[type=submit],.row button[type=submit]{margin-top:0}


/* ---------- site-wide downtime banner -------------------------------------
   Text comes from portaldata/site_banner.txt; absent/empty file = no banner.
   Namespaced per the alignment contract: a bare .warn here would collide with
   the full-width notice box and inherit its padding/border/margin. */
.sitebanner{display:flex;align-items:flex-start;gap:.55rem;
  padding:.7rem 1.4rem;font-size:.92rem;line-height:1.45;
  background:#6d3f06;color:#ffe6bd;border-bottom:1px solid #9a6414}
.sitebanner svg{flex:0 0 auto;margin-top:.15rem;opacity:.9}
.sitebanner b{color:#fff}
:root[data-theme="light"] .sitebanner{background:#fff3d4;color:#59390a;
  border-bottom-color:#e2ba66}
@media (max-width:640px){.sitebanner{padding:.65rem 1rem;font-size:.86rem}}
/* ---------- report builder (appended to style.css; follows the alignment contract:
   BOXED table composition .card > .tbl-wrap > .tbl, trailing spacer column, namespaced
   state classes, no bare status words, buttons and pills never wrap) ---------- */
.rb-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 1100px) { .rb-layout { grid-template-columns: minmax(0, 1fr); } }
.rb-side { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.rb-main { min-width: 0; }
.rb-block { display: flex; flex-direction: column; gap: .55rem; }
.rb-block > label, .rb-block .rb-lbl { font-size: .78rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; opacity: .75; }
.rb-block select, .rb-block input[type=text], .rb-block input[type=date], .rb-block input[type=search] { width: 100%; box-sizing: border-box; }
.rb-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.rb-row > * { margin: 0; }
.rb-row.rb-actions button { margin-top: 0; }
.rb-muted { opacity: .6; font-size: .82em; }
.rb-grain { font-size: .85rem; opacity: .8; margin: 0; }
.rb-lib { max-height: 20rem; overflow: auto; border: 1px solid var(--line, #d9dde3); border-radius: .4rem; padding: .35rem .5rem; }
.rb-lib-group { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .7; padding: .45rem 0 .2rem; }
.rb-lib-item { display: block; padding: .18rem 0; font-size: .9rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-lib-item input { margin-right: .35rem; }
.rb-lib-on { font-weight: 600; }
.rb-sel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.rb-sel-item { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .3rem .5rem; border: 1px solid var(--line, #d9dde3); border-radius: .4rem; font-size: .9rem; }
.rb-sel-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-sel-tools { display: flex; gap: .2rem; flex: none; }
.rb-mini { padding: .1rem .45rem; font-size: .78rem; line-height: 1.4; margin: 0; white-space: nowrap; }
.rb-mini-on { font-weight: 700; }
.rb-filter { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: .35rem; align-items: center; margin-bottom: .4rem; }
.rb-filter select, .rb-filter input { min-width: 0; width: 100%; box-sizing: border-box; margin: 0; }
.rb-filter input:nth-of-type(2) { grid-column: 4; }
@media (max-width: 640px) { .rb-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .rb-filter input:nth-of-type(2) { grid-column: auto; } }
.rb-status { min-height: 1.3rem; font-size: .88rem; margin: 0; }
.rb-status-err { color: var(--err); }
.rb-status-warn { color: var(--warn); }
.rb-status-ok { color: var(--ok); }
.rb-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .8rem; }
.rb-head h2 { margin: 0; }
.rb-count { font-size: .88rem; opacity: .75; white-space: nowrap; }
.rb-table th.num, .rb-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rb-table th, .rb-table td { white-space: nowrap; }
.rb-table th:last-child, .rb-table td:last-child { width: 100%; padding-left: 0; padding-right: 0; }
.rb-table tfoot td { font-weight: 700; border-top: 2px solid var(--line, #d9dde3); }
.rb-table tbody tr:last-child td { padding-bottom: .7rem; }
.rb-store { font-size: .82rem; opacity: .7; margin: 0; }
