/* The dashboard (designs 2c home, 2d not-sure pile, 2e settings, 2f onboarding).
   Shell: 64px icon rail, 232px sidebar on the sunken background, one white
   content card that runs off the bottom edge.
   Tokens and base controls come from @nocold-email/ui theme.css, which the
   build vendors to dist/vendor/ui/ next to this file's own dist/src/. */

body.app { background: var(--bg-sunken); overflow: hidden; }

.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg-sunken); }
.boot .logo { animation: cef-breathe 1.4s ease-in-out infinite; }
.boot .logo-dot { width: 12px; height: 12px; border-width: 3px; border-color: var(--bg-sunken); }
@keyframes cef-breathe { 0%, 100% { opacity: .45; transform: scale(.96); } 50% { opacity: 1; transform: scale(1); } }

.shell { display: flex; height: 100vh; }

/* ---------- icon rail ---------- */
.rail { display: flex; flex-direction: column; align-items: center; justify-content: space-between; flex: none; width: 64px; padding: 16px 0 16px; }
.rail-top { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.rail .logo { margin-bottom: 6px; }
.rail .logo-dot { border-color: var(--bg-sunken); }
.rail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg-2);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.rail-btn:hover { color: var(--fg); background: var(--bg-subtle); }
.rail-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.rail-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font: 600 12px var(--font);
  cursor: pointer;
}
.rail-avatar:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- sidebar ---------- */
.side { flex: none; width: 232px; padding: 8px 8px 8px 0; }
.side-inner { display: flex; flex-direction: column; height: 100%; padding: 12px; }

