/* Layout concept: an installed app shell. Phone = top bar + bottom tab bar, one column.
   Desktop = side rail + the same screens given room (builder steps | live result card,
   campaign list | campaign detail). Cream paper surfaces, forest structure, gold as a spark. */
:root {
  --bg: #F7F4EC;
  --surface: #FBFAF5;
  --surface-2: #FFFFFF;
  --sunken: #F0ECE1;
  --line: #E6E0D2;
  --line-strong: #D3CAB7;
  --ink: #28251F;
  --body: #5B5447;
  --muted: #6B6558;
  --faint: #9A948A;
  --taupe: #76664F;
  --forest: #14543E;
  --forest-hover: #0F4231;
  --on-forest: #F7F4EC;
  --accent: #14543E;
  --accent-soft: rgba(20, 84, 62, 0.08);
  --accent-line: rgba(20, 84, 62, 0.28);
  --gold: #C9A227;
  --on-gold: #1B2B22;
  --sage: #A7BFA9;
  --focus: #14543E;
  --result-bg: #14543E;
  --result-ink: #F7F4EC;
  --result-muted: rgba(247, 244, 236, 0.76);
  --result-tag: #D3E4D4;
  --result-line: rgba(247, 244, 236, 0.18);
  --result-sunken: rgba(8, 30, 22, 0.32);
  --tag-bg: rgba(20, 84, 62, 0.08);
  --tag-ink: #14543E;
  --ok: #1E6A4B;
  --ok-soft: rgba(20, 84, 62, 0.10);
  --warn: #855200;
  --warn-soft: #F5E8C6;
  --bad: #9A3826;
  --bad-soft: #F6E0D8;
  --bar: #14543E;
  --bar-muted: #CBC2AE;
  --bar-warn: #B98516;
  --scrim: rgba(28, 26, 20, 0.38);
  --qr-bg: #FFFFFF;
  --qr-ink: #17231C;
  --shadow-card: 0 18px 44px -32px rgba(40, 37, 31, 0.38);
  --shadow-pop: 0 30px 80px -40px rgba(20, 84, 62, 0.55);

  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-sans: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --t-xl: clamp(26px, 3.2vw, 34px);
  --t-lg: 20px;
  --t-md: 17px;
  --t-body: 16px;
  --t-sm: 14px;
  --t-xs: 12px;

  --r-pill: 100px;
  --r-lg: 22px;
  --r-md: 18px;
  --r-sm: 12px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 240ms;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1713; --surface: #16211C; --surface-2: #1A2721; --sunken: #121C17;
    --line: #2A3A32; --line-strong: #3A4C42;
    --ink: #EEF0E8; --body: #C6CCBF; --muted: #9DA69A; --faint: #6E786C; --taupe: #B3A48F;
    --forest: #2A7A5C; --forest-hover: #318A68; --on-forest: #F4F2EA;
    --accent: #7CC6A2; --accent-soft: rgba(124, 198, 162, 0.10); --accent-line: rgba(124, 198, 162, 0.34);
    --gold: #D9B440; --on-gold: #17231C; --sage: #A7BFA9; --focus: #7CC6A2;
    --result-bg: #1C3A2E; --result-ink: #EEF0E8; --result-muted: rgba(238, 240, 232, 0.74);
    --result-tag: #A6DCC1; --result-line: rgba(238, 240, 232, 0.12); --result-sunken: rgba(0, 0, 0, 0.24);
    --tag-bg: rgba(124, 198, 162, 0.12); --tag-ink: #A6DCC1;
    --ok: #7CC6A2; --ok-soft: rgba(124, 198, 162, 0.12);
    --warn: #E3BC66; --warn-soft: rgba(227, 188, 102, 0.12);
    --bad: #F0A391; --bad-soft: rgba(240, 163, 145, 0.12);
    --bar: #7CC6A2; --bar-muted: #3B4C42; --bar-warn: #D9A944;
    --scrim: rgba(0, 0, 0, 0.58);
    --shadow-card: 0 18px 44px -30px rgba(0, 0, 0, 0.7);
    --shadow-pop: 0 30px 80px -36px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1713; --surface: #16211C; --surface-2: #1A2721; --sunken: #121C17;
  --line: #2A3A32; --line-strong: #3A4C42;
  --ink: #EEF0E8; --body: #C6CCBF; --muted: #9DA69A; --faint: #6E786C; --taupe: #B3A48F;
  --forest: #2A7A5C; --forest-hover: #318A68; --on-forest: #F4F2EA;
  --accent: #7CC6A2; --accent-soft: rgba(124, 198, 162, 0.10); --accent-line: rgba(124, 198, 162, 0.34);
  --gold: #D9B440; --on-gold: #17231C; --sage: #A7BFA9; --focus: #7CC6A2;
  --result-bg: #1C3A2E; --result-ink: #EEF0E8; --result-muted: rgba(238, 240, 232, 0.74);
  --result-tag: #A6DCC1; --result-line: rgba(238, 240, 232, 0.12); --result-sunken: rgba(0, 0, 0, 0.24);
  --tag-bg: rgba(124, 198, 162, 0.12); --tag-ink: #A6DCC1;
  --ok: #7CC6A2; --ok-soft: rgba(124, 198, 162, 0.12);
  --warn: #E3BC66; --warn-soft: rgba(227, 188, 102, 0.12);
  --bad: #F0A391; --bad-soft: rgba(240, 163, 145, 0.12);
  --bar: #7CC6A2; --bar-muted: #3B4C42; --bar-warn: #D9A944;
  --scrim: rgba(0, 0, 0, 0.58);
  --shadow-card: 0 18px 44px -30px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 30px 80px -36px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--body);
  font: 400 var(--t-body)/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 40; background: var(--bg);
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink); letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.app { min-height: 100vh; }
.rail { display: none; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.arch { width: 30px; height: 30px; color: var(--forest); flex: none; }
:root[data-theme="dark"] .arch { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .arch { color: var(--accent); } }
.ws { min-width: 0; display: grid; line-height: 1.2; }
.ws-name { font: 600 16px var(--font-display); color: var(--ink); letter-spacing: -0.01em; }
.ws-host { font: 400 12px var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.tab {
  min-height: 60px; display: grid; justify-items: center; align-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font: 500 12px var(--font-sans); letter-spacing: 0.01em;
  position: relative;
}
.tab svg.i { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--accent); }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold);
}

