/* Fedi Operator UI — v1.0.0
   Extension layer of the Fedi Design System (tokens.json v1.2.0) for desktop operator dashboards:
   Manifold Fedimint Guardian and Manifold Liquidity Provider.
   Reference implementation: https://fedi-miki.vercel.app/manifold/guardian-dashboard/redesign
   Docs: https://fedi-lab.vercel.app/design/operator  ·  MCP: get_operator_components / get_operator_css
   Series colours: blue-700 = series 1, teal-600 = series 2, pink-600 = series 3 (validated for colour-blind safety).
   Status colours (green/orange/red) only ever mean status. */

:root {
  /* neutral ramp */
  --black: #0B1013;
  --black-soft: #313538;
  --gray-500: #6D7071;
  --gray-400: #9C9EA0;
  --gray-200: #D3D4DB;
  --gray-150: #EAEAEB;
  --gray-50: #F8F8F8;
  --white: #FFFFFF;
  /* palettes */
  --orange-600: #DF7B00;
  --orange-500: #FCA404;
  --orange-100: #FFF5C5;
  --teal-600: #09A3B1;
  --teal-100: #CFFEFD;
  --pink-600: #DC267B;
  --pink-100: #FCE7F3;
  --red-600: #E00A00;
  --red-100: #FFDFDD;
  --green-600: #00A829;
  --green-100: #D7FFE0;
  --blue-700: #0277F2;
  --blue-100: #D6F2FF;
  /* semantic */
  --text-primary: var(--black);
  --text-secondary: var(--gray-500);
  --text-tertiary: var(--gray-400);
  --bg-base: var(--white);
  --bg-subtle: var(--gray-50);
  --border-default: var(--gray-150);
  --border-strong: var(--gray-200);
  /* data series */
  --series-fees: var(--blue-700);
  --series-seats: var(--teal-600);
  --note: var(--pink-600);
  /* shape + depth */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-xxl: 20px;
  --radius-full: 9999px;
  --shadow-soft: 0px 4px 24px rgba(11, 16, 19, 0.10);
  --shadow-regular: 0px 4px 20px rgba(11, 16, 19, 0.30), 0px 2px 2px rgba(11, 16, 19, 0.20);
  --rail-w: 248px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Poppins, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
.ic { display: block; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-secondary); }
.faint { color: var(--text-tertiary); }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── App frame ───────── */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); height: 100vh; min-width: 1200px; }
.rail {
  display: flex; flex-direction: column; gap: 24px;
  padding: 24px 16px; border-right: 1px solid var(--border-default); background: var(--white);
  overflow: auto; position: relative;
}
.product { display: grid; gap: 4px; padding: 0 12px; }
.product img { height: 16px; width: auto; display: block; }
.product span { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.product b { font-size: 16px; line-height: 24px; font-weight: 600; }
.hostpill {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}
.hostpill b { display: block; font-size: 14px; line-height: 20px; font-weight: 600; }
.hostpill span { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--green-600); flex: none; }
.dot.warn { background: var(--orange-500); }
.dot.wait { background: var(--gray-400); }
.dot.live { box-shadow: 0 0 0 0 rgba(0, 168, 41, 0.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 168, 41, 0.45); } 70% { box-shadow: 0 0 0 8px rgba(0, 168, 41, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 168, 41, 0); } }
.navlist { display: grid; gap: 4px; }
.navitem {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 12px;
  border: 0; border-radius: var(--radius-md); background: none; cursor: pointer; text-align: left;
  font-size: 14px; font-weight: 500; color: var(--text-secondary); text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.navitem:hover { background: var(--bg-subtle); color: var(--text-primary); }
.navitem[aria-current="page"] { background: var(--bg-subtle); color: var(--text-primary); }
.navitem .ext { margin-left: auto; color: var(--text-tertiary); }
.navcount {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 4px; border-radius: var(--radius-full);
  background: var(--orange-500); color: var(--black); font-size: 12px; font-weight: 600;
  display: inline-grid; place-items: center;
}
.navdot { margin-left: auto; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--blue-700); }
.rail-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid var(--border-default); }
.rail-ver { padding: 8px 12px 0; font-size: 12px; line-height: 16px; color: var(--text-tertiary); }

.main { overflow: auto; position: relative; background: var(--white); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 16px 40px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color 0.2s ease;
}
.topbar.scrolled { border-bottom-color: var(--border-default); }
.pt { font-size: 24px; line-height: 32px; font-weight: 500; }
.tb-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.tb-spacer { flex: 1; }
.searchbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; min-width: 280px;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-full); background: var(--white);
  color: var(--text-secondary); cursor: pointer; font-size: 14px;
}
.searchbtn:hover { background: var(--bg-subtle); }
.searchbtn kbd { margin-left: auto; font-family: inherit; font-size: 12px; color: var(--text-tertiary); }
.iconbtn {
  position: relative; width: 40px; height: 40px; border-radius: var(--radius-full); border: 0; background: none;
  display: grid; place-items: center; cursor: pointer; color: var(--text-primary);
}
.iconbtn:hover { background: var(--bg-subtle); }
.iconbtn .badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--radius-full);
  background: var(--red-600); color: var(--white); font-size: 10px; line-height: 16px; font-weight: 600; text-align: center;
}
.page { padding: 8px 40px 48px; max-width: 1280px; display: grid; gap: 24px; }
.page::after { content: ""; display: block; height: 72px; }
.page-sub { font-size: 16px; line-height: 24px; color: var(--text-secondary); }

