/* CryptoBro minimal design system (dark default, light toggle). */

:root,
[data-theme="dark"] {
  --bg: #0a0b0d;
  --surface: #101216;
  --elev: #16181e;
  --line: #22252c;
  --line-soft: #1a1d23;
  --text: #ecedef;
  --muted: #9a9ea8;
  --faint: #6a6e78;
  --accent: #7c8cf8;
  --accent-ink: #0a0b0d;
  --accent-soft: rgba(124, 140, 248, 0.12);
  --up: #16c784;
  --down: #ea3943;
  --warn: #f5a623;
  --radius: 12px;
  --maxw: 1120px;
  --paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

[data-theme="light"] {
  --bg: #f6f3ea;
  --surface: #fffdf8;
  --elev: #f0ece1;
  --line: #e5dfd0;
  --line-soft: #ece7db;
  --text: #1c1b19;
  --muted: #6d6a60;
  --faint: #98937f;
  --accent: #5b6cff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(91, 108, 255, 0.10);
  --warn: #b26a00;
  --paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Commissioner", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .2s ease, color .2s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.hidden { display: none !important; }
::selection { background: var(--accent-soft); }

/* ------------------------------------------------------------------ topbar */
.topbar {
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50;
  min-width: 0;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: -0.01em; font-size: 15px; white-space: nowrap; flex-shrink: 0; }
.brand .logo { color: var(--accent); font-size: 16px; }
.logo-img { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; }
.menu-toggle {
  display: none; background: transparent; color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; font-size: 16px; line-height: 1; padding: 5px 9px; cursor: pointer;
}
.site-nav { display: none; gap: 22px; margin-left: 12px; }
.site-nav a { color: var(--muted); font-size: 14px; transition: color .15s ease; }
.site-nav a:hover { color: var(--text); }
body.home .site-nav { display: flex; }
body.home #status, body.home .menu-toggle { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
main.home [id], section[id] { scroll-margin-top: 76px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--faint); }
[data-theme="dark"] .ic-sun { display: block; }
[data-theme="dark"] .ic-moon { display: none; }
[data-theme="light"] .ic-sun { display: none; }
[data-theme="light"] .ic-moon { display: block; }

/* ------------------------------------------------------------- app layout */
.layout { display: grid; grid-template-columns: 264px 1fr; height: calc(100vh - 60px); height: calc(100dvh - 60px); }
.sidebar { border-right: 1px solid var(--line); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
#nav-list { flex: 1 1 auto; overflow-y: auto; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 11px 16px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.sidebar-foot a { color: var(--muted); font-size: 12.5px; }
.sidebar-foot a:hover { color: var(--text); }
.sidebar-title { padding: 16px 18px 6px; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; }
.nav-tag { padding: 16px 18px 6px; color: var(--accent); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.nav-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 18px; cursor: pointer; color: var(--muted); font-size: 13.5px;
  border-left: 2px solid transparent; transition: color .12s ease, background .12s ease;
}
.nav-item:hover { background: var(--elev); color: var(--text); }
.nav-item.active { background: var(--accent-soft); border-left-color: var(--accent); color: var(--text); }
.nav-item em { color: var(--faint); font-size: 10px; font-style: normal; }
.nav-item.admin-entry { color: var(--accent); font-weight: 600; }
.nav-item.locked { color: var(--faint); }

.main { padding: 22px 26px; overflow-y: auto; }
.main-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
h1 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; max-width: 760px; }

.engine-toggle { display: inline-flex; margin: 14px 12px 0 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.engine-toggle button {
  background: transparent; color: var(--muted); border: none; padding: 7px 14px;
  font-size: 12px; font-weight: 500; cursor: pointer; border-right: 1px solid var(--line);
}
.engine-toggle button:last-child { border-right: none; }
.engine-toggle button.active { background: var(--accent); color: var(--accent-ink); }
.engine-toggle button:hover:not(.active) { background: var(--elev); color: var(--text); }

.controls { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
/* time machine (liquidation heatmap replay) */
.tm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.tm-bar .tm-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tm-bar input[type="range"] { flex: 1 1 180px; min-width: 140px; accent-color: var(--accent); }
.tm-bar .tm-stamp { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 130px; color: var(--text); }
.tm-bar .tm-empty { color: var(--muted); font-size: 12px; }
.tm-bar .tm-count { margin-left: auto; }
.tm-bar .btn.ghost { padding: 3px 9px; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ctl {
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 10px; font-size: 13px; min-width: 118px; outline: none;
}
.ctl:focus { border-color: var(--accent); }
.ctl.refresh { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border: none; font-weight: 600; cursor: pointer; }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; padding: 7px 13px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.ghost:hover { color: var(--text); border-color: var(--faint); }

.chart-wrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
#chart { width: 100%; height: 66vh; }
#datatable { width: 100%; max-height: 66vh; overflow: auto; }
#empty-state { padding: 64px; text-align: center; color: var(--muted); }

/* Chart loading spinner: a floating indicator that never covers the chart, so a
   refresh always updates in place instead of blanking the plot area. */
.chart-loading { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; border-radius: var(--radius);
  pointer-events: none; background: transparent; }
.cb-spinner { position: relative; width: 52px; height: 52px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .45)); }
.cb-spin-ring { position: absolute; inset: 0; width: 52px; height: 52px; color: var(--accent);
  animation: cb-spin 0.9s linear infinite; }
.cb-spin-logo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  animation: cb-pulse 1.4s ease-in-out infinite; }
.cb-spin-logo img { width: 24px; height: 24px; display: block; }
.cb-spin-label { font-size: 12px; color: var(--text); letter-spacing: .02em;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
@keyframes cb-spin { to { transform: rotate(360deg); } }
@keyframes cb-pulse { 0%, 100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .cb-spin-ring { animation-duration: 2.4s; }
  .cb-spin-logo { animation: none; }
}

.status { font-size: 12px; padding: 5px 11px; border-radius: 999px; background: var(--elev); color: var(--muted); white-space: nowrap; }
.status.ok { color: var(--up); }
.status.warn { color: var(--warn); }
.status.err { color: var(--down); }
.status.load { color: var(--accent); }

#raw { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; max-height: 40vh; overflow: auto; }
#raw pre { margin: 0; font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--muted); white-space: pre-wrap; word-break: break-word; }

.raw-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.raw-table th, .raw-table td { border-bottom: 1px solid var(--line); padding: 6px 9px; text-align: left; }
.raw-table th { background: var(--elev); color: var(--accent); position: sticky; top: 0; font-weight: 600; }

.sidebar-overlay { position: fixed; inset: 60px 0 0 0; background: rgba(0, 0, 0, 0.45); z-index: 40; }

/* --------------------------------------------------------------- account */
.user-area { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-chip {
  display: flex; align-items: center; gap: 8px; background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px 3px 4px;
  cursor: pointer; color: var(--text); font-size: 12.5px;
}
.user-chip:hover { border-color: var(--faint); }
.user-chip img { width: 22px; height: 22px; border-radius: 50%; display: block; }
.user-chip .badge { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.user-chip .badge.admin { color: var(--accent); }
.user-chip .caret { color: var(--faint); font-size: 10px; margin-left: 1px; }
.btn { background: var(--accent); color: var(--accent-ink); border: none; border-radius: 9px; padding: 8px 15px; font-weight: 600; cursor: pointer; font-size: 13px; white-space: nowrap; transition: opacity .15s ease, transform .05s ease; }
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.btn.danger { background: var(--down); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; border-radius: 11px; }
.user-menu {
  position: fixed; top: 56px; right: 18px; z-index: 60; background: var(--elev);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; min-width: 210px;
  max-height: calc(100vh - 76px); overflow-y: auto;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
.user-menu.two-col {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; row-gap: 4px;
  align-content: start; min-width: 400px;
}
.user-menu.two-col .who { grid-column: 1 / -1; }
.user-menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: transparent; color: var(--text); border: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.user-menu button:hover { background: var(--surface); }
.user-menu .mi { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; flex: 0 0 15px; color: var(--muted); }
.user-menu button:hover .mi { color: var(--text); }
.user-menu button.seeas-active .mi { color: var(--accent); }
.user-menu .ml { flex: 1 1 auto; min-width: 0; }
.user-menu .who { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu .who small { display: block; color: var(--muted); }
.user-menu .menu-sec { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.user-menu .who + .menu-sec { border-top: none; margin-top: 0; padding-top: 0; }
.user-menu .menu-sec-head { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 10px 2px; }
.user-menu.two-col .menu-sec { border-top: none; margin-top: 0; padding-top: 0; }
.user-menu.two-col .menu-see-as { border-top: none; margin-top: 0; padding-top: 0; }

/* ------------------------------------------------------------ admin panel */
.admin-panel { margin-top: 8px; }
.admin-panel h2 { font-size: 17px; margin: 20px 0 10px; font-weight: 600; }
.admin-panel .lead { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.admin-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.admin-tabs button { background: transparent; color: var(--muted); border: none; border-right: 1px solid var(--line); padding: 7px 14px; font-size: 12px; font-weight: 500; cursor: pointer; }
.admin-tabs button:last-child { border-right: none; }
.admin-tabs button.active { background: var(--accent); color: var(--accent-ink); }
.admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.admin-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 8px 9px; text-align: left; vertical-align: middle; }
.admin-table th { color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.role-pill { font-size: 10px; padding: 2px 9px; border-radius: 999px; background: var(--elev); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.role-pill.admin { background: var(--accent-soft); color: var(--accent); }
.role-pill.root { background: rgba(234, 57, 67, .14); color: var(--down); }
.vis-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.vis-row .k { font-size: 13px; }
.vis-row .k small { color: var(--muted); display: block; }
.vis-row select { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12px; }
.vis-group h3 { font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin: 16px 0 4px; }

/* ------------------------------------------------------------- live series */
.series-access { color: var(--muted); font-size: 12.5px; margin: 2px 0 10px; }
#series-live.hidden { display: none; }
.series-meta { margin: 10px 0; }
.series-chart-wrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.series-render-img { display: block; width: 100%; height: auto; border-radius: 8px; }
#series-chart { width: 100%; height: 68vh; }
.series-controls { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0 6px; align-items: flex-end; }
.series-controls .ctl-label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.series-ov { display: inline-flex; align-items: center; gap: 6px; }
.series-ov input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.ctl.num { min-width: 76px; }
.series-ov-note { color: var(--warn); margin: 2px 0 6px; }
.series-controls .ctl-check { flex-direction: row; align-items: center; }
.series-controls .ctl-check .series-ov { text-transform: none; font-size: 12px; }
.series-controls .series-ov { min-height: 34px; text-transform: none; font-size: 12px; }
.engine-toggle button.locked { color: var(--faint); opacity: .55; }
.engine-toggle button.locked:hover { opacity: .85; }
.engine-toggle button.locked .lock-ic { margin-right: 5px; vertical-align: -1px; }
.ctl-help { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg);
  color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; }
.ctl-help:hover { border-color: var(--accent); color: var(--accent); }
.ctl-tip-host { position: relative; }
.series-tip { position: absolute; right: 0; top: calc(100% + 8px); z-index: 25; width: max-content; max-width: 300px;
  background: var(--elev); color: var(--text); border: 1px solid var(--accent); border-radius: 10px;
  padding: 9px 12px; font-size: 12px; line-height: 1.45; text-transform: none; letter-spacing: normal;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .4); }
.series-tip::before { content: ""; position: absolute; top: -6px; right: 18px; width: 10px; height: 10px;
  background: var(--elev); border-left: 1px solid var(--accent); border-top: 1px solid var(--accent); transform: rotate(45deg); }
.series-tip[hidden] { display: none; }
/* Global hover tooltip: one HTML/CSS box for every tooltip on the platform. */
.cb-tip { position: fixed; z-index: 400; width: max-content; max-width: 300px;
  background: var(--elev); color: var(--text); border: 1px solid var(--accent); border-radius: 10px;
  padding: 9px 12px; font-size: 12px; line-height: 1.45; text-align: left; text-transform: none;
  letter-spacing: normal; font-weight: 400; box-shadow: 0 10px 28px rgba(0, 0, 0, .4); pointer-events: none; }
.cb-tip::before { content: ""; position: absolute; top: -6px; left: var(--tip-arrow, 16px);
  width: 10px; height: 10px; background: var(--elev);
  border-left: 1px solid var(--accent); border-top: 1px solid var(--accent); transform: rotate(45deg); }
.cb-tip.cb-tip--above::before { top: auto; bottom: -6px;
  border-left: none; border-top: none; border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); }
.ctl-tip-host.prune-highlight { animation: prunePulse 1.2s ease-in-out 2; border-radius: 8px; }
@keyframes prunePulse { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 4px var(--accent-soft); } }
.series-jev-controls { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.series-jev-stats { margin: 6px 0 2px; color: var(--text); font-variant-numeric: tabular-nums; }
.series-slider-wrap { display: flex; align-items: center; gap: 12px; margin: 10px 2px 12px; }
.series-slider-wrap input[type="range"] { flex: 1; accent-color: var(--accent); }
.series-slider-label { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#series-live { white-space: nowrap; }
/* Portrait mobile: HQ status lines (D/SNR/σ/AGR/EV/Q + verdict) shown under the
   chart so they do not consume plot space. */
.series-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  margin: 8px 2px 2px; font-size: 12px; line-height: 1.4; }
.series-status .ss-verdict, .series-status .ss-fair { font-weight: 700; }
.series-status .ss-metrics { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------- series trigger conditions */
.series-triggers { margin: 12px 0 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.trg-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.trg-title .trg-hint { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.trg-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 10px; }
.trg-en { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); text-transform: none; letter-spacing: 0; }
.trg-floor { white-space: nowrap; }
.trg-floor .ctl.num { width: 112px; }
.series-triggers .btn.ghost.trg-lib-btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.series-triggers .btn.ghost.trg-lib-btn:hover { filter: brightness(1.08); color: var(--accent-ink); }
.trg-toolbar .ctl-label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.trg-rules { display: flex; flex-direction: column; gap: 10px; }
.trg-rule { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); }
.trg-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.trg-head .trg-label { flex: 1; min-width: 140px; }
.trg-head input[type="color"] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.trg-clauses { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.trg-clause { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.trg-clause .trg-value, .trg-clause .trg-value2 { width: 110px; }
.trg-clause .trg-to { color: var(--muted); font-size: 11px; }
.trg-empty { color: var(--muted); font-size: 12px; padding: 2px 0; }
.trg-note { color: var(--muted); font-size: 11px; align-self: center; }
.series-triggers .btn.ghost { font-size: 11px; padding: 4px 8px; }
.trg-group { border-left: 2px solid var(--line); padding: 4px 0 4px 8px; margin: 6px 0; }
.trg-group[data-group="stop"] { border-left-color: var(--warn, #f59e0b); }
.trg-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.trg-group-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; min-width: 42px; }
.trg-fixed { color: var(--muted); font-size: 12px; }
.trg-bell { color: var(--muted); position: relative; }
.trg-bell.on { color: var(--accent); }
.trg-bell-badge { position: absolute; top: -5px; right: -6px; min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 9px; line-height: 14px;
  text-align: center; font-weight: 700; }
.trg-sub-url { color: var(--muted); font-size: 11px; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.wh-row { border-top: 1px solid var(--line); padding: 12px 0; }
.wh-row:first-of-type { border-top: none; }
.wh-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.trg-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 6px 0 8px;
  padding: 7px 10px; border: 1px dashed var(--line); border-radius: 8px; background: var(--bg); }
.trg-sub-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.trg-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); }
.trg-chk input { accent-color: var(--accent); width: 15px; height: 15px; }
.trg-sub-note { flex-basis: 100%; color: var(--warn, #f59e0b); font-size: 11px; }
.trg-preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.trg-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 10px; cursor: pointer; }
.trg-chip:hover { border-color: var(--accent); }
.trg-chip-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0 2px; line-height: 1; }
.trg-chip-x:hover { color: var(--down, #ea3943); }

/* ------------------------------------------------------ notifications */
.notify-badge { position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 8px; background: var(--down, #ea3943); color: #fff; font-size: 9.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1; }
#notify-bell { position: relative; }
.notify-panel { position: fixed; top: 58px; right: 14px; width: min(380px, calc(100vw - 28px)); max-height: 76vh;
  overflow: auto; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,.4); padding: 12px 14px; }
.ntf-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.ntf-head > span { flex: 1; }
.ntf-head .btn.ghost { font-size: 11px; padding: 4px 8px; }
.ntf-settings { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-bottom: 10px;
  margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.ntf-settings .ntf-row { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.ntf-settings .ctl { flex: 1; min-width: 140px; }
.ntf-settings .btn { font-size: 11px; padding: 4px 8px; }
.ntf-note { color: var(--warn, #f59e0b); font-size: 11px; width: 100%; }
.ntf-list { display: flex; flex-direction: column; gap: 6px; }
.ntf-history { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.acct-warn { border-left: 3px solid var(--warn, #f59e0b); background: color-mix(in srgb, var(--warn, #f59e0b) 8%, var(--surface)); margin-bottom: 12px; }
.ntf-item { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.ntf-item.unread { border-left: 3px solid var(--accent); }
.ntf-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.ntf-body { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ntf-time { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.ntf-empty { color: var(--muted); font-size: 12px; padding: 10px 2px; }

/* --------------------------------------------------- install banner */
.install-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 65;
  display: flex; align-items: center; gap: 12px; width: min(560px, calc(100vw - 28px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,.4); padding: 10px 12px; }
.install-banner img { border-radius: 9px; }
.install-text { flex: 1; }
.install-title { font-size: 13px; font-weight: 600; color: var(--text); }
.install-sub { font-size: 11.5px; color: var(--muted); }
.install-banner .btn { font-size: 12px; padding: 6px 12px; }
.install-banner .btn.ghost { padding: 4px 8px; }

/* ----------------------------------------------------------------- legal */
.legal-doc { max-width: 780px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; line-height: 1.7; }
.legal-doc h1 { margin-top: 0; }
.legal-doc h2 { margin-top: 22px; font-size: 18px; }
.legal-doc a { color: var(--accent); }
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: flex;
  align-items: center; justify-content: space-between; gap: 16px; padding: 13px 20px;
  background: var(--elev); border-top: 1px solid var(--line);
}
.cookie-banner .cookie-text { font-size: 13px; color: var(--text); }
.cookie-banner a { color: var(--accent); }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ----------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { position: relative; background: var(--elev); border: 1px solid var(--line); border-radius: 16px; padding: 24px; max-width: 430px; width: 100%; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.modal-close { position: absolute; top: 10px; right: 14px; background: transparent; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.modal-box h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.modal-box p { color: var(--muted); font-size: 12.5px; }
.modal-box input { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 11px; font-size: 16px; letter-spacing: .3em; text-align: center; margin-top: 8px; }
.qr-box { display: flex; justify-content: center; margin: 14px 0; }
.qr-box canvas, .qr-box img { background: #fff; padding: 8px; border-radius: 10px; image-rendering: pixelated; max-width: 100%; }
.secret-line { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; color: var(--accent); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px; margin: 8px 0; }
.modal-err { color: var(--down); font-size: 12px; min-height: 16px; margin-top: 8px; }

/* --------------------------------------------------------------- billing */
.upsell-banner { background: var(--accent-soft); border: 1px solid var(--accent); color: var(--text); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 16px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
@media (min-width: 1280px) {
  #pricing .section-inner { max-width: 1360px; }
  .plan-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
.price-matrix-wrap { overflow-x: auto; margin-top: 14px; }
.price-matrix { width: 100%; border-collapse: collapse; min-width: 820px; }
.price-matrix th, .price-matrix td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
.price-matrix thead th { font-size: 15px; font-weight: 600; position: sticky; top: 0; background: var(--surface); }
.price-matrix tr.pm-price-row th, .price-matrix tr.pm-price-row td { font-weight: 700; }
.price-matrix tr.pm-price-row .plan-was { font-weight: 500; }
.price-matrix .pm-contact { color: var(--accent); font-weight: 700; }
.price-matrix tr.pm-choose-row th, .price-matrix tr.pm-choose-row td { border-bottom: none; vertical-align: middle; }
.pm-choose { width: 100%; white-space: nowrap; padding: 7px 10px; font-size: 12.5px; }
.price-matrix tbody th { color: var(--muted); font-weight: 400; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.price-matrix td[data-payg] { background: var(--accent-soft); }
.price-matrix thead th[data-payg] { background: var(--accent-soft); }
.price-matrix .yes { color: var(--accent); font-weight: 600; }
.price-matrix .no { color: var(--muted); }
.bill-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bill-head-row .bill-section { margin-bottom: 0; }
.crypto-addr-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 10px; }
.crypto-addr { border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; background: var(--bg); }
.crypto-addr-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.crypto-addr-head span { font-size: 11px; color: var(--muted); word-break: break-all; font-family: ui-monospace, monospace; }
.crypto-qr { display: flex; justify-content: center; margin: 6px 0; }
.crypto-qr img, .crypto-qr canvas { width: 140px; height: 140px; background: #fff; border-radius: 8px; padding: 4px; }
.bill-subnote { margin: 4px 0 12px; }
.payg-what { display: flex; flex-direction: column; gap: 7px; margin: 10px 0; font-size: 12.5px; color: var(--muted); }
.payg-what b { color: var(--text); }
.payg-example { border-left: 3px solid var(--accent); padding-left: 10px; }
.payg-chart { height: 290px; width: 100%; margin: 12px 0 2px; }
.payg-promo { margin: 8px 0; padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--text); font-size: 12.5px; font-weight: 600; }
.rate-now { color: var(--accent); font-weight: 700; }
.rate-was { color: var(--muted); text-decoration: line-through; font-weight: 400; margin-left: 4px; }
.payg-schematic { width: 100%; height: auto; display: block; margin: 10px 0 2px; }
.payg-schematic .ps-h { fill: var(--text); font-size: 14px; font-weight: 600; }
.payg-schematic .ps-s { fill: var(--muted); font-size: 11.5px; }
.payg-schematic .ps-price { fill: var(--accent); font-size: 11.5px; font-weight: 600; }
.payg-schematic .ps-line { stroke: var(--line); stroke-width: 2; }
.payg-schematic .ps-tick { fill: var(--muted); }
.payg-schematic .ps-tick.ps-lg { fill: var(--accent); }
.payg-schematic .ps-total { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--accent); stroke-width: 1.5; }
.payg-schematic .ps-total-v { fill: var(--text); font-size: 17px; font-weight: 700; }
.payg-schematic .ps-total-s { fill: var(--muted); font-size: 11.5px; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; }
.plan-name { font-size: 16px; font-weight: 600; }
.plan-price { font-size: 26px; font-weight: 700; color: var(--accent); margin: 8px 0; letter-spacing: -0.02em;
  min-height: 60px; line-height: 1.15; }
.plan-contact-price { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan-per { font-size: 12px; color: var(--muted); font-weight: 400; }
.plan-desc { color: var(--muted); font-size: 12.5px; min-height: 34px; }
.plan-feats { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.plan-feats li { font-size: 12.5px; color: var(--text); padding-left: 16px; position: relative; }
.plan-feats li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent); }
.plan-card .plan-feats { margin-bottom: 12px; }
.plan-card .plan-cta { margin-top: auto; }
.plan-was { color: var(--muted); text-decoration: line-through; font-size: .6em; margin-right: 2px; }
.plan-now { color: var(--accent); }
.plan-off { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; letter-spacing: .03em;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; vertical-align: middle; }
.promo-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px;
  border: 1px solid var(--accent); border-radius: 12px; padding: 10px 14px; background: var(--accent-soft); font-size: 14px; }
.promo-banner .promo-tag { font-weight: 700; color: var(--accent); }
.promo-banner .promo-ends { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.plan-toggle-row { display: flex; justify-content: center; margin: 16px 0 4px; }
.contact-plan { border-style: dashed; }
.payg-plan { border-color: var(--accent); }
.bill-section { margin: 26px 0 12px; font-size: 15px; letter-spacing: .02em; }
.payg-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.payg-balance { font-size: 15px; font-weight: 600; color: var(--accent); margin: 10px 0; }
.payg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.payg-ccy { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 4px; }
.payg-buy { white-space: nowrap; }
.rate-card { width: 100%; border-collapse: collapse; margin: 8px 0 4px; }
.rate-card td { padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.rate-card td:first-child { color: var(--muted); }
.rate-card td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
a.series-cta { color: var(--accent); text-decoration: underline; cursor: pointer; }
.plan-admin-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ctl-label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tab-check { display: block; padding: 3px 0; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text); }
.tab-check small { color: var(--muted); }
.rc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0; }
.rc-code { font-family: ui-monospace, monospace; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; letter-spacing: .06em; font-size: 13px; }
.rc-note { color: var(--muted); font-size: 11.5px; }
.modal-box input[name="code"] { text-transform: uppercase; }

/* ================================================================== home */
.home { display: block; }
.hero { position: relative; overflow: hidden; padding: 118px 24px 108px; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.hero-inner { position: relative; max-width: var(--maxw); margin: 0 auto; }
.eyebrow, .section-eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em; margin: 0 0 18px; }
.hero h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1.04; letter-spacing: -0.03em; font-weight: 600; max-width: 15ch; margin: 0 0 22px; }
.lede { color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; max-width: 60ch; margin: 0 0 34px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.section { padding: 96px 24px; border-top: 1px solid var(--line-soft); }
.section.alt { background: var(--surface); }
.section-inner { max-width: var(--maxw); margin: 0 auto; }
.section-inner.center { text-align: center; }
.section h2 { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -0.025em; font-weight: 600; margin: 0 0 26px; max-width: none; }
.section-inner.center h2 { margin-left: auto; margin-right: auto; }

.mission-text { font-size: clamp(22px, 3vw, 34px); line-height: 1.42; letter-spacing: -0.02em; max-width: 24ch; margin: 0; font-weight: 400; }

.goals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 16px; }
.goal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; transition: border-color .15s ease, transform .15s ease; }
.goal-card:hover { border-color: var(--faint); transform: translateY(-2px); }
.goal-card h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.goal-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.venue-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; }
.venue-strip span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; font-size: 13px; color: var(--muted); }
.feature-list { list-style: none; padding: 0; margin: 0; max-width: 640px; }
.feature-list li { position: relative; padding: 12px 0 12px 26px; border-bottom: 1px solid var(--line-soft); color: var(--text); font-size: 15px; }
.feature-list li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.cta-band { background: var(--accent-soft); }

.site-footer { border-top: 1px solid var(--line); padding: 40px 24px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.footer-brand { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.footer-brand .logo { color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
.footer-links a { color: var(--muted); font-size: 13.5px; }
.footer-links a:hover { color: var(--text); }
.footer-note { width: 100%; color: var(--faint); font-size: 12px; margin: 14px 0 0; }

/* --------------------------------------------------- marketing components */
.stat-row { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 40px; }
.stat b { display: block; font-size: 27px; font-weight: 600; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.mission-sub { color: var(--muted); font-size: 17px; line-height: 1.65; max-width: 62ch; margin: 24px 0 0; }

.cap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; }
.cap-card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 22px; transition: border-color .15s ease, transform .15s ease; }
.cap-card:hover { border-color: var(--faint); transform: translateY(-2px); }
.cap-card h3 { margin: 0 0 9px; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.cap-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

.flagship-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.flagship-visual { position: relative; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 14px; min-height: 340px; overflow: hidden; }
.flagship-canvas { display: block; width: 100%; height: 340px; }
.flagship-cap { position: absolute; left: 18px; bottom: 14px; font-size: 11px; letter-spacing: .04em; color: var(--muted); background: var(--surface); padding: 2px 6px; border-radius: 6px; }

.venue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 14px; margin-bottom: 34px; }
.venue-card { position: relative; z-index: 1; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; cursor: pointer; color: var(--text); font: inherit; transition: border-color .15s ease, transform .15s ease; }
.venue-card:hover, .venue-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; z-index: 20; }
.venue-name { display: block; font-size: 16px; font-weight: 600; }
.venue-tag { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.venue-pop { display: block; position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 6; background: var(--elev); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 12.5px; color: var(--muted); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility .15s; box-shadow: 0 16px 44px rgba(0, 0, 0, .28); }
.venue-card:hover .venue-pop, .venue-card:focus-visible .venue-pop { opacity: 1; visibility: visible; transform: translateY(0); }
.venue-card.more { cursor: default; border-style: dashed; }
.venue-card.more:hover { transform: none; border-color: var(--line); }

.feature-list.two-col { max-width: none; columns: 2; column-gap: 44px; }
.feature-list.two-col li { break-inside: avoid; }

.api-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; margin: 6px 0 18px; }
.api-code { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.api-code-head { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.api-code-head span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.api-code pre { margin: 0; padding: 16px; overflow: auto; }
.api-code pre code { background: transparent; border: none; padding: 0; color: var(--text); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: var(--elev); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }

.roadmap-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-size: 13.5px; color: var(--text); background: var(--surface); }

#home-plans .plan-card { background: var(--bg); }

/* ----------------------------------------------- modern dashboard shell */
#nav-list { scrollbar-width: thin; }
#nav-list::-webkit-scrollbar { width: 8px; }
#nav-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.sidebar-head { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 14px 14px 8px; }
.nav-search { width: 100%; margin-top: 9px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; font-size: 13px; outline: none; }
.nav-search:focus { border-color: var(--accent); }
.nav-search::placeholder { color: var(--faint); }
#nav-list { padding: 4px 10px 24px; }
.nav-tag { padding: 15px 8px 5px; }
.nav-item { border-left: none; border-radius: 9px; padding: 8px 11px; margin: 1px 0; }
.nav-item.active { background: var(--accent-soft); border-left: none; box-shadow: inset 2px 0 0 var(--accent); }
.nav-item.accent { color: var(--accent); }

.main { padding: 24px 30px 44px; }
.main-head { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.main-head h1 { font-size: 22px; }
.controls { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; gap: 14px; }
.engine-toggle { border-radius: 9px; }
.chart-wrap { border-radius: 14px; padding: 12px; }
#raw { border-radius: 14px; }
.ctl { background: var(--bg); }

@media (max-width: 860px) {
  .stat-row { gap: 20px; }
  .flagship-inner { grid-template-columns: 1fr; gap: 30px; }
  .flagship-visual { min-height: 250px; }
  .flagship-canvas { height: 240px; }
  .api-grid { grid-template-columns: 1fr; }
  .feature-list.two-col { columns: 1; }
  .venue-pop { position: static; opacity: 1; visibility: visible; transform: none; margin-top: 12px; box-shadow: none; }
  .venue-card.more .venue-pop { display: none; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-block; }
  .sidebar {
    position: fixed; top: 60px; bottom: 0; left: 0; width: 84%; max-width: 320px;
    z-index: 45; transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 4px 0 30px rgba(0, 0, 0, .35);
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 16px 14px 44px; }
  #chart { height: 58vh; }
  .hero { padding: 72px 20px 64px; }
  .section { padding: 64px 20px; }
  .mission-text { max-width: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-links { margin-left: 0; }
  /* Topbar: keep everything on one row without clipping. */
  .topbar { gap: 10px; padding: 0 12px; }
  .site-nav {
    overflow-x: auto; white-space: nowrap; flex: 0 1 auto; min-width: 0;
    margin-left: 0; gap: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .status { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand { font-size: 14px; }
  .cookie-banner { flex-direction: column; align-items: stretch; padding: 12px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .rc-grid { grid-template-columns: 1fr; }
  .site-nav { gap: 14px; }
  /* Compact topbar: drop the redundant bits and let the essentials fit. */
  body.home .site-nav { display: none; }
  /* But keep a menu button on the homepage so the nav is reachable on mobile. */
  body.home .menu-toggle { display: inline-block; }
  body.home .site-nav.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: fixed; top: 60px; left: 0; right: 0; z-index: 49;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 12px 14px; box-shadow: 0 16px 34px rgba(0, 0, 0, .35);
    overflow: visible; white-space: normal;
  }
  body.home .site-nav.open a { padding: 11px 6px; font-size: 15px; }
  .status { display: none; }
  .anon-pricing { display: none; }
  .user-chip span:not(.caret) { display: none; }
  .user-chip { padding: 3px 9px 3px 4px; }
  .hero { padding: 60px 18px 54px; }
  .section { padding: 54px 18px; }
  .hero h1 { font-size: clamp(30px, 9vw, 44px); }
  .legend, .chart-wrap { min-width: 0; }
  #empty-state { padding: 40px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ------------------------------------------------------------- paper grain */
body { background-image: var(--paper); background-repeat: repeat; }
.topbar, .sidebar, .chart-wrap, .controls, .admin-card, .flagship-visual,
.series-chart-wrap, .section.alt, .modal-box, .user-menu, .venue-pop, .api-code {
  background-image: var(--paper);
  background-repeat: repeat;
}

/* --------------------------------------------------------------- API docs */
.docs { max-width: 860px; }
.docs h2 { margin: 28px 0 8px; font-size: 19px; }
.docs h3 { margin: 18px 0 6px; font-size: 15px; }
.docs p { color: var(--muted); font-size: 14px; line-height: 1.65; }
.docs .admin-table { margin: 8px 0 16px; }
.docs .api-code { margin: 10px 0 18px; }
.docs-limits { margin: 10px 0 18px; }
.api-create { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.api-create .ctl { min-width: 200px; }
.api-newkey { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }

/* ------------------------------------------- per-endpoint description + dev */
.ep-desc { margin: 12px 0 4px; max-width: 900px; }
.model-note { margin: 10px 0 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 14px 16px; }
.model-note-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.model-note-title { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.model-note-sub { font-size: 12.5px; color: var(--muted); }
.model-note-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.model-note-item { border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; }
.model-note-item b { display: block; font-size: 13px; color: var(--text); margin-bottom: 3px; }
.model-note-item span { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.ep-desc-text { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 0 0 6px; }
.ep-desc-text.ep-muted { color: var(--faint); }
.ep-desc-meta { color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.ep-params { margin-top: 10px; }
.ep-params summary { cursor: pointer; color: var(--accent); font-size: 12.5px; }
.ep-params .admin-table { margin-top: 8px; max-width: 780px; }
.ep-dev { margin: 14px 0; }
.ep-dev-box { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ep-dev-box > summary { cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 600; color: var(--text); list-style: none; }
.ep-dev-box > summary::-webkit-details-marker { display: none; }
.ep-dev-box > summary::before { content: "\203A "; color: var(--accent); }
.ep-dev-box[open] > summary::before { content: "\2304 "; }
.ep-dev-body { padding: 4px 14px 16px; border-top: 1px solid var(--line); }
.ep-dev-body p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.ep-dev-endpoint code { color: var(--accent); }
.ep-dev-body .api-code { margin: 10px 0; }
.sub:empty { display: none; }
.docs-actions { display: flex; gap: 10px; flex-wrap: wrap; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* ------------------------------------------- homepage equities strip */
.stk-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.stk-strip span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 12.5px; color: var(--muted); background: var(--surface); }
.btn.ghost.active { color: var(--accent); border-color: var(--accent); }
.series-slider-wrap select.ctl { min-width: 68px; padding: 5px 8px; font-size: 12px; }

/* ------------------------------------------------------------------- news */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 14px; }
.news-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; text-decoration: none; color: inherit; transition: border-color .15s ease, transform .15s ease; }
.news-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.news-cover { height: 150px; background-size: cover; background-position: center; border-bottom: 1px solid var(--line); }
.news-card-body { padding: 14px 16px 18px; }
.news-card h3 { margin: 6px 0 6px; font-size: 16px; }
.news-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.news-meta { color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 8px; }
.news-lock { border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 1px 8px; font-size: 10.5px; letter-spacing: .04em; }
.news-post-wrap { max-width: 820px; }
.news-back { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 13px; padding: 0 0 14px; }
.news-post-cover { border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.news-post-cover img { width: 100%; display: block; }
.news-title { font-size: 30px; line-height: 1.2; margin: 4px 0 8px; }
.news-body { margin-top: 18px; color: var(--text); font-size: 15.5px; line-height: 1.7; }
.news-body h1, .news-body h2, .news-body h3 { line-height: 1.25; margin: 24px 0 8px; }
.news-body p { margin: 0 0 14px; }
.news-body img { max-width: 100%; height: auto; border-radius: 10px; }
.news-body iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 10px; display: block; margin: 0 0 16px; }
.news-body a { color: var(--accent); }
.news-body blockquote { margin: 0 0 14px; padding: 6px 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.news-body pre, .news-body code { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.news-body code { padding: 1px 5px; font-size: 13px; }
.news-body pre { padding: 12px 14px; overflow-x: auto; }
.news-gate { margin-top: 22px; padding: 26px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
.news-gate-icon { color: var(--accent); }
.news-gate h3 { margin: 8px 0 6px; }
.news-gate p { color: var(--muted); max-width: 460px; margin: 0 auto 14px; }
.news-comments { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 18px; }
.comments-title { font-size: 16px; margin: 0 0 12px; }
.comment-form textarea { width: 100%; }
.comment-form-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.comment-cta { margin-bottom: 10px; }
.comment-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.comment { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 14px; }
.comment-head { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.comment-head span { color: var(--faint); font-size: 11.5px; }
.comment-del { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11.5px; text-decoration: underline; }
.comment-del:hover { color: #ea3943; }
.comment-body { margin-top: 6px; font-size: 14px; line-height: 1.55; word-break: break-word; }

/* ------------------------------------------------------ WYSIWYG (admin) */
.wys-toolbar { display: flex; flex-wrap: wrap; gap: 4px; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; padding: 6px; background: var(--bg); }
.wys-btn { min-width: 32px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 13px; }
.wys-btn:hover { border-color: var(--accent); color: var(--accent); }
.wys-editor { min-height: 260px; border: 1px solid var(--line); border-radius: 0 0 10px 10px; padding: 14px 16px; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.65; overflow-y: auto; }
.wys-editor:focus { outline: none; border-color: var(--accent); }
.wys-editor img { max-width: 100%; }
.wys-editor iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.post-cover-row { margin-top: 10px; }
.post-cover-preview { margin-top: 8px; }
.post-cover-preview img { max-height: 130px; border-radius: 10px; border: 1px solid var(--line); }

/* ----------------------------------------------------- /compare tables */
.compare { max-width: 1100px; }
.cmp-h2 { font-size: 16px; margin: 22px 0 8px; font-weight: 600; }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 8px 0 6px;
  color: var(--muted); font-size: 12.5px; }
.cmp-legend b { margin-right: 4px; font-weight: 700; }
.cmp-asof { margin-left: auto; color: var(--faint); }
.cmp-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cmp-table { border-collapse: collapse; width: 100%; min-width: 780px; font-size: 13px; }
.cmp-mini { min-width: 520px; }
.cmp-table th, .cmp-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); text-align: center; }
.cmp-table tbody tr:last-child th, .cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-table thead th { background: var(--bg); }
.cmp-col { font-weight: 600; color: var(--text); }
.cmp-col a { color: var(--text); text-decoration: none; }
.cmp-col a:hover { color: var(--accent); }
.cmp-tier { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 500; margin-top: 2px; }
.cmp-row-head, .cmp-row { text-align: left; }
.cmp-row { font-weight: 500; color: var(--text); white-space: normal; min-width: 220px; }
.cmp-row-note { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 3px; max-width: 340px; }
.cmp-td { font-size: 15px; }
.cmp-self { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.cmp-wrap { position: relative; }
.cmp-scroll.cmp-faded { position: relative; }
.cmp-scroll.cmp-faded::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 40px;
  pointer-events: none; border-radius: 0 12px 12px 0;
  background: linear-gradient(to right, transparent, var(--surface)); }
.cmp-table th.cmp-more, .cmp-table td.cmp-more { opacity: .45; }
.cmp-table.cmp-mini th:last-child, .cmp-table.cmp-mini td:last-child { padding-right: 46px; }
.cmp-ribbon { position: absolute; top: 50%; right: 0; transform: translateY(-50%); z-index: 3;
  writing-mode: vertical-rl; text-orientation: mixed; padding: 14px 8px; border: 0; cursor: pointer;
  font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600;
  background: var(--accent); color: #fff; border-radius: 10px 0 0 10px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .28); transition: filter .15s ease; }
.cmp-ribbon:hover { filter: brightness(1.1); }
.cmp-yes { color: var(--up, #16c784); font-weight: 700; }
.cmp-partial { color: var(--warn, #f59e0b); font-weight: 700; }
.cmp-no { color: var(--faint, #64748b); }
.cmp-disclaimer { margin-top: 14px; max-width: 900px; }

/* ------------------------------------------- live series help / tutorial */
.series-help { margin: 12px 0 4px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); padding: 14px 16px; }
.sh-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.sh-title { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.sh-sub { font-size: 12.5px; color: var(--muted); }
.sh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sh-item { border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; }
.sh-item b { display: block; font-size: 13px; color: var(--text); margin-bottom: 3px; }
.sh-item span { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.trg-help { margin: 8px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.trg-help > summary { cursor: pointer; padding: 9px 12px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.trg-help[open] > summary { border-bottom: 1px solid var(--line); }
.trg-help-body { padding: 4px 14px 12px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.trg-help-body h4 { color: var(--text); font-size: 13px; margin: 12px 0 4px; }
.trg-help-body ul { margin: 6px 0; padding-left: 18px; }
.trg-help-body li { margin: 3px 0; }
.trg-help-body b { color: var(--text); }
.trg-help-body code { background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; font-size: 11.5px; color: var(--text); }

/* Subscribed (notification-enabled) rules are outlined in blue. */
.trg-rule.trg-notify-on { border-color: var(--accent); background: var(--bg);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg)); box-shadow: inset 3px 0 0 var(--accent); }

.ntf-help { margin: 6px 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.ntf-help > summary { cursor: pointer; padding: 7px 10px; font-size: 12px; font-weight: 600; color: var(--text); }
.ntf-help p { margin: 6px 10px 8px; color: var(--muted); font-size: 12px; line-height: 1.55; }

/* Advanced editor: cross-feed condition rows */
.trg-clause .trg-src { min-width: 76px; }
.trg-clause .trg-feed { max-width: 170px; }
.trg-clause .trg-metric { max-width: 160px; }
.trg-clause .trg-xf { min-width: 84px; }
.trg-clause-feed { border-left: 2px solid var(--accent); padding-left: 6px; }

/* Notifications: test button + inline email configurator */
.ntf-testres { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.ntf-testres.ok { color: var(--up, #16c784); }
.ntf-testres.err { color: var(--down, #ea3943); }
.trg-sub-config { display: inline-flex; align-items: center; gap: 6px; }
.trg-sub-config .trg-sub-email { width: 200px; }

/* --------------------------------------------------------- /help page */
.help-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 18px; }
.help-sec { max-width: 820px; margin: 0 0 26px; }
.help-sec h2 { font-size: 18px; margin: 0 0 8px; }
.help-sec p { color: var(--muted); line-height: 1.65; font-size: 13.5px; }
.help-shot { display: block; width: 100%; max-width: 640px; height: auto; margin: 12px 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.help-steps { color: var(--muted); font-size: 13.5px; line-height: 1.7; padding-left: 20px; }
.help-steps b, .help-list b { color: var(--text); }
.help-list { color: var(--muted); font-size: 13.5px; line-height: 1.7; padding-left: 18px; }
.help-sec .btn { margin-top: 6px; }
.help-sec code { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.help-sec a { color: var(--accent); }
.help-chart-group { margin: 0 0 16px; }
.help-chart-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.help-chart-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.help-chart { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.help-chart:hover { border-color: var(--accent); }
.help-chart b { font-size: 13px; }
.help-chart span { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* --------------------------------------------------------- onboarding */
.onb { max-width: 480px; }
.onb-dot { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.onb h2 { margin: 0 0 8px; }
.onb p { color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.onb-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* Notifications: phone install QR */
.ntf-qrwrap { flex-basis: 100%; }
.ntf-qr { display: flex; gap: 12px; align-items: center; background: #fff; color: #0b0f19;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; }
.ntf-qr img { display: block; width: 132px; height: 132px; }
.ntf-qr-text { display: flex; flex-direction: column; gap: 4px; }
.ntf-qr-text b { font-size: 12.5px; }
.ntf-qr-text span { font-size: 11.5px; color: #475569; line-height: 1.5; }
.ntf-qr-text code { font-size: 11px; background: #eef1f8; border-radius: 4px; padding: 1px 5px; color: #334155; }
.ntf-qr-loading { font-size: 12px; color: var(--muted); padding: 6px 2px; }

/* Onboarding: real product screenshot */
.onb-shot { display: block; width: 100%; height: auto; margin: 10px 0; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.onb-logo-wrap { display: flex; justify-content: center; padding: 18px 0 10px; }
.onb-logo { width: 104px; height: 104px; display: block; filter: drop-shadow(0 8px 24px rgba(124,140,248,.35)); }
.intro-shot { display: block; width: 100%; height: auto; margin: 10px 0; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); box-shadow: 0 6px 24px rgba(0,0,0,.18); }

/* Live Series gate */
.series-locked { max-width: 620px; margin: 20px 0; padding: 20px 22px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface); }
.series-locked p { color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.series-locked-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* Trigger panel title row with the test-alert button */
.trg-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.trg-title .btn.ghost { font-size: 11px; padding: 4px 10px; }

/* ================================================== homepage alternatives
   /homeA (terminal), /homeB (dashboard), /homeC (hybrid). Built from a live
   stat strip, a board mosaic of real (24h stale) chart images and a markets
   table, mixing our marketing with the aggregator dashboard patterns. */
.home-alt { background: var(--bg); }
.hv-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.hv-hero { padding: 84px 0 44px; }
.hv-hero-b { padding: 64px 0 40px; }
.hv-hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hv-hero-copy h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.06; margin: 14px 0 16px; letter-spacing: -0.02em; }
.hv-h1-b { font-size: clamp(30px, 4.5vw, 48px); line-height: 1.08; margin: 0 0 14px; max-width: 760px; letter-spacing: -0.02em; }
.hv-chip { display: inline-block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.hv-lede { color: var(--muted); font-size: 16px; line-height: 1.6; max-width: 620px; }
.hv-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hv-center { text-align: center; }
.hv-center .hv-lede { margin-left: auto; margin-right: auto; }
.hv-center .hv-cta { justify-content: center; }
.hv-hero-c .hv-hero-copy { max-width: 780px; margin: 0 auto; }
.hv-hero-visual .hv-img { border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.hv-img { width: 100%; display: block; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.hv-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: center;
  margin-top: 34px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.hv-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hv-stat-l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-stat-v { font-size: 15px; font-variant-numeric: tabular-nums; }
.hv-strip-cta { white-space: nowrap; background: transparent; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 9px 14px; cursor: pointer; font: inherit; font-size: 13px; }
.hv-strip-cta:hover { border-color: var(--accent); }
.up { color: var(--up); } .down { color: var(--down); }
.hv-section { padding: 58px 0; }
.hv-section.alt { background: var(--elev); }
.hv-head { margin-bottom: 22px; }
.hv-head h2 { font-size: clamp(24px, 3vw, 34px); margin: 6px 0; letter-spacing: -0.02em; }
.hv-sub { color: var(--muted); max-width: 720px; line-height: 1.65; }
.hv-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.hv-tile { display: flex; flex-direction: column; padding: 0; text-align: left; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface); overflow: hidden; cursor: pointer; color: var(--text);
  transition: border-color .15s, transform .15s; }
.hv-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.hv-tile .hv-img { border: 0; border-radius: 0; height: 118px; object-fit: cover; }
.hv-tile-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; }
.hv-tile-body b { font-size: 14px; }
.hv-tile-body span { font-size: 12px; color: var(--muted); line-height: 1.45; }
.hv-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.hv-panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; padding-bottom: 16px; }
.hv-panel .hv-img { border: 0; border-radius: 0; height: 180px; object-fit: cover; }
.hv-panel h3 { margin: 14px 16px 6px; font-size: 17px; }
.hv-panel p { margin: 0 16px 12px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.hv-panel .btn { margin: 0 16px; }
.hv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hv-table th, .hv-table td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.hv-table th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.hv-num { text-align: right; font-variant-numeric: tabular-nums; }
.hv-table .btn { font-size: 12px; padding: 5px 10px; }
.hv-coin em { color: var(--muted); font-style: normal; }
.hv-note { color: var(--muted); font-size: 12px; margin-top: 10px; }
.hv-end { text-align: center; }
.hv-end h2 { font-size: clamp(24px, 3vw, 34px); margin: 0 0 4px; }
.hv-end .hv-cta { justify-content: center; }
.hv-mosaic { margin-top: 34px; }
.hv-mosaic .hv-tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.hv-mosaic .hv-img { height: 108px; }
.hv-feature { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.hv-feature-img img { border-radius: 14px; border: 1px solid var(--line); }
.hv-feature h2 { font-size: clamp(24px, 3vw, 34px); margin: 6px 0 10px; }
.hv-feature p { color: var(--muted); line-height: 1.65; }
.hv-feature .hv-cta { justify-content: flex-start; }
@media (max-width: 860px) {
  .hv-hero-grid, .hv-feature { grid-template-columns: 1fr; }
  .hv-strip { grid-template-columns: repeat(2, 1fr); }
  .hv-strip-cta { grid-column: 1 / -1; text-align: center; }
  .hv-hero { padding-top: 56px; }
}

/* home variants: values, pledge, free tiers, live-series rule demo */
.hv-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.hv-value { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 16px 18px; }
.hv-value b { display: block; font-size: 14.5px; margin-bottom: 5px; }
.hv-value b::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 9px;
  background: var(--accent); transform: rotate(45deg); border-radius: 1px; }
.hv-value span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.hv-pledge { background: var(--elev); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hv-pledge h2 { font-size: clamp(24px, 3vw, 34px); margin: 12px 0 10px; }
.hv-pledge-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.hv-pledge-chip { font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; color: var(--text); background: var(--surface); }
.hv-freetwo { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; max-width: 900px; margin: 0 auto; }
.hv-freecard { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 22px; }
.hv-freecard.paid { border-color: var(--accent); }
.hv-freecard h3 { margin: 0 0 12px; font-size: 20px; }
.hv-freecard ul { list-style: none; padding: 0; margin: 0 0 18px; }
.hv-freecard li { color: var(--muted); font-size: 13.5px; line-height: 1.6; padding-left: 20px; position: relative; margin-bottom: 7px; }
.hv-freecard li::before { content: "\2713"; position: absolute; left: 0; color: var(--up); font-weight: 700; }
.hv-panels-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.hv-rule { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px 16px; }
.hv-rule-top { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.hv-rule-top em { color: var(--muted); font-style: normal; font-weight: 400; font-size: 12px; margin-left: 8px; }
.hv-rule-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--down); margin-right: 8px; }
.hv-rule-line { font-size: 13px; color: var(--muted); line-height: 1.7; }
.hv-rule-line b { color: var(--accent); margin-right: 8px; }
.hv-rule-line.until b { color: var(--warn); }
.hv-rule-line i { font-style: normal; color: var(--text); opacity: .7; margin: 0 4px; }
.hv-rule-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.hv-never { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hv-never span { font-size: 13.5px; border: 1px solid var(--down); border-radius: 999px; padding: 8px 15px; color: var(--text); }
.hv-never span::before { content: "\2715"; color: var(--down); margin-right: 8px; font-weight: 700; }
.hv-hero-d, .hv-hero-e { padding-top: 66px; }

/* home variants: animated lines hero + screenshot slider (G/H/I) */
.hv-hero-lines { position: relative; overflow: hidden; }
.hv-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .85; }
.hv-hero-lines .hv-inner { position: relative; z-index: 1; }
.hv-slider { position: relative; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.hv-slides { position: relative; width: 100%; aspect-ratio: 1090 / 595; background: var(--surface); }
.hv-slide { position: absolute; inset: 0; margin: 0; cursor: pointer; opacity: 0; visibility: hidden;
  transition: opacity .45s ease, visibility .45s ease; }
.hv-slide.active { opacity: 1; visibility: visible; }
.hv-slide .hv-img { border: 0; border-radius: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.hv-slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(to top, rgba(0,0,0,.74), rgba(0,0,0,0)); }
.hv-slide figcaption b { font-size: 15px; color: #fff; }
.hv-slide figcaption span { font-size: 12.5px; color: rgba(255,255,255,.75); }
.hv-slide-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(0,0,0,.45); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.hv-slide-nav.prev { left: 10px; } .hv-slide-nav.next { right: 10px; }
.hv-slide-nav:hover { border-color: var(--accent); }
.hv-dots { position: absolute; top: 12px; right: 14px; display: flex; gap: 6px; }
.hv-dot { width: 8px; height: 8px; border-radius: 50%; border: 0; background: rgba(255,255,255,.35); cursor: pointer; padding: 0; }
.hv-dot.active { background: var(--accent); }
.hv-loadbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.16); z-index: 3; pointer-events: none; }
.hv-loadbar-fill { display: block; height: 100%; width: 0; background: var(--accent); }
@keyframes hv-load { from { width: 0; } to { width: 100%; } }

/* J/K/L: screenshots in the features + liquidations sections */
.hv-liquids-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 20px 0 24px; }
.hv-liquid-shot { margin: 0; position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.hv-liquid-shot .hv-img { border: 0; border-radius: 0; }
.hv-liquid-shot figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(to top, rgba(0,0,0,.74), rgba(0,0,0,0)); }
.hv-liquid-shot figcaption b { color: #fff; font-size: 14px; }
.hv-liquid-shot figcaption span { color: rgba(255,255,255,.75); font-size: 12px; }

/* Capability cards with a screenshot (features section on the new homepage) */
.cap-card.has-shot { padding: 0; overflow: hidden; background: var(--surface); }
.cap-card.has-shot .hv-img { border: 0; border-radius: 0; height: 116px; object-fit: cover; display: block; }
.cap-card .cap-body { padding: 16px 18px 18px; }

/* Pricing: plan cards + comparison matrix on small screens */
@media (max-width: 640px) {
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { padding: 16px; }
  .bill-section { margin: 20px 0 10px; font-size: 14px; }
  .payg-card { padding: 16px; }
  .price-matrix-wrap { -webkit-overflow-scrolling: touch; margin-top: 10px; }
  .price-matrix { min-width: 620px; }
  .price-matrix th, .price-matrix td { padding: 8px 9px; font-size: 12px; }
  .price-matrix tbody th { white-space: normal; max-width: 132px; }
}
@media (max-width: 860px) {
  .price-matrix-wrap { border: 1px solid var(--line); border-radius: 12px; }
  .price-matrix { min-width: 760px; }
}

/* Admin "See as" preview menu + bar */
.user-menu .menu-see-as { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; display: flex; flex-direction: column; }
.user-menu .seeas-head { display: flex; align-items: center; gap: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 10px 2px; }
.user-menu .seeas-active { color: var(--accent); font-weight: 600; }
.seeas-bar { position: fixed; left: 50%; transform: translateX(-50%); top: 66px; z-index: 90;
  background: var(--elev); border: 1px solid var(--accent); color: var(--text); padding: 8px 12px;
  border-radius: 999px; display: flex; gap: 10px; align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); font-size: 13px; }
.seeas-bar b { color: var(--accent); }
.series-trig-locked { margin-top: 18px; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; background: var(--surface); }
.series-trig-locked p { color: var(--muted); margin: 0 0 12px; }
.footer-version { color: var(--muted); font-size: 12px; margin: 6px 0 0; opacity: .75; }

/* Live Series "Reading this chart": spotlight items + locked states */
.sh-item.sh-hoverable { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.sh-item.sh-hoverable:hover { border-color: var(--accent); background: var(--accent-soft); }
.sh-item.sh-locked { opacity: .5; cursor: help; }
.sh-item.sh-locked:hover { opacity: .7; }
.sh-lock { font-size: 11px; opacity: .8; }
.sh-popup { position: fixed; z-index: 80; max-width: 280px; background: var(--elev); color: var(--text);
  border: 1px solid var(--accent); border-radius: 10px; padding: 9px 12px; font-size: 12.5px; line-height: 1.4;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .4); pointer-events: none; }

/* "Reading this chart" points at the matching control when the overlay is off */
@keyframes cbFlash { 0% { box-shadow: 0 0 0 0 rgba(124,140,248,0); } 40% { box-shadow: 0 0 0 7px rgba(124,140,248,.55); } 100% { box-shadow: 0 0 0 0 rgba(124,140,248,0); } }
.cb-flash { animation: cbFlash 1.3s ease-in-out 1; border-radius: 10px; }

/* Full-height crosshair over the Live Series chart (traverses the signal lanes) */
#series-chart { position: relative; }
.series-crosshair { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed #94a3b8;
  pointer-events: none; z-index: 5; }
.series-crosshair.hidden { display: none; }


/* ── per-chart trigger badge + strategy library ── */
.engine-toggle [data-series-view] { position: relative; }
#series-view-toggle { overflow: visible; }
#series-view-toggle button:first-child { border-radius: 9px 0 0 9px; }
#series-view-toggle button:last-child { border-radius: 0 9px 9px 0; }
.trg-count-badge {
  position: absolute; top: -8px; right: -8px; z-index: 6;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: #7c8cf8; color: #fff;
  font-size: 11px; line-height: 17px; text-align: center;
  font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.series-triggers .trg-library { margin-top: 10px; border: 1px solid rgba(148,163,184,.25);
  border-radius: 10px; padding: 12px; background: rgba(148,163,184,.06); }
.trg-lib-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.trg-lib-head span { opacity: .7; font-size: 12px; }
.trg-lib-head button { margin-left: auto; }
.trg-lib-note { opacity: .75; font-size: 13px; padding: 8px 0; }
.trg-lib-sub { margin: 14px 0 8px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; opacity: .6; }
.trg-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.trg-card { border: 1px solid rgba(148,163,184,.25); border-radius: 10px; padding: 10px;
  background: rgba(148,163,184,.05); display: flex; flex-direction: column; gap: 6px; }
.trg-card-title { font-weight: 600; font-size: 13px; }
.trg-card-sub { font-size: 11px; opacity: .7; }
.trg-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 2px 0; }
.trg-card-stats > div { display: flex; justify-content: space-between; font-size: 11px; }
.trg-card-stats span { opacity: .6; }
.trg-card-use { margin-top: auto; }
.trg-card-view { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: -2px; }
.trg-card-is-locked { opacity: .62; }
.trg-card-locked, .trg-card-open { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.series-triggers .btn.ghost.trg-card-open { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.series-triggers .btn.ghost.trg-card-open:hover { filter: brightness(1.08); color: var(--accent-ink); }
.series-triggers .btn.ghost.trg-card-locked { background: var(--elev); color: var(--muted); border-color: var(--line); cursor: pointer; }
.series-triggers .btn.ghost.trg-card-locked:hover { border-color: var(--muted); color: var(--text); }
.trg-card-locked:disabled { cursor: default; }
.trg-card-locked .lock-ic { vertical-align: -1px; }
.trg-lib-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.trg-lib-chip { border: 1px solid rgba(148,163,184,.35); background: transparent; color: inherit;
  border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.trg-lib-chip:hover { background: rgba(124,140,248,.18); }

.trg-q { display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; margin-left: 4px; border-radius: 50%;
  border: 1px solid rgba(148,163,184,.55); font-size: 10px; line-height: 1;
  cursor: help; opacity: .8; vertical-align: middle; }
.trg-q:hover { opacity: 1; background: rgba(124,140,248,.25); }

/* Short disclaimer shown at the bottom of every chart page */
.chart-disclaimer { color: var(--muted); font-size: 11.5px; line-height: 1.5; margin: 20px 0 8px;
  padding-top: 12px; border-top: 1px solid var(--line); opacity: .85; }

/* Desktop "Install app" -> scan-to-install-on-phone QR */
.install-qr-box { text-align: center; margin: 8px 0 14px; }
.install-qr-box img { background: #fff; padding: 10px; border-radius: 12px; image-rendering: pixelated; }
.install-qr-box code { display: block; margin-top: 10px; color: var(--muted); word-break: break-all; font-size: 12px; }

.footer-note a { color: var(--accent); text-decoration: none; }
.footer-note a:hover { text-decoration: underline; }
.sidebar-foot a.desota-mark, .footer-note a.desota-mark { color: var(--text); }
.desota-mark .de { color: var(--accent); }

/* --------------------------------------------------- mobile (compact) */
/* Phone portrait: keep the Live Series view menu (unified / Deviation /
   Volume Deviation / Rank / Dual Rank / Rank Vote / Volume Norm), the playback
   slider and the chart time machine inside the viewport instead of scrolling
   the whole page sideways. */
@media (max-width: 640px) {
  #series-view-toggle {
    display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin: 12px 0 0;
    border: none; border-radius: 0; overflow: visible;
  }
  #series-view-toggle button,
  #series-view-toggle button:first-child,
  #series-view-toggle button:last-child {
    flex: 1 1 auto; border: 1px solid var(--line); border-radius: 9px;
    padding: 7px 10px; text-align: center;
  }
  #series-view-toggle button.active { border-color: var(--accent); }
  .series-controls { gap: 10px; }
  /* Playback slider + its buttons wrap instead of running off-screen. */
  .series-slider-wrap { flex-wrap: wrap; gap: 8px; }
  .series-slider-wrap input[type="range"] { flex: 1 1 100%; min-width: 0; }
  .series-slider-label { white-space: normal; }
  /* Time-machine slider (heatmaps): wrap every control into the viewport. */
  .tm-bar { gap: 8px; }
  .tm-bar .tm-stamp { min-width: 0; }
  .tm-bar .tm-count { margin-left: 0; }
  .tm-bar input[type="range"] { flex: 1 1 100%; min-width: 0; }
  /* Compact Live Series chart on a phone. */
  #series-chart { height: 62vh; min-height: 360px; }
}

/* ── trading accounts (admin) ───────────────────────────────────────── */
.cb-trading-table td, .cb-trading-table th { white-space: nowrap; }
.cb-trading-table tbody tr[data-key] { cursor: pointer; }
.cb-trading-table tbody tr[data-key]:hover { background: var(--accent-soft); }
.cb-trading-table .lead { margin: 0; }
.cb-state { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.cb-state.ok { color: var(--up); }
.cb-state.warn { color: var(--warn); }
.cb-state.bad { color: var(--down); }
.cb-trading-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: 6px; }
.cb-trading-grid .ctl { width: 100%; box-sizing: border-box; }
.cb-trading-grid .ctl.num { max-width: 130px; }


/* ── trading performance (admin) ────────────────────────────────────── */
.cb-perf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cb-perf-head h2 { margin-top: 0; }
.cb-days { max-width: 130px; }
.cb-inline { font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.cb-stat-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 12px 0; }
.cb-stat { background: var(--elev); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cb-stat .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.cb-stat .v { font-size: 17px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cb-chart-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-top: 8px; }
.cb-chart-box h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.cb-chart { height: 220px; width: 100%; }

/* ── email auth pages ───────────────────────────────────────────────── */
#invite-panel .admin-card, #reset-panel .admin-card { max-width: 560px; }
#invite-panel .ctl-label, #reset-panel .ctl-label { margin-top: 10px; }
#invite-panel .ctl, #reset-panel .ctl { width: 100%; box-sizing: border-box; }