.view {
  max-width: 1180px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 20px 120px;
  animation: viewIn 320ms var(--ease) both;
}
@keyframes viewIn { from { opacity: 0.4; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 256px minmax(0, 1fr); }
  .topbar, .tabbar { display: none; }
  .rail {
    display: flex; flex-direction: column; gap: 22px;
    position: sticky; top: 0; height: 100vh; height: 100dvh;
    padding: 26px 18px 20px; background: var(--surface); border-right: 1px solid var(--line);
  }
  .view { padding-block: 40px 72px; padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); }
}
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.rail-brand span { font: 600 18px var(--font-display); color: var(--ink); letter-spacing: -0.02em; }
.ws-card { display: grid; gap: 4px; padding: 14px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); }
.ws-card .label { font: 500 10.5px var(--font-sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--taupe); }
.ws-private { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ws-private svg.i { width: 14px; height: 14px; }
.rail-nav { display: grid; gap: 4px; }
.rail-link {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px;
  border-radius: var(--r-sm); text-decoration: none; color: var(--body); font-weight: 500; font-size: 15px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.rail-link:hover { background: var(--accent-soft); color: var(--ink); }
.rail-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.rail-link[aria-current="page"] .dot { background: var(--accent); }
.rail-link .dot { width: 6px; height: 6px; border-radius: 50%; margin-left: auto; background: transparent; }
.rail-foot { margin-top: auto; display: grid; gap: 10px; }
.rail-row { display: flex; gap: 8px; align-items: center; }
.user { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--body); }

/* ---------- Common pieces ---------- */
.head { display: grid; gap: 10px; margin-bottom: 22px; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.eyebrow { font: 500 11px var(--font-sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--taupe); }
.title { font-size: var(--t-xl); line-height: 1.1; letter-spacing: -0.025em; }
.lead { font-weight: 300; font-size: var(--t-md); color: var(--body); max-width: 62ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-card); }
.btn {
  min-height: 46px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-pill); border: 1px solid transparent; font: 500 15px var(--font-sans); text-decoration: none;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn svg.i { width: 18px; height: 18px; }
.btn-primary { background: var(--forest); color: var(--on-forest); }
.btn-primary:hover { background: var(--forest-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-quiet { background: transparent; color: var(--accent); padding: 0 12px; }
.btn-quiet:hover { background: var(--accent-soft); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--font-sans); padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-live { color: var(--ok); background: var(--ok-soft); }
.pill-scheduled { color: var(--muted); border: 1px solid var(--line-strong); padding: 2px 9px; }
.pill-scheduled::before { background: transparent; border: 1.5px solid currentColor; width: 5px; height: 5px; }
.pill-ended { color: var(--muted); background: var(--sunken); }
.pill-ended::before { opacity: 0.5; }
.chip { display: inline-flex; align-items: center; font: 500 12px var(--font-sans); color: var(--accent); border: 1px solid var(--accent-line); background: var(--surface-2); padding: 2px 10px; border-radius: var(--r-pill); }
.tagval { font: 500 13px var(--font-mono); color: var(--tag-ink); background: var(--tag-bg); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font: 600 11px var(--font-display); letter-spacing: 0.02em; color: var(--ink); background: var(--sunken); border: 1px solid var(--line-strong);
}
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--r-pill); background: var(--sunken); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.seg button {
  min-height: 40px; padding: 0 clamp(10px, 2.6vw, 14px); border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted);
  font-weight: 500; font-size: 14px; white-space: nowrap; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 0 0 1px var(--line); }

/* Fields */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .flabel { font-weight: 500; font-size: 15px; color: var(--ink); }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--ink);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input.mono { font-size: 15px; }
.hint { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.hint .tagval { font-size: 12px; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; padding: 12px 14px; border-radius: var(--r-sm); }
.note svg.i { width: 18px; height: 18px; margin-top: 1px; }
.note-warn { background: var(--warn-soft); color: var(--warn); }
.note-bad { background: var(--bad-soft); color: var(--bad); }
.note-info { background: var(--sunken); color: var(--body); }

/* ---------- Builder ---------- */
.howto { padding: 18px; display: grid; gap: 14px; margin-bottom: 22px; position: relative; }
.howto h2 { font-size: var(--t-md); }
.howto ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .howto ol { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.howto li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; min-width: 0; }
.howto .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 500 12px var(--font-mono); color: var(--accent); border: 1px solid var(--accent-line); }
.howto .close { position: absolute; top: 8px; right: 8px; border: 0; background: transparent; }
.howto-head { display: flex; align-items: center; gap: 10px; padding-right: 44px; }

