/* PRM Insights - PM screens. Calm internal-tool styling: neutral greys, one accent (blue), muted status tints. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e7eaee;
  --border: #e1e4e8;
  --border-strong: #c9ced5;
  --text: #1a1e23;
  --text-2: #565e68;
  --text-3: #868e98;
  --accent: #2d6cdf;
  --accent-hover: #2459bd;
  --accent-soft: #e9f0fc;
  --accent-text: #1d4fa8;
  --focus: rgba(45, 108, 223, 0.35);

  --good-bg: #e5f3ea;
  --good-fg: #1d6b37;
  --warn-bg: #fdf1dc;
  --warn-fg: #81540a;
  --bad-bg: #fbe9e8;
  --bad-fg: #a3261b;
  --info-bg: #e8edf4;
  --info-fg: #38506f;
  --pin-bg: #efe9f8;
  --pin-fg: #5d3a9b;
  --muted-bg: #eceef1;
  --muted-fg: #5c636c;

  --bar-pos: #2d6cdf;
  --bar-neg: #c9564b;

  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --surface: #1b1f24;
    --surface-2: #22272d;
    --surface-3: #2b3138;
    --border: #2e343b;
    --border-strong: #3d444d;
    --text: #e6e9ed;
    --text-2: #a9b1ba;
    --text-3: #7b848e;
    --accent: #5b8ff0;
    --accent-hover: #7aa5f4;
    --accent-soft: #1f2d45;
    --accent-text: #9dbcf6;
    --focus: rgba(91, 143, 240, 0.4);
    --good-bg: #1c3426;
    --good-fg: #8fd3a6;
    --warn-bg: #3a2e17;
    --warn-fg: #ecc477;
    --bad-bg: #3d1f1d;
    --bad-fg: #f0a39b;
    --info-bg: #222d3b;
    --info-fg: #a9bedb;
    --pin-bg: #2e2440;
    --pin-fg: #c6aef0;
    --muted-bg: #282d33;
    --muted-fg: #a0a8b1;
    --bar-pos: #5b8ff0;
    --bar-neg: #e07a70;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }

p { margin: 0; }

code, .mono { font-family: var(--mono); font-size: 12px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.hidden { display: none !important; }
.contents { display: contents; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.spacer { flex: 1 1 auto; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ app shell */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 52px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent);
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700;
}
.brand-tag {
  font-size: 11px; font-weight: 500; color: var(--text-3); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 99px;
}

.nav { display: flex; gap: 4px; }
.nav a {
  padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { color: var(--text); background: var(--surface-2); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

main#view {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }

/* ------------------------------------------------------------------ buttons + inputs */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: 500 13px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad-fg); }
.btn.danger:hover:not(:disabled) { background: var(--bad-bg); border-color: var(--bad-fg); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.xs { height: 22px; padding: 0 7px; font-size: 11px; }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }

.verdicts .btn[data-v="good"][aria-pressed="true"] { background: var(--good-bg); border-color: var(--good-fg); color: var(--good-fg); }
.verdicts .btn[data-v="bad"][aria-pressed="true"] { background: var(--bad-bg); border-color: var(--bad-fg); color: var(--bad-fg); }
.verdicts .btn[data-v="unsure"][aria-pressed="true"] { background: var(--warn-bg); border-color: var(--warn-fg); color: var(--warn-fg); }

input[type="text"], input[type="search"], input[type="password"], input[type="number"], select, textarea {
  height: 32px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: 13px/1.3 var(--font);
  min-width: 0;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 56px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
input[type="number"] { width: 100%; }
input::placeholder, textarea::placeholder { color: var(--text-3); }

label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
label.check input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > .label { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field > .label .req { color: var(--accent-text); font-weight: 500; font-size: 11px; }
.field > .help { font-size: 12px; color: var(--text-3); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button {
  border: 0; background: var(--surface); color: var(--text-2); font: 500 12px var(--font);
  padding: 0 10px; height: 30px; cursor: pointer; border-right: 1px solid var(--border);
}
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--surface-2); }
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 32px; height: 18px; border-radius: 99px; background: var(--border-strong); position: relative;
  transition: background 0.15s; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--focus); }

/* ------------------------------------------------------------------ cards, panels */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 13px; }
.card-body { padding: 14px 16px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; font-size: 13px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.kv dd.warn { color: var(--warn-fg); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .l { font-size: 12px; color: var(--text-2); }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a {
  padding: 9px 14px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------------ pills + badges */

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 99px;
  font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--muted-bg); color: var(--muted-fg);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-bg); color: var(--good-fg); }
.pill.warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill.bad { background: var(--bad-bg); color: var(--bad-fg); }
.pill.info { background: var(--info-bg); color: var(--info-fg); }
.pill.accent { background: var(--accent-soft); color: var(--accent-text); }
.pill.pin { background: var(--pin-bg); color: var(--pin-fg); }
.pill.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); font-weight: 500; }

.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px;
  font-size: 11px; font-weight: 500; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  white-space: nowrap;
}