/* ───────── Primitives from the design system ───────── */
.card { position: relative; background: var(--white); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 24px; }
.card.subtle { background: var(--bg-subtle); border-color: transparent; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; min-height: 32px; }
.card-h h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
.card-h .spacer { flex: 1; }
.card-h .sub { font-size: 12px; line-height: 16px; color: var(--text-secondary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-full); border: 1.5px solid transparent;
  font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: var(--black-soft); }
.btn-primary:active { background: var(--gray-400); }
.btn-secondary { background: var(--white); color: var(--black); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-subtle); }
.btn-danger { background: var(--red-600); color: var(--white); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--gray-150); color: var(--gray-400); border-color: transparent; cursor: not-allowed; transform: none; }
.btn-md { height: 48px; font-size: 16px; padding: 0 24px; }
.btn-xs { height: 32px; font-size: 14px; padding: 0 16px; }
.btn-block { width: 100%; }
.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; font-weight: 500; color: var(--text-primary);
  text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px;
}
.linkbtn:hover { text-decoration-color: var(--black); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 12px; border-radius: var(--radius-full);
  font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap;
}
.chip-ok { background: var(--green-100); color: var(--green-600); }
.chip-wait { background: var(--orange-100); color: var(--orange-600); }
.chip-bad { background: var(--red-100); color: var(--red-600); }
.chip-info { background: var(--blue-100); color: var(--blue-700); }
.chip-neutral { background: var(--bg-subtle); color: var(--gray-500); }

.field { display: grid; gap: 8px; }
.field > label, .label { font-size: 14px; line-height: 20px; font-weight: 500; }
.input {
  width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--white); font-size: 16px; line-height: 24px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 4px rgba(11, 16, 19, 0.08); }
.input.is-error { border-color: var(--red-600); }
.input.is-ok { border-color: var(--green-600); }
.input-wrap { position: relative; }
.input-wrap .suffix { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; }
.input-wrap .input { padding-right: 48px; }
.help { font-size: 12px; line-height: 16px; color: var(--text-secondary); display: flex; gap: 4px; align-items: center; }
.help.err { color: var(--red-600); }
.help.ok { color: var(--green-600); }

.toggle {
  position: relative; width: 38px; height: 22px; border-radius: var(--radius-full); border: 0; padding: 0;
  background: var(--gray-200); cursor: pointer; flex: none; transition: background 0.2s ease;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: var(--radius-full);
  background: var(--white); box-shadow: 0 1px 2px rgba(11, 16, 19, 0.24); transition: transform 0.2s var(--ease);
}
.toggle[aria-checked="true"] { background: var(--black); }
.toggle[aria-checked="true"]::after { transform: translateX(16px); }

.seg { display: inline-flex; padding: 4px; gap: 0; border-radius: var(--radius-full); background: var(--bg-subtle); }
.seg button {
  height: 32px; padding: 0 16px; border: 0; border-radius: var(--radius-full); background: none; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--gray-500); white-space: nowrap; transition: background 0.15s ease, color 0.15s ease;
}
.seg button[aria-pressed="true"] { background: var(--white); color: var(--black); box-shadow: 0 1px 4px rgba(11, 16, 19, 0.12); }
.seg button .n { color: var(--text-tertiary); margin-left: 4px; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius-lg); }
.banner .ic { margin-top: 2px; }
.banner.warn { background: var(--orange-100); }
.banner.warn .ic { color: var(--orange-600); }
.banner.info { background: var(--blue-100); }
.banner.info .ic { color: var(--blue-700); }
.banner.ok { background: var(--green-100); }
.banner.ok .ic { color: var(--green-600); }
.banner b { font-weight: 600; }
.banner .banner-t { display: grid; gap: 4px; flex: 1; }
.banner .banner-a { display: flex; gap: 8px; margin-top: 8px; }

.av {
  width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--gray-150); overflow: hidden; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--gray-500);
}
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-24 { width: 24px; height: 24px; }
.av-40 { width: 40px; height: 40px; font-size: 14px; }
.av-48 { width: 48px; height: 48px; font-size: 16px; }
.av-64 { width: 64px; height: 64px; font-size: 20px; }
.av.ink { background: var(--black); color: var(--white); }

.kv { display: grid; gap: 12px; margin: 0; }
.kv > div { display: flex; align-items: center; gap: 12px; }
.kv dt { color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.kv dd { margin: 0 0 0 auto; font-weight: 500; text-align: right; }
.key { width: 12px; height: 12px; border-radius: var(--radius-xs, 2px); display: inline-block; flex: none; }
.key.fees { background: var(--series-fees); }
.key.seats { background: var(--series-seats); }
.key.line { width: 16px; height: 2px; border-radius: var(--radius-full); }

.copyval {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: var(--radius-md);
  background: var(--bg-subtle); border: 0; cursor: pointer; font-size: 14px; font-weight: 500; letter-spacing: 0.02em;
}
.copyval:hover { background: var(--gray-150); }
.idrow .copyval, .success .copyval { justify-self: start; }
.copyval .ic { color: var(--text-secondary); }

/* ───────── Home ───────── */
.hello { display: grid; gap: 8px; padding-top: 16px; }
.hello-date { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-secondary); }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--green-600); }
.hello-h { font-size: 32px; line-height: 40px; font-weight: 500; }
.hello-sum { font-size: 16px; line-height: 24px; color: var(--text-secondary); max-width: 720px; }
.hello-sum b { color: var(--text-primary); font-weight: 600; }
.hello-sum .linkbtn { color: var(--text-primary); }

