/* Speroll Shield console.
   Tokens and component vocabulary are the Speroll RTB console's (speroll-rtb-server/speroll/dashboard/
   tmpl_base.go, "airy" redesign 2026-09): warm ground, white cards, hairlines, gold as the only accent,
   colour for status only. Chart series use a validated categorical trio (dataviz validator, both themes). */
:root{
  color-scheme:light;
  --ground:#F3F1EB; --surface:#FFFFFF; --surface-2:#F2F0EB;
  --border:#E6E3DC; --border-strong:#D3CFC6;
  --text:#1B1A17; --text-muted:#66625A; --text-faint:#9A958C;
  --accent:#B58E30; --accent-ink:#85661A; --accent-soft:#F5EDD9; --on-accent:#1D1A12; --accent-line:#E3D4B0;
  --focus:rgba(181,142,48,.35);
  --ok:#2A7350; --ok-soft:#E4F3EA; --warn:#96591A; --warn-soft:#FBEEDB; --bad:#AE423A; --bad-soft:#FAE7E3;
  --info:#345FAE; --info-soft:#E7EDF8; --slate:#5B7391;
  --c-sec:#2a78d6; --c-ux:#eb6834; --c-con:#1baf7a;
  --font:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --r-sm:4px; --r-md:6px; --r-lg:8px; --r-xl:12px;
  --shadow-pop:0 4px 16px rgba(0,0,0,.08),0 0 0 1px var(--border);
  --scrim:rgba(27,26,23,.28);
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  color-scheme:dark;
  --ground:#101112; --surface:#17191C; --surface-2:#1E2125; --border:#282C31; --border-strong:#363B42;
  --text:#ECEBE6; --text-muted:#9A9EA6; --text-faint:#6A6F77;
  --accent:#CBA857; --accent-ink:#DBBC6E; --accent-soft:#2A2416; --on-accent:#14120A; --accent-line:#564B31;
  --focus:rgba(203,168,87,.40);
  --ok:#5DBB86; --ok-soft:#15271D; --warn:#DDAA5A; --warn-soft:#2C2213; --bad:#E4837A; --bad-soft:#301B18;
  --info:#86A8E6; --info-soft:#172033; --slate:#8CA3C0;
  --c-sec:#3987e5; --c-ux:#d95926; --c-con:#199e70;
  --shadow-pop:0 8px 24px rgba(0,0,0,.45),0 0 0 1px var(--border); --scrim:rgba(0,0,0,.55);
}}
:root[data-theme="dark"]{
  color-scheme:dark;
  --ground:#101112; --surface:#17191C; --surface-2:#1E2125; --border:#282C31; --border-strong:#363B42;
  --text:#ECEBE6; --text-muted:#9A9EA6; --text-faint:#6A6F77;
  --accent:#CBA857; --accent-ink:#DBBC6E; --accent-soft:#2A2416; --on-accent:#14120A; --accent-line:#564B31;
  --focus:rgba(203,168,87,.40);
  --ok:#5DBB86; --ok-soft:#15271D; --warn:#DDAA5A; --warn-soft:#2C2213; --bad:#E4837A; --bad-soft:#301B18;
  --info:#86A8E6; --info-soft:#172033; --slate:#8CA3C0;
  --c-sec:#3987e5; --c-ux:#d95926; --c-con:#199e70;
  --shadow-pop:0 8px 24px rgba(0,0,0,.45),0 0 0 1px var(--border); --scrim:rgba(0,0,0,.55);
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{background:var(--ground)}
body{margin:0;background:var(--ground);color:var(--text);font:400 14px/1.5 var(--font);-webkit-font-smoothing:antialiased;min-height:100vh}
a{color:var(--accent-ink);text-decoration:none}
a:hover{text-decoration:underline;text-underline-offset:3px}
button{font:inherit;color:inherit}
h1,h2,h3{font-weight:600;letter-spacing:-.01em;margin:0}
h1{font-size:20px;line-height:1.3}
h2{font-size:15px;display:flex;align-items:center;gap:8px;min-height:28px;margin:0}
h2.sech:before{content:"";width:3px;height:14px;border-radius:2px;background:var(--accent);flex:none}
.sub{color:var(--text-muted);font-size:13px;margin:4px 0 16px}
.muted{color:var(--text-muted)}.faint{color:var(--text-faint)}
.num{font-variant-numeric:tabular-nums}
code,.mono{font-family:var(--mono);font-size:12.5px}
code{background:var(--surface-2);border-radius:var(--r-sm);padding:1px 5px}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
::selection{background:var(--accent-soft)}
*{scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent}
.ic{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* topbar */
.topbar{position:sticky;top:0;z-index:40;height:48px;display:flex;align-items:center;gap:8px;padding:0 16px 0 12px;background:var(--surface);border-bottom:1px solid var(--accent-line)}
.brand{display:flex;align-items:center;gap:10px;color:var(--text)}
.brand:hover{text-decoration:none}
.mark{width:28px;height:28px;border-radius:8px;background:var(--accent);display:grid;place-items:center}
.mark svg{width:15px;height:15px;fill:none;stroke:var(--on-accent);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.wordmark{font-weight:600;font-size:12px;letter-spacing:.14em}
.wordmark b{color:var(--accent-ink);font-weight:600}
.tb-right{margin-left:auto;display:flex;align-items:center;gap:4px}
.ib{width:32px;height:32px;border-radius:var(--r-md);display:inline-flex;align-items:center;justify-content:center;color:var(--text-muted);background:none;border:0;cursor:pointer}
.ib:hover{background:var(--surface-2);color:var(--text)}
.chip{display:inline-flex;align-items:center;gap:6px;height:26px;padding:0 10px;border-radius:var(--r-md);font-size:12px;font-weight:500;color:var(--text-muted);background:var(--surface);border:1px solid var(--border);white-space:nowrap}
.chip i{width:7px;height:7px;border-radius:50%;background:var(--ok);font-style:normal}
.chip.busy i{background:var(--accent);animation:pulse 1.2s infinite}
@keyframes pulse{50%{opacity:.3}}
.menu-btn{display:none}

/* shell */
.shell{display:flex;align-items:flex-start;min-height:calc(100vh - 48px)}
aside{width:224px;flex:0 0 224px;position:sticky;top:48px;height:calc(100vh - 48px);background:var(--surface);border-right:1px solid var(--border);display:flex;flex-direction:column;padding:12px 0 8px;overflow:auto}
.nav{display:flex;flex-direction:column;gap:2px;padding:0 8px}
.nav a{display:flex;align-items:center;gap:10px;height:34px;padding:0 12px;border-radius:var(--r-md);color:var(--text-muted);font-size:14px;font-weight:500;position:relative}
.nav a:hover{background:var(--surface-2);color:var(--text);text-decoration:none}
.nav a.on{background:var(--surface-2);color:var(--text)}
.nav a.on:before{content:"";position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:2px;background:var(--accent)}
.nav a.on .ic{color:var(--accent-ink)}
.nav .cnt{margin-left:auto;font-size:11px;font-weight:600;color:var(--bad);background:var(--bad-soft);border-radius:99px;padding:0 6px;line-height:18px}
.nav hr{border:0;border-top:1px solid var(--border);margin:8px 4px}
.sbfoot{margin-top:auto;padding:12px 16px 4px;font-size:11.5px;color:var(--text-faint);line-height:1.5}
main{flex:1 1 auto;min-width:0}
.content{max-width:1440px;padding:24px;min-width:0}
.scrim{display:none}

/* page header + controls */
.ph{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.ph .grow{flex:1 1 auto}
.toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 16px}
.seg{display:inline-flex;border:1px solid var(--border);border-radius:var(--r-md);overflow:hidden;background:var(--surface)}
.seg button{height:30px;padding:0 12px;font-size:13px;font-weight:500;color:var(--text-muted);background:none;border:0;border-left:1px solid var(--border);cursor:pointer}
.seg button:first-child{border-left:0}
.seg button.on,.seg button:hover{background:var(--surface-2);color:var(--text)}
input,select,textarea{font:inherit;font-size:13px;color:var(--text);background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--r-md);height:32px;padding:0 10px;max-width:100%}
textarea{height:auto;padding:8px 10px;line-height:1.45;font-family:var(--mono);font-size:12.5px;width:100%;resize:vertical}
select{appearance:none;padding-right:28px;background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center/14px}
input[type=checkbox],input[type=radio]{width:15px;height:15px;padding:0;margin:0;accent-color:var(--accent);vertical-align:middle}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--focus)}
input::placeholder,textarea::placeholder{color:var(--text-faint)}
label.f{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:500;color:var(--text-muted)}
label.cb{display:inline-flex;align-items:center;gap:7px;font-size:13px;color:var(--text);cursor:pointer}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;border-radius:var(--r-md);font-size:13px;font-weight:500;cursor:pointer;white-space:nowrap;background:var(--accent);color:var(--on-accent);border:1px solid transparent;text-decoration:none}
.btn:hover{filter:brightness(1.05);text-decoration:none}
.btn:disabled{opacity:.5;cursor:default}
.btn.ghost,.btn.warn,.btn.ok{background:transparent;color:var(--text);border-color:var(--border-strong)}
.btn.ghost:hover{background:var(--surface-2)}
.btn.warn{color:var(--bad)}.btn.warn:hover{background:var(--bad-soft)}
.btn.ok{color:var(--ok)}.btn.ok:hover{background:var(--ok-soft)}
.btn.sm{height:26px;padding:0 9px;font-size:12px}

