/* RiftCombo — visual identity taken from Riot's own Riftbound surfaces (playriftbound.com):
   navy-teal ground, cream text, one orange accent. One type family; hierarchy comes from size
   and weight, not from a display face. Deliberately NOT the reference tool's vocabulary: no dot
   grid, no mono eyebrows with wide tracking, no categorical rainbow. House rules: no glow, no
   noise, no emoji, no decorative shadows, no blue/purple gradients. */

:root {
  --bg: #0f1a1e;
  --panel: #16242b;
  --panel-2: #1e3043;
  --panel-3: #293a4c;
  --line: #24404c;
  --line-2: #336073;
  --text: #f9eedc;
  --muted: #8fa7b3;          /* 7.03:1 on --bg */
  --faint: #6a8794;
  --accent: #ef7d00;         /* 6.41:1 on --bg */
  --accent-ink: #1a0f00;
  --accent-dim: #a85700;
  --danger: #d8552f;
  --ok: #6fa88b;

  /* Domain colours are reserved by Riot and must not be reused for anything else. */
  --dom-fury: #ce212d; --dom-calm: #15ac72; --dom-mind: #22799c;
  --dom-body: #e4720c; --dom-chaos: #6c4993; --dom-order: #d0ab01;

  --font: Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --topbar: 64px;
  --panel-w: 320px;
  --tray-h: 124px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(239, 125, 0, .3); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
h1, h2, h3 { font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.eyebrow { margin: 0 0 5px; font: 500 12px/1.2 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Top bar */
.topbar {
  height: var(--topbar); display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.brand { display: inline-flex; align-items: baseline; gap: 10px; }
.brand-mark { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.6; align-self: center; }
.brand-name { font-weight: 600; font-size: 20px; letter-spacing: .08em; color: var(--text); }
.brand-tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.topnav { display: flex; gap: 4px; height: 100%; justify-content: flex-start; padding-left: 34px; }
.topnav a { display: flex; align-items: center; padding: 0 14px; color: var(--muted); font-size: 14.5px; border-bottom: 2px solid transparent; }
.topnav a.active { color: var(--text); border-bottom-color: var(--accent); }
.topnav a:hover { color: var(--text); }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }

/* Segmented controls — one rounded shell, rule-separated inside */
.segmented { display: inline-flex; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: transparent; overflow: hidden; }
.segmented label { position: relative; display: block; }
.segmented label + label { border-left: 1px solid var(--line-2); }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 7px 14px; font-size: 13.5px; color: var(--muted); }
.segmented input:checked + span { background: var(--panel-2); color: var(--text); font-weight: 500; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.segmented.small span { padding: 5px 11px; font-size: 12.5px; }

/* Buttons */
.primary {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: 0; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; cursor: pointer;
}
.primary svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.primary:hover { background: #ff8c14; }
.primary:disabled { background: var(--accent-dim); color: #d8c4ae; cursor: wait; }
.ghost { padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); color: var(--text); font-weight: 500; font-size: 13.5px; cursor: pointer; }
.ghost:hover { border-color: var(--accent); color: var(--accent); }
.linklike { background: none; border: 0; padding: 0; color: var(--muted); font-size: 14px; cursor: pointer; }
.linklike:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--panel); color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1;
}
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.icon-btn.toggle.on { color: var(--accent); border-color: var(--accent); }

/* Shell */
.app-shell { display: grid; grid-template-columns: var(--panel-w) minmax(0, 1fr); height: calc(100vh - var(--topbar)); min-height: 620px; }
.app-shell.collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.app-shell.collapsed .deck-panel { display: none; }

/* Deck panel */
.deck-panel { border-right: 1px solid var(--line); padding: 20px 22px 18px; overflow-y: auto; scrollbar-width: thin; display: flex; flex-direction: column; gap: 13px; background: var(--bg); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; }
.panel-head h2 { margin: 0; font-size: 17px; }
.deck-panel form { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.field-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; font-size: 13px; }
.url-row { display: flex; gap: 6px; }
.url-row input { flex: 1; min-width: 0; }
input[type=url], textarea, select {
  width: 100%; padding: 9px 11px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; color: var(--text);
}
input[type=url] { font-size: 13.5px; }
input[type=url]:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.65; min-height: 190px; }
textarea::placeholder, input::placeholder { color: var(--faint); }
.fine { margin: 0; font-size: 12px; color: var(--faint); line-height: 1.45; }
.or { display: flex; align-items: center; gap: 10px; margin: 6px 0; color: var(--faint); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.near-miss { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.near-miss select { width: auto; padding: 6px 10px; font-size: 13.5px; }
.notice { margin: 6px 0; padding: 9px 12px; border-left: 2px solid var(--line-2); font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.status-card { display: flex; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.status-card strong { display: block; font-size: 14px; font-family: var(--font); font-weight: 600; }
.status-card span { display: block; font-size: 12.5px; color: var(--muted); }
.status-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; border: 1.5px solid var(--line-2); }
.status-card.ok .status-dot { border-color: var(--ok); background: var(--ok); }
.status-card.error .status-dot { border-color: var(--danger); background: var(--danger); }
.legal { margin: auto 0 0; font-size: 11.5px; line-height: 1.5; color: var(--faint); }

/* Workspace */
.workspace { grid-column: 2; display: grid; grid-template-rows: 72px minmax(0, 1fr) var(--tray-h); min-width: 0; background: var(--bg); }
.ws-head { display: flex; justify-content: space-between; align-items: center; padding: 0 22px; gap: 16px; }
.ws-title { margin: 0; font-size: 22px; display: flex; align-items: baseline; gap: 10px; }
.count-pill { font: 500 13px var(--mono); padding: 1px 9px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--accent); }
.ws-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--faint); }
.ws-controls { display: flex; gap: 10px; align-items: center; }

/* Stage — flat ground with three faint lanes, not a dot grid */
.stage { position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; background: #0c161a; }
.graph-host { position: absolute; inset: 0; }
.graph-host svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.graph-host svg.dragging { cursor: grabbing; }
.stage-enter { position: absolute; top: 14px; left: 14px; z-index: 2; }
.stage-tools { position: absolute; right: 14px; top: 14px; display: flex; gap: 6px; z-index: 2; }
.zoom { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); z-index: 2; }
.zoom .icon-btn { border: 0; width: 28px; height: 28px; background: transparent; }
.zoom span { min-width: 46px; text-align: center; font-size: 12px; color: var(--muted); }

.empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; padding: 24px; max-width: 620px; margin: 0 auto; }
.empty-glyph { width: 48px; height: 48px; border: 1px solid var(--line-2); border-radius: 14px; display: grid; place-items: center; }
.empty-glyph svg { width: 20px; height: 20px; fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-linecap: round; }
.empty-title { margin: 14px 0 0; font-family: var(--font); font-weight: 600; font-size: 18px; color: var(--text); }
.empty-body { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.empty-body strong { color: var(--text); font-weight: 600; }
.empty-coverage { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; font-variant-numeric: tabular-nums; }
.empty-coverage strong { color: var(--text); font-weight: 600; }
.empty-note { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); line-height: 1.6; }