.workspace { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 12px 10px; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; border-radius: var(--r-input); }
.workspace:hover { background: rgba(23, 23, 23, .05); }
.workspace:focus-visible { outline: none; box-shadow: var(--ring); }
.workspace b { font: 600 17px/1.2 var(--font); letter-spacing: -.01em; }
.workspace small { display: block; margin-top: 1px; font-size: 11px; color: var(--fg-4); }
@media (prefers-color-scheme: dark) { .workspace:hover { background: rgba(255, 255, 255, .06); } }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--fg-2);
  font: 400 13.5px var(--font);
  cursor: pointer;
  text-align: left;
}
.nav-item > span:first-child { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item svg { color: var(--fg-3); }
.nav-item:hover { background: rgba(23, 23, 23, .05); }
.nav-item:focus-visible { outline: none; box-shadow: var(--ring); }
.nav-item[aria-current=page] { background: var(--blue-bg); color: var(--blue); font-weight: 500; }
.nav-item[aria-current=page] svg { color: currentColor; }
.nav-item .nav-count { flex: none; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--orange-bg); color: var(--orange); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { .nav-item:hover { background: rgba(255, 255, 255, .06); } }

.side-card { margin-top: auto; padding: 12px; border-radius: 10px; background: var(--bg); box-shadow: var(--shadow-sm); }
.side-card .row { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--fg-2); }
.side-card .row span:last-child { color: var(--fg-3); font-variant-numeric: tabular-nums; }
.side-card .track { margin-top: 8px; height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; }
.side-card .track i { display: block; height: 100%; border-radius: 999px; background: var(--solid); transition: width .4s ease; }
.side-card .track.busy i { width: 40%; animation: cef-slide 1.4s ease-in-out infinite; }
.side-card small { display: block; margin-top: 8px; font-size: 11px; color: var(--fg-4); }
@keyframes cef-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ---------- content card ---------- */
.pane { flex: 1; min-width: 0; padding: 8px 8px 0 0; }
.pane-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--r-card) var(--r-card) 0 0;
  overflow: hidden;
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; min-height: 64px; padding: 0 24px; border-bottom: 1px solid var(--border); }
.page-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-heading h1 { font-size: 18px; letter-spacing: -.01em; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.page-actions .stamp { font-size: 12px; color: var(--fg-4); margin-right: 4px; white-space: nowrap; }

.view { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 40px; }
.view:focus { outline: none; }

/* ---------- stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; }
.stat-head { display: flex; align-items: center; gap: 8px; }
.stat-ico { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; flex: none; }
.stat-ico.cold { background: var(--cold-bg); color: var(--cold-fg); }
.stat-ico.orange { background: var(--orange-bg); color: var(--orange); }
.stat-ico.blue { background: var(--blue-bg); color: var(--blue-fg); }
.stat-ico.green { background: var(--green-bg); color: var(--green-fg); }
.stat-head > span:last-child { font-size: 12.5px; font-weight: 500; color: var(--fg-2); }
.stat b { display: block; margin-top: 10px; font-size: 26px; line-height: 1.1; }
.stat small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--fg-3); }

/* ---------- section heading ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 10px; }
.section-head h2 { font-size: 14px; }
.link { border: 0; background: none; padding: 0; font: 400 12.5px var(--font); color: var(--fg-3); cursor: pointer; text-decoration: none; }
.link:hover { color: var(--fg); }
.link:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

/* ---------- decisions table ---------- */
.table { border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.tr {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) minmax(150px, 220px) 120px 82px 92px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-faint);
}
.tr:last-child { border-bottom: 0; }
.thead {
  padding: 9px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.row-btn { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.row-btn:hover .tr { background: var(--bg-subtle); }
.row-btn:focus-visible { outline: none; }
.row-btn:focus-visible .tr { background: var(--bg-subtle); box-shadow: inset 3px 0 0 var(--fg); }

.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who .avatar { width: 26px; height: 26px; font-size: 10px; }
.who b { display: block; font-size: 12.5px; font-weight: 600; }
.who small { display: block; font-size: 10.5px; color: var(--fg-4); }
.subj { font-size: 12.5px; color: var(--fg-2); }

.why { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; }
.why i { display: flex; align-items: center; gap: 6px; font-style: normal; }
.why i.up { color: var(--fg-2); }
.why i.up svg { color: var(--fg-4); }
.why i.down { color: var(--green-fg); }
.why i.flat { color: var(--fg-3); }

.score .meter { display: flex; align-items: center; gap: 8px; }
.score .track { flex: 1; height: 5px; border-radius: 999px; background: var(--border); overflow: hidden; }
.score .track i { display: block; height: 100%; border-radius: 999px; }
.score .track i.cold { background: var(--fg-2); }
.score .track i.orange { background: var(--orange-dot); }
.score .track i.green { background: var(--green-dot); }
.score .track i.grey { background: var(--fg-4); }
.score b { width: 26px; text-align: right; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score b.cold { color: var(--fg); }
.score b.green { color: var(--green-fg); }
.score small { display: block; margin-top: 3px; font-size: 10px; color: var(--fg-4); }
.score small.cold { color: var(--fg-2); }

.tr .go { display: flex; justify-content: flex-end; }

/* expanded row detail */
.detail { padding: 2px 16px 16px 56px; border-bottom: 1px solid var(--border-faint); background: var(--bg-subtle); }
.detail h3 { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-4); margin-bottom: 8px; }
.signals { display: flex; flex-wrap: wrap; gap: 6px; }
.signal { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); font-size: 11.5px; color: var(--fg-2); }
.signal b { font-variant-numeric: tabular-nums; font-weight: 700; }
.signal.up { border-color: var(--cold-border); background: var(--cold-soft); color: var(--cold-fg); }
.signal.down { border-color: var(--green-border); background: var(--green-soft); color: var(--green-fg); }
.detail-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 11.5px; color: var(--fg-3); }
.detail-foot a { display: inline-flex; align-items: center; gap: 5px; color: var(--fg-2); text-decoration: none; font-weight: 500; }
.detail-foot a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- not-sure pile ---------- */
.intro { padding: 16px 24px; margin: -20px -24px 0; font-size: 12.5px; color: var(--fg-3); border-bottom: 1px solid var(--border-faint); }
.pile { margin: 0 -24px; }
.pile-row { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--border-faint); }
.pile-row:hover, .pile-row.cursor { background: var(--bg-subtle); }
.pile-row.cursor { box-shadow: inset 3px 0 0 var(--fg); }
.pile-row.checked { background: var(--bg-subtle); }
.pile-row.leaving { opacity: 0; transform: translateX(24px); transition: opacity .18s ease, transform .18s ease; }
.pile-row .avatar { width: 34px; height: 34px; font-size: 11px; }
.pile-main { flex: 1; min-width: 0; }
.pile-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pile-head b { font-size: 13.5px; font-weight: 600; }
.pile-head small { font-size: 12px; color: var(--fg-4); }
.pile-subj { font-size: 12.5px; color: var(--fg-2); margin-top: 2px; }
.pile-reason { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--fg-3); }
.pile-band { flex: none; width: 118px; text-align: center; }
.band { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.band.cold { background: var(--cold-bg); color: var(--cold-fg); }
.band.orange { background: var(--orange-bg); color: var(--orange); }
.band.yellow { background: var(--yellow-bg); color: var(--yellow-fg); }
.band i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pile-actions { display: flex; gap: 6px; flex: none; }

/* ---------- end of an infinite list ---------- */
/* Doubles as the scroll sentinel: when this drifts into view the next page is
   fetched and appended, so it must sit in the flow under the last row. */
.scroll-foot { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 14px 0 2px; font-size: 12px; color: var(--fg-4); font-variant-numeric: tabular-nums; }
.scroll-foot span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- empty states ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 64px 24px; text-align: center; }
.empty .badge { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--green-bg); color: var(--green-fg); margin-bottom: 8px; }
.empty .badge.grey { background: var(--bg-sunken); color: var(--fg-4); }
.empty .badge.orange { background: var(--orange-bg); color: var(--orange); }
.empty h2 { font-size: 16px; }
.empty p { margin: 0; font-size: 13px; color: var(--fg-3); max-width: 380px; line-height: 1.55; }
.empty .btn { margin-top: 10px; }