/* cards, kpis */
.grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px;align-items:start}
.grid>*{min-width:0}
.s12{grid-column:span 12}.s8{grid-column:span 8}.s7{grid-column:span 7}.s6{grid-column:span 6}.s5{grid-column:span 5}.s4{grid-column:span 4}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);padding:16px;min-width:0}
.ch{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 12px}
.ch .right{margin-left:auto;display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text-muted)}
.kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0}
.kpi{padding:2px 16px;border-left:1px solid var(--border);min-width:0}
.kpi:first-child{border-left:0;padding-left:0}
.kpi .k{font-size:12px;font-weight:500;color:var(--text-muted)}
.kpi .v{font-size:26px;font-weight:600;letter-spacing:-.02em;line-height:1.1;margin-top:8px;font-variant-numeric:tabular-nums;white-space:nowrap}
.kpi .b{margin-top:6px;font-size:12px;color:var(--text-muted)}
.hist{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:10px 14px;border-radius:var(--r-md);background:var(--accent-soft);font-size:13px;margin:0 0 16px}
.hist b{font-weight:600}

/* tables */
.tw{overflow-x:auto;margin:0 -16px;padding:0 16px}
table{border-collapse:collapse;width:100%;font-size:13px}
th,td{text-align:left;padding:0 10px;height:38px;border-bottom:1px solid var(--border);vertical-align:middle;white-space:nowrap}
th{font-size:12px;font-weight:500;color:var(--text-muted);position:sticky;top:0;background:var(--surface)}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}
tbody tr:hover td{background:var(--surface-2)}
tbody tr.clk{cursor:pointer}
td.name{font-weight:500;max-width:320px;overflow:hidden;text-overflow:ellipsis}
td.wrap{white-space:normal;min-width:240px;max-width:460px;line-height:1.4;padding-top:6px;padding-bottom:6px}
.trunc{display:inline-block;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}
.empty{color:var(--text-muted);text-align:center;padding:28px 12px;font-size:13px}
.pager{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin-top:12px;font-size:12.5px;color:var(--text-muted)}

