/* Global density pass (Batch B): applies css/tokens.css to the shared components. Loaded last, so it wins over
   page CSS. Rules: no card stretching, one-row header band, compact controls and rows, scrolling mobile tabs,
   one-line empty states inside cards. Gradient Band identity (header and table head gradients) is kept. */
body{font-size:var(--fs-md);line-height:var(--lh-body)}
html body{--gut:var(--stack)}

/* ---- chrome ---- */
html body #appbar{height:var(--appbar-h);gap:var(--sp-3)}
html body #demo{flex-wrap:nowrap;min-height:var(--demobar-h);padding:4px var(--page-pad);gap:var(--sp-3);font-size:var(--fs-sm);overflow-x:auto;white-space:nowrap}
html body #demo label{display:inline-flex;align-items:center;gap:6px}
html body #demo select{height:30px;font-size:var(--fs-sm)}
html body #demo .dbtn{min-height:30px;padding:0 10px;font-size:var(--fs-sm)}
#demo .demo-more{position:relative}
#demo .demo-more>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:6px}
#demo .demo-more>summary::-webkit-details-marker{display:none}
#demo .demo-pop{position:fixed;z-index:60;margin-top:6px;display:grid;gap:8px;padding:12px;min-width:240px;background:var(--raised);border:1px solid var(--line);border-radius:var(--r-card);box-shadow:var(--shadow)}
#demo .demo-pop label{justify-content:space-between}
html body #main{padding:var(--page-pad) var(--page-pad) var(--sp-8)}
html body .page{gap:var(--stack)}
html body #nav a,html body #nav .ni{min-height:var(--nav-item-h);padding-top:4px;padding-bottom:4px;font-size:var(--fs-md)}

/* ---- header band: one row, 72px (88 with crumb), never a hero ---- */
html body .crumbs{margin:0 0 var(--sp-1);font-size:var(--fs-sm)}
html body .ph{min-height:var(--hdr-h);padding:var(--sp-3) var(--sp-5);border-radius:var(--r-card);align-items:center;flex-wrap:nowrap;gap:var(--sp-3) var(--sp-5)}
html body .ph .hero-doodle{display:none}
html body .ph .hero-main{gap:var(--sp-3);align-items:center;min-width:0}
html body .ph .hero-ico{width:32px;height:32px;border-radius:var(--r-ctl);flex:none}
html body .ph .hero-ico svg{width:18px;height:18px}
html body .ph .hero-main>div{min-width:0}
html body .ph h1{font-size:var(--fs-2xl);line-height:var(--lh-tight)}
html body .ph .eyebrow{font-size:var(--fs-xs)}
html body .ph .chips{margin-top:4px;gap:6px}
html body .ph .chip{font-size:var(--fs-xs);padding:2px 8px}
html body .ph .ph-r{flex-wrap:nowrap;gap:var(--sp-2)}

/* ---- KPI tiles: content-sized, 64px, more per row ---- */
html body .kpis{grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:var(--sp-3)}
html body .kpi{min-height:var(--kpi-h);padding:var(--sp-2) var(--sp-3);border-radius:var(--r-card);flex-direction:row;align-items:center;gap:var(--sp-3)}
html body .kpi .kpi-ico{width:32px;height:32px;flex:none}
html body .kpi .kpi-v{font-size:var(--fs-kpi);line-height:var(--lh-tight)}
html body .kpi .kpi-l{font-size:var(--fs-xs)}

/* ---- cards: size to content, never stretched to a neighbour ---- */
html body .g-7-5,html body .g-5-7,html body .grid2,html body .grid3,html body .s360-grid,html body .charts3,html body .home-grid{align-items:start}
html body .card,html body .panel,html body .set-card{border-radius:var(--r-card)}
html body .set-card{padding:var(--card-pad)}
html body .set-h{gap:var(--sp-3);margin-bottom:var(--sp-3)}
html body .set-h h2,html body .card h2,html body .panel-t{font-size:var(--fs-lg)}
html body .set-ico{width:32px;height:32px}
html body .card-h,html body .panel-h{min-height:var(--card-head-h);padding:var(--sp-2) var(--card-pad)}
html body .card-b,html body .panel-b{padding:var(--card-pad)}