.signals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; position: relative; }
.signal {
  display: grid; gap: 4px; align-content: start; padding: 20px 24px; border-radius: var(--radius-lg);
  border: 1px solid var(--border-default); background: var(--white); text-decoration: none; cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s var(--ease);
}
.signal:hover { border-color: var(--border-strong); box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.signal.tone-warn { background: var(--orange-100); border-color: transparent; }
.sig-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.sig-top .chip { margin-left: auto; }
.sig-main { font-size: 20px; line-height: 28px; font-weight: 500; }
.sig-sub { font-size: 14px; color: var(--text-secondary); }
.tone-warn .sig-sub { color: var(--text-primary); }
.tone-warn .chip { background: var(--white); }
.sig-ticks { margin-top: 12px; }

.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid-1-1 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }

.earn-head { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.big { font-size: 32px; line-height: 40px; font-weight: 500; }
.unit { font-size: 14px; color: var(--text-secondary); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; padding-bottom: 4px; }
.delta.up { color: var(--green-600); }
.delta.down { color: var(--red-600); }
.legend { display: flex; gap: 20px; margin-left: auto; padding-bottom: 4px; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend b { color: var(--text-primary); font-weight: 600; }

.balance-card { display: grid; gap: 16px; }
.balance-card .card-h { margin-bottom: 0; }
.bal { display: flex; align-items: baseline; gap: 8px; }
.bal-n { font-size: 48px; line-height: 56px; font-weight: 500; letter-spacing: -0.02em; }
.bal-u { font-size: 16px; color: var(--text-secondary); }
.bal-fiat { font-size: 14px; color: var(--text-secondary); margin-top: -12px; }
.compbar { display: flex; gap: 2px; height: 8px; border-radius: var(--radius-full); overflow: hidden; background: var(--gray-150); }
.compbar i { display: block; height: 100%; transition: width 0.6s var(--ease); }
.compbar i.fees { background: var(--series-fees); }
.compbar i.seats { background: var(--series-seats); }
.fine { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.dest { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); flex-wrap: wrap; }
.dest b { color: var(--text-primary); font-weight: 500; }
.row-toggle { display: flex; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border-default); font-size: 14px; }
.row-toggle > span { flex: 1; }
.row-toggle small { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }

.fedrows { display: grid; }
.fedrow {
  display: grid; grid-template-columns: minmax(0, 1.6fr) 120px minmax(0, 1.2fr) 104px; gap: 16px; align-items: center;
  padding: 12px 8px; border-radius: var(--radius-md); cursor: pointer; transition: background 0.15s ease; border: 0; background: none; text-align: left; width: 100%;
}
.fedrow + .fedrow { border-top: 1px solid var(--border-default); border-top-left-radius: 0; border-top-right-radius: 0; }
.fedrow:hover { background: var(--bg-subtle); }
.fedcell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fedcell b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fedcell span { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amt { text-align: right; }
.amt b { display: block; font-weight: 600; }
.amt span { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.cap-foot { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-default); font-size: 12px; color: var(--text-secondary); }
.cap-foot .seats-mini { flex: 1; }

.ticks { display: flex; gap: 2px; height: 20px; align-items: stretch; }
.ticks i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--gray-200); }
.ticks i.deg { background: var(--orange-500); }
.ticks i.down { background: var(--red-600); }
.ticks i.none { background: var(--gray-50); }
.ticks.tall { height: 32px; }
.ticks i:hover { opacity: 0.7; }
.tick-legend { display: flex; gap: 16px; font-size: 12px; line-height: 16px; color: var(--text-secondary); margin-top: 8px; flex-wrap: wrap; }
.tick-legend span { display: inline-flex; align-items: center; gap: 8px; }
.tick-legend i { width: 8px; height: 12px; border-radius: 2px; display: inline-block; background: var(--gray-200); }
.tick-legend i.deg { background: var(--orange-500); }
.tick-legend i.down { background: var(--red-600); }
.tick-legend i.none { background: var(--gray-50); border: 1px solid var(--border-default); }

.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed-i { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; align-items: start; }
.feed-i + .feed-i { border-top: 1px solid var(--border-default); }
.feed-i .ic { color: var(--text-secondary); margin-top: 2px; }
.feed-t { font-size: 14px; line-height: 20px; }
.feed-t b { font-weight: 600; }
.feed-m { font-size: 12px; line-height: 16px; color: var(--text-secondary); margin-top: 2px; }
.feed-a { font-size: 14px; font-weight: 600; white-space: nowrap; }
.feed-a.pos { color: var(--green-600); }
.feed-i.fresh { animation: freshIn 0.6s var(--ease); }
@keyframes freshIn { from { opacity: 0; transform: translateY(-8px); background: var(--bg-subtle); } to { opacity: 1; transform: none; } }