/* pills + grades */
.pill{display:inline-flex;align-items:center;height:20px;padding:0 7px;border-radius:var(--r-sm);font-size:11.5px;font-weight:500;white-space:nowrap;background:var(--surface-2);color:var(--text-muted)}
.pill.ok{background:var(--ok-soft);color:var(--ok)}.pill.warn{background:var(--warn-soft);color:var(--warn)}
.pill.bad{background:var(--bad-soft);color:var(--bad)}.pill.info{background:var(--info-soft);color:var(--info)}
.pill.accent{background:var(--accent-soft);color:var(--accent-ink)}
.grade{display:inline-grid;place-items:center;width:26px;height:22px;border-radius:var(--r-sm);font-weight:600;font-size:12.5px}
.g-A{background:var(--ok-soft);color:var(--ok)}.g-B{background:var(--ok-soft);color:var(--ok)}
.g-C{background:var(--warn-soft);color:var(--warn)}.g-D{background:var(--bad-soft);color:var(--bad)}.g-F{background:var(--bad);color:#fff}
.g-x{background:var(--surface-2);color:var(--text-faint)}
.dot{display:inline-block;width:8px;height:8px;border-radius:2px;vertical-align:middle;margin-right:6px}
.grp-security{background:var(--c-sec)}.grp-user_experience{background:var(--c-ux)}.grp-content{background:var(--c-con)}.grp-user_defined{background:var(--slate)}

/* charts */
.chart{position:relative}
.chart svg{display:block;width:100%;height:auto;overflow:visible}
.chart .grid line{stroke:var(--border);stroke-width:1}
.chart text{fill:var(--text-muted);font-size:11px;font-family:var(--font)}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--text-muted);margin-top:8px}
.tip{position:absolute;pointer-events:none;background:var(--surface);box-shadow:var(--shadow-pop);border-radius:var(--r-md);padding:8px 10px;font-size:12px;line-height:1.5;white-space:nowrap;z-index:5;color:var(--text)}
.bars .row{display:grid;grid-template-columns:minmax(120px,40%) 1fr auto;gap:10px;align-items:center;height:28px;font-size:13px}
.bars .track{height:8px;background:var(--surface-2);border-radius:4px;overflow:hidden}
.bars .fill{height:100%;background:var(--accent);border-radius:4px}
.spark{width:84px;height:20px}
.spark path{fill:none;stroke:var(--slate);stroke-width:1.5}
.spark circle{fill:var(--bad)}