.pulse .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.04em; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface);
  white-space: nowrap; position: sticky; top: 0;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data th .arrow { display: inline-block; width: 10px; margin-left: 3px; color: var(--accent); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tr.clickable { cursor: pointer; }
table.data td.actions { white-space: nowrap; text-align: right; }
table.data td.actions .btn + .btn { margin-left: 6px; }

.shop-cell { display: flex; flex-direction: column; gap: 1px; min-width: 180px; }
.shop-cell .name { font-weight: 600; color: var(--text); }
.shop-cell .domain { font-size: 12px; color: var(--text-3); }

.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar input[type="search"] { width: 280px; }

.chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chip-btn {
  height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); font: 500 12px var(--font); cursor: pointer;
}
.chip-btn:hover { background: var(--surface-2); }
.chip-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }

/* ------------------------------------------------------------------ job progress */

.progress { display: flex; flex-direction: column; gap: 4px; min-width: 170px; }
.progress .line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.bar { height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.4s ease; }
.bar.indeterminate > span { width: 35%; position: absolute; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { left: -35%; } 100% { left: 100%; } }
.progress .details { font-size: 11px; color: var(--text-3); display: flex; gap: 10px; flex-wrap: wrap; }

.lab-meter { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.lab-meter .slots { display: inline-flex; gap: 3px; }
.lab-meter .slot { width: 10px; height: 10px; border-radius: 3px; background: var(--surface-3); border: 1px solid var(--border-strong); }
.lab-meter .slot.on { background: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------------------ states */

.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 40px 20px; color: var(--text-2);
}
.state .icon {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--surface-2); color: var(--text-3);
}
.state.error .icon { background: var(--bad-bg); color: var(--bad-fg); }
.state .title { font-weight: 600; color: var(--text); }
.state .text { max-width: 520px; font-size: 13px; }
.state.compact { padding: 20px 12px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; flex: none;
}
.spinner.sm { width: 13px; height: 13px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 4px; height: 12px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.notice.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.notice.bad { background: var(--bad-bg); color: var(--bad-fg); border-color: transparent; }
.notice.info { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.notice .glyph { font-weight: 700; flex: none; }
.notice ul { margin: 0; padding-left: 18px; }
.notice li + li { margin-top: 3px; }

/* ------------------------------------------------------------------ token gate */

.gate { min-height: calc(100vh - 52px); display: grid; place-items: center; padding: 24px; }
.gate .card { width: 100%; max-width: 420px; padding: 28px; }
.gate h1 { margin-bottom: 6px; }
.gate form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.gate input { height: 38px; font-family: var(--mono); }
.gate .btn { height: 38px; }

/* ------------------------------------------------------------------ overview */

.signal { display: flex; flex-direction: column; gap: 8px; }
.signal .top { display: flex; align-items: center; gap: 8px; }
.signal .name { font-weight: 600; }
.signal .meter { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.signal .meter > span { display: block; height: 100%; border-radius: 99px; }
.signal .meter > span.strong { background: var(--good-fg); }
.signal .meter > span.weak { background: var(--warn-fg); }
.signal .meter > span.none { background: var(--text-3); }

.type-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .type-cols { grid-template-columns: 1fr; } }
.type-col h4 { margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.type-list { display: flex; flex-direction: column; gap: 4px; }
.type-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); font-size: 12px; cursor: pointer; text-align: left;
  color: var(--text); font-family: var(--font); width: 100%;
}
.type-item:hover:not(:disabled) { border-color: var(--accent); }
.type-item:disabled { cursor: default; opacity: 0.75; }
.type-item .ep { color: var(--text-3); font-size: 11px; }
.type-item .why { color: var(--text-3); font-size: 11px; margin-left: auto; }

/* ------------------------------------------------------------------ playground */

.play { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.play.compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .play, .play.compare { grid-template-columns: 1fr; } }
.play-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.config .card-body { display: flex; flex-direction: column; gap: 14px; }
.side-tag {
  width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: var(--accent-soft); color: var(--accent-text);
}
.format-desc { font-size: 12px; color: var(--text-3); margin-top: -6px; }

.jev-warn { font-size: 12px; }

/* product picker */
.picker { position: relative; display: flex; flex-direction: column; gap: 6px; }
.picker .search { position: relative; }
.picker .search input { width: 100%; }
.picker .search .spinner { position: absolute; right: 9px; top: 9px; }
.picker .menu {
  position: absolute; z-index: 30; top: 36px; left: 0; right: 0; max-height: 300px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.picker .opt {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.picker .opt:last-child { border-bottom: 0; }
.picker .opt:hover, .picker .opt.active { background: var(--accent-soft); }
.picker .opt .t { font-size: 13px; font-weight: 500; }
.picker .opt .s { font-size: 11px; color: var(--text-3); }
.picker .menu .state { padding: 14px; }
.selected-list { display: flex; flex-wrap: wrap; gap: 5px; }
.pchip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 4px 0 3px;
  border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-2); font-size: 12px;
}
.pchip .t { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip button {
  border: 0; background: transparent; color: var(--text-3); cursor: pointer; width: 20px; height: 20px;
  border-radius: 4px; font-size: 14px; line-height: 1;
}
.pchip button:hover { background: var(--surface-3); color: var(--text); }

.thumb {
  width: 22px; height: 22px; border-radius: 4px; object-fit: cover; background: var(--surface-3); flex: none;
  display: inline-block;
}
.thumb.md { width: 36px; height: 36px; border-radius: 5px; }
.thumb.lg { width: 60px; height: 60px; border-radius: 6px; }

/* results */
.result-head { display: flex; flex-direction: column; gap: 10px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-2); }
.meta-line .sep { color: var(--border-strong); }

.picks { display: flex; flex-direction: column; }
.pick { display: grid; grid-template-columns: 26px 60px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.pick:last-child { border-bottom: 0; }
.pick .pos {
  width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--text-2);
  display: grid; place-items: center; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.pick.in-both { box-shadow: inset 3px 0 0 var(--accent); }
.pick.highlight { background: var(--good-bg); }
.pick .body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pick .title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pick .title { font-weight: 600; font-size: 14px; }
.pick .price { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; }
.pick .gid { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.pick .why { font-size: 13px; color: var(--text); }
.pick .why.none { color: var(--text-3); font-style: italic; }
.pick .strength-why { font-size: 12px; color: var(--text-2); }
.pick .controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.pick .verdicts { display: inline-flex; gap: 4px; }
.pick .note-box { display: flex; gap: 6px; align-items: flex-start; }
.pick .note-box textarea { flex: 1 1 auto; min-height: 44px; font-size: 12px; }
.pick .saved-mark { font-size: 11px; color: var(--text-3); }

.evidence { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px 12px; display: flex; flex-direction: column; gap: 12px; }
.groups { display: flex; flex-direction: column; gap: 5px; }
.grp { display: grid; grid-template-columns: 120px minmax(0, 1fr) 64px 52px; gap: 8px; align-items: center; font-size: 12px; }
.grp .gname { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp .gbar { height: 8px; background: var(--surface-3); border-radius: 99px; position: relative; overflow: hidden; }
.grp .gbar > span { position: absolute; top: 0; bottom: 0; border-radius: 99px; }
.grp .gbar > span.pos { left: 50%; background: var(--bar-pos); }
.grp .gbar > span.neg { right: 50%; background: var(--bar-neg); }
.grp .gbar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--border-strong); }
.grp .gval { text-align: right; font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.grp .gshare { text-align: right; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.fact-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.fact-group h5 { margin: 0 0 6px; font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.fact-group .kv { font-size: 12px; }
.fact-group .kv dd { font-family: var(--mono); font-size: 11px; font-weight: 500; overflow-wrap: anywhere; }
.ev-foot { font-size: 11px; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; }

.diff-bar { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 12px 16px; }
.overlap { display: flex; align-items: center; gap: 10px; }
.overlap .bar { width: 140px; height: 7px; }

details.more > summary { cursor: pointer; color: var(--text-2); font-size: 12px; list-style: none; user-select: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "\25B8"; display: inline-block; width: 12px; transition: transform 0.12s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > .inner { margin-top: 8px; }

/* ------------------------------------------------------------------ ae vs prm */

.case { border-bottom: 1px solid var(--border); }
.case:last-child { border-bottom: 0; }
.case > summary {
  display: grid; grid-template-columns: 70px 140px 120px minmax(0, 1fr) 90px; gap: 12px; align-items: center;
  padding: 10px 16px; cursor: pointer; font-size: 13px; list-style: none;
}
.case > summary::-webkit-details-marker { display: none; }
.case > summary:hover { background: var(--surface-2); }
.case .inner { padding: 4px 16px 14px; }
.mini-picks { display: flex; flex-direction: column; gap: 4px; }
.mini-pick { display: grid; grid-template-columns: 22px 36px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; padding: 4px 6px; border-radius: 4px; }
.mini-pick.sold { background: var(--good-bg); }
.mini-pick.shown { background: var(--accent-soft); }

/* ------------------------------------------------------------------ toasts + dialog */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast {
  background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: 10px; align-items: flex-start;
  animation: toast-in 0.18s ease-out;
}
.toast.bad { background: var(--bad-fg); color: #fff; }
.toast.good { background: var(--good-fg); color: #fff; }
.toast button { margin-left: auto; background: transparent; border: 0; color: inherit; opacity: 0.7; cursor: pointer; font-size: 15px; line-height: 1; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

dialog.modal {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(16, 20, 26, 0.45); }
dialog.modal .m-head { padding: 16px 20px 0; }
dialog.modal .m-body { padding: 12px 20px 4px; display: flex; flex-direction: column; gap: 12px; font-size: 13px; color: var(--text-2); }
dialog.modal .m-foot { padding: 16px 20px; display: flex; justify-content: flex-end; gap: 8px; }

.legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.legend .row { align-items: flex-start; }
.legend .pill { flex: none; min-width: 112px; justify-content: center; }

.empty-inline { color: var(--text-3); font-size: 12px; font-style: italic; }