.checklist { display: grid; gap: 0; }
.check-i { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 0; }
.check-i + .check-i { border-top: 1px solid var(--border-default); }
.check-i .mark {
  width: 32px; height: 32px; border-radius: var(--radius-full); display: grid; place-items: center;
  border: 1.5px solid var(--border-strong); color: var(--text-tertiary); font-size: 12px; font-weight: 600;
}
.check-i.done .mark { background: var(--black); border-color: var(--black); color: var(--white); }
.check-i.wait .mark { border-color: var(--orange-500); color: var(--orange-600); }
.check-i b { display: block; font-weight: 600; }
.check-i span { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.progress { height: 8px; border-radius: var(--radius-full); background: var(--gray-150); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--black); border-radius: var(--radius-full); transition: width 0.8s var(--ease); }
.how { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.how > div { display: grid; gap: 8px; padding: 20px; border-radius: var(--radius-lg); background: var(--bg-subtle); }
.how b { font-weight: 600; font-size: 16px; line-height: 24px; display: flex; align-items: center; gap: 8px; }
.how p { color: var(--text-secondary); }

/* ───────── Charts ───────── */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gridline { stroke: var(--gray-150); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis { fill: var(--gray-500); font-size: 12px; font-family: Poppins, sans-serif; }
.chart .fees { fill: var(--series-fees); }
.chart .seats { fill: var(--series-seats); }
.chart .col { transition: opacity 0.15s ease; }
.chart.hovering .col { opacity: 0.45; }
.chart.hovering .col.on { opacity: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart .grow { transform-box: fill-box; transform-origin: 50% 100%; animation: grow 0.7s var(--ease) both; }
.chart .grow-x { transform-box: fill-box; transform-origin: 0 50%; animation: growx 0.8s var(--ease) both; }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart .line { fill: none; stroke: var(--series-fees); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-fees); opacity: 0.1; }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.2s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .wd-dot { fill: var(--black); stroke: var(--white); stroke-width: 2; }
.chart .cross { stroke: var(--gray-400); stroke-width: 1; shape-rendering: crispEdges; }
.chart .peak { fill: var(--gray-500); font-size: 12px; font-family: Poppins, sans-serif; }
.chart .hbar { fill: var(--series-fees); }
.chart .hlabel { fill: var(--black); font-size: 14px; font-family: Poppins, sans-serif; }
.chart .hval { fill: var(--gray-500); font-size: 12px; font-family: Poppins, sans-serif; }
.tipcard {
  position: absolute; z-index: 30; pointer-events: none; min-width: 200px; padding: 12px 16px;
  background: var(--white); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft);
  font-size: 12px; line-height: 16px; opacity: 0; transform: translateY(4px); transition: opacity 0.12s ease, transform 0.12s ease;
}
.tipcard.show { opacity: 1; transform: none; }
.tipcard .tt-h { color: var(--text-secondary); margin-bottom: 8px; }
.tipcard .tt-r { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tipcard .tt-r b { margin-left: auto; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tipcard .tt-tot { border-top: 1px solid var(--border-default); margin-top: 8px; padding-top: 8px; }

/* capacity */
.seatgrid { display: flex; gap: 8px; flex-wrap: wrap; }
.seatgrid i {
  width: 32px; height: 32px; border-radius: var(--radius-md); display: block; border: 1.5px solid var(--border-strong); background: var(--white);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
}
.seatgrid i.run { background: var(--black); border-color: var(--black); }
.seatgrid i.form { background: var(--gray-400); border-color: var(--gray-400); }
.seatgrid i.over { border-color: var(--orange-500); background: var(--orange-100); }
.seatgrid.small i { width: 16px; height: 16px; border-radius: var(--radius-sm); }
.seat-legend { display: flex; gap: 16px; font-size: 12px; line-height: 16px; color: var(--text-secondary); flex-wrap: wrap; }
.seat-legend span { display: inline-flex; align-items: center; gap: 8px; }
.seat-legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; border: 1.5px solid var(--border-strong); }
.seat-legend i.run { background: var(--black); border-color: var(--black); }
.seat-legend i.form { background: var(--gray-400); border-color: var(--gray-400); }

/* ───────── Federations page ───────── */
.caprow { display: flex; align-items: center; gap: 32px; }
.caprow .capnum { font-size: 32px; line-height: 40px; font-weight: 500; }
.caprow .capnum small { font-size: 16px; color: var(--text-secondary); font-weight: 400; }
.filters { display: flex; align-items: center; gap: 16px; }
.filters .search { margin-left: auto; width: 280px; }
.filters .search .input { height: 40px; border-radius: var(--radius-full); padding-left: 40px; font-size: 14px; }
.filters .search .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); }
.fedtable { width: 100%; border-collapse: collapse; }
.fedtable th {
  text-align: left; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-secondary);
  padding: 12px 16px; border-bottom: 1px solid var(--border-default);
}
.fedtable td { padding: 16px; border-bottom: 1px solid var(--border-default); vertical-align: middle; }
.fedtable tr.rowlink { cursor: pointer; transition: background 0.15s ease; }
.fedtable tr.rowlink:hover td { background: var(--bg-subtle); }
.fedtable tr.rowlink td:first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.fedtable tr.rowlink td:last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }
.fedtable .r { text-align: right; }
.fedtable .chev { width: 24px; color: var(--text-tertiary); }
.fedtable .ticks { width: 200px; }
.empty { display: grid; place-items: center; gap: 12px; padding: 48px 24px; text-align: center; color: var(--text-secondary); }
.empty b { color: var(--text-primary); font-weight: 600; font-size: 16px; }