/* galleries */
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(176px,1fr));gap:12px}
.tile{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);overflow:hidden;display:flex;flex-direction:column;cursor:pointer}
.tile:hover{border-color:var(--border-strong)}
.tile .img{height:132px;background:var(--surface-2) center/contain no-repeat;border-bottom:1px solid var(--border);display:grid;place-items:center;color:var(--text-faint);font-size:12px}
.tile .meta{padding:8px 10px;font-size:12px;display:flex;flex-direction:column;gap:4px}
.tile .meta .t{font-weight:500;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.brandrow{margin:0 0 16px}
.brandrow .head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.brandrow .head b{font-size:15px}

/* drawer */
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(760px,100vw);background:var(--surface);box-shadow:var(--shadow-pop);z-index:60;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .18s}
.drawer.open{transform:none}
.drawer .dh{display:flex;align-items:center;gap:10px;padding:14px 18px;border-bottom:1px solid var(--border)}
.drawer .db{padding:18px;overflow:auto;flex:1}
.dscrim{position:fixed;inset:0;background:var(--scrim);z-index:55;display:none}
.dscrim.open{display:block}
dl.kv{display:grid;grid-template-columns:150px 1fr;gap:6px 14px;margin:0 0 16px;font-size:13px}
dl.kv dt{color:var(--text-muted)}
dl.kv dd{margin:0;min-width:0;overflow-wrap:anywhere}
.shots{display:flex;gap:12px;flex-wrap:wrap;margin:0 0 16px}
.shots figure{margin:0;border:1px solid var(--border);border-radius:var(--r-md);overflow:hidden;background:var(--surface-2)}
.shots img{display:block;max-width:330px;max-height:280px}
.shots figcaption{font-size:11.5px;color:var(--text-muted);padding:5px 8px;border-top:1px solid var(--border);background:var(--surface)}
.inc{border:1px solid var(--border);border-radius:var(--r-md);padding:10px 12px;margin:0 0 8px;display:flex;gap:10px;align-items:flex-start}
.inc .body{flex:1;min-width:0}
.inc .t{font-weight:600;font-size:13.5px}
.inc .s{font-size:13px;color:var(--text-muted);margin-top:2px}
.inc details{margin-top:6px;font-size:12px}
.inc pre{white-space:pre-wrap;word-break:break-all;background:var(--surface-2);padding:8px;border-radius:var(--r-sm);max-height:220px;overflow:auto;margin:6px 0 0}
.verdict{display:flex;align-items:center;gap:14px;padding:14px;border-radius:var(--r-md);margin:0 0 14px}
.verdict.block{background:var(--bad-soft)}.verdict.report{background:var(--warn-soft)}.verdict.allow{background:var(--ok-soft)}
.verdict .big{font-size:20px;font-weight:600}
.verdict.block .big{color:var(--bad)}.verdict.report .big{color:var(--warn)}.verdict.allow .big{color:var(--ok)}
.risk{margin-left:auto;text-align:right;font-size:12px;color:var(--text-muted)}
.risk b{display:block;font-size:22px;color:var(--text);font-variant-numeric:tabular-nums}
.notice{padding:9px 12px;border-radius:var(--r-md);font-size:13px;background:var(--info-soft);margin:0 0 16px}
.err{background:var(--bad-soft);color:var(--bad)}

