/* AD Report # 19: Forest Health (mobile), in the Studio style: Anton display, Inter Tight body,
   JetBrains Mono figures; rounded thick-stroke cards in yellow, blue, green and red on a cream ground.
   Status colours: .lvl-2 fail, .lvl-1 warn, .lvl-0 ok. */

:root {
  --page: #DCD5C7;
  --bg: #EFEBE3;
  --card: #FFFFFF;
  --ink: #111111;
  --muted: #4A4640;
  --rule: #E4DED2;
  --soft: #EFEBE3;
  --c1: #FFD43B;   /* yellow */
  --c2: #4C7DFF;   /* blue */
  --c3: #3DCB6C;   /* green */
  --c4: #F0473C;   /* red */
  --fail: #F0473C;
  --warn: #FFD43B;
  --ok: #3DCB6C;
  --stroke: 3px;
  --r: 12px;
  --r-lg: 14px;
  --r-pill: 999px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 4px 4px 0 var(--ink);
  --display: 'Anton', 'Impact', sans-serif;
  --body: 'Inter Tight', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --skew: skewX(-6deg);
  --case: none;
  --hweight: 400;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.4;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
img { display: block; }
.ico { flex-shrink: 0; }
:focus-visible { outline: 3px solid var(--c2); outline-offset: 2px; }

/* ---------- frame ---------- */
#app {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  position: relative;
}
@media (min-width: 520px) {
  #app { border-left: var(--stroke) solid var(--ink); border-right: var(--stroke) solid var(--ink); }
}
#page { outline: none; padding-bottom: 8px; }

.loading { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; font-weight: 600; }
.spin { width: 38px; height: 38px; border: var(--stroke) solid var(--ink); border-top-color: var(--c1); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* ---------- top strip + header ---------- */
.topstrip {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 16px; font-size: 12px; font-weight: 700;
  background: var(--ink); color: var(--bg);
}
.topstrip a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; min-height: 28px; }
.topstrip span { font-family: var(--mono); font-size: 11px; opacity: 0.85; }

.bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.logo {
  width: 42px; height: 42px; flex-shrink: 0;
  border: var(--stroke) solid var(--ink); border-radius: 8px;
  background: var(--c4); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 18px; text-decoration: none;
}
.bar-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.bar-title strong { font-family: var(--display); font-weight: var(--hweight, 400); font-size: 21px; line-height: 1.05; text-transform: var(--case); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title span { font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* domain picker (adr-forests): a button that opens a sheet listing every domain, so any number fits */
.forestbar { display: flex; align-items: center; gap: 10px; margin: 0 16px 2px; }
.forestbar-k { font-size: 12px; font-weight: 800; flex-shrink: 0; }
.forestbar-n { font-size: 11px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.domainbtn {
  flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 0 12px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  background: var(--c1); border: var(--stroke) solid var(--ink); border-radius: 10px; box-shadow: var(--shadow);
  font-size: 16px; font-weight: 800; text-align: left;
}
.domainbtn > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 480px; max-height: 82vh; padding: 0;
  background: var(--bg); color: var(--ink); overflow: hidden;
  border: var(--stroke) solid var(--ink); border-bottom: 0; border-radius: 18px 18px 0 0;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-up 0.18s ease-out; }
.sheet::backdrop { background: rgba(17, 17, 17, 0.5); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
.sheet-head h2 { flex: 1 1 auto; margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; transform: var(--skew); transform-origin: left; }
.sheet-close { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; background: var(--card); border: var(--stroke) solid var(--ink); border-radius: 10px; }
.sheet-search { padding: 0 16px 10px; }
.sheet-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 16px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; }
.domain-opt {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px; text-align: left; cursor: pointer;
  background: var(--card); border: var(--stroke) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow);
}
.domain-opt[hidden] { display: none; }
.domain-opt[aria-current="true"] { background: var(--c1); }
.domain-opt > span { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.domain-opt b { font-family: var(--display); font-weight: 400; font-size: 20px; overflow-wrap: anywhere; }
.domain-opt small { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- sections + type ---------- */
.sec { margin: 18px 16px 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.h1, .h2, .h3 { margin: 0; font-family: var(--display); font-weight: var(--hweight, 400); text-transform: var(--case); line-height: 1.02; }
.h1 { font-size: 34px; transform: var(--skew); transform-origin: left; }
.h2 { flex: 1 1 auto; font-size: 25px; transform: var(--skew); transform-origin: left; }
.h3 { font-size: 21px; }
.more { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 12px; font-weight: 800; text-decoration: none; }
.pagehead { margin-top: 14px; }
.sub { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.note { margin: 0 0 12px; font-size: 13px; line-height: 1.4; }
.foot { margin: 8px 0 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.empty { margin: 18px 16px; padding: 16px; border: var(--stroke) dashed var(--ink); border-radius: var(--r); font-weight: 600; text-align: center; }
.mono { font-family: var(--mono); }
.backlink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 13px; font-weight: 800; text-decoration: none; }

/* ---------- card ---------- */
.card {
  display: block; text-decoration: none;
  background: var(--card); border: var(--stroke) solid var(--ink); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 14px;
}
.tone-y { background: var(--c1); }
.tone-b { background: var(--c2); }
.tone-g { background: var(--c3); }
.tone-r { background: var(--c4); }
.tone-w { background: var(--card); }

/* ---------- status colours ---------- */
.lvl-2 { --lvl: var(--fail); }
.lvl-1 { --lvl: var(--warn); }
.lvl-0 { --lvl: var(--ok); }
.badge {
  flex-shrink: 0; display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 800; padding: 3px 8px; line-height: 1.2;
  border: 2px solid var(--ink); border-radius: var(--r-pill); background: var(--lvl, var(--card));
}
.t-fail { background: var(--fail); font-weight: 700; }
.t-warn { background: var(--warn); font-weight: 700; }

/* ---------- Studio hero ---------- */
.hero {
  margin: 2px 16px 0; position: relative; overflow: hidden;
  background: var(--ink); color: #FFF8E7;
  border: var(--stroke) solid var(--ink); border-radius: var(--r-lg); padding: 18px 18px 18px;
}
.kicker { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--c1); letter-spacing: 1px; max-width: 190px; }
.hero-title { margin: 8px 0 0; font-family: var(--display); font-weight: 400; font-size: 46px; line-height: 0.95; transform: skewX(-7deg); transform-origin: left; max-width: 200px; overflow-wrap: anywhere; }
.hero-sub { margin: 10px 0 0; font-size: 14px; line-height: 1.4; color: #E9E2D0; max-width: 190px; }
.sticker {
  position: absolute; right: 14px; top: 24px; width: 128px;
  background: var(--c1); color: var(--ink); text-decoration: none;
  border: var(--stroke) solid var(--ink); box-shadow: 4px 4px 0 var(--c4);
  padding: 10px 10px 8px; transform: rotate(4deg);
  display: flex; flex-direction: column; gap: 2px;
}
.sticker.ok { background: var(--c3); box-shadow: 4px 4px 0 var(--c1); }
.sticker b { font-family: var(--display); font-weight: 400; font-size: 46px; line-height: 0.9; }
.sticker span { font-family: var(--display); font-size: 19px; line-height: 1.02; }
.sticker .ico { margin-top: 4px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.hchip { font-size: 11px; font-weight: 700; padding: 6px 9px; border: 2px solid #FFF8E7; border-radius: 999px; text-decoration: none; }

/* status block (screens) and the shared bar */
.status { border: var(--stroke) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--lvl); }
.status-tag { align-self: flex-start; font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 3px 8px; background: var(--ink); color: #FFFFFF; border-radius: 6px; }
.status-big { font-family: var(--display); font-size: 30px; line-height: 1.05; text-transform: var(--case); }
.status-line { margin: 0; font-size: 14px; font-weight: 600; }
.status-bar { height: 20px; border: var(--stroke) solid var(--ink); background: var(--card); border-radius: 8px; overflow: hidden; }
.status-bar i { display: block; height: 100%; background: var(--ink); }
.status-cap { font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 12px; text-decoration: none; color: var(--ink);
  border: var(--stroke) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow);
}
.kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
.kpi-label { font-size: 13px; font-weight: 800; }
.kpi-val { font-family: var(--display); font-size: 40px; line-height: 1; }
.kpi-val .of { font-size: 22px; }
.kpi-sub { font-size: 12px; font-weight: 700; }
.kpi .track { display: none; }

/* ---------- bars ---------- */
.track { height: 12px; border: 2px solid var(--ink); border-radius: 6px; background: var(--soft); overflow: hidden; }
.fill { display: block; height: 100%; background: var(--lvl); border-right: 2px solid var(--ink); }
.fill[style*="width:0%"] { border-right: 0; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; text-decoration: none; font-size: 13px; font-weight: 700; }
.bar-row .track { grid-column: 1 / -1; }
.bar-v { font-family: var(--mono); }
.stackbar { display: flex; height: 22px; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; background: var(--card); }
.stackbar i { display: block; height: 100%; background: var(--lvl); }
.stackbar i + i { border-left: 2px solid var(--ink); }
.stackbar i[style*="width:0%"] { display: none; }
.stackbar i.lvl-0 { background: var(--card); }
.legend { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; font-weight: 700; }

/* ---------- mini stats ---------- */
.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.minis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.card .sec-head + .minis { margin-top: 0; }
.mini { display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; min-width: 0; }
.mini b { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.1; }
.mini b small { font-size: 14px; }
.mini span { font-size: 11px; font-weight: 700; }
.mini.lvl-2, .mini.lvl-1 { background: var(--lvl); }

/* ---------- alerts ---------- */
.alert { display: flex; align-items: flex-start; gap: 12px; text-decoration: none; color: var(--ink); }
.alert > .ico { margin-top: 8px; }
.alert-mark {
  flex-shrink: 0; min-width: 34px; height: 34px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: var(--stroke) solid var(--ink); border-radius: 8px; background: var(--lvl);
  font-family: var(--mono); font-weight: 700; font-size: 12px;
}
.alert-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.alert-title { font-size: 15px; font-weight: 800; }
.alert-text { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.alert-tag { display: none; }
.more-alerts > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-weight: 800; font-size: 14px; }
.more-alerts > summary::-webkit-details-marker { display: none; }
.more-alerts[open] > summary .ico { transform: rotate(90deg); }

.alerts { background: var(--card); border: var(--stroke) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 2px 14px; }
.alert { padding: 12px 0; border-top: 2px solid var(--rule); }
.alerts > .alert:first-child { border-top: 0; }
.more-alerts { border-top: 2px solid var(--rule); }
.alert.lvl-0 .alert-mark { background: var(--c3); }

/* ---------- area cards ---------- */
.area { display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.area-head { display: flex; align-items: center; gap: 8px; }
.area-head .h3 { flex: 1 1 auto; }
.area-text { margin: 0; font-size: 13px; line-height: 1.4; }

/* ---------- holders, chips ---------- */
.holders { display: flex; flex-direction: column; gap: 8px; }
.holder { display: flex; align-items: center; gap: 10px; padding: 10px; border: 2px solid var(--ink); border-radius: 10px; text-decoration: none; min-height: 48px; }
.holder strong { flex: 1 1 auto; font-size: 14px; }
.holder span { font-size: 12px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sec > .chips { margin-top: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px;
  font-size: 12px; font-weight: 700; padding: 4px 10px; text-decoration: none; cursor: default;
  background: var(--soft); border: 2px solid var(--ink); border-radius: var(--r-pill);
}
button.chip, a.chip { cursor: pointer; min-height: 40px; font-size: 13px; background: var(--card); }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--bg); }

/* ---------- sources ---------- */
.sources { background: var(--c4); border: var(--stroke) solid var(--ink); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.sources-title { font-family: var(--display); font-size: 32px; line-height: 1; transform: var(--skew); transform-origin: left; }
.sources-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.sources-grid a { font-size: 13px; font-weight: 700; text-decoration: none; min-height: 28px; }

/* ---------- DC list ---------- */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.segb {
  min-height: 80px; padding: 8px; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--card); border: var(--stroke) solid var(--ink); border-radius: var(--r);
}
.segb b { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1; }
.segb span { font-size: 12px; font-weight: 800; }
.segb.lvl-2, .segb.lvl-1, .segb.lvl-0 { background: var(--lvl); }
.segb.lvl-0 { background: var(--card); }
.segb[aria-pressed="true"] { box-shadow: var(--shadow); transform: translate(-2px, -2px); outline: 3px solid var(--ink); outline-offset: -7px; }
.lbl { display: block; font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.search { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; background: var(--card); border: var(--stroke) solid var(--ink); border-radius: 10px; }
.search input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; }
.listhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 12px; font-weight: 800; letter-spacing: 0.6px; }
.listhead .chip { min-height: 36px; }
.dcs { display: flex; flex-direction: column; gap: 12px; }
.dc { display: block; text-decoration: none; background: var(--card); border: var(--stroke) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.dc-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.dc > .dc-head { background: var(--lvl); border-bottom: var(--stroke) solid var(--ink); }
.dc.lvl-0 > .dc-head { background: var(--card); border-bottom: 2px solid var(--rule); }
.flag { width: 28px; height: 21px; flex-shrink: 0; border: 2px solid var(--ink); border-radius: 4px; object-fit: cover; background: var(--card); }
.flag-none { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.dc-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.dc-name b { font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1.1; }
.dc-name span { font-size: 12px; font-weight: 700; }
.dc-issue { margin: 0; padding: 10px 12px 4px; font-size: 13px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.dc-issue em { font-style: normal; font-weight: 800; }
.dc-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 6px 12px 12px; font-family: var(--mono); font-size: 15px; font-weight: 700; }
.dc-metrics span { display: flex; flex-direction: column; }
.dc-metrics small { font-family: var(--body); font-size: 11px; font-weight: 700; color: var(--muted); }
.btn { display: block; width: 100%; margin-top: 14px; min-height: 52px; border: var(--stroke) solid var(--ink); border-radius: var(--r); font-size: 15px; font-weight: 800; cursor: pointer; background: var(--card); }
.btn.dark { background: var(--ink); color: var(--bg); }

/* ---------- one DC ---------- */
.dchero { background: var(--card); border: var(--stroke) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.dchero > .dc-head { background: var(--lvl); border-bottom: var(--stroke) solid var(--ink); padding: 14px 12px; }
.dchero.lvl-0 > .dc-head { background: var(--c3); }
.dchero .dc-name b { font-size: 26px; }
.dchero .chips { padding: 0 12px 12px; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr; }
.fact { display: grid; grid-template-columns: 42% 1fr; gap: 8px; padding: 9px 0; border-top: 2px solid var(--rule); font-size: 13px; }
.fact:first-child { border-top: 0; }
.minis + .facts { margin-top: 10px; }
.fact dt { font-weight: 700; color: var(--muted); }
.fact dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sublist { display: flex; flex-direction: column; margin-top: 12px; }
.card .sec-head + .sublist { margin-top: 0; }
.subrow { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 2px solid var(--rule); font-size: 13px; text-decoration: none; }
.subrow:first-child { border-top: 0; }
.subrow > span { overflow-wrap: anywhere; }
.subrow.row { flex-direction: row; align-items: center; gap: 10px; min-height: 48px; }
.subrow.row > span:first-child { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.subrow.row > span:first-child > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.checklist { display: flex; flex-direction: column; }
.check { display: grid; grid-template-columns: 28px 38% 1fr; align-items: start; gap: 8px; padding: 10px 0; border-top: 2px solid var(--rule); font-size: 13px; }
.check:first-child { border-top: 0; }
.check-ico { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); border-radius: 6px; background: var(--lvl); }
.check-k { font-weight: 800; }
.check-v { font-weight: 500; overflow-wrap: anywhere; }
.detail { margin-top: 10px; border-top: 2px solid var(--rule); }
.detail > summary, .rule > summary { list-style: none; cursor: pointer; }
.detail > summary::-webkit-details-marker, .rule > summary::-webkit-details-marker { display: none; }
.detail > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-weight: 800; font-size: 13px; }
.detail[open] > summary .ico, .rule[open] > summary > .ico { transform: rotate(90deg); }
.detail p { margin: 0 0 8px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }

/* ---------- replication ---------- */
.links { display: flex; flex-direction: column; gap: 14px; }
.link { background: var(--card); border: var(--stroke) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.link-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 48px; background: var(--lvl); border-bottom: var(--stroke) solid var(--ink); text-decoration: none; }
.link-head .from { font-family: var(--mono); font-size: 12px; font-weight: 700; }
.link-head b { font-family: var(--display); font-weight: 400; font-size: 16px; }
.link-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.link-err { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.code { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 3px 7px; background: var(--ink); color: #FFFFFF; border-radius: 6px; }
.triple { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; }
.triple > div { padding: 8px; display: flex; flex-direction: column; }
.triple > div + div { border-left: 2px solid var(--ink); }
.triple small { font-family: var(--mono); font-size: 10px; font-weight: 700; }
.triple b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.sticky-note { margin: 16px 0 0 auto; max-width: 260px; padding: 10px 12px; background: var(--c1); border: var(--stroke) solid var(--ink); box-shadow: var(--shadow); transform: rotate(-3deg); font-family: var(--display); font-size: 15px; line-height: 1.2; text-transform: var(--case); }
.buckets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--card); border: var(--stroke) solid var(--ink); border-radius: var(--r); overflow: hidden; }
.buckets > div { padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.buckets > div + div { border-left: var(--stroke) solid var(--ink); }
.buckets .lvl-0, .buckets .lvl-2 { background: var(--lvl); }
.buckets .lvl-0 { background: var(--card); }
.buckets b { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1; }
.buckets span { font-size: 12px; font-weight: 700; }
.bars-card { margin-top: 14px; }
.okcard { display: flex; align-items: center; gap: 12px; background: var(--lvl); }
.okcard > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.okcard b { font-family: var(--display); font-weight: 400; font-size: 18px; text-transform: var(--case); }
.okico { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--card); border: var(--stroke) solid var(--ink); border-radius: 10px; }

/* ---------- tables ---------- */
.tblwrap { overflow-x: auto; background: var(--card); border: var(--stroke) solid var(--ink); border-radius: var(--r); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 9px 10px; background: var(--ink); color: #FFFFFF; font-size: 11px; font-weight: 700; letter-spacing: 0.4px; }
.tbl td { padding: 10px; border-top: 2px solid var(--rule); }
.tbl tr:first-child td { border-top: 0; }
.tbl td a { font-weight: 700; text-decoration: none; }
.tbl .r { text-align: right; }

/* ---------- security ---------- */
.pc { padding: 0; overflow: hidden; }
.pc > .bars, .pc > .foot { margin: 14px; }
.pc > .foot { margin-top: -2px; }
.pc-top { display: flex; align-items: stretch; border-bottom: var(--stroke) solid var(--ink); }
.pc-score { padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; background: var(--lvl); border-right: var(--stroke) solid var(--ink); }
.pc-score b { font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1; }
.pc-score span { font-family: var(--mono); font-size: 11px; font-weight: 700; }
.pc-meta { padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 4px; font-size: 13px; font-weight: 500; }
.rules { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.sec-head + .rules { margin-top: 0; }
.rule { background: var(--card); border: var(--stroke) solid var(--ink); border-radius: var(--r); }
.rule > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 56px; }
.rule-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rule-t b { font-size: 14px; line-height: 1.3; }
.rule-t span { font-size: 12px; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.pts { flex-shrink: 0; min-width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--lvl); border: 2px solid var(--ink); border-radius: 8px; font-family: var(--mono); font-weight: 700; font-size: 13px; }
.rule p { margin: 0; padding: 0 12px 12px; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.rule .sol { padding-top: 0; }

/* ---------- more ---------- */
.menu { display: flex; flex-direction: column; gap: 12px; }
.menu-item { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px; text-decoration: none; background: var(--card); border: var(--stroke) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); }
.menu-item > span { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.menu-item b { font-family: var(--display); font-weight: 400; font-size: 19px; text-transform: var(--case); }
.menu-item > span > span { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: var(--card); border-top: var(--stroke) solid var(--ink);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; font-size: 11px; font-weight: 700; text-decoration: none; border: 2px solid transparent; border-radius: 10px; }
.tabbar a.on { background: var(--c1); border-color: var(--ink); font-weight: 800; }
@media (min-width: 520px) { .tabbar { border-left: var(--stroke) solid var(--ink); border-right: var(--stroke) solid var(--ink); } }

@media (max-width: 360px) {
  .bar-title strong { font-size: 18px; }
  .hero-title { font-size: 38px; }
  .sticker { width: 112px; }
  .kpi-val { font-size: 34px; }
}

@media print {
  .tabbar, .topstrip { display: none; }
  #app { padding-bottom: 0; border: 0; }
}