/* ---------- filters ---------- */
.filters { display: flex; align-items: center; gap: 8px; }
.searchbox { position: relative; display: flex; align-items: center; }
.searchbox svg { position: absolute; left: 10px; color: var(--fg-4); pointer-events: none; }
.searchbox input { width: 220px; padding-left: 32px; }
.seg-group { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: var(--r-input); background: var(--bg-subtle); }
.seg-btn { height: 30px; padding: 0 10px; border: 0; border-radius: var(--r-btn); background: none; color: var(--fg-3); font: 500 12.5px var(--font); cursor: pointer; }
.seg-btn:hover { color: var(--fg); }
.seg-btn[aria-pressed=true] { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm); }
.seg-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- settings ---------- */
.settings { max-width: 720px; display: flex; flex-direction: column; gap: 20px; }
.panel { border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.panel.danger { border-color: var(--red-border); }
.panel-head { padding: 18px 20px 6px; }
.panel-head h2 { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.panel-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--fg-3); line-height: 1.5; }
.panel-head h2.danger { color: var(--red); }
.panel-body { display: flex; flex-direction: column; gap: 16px; padding: 14px 20px 20px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.field > label, .field-label { font-size: 13px; font-weight: 500; color: var(--fg); }
.field small { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 400; color: var(--fg-3); line-height: 1.45; }
.field-stack { display: flex; flex-direction: column; gap: 10px; }

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { position: relative; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); text-align: left; cursor: pointer; }
.choice:hover { border-color: var(--fg-4); }
.choice:focus-visible { outline: none; box-shadow: var(--ring); }
.choice b { display: block; font-size: 13px; font-weight: 600; color: var(--fg); }
.choice small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--fg-3); line-height: 1.4; }
.choice[aria-pressed=true] { border-width: 2px; border-color: var(--solid); padding: 11px; }
.choice .tick { position: absolute; top: 10px; right: 10px; display: none; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--solid); color: var(--solid-fg); }
.choice[aria-pressed=true] .tick { display: flex; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; border: 1px solid var(--border); }
.chip.green { border-color: var(--green-border); background: var(--green-soft); color: var(--green-fg); }
.chip.cold { border-color: var(--cold-border); background: var(--cold-soft); color: var(--cold-fg); }
.chip button { display: flex; border: 0; background: none; padding: 0; color: inherit; cursor: pointer; opacity: .75; }
.chip button:hover { opacity: 1; }
.chip.add { border-style: dashed; border-color: var(--border-strong); color: var(--fg-3); cursor: pointer; background: none; font: 400 12.5px var(--font); }
/* The tail of a preview: how many more are in the full list. */
.chip.more { border-style: dashed; border-color: var(--border); color: var(--fg-4); }
.chip.add:hover { background: var(--bg-subtle); }
.chip-form { display: flex; gap: 6px; }
.chip-form input { height: 32px; width: 240px; font-size: 12.5px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 12.5px; }
.kv dt { color: var(--fg-3); }
.kv dd { margin: 0; }
code, .mono { font-family: var(--font-mono); font-size: 11.5px; }
pre.dump { margin: 0; padding: 10px; max-height: 300px; overflow: auto; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--r-input); font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