/* Graph */
.lane-label { fill: var(--muted); font: 600 14px var(--font); letter-spacing: .05em; }
.lane-rule { stroke: var(--line); stroke-width: 1; }
.edge { fill: none; stroke-width: 1.6; opacity: .4; transition: opacity .18s ease, stroke-width .18s ease; }
.edge.missing { stroke-dasharray: 4 6; }
.edge.needs { stroke-width: 1.2; opacity: .45; stroke-dasharray: none; }
.edge.hl { opacity: .9; stroke-width: 2.4; }
.edge.selected { opacity: 1; stroke-width: 3; stroke: var(--accent) !important; }
.dim-unrelated.has-selection .edge.dimmed { opacity: .07; }
.node { cursor: pointer; transition: opacity .18s ease; }
.node:focus { outline: none; }
.node:focus-visible .frame, .node:focus-visible .route-shell, .node:focus-visible .result-shell { stroke: var(--accent); stroke-width: 2.5; }
.dim-unrelated.has-selection .node.dimmed { opacity: .16; }
.node.card .frame { fill: var(--panel); stroke: var(--line-2); stroke-width: 1; }
.node.card.missing .frame { stroke: var(--accent); stroke-dasharray: 6 4; }
.node.card.missing image { opacity: .5; filter: grayscale(.85); }
.node.card .no-art { fill: var(--panel-2); stroke: var(--line); }
.node.card .name-bg { fill: #0b1417; stroke: var(--line-2); }
.node.card .name { fill: var(--text); font: 500 12.5px var(--font); }
.node.card .qty-bg { fill: #0b1417; stroke: var(--line-2); }
.node.card .qty { fill: var(--muted); font: 500 11px var(--mono); }
.node.card.missing .qty { fill: var(--accent); }
.node.card.hl .frame, .node.card.selected .frame, .node.card:hover .frame { stroke: var(--accent); stroke-width: 2; }
.node.card.illegal .name { text-decoration: line-through; }
.node.route .route-shell { fill: var(--panel); stroke-width: 1; }
.node.route .route-accent { stroke-width: 3; }
.node.route.hl .route-shell, .node.route.selected .route-shell, .node.route:hover .route-shell { stroke: var(--accent); stroke-width: 2; }
.node.route.candidate .route-shell { stroke-dasharray: 5 4; }
.node.route .mini-frame { fill: var(--panel-2); stroke: var(--line); }
.node.route .route-label { fill: var(--text); font: 500 13px var(--font); }
.node.route .route-class { fill: var(--muted); font: 500 10.5px var(--mono); letter-spacing: .06em; }
.node.result .result-shell { fill: var(--panel-2); stroke-width: 1; }
.node.result.hl .result-shell, .node.result.selected .result-shell, .node.result:hover .result-shell { stroke: var(--accent); stroke-width: 2; }
.node.result .result-label { fill: var(--text); font: 600 13.5px var(--font); }
.node.result .result-sub { fill: var(--muted); font: 500 11px var(--mono); }
.hub-ring { fill: none; stroke: var(--line); }
.hub-disc { fill: var(--panel); stroke: var(--line-2); }
.hub-eyebrow { fill: var(--muted); font: 600 11px var(--font); letter-spacing: .06em; }
.hub-count { fill: var(--accent); font: 600 32px var(--font); }
.hub-sub { fill: var(--faint); font: 500 11px var(--font); }

/* Tray */
.tray { display: flex; gap: 0; padding: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; align-items: stretch; background: var(--bg); }
.tray-empty { margin: auto; color: var(--faint); font-size: 13px; background: var(--bg); width: 100%; text-align: center; padding: 40px 0; }
.chip {
  flex: 0 0 auto; width: 268px; padding: 13px 16px 13px 14px; border: 0; border-left: 3px solid var(--line-2); border-right: 1px solid var(--line); border-radius: 0 10px 10px 0; background: var(--bg);
  text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; color: var(--text);
}
.chip:hover { background: var(--panel); }
.chip.active { background: var(--panel-2); border-left-color: var(--accent); }
.chip-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.chip-title { font-family: var(--font); font-weight: 600; font-size: 14.5px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pill { flex: 0 0 auto; font: 500 10.5px var(--mono); padding: 2px 7px; border-radius: 4px; border: 1px solid; }
.chip-outcome { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.swatch { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; }
.chip-meta { font: 500 11px var(--mono); color: var(--faint); }
.chip-meta.illegal { color: var(--danger); }

/* Drawer */
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 348px; padding: 20px 22px 28px; overflow-y: auto; scrollbar-width: thin;
  background: var(--bg); border-left: 1px solid var(--line-2); z-index: 3;
}
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer h2 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; }
.drawer h2 .plus { color: var(--accent); font-weight: 400; padding: 0 5px; }
.drawer .meta { margin: 0 0 18px; font: 500 12px var(--mono); color: var(--muted); }
.drawer h3 { margin: 20px 0 8px; font-family: var(--font); font-weight: 600; font-size: 13px; letter-spacing: .05em; color: var(--accent); }
.drawer ol, .drawer ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--text); }
.drawer li { margin: 6px 0; }
.drawer li::marker { color: var(--faint); }
.drawer p { margin: 4px 0; font-size: 14px; color: var(--text); }
.card-list { display: flex; flex-direction: column; gap: 8px; }
.card-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; }
.card-row img { width: 34px; height: 47px; border-radius: 4px; border: 1px solid var(--line-2); object-fit: cover; background: var(--panel); }
.card-row .cname { font-weight: 500; font-size: 14px; }
.card-row .csub { font: 500 11px var(--mono); color: var(--faint); }
.card-row .have { font: 500 11px var(--mono); color: var(--muted); }
.card-row .have.short { color: var(--accent); }
.card-row.missing .cname { color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills .pill { font: 500 12px var(--font); padding: 4px 10px; }
.drawer .net { font: 500 12px var(--mono); color: var(--text); padding: 9px 11px; border-left: 2px solid var(--accent); background: var(--panel); }
.drawer .sources a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.drawer .rules-version { margin-top: 16px; font: 500 11px var(--mono); color: var(--faint); }

/* Card preview — click a thumbnail (or double-click a node) to read the card */
.card-preview { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(6, 12, 15, .84); }
.card-preview-box {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 380px); gap: 26px; align-items: start;
  max-width: min(960px, 100%); max-height: 100%; overflow: auto; padding: 24px 24px 26px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 14px;
}
.card-preview-box img { display: block; width: 330px; max-width: 100%; height: auto; border-radius: 14px; background: var(--panel); }
.card-preview-box img.landscape { width: 470px; }
.cp-close { position: absolute; top: 12px; right: 12px; }
.cp-name { margin: 0 34px 4px 0; font-size: 21px; }
.cp-meta { margin: 0 0 14px; font: 500 12px var(--mono); color: var(--muted); line-height: 1.6; }
.cp-text { font-size: 14.5px; line-height: 1.65; white-space: pre-line; }
.cp-effect { margin-top: 14px; padding: 10px 12px; border-left: 2px solid var(--accent); background: var(--panel); font-size: 14px; line-height: 1.55; white-space: pre-line; }
.cp-label { display: block; margin-bottom: 5px; font: 500 11px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.cp-hint { margin: 16px 0 0; font-size: 12px; color: var(--faint); }
.card-row img { cursor: zoom-in; }
.card-row img:hover { border-color: var(--accent); }
@media (max-width: 760px) {
  .card-preview { padding: 12px; }
  .card-preview-box { grid-template-columns: 1fr; justify-items: center; }
  .card-preview-box img.landscape { width: 100%; }
}

/* Docs below the app */
.doc { max-width: 820px; margin: 0 auto; padding: 44px 24px 20px; color: var(--muted); font-size: 14.5px; }
.doc h2 { margin: 0 0 14px; font-size: 19px; color: var(--text); }
.doc h3 { margin: 26px 0 8px; font-size: 14.5px; color: var(--text); font-weight: 600; }
.doc p { margin: 0 0 10px; line-height: 1.65; max-width: 65ch; }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.doc ol { padding-left: 20px; } .doc li { margin: 7px 0; }
.doc strong { color: var(--text); font-weight: 600; }
.colophon { padding-bottom: 44px; border-top: 1px solid var(--line); }
.colophon p { margin: 7px 0; font-size: 13.5px; }
.colophon em { font-style: normal; color: var(--text); }

/* Responsive */
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 14px; }
  .topnav { display: none; }
  .app-shell { display: block; height: auto; }
  .deck-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .workspace { grid-template-rows: auto 68vh var(--tray-h); }
  .ws-head { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .ws-controls { flex-wrap: wrap; }
  .drawer { width: 100%; top: auto; height: 62%; border-left: 0; border-top: 1px solid var(--line-2); }
  .stage-tools { top: auto; bottom: 14px; right: 14px; }
  .zoom { bottom: 14px; left: 14px; right: auto; }
  .chip { width: 240px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* --- what to add (#18) ---------------------------------------------------------------- */
/* Lives in the 320px deck panel, so every row has to work at ~276px of usable width. */
.plan { display: flex; flex-direction: column; gap: 11px; padding-top: 14px; border-top: 1px solid var(--line); }
.plan-head { margin: 0; font-size: 13px; letter-spacing: .05em; color: var(--accent); }
#plan-body { display: flex; flex-direction: column; gap: 15px; }
.plan-sec { display: flex; flex-direction: column; gap: 7px; }

/* Ban list. Sits above the status card because a tournament list wants that answer first. The
   status is carried by the left rule and the tag's weight, not by a second accent colour. */
.bans .plan-head { color: var(--danger); }
.ban-row { padding: 8px 10px; border: 1px solid var(--line); border-left: 2px solid var(--danger); border-radius: 6px; background: var(--panel); }
.ban-row + .ban-row { margin-top: 7px; }
.ban-row.restricted { border-left-color: var(--accent-dim); }
.ban-name { margin: 0; font: 600 13px/1.35 var(--font); color: var(--text); }
.ban-tag { margin-left: 5px; font: 500 10.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--danger); }
.ban-row.restricted .ban-tag { color: var(--accent); }
.ban-meta { margin: 3px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.ban-meta a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.ban-meta a:hover { color: var(--accent); }
.bans-foot { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--faint); }
.bans-foot:empty { display: none; }
.plan-lab { font: 500 10.5px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.plan-note { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.plan-note strong { color: var(--text); font-weight: 600; }
.plan-had { display: flex; gap: 9px; align-items: baseline; justify-content: space-between; padding: 7px 9px; border: 1px solid var(--line); border-left: 2px solid var(--ok); border-radius: 6px; background: var(--panel); }
.plan-had-name { font-size: 12.5px; line-height: 1.35; }
.plan-lead { display: flex; flex-direction: column; gap: 10px; padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); }
.plan-lead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.plan-name { padding: 0; border: 0; background: none; text-align: left; font: 600 13.5px/1.35 var(--font); color: var(--text); cursor: pointer; }
.plan-name:hover { color: var(--accent); }
.plan-out { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.plan-cost { flex: 0 0 auto; color: var(--accent); border-color: var(--accent-dim); }
.plan-adds { display: flex; flex-direction: column; gap: 8px; }
.plan-foot { margin: 0; padding-top: 9px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.plan-foot strong { color: var(--text); font-weight: 600; }
.plan-alts { display: flex; flex-direction: column; }
.plan-alt { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 7px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.plan-alt:last-child { border-bottom: 0; }
.plan-alt:hover .plan-alt-name { color: var(--accent); }
.plan-alt-cost { font: 600 11px var(--mono); color: var(--accent); }
.plan-alt-name { font-size: 12px; line-height: 1.35; color: var(--text); }
.plan-alt-class { font: 500 9.5px var(--mono); letter-spacing: .06em; color: var(--faint); }

/* Pairs in this deck (#22). A weaker guarantee than a combo, so the panel leads with what it is
   rather than with a count, and the rows carry the rule and its paragraphs instead of a score. */
.syn-guarantee { margin: -4px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
#synergy-body { display: flex; flex-direction: column; }
.syn { border-bottom: 1px solid var(--line); }
.syn:last-child { border-bottom: 0; }
.syn-sum { display: flex; flex-direction: column; gap: 5px; padding: 9px 2px; cursor: pointer; list-style: none; }
.syn-sum::-webkit-details-marker { display: none; }
.syn-name { font: 600 12.5px/1.35 var(--font); color: var(--text); }
.syn[open] .syn-name, .syn-sum:hover .syn-name { color: var(--accent); }
.syn-pair { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.syn-card { padding: 0; border: 0; background: none; font: 400 11.5px/1.4 var(--font); color: var(--muted); cursor: pointer; text-align: left; }
.syn-card:hover { color: var(--text); }
.syn-n { font: 600 10.5px var(--mono); color: var(--faint); }
.syn-plus { font: 600 11px var(--mono); color: var(--faint); }
.syn-open { display: flex; flex-direction: column; gap: 8px; padding: 2px 2px 12px; }
.syn-why { margin: 0; font-size: 12px; line-height: 1.65; color: var(--muted); }
.syn-from { display: flex; flex-direction: column; gap: 5px; }
.syn-alone { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--faint); }
.syn-from-list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.syn-from-list li { display: flex; gap: 6px; }
.syn-from-list li::before { content: "\2014"; color: var(--faint); font: 400 11.5px/1.5 var(--mono); }
.syn-link { flex: 1; padding: 0; border: 0; background: none; text-align: left; font: 400 11.5px/1.5 var(--font); color: var(--muted); cursor: pointer; }
.syn-link:hover { color: var(--accent); }
.syn-basis { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; }

/* One card away. Same vocabulary as the pairs above — this is the same rule, one card short — so it
   borrows .syn wholesale and only adds the shortlist. The accent stays on the card you would buy. */
.gap-lead { font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.gap-lead strong { color: var(--text); font-weight: 600; }
.gap-list { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 0; padding: 0; list-style: none; }
.gap-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.gap-add { font-weight: 600; color: var(--text); }
.gap-add::before { content: "+"; margin-right: 4px; font: 600 11px var(--mono); color: var(--accent); }
.gap-add:hover { color: var(--accent); }
.gap-cost { font: 400 10.5px var(--mono); color: var(--faint); }
.gap-tag { font: 500 9.5px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.gap-wide { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--faint); }
.gap-rest { padding-top: 9px; }
.syn-lab { font: 500 9.5px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.syn-ref { font: 500 10px var(--mono); color: var(--muted); padding: 1px 5px; border: 1px solid var(--line); border-radius: 6px; }

/* --- account (#31) ---------------------------------------------------------------------
   Saved decks. Deliberately the quietest thing in the panel: it is plumbing, not an answer
   about a deck, so it borrows the panel's own controls rather than introducing a new colour. */
.acct-top { display: flex; align-items: center; gap: 10px; }
.ghost.small { padding: 5px 11px; font-size: 12.5px; }
.acct-who { display: flex; align-items: center; gap: 10px; }
.acct-label { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.acct-note { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.acct-note strong { color: var(--text); font-weight: 600; }
.acct-msg { margin: 0; font-size: 12px; line-height: 1.5; color: var(--accent); }
.acct-msg:empty { display: none; }
.acct-save { display: flex; gap: 8px; }
.acct-save input, .acct-row input { flex: 1 1 auto; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 13px; }
.acct-save input:focus-visible, .acct-row input:focus-visible { outline: none; border-color: var(--accent); }
.acct-row { display: flex; gap: 9px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.acct-row.on { border-left: 2px solid var(--accent); }
.acct-meta { min-width: 0; }
.acct-name { margin: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-sum { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.acct-acts { display: flex; flex: 0 0 auto; gap: 9px; }
.acct-acts .linklike { font-size: 12px; }
.acct-acts .linklike.danger { color: var(--danger); }
.acct-foot { margin: 2px 0 0; font-size: 11.5px; color: var(--faint); }
.acct-foot .linklike, .acct-foot a { font-size: 11.5px; color: var(--faint); }
.acct-foot .linklike:hover, .acct-foot a:hover { color: var(--accent); }

/* Entrance (#39): the body carries the auth state and the stylesheet picks what is on screen.
   "pending" shows neither, so nothing flashes; "open" is a build with no accounts configured. */
body[data-auth="pending"] .view, body[data-auth="pending"] .topnav, body[data-auth="pending"] .topbar-right,
body[data-auth="out"] .view, body[data-auth="out"] .topnav, body[data-auth="out"] .topbar-right { display: none; }
.gate { display: none; }
body[data-auth="out"] .gate { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--topbar)); padding: 32px 22px; }
.gate-box { width: min(440px, 100%); padding: 30px 30px 26px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); display: grid; gap: 14px; justify-items: start; }
.gate-mark { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.6; }
.gate h1 { margin: 0; font: 600 22px/1.2 var(--font); letter-spacing: .04em; color: var(--text); }
.gate-lead { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--text); text-wrap: pretty; }
.gate-signin { width: 100%; justify-content: center; margin-top: 4px; }
.gate-note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.gate-legal { margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.5; color: var(--faint); }
.gate-links { margin: 0; font-size: 12.5px; color: var(--muted); }
.gate-links a { color: var(--muted); }
.gate-links a:hover { color: var(--accent); }

/* My decks (#43) — the library and the deck detail. */
.decks { max-width: 1000px; margin: 0 auto; padding: 30px 24px 44px; display: flex; flex-direction: column; gap: 18px; }
.decks-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.decks-title { margin: 0; font-size: 22px; }
.decks-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.decks-import { display: flex; flex-direction: column; gap: 7px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.decks-import .url-row { max-width: 560px; }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.deck-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.deck-card:hover { border-color: var(--accent); }
.deck-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.deck-card-name { min-width: 0; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-card-legend { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.deck-card-meta { font-size: 11.5px; color: var(--muted); }
.deck-card-when { font-size: 11.5px; color: var(--faint); }
.dom-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dom-fury { background: var(--dom-fury); } .dom-calm { background: var(--dom-calm); }
.dom-mind { background: var(--dom-mind); } .dom-body { background: var(--dom-body); }
.dom-chaos { background: var(--dom-chaos); } .dom-order { background: var(--dom-order); }
.badge { flex: 0 0 auto; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 6px; font: 500 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.bad { color: var(--danger); border-color: var(--danger); }

.detail-back { font-size: 13px; }
.detail-back a { color: var(--muted); }
.detail-back a:hover { color: var(--accent); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.detail-edit { display: flex; flex-direction: column; gap: 10px; }
.detail-name { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); color: var(--text); font: 600 16px var(--font); }
.detail-name:focus { outline: none; border-color: var(--accent); }
.detail-edit .segmented { align-self: flex-start; }
.detail-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.detail-check { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.build-badge { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font: 600 15px var(--font); }
.build-badge span { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.build-badge.ok { color: var(--ok); } .build-badge.bad { color: var(--danger); }
.build-rows { display: flex; flex-direction: column; }
.build-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.build-label { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.build-row.fail .build-label { color: var(--text); }
.build-rule { grid-column: 1 / -1; margin: 0; font: 400 10.5px/1.4 var(--mono); color: var(--faint); }
.build-state { grid-column: 2; grid-row: 1; align-self: start; font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.build-row.pass .build-state { color: var(--ok); }
.build-row.fail .build-state { color: var(--danger); }
.build-detail { grid-column: 1 / -1; margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }

/* The strip that names the saved list Combos is showing, and the way to save a pasted one. */
.analyzing { margin: 0; padding: 8px 11px; border-left: 2px solid var(--accent); font-size: 12.5px; color: var(--muted); }
.analyzing strong { color: var(--text); font-weight: 600; }
.analyzing a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.save-here { margin: 0; }

@media (max-width: 900px) { .detail { grid-template-columns: minmax(0, 1fr); } }

/* The format toggle scopes the combo matcher, so it is only on screen where it changes an answer. */
body:not([data-view="combos"]) .topbar-right .segmented { display: none; }
/* A disabled Save is not waiting on anything; the shared .primary:disabled cursor says it is. */
.detail-acts .primary:disabled { cursor: not-allowed; }