/* drawer */
.drawer-scrim { position: fixed; inset: 0; z-index: 50; background: rgba(11, 16, 19, 0.24); animation: fade 0.2s ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; width: 560px; max-width: 100vw; overflow: auto;
  background: var(--white); box-shadow: var(--shadow-regular); animation: slideIn 0.32s var(--ease);
  display: grid; align-content: start; gap: 24px; padding: 32px;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer::after { content: ""; display: block; height: 72px; }
.drawer-h { display: flex; align-items: center; gap: 16px; }
.drawer-h h2 { font-size: 24px; line-height: 32px; font-weight: 500; }
.drawer-h .sub { font-size: 14px; color: var(--text-secondary); }
.drawer-h .iconbtn { margin-left: auto; align-self: flex-start; }
.stat3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px; border-radius: var(--radius-lg); background: var(--bg-subtle); display: grid; gap: 4px; }
.stat span { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.stat b { font-size: 20px; line-height: 28px; font-weight: 500; }
.stat small { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sec { display: grid; gap: 12px; }
.sec h4 { font-size: 14px; line-height: 20px; font-weight: 600; }
.sec p { color: var(--text-secondary); }
.guardians { display: flex; gap: 12px; flex-wrap: wrap; }
.gnode { display: grid; justify-items: center; gap: 8px; width: 80px; font-size: 12px; line-height: 16px; color: var(--text-secondary); text-align: center; }
.gnode .av { position: relative; overflow: visible; }
.gnode .av .dot { position: absolute; right: 0; bottom: 0; box-shadow: 0 0 0 2px var(--white); }
.gnode.you { color: var(--text-primary); font-weight: 600; }
.thresh { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-lg); background: var(--bg-subtle); font-size: 14px; }
.thresh.warn { background: var(--orange-100); }
.stepline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.stepline li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; position: relative; }
.stepline li::before {
  content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--gray-150);
}
.stepline li:last-child::before { display: none; }
.stepline li .m { width: 24px; height: 24px; border-radius: var(--radius-full); border: 1.5px solid var(--border-strong); background: var(--white); display: grid; place-items: center; }
.stepline li.done .m { background: var(--black); border-color: var(--black); color: var(--white); }
.stepline li.now .m { border-color: var(--black); }
.stepline li.now .m::after { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--black); animation: pulseInk 1.6s infinite; }
@keyframes pulseInk { 50% { opacity: 0.3; } }
.stepline b { display: block; font-weight: 600; }
.stepline span { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
details.tech { border-top: 1px solid var(--border-default); padding-top: 16px; }
details.tech summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.tech summary::-webkit-details-marker { display: none; }
details.tech summary .ic { transition: transform 0.2s ease; }
details.tech[open] summary .ic { transform: rotate(90deg); }
details.tech .kv { margin-top: 16px; }

/* ───────── Earnings page ───────── */
.money-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; padding: 0; }
.money-hero > div { padding: 32px; display: grid; gap: 16px; align-content: start; }
.money-hero > div + div { border-left: 1px solid var(--border-default); background: var(--bg-subtle); border-top-right-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
.money-hero .actions { display: flex; gap: 12px; align-items: center; }
.addr-line { display: flex; align-items: center; gap: 12px; }
.addr-line b { font-size: 16px; line-height: 24px; font-weight: 600; }
.addr-line .chip { margin-left: auto; }
.chart-side { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; align-items: start; }
.sidestats { display: grid; gap: 20px; }
.sidestats div { display: grid; gap: 4px; }
.sidestats span { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sidestats b { font-size: 20px; line-height: 28px; font-weight: 500; }
.share { display: grid; gap: 16px; }
.share-bar { display: flex; gap: 2px; height: 24px; border-radius: var(--radius-sm); overflow: hidden; }
.share-bar i { display: block; height: 100%; }
.share-bar i.fees { background: var(--series-fees); }
.share-bar i.seats { background: var(--series-seats); }
.histtable { width: 100%; border-collapse: collapse; }
.histtable th { text-align: left; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-secondary); padding: 12px 16px; border-bottom: 1px solid var(--border-default); }
.histtable td { padding: 12px 16px; border-bottom: 1px solid var(--border-default); vertical-align: middle; }
.histtable .r { text-align: right; }
.histtable .what { display: flex; align-items: center; gap: 12px; }
.histtable .what .ic { color: var(--text-secondary); }
.histtable .what b { display: block; font-weight: 500; }
.histtable .what span { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.histtable .amt-pos { color: var(--green-600); font-weight: 600; }
.histtable .amt-neg { font-weight: 600; }
.more { display: flex; justify-content: center; padding-top: 16px; }

/* ───────── Listing page ───────── */
.list-status { display: flex; align-items: center; gap: 24px; }
.list-status h3 { font-size: 20px; line-height: 28px; font-weight: 500; }
.list-status .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.list-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.stack { display: grid; gap: 24px; }
.row-between { display: flex; align-items: center; gap: 16px; }
.row-between > div { flex: 1; }
.row-between > .countctl { flex: none; }
.row-between b { font-weight: 600; font-size: 16px; line-height: 24px; display: block; }
.row-between p { color: var(--text-secondary); }
.pricefield { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: center; }
.fiatline { font-size: 14px; color: var(--text-secondary); }
.fiatline b { color: var(--text-primary); font-weight: 600; }
.insight { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius-lg); background: var(--bg-subtle); font-size: 14px; }
.insight .ic { color: var(--text-secondary); margin-top: 2px; }
.countctl { display: inline-flex; align-items: center; gap: 0; border: 1.5px solid var(--border-strong); border-radius: var(--radius-full); height: 48px; }
.countctl button { width: 48px; height: 44px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: var(--radius-full); }
.countctl button:hover { background: var(--bg-subtle); }
.countctl button:disabled { color: var(--gray-200); cursor: not-allowed; background: none; }
.countctl output { min-width: 48px; text-align: center; font-size: 20px; line-height: 28px; font-weight: 500; }
.preview-wrap { position: sticky; top: 96px; display: grid; gap: 16px; }
.hostcard {
  display: grid; gap: 16px; padding: 24px; border-radius: var(--radius-xxl); background: var(--white);
  box-shadow: var(--shadow-soft); border: 1px solid var(--border-default); transition: transform 0.2s var(--ease);
}
.hostcard .hc-top { display: flex; align-items: center; gap: 12px; }
.hostcard .hc-top > div { flex: 1; }
.hostcard .hc-top > div b { display: block; font-weight: 600; font-size: 16px; line-height: 24px; }
.hostcard .hc-top > div span { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.hostcard .hc-price { font-size: 32px; line-height: 40px; font-weight: 500; }
.hostcard .hc-price small { font-size: 14px; color: var(--text-secondary); font-weight: 400; }
.hostcard .hc-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hostcard .hc-facts div { display: grid; gap: 2px; padding: 12px; border-radius: var(--radius-md); background: var(--bg-subtle); }
.hostcard .hc-facts b { font-size: 14px; font-weight: 600; }
.hostcard .hc-facts span { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.hostcard.bump { transform: scale(1.02); }
.hostcard.off { opacity: 0.55; }
.savebar {
  position: fixed; left: calc(var(--rail-w) + 40px); right: 40px; bottom: 96px; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 24px; border-radius: var(--radius-full);
  background: var(--black); color: var(--white); box-shadow: var(--shadow-regular); animation: rise 0.25s var(--ease);
  max-width: 720px; margin: 0 auto;
}
.savebar span { flex: 1; font-weight: 500; }
.savebar .btn-secondary { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.3); }
.savebar .btn-secondary:hover { background: rgba(255, 255, 255, 0.08); }
.savebar .btn-primary { background: var(--white); color: var(--black); }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ───────── Settings ───────── */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.subnav { display: grid; gap: 4px; position: sticky; top: 96px; }
.set-stack { display: grid; gap: 24px; max-width: 760px; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; }
.set-row + .set-row { border-top: 1px solid var(--border-default); }
.set-row > div { flex: 1; }
.set-row b { display: block; font-weight: 600; }
.set-row span { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.addr-big { display: flex; align-items: center; gap: 16px; }
.addr-big .ic { color: var(--text-secondary); }
.addr-big b { display: block; font-size: 20px; line-height: 28px; font-weight: 500; }
.addr-big span { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.log { list-style: none; margin: 0; padding: 0; display: grid; }
.log li { display: flex; gap: 12px; padding: 12px 0; font-size: 14px; }
.log li + li { border-top: 1px solid var(--border-default); }
.log li span { color: var(--text-secondary); width: 120px; flex: none; }
.steps-ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.whatsnew { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--text-secondary); }

/* ───────── Modal ───────── */
.scrim { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(11, 16, 19, 0.42); animation: fade 0.2s ease; }
.modal {
  width: 520px; max-width: 100%; max-height: calc(100vh - 48px); overflow: auto; display: grid; gap: 24px;
  padding: 32px; border-radius: var(--radius-xl); background: var(--white); box-shadow: var(--shadow-regular); animation: rise 0.28s var(--ease);
}
.modal.wide { width: 640px; }
.modal-h { display: flex; align-items: flex-start; gap: 16px; }
.modal-h h2 { font-size: 20px; line-height: 28px; font-weight: 500; }
.modal-h p { color: var(--text-secondary); margin-top: 4px; }
.modal-h .iconbtn { margin-left: auto; margin-top: -8px; margin-right: -8px; }
.modal-a { display: flex; gap: 12px; justify-content: flex-end; }
.review { display: grid; gap: 0; border: 1px solid var(--border-default); border-radius: var(--radius-lg); }
.review > div { display: flex; align-items: center; gap: 12px; padding: 16px; }
.review > div + div { border-top: 1px solid var(--border-default); }
.review span { color: var(--text-secondary); }
.review b { margin-left: auto; font-weight: 600; text-align: right; }
.review b small { display: block; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--text-secondary); }
.review .total { background: var(--bg-subtle); border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
.amount-hero { display: grid; justify-items: center; gap: 4px; padding: 8px 0; }
.amount-hero b { font-size: 48px; line-height: 56px; font-weight: 500; letter-spacing: -0.02em; }
.amount-hero span { color: var(--text-secondary); }
.progress-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.progress-list li { display: flex; align-items: center; gap: 12px; color: var(--text-tertiary); transition: color 0.2s ease; }
.progress-list li .m { width: 24px; height: 24px; border-radius: var(--radius-full); display: grid; place-items: center; border: 1.5px solid var(--border-strong); flex: none; }
.progress-list li.active { color: var(--text-primary); }
.progress-list li.active .m { border-color: var(--black); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.progress-list li.done { color: var(--text-primary); }
.progress-list li.done .m { background: var(--black); border-color: var(--black); color: var(--white); animation: pop 0.3s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(0.6); } to { transform: scale(1); } }
.success { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 8px 0; }
.success .big-check { width: 64px; height: 64px; border-radius: var(--radius-full); background: var(--black); color: var(--white); display: grid; place-items: center; animation: pop 0.4s var(--ease); }
.success h2 { font-size: 24px; line-height: 32px; font-weight: 500; }
.success p { color: var(--text-secondary); }

/* notifications + command palette */
.panel {
  position: fixed; top: 64px; right: 40px; z-index: 55; width: 400px; max-height: 70vh; overflow: auto;
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-regular); animation: rise 0.22s var(--ease);
}
.panel-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-default); position: sticky; top: 0; background: var(--white); }
.panel-h b { font-weight: 600; flex: 1; }
.notif { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 16px 20px; }
.notif + .notif { border-top: 1px solid var(--border-default); }
.notif.unread { background: var(--bg-subtle); }
.notif .ic { color: var(--text-secondary); margin-top: 2px; }
.notif small { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); margin-top: 4px; }
.cmd { width: 600px; padding: 0; gap: 0; overflow: hidden; align-self: start; margin-top: 12vh; }
.cmd-in { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border-default); }
.cmd-in input { flex: 1; border: 0; outline: none; font-size: 16px; line-height: 24px; background: none; }
.cmd-in .ic { color: var(--text-tertiary); }
.cmd-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.cmd-list li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-md); cursor: pointer; }
.cmd-list li .ic { color: var(--text-secondary); }
.cmd-list li span { margin-left: auto; font-size: 12px; color: var(--text-tertiary); }
.cmd-list li.on { background: var(--bg-subtle); }

