/* ==================================================================
   Social Handles Quality Tool — neutral internal-tool aesthetic
   ================================================================== */

:root {
  /* Brand-neutral: stone + one calm accent */
  --bg:        #FAFAF9;
  --surface:   #FFFFFF;
  --surface-2: #F5F5F4;
  --border:    #E7E5E4;
  --border-2:  #D6D3D1;
  --ink:       #1C1917;
  --ink-2:     #44403C;
  --muted:     #78716C;
  --muted-2:   #A8A29E;

  /* Accent (tweakable) */
  --accent:    #4F46E5;  /* indigo-600 */
  --accent-2:  #EEF2FF;
  --accent-ink:#312E81;

  /* Status semantic */
  --ok:        #16A34A;
  --ok-2:      #DCFCE7;
  --warn:      #D97706;
  --warn-2:    #FEF3C7;
  --err:       #DC2626;
  --err-2:     #FEE2E2;
  --info:      #0284C7;
  --info-2:    #E0F2FE;

  --radius:    6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(24,24,27,.04), 0 1px 1px rgba(24,24,27,.03);
  --shadow-md: 0 4px 12px rgba(24,24,27,.06), 0 2px 4px rgba(24,24,27,.04);
  --shadow-lg: 0 20px 40px -8px rgba(24,24,27,.18), 0 8px 16px -4px rgba(24,24,27,.08);

  /* Density */
  --row-h:     40px;
  --tile:      28px;
}

[data-density="comfortable"] { --row-h: 52px; --tile: 32px; }
[data-density="compact"]     { --row-h: 36px; --tile: 26px; }

[data-theme="dark"] {
  --bg:        #0C0A09;
  --surface:   #1C1917;
  --surface-2: #292524;
  --border:    #292524;
  --border-2:  #44403C;
  --ink:       #FAFAF9;
  --ink-2:     #E7E5E4;
  --muted:     #A8A29E;
  --muted-2:   #78716C;
  --accent-2:  #1E1B4B;
  --accent-ink:#C7D2FE;
  --ok-2:      #052E16;
  --warn-2:    #451A03;
  --err-2:     #450A0A;
  --info-2:    #082F49;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 40px -8px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.003em;
}
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }

button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================== App shell ================== */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100vh;
  background: var(--bg);
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.sb-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 14px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.sb-brand .mark {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 5px;
  background: var(--ink);
  color: var(--surface);
  font-size: 11px; font-weight: 700;
}
.sb-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 12px 8px 4px;
  font-weight: 500;
}
.sb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}
.sb-item:hover { background: var(--surface-2); }
.sb-item.active {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 500;
}
.sb-item .sb-icon { width: 14px; display: inline-flex; justify-content: center; color: var(--muted); }
.sb-item.active .sb-icon { color: var(--ink); }
.sb-item .sb-badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 10px;
  padding: 1px 6px;
  font-variant-numeric: tabular-nums;
}
.sb-item.active .sb-badge { background: var(--accent-2); color: var(--accent-ink); }

.sb-user {
  margin-top: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  background: var(--accent-2); color: var(--accent-ink);
  flex: none;
}