/* ---- controls ---- */
html body .btn{min-height:var(--ctl-h);padding:0 var(--sp-4);font-size:var(--fs-md);border-radius:var(--r-ctl)}
html body .btn.sm{min-height:var(--ctl-h-sm);padding:0 var(--sp-3);font-size:var(--fs-sm)}
html body .inp{min-height:var(--ctl-h);font-size:var(--fs-md);border-radius:var(--r-ctl)}
html body .sel{min-height:var(--ctl-h);border-radius:var(--r-ctl)}
html body .sel select{height:calc(var(--ctl-h) - 2px);font-size:var(--fs-md)}
html body .ctab,html body .tabs [role=tab]{min-height:var(--tab-h);padding:4px var(--sp-3);font-size:var(--fs-sm);border-radius:var(--r-ctl)}
html body .ctabs,html body .tabs{gap:var(--sp-2)}
html body .fchip,html body .chip{min-height:24px}

/* ---- tables and lists ---- */
html body .tbl th{height:var(--th-h);padding:6px var(--sp-3);font-size:var(--fs-xs)}
html body .tbl td{height:var(--row-h);padding:6px var(--sp-3)}
html body .rows li{min-height:var(--list-row-min);padding-top:var(--sp-2);padding-bottom:var(--sp-2)}

/* ---- empty states inside cards: one line ---- */
html body .card .empty,html body .panel .empty,html body .set-card .empty{grid-auto-flow:column;justify-content:start;justify-items:start;align-items:center;text-align:left;gap:var(--sp-2) var(--sp-3);padding:var(--sp-3) var(--sp-4)}
html body .card .empty h3,html body .panel .empty h3,html body .set-card .empty h3{font-size:var(--fs-md)}
html body .card .empty p,html body .panel .empty p,html body .set-card .empty p{margin:0;font-size:var(--fs-sm)}
html body .card .empty svg,html body .panel .empty svg{width:20px;height:20px}

/* ---- Home hero follows the band ---- */
html body .home-hero{padding:var(--sp-3) var(--sp-5);border-radius:var(--r-card)}