/* toasts */
.toasts { position: fixed; right: 40px; bottom: 96px; z-index: 80; display: grid; gap: 8px; justify-items: end; pointer-events: none; max-width: 400px; }
.toast {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: var(--radius-lg);
  background: var(--black); color: var(--white); font-size: 14px; line-height: 20px; font-weight: 500;
  box-shadow: var(--shadow-regular); animation: rise 0.25s var(--ease);
}
.toast .ic { color: var(--white); }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity 0.3s ease, transform 0.3s ease; }

/* ───────── Setup (onboarding) ───────── */
.setup { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: 100vh; min-width: 1200px; }
.setup-rail { background: var(--bg-subtle); padding: 40px 32px; display: flex; flex-direction: column; gap: 32px; }
.setup-rail .product { padding: 0; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.setup-steps li {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 12px; border-radius: var(--radius-lg); color: var(--text-secondary); transition: background 0.2s ease;
}
.setup-steps li .n {
  width: 32px; height: 32px; border-radius: var(--radius-full); border: 1.5px solid var(--border-strong); background: var(--white);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.setup-steps li b { display: block; font-weight: 500; color: inherit; }
.setup-steps li small { display: block; font-size: 12px; line-height: 16px; color: var(--text-tertiary); }
.setup-steps li.done { color: var(--text-primary); }
.setup-steps li.done .n { background: var(--black); border-color: var(--black); color: var(--white); }
.setup-steps li.now { background: var(--white); color: var(--text-primary); box-shadow: var(--shadow-soft); }
.setup-steps li.now .n { border-color: var(--black); }
.setup-rail .foot { margin-top: auto; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.setup-main { padding: 48px; overflow: auto; display: grid; justify-items: center; align-content: start; }
.setup-card { width: 100%; max-width: 640px; display: grid; gap: 24px; padding-top: 48px; animation: rise 0.35s var(--ease); }
.setup-card h1 { font-size: 32px; line-height: 40px; font-weight: 500; }
.setup-card .lead { font-size: 16px; line-height: 24px; color: var(--text-secondary); }
.setup-actions { display: flex; gap: 12px; align-items: center; padding-top: 8px; }
.setup-actions .spacer { flex: 1; }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.choice button {
  display: grid; gap: 8px; text-align: left; padding: 24px; border-radius: var(--radius-lg); cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--white); transition: border-color 0.15s ease, box-shadow 0.2s ease;
}
.choice button:hover { box-shadow: var(--shadow-soft); }
.choice button[aria-pressed="true"] { border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }
.choice b { font-weight: 600; font-size: 16px; line-height: 24px; }
.choice span { color: var(--text-secondary); }
.syscheck { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--border-default); border-radius: var(--radius-lg); }
.syscheck li { display: flex; align-items: center; gap: 12px; padding: 16px; }
.syscheck li + li { border-top: 1px solid var(--border-default); }
.syscheck li .v { color: var(--text-secondary); margin-left: auto; }
.syscheck li .m { width: 24px; height: 24px; border-radius: var(--radius-full); display: grid; place-items: center; border: 1.5px solid var(--border-strong); color: transparent; transition: all 0.25s ease; }
.syscheck li.ok .m { background: var(--black); border-color: var(--black); color: var(--white); }
.phrase { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; position: relative; }
.phrase .w {
  display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--border-default); background: var(--white); font-size: 16px; font-weight: 500;
}
.phrase .w i { font-style: normal; width: 20px; font-size: 12px; color: var(--text-tertiary); }
.phrase .w b { font-weight: 500; transition: filter 0.3s ease; }
.phrase.veiled .w b { filter: blur(8px); }
.phrase .reveal { position: absolute; inset: 0; display: grid; place-items: center; }
.quiz { display: grid; gap: 16px; }
.quiz-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; }
.quiz-row b { font-weight: 600; }
.quiz-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.quiz-opts button {
  height: 40px; padding: 0 16px; border-radius: var(--radius-full); border: 1.5px solid var(--border-strong); background: var(--white);
  cursor: pointer; font-size: 14px; font-weight: 500;
}
.quiz-opts button[aria-pressed="true"] { background: var(--black); border-color: var(--black); color: var(--white); }
.quiz-opts.wrong button[aria-pressed="true"] { background: var(--red-600); border-color: var(--red-600); }
.terms-sum { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.terms-sum li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; }
.terms-sum li .ic { color: var(--text-secondary); margin-top: 2px; }
.terms-sum b { font-weight: 600; display: block; }
.terms-sum span { color: var(--text-secondary); }
.qr { width: 160px; height: 160px; border-radius: var(--radius-lg); border: 1px solid var(--border-default); padding: 12px; background: var(--white); }
.idrow { display: flex; align-items: center; gap: 24px; }
.idrow > div { display: grid; gap: 8px; }
.restore-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.restore-grid label { position: relative; }
.restore-grid label i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--text-tertiary); }
.restore-grid .input { padding-left: 40px; height: 44px; font-size: 14px; }

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