/* ================== Main ================== */
.main {
  display: flex; flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.topbar {
  height: 48px;
  flex: none;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 12px;
  background: var(--surface);
}
.topbar h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.topbar .crumb {
  color: var(--muted);
  font-size: 13px;
}
.topbar .crumb a { color: var(--muted); }

.scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

/* ================== Filters bar ================== */
.filters {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.search {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 8px;
  background: var(--surface);
  min-width: 240px;
  flex: 0 0 280px;
}
.search:focus-within { border-color: var(--border-2); box-shadow: 0 0 0 3px var(--accent-2); }
.search input {
  border: 0; outline: 0; background: transparent;
  width: 100%;
  font-size: 13px;
}
.search .kbd { font-size: 10px; color: var(--muted); background: var(--surface-2); padding: 1px 4px; border-radius: 3px; border:1px solid var(--border); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { border-color: var(--border-2); }
.chip.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.active .count { color: var(--muted-2); }

.spacer { flex: 1; }

/* ================== Progress header ================== */
.progress-strip {
  display: flex;
  padding: 14px 16px;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  display: flex;
}
.progress-bar span {
  height: 100%;
  display: block;
}
.stat {
  font-size: 12px;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.stat b { color: var(--ink); font-weight: 600; font-size: 13px; }
.stat .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* ================== Table ================== */
.table-wrap { padding: 0; }
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
table.data thead th {
  position: sticky; top: 0;
  z-index: 2;
  background: var(--bg);
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data tbody td {
  height: var(--row-h);
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr { cursor: pointer; background: var(--surface); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr.sel {
  background: var(--accent-2);
}
table.data tbody tr.sel td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.nm { font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.nm .nmavatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  flex: none;
}
.muted { color: var(--muted); }
.country {
  display: inline-flex; align-items: center;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ================== Platform tile (the key visual) ================== */
.tile-row {
  display: flex;
  gap: 5px;
  align-items: center;
}
.tile {
  width: var(--tile);
  height: var(--tile);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: default;
}
.tile .tile-lbl {
  flex: 1;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted-2);
}
.tile .tile-bar {
  height: 3px;
  background: transparent;
}

/* States */
.tile.missing      { background: var(--surface);     border: 1px dashed var(--border-2); }
.tile.missing .tile-lbl { color: var(--muted-2); }

.tile.unverified   { background: var(--warn-2); border-color: #FCD34D; }
.tile.unverified .tile-lbl { color: #92400E; }
.tile.unverified .tile-bar { background: var(--warn); }

.tile.verified     { background: var(--surface); border-color: var(--border-2); }
.tile.verified .tile-lbl { color: var(--ink); }
.tile.verified .tile-bar { background: var(--ok); }

.tile.qc           { background: var(--ok-2); border-color: #86EFAC; }
.tile.qc .tile-lbl { color: #14532D; }
.tile.qc .tile-bar { background: var(--ok); box-shadow: inset 0 3px 0 #14532D; }

.tile.non-existing { background: var(--surface); border: 1px solid var(--border); }
.tile.non-existing .tile-lbl {
  color: var(--muted-2);
  position: relative;
}
.tile.non-existing .tile-lbl::after {
  content: "";
  position: absolute;
  left: 3px; right: 3px; top: 50%;
  border-top: 1.5px solid var(--muted);
  transform: rotate(-18deg);
}

[data-theme="dark"] .tile.unverified { background: #3B2A0A; border-color:#78350F; }
[data-theme="dark"] .tile.unverified .tile-lbl { color:#FDE68A; }
[data-theme="dark"] .tile.qc { background: #052e16; border-color:#14532D; }
[data-theme="dark"] .tile.qc .tile-lbl { color:#86EFAC; }

.tile.lg { width: 42px; height: 42px; border-radius: 7px; }
.tile.lg .tile-lbl { font-size: 13px; }
.tile.lg .tile-bar { height: 4px; }
.tile.xl { width: 56px; height: 56px; border-radius: 8px; }
.tile.xl .tile-lbl { font-size: 16px; }
.tile.xl .tile-bar { height: 5px; }

/* Tile selected ring */
.tile.selected { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Ratio bar */
.ratio {
  display: inline-flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.ratio .bar {
  width: 52px; height: 4px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
}
.ratio .bar span { height: 100%; display: block; }

/* ================== Status pill ================== */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  height: 20px;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill.ok   { background: var(--ok-2);   color: #14532D; }
.pill.warn { background: var(--warn-2); color: #92400E; }
.pill.err  { background: var(--err-2);  color: #7F1D1D; }
.pill.info { background: var(--info-2); color: #0C4A6E; }
.pill.neutral { background: var(--surface-2); color: var(--ink-2); }

[data-theme="dark"] .pill.ok { color: #86EFAC; }
[data-theme="dark"] .pill.warn { color: #FDE68A; }
[data-theme="dark"] .pill.err { color: #FCA5A5; }
[data-theme="dark"] .pill.info { color: #7DD3FC; }

/* ================== Button ================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  height: 30px;
  transition: background .08s ease, border-color .08s ease;
}
.btn:hover { background: var(--surface-2); }
.btn.primary {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.btn.primary:hover { background: #000; }
.btn.accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn.ok {
  background: var(--ok);
  color: #fff; border-color: var(--ok);
}
.btn.ok:hover { background: #15803D; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { height: 26px; padding: 3px 8px; font-size: 12px; border-radius: 4px; }
.btn.icon { width: 30px; padding: 0; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.kbd-hint {
  display: inline-block;
  min-width: 16px;
  padding: 1px 4px;
  font-size: 10px;
  font-family: ui-monospace, monospace;
  background: rgba(255,255,255,.15);
  border-radius: 3px;
  margin-left: 2px;
  font-weight: 500;
}
.btn:not(.primary):not(.accent):not(.ok) .kbd-hint { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ================== Detail view (primary surface) ================== */
.detail {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100%;
  min-height: 0;
}

/* — Left column: queue — */
.queue {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
  min-height: 0;
}
.queue-head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.queue-head .q-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.queue-head .q-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.queue-list { overflow: auto; flex: 1; }
.queue-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
}
.queue-row:hover { background: var(--surface-2); }
.queue-row.active {
  background: var(--accent-2);
  box-shadow: inset 3px 0 0 var(--accent);
}
.queue-row .qr-name { font-weight: 500; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.queue-row .qr-meta { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.queue-row .qr-tiles { display: flex; gap: 3px; }
.queue-row .tile { --tile: 20px; }
.queue-row .tile .tile-lbl { font-size: 8px; }
.queue-row .tile .tile-bar { height: 2px; }

/* — Middle column: verification — */
.verify {
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: auto;
}
.verify-head {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column; gap: 8px;
}
.verify-head .vh-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  display: flex; align-items: center; gap: 10px;
}
.verify-head .vh-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex; gap: 10px; align-items: center;
}
.verify-head .vh-meta span::after { content: "·"; margin-left: 10px; color: var(--border-2); }
.verify-head .vh-meta span:last-child::after { display: none; }

.verify-head .vh-tiles { display: flex; gap: 6px; margin-top: 2px; }

.verify-body {
  padding: 10px 22px 28px;
  background: var(--bg);
  min-height: 100%;
}

/* Platform verification card */
.pcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 10px 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.pcard.focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-2);
}
.pcard-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.pcard-head .plat { font-weight: 600; font-size: 14px; }
.pcard-head .plat-sub { font-size: 12px; color: var(--muted); }
.pcard-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.pcard-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.pcard-body > div {
  background: var(--surface);
  padding: 12px 14px;
  min-height: 56px;
  display: flex; flex-direction: column; gap: 4px;
}
.src-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}
.src-handle {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 4px;
  word-break: break-all;
}
.src-handle.empty { color: var(--muted-2); font-style: italic; font-family: inherit; }
.src-handle .ext { opacity: .7; }
.src-match {
  font-size: 11px;
  margin-top: 2px;
  color: var(--muted);
}

.pcard-resolve {
  background: var(--surface-2);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pcard-resolve .resolve-input {
  flex: 1;
  min-width: 220px;
  display: flex; align-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
.pcard-resolve .resolve-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
.pcard-resolve .resolve-input .prefix { color: var(--muted); margin-right: 2px; }
.pcard-resolve .resolve-input input {
  border: 0; outline: 0; background: transparent;
  flex: 1;
  font-family: inherit;
  font-size: inherit;
  color: var(--ink);
  min-width: 80px;
}
.pcard-actions { display: flex; gap: 6px; }

.match-ok  { color: var(--ok); }
.match-mismatch { color: var(--warn); }
.match-onesided { color: var(--muted); }

/* — Right column: activity / notes — */
.activity {
  border-left: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 16px;
  overflow: auto;
}
.activity h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 500; margin: 18px 0 10px;
}
.activity h3:first-child { margin-top: 0; }
.activity textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--surface);
  font-size: 13px;
}
.activity textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }

.audit {
  display: flex; flex-direction: column; gap: 10px;
  font-size: 12px;
}
.audit .ev {
  display: flex; gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.audit .ev:last-child { border: 0; }
.audit .ev .avatar { width: 20px; height: 20px; font-size: 9px; }
.audit .ev-body { flex: 1; }
.audit .ev-line { color: var(--ink-2); }
.audit .ev-line b { font-weight: 500; color: var(--ink); }
.audit .ev-when { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* Batch verify footer */
.verify-foot {
  position: sticky; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 22px;
  display: flex; align-items: center; gap: 10px;
  z-index: 5;
}
.verify-foot .progress-inline {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.verify-foot .progress-inline .bar {
  flex: 1; height: 4px; background: var(--surface-2); border-radius: 99px; overflow: hidden;
}
.verify-foot .progress-inline .bar span { display: block; height: 100%; background: var(--accent); }

/* ================== Modal ================== */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(12,10,9,.45);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: grid; place-items: center;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 560px;
  max-width: 92vw;
  overflow: hidden;
  border: 1px solid var(--border);
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.modal-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }

.checkrow { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px dashed var(--border); }
.checkrow:last-child { border: 0; }
.checkrow input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); }

/* ================== Tweaks panel ================== */
.tweaks {
  position: fixed; right: 16px; bottom: 16px;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  font-size: 13px;
}
.tweaks h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 10px; color: var(--muted); font-weight: 500; }
.tweak-row { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; }
.tweak-row label { color: var(--ink-2); }
.seg {
  display: inline-flex; background: var(--surface-2); border-radius: 5px; padding: 2px; gap: 2px;
  border: 1px solid var(--border);
}
.seg button { background: transparent; border: 0; padding: 3px 8px; border-radius: 4px; font-size: 11px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.accent-dots { display: inline-flex; gap: 4px; }
.accent-dots button {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  background: var(--c);
}
.accent-dots button.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg); }

/* ================== Compact row layout ================== */
.verify-body.compact {
  padding: 14px 22px 28px;
  overflow-x: auto;
}
.prow {
  display: grid;
  grid-template-columns: 170px 110px 110px minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 0;
  min-height: 48px;
}
.prow:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-top: 1px solid var(--border); }
.prow:last-child  { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.prow.head {
  background: var(--surface-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
  min-height: 32px;
  padding: 6px 12px;
}
.prow.done { background: var(--surface); }
.prow.qc { background: #F7FDF9; }
[data-theme="dark"] .prow.qc { background: #0F1A12; }
.prow.missing { background: #FAFAF9; }
[data-theme="dark"] .prow.missing { background: #14110F; }

.prow-pl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prow-pl .pl-name { font-weight: 500; font-size: 13px; color: var(--ink); line-height: 1.1; }
.prow-pl .pl-stat { font-size: 11px; color: var(--muted); line-height: 1.2; }

.tile-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;
  line-height: 0;
  position: relative;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.tile-toggle:hover { transform: scale(1.08); }
.tile-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-toggle.off { opacity: 0.4; filter: grayscale(1); }
.tile-toggle.off::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1.5px;
  background: var(--err);
  transform: translateY(-50%) rotate(-22deg);
  border-radius: 2px;
}

.prow.non-existing .prow-handle,
.prow.non-existing .prow-src {
  opacity: 0.35;
  text-decoration: line-through;
  text-decoration-color: var(--border-2);
}
.prow.non-existing .pl-name { color: var(--muted); }

.absent-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
.absent-note svg { color: var(--muted-2); }

/* Soft-lock presence chip on list rows */
.lock-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: help;
}
.lock-chip .avatar.xs {
  background: var(--accent-2);
  color: var(--accent-ink);
  border: 1.5px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.lock-chip .presence {
  right: -2px; bottom: -2px;
  width: 7px; height: 7px;
}

/* Collision warning modal */
.modal.collide {
  max-width: 460px;
  padding: 20px 22px 16px;
}
.collide-head {
  display: flex; gap: 14px; align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.collide-head .avatar.lg {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-2);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 600;
  flex-shrink: 0;
}
.collide-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.collide-sub { font-size: 12px; color: var(--muted); }
.collide-body {
  font-size: 13px; color: var(--ink-2);
  margin: 14px 0 18px;
  line-height: 1.5;
}
.collide-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}

.prow-src { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-src .mono { font-family: ui-monospace, monospace; font-size: 12px; }
.prow-src .none { color: var(--muted-2); }
.prow-src.mm .mono { color: var(--warn); }

.prow-handle { min-width: 0; }
.handle-input {
  display: flex; align-items: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 6px;
  background: var(--surface);
  font-size: 12px;
}
.handle-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
.handle-input .prefix { color: var(--muted); font-family: ui-monospace, monospace; font-size: 11px; margin-right: 2px; white-space: nowrap; }
.handle-input input {
  border: 0; outline: 0; background: transparent;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  min-width: 40px;
  flex: 1;
  padding: 2px 0;
}
.chip-mini {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 3px;
  margin-left: 4px;
  padding: 0;
  cursor: pointer;
}
.chip-mini:hover { background: var(--accent-2); color: var(--accent-ink); border-color: var(--accent); }

.prow-actions { display: flex; gap: 4px; align-items: center; white-space: nowrap; }

/* Narrow-viewport fallback: stack into 2 rows per platform */
@media (max-width: 1320px) {
  .prow, .prow.head {
    grid-template-columns: 170px minmax(220px, 1fr);
    grid-template-areas:
      "pl    handle"
      "pl    sources"
      "pl    actions";
    row-gap: 8px;
    padding: 10px 12px;
  }
  .prow.head { display: none; }
  .prow-pl { grid-area: pl; align-self: start; padding-top: 2px; }
  .prow-handle { grid-area: handle; min-width: 0; }
  .prow-actions { grid-area: actions; justify-content: flex-start; flex-wrap: wrap; row-gap: 6px; }
  .prow-src:nth-of-type(2) { grid-area: sources; display: inline-flex; align-items: center; gap: 6px; overflow: hidden; }
  .prow-src:nth-of-type(2)::before { content: "ST:"; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; flex-shrink: 0; }
  .prow-src:nth-of-type(3) { grid-area: sources; justify-self: end; display: inline-flex; align-items: center; gap: 6px; overflow: hidden; max-width: 50%; }
  .prow-src:nth-of-type(3)::before { content: "MC:"; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; flex-shrink: 0; }
  .prow-src .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ================== Report view ================== */
.report-scope {
  display: flex; gap: 6px; align-items: center; padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.report-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  min-height: 96px;
}
.metric .m-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 500; }
.metric .m-val { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric .m-sub { font-size: 12px; color: var(--muted); }
.metric.accent { background: linear-gradient(180deg, var(--accent-2), var(--surface)); border-color: var(--accent); }
.metric.accent .m-val { color: var(--accent-ink); }
.metric .m-delta { font-size: 11px; font-weight: 500; }
.metric .m-delta.up { color: var(--ok); }
.metric .m-delta.down { color: var(--err); }

.report-section {
  padding: 0 16px 20px;
}
.report-section h2 {
  font-size: 13px; font-weight: 600; margin: 18px 0 8px;
}
.report-section .sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

.sbs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.sbs .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.sbs .panel-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.sbs .panel-head .mark {
  width: 26px; height: 26px; border-radius: 5px;
  background: var(--surface-2);
  color: var(--ink);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
}
.sbs .panel-head .src-name { font-size: 14px; font-weight: 600; }
.sbs .panel-head .src-count { font-size: 12px; color: var(--muted); }

.stack {
  height: 12px;
  border-radius: 99px;
  overflow: hidden;
  display: flex;
  background: var(--surface-2);
  margin: 6px 0 12px;
}
.stack span { display: block; height: 100%; }
.stack-legend {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
  font-size: 12px;
}
.stack-legend .ll { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.stack-legend .ll b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; margin-left: auto; }
.stack-legend .ll .sw { width: 10px; height: 10px; border-radius: 2px; }

.platform-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.platform-table thead th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
  text-align: right;
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
}
.platform-table thead th:first-child { text-align: left; }
.platform-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.platform-table td:first-child { text-align: left; }
.platform-table tr:last-child td { border-bottom: 0; }
.platform-table .pcell { display: flex; align-items: center; gap: 8px; }
.platform-table .pbar {
  display: inline-flex;
  width: 60px; height: 4px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-left: auto;
}
.platform-table .pbar span { display: block; height: 100%; background: var(--ok); }

.sbs .panel.wide {
  grid-column: span 2;
}

/* ================== Remove stale 3-col leftovers ================== */

/* ================== Misc ================== */
.hr { height: 1px; background: var(--border); margin: 12px 0; }
.empty {
  padding: 60px 40px;
  text-align: center;
  color: var(--muted);
}
.empty .big { font-size: 16px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }

.kbd-legend {
  font-size: 11px;
  color: var(--muted);
  display: flex; gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.kbd-legend .kbd { background: var(--surface-2); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--border); font-family: ui-monospace, monospace; font-size: 10px; margin: 0 2px; }

/* Scrollbar */
.scroll::-webkit-scrollbar, .queue-list::-webkit-scrollbar, .verify::-webkit-scrollbar, .activity::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb, .queue-list::-webkit-scrollbar-thumb, .verify::-webkit-scrollbar-thumb, .activity::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; border: 2px solid var(--bg); }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ================== Legend strip ================== */
.legend {
  padding: 8px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex; gap: 16px; align-items: center;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}
.legend .lg-item { display: flex; align-items: center; gap: 6px; }
.legend .lg-item .mini { --tile: 16px; }
.legend .lg-item .mini .tile-lbl { font-size: 7px; }
.legend .lg-item .mini .tile-bar { height: 2px; }

/* ================== Toast ================== */
.toast {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--surface);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex; align-items: center; gap: 8px;
  animation: toast-in .2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}


/* ================== Team activity log ================== */
.team-log {
  display: flex; flex-direction: column;
  gap: 2px;
  padding: 2px 6px 8px;
  max-height: 260px;
  overflow-y: auto;
}
.team-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.12s ease;
}
.team-row:hover { background: var(--surface-2); }
.team-av { position: relative; flex-shrink: 0; }
.avatar.xs {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-2);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: 0.02em;
}
.presence {
  position: absolute;
  right: -1px; bottom: -1px;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}
.presence.online { background: #22C55E; }
.presence.idle { background: #F59E0B; }
.presence.offline { background: var(--border-2); }
.team-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  display: flex; align-items: center; gap: 6px;
}
.team-role {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
}
.team-act {
  font-size: 11px;
  color: var(--ink-2);
  line-height: 1.3;
  margin-top: 1px;
  display: flex; align-items: baseline; gap: 5px;
  flex-wrap: wrap;
}
.team-verb {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}
.team-verb.reviewing { background: #DBEAFE; color: #1D4ED8; }
.team-verb.qc        { background: #DCFCE7; color: #15803D; }
[data-theme="dark"] .team-verb.reviewing { background: #1E3A8A33; color: #93C5FD; }
[data-theme="dark"] .team-verb.qc        { background: #14532D33; color: #86EFAC; }
.team-target {
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}
.team-row.offline { opacity: 0.55; }

.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: live-pulse 1.8s infinite;
  display: inline-block;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}


/* ================== Data views (activity log, source quality) ================== */
.select-inline {
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
  padding: 4px 8px; font-size: 12px; color: var(--ink); font-family: inherit; cursor: pointer;
}
.select-inline:hover { border-color: var(--border-2); }

.user-summary-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px;
}
.user-summary {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px;
}
.us-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.us-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.us-stack > div { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; }
.us-lab { color: var(--muted); }
.us-stack b { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); font-size: 13px; }

.log-feed { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.log-row {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--surface); cursor: pointer; font-size: 12px;
}
.log-row:hover { background: var(--surface-2); }
.log-user { font-weight: 500; color: var(--ink); min-width: 110px; }
.log-target { font-weight: 500; color: var(--ink); }
.log-sub { color: var(--muted); }
.log-detail { color: var(--ink-2); font-style: italic; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-time { margin-left: auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

/* Log table */
.log-search-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.log-search-input-wrap {
  display: flex; align-items: center; gap: 6px;
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 5px 10px; background: var(--surface);
  transition: border-color 0.12s;
}
.log-search-input-wrap:focus-within { border-color: var(--accent); }
.log-search-input {
  flex: 1; border: none; outline: none; background: transparent;
  font: inherit; font-size: 13px; color: var(--ink);
}
.log-table-wrap {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden;
}
.log-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.log-table thead tr {
  background: var(--surface-2);
}
.log-table th {
  padding: 8px 12px; text-align: left;
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.log-tr { background: var(--surface); }
.log-tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.log-tr:hover td { background: var(--surface-2); }
.log-tr td { padding: 9px 12px; vertical-align: middle; }
.log-td-user { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.log-username { font-weight: 500; color: var(--ink); }
.log-td-platform { color: var(--ink-2); }
.log-td-since { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-person-btn {
  appearance: none; border: none; background: none; padding: 0;
  font: inherit; font-size: 12px; font-weight: 500; color: var(--ink);
  cursor: pointer; text-align: left;
  text-decoration: underline; text-underline-offset: 2px; text-decoration-color: transparent;
  transition: text-decoration-color 0.12s;
}
.log-person-btn:hover { text-decoration-color: var(--border-2); color: var(--accent); }
.log-empty {
  padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13px;
}
.log-status-chip {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: .06em; white-space: nowrap; text-transform: uppercase;
}
.lsc-verified   { background: #DBEAFE; color: #1D4ED8; }
.lsc-qc         { background: #DCFCE7; color: #15803D; }
.lsc-absent     { background: #FEE2E2; color: #991B1B; }
.lsc-unverified { background: #FEF3C7; color: #92400E; }
[data-theme="dark"] .lsc-verified   { background: #1E3A8A33; color: #93C5FD; }
[data-theme="dark"] .lsc-qc         { background: #14532D33; color: #86EFAC; }
[data-theme="dark"] .lsc-absent     { background: #7F1D1D33; color: #FCA5A5; }
[data-theme="dark"] .lsc-unverified { background: #78350F33; color: #FCD34D; }
.log-pagination {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; justify-content: center;
}
.log-page-info { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.team-verb.edit { background: #FEF3C7; color: #92400E; }
.team-verb.off  { background: #FEE2E2; color: #991B1B; }
[data-theme="dark"] .team-verb.edit { background: #78350F33; color: #FCD34D; }
[data-theme="dark"] .team-verb.off  { background: #7F1D1D33; color: #FCA5A5; }

.sq-lab { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
.sq-val { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); margin-top: 2px; }
.stack-legend i { color: var(--muted); font-style: normal; font-size: 10px; margin-left: 2px; }


/* ================== Source quality: pain cards ================== */
.pain-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px;
}
.pain-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; min-height: 110px;
  position: relative;
  overflow: hidden;
}
.pain-card.tone-err { border-color: color-mix(in oklab, var(--err) 30%, var(--border)); background: color-mix(in oklab, var(--err) 4%, var(--surface)); }
.pain-card.tone-ok  { border-color: color-mix(in oklab, var(--ok) 30%, var(--border)); background: color-mix(in oklab, var(--ok) 4%, var(--surface)); }
.pain-head { display: flex; align-items: center; gap: 6px; }
.pain-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--muted); }
.pain-card.tone-err .pain-head { color: var(--err); }
.pain-card.tone-err .pain-label { color: var(--err); }
.pain-card.tone-ok .pain-head { color: var(--ok); }
.pain-card.tone-ok .pain-label { color: var(--ok); }
.pain-main { display: flex; align-items: center; gap: 10px; }
.pain-primary { font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pain-sub { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.pain-value { margin-left: auto; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pain-card.tone-err .pain-value { color: var(--err); }
.pain-card.tone-ok .pain-value { color: var(--ok); }


/* ================== Guide ================== */
.guide-wrap {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 32px 60px;
  overflow-y: auto;
  height: 100%;
}
.guide-toc {
  position: sticky; top: 24px;
  align-self: start;
  display: flex; flex-direction: column;
  gap: 1px;
  border-left: 1px solid var(--border);
  max-height: calc(100vh - 120px);
}
.guide-toc button {
  appearance: none; border: 0; background: transparent;
  text-align: left; padding: 6px 12px;
  font: inherit; font-size: 12px; color: var(--muted); cursor: pointer;
  border-left: 2px solid transparent; margin-left: -1px;
}
.guide-toc button:hover { color: var(--ink); }
.guide-toc button.on {
  color: var(--ink); font-weight: 500;
  border-left-color: var(--accent);
}
.guide-body { min-width: 0; }
.guide-body section { margin-bottom: 48px; scroll-margin-top: 24px; }

/* ================== Activity grid (team activity view) ================== */
.activity-grid {
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
  gap: 12px;
}

.activity-card {
  background: var(--surface); 
  border: 1px solid var(--border); 
  border-radius: var(--radius-lg); 
  padding: 14px 16px;
  display: flex; 
  flex-direction: column; 
  gap: 12px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.activity-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-sm);
}

.activity-header {
  display: flex; 
  align-items: center; 
  gap: 12px;
}

.activity-details {
  display: grid; 
  grid-template-columns: 1fr;
  gap: 8px;
}

.activity-field {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 4px 0;
}

.field-label {
  font-size: 11px; 
  color: var(--muted); 
  text-transform: uppercase; 
  letter-spacing: 0.06em; 
  font-weight: 500;
}

.field-value {
  font-size: 12px; 
  color: var(--ink); 
  font-weight: 500;
  text-align: right;
}

.status-badge {
  display: inline-flex; 
  align-items: center; 
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge.online {
  background: var(--ok-2);
  color: #14532D;
}

.status-badge.idle {
  background: var(--warn-2);
  color: #92400E;
}

.status-badge.offline {
  background: var(--surface-2);
  color: var(--muted);
}

[data-theme="dark"] .status-badge.online {
  background: #052e16;
  color: #86EFAC;
}

[data-theme="dark"] .status-badge.idle {
  background: #451A03;
  color: #FDE68A;
}

.status-dot {
  width: 6px; 
  height: 6px; 
  border-radius: 50%;
  flex-shrink: 0;
}

.summary-stats {
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); 
  gap: 12px;
  margin-top: 12px;
}

.stat-card {
  background: var(--surface); 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 12px 14px;
  display: flex; 
  flex-direction: column; 
  gap: 8px;
}

.stat-header {
  display: flex; 
  align-items: center; 
  gap: 8px;
}

.stat-label {
  font-size: 11px; 
  color: var(--muted); 
  text-transform: uppercase; 
  letter-spacing: 0.06em; 
  font-weight: 500;
}

.stat-value {
  font-size: 24px; 
  font-weight: 600; 
  color: var(--ink); 
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.guide-h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 12px; line-height: 1.2; }
.guide-h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 12px; padding-top: 8px; border-top: 1px solid var(--border); padding-top: 24px; }
.guide-body p { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin: 0 0 12px; }
.guide-body p.guide-lead { font-size: 15px; color: var(--ink); }
.guide-body b { color: var(--ink); font-weight: 600; }

.guide-callout {
  background: var(--accent-2); border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 4px;
  font-size: 13px; line-height: 1.5; color: var(--ink);
  margin: 12px 0;
}
.guide-callout.warn { background: color-mix(in oklab, var(--warn) 10%, var(--surface)); border-left-color: var(--warn); }

.pipeline {
  display: flex; align-items: stretch; gap: 12px;
  margin: 16px 0 8px;
  flex-wrap: wrap;
}
.step {
  flex: 1; min-width: 180px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; display: flex; gap: 12px;
}
.step-num {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.step-title { font-weight: 600; font-size: 14px; color: var(--ink); }
.step-sub { font-size: 11px; color: var(--muted); margin: 2px 0 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.step-body { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.step-arrow { display: flex; align-items: center; color: var(--border-2); }

.state-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px;
  margin-top: 14px;
}
.state-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; display: flex; gap: 12px; align-items: flex-start;
}
.state-name { font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 2px; }
.state-body { font-size: 12px; line-height: 1.45; color: var(--ink-2); }

.numlist { padding-left: 20px; margin: 12px 0; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.numlist li { margin-bottom: 10px; }
.numlist li::marker { color: var(--muted); font-weight: 600; }

.bullets { padding-left: 20px; margin: 8px 0 16px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.bullets li { margin-bottom: 6px; }

.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.rule { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.rule-head { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.rule.ok .rule-head { color: var(--ok); }
.rule.warn .rule-head { color: var(--err); }
.rule ul { padding-left: 18px; margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.rule ul li { margin-bottom: 6px; }

.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.sc-group { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.sc-title { font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.sc { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; line-height: 1.6; }
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; font-family: ui-monospace, monospace; font-size: 11px; font-weight: 600; color: var(--ink);
  margin: 0 2px;
}

.faq > div { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.faq > div:last-child { border-bottom: 0; }
.faq b { display: block; font-size: 14px; color: var(--ink); margin-bottom: 4px; }
.faq p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.6; }

/* ================== Login Form ================== */
.login-container {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--bg) 0%, var(--surface-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.login-header p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-error {
  background: var(--err-2);
  border: 1px solid color-mix(in oklab, var(--err) 30%, var(--border));
  border-radius: var(--radius);
  color: var(--err);
  padding: 12px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.login-field input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-field input:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-2);
}

.login-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-btn {
  padding: 12px 16px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}

.login-btn:hover:not(:disabled) {
  background: color-mix(in oklab, var(--accent) 90%, black);
  border-color: color-mix(in oklab, var(--accent) 90%, black);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* User profile in sidebar */
.user-profile {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