/* ---- mobile: 44px targets, scrolling tab rows, 2-column KPIs, wrapping header ---- */
@media (max-width:767px),(pointer:coarse){
  html body .ph{flex-wrap:wrap;padding:var(--sp-3)}
  html body .ph .ph-r{flex-wrap:wrap;width:100%}
  html body .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  html body .kpi{min-height:56px}
  html body .ctabs,html body .tabs,html body .ws-tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin}
  html body .ctab,html body .tabs [role=tab]{flex:none}
  html body .btn,html body .btn.sm,html body .dbtn,html body .fchip,html body .crumbs a,html body .chk{min-height:44px}
  html body .crumbs a{display:inline-flex;align-items:center}
  html body #nav a{min-height:44px}
}
/* tighter band: eyebrow and subtitle each one short line */
html body .ph{padding:var(--sp-2) var(--sp-5)}
html body .ph .eyebrow{line-height:1.3;margin:0}
html body .ph h1{margin:0}
html body .kpi .kpi-l{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.2}
@media (max-width:767px){
  html body .ph .ph-r{flex-wrap:nowrap;overflow-x:auto}
  html body .ph .ph-r label.sel:has(select[data-ctl=date]){display:none}
  html body .ph h1{font-size:var(--fs-2xl)}
}
/* breadcrumb inside the band */
html body .ph .crumbs{margin:0;font-size:var(--fs-xs);font-weight:700;letter-spacing:.04em;text-transform:uppercase}
html body .ph .crumbs ol{display:flex;flex-wrap:wrap;gap:4px;margin:0;padding:0;list-style:none}
html body .ph .crumbs a,html body .ph .crumbs span{color:rgba(255,255,255,.88)}
html body .ph .crumbs a:focus-visible{outline:2px solid #fff;outline-offset:2px;border-radius:4px}
@media (max-width:767px),(pointer:coarse){html body .ph .crumbs{display:block}html body .ph .crumbs a{min-height:44px}}
/* 44px hit areas on touch: app bar, selects, row links */
@media (max-width:767px),(pointer:coarse){
  html body #appbar .ib,html body #appbar a,html body #appbar button{min-height:44px;min-width:44px}
  html body #appbar .brand{display:inline-flex;align-items:center}
  html body .sel select,html body select.inp{height:44px}
  html body #main td a,html body #main .rows a,html body #main a.nm,html body #main .who a{display:inline-flex;align-items:center;min-height:44px}
}
@media (max-width:767px),(pointer:coarse){
  html body #main button[data-act],html body #main [role=tab],html body #main select{min-height:44px}
  html body #main a[href^="#/"]:not(.kpi):not(.btn):not(.qa):not(.ctab):not(.nav-card):not(.pa-tab):not(.pa-row):not(.pa-back){display:inline-flex;align-items:center;min-height:44px}
}
@media (max-width:767px),(pointer:coarse){html body #main a[href="#"]{display:inline-flex;align-items:center;min-height:44px}}
/* disclosures and status chips are never hidden or truncated (CC2 Batch B must-fix) */
html body .ph-note{margin:calc(var(--sp-2) * -1) 0 0;padding:6px var(--sp-3);font-size:var(--fs-sm);color:var(--ink2);background:var(--sunk);border:1px solid var(--line2);border-radius:var(--r-ctl);white-space:normal}
html body .ph .chips{flex-wrap:wrap}
@media (max-width:767px){html body .ph .eyebrow{display:block}html body .ph .hero-main{align-items:flex-start}}
/* KPI sub-lines are shown (they carry qualifiers like "Opt-in only"); tile still sizes to content */
html body .kpi .kpi-s{display:block;font-size:var(--fs-xs);line-height:1.25;color:var(--mute);-webkit-line-clamp:unset;overflow:visible;margin-top:1px}
/* labels on health tiles wrap instead of being cut */
html body .utile span{white-space:normal;overflow:visible;text-overflow:clip}
/* the date select is a fixed sample day; keep the band on one row below very wide screens */
@media (max-width:1599px){html body .ph .ph-r label.sel:has(select[data-ctl=date]){display:none}}
label.hit{display:inline-flex;align-items:center;justify-content:center}
@media (max-width:767px),(pointer:coarse){html body #main summary{min-height:44px;display:flex;align-items:center}html body label.hit{min-width:44px;min-height:44px}}
html body .utile span:last-child{white-space:normal;overflow:visible;text-overflow:clip}
/* the sample-data label never scrolls out of view in the demo bar (CC2 should-fix on fa0f2f6) */
html body #demo .demo-tag{position:sticky;left:calc(var(--page-pad) * -1);z-index:3;background:var(--sunk);padding:2px 8px 2px 0;box-shadow:8px 0 8px -6px var(--sunk)}
/* 375: chips stay on one scrolling row so the band keeps close to the 64/76 token */
@media (max-width:767px){html body .ph .chips{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}html body .ph .chip{flex:none}html body .ph{gap:var(--sp-2)}}
html body .ph-note .chip-key{display:inline-flex;align-items:center;gap:4px;margin:0 6px 2px 0;padding:1px 8px;border-radius:var(--r-pill);background:var(--raised);border:1px solid var(--line);font-size:var(--fs-xs);font-weight:700;color:var(--ink)}
@media (max-width:767px){html body .rows li{flex-wrap:wrap}html body .rows li .pill{max-width:100%;white-space:normal}}
/* ---- Batch D1 components ---- */
/* plain table headers (no striped gradient): quieter, denser, easier to scan */
html body .tbl thead th,html body .tbl2 thead th{background:var(--sunk);color:var(--ink2);font-weight:700;letter-spacing:.04em;text-transform:uppercase;border-bottom:1px solid var(--line)}
html body .card .tbl thead th:first-child{border-top-left-radius:0}
/* dialogs at the card radius token */
html body .dlg-p{border-radius:var(--r-card)}
/* one visible keyboard focus ring for every interactive element (white on the gradient band) */
html body :focus-visible{outline:2px solid var(--accent) !important;outline-offset:2px !important;box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 22%,transparent)}
html body .ph :focus-visible,html body .home-hero :focus-visible,html body .kiosk-top :focus-visible{outline-color:#fff !important}
html body .sel:focus-within{outline:2px solid var(--accent);outline-offset:2px}
/* ---- Batch D2 ---- */
html body .qitem.q2{grid-template-columns:32px minmax(0,1fr) auto;gap:var(--sp-3);align-items:center;padding:var(--sp-2) 0}
html body .qitem.q2 h3{font-size:var(--fs-md);display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0}
html body .qitem.q2 p{font-size:var(--fs-sm);margin:2px 0 0}
html body .qitem.q2 .q-act{display:flex;gap:6px;align-items:center}
html body details.more{position:relative}
html body details.more>summary{list-style:none;cursor:pointer;min-width:32px;justify-content:center}
html body details.more>summary::-webkit-details-marker{display:none}
html body details.more .more-pop{position:absolute;right:0;top:calc(100% + 4px);z-index:20;display:grid;gap:4px;padding:6px;min-width:150px;background:var(--raised);border:1px solid var(--line);border-radius:var(--r-ctl);box-shadow:var(--shadow)}
html body .pu-row{min-height:var(--row-h-2);padding-block:8px}
html body .tbl td.acts{white-space:nowrap}
html body .ab-site{display:none}
@media (max-width:767px){html body .ab-site{display:inline-flex;min-height:44px;max-width:140px;min-width:0;flex:0 1 auto}html body #appbar:has(.ab-site) .brand{display:none}html body .ab-scope{display:none}html body .ph .ph-r label.sel:has(select[data-ctl=site]){display:none}html body .qitem.q2{grid-template-columns:32px minmax(0,1fr) auto;row-gap:6px;column-gap:10px;align-items:start}html body .qitem.q2 .q-act .btn.primary{display:none}html body .qitem.q2 .q-txt{display:contents}html body .qitem.q2 .qi{grid-row:1;grid-column:1}html body .qitem.q2 h3{grid-row:1;grid-column:2}html body .qitem.q2 .q-act{grid-row:1;grid-column:3}html body .qitem.q2 .q-txt>p{grid-row:2;grid-column:2/4;margin:0}html body .qitem.q2 .q-link{display:inline-flex;align-items:center;min-height:44px}html body .qitem.q2 details.more>summary{min-height:44px;min-width:44px}html body .qitem.q2 .q-kind{display:none}}
html body .checklist>li.pu-row{padding:8px 16px!important}
html body .acts-r{display:flex;gap:6px;justify-content:flex-end;flex-wrap:nowrap}html body .acts-r .btn+.btn{margin-left:0}
html body .utbl .secb{display:flex;flex-direction:row;flex-wrap:nowrap;gap:4px;white-space:nowrap}
html body .qitem.q2 .q-link{color:inherit;text-decoration:none}html body .qitem.q2 .q-link:hover{text-decoration:underline}
/* ---- Batch D3a ---- */
/* a header with one info chip keeps it beside the title, so the band stays at the 72 px token */
@media (min-width:768px){html body .ph .hero-main>div:has(>.chips>.chip:only-child){display:flex;flex-wrap:wrap;align-items:center;column-gap:12px}html body .ph .hero-main>div:has(>.chips>.chip:only-child)>:not(h1):not(.chips){flex-basis:100%}html body .ph .hero-main>div:has(>.chips>.chip:only-child)>.chips{margin:0}}
html body .set-nav{display:flex;align-items:center;gap:var(--sp-3);flex-wrap:wrap}html body .set-nav .set-tabs{flex:1 1 0;min-width:0;margin:0}html body .set-nav .set-q{flex:0 1 300px;margin:0}
html body .set-sel{display:none}html body .set-sticky{display:none}
@media (max-width:767px){html body .set-nav .set-tabs{display:none}html body .set-sel{display:inline-flex;flex:1 1 100%;min-height:44px}html body .set-nav .set-q{flex:1 1 100%}html body .ph .set-pub{display:none}
 html body .set-sticky{display:flex;position:sticky;bottom:0;z-index:5;gap:8px;align-items:center;justify-content:flex-end;padding:8px var(--gut);margin:0 calc(-1 * var(--gut));background:var(--raised);border-top:1px solid var(--line);box-shadow:0 -6px 16px rgba(0,0,0,.08)}html body .set-sticky .muted{margin-right:auto;font-size:var(--fs-sm)}
 html body .mh-grid{grid-template-columns:1fr;gap:6px}html body .mh{grid-template-columns:auto 1fr auto;align-items:center;padding:8px 12px;gap:4px 10px}html body .mh .mh-top{display:contents}html body .mh .mh-ico{grid-row:1/3;width:32px;height:32px}html body .mh .mh-go{grid-column:3;grid-row:1/3}html body .mh b{grid-column:2;font-size:var(--fs-md)}html body .mh .mh-st{grid-column:2}html body .mh small,html body .mh .mh-foot{display:none}
 html body .fam-qa .nav-grid{grid-template-columns:1fr 1fr;gap:8px}html body .fam-qa .nav-card p,html body .fam-qa .nav-card .nc-foot{display:none}html body .fam-qa .nav-card{padding:10px 12px;min-height:44px}}
@media (min-width:768px){html body .set-nav .set-tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin}html body .set-nav .set-tabs .ctab{flex:none}html body .mh-grid{grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}html body .mh{padding:10px 12px;gap:4px}html body .mh-ico{width:32px;height:32px}html body .mh-foot{margin-top:2px;padding-top:6px}}
html body .set-nav{min-width:0;max-width:100%}html body .set-nav>*{min-width:0}
/* Module health: compact rows at every width (icon · name, status, purpose · open), two columns on wide screens */
html body .mh-grid{grid-template-columns:1fr;gap:6px}
@media (min-width:1024px){html body .mh-grid{grid-template-columns:1fr 1fr}}
html body .mh{grid-template-columns:auto minmax(0,1fr) auto;align-items:center;padding:8px 12px;gap:2px 10px}html body .mh:hover{transform:none}
html body .mh .mh-top{display:contents}html body .mh .mh-ico{grid-row:1/4;grid-column:1;width:32px;height:32px}html body .mh .mh-go{grid-column:3;grid-row:1/4}
html body .mh b{grid-column:2;font-size:var(--fs-md)}html body .mh .mh-st{grid-column:2}html body .mh small{grid-column:2;font-size:var(--fs-sm)}html body .mh .mh-foot{display:none}
html body .mh .mh-own{font-weight:600;opacity:.92}
/* ---- View: Tablet / Phone (CC1, 27 Nov) ---- */
/* outer page in Tablet/Phone view: only the demo bar and the device frame */
body.framed>#appbar,body.framed>.shell,body.framed>#tabbar,body.framed #nav,body.framed #main{display:none !important}
#devframe{display:grid;justify-items:center;gap:10px;padding:20px 12px 28px}
#devframe .dev-shell{width:calc(var(--dev-w) + 24px);max-width:calc(100vw - 24px);padding:12px;border-radius:44px;background:#11161f;box-shadow:0 30px 80px -24px rgba(0,0,0,.55),inset 0 0 0 2px #2a3342}
#devframe.dev-tablet .dev-shell{border-radius:32px}
#devframe iframe{display:block;width:var(--dev-w);max-width:100%;height:var(--dev-h);max-height:calc(100vh - 150px);border:0;border-radius:32px;background:var(--bg)}
#devframe.dev-tablet iframe{border-radius:20px}
#devframe .dev-cap{margin:0;font-size:var(--fs-sm);color:var(--ink2);text-align:center}
/* inside the frame the demo bar lives in the outer page */
html.embedded #demo{display:none !important}
/* phone chrome: bottom tab bar, sticky primary action, full-screen sheets */
#tabbar{display:none}
@media (max-width:767px){
 html body #tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:40;justify-content:space-around;gap:2px;padding:4px 4px calc(4px + env(safe-area-inset-bottom));background:var(--raised);border-top:1px solid var(--line);box-shadow:0 -6px 18px rgba(0,0,0,.08)}
 html body #tabbar a,html body #tabbar button{flex:1 1 0;min-width:0;min-height:52px;display:grid;justify-items:center;align-content:center;gap:2px;padding:4px 2px;border:0;background:none;border-radius:12px;color:var(--ink2);font:600 11.5px/1.15 var(--font);text-decoration:none;cursor:pointer}
 html body #tabbar a[aria-current=page]{color:var(--accent);background:var(--accent-soft)}
 html body #tabbar span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 html body{padding-bottom:calc(68px + env(safe-area-inset-bottom))}
 html body.kiosk-mode #tabbar,html body.framed #tabbar{display:none}
 html body .set-sticky{bottom:calc(64px + env(safe-area-inset-bottom))}
 html body #fab{position:fixed;right:14px;bottom:calc(72px + env(safe-area-inset-bottom));z-index:39}html body #fab .btn{min-height:48px;padding:0 18px;border-radius:24px;box-shadow:0 10px 24px -8px rgba(0,0,0,.45)}html body.has-fab{padding-bottom:calc(128px + env(safe-area-inset-bottom))}html body.framed #fab{display:none}
 html body .donut-wrap{grid-template-columns:minmax(0,1fr);justify-items:stretch}html body .donut-wrap>:first-child{justify-self:center;max-width:150px}
 html body #dlg{padding:0;place-items:end stretch}
 html body .dlg-p{width:100%;max-width:100%;height:100%;max-height:100%;border-radius:0;border:0}
}
html.embedded{scrollbar-width:none}html.embedded::-webkit-scrollbar{display:none}
#fab{display:none}@media (max-width:767px){html body #fab{display:block}}
@media (max-width:767px){html body #main .ph .btn.dup-m{display:none}}