.builder { display: grid; gap: 20px; }
@media (min-width: 1100px) { .builder { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: start; gap: 28px; } }
.steps { display: grid; gap: 16px; min-width: 0; }
.step { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
@media (min-width: 640px) { .step { padding: 22px 24px; } .howto { padding: 22px 24px; } }
.step-head { display: flex; align-items: center; gap: 12px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--forest); color: var(--on-forest); font: 500 13px var(--font-mono); }
.step-head h2 { font-size: var(--t-lg); }
.step-head .sub { margin-left: auto; }

.picker-current {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; min-height: 64px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface-2);
}
.picker-current:hover { border-color: var(--accent-line); }
.pc-main { min-width: 0; flex: 1; display: grid; gap: 3px; }
.pc-title { font-weight: 500; color: var(--ink); font-size: 16px; }
.pc-name { font: 400 13px var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.chev { transition: transform var(--dur) var(--ease); color: var(--muted); }
[aria-expanded="true"] .chev { transform: rotate(180deg); }
.picker-list { display: grid; gap: 6px; padding: 6px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); }
.picker-group { font: 500 10.5px var(--font-sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--taupe); padding: 8px 10px 2px; }
.popt {
  width: 100%; text-align: left; display: flex; gap: 12px; align-items: center; min-height: 56px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid transparent; background: transparent;
}
.popt:hover { background: var(--surface-2); }
.popt[aria-pressed="true"] { background: var(--surface-2); border-color: var(--accent-line); }
.popt .pc-main { gap: 1px; }
.popt-new { color: var(--accent); font-weight: 500; }
.popt-new .plus { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px dashed var(--accent-line); }