/* ───────── Support (chat from the design system: sent = blue, received = subtle, system = dim centred) ───────── */
.support { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.chat { display: flex; flex-direction: column; padding: 0; height: calc(100vh - 232px); min-height: 600px; }
.chat-h { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border-default); }
.chat-h b { display: block; font-weight: 600; font-size: 16px; line-height: 24px; }
.chat-h span:not(.chip):not(.av) { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.chat-h .spacer { flex: 1; }
.av-32 { width: 32px; height: 32px; }
.sup-av { background: linear-gradient(135deg, #FCF7E1 0%, #C0EBFD 100%); padding: 4px; }
.sup-av img { object-fit: contain; }
.chat-safe { margin: 16px 24px 0; }
.msgs { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.msg-sys { align-self: center; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.msg { max-width: 72%; padding: 12px 16px; border-radius: 16px; display: grid; gap: 4px; }
.msg p { font-size: 14px; line-height: 20px; }
.msg time, .msg-card time { font-size: 12px; line-height: 16px; opacity: 0.72; justify-self: end; }
.msg.out { align-self: flex-end; background: var(--blue-700); color: var(--white); border-bottom-right-radius: 4px; }
.msg.in { background: var(--bg-subtle); color: var(--text-primary); border-bottom-left-radius: 4px; }
.msg-row { display: flex; align-items: flex-end; gap: 8px; }
.msg-row .msg { max-width: calc(72% + 40px); }
.msg-card {
  align-self: flex-end; width: 360px; max-width: 72%; display: grid; gap: 12px; padding: 16px;
  border: 1px solid var(--border-default); border-radius: 16px; border-bottom-right-radius: 4px; background: var(--white);
}
.mc-h { display: flex; align-items: center; gap: 8px; }
.mc-h b { font-weight: 600; flex: 1; }
.mc-h .ic { color: var(--text-secondary); }
.mc-kv { gap: 8px; font-size: 12px; line-height: 16px; }
.fix-card {
  max-width: 420px; display: grid; gap: 8px; padding: 16px; border-radius: 16px; border-bottom-left-radius: 4px;
  background: var(--white); border: 1.5px solid var(--black);
}
.fix-card .label { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.fix-card b { font-size: 16px; line-height: 24px; font-weight: 600; }
.fix-card p { font-size: 14px; color: var(--text-secondary); }
.msg-typing { display: flex; align-items: center; gap: 8px; }
.dots { display: inline-flex; gap: 4px; padding: 12px 16px; border-radius: 16px; border-bottom-left-radius: 4px; background: var(--bg-subtle); }
.dots i { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--gray-400); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
.composer { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-default); }
.composer .input { flex: 1; height: 40px; border-radius: var(--radius-full); font-size: 14px; }
.sendbtn { width: 40px; height: 40px; border-radius: var(--radius-full); border: 0; background: var(--black); color: var(--white); display: grid; place-items: center; cursor: pointer; flex: none; }
.topics { display: grid; }
.topic {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 16px; gap: 12px; align-items: center; padding: 12px 8px;
  border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--radius-md); width: 100%;
}
.topic + .topic { border-top: 1px solid var(--border-default); border-top-left-radius: 0; border-top-right-radius: 0; }
.topic:hover { background: var(--bg-subtle); }
.topic .ic { color: var(--text-secondary); }
.topic b { display: block; font-weight: 600; font-size: 14px; }
.topic span { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.dx-list { display: grid; gap: 8px; margin: 16px 0; font-size: 14px; }
.dx-list > div { display: flex; align-items: center; gap: 12px; }
.dx { width: 20px; height: 20px; border-radius: var(--radius-full); display: grid; place-items: center; flex: none; }
.dx.ok { background: var(--green-100); color: var(--green-600); }
.dx.no { background: var(--red-100); color: var(--red-600); }
.card.chat { position: sticky; top: 88px; }