details.more { border-top: 1px solid var(--border); }
details.more > summary { display: flex; align-items: center; gap: 8px; padding: 14px 20px; font-size: 13px; font-weight: 500; color: var(--fg-2); cursor: pointer; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary:hover { background: var(--bg-subtle); }
details.more > summary .caret { transition: transform .15s ease; color: var(--fg-4); }
details.more[open] > summary .caret { transform: rotate(180deg); }

table.rules { width: 100%; border-collapse: collapse; font-size: 12px; }
table.rules th, table.rules td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border-faint); vertical-align: middle; }
table.rules th { color: var(--fg-3); font-weight: 600; position: sticky; top: 0; background: var(--bg); }
table.rules td.w input { width: 58px; height: 28px; padding: 0 6px; font-size: 12px; }
table.rules .group { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: var(--bg-sunken); color: var(--fg-3); }
.rules-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-input); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.stack > span { font-size: 12px; color: var(--fg-3); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.status-line { font-size: 12.5px; font-weight: 500; }
.status-line.ok { color: var(--green-fg); }
.status-line.bad { color: var(--red); }

/* ---------- dialog ---------- */
.backdrop { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; z-index: 80; animation: cef-fade .12s ease-out; }
.dialog { width: min(400px, calc(100vw - 32px)); padding: 20px; border-radius: var(--r-card); background: var(--bg); box-shadow: var(--shadow-lg); }
.dialog h2 { font-size: 16px; }
.dialog p { margin: 8px 0 0; font-size: 13px; color: var(--fg-3); line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- sheet: a dialog the size of the window, less a small margin ---- */
/* `place-items: stretch` lets the single child fill the backdrop; the margin
   below is the padding you see around it. */
.backdrop.full { place-items: stretch; }
.dialog.sheet {
  width: auto;
  min-width: 0;
  min-height: 0;
  margin: 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  animation: cef-sheet .16s ease-out;
}
@keyframes cef-sheet { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dialog.sheet, .backdrop { animation: none; } }

.sheet-head { display: flex; align-items: flex-start; gap: 16px; flex: none; padding: 20px 20px 16px 24px; border-bottom: 1px solid var(--border); }
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h2 { font-size: 18px; letter-spacing: -.01em; }
.sheet-title p { margin: 3px 0 0; font-size: 12.5px; }
.sheet-head-end { display: flex; align-items: center; gap: 10px; flex: none; }

.sheet-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 24px; border-bottom: 1px solid var(--border-faint); background: var(--bg-subtle); }
.sheet-tools .searchbox { flex: 1; min-width: 180px; max-width: 420px; }
.sheet-tools .searchbox input { width: 100%; }
/* Push the add control to the far edge and give the placeholder room to breathe. */
.sheet-tools .chip-form { margin-left: auto; }
.sheet-tools .chip-form input { width: 300px; height: 36px; font-size: 13px; }
.sheet-tools .chip-form .btn { height: 36px; }

.sheet-body { flex: 1; min-height: 0; overflow-y: auto; }
.sheet-list { padding: 18px 24px 24px; }
.sheet-body .chips { gap: 8px; }

.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; padding: 14px 20px 14px 24px; border-top: 1px solid var(--border); background: var(--bg-subtle); font-size: 12.5px; color: var(--fg-3); }
.sheet-foot .btn-row { gap: 8px; }

@media (max-width: 700px) {
  .dialog.sheet { margin: 12px; }
  .sheet-head { padding: 16px 14px 14px 18px; }
  .sheet-tools, .sheet-list { padding-left: 18px; padding-right: 18px; }
  .sheet-foot { padding-left: 18px; }
}
@keyframes cef-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- onboarding (design 2f) ---------- */
.onboard { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 32px; background: var(--bg-sunken); }
.step { width: 420px; max-width: 100%; display: flex; flex-direction: column; padding: 40px 36px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); box-shadow: var(--shadow-md); }
.step.center { align-items: center; text-align: center; }
.step .logo { box-shadow: var(--shadow-md); }
.step .logo-dot { right: -4px; bottom: -4px; border-width: 3px; }
.step .done { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--green-bg); color: var(--green-fg); }
.step h1 { margin-top: 24px; font: 700 26px var(--font-display); letter-spacing: -.02em; }
.step h2 { font: 700 20px var(--font-display); letter-spacing: -.01em; }
.step .lede { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--fg-3); max-width: 300px; }
.step .fine { margin: 16px 0 0; font-size: 11.5px; color: var(--fg-4); }
.step .btn { margin-top: 28px; }
.perm { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-subtle); }
.perm b { display: block; font-size: 13px; }
.perm p { margin: 2px 0 0; font-size: 12px; color: var(--fg-3); line-height: 1.45; }
.note-green { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: var(--r-input); background: var(--green-bg); color: var(--green-fg); font-size: 12px; font-weight: 500; }
.note-red { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: var(--r-input); background: var(--red-bg); color: var(--red); font-size: 12px; font-weight: 500; }
.note-grey { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; border-radius: var(--r-input); background: var(--bg-sunken); color: var(--fg-2); font-size: 12px; font-weight: 500; }
.labels-card { width: 100%; margin-top: 22px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-subtle); text-align: left; }
.labels-card h3 { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-4); }
.labels-card div { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 500; }
.labels-card i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.dots { display: flex; gap: 6px; margin-top: 32px; justify-content: center; }
.dots i { width: 5px; height: 5px; border-radius: 999px; background: var(--border-strong); transition: width .2s ease; }
.dots i.on { width: 20px; background: var(--solid); }

/* ---------- narrow screens ---------- */
@media (max-width: 1120px) {
  .tr { grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) 110px 82px 88px; }
  .tr .why { display: none; }
}
@media (max-width: 900px) {
  .rail { display: none; }
  .side { width: 216px; padding-left: 8px; }
  .nav-item { font-size: 13px; }
  .tr { grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) 82px 88px; }
  .tr .score { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pile-band { display: none; }
  .choices { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .side { display: none; }
  .pane { padding-left: 8px; }
  .searchbox input { width: 140px; }
}