.tile-group { display: grid; gap: 10px; }
.tile-group h3 { font: 500 11px var(--font-sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--taupe); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile {
  text-align: left; min-height: 84px; padding: 14px; display: grid; align-content: space-between; gap: 8px;
  border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface-2); position: relative; min-width: 0;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.tile:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.tile-name { font-weight: 500; color: var(--ink); font-size: 15px; line-height: 1.3; padding-right: 22px; }
.tile-name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.tile-medium { font: 400 12px var(--font-mono); color: var(--muted); }
.tile .tick { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; display: none; place-items: center; background: var(--forest); color: var(--on-forest); }
.tile .tick svg.i { width: 13px; height: 13px; stroke-width: 2.4; }
.tile[aria-pressed="true"] .tick { display: grid; }

.fields { display: grid; gap: 16px; }
@media (min-width: 720px) { .fields .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
.fields .pair { display: grid; gap: 16px; }
.becomes { font-size: 13px; color: var(--muted); }

/* Result card */
.result {
  background: var(--result-bg); color: var(--result-ink); border-radius: var(--r-lg); padding: 20px;
  display: grid; gap: 18px; box-shadow: var(--shadow-pop); position: relative; overflow: hidden; min-width: 0;
}
.result::after {
  content: ""; position: absolute; width: 360px; height: 360px; right: -170px; top: -190px; border-radius: 50%;
  border: 1px solid var(--result-line); pointer-events: none;
}
@media (min-width: 640px) { .result { padding: 26px; } }
@media (min-width: 1100px) { .result-wrap { position: sticky; top: 32px; } }
.result :focus-visible { outline-color: var(--gold); }
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.result .eyebrow { color: var(--result-muted); }
.ready { display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--font-mono); color: var(--result-ink); }
.ready::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--result-tag); }
.result h2 { color: var(--result-ink); font-size: var(--t-lg); }
.linkbox {
  font-size: 15px; line-height: 1.6; padding: 14px 16px; border-radius: var(--r-sm); background: var(--result-sunken);
  overflow-wrap: anywhere; word-break: break-word; min-width: 0; user-select: all;
}
.linkbox .base { color: var(--result-ink); }
.linkbox .tags { font-family: var(--font-mono); font-size: 13.5px; color: var(--result-tag); }
.linkbox .sep { font-family: var(--font-mono); color: var(--result-muted); }
.btn-gold { background: var(--gold); color: var(--on-gold); font-weight: 500; }
.btn-gold:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-onresult { background: transparent; color: var(--result-ink); border-color: var(--result-line); }
.btn-onresult:hover { background: var(--result-sunken); }
.ga { display: grid; gap: 0; border-top: 1px solid var(--result-line); }
.ga-title { font: 500 11px var(--font-sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--result-muted); padding: 14px 0 6px; }
.ga dl { margin: 0; display: grid; }
.ga .row { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--result-line); font-size: 14px; }
.ga dt { color: var(--result-muted); }
.ga dd { margin: 0; color: var(--result-ink); font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; }
.ga dd.plain { font-family: var(--font-sans); font-size: 14px; }
.result .err { background: var(--bad-soft); color: var(--bad); }
.metasteps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.metasteps li { display: flex; gap: 12px; font-size: 14.5px; line-height: 1.45; color: var(--result-ink); }
.metasteps .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 500 12px var(--font-mono); border: 1px solid var(--result-line); color: var(--result-tag); }
.metasteps code { font-family: var(--font-mono); font-size: 12.5px; color: var(--result-tag); overflow-wrap: anywhere; }
.qr { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: center; padding-top: 16px; border-top: 1px solid var(--result-line); }
.qr-box { width: 112px; height: 112px; border-radius: 12px; background: var(--qr-bg); padding: 6px; display: grid; place-items: center; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-meta { display: grid; gap: 8px; min-width: 0; }
.qr-file { font: 400 12px var(--font-mono); color: var(--result-muted); overflow-wrap: anywhere; }
.qr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result-note { font-size: 13.5px; color: var(--result-muted); line-height: 1.45; }

/* Check a link */
.check-out { display: grid; gap: 14px; }
.finding { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.finding:last-child { border-bottom: 0; }
.sev { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.sev svg.i { width: 16px; height: 16px; stroke-width: 2; }
.sev-bad { background: var(--bad-soft); color: var(--bad); }
.sev-warn { background: var(--warn-soft); color: var(--warn); }
.sev-ok { background: var(--ok-soft); color: var(--ok); }
.finding h4 { margin: 0 0 3px; font: 500 15px var(--font-sans); color: var(--ink); }
.finding p { font-size: 14px; line-height: 1.5; }
.explain { display: grid; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.explain .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.explain .row:last-child { border-bottom: 0; }
.explain .k { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.explain .v { overflow-wrap: anywhere; }
.fixed { display: grid; gap: 10px; padding: 16px; border-radius: var(--r-sm); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.fixed .linkline { font-family: var(--font-mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; line-height: 1.55; }
.sec-label { font: 500 11px var(--font-sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--taupe); }

/* ---------- Library ---------- */
.lib { display: grid; gap: 20px; }
@media (min-width: 1100px) { .lib { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); align-items: start; gap: 28px; } }
.lib-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.clist { display: grid; gap: 10px; }
.citem {
  width: 100%; text-align: left; display: grid; gap: 10px; padding: 16px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); min-width: 0;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.citem:hover { border-color: var(--accent-line); }
.citem[aria-current="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-card); }
.citem-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.citem-title { font: 600 16px var(--font-display); color: var(--ink); letter-spacing: -0.01em; }
.citem-name { font: 400 12.5px var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.citem-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13.5px; color: var(--muted); }
.citem-meta .by { display: inline-flex; align-items: center; gap: 8px; }
.citem-meta .avatar { width: 24px; height: 24px; font-size: 10px; }

.detail { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
@media (min-width: 640px) { .detail { padding: 26px 28px; } }
.detail-back { display: inline-flex; }
@media (min-width: 1100px) { .detail-back { display: none; } }
.detail-head { display: grid; gap: 8px; }
.detail-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 14px 18px; margin: 0; }
.facts div { min-width: 0; display: grid; gap: 2px; }
.facts dt { font: 500 10.5px var(--font-sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--taupe); }
.facts dd { margin: 0; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
.sofar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--sunken); font-size: 14px; }
.sofar b { font: 600 15px var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.lgroup { display: grid; gap: 8px; }
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.lrow-main { min-width: 0; display: grid; gap: 4px; }
.lrow-ch { font-weight: 500; font-size: 15px; color: var(--ink); }
.lrow-url { font: 400 12.5px var(--font-mono); color: var(--muted); overflow-wrap: anywhere; line-height: 1.5; }
.lrow-url .t { color: var(--tag-ink); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.empty { padding: 36px 22px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.empty .arch-lg { width: 72px; height: 72px; color: var(--sage); }
.empty h2 { font-size: var(--t-lg); }
.empty p { max-width: 42ch; color: var(--body); }
.lib.is-empty { grid-template-columns: minmax(0, 1fr); }

/* phone: list or detail, not both */
@media (max-width: 1099px) {
  .lib:not(.show-detail) .detail-wrap { display: none; }
  .lib.show-detail .list-wrap { display: none; }
}

/* ---------- Results ---------- */
.res-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.range { font: 400 12.5px var(--font-mono); color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; overflow: hidden; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { padding: 18px; display: grid; gap: 4px; min-width: 0; border-color: var(--line); border-style: solid; border-width: 0; }
.kpis .kpi:nth-child(odd) { border-right-width: 1px; }
.kpis .kpi:nth-child(-n+2) { border-bottom-width: 1px; }
@media (min-width: 900px) {
  .kpis .kpi { border-width: 0; border-right-width: 1px; padding: 22px 24px; }
  .kpis .kpi:last-child { border-right-width: 0; }
}
.kpi-label { font-size: 13.5px; color: var(--muted); line-height: 1.3; }
.kpi-value { font: 600 clamp(24px, 3vw, 32px)/1.1 var(--font-display); color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-cmp { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi-cmp .d { color: var(--ok); font-weight: 500; }
@media (max-width: 899px) { .kpi-cmp .d { display: block; } }
.bd { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 20px; min-width: 0; }
@media (min-width: 640px) { .bd { padding: 22px 24px; } }
.bd-head > * { min-width: 0; }
.bd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.bd-head h2 { font-size: var(--t-lg); }
.brows { display: grid; }
.brow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 10px; padding: 14px 0; border-top: 1px solid var(--line); align-items: end; }
.brow .name { grid-column: 1 / -1; display: grid; gap: 6px; min-width: 0; }
.brow .nm { font-size: 15px; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.brow .nm.mono { font: 500 13.5px var(--font-mono); }
.brow .sub { font-size: 13px; color: var(--muted); }
.brow .val { display: grid; gap: 1px; min-width: 0; font-variant-numeric: tabular-nums; color: var(--ink); font-size: 15px; }
.brow .val small { font-size: 11.5px; color: var(--muted); }
.bar { height: 6px; border-radius: 6px; background: var(--sunken); overflow: hidden; max-width: 420px; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--bar); transform-origin: left; animation: grow 600ms var(--ease) both; }
.bar.muted i { background: var(--bar-muted); }
.bar.warn i { background: var(--bar-warn); }
@keyframes grow { from { transform: scaleX(0.2); } to { transform: scaleX(1); } }
.brow.head { display: none; }
.brow.total { border-top: 1px solid var(--line-strong); }
.brow.total .nm { font-weight: 600; }
@media (min-width: 900px) {
  .brow, .brow.head { display: grid; grid-template-columns: minmax(0, 2.6fr) repeat(4, minmax(0, 1fr)); align-items: center; gap: 16px; }
  .brow .name { grid-column: auto; }
  .brow .val { text-align: right; }
  .brow .val small { display: none; }
  .brow.head { padding: 8px 0; border-top: 0; font-size: 12.5px; color: var(--muted); }
  .brow.head span:not(:first-child) { text-align: right; }
}
.bd-foot { font-size: 13px; color: var(--muted); }
.health { padding: 18px; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; margin-bottom: 16px; }
@media (min-width: 640px) { .health { padding: 22px 24px; } }
.health .sev { width: 40px; height: 40px; }
.health .sev svg.i { width: 20px; height: 20px; }
.health h2 { font-size: var(--t-md); margin-bottom: 6px; }
.health p { font-size: 15px; line-height: 1.55; max-width: 70ch; }
.health .next { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.health .next .btn { white-space: normal; text-align: left; padding-block: 8px; max-width: 100%; }
.updated { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.updated svg.i { width: 16px; height: 16px; }

/* ---------- Sheets (bottom sheet on phone, side panel on desktop) ---------- */
dialog.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0; padding: 0; border: 0;
  width: 100%; max-width: 100%; max-height: 92vh; max-height: 92dvh;
  background: var(--surface); color: var(--body);
  border-radius: 22px 22px 0 0; box-shadow: var(--shadow-pop); overflow: hidden;
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: sheetUp 300ms var(--ease) both; }
dialog.sheet::backdrop { background: var(--scrim, rgba(16, 20, 17, 0.5)); }
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (min-width: 960px) {
  dialog.sheet { inset: 0 0 0 auto; width: 520px; height: 100vh; height: 100dvh; max-height: 100dvh; border-radius: 22px 0 0 22px; }
  @keyframes sheetUp { from { transform: translateX(28px); opacity: 0.6; } to { transform: none; opacity: 1; } }
}
.sheet-head {
  display: grid; gap: 4px; padding: 10px 18px 14px; border-bottom: 1px solid var(--line); position: relative;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(64px, calc(env(safe-area-inset-right, 0px) + 56px));
}
.grabber { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); justify-self: center; margin: 0 0 8px; }
@media (min-width: 960px) { .grabber { display: none; } .sheet-head { padding-top: 22px; } }
.sheet-head h2 { font-size: var(--t-lg); }
.sheet-head .close { position: absolute; top: 12px; right: max(12px, env(safe-area-inset-right, 0px)); }
@media (min-width: 960px) { .sheet-head .close { top: 16px; } }
.sheet-body {
  overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 18px;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  flex: 1; min-height: 0; align-content: start;
}
.sheet-foot {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); background: var(--surface);
  padding-top: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
}
.namegen { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--result-bg); color: var(--result-ink); }
.namegen .lbl { font: 500 10.5px var(--font-sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--result-muted); }
.namegen .val { font: 500 15px var(--font-mono); color: var(--result-tag); overflow-wrap: anywhere; }
.namegen .parts { font: 400 12px var(--font-mono); color: var(--result-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chipbtn { min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 14px; color: var(--ink); }
.chipbtn[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: var(--on-forest); }
.pack { margin: 0; padding: 16px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); font: 400 12.5px/1.6 var(--font-mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: 14.5px; font-weight: 500;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast svg.i { width: 18px; height: 18px; color: var(--gold); }
@media (min-width: 960px) { .toast { bottom: 28px; left: calc(50% + 128px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* =====================================================================
   App additions (beyond the design pass): gate screens, module rail,
   states, skeletons, confirm rows, admin, account.
   ===================================================================== */
[hidden] { display: none !important; }
html { scrollbar-color: var(--line-strong) transparent; }
::selection { background: var(--accent-soft); color: var(--ink); }
.result ::selection { background: var(--result-sunken); color: var(--result-ink); }
input, textarea { caret-color: var(--accent); }
a { text-underline-offset: 3px; }
#main:focus { outline: none; }
.btn[disabled], .chipbtn[disabled], .icon-btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn-danger { background: var(--bad); color: var(--surface-2); }
.btn-danger:hover { filter: brightness(1.06); }
.stack { display: grid; gap: 18px; min-width: 0; }
.stack-sm { display: grid; gap: 10px; min-width: 0; }
.pair { display: grid; gap: 16px; }
@media (min-width: 560px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field-err:empty { display: none; }
.center { text-align: center; }
.pad-y { padding-block: 14px; }
.mono-inline { font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; color: var(--result-ink); }

/* Gate: loading, sign-in, offline */
.gate {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.gate-card { width: min(100%, 440px); display: grid; gap: 22px; }
.gate-brand { display: flex; align-items: center; gap: 10px; font: 600 20px var(--font-display); color: var(--ink); letter-spacing: -0.02em; }
.gate-brand .arch { width: 34px; height: 34px; }
.signin { display: grid; gap: 16px; padding: 26px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
@media (min-width: 560px) { .signin { padding: 32px 30px; } }
.signin-title { font-size: var(--t-xl); line-height: 1.12; }
.signin .lead { font-size: 16px; }
.devlink { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); background: var(--sunken); justify-items: start; }
.devlink-label { font: 500 12px var(--font-mono); color: var(--warn); letter-spacing: 0.04em; }

/* Calm states: empty, offline, error, no data */
.state { display: grid; justify-items: start; gap: 12px; }
.state p { max-width: 60ch; }
.state-card { padding: 28px 22px; }
@media (min-width: 640px) { .state-card { padding: 34px 32px; } }
.state-card .state, .state-card.state { justify-items: center; text-align: center; }
.state-card .arch-lg, .state-card > .arch-lg { width: 64px; height: 64px; color: var(--sage); }
.state-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.state-icon svg.i { width: 22px; height: 22px; }
.state-icon-warn { background: var(--warn-soft); color: var(--warn); }
.state-title { font-size: var(--t-lg); }
.gate .state-title { font-size: var(--t-xl); }

/* Skeletons */
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--sunken) 0%, var(--line) 50%, var(--sunken) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.sk-line { height: 12px; }
.sk-num { height: 28px; width: 48%; margin-top: 6px; }
.sk-bar { height: 6px; margin-top: 10px; }
.sk-row { padding: 16px 0; border-top: 1px solid var(--line); }
.sk-row:first-child { border-top: 0; }
.loading-card { padding: 18px; display: grid; gap: 12px; margin-bottom: 10px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* Shell: top bar actions, rail groups, account */
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions .avatar { width: 30px; height: 30px; }
.rail-brand { text-decoration: none; }
.rail-group { display: grid; gap: 2px; }
.rail-group + .rail-group { margin-top: 14px; }
.rail-group-label { font: 500 11px var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 4px 12px 6px; }
.rail-link svg.i { color: var(--muted); }
.rail-link[aria-current="page"] svg.i { color: var(--accent); }
.ws-card .ws-name { overflow-wrap: anywhere; }
.ws-select {
  width: 100%; min-height: 44px; padding: 8px 32px 8px 10px; margin: 2px 0;
  font: 600 15px var(--font-display); color: var(--ink); letter-spacing: -0.01em;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px;
}
.user { width: 100%; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; min-height: 56px; }
.user:hover .user-name { color: var(--accent); }
.user-text { display: grid; min-width: 0; line-height: 1.3; }
.user-name { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.user-text .hint { font-size: 12.5px; overflow-wrap: anywhere; }
.tabbar { grid-template-columns: repeat(var(--tabs, 3), minmax(0, 1fr)); }
.tab { min-width: 0; text-align: center; padding-inline: 2px; }
.tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
@media (max-width: 959px) { .view { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); } }

.acct { display: flex; align-items: center; gap: 14px; }
.avatar-lg { width: 48px; height: 48px; font-size: 15px; }
.acct-name { font-weight: 500; color: var(--ink); }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; line-height: 1.5; }
.steps-list .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 500 13px var(--font-mono); color: var(--accent); border: 1px solid var(--accent-line); }
.inline-ic { display: inline-grid; vertical-align: -4px; color: var(--accent); }
.inline-ic svg.i { width: 18px; height: 18px; }
.sheet-sub { font-size: 14.5px; color: var(--muted); line-height: 1.45; }

/* Toast */
.toast { max-width: min(560px, calc(100% - 32px)); border-radius: 18px; line-height: 1.4; }
.toast #toast-icon { display: inline-grid; }
.toast-warn svg.i { color: var(--warn-soft); }

/* Inline confirm */
.confirm { display: grid; gap: 10px; padding: 14px; margin: 6px 0; border-radius: var(--r-sm); background: var(--bad-soft); border: 1px solid var(--line); }
.confirm-q { font-size: 14.5px; color: var(--ink); line-height: 1.45; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Builder additions */
.picker-current.is-loading { min-height: 64px; display: grid; align-content: center; }
.picker-empty { border-style: dashed; border-color: var(--accent-line); }
.picker-empty .plus { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px dashed var(--accent-line); color: var(--accent); }
.pc-status { margin-top: 4px; }
.tile-wrap { display: grid; gap: 18px; }
.tiles-foot { display: flex; gap: 8px; align-items: flex-start; padding-top: 4px; }
.tiles-foot svg.i { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.tiles-foot b { font-weight: 500; color: var(--body); }
.seg-wrap { flex-wrap: wrap; border-radius: var(--r-sm); }
.seg-wrap button { white-space: normal; text-align: left; border-radius: 10px; padding-block: 8px; }
.field .chips { margin-bottom: 2px; }
.chipbtn { min-height: 44px; }
.result-ch { font: 500 12px var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--result-muted); }
.rnotes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rnote { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; padding: 10px 12px; border-radius: 10px; }
.rnote svg.i { width: 16px; height: 16px; margin-top: 2px; }
.rnote-info { background: var(--result-sunken); color: var(--result-ink); }
.rnote-info svg.i { color: var(--result-tag); }
.rnote-warn { background: var(--warn-soft); color: var(--warn); }
.rlabel { font-size: 13.5px; color: var(--result-muted); margin-bottom: -8px; }
.result .note.err { margin: 0; }

/* Check a link */
.check-empty { display: grid; gap: 12px; justify-items: start; }
.check-summary { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-sm); background: var(--sunken); }
.check-head { font-weight: 500; color: var(--ink); }
.check-group { display: grid; gap: 4px; }
.finding-msg { font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.finding-fix { font-size: 14px; line-height: 1.5; color: var(--body); margin-top: 4px; }
.finding-fix b { font-weight: 500; }
.explain { margin: 0; }
.explain dd { margin: 0; }
.sev-info { background: var(--sunken); color: var(--muted); }

/* Campaigns additions */
.seg-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.lib-tools .seg { max-width: 100%; }
.list-empty { padding: 18px 4px; }
.detail-title { font-size: clamp(22px, 2.6vw, 28px); }
.name-tag { justify-self: start; }
.facts a { overflow-wrap: anywhere; }
.lgroup-ch { margin: 8px 0 0; font: 500 13px var(--font-sans); color: var(--muted); }
.lrow-actions { display: flex; gap: 6px; }
.lrow-by { font-size: 12.5px; color: var(--muted); }
.icon-btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn-quiet:hover { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.links-box { display: grid; gap: 18px; }
.links-empty { padding: 16px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); color: var(--body); font-size: 14.5px; }
.fixed .sec-label { margin-bottom: -2px; }

/* Results additions */
.res-controls { margin-bottom: 18px; }
.kpi-cmp .d-down { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 12px; height: 6px; border-radius: 3px; background: var(--bar); }
.lg-other::before { background: var(--bar-muted); }
.lg-warn::before { background: var(--bar-warn); }
.brow.is-untagged .nm { color: var(--warn); }
.offenders { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.offenders li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--sunken); }
.off-camp { font: 400 12.5px var(--font-mono); color: var(--muted); overflow-wrap: anywhere; }
.off-why { font-size: 14px; color: var(--body); }
.health > div { min-width: 0; }

/* Admin */
.ws-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .ws-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .ws-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ws-item { padding: 20px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.ws-item.is-open { border-color: var(--accent-line); }
.ws-item-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ws-item-title { display: grid; gap: 2px; min-width: 0; }
.ws-item h2 { font-size: var(--t-lg); }
.ws-stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 0; border-block: 1px solid var(--line); }
.ws-stat { display: grid; gap: 2px; min-width: 0; }
.ws-stat dt { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.ws-stat dd { margin: 0; font: 600 18px var(--font-display); color: var(--ink); letter-spacing: -0.01em; }
.ws-stat.is-warn dd { color: var(--warn); }
.flabel-sm { font-size: 13.5px !important; color: var(--muted) !important; }
.chip-toggle { display: inline-flex; align-items: center; gap: 6px; }
.chip-toggle svg.i { width: 16px; height: 16px; }
.mlist { display: grid; }
.mrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mrow-main { display: grid; min-width: 0; }
.mrow-main .hint { overflow-wrap: anywhere; }
.mrow-name { font-weight: 500; color: var(--ink); }

/* Public vendor pack page */
.pk { max-width: 760px; margin-inline: auto; padding: max(28px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(48px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 22px; }
.pk-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pk-org { display: flex; align-items: center; gap: 10px; font: 600 16px var(--font-display); color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.pk-org .arch { width: 28px; height: 28px; }
.pk-card { padding: 20px; display: grid; gap: 14px; }
@media (min-width: 640px) { .pk-card { padding: 24px 26px; } }
.pk-link { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.pk-link:first-of-type { border-top: 0; }
.pk-label { font-weight: 500; color: var(--ink); }
.pk-url { font: 400 13px/1.6 var(--font-mono); color: var(--ink); overflow-wrap: anywhere; padding: 10px 12px; border-radius: 10px; background: var(--sunken); }
.pk-url .t { color: var(--tag-ink); }
.pk-rules { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.pk-foot { font-size: 13px; color: var(--muted); }
.brow .sub.mono-sub { font: 400 12.5px var(--font-mono); overflow-wrap: anywhere; }
@media (max-width: 1099px) { .lib { grid-template-columns: minmax(0, 1fr); } }
.list-wrap, .detail-wrap { min-width: 0; }
.topbar .ws { min-width: 0; }
.topbar .ws-name, .topbar .ws-host { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand { flex: 1; }
.toast { width: max-content; }
.detail-back { justify-self: start; }
.bd-head .seg { width: 100%; }
.bd-head .seg button { flex: 1 1 auto; padding-inline: 8px; }
@media (min-width: 640px) { .bd-head .seg { width: auto; } .bd-head .seg button { padding-inline: 14px; } }
.ws-stat { align-content: space-between; }
.input::placeholder { color: var(--muted); opacity: 1; }