/* policy matrix */
.matrix td.c{text-align:center;width:72px}
.matrix th.c{text-align:center}
.tabs{display:flex;gap:4px;flex-wrap:wrap;margin:0 0 14px;border-bottom:1px solid var(--border)}
.tabs button{background:none;border:0;border-bottom:2px solid transparent;padding:8px 12px;font-size:13px;font-weight:500;color:var(--text-muted);cursor:pointer;margin-bottom:-1px}
.tabs button.on{color:var(--text);border-bottom-color:var(--accent)}
pre.snip{background:var(--surface-2);border-radius:var(--r-md);padding:12px;white-space:pre-wrap;word-break:break-all;font-family:var(--mono);font-size:12px;max-height:260px;overflow:auto;margin:6px 0 12px}

/* certificate (supply report) */
.cert{max-width:860px}
.cert .seal{display:flex;align-items:center;gap:14px;margin-bottom:16px}
.cert .seal .mark{width:44px;height:44px;border-radius:12px}
.cert .seal .mark svg{width:22px;height:22px}
.cert .big{font-size:34px;font-weight:600;letter-spacing:-.02em}
@media print{
  aside,.topbar,.toolbar,.noprint{display:none!important}
  body,.content{background:#fff}
  .card{border:0}
}

/* toast */
.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:var(--text);color:var(--surface);padding:9px 14px;border-radius:var(--r-md);font-size:13px;z-index:90;opacity:0;transition:opacity .2s;pointer-events:none}
.toast.show{opacity:1}
.spin{display:inline-block;width:14px;height:14px;border:2px solid var(--border-strong);border-top-color:var(--accent);border-radius:50%;animation:sp .8s linear infinite;vertical-align:middle}
@keyframes sp{to{transform:rotate(360deg)}}

/* phone */
@media (max-width:900px){
  .menu-btn{display:inline-flex}
  aside{position:fixed;left:0;top:48px;z-index:50;transform:translateX(-100%);transition:transform .18s;box-shadow:var(--shadow-pop)}
  body.nav-open aside{transform:none}
  body.nav-open .scrim{display:block;position:fixed;inset:48px 0 0 0;background:var(--scrim);z-index:45}
  .content{padding:16px}
  .s8,.s7,.s6,.s5,.s4{grid-column:span 12}
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 0}
  .kpi:nth-child(odd){border-left:0;padding-left:0}
  .kpi .v{font-size:22px}
  dl.kv{grid-template-columns:110px 1fr}
  .wordmark span{display:none}
  .hide-sm{display:none}
}
