/* ═══════════════════════════════════════════════════════════════════════════
   ALPHA SIGNAL PRO — V18 DESIGN SYSTEM  ·  "SOVEREIGN" COMPONENT LAYER
   ─────────────────────────────────────────────────────────────────────────
   The single authoritative component layer for the V18 product experience.
   Consumes tokens-v18.css only. Loaded AFTER all legacy layers so every
   rule here intentionally wins the cascade.

   Contents
   01 Base & overflow guards            07 Legacy vocabulary re-skin
   02 App shell (grid/rail/topbar)      08 Responsive table system
   03 Rail navigation                   09 Forms, modals, toasts, palette
   04 Topbar                            10 Public site (pub chrome + landing)
   05 Mobile drawer + bottom nav        11 Empty / error / tech-details states
   06 Product components (asp-*)        12 Responsive tiers + light mode
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ 01 · BASE & OVERFLOW GUARDS ═══════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  max-width: 100%;
  overflow-x: clip;              /* page-level horizontal scroll is forbidden */
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas { max-width: 100%; height: auto; }

::selection { background: rgba(124, 140, 255, 0.28); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 9999;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 600; font-size: 13px;
}
.skip-link:focus { left: 0; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ═══ 02 · APP SHELL ═════════════════════════════════════════════════════ */

.mdn-app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "rail topbar" "rail main";
  min-height: 100dvh;
  background: var(--bg);
}

.mdn-app > .mdn-rail   { grid-area: rail; }
.mdn-app > .mdn-topbar { grid-area: topbar; }
.mdn-app > main.mdn-main { grid-area: main; }

/* Rail collapsed (desktop mini mode) */
.mdn-app.rail-mini { grid-template-columns: 68px 1fr; }
.mdn-app.rail-mini .mdn-rail { width: 68px; }

/* Public / auth pages: no rail — single column */
.mdn-app.no-rail { grid-template-columns: 1fr; grid-template-rows: auto 1fr; grid-template-areas: "topbar" "main"; }

main.mdn-main {
  min-width: 0;                       /* grid child overflow containment */
  width: 100%;
  padding: 22px clamp(14px, 2.4vw, 30px) calc(96px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.no-sidebar main.mdn-main { padding-bottom: 24px; }   /* bottom nav absent */
body.pub-body main.mdn-main { padding: 0; border: 0; background: var(--pub-bg); }

/* Page header inside main */
.mdn-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.mdn-page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: var(--text-2xl);
  font-weight: 700; letter-spacing: var(--tracking-tight);
  color: var(--ink-strong); line-height: 1.15;
}
.mdn-page-head .sub { margin: 4px 0 0; color: var(--dim); font-size: var(--text-md); }
.mdn-page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ═══ 03 · RAIL NAVIGATION ═══════════════════════════════════════════════ */

.mdn-rail {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  z-index: var(--z-rail);
  scrollbar-width: thin;
}

.mdn-rail .rail-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px; text-decoration: none; color: var(--ink-strong);
  min-height: 58px;
}
.mdn-rail .rail-brand img, .mdn-rail .rail-brand .mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 16px;
  color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
}
.mdn-rail .rail-brand b { font-family: var(--display); font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.mdn-rail .rail-brand .tag {
  font-family: var(--mono); font-size: 9px; color: var(--dimmer);
  display: block; letter-spacing: 0.06em; margin-top: 1px;
}

.rail-scroll { flex: 1; padding: 4px 10px 18px; display: flex; flex-direction: column; gap: 2px; }

.mdn-rail-grp { border: 0; padding: 0; }
.mdn-rail-grp > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 2px;
  padding: 12px 8px 6px; color: var(--dimmer);
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: 6px;
}
.mdn-rail-grp > summary::-webkit-details-marker { display: none; }
.mdn-rail-grp > summary::after {
  content: ""; margin-left: auto; width: 6px; height: 6px;
  border-right: 1.5px solid var(--dimmer); border-bottom: 1.5px solid var(--dimmer);
  transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease);
  opacity: .6;
}
.mdn-rail-grp[open] > summary::after { transform: rotate(45deg); }
.mdn-rail-grp > summary:hover { color: var(--dim); }

.mdn-rail-grp > .grp-links { display: flex; flex-direction: column; gap: 1px; }

.rail-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none;
  font-size: 13px; font-weight: 500; line-height: 1.3;
  min-height: 38px;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  border: 1px solid transparent;
  position: relative;
}
.rail-link .ic {
  width: 20px; height: 20px; flex: none;
  display: grid; place-items: center;
  font-size: 13px; opacity: .85;
}
.rail-link span.lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-link:hover { background: rgba(124, 140, 255, 0.07); color: var(--ink); }
.rail-link.on {
  background: linear-gradient(90deg, rgba(124, 140, 255, 0.16), rgba(124, 140, 255, 0.05));
  color: var(--ink-strong); font-weight: 600;
  border-color: rgba(124, 140, 255, 0.18);
}
.rail-link.on::before {
  content: ""; position: absolute; left: -10px; top: 20%; bottom: 20%;
  width: 3px; border-radius: 3px; background: var(--accent);
}
.rail-link .rail-count {
  font-family: var(--mono); font-size: 10px; color: var(--dim);
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 99px; flex: none;
}
.rail-link.on .rail-count { background: rgba(124, 140, 255, 0.15); color: var(--accent-3); border-color: transparent; }

/* Mini rail: hide labels */
.mdn-app.rail-mini .rail-link span.lbl,
.mdn-app.rail-mini .mdn-rail-grp > summary .lbl,
.mdn-app.rail-mini .rail-brand b, .mdn-app.rail-mini .rail-brand .tag,
.mdn-app.rail-mini .rail-link .rail-count { display: none; }
.mdn-app.rail-mini .rail-link { justify-content: center; padding: 10px 0; }
.mdn-app.rail-mini .mdn-rail-grp > summary { justify-content: center; font-size: 9px; padding: 10px 0 4px; }
.mdn-app.rail-mini .mdn-rail-grp > summary::after { display: none; }

.rail-foot { padding: 12px 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.rail-foot .rail-link { min-height: 34px; font-size: 12px; }

/* ═══ 04 · TOPBAR ════════════════════════════════════════════════════════ */

.mdn-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 clamp(14px, 2.4vw, 30px);
  background: color-mix(in srgb, var(--bg-2) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: var(--z-topbar);
  min-width: 0;
}

.mdn-topbar .burger {
  display: none;
  width: 42px; height: 42px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink-2); cursor: pointer;
  align-items: center; justify-content: center; flex: none;
}
.mdn-topbar .burger:hover { border-color: var(--line-2); color: var(--ink); }

.mdn-topbar .crumb { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 13px; }
.mdn-topbar .crumb .sep { color: var(--dimmer); }
.mdn-topbar .crumb b { font-family: var(--display); font-size: 14px; color: var(--ink-strong); font-weight: 600; white-space: nowrap; }
.mdn-topbar .crumb span { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

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

.tb-icon {
  position: relative;
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--dim); text-decoration: none;
  border: 1px solid transparent;
  font-size: 15px;
}
.tb-icon:hover { color: var(--ink); background: var(--panel-2); border-color: var(--line); }
.tb-icon .pip {
  position: absolute; top: 7px; right: 7px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--warn); border: 2px solid var(--bg-2);
}

.tb-user {
  display: flex; align-items: center; gap: 9px; text-decoration: none;
  padding: 5px 10px 5px 5px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink-2); font-size: 12.5px; min-height: 40px;
}
.tb-user:hover { border-color: var(--line-2); }
.tb-user .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
  color: #fff; font-weight: 700; font-size: 12px;
}
.tb-user .who { display: flex; flex-direction: column; line-height: 1.2; max-width: 180px; }
.tb-user .who b { color: var(--ink-strong); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-user .who i { font-style: normal; font-size: 10px; color: var(--dimmer); letter-spacing: 0.05em; text-transform: uppercase; }

.tb-chip {
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 99px; padding: 6px 11px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px;
}
.tb-chip:hover { border-color: var(--line-2); }
.tb-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); }

/* Theme dropdown + user menu (premium.js .dropdown contract) */
.pm-dropdown { position: relative; }
.pm-dropdown .dd {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 210px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--r-md); box-shadow: var(--shadow-3);
  padding: 6px; display: none; z-index: var(--z-dropdown);
}
.pm-dropdown.open .dd { display: block; }
.pm-dropdown .dd .dd-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 11px; border-radius: var(--r-sm); border: 0; background: none;
  color: var(--ink-2); font-size: 13px; cursor: pointer; text-align: left;
  font-family: var(--sans); text-decoration: none;
}
.pm-dropdown .dd .dd-item:hover { background: var(--panel-2); color: var(--ink-strong); }
.pm-dropdown .dd .dd-head {
  padding: 8px 11px 6px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dimmer); font-weight: 700;
}
.pm-dropdown .dd hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }

/* ═══ 05 · MOBILE DRAWER + BOTTOM NAV ════════════════════════════════════ */

#mdnSideScrim {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: var(--overlay); opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
#mdnSideScrim.show { opacity: 1; pointer-events: auto; }

.mdn-bnav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bottomnav);
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, 1fr);
}
.mdn-bnav a, .mdn-bnav .bnav-more {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 52px; padding: 5px 2px 4px;
  color: var(--dimmer); text-decoration: none; font-size: 10px; font-weight: 600;
  letter-spacing: 0.02em; border-radius: var(--r-sm);
  border: 0; background: none; cursor: pointer; font-family: var(--sans);
  -webkit-tap-highlight-color: transparent;
}
.mdn-bnav a .bic, .mdn-bnav .bnav-more .bic { font-size: 17px; line-height: 1; }
.mdn-bnav a.active { color: var(--accent); }
.mdn-bnav a.active .bic { transform: translateY(-1px); }
.mdn-bnav a:active, .mdn-bnav .bnav-more:active { background: var(--panel-2); }

/* ── Breakpoint: drawer + bnav at ≤900px ── */
@media (max-width: 900px) {
  .mdn-app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; grid-template-areas: "topbar" "main"; }
  .mdn-topbar { position: sticky; top: 0; }
  .mdn-topbar .burger { display: inline-flex; }
  .mdn-app > .mdn-rail {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(292px, 86vw);
    transform: translateX(-102%);
    transition: transform var(--dur) var(--ease);
    box-shadow: none; z-index: var(--z-drawer);
  }
  .mdn-app.side-open > .mdn-rail { transform: translateX(0); box-shadow: var(--shadow-3); }
  body:not(.no-sidebar) .mdn-bnav { display: grid; }
  main.mdn-main { padding-top: 14px; }
  .mdn-page-head h1 { font-size: 1.45rem; }
  .mdn-topbar .tb-chip { display: none; }
  /* V18.0.1 — the currency pill must actually vanish on phones. overrides.css
     ships `#aspCurrencyPill { display:inline-block !important }` (v8.7 legacy),
     which out-muscles every non-important rule above; asp.css loads last, so an
     !important of our own is the only reliable counter. */
  .mdn-topbar #aspCurrencyPill,
  .mdn-topbar .tb-chip,
  #aspCurrencyPill.tb-chip { display: none !important; }
  .mdn-topbar .crumb span { display: none; }
  .mdn-topbar .crumb .sep { display: none; }
  .tb-user .who { display: none; }
  .mdn-app.rail-mini .rail-link span.lbl, .mdn-app.rail-mini .mdn-rail-grp > summary .lbl,
  .mdn-app.rail-mini .rail-brand b { display: initial; }   /* drawer always shows labels */
}

/* V18.0.1 — topbar must fit a 360px phone. After the currency pill is hidden,
   the icon run (health · notifications · theme · avatar · sign-out) plus the
   burger and breadcrumb still exceeds 360px, so: drop the crumb's link,
   ellipsis the page title, tighten icon gaps/sizes. */
@media (max-width: 640px) {
  .mdn-topbar { gap: 8px; }
  .mdn-topbar .crumb { min-width: 0; flex: 0 1 auto; overflow: hidden; }
  .mdn-topbar .crumb a { display: none; }
  .mdn-topbar .crumb b { overflow: hidden; text-overflow: ellipsis; }
  .mdn-topbar .tb-right { gap: 6px; }
  .mdn-topbar .tb-right .tb-icon { width: 34px; height: 34px; }
  .mdn-topbar .tb-user .avatar { width: 30px; height: 30px; font-size: 12px; }
}

/* ═══ 06 · PRODUCT COMPONENTS (asp-*) ════════════════════════════════════ */

/* Status cards — the V18 admin dashboard primitive */
.asp-status-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(232px, 100%), 1fr));
}
.asp-status {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, var(--panel) 0%, color-mix(in srgb, var(--panel) 88%, var(--bg)) 100%);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px 16px 13px; text-decoration: none; color: inherit;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  overflow: hidden;
}
a.asp-status:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.asp-status .st-top { display: flex; align-items: center; gap: 8px; }
.asp-status .st-name {
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--dim); flex: 1;
}
.asp-status .st-val {
  font-family: var(--display); font-size: 26px; font-weight: 700;
  color: var(--ink-strong); line-height: 1.05; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.asp-status .st-sub { font-size: 12px; color: var(--dim); line-height: 1.45; }
.asp-status .st-foot { margin-top: auto; padding-top: 8px; font-size: 11px; color: var(--dimmer); display: flex; align-items: center; gap: 6px; }

/* Status dot + word */
.asp-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.asp-dot.ok   { background: var(--up);   box-shadow: 0 0 0 3px var(--up-soft); }
.asp-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.asp-dot.bad  { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.asp-dot.idle { background: var(--dimmer); box-shadow: 0 0 0 3px rgba(139, 149, 184, 0.12); }
.asp-dot.info { background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.asp-dot.pulse { animation: asp-pulse 2.4s var(--ease) infinite; }
@keyframes asp-pulse {
  0%, 100% { opacity: 1; } 50% { opacity: .45; }
}
@media (prefers-reduced-motion: reduce) { .asp-dot.pulse { animation: none; } }

.asp-st-word { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }

/* Architecture flow strip (admin overview + landing) */
.asp-flow {
  display: flex; align-items: stretch; gap: 0; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; overflow: hidden;
}
.asp-flow .node {
  flex: 1 1 130px; min-width: 118px;
  display: flex; flex-direction: column; gap: 3px; justify-content: center;
  padding: 8px 12px; border-radius: var(--r-sm);
  text-decoration: none; color: inherit; position: relative;
}
.asp-flow .node:hover { background: var(--panel-2); }
.asp-flow .node .nm { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 7px; }
.asp-flow .node .ds { font-size: 11.5px; color: var(--dimmer); line-height: 1.35; }
.asp-flow .arrow {
  display: grid; place-items: center; color: var(--dimmer); flex: none;
  min-width: 26px; font-size: 15px; opacity: .7;
}
.asp-flow .arrow::before { content: "→"; }

/* Section card (standard container) */
.asp-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
  display: flex; flex-direction: column; min-width: 0;
}
.asp-card > .hd {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 55%, transparent);
}
.asp-card > .hd .t {
  font-family: var(--display); font-size: 14.5px; font-weight: 600;
  color: var(--ink-strong); letter-spacing: -0.01em; flex: 1;
}
.asp-card > .hd .sub { font-size: 12px; color: var(--dim); }
.asp-card > .bd { padding: 14px 16px; min-width: 0; }
.asp-card > .bd.tight { padding: 0; }
.asp-card > .ft { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* KPI tile */
.asp-kpi { display: flex; flex-direction: column; gap: 3px; padding: 13px 15px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); min-width: 0; }
.asp-kpi .k { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.asp-kpi .v { font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--ink-strong); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.asp-kpi .f { font-size: 11.5px; color: var(--dimmer); }
.asp-kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }

/* Buttons — the one true button system */
.asp-btn, .mdn-btn, .fx-btn, .pm-btn, .pm-btn-solid, .pm-btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 9px 16px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-family: var(--sans); font-size: 13.5px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.asp-btn.primary, .mdn-btn.primary, .pm-btn-solid {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
  color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, var(--shadow-1);
}
.asp-btn.primary:hover, .mdn-btn.primary:hover, .pm-btn-solid:hover { filter: brightness(1.07); box-shadow: var(--shadow-cta); }
.asp-btn.ghost, .mdn-btn.ghost, .pm-btn-line {
  background: transparent; color: var(--ink-2); border-color: var(--line-2);
}
.asp-btn.ghost:hover, .mdn-btn.ghost:hover, .pm-btn-line:hover { color: var(--ink-strong); border-color: var(--accent); background: var(--accent-soft); }
.asp-btn.soft { background: var(--accent-soft); color: var(--accent-3); }
.asp-btn.soft:hover { background: rgba(124,140,255,.2); }
.asp-btn.danger, .mdn-btn.danger { background: var(--down-soft); color: var(--down); border-color: rgba(255,107,129,.25); }
.asp-btn.danger:hover, .mdn-btn.danger:hover { background: rgba(255,107,129,.2); }
.asp-btn.ok, .mdn-btn.success { background: var(--up-soft); color: var(--up); border-color: rgba(46,221,147,.22); }
.asp-btn.sm, .mdn-btn.sm, .fx-btn.sm, .pm-btn.sm { min-height: 32px; padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.asp-btn.lg { min-height: 48px; padding: 13px 24px; font-size: 15px; border-radius: var(--r-md); }
.asp-btn:disabled, .mdn-btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

/* Chips / badges — unified status vocabulary */
.asp-chip, .mdn-badge, .fx-pill, .pm-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.6;
  border: 1px solid transparent; white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.asp-chip.ok, .mdn-badge.ok, .fx-pill.success, .fx-pill.ok, .pm-pill.success, .pm-pill.ok
  { background: var(--up-soft); color: var(--up); border-color: rgba(46,221,147,.2); }
.asp-chip.bad, .mdn-badge.danger, .fx-pill.danger, .fx-pill.err, .pm-pill.danger, .pm-pill.err
  { background: var(--down-soft); color: var(--down); border-color: rgba(255,107,129,.2); }
.asp-chip.warn, .mdn-badge.warn, .mdn-badge.warning, .fx-pill.warning, .pm-pill.warning
  { background: var(--warn-soft); color: var(--warn); border-color: rgba(245,184,65,.2); }
.asp-chip.info, .mdn-badge.info, .fx-pill.info, .pm-pill.info
  { background: var(--info-soft); color: var(--info); border-color: rgba(111,177,255,.2); }
.asp-chip.neutral, .mdn-badge.neutral, .fx-pill.neutral, .fx-pill.muted, .pm-pill.neutral, .pm-pill.muted
  { background: var(--panel-2); color: var(--dim); border-color: var(--line); }
.asp-chip.accent { background: var(--accent-soft); color: var(--accent-3); border-color: rgba(124,140,255,.22); }
.asp-chip.mono, .asp-chip .mono { font-family: var(--mono); }
.fx-pill a, .pm-pill a { color: inherit; }

/* Buy/sell direction chips */
.asp-side { font-family: var(--mono); font-weight: 600; padding: 2px 8px; border-radius: 6px; font-size: 11px; }
.asp-side.buy  { background: var(--up-soft); color: var(--up); }
.asp-side.sell { background: var(--down-soft); color: var(--down); }

/* ═══ 07 · LEGACY VOCABULARY RE-SKIN ═════════════════════════════════════ */

/* Panels → asp-card look */
.mdn-panel, .fx-card, .pm-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: none;
  overflow: hidden;
  min-width: 0;
  display: flex; flex-direction: column;
}
.mdn-panel .mdn-panel-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 55%, transparent);
}
.mdn-panel .mdn-panel-head .t, .fx-card .head .title, .pm-card .head .title {
  font-family: var(--display); font-size: 14.5px; font-weight: 600; color: var(--ink-strong); flex: 1; letter-spacing: -0.01em;
}
.mdn-panel .mdn-panel-body { padding: 14px 16px; min-width: 0; }
.mdn-panel .mdn-panel-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fx-card .head, .pm-card .head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 55%, transparent);
}
.fx-card .body, .pm-card .body { padding: 14px 16px; min-width: 0; }

/* KPIs */
.mdn-kpi, .fx-kpi, .pm-kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 13px 15px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
  text-decoration: none; color: inherit; box-shadow: none;
}
.mdn-kpi .k, .fx-kpi .k, .pm-kpi .k { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.mdn-kpi .v, .fx-kpi .v, .pm-kpi .v { font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--ink-strong); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.mdn-kpi .foot, .fx-kpi .foot, .pm-kpi .foot { font-size: 11.5px; color: var(--dimmer); }
.mdn-grid.kpi-6, .mdn-grid.kpi-4, .mdn-grid.kpi-3 {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
}
.mdn-grid { display: grid; gap: 12px; min-width: 0; }
.mdn-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.mdn-grid.cols-3, .fx-grid.cols-3, .pm-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.fx-grid, .pm-grid, .fx-grid.pm-grid { display: grid; gap: 12px; min-width: 0; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.fx-grid.cols-2, .pm-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }

/* Dots & flow connectors (legacy) */
.mdn-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.mdn-dot.ok { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.mdn-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.mdn-dot.bad, .mdn-dot.err { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.mdn-dot.idle, .mdn-dot.dim { background: var(--dimmer); box-shadow: 0 0 0 3px rgba(139,149,184,.12); }
.mdn-dot.pulse { animation: asp-pulse 2.4s var(--ease) infinite; }
.mdn-conn {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; color: var(--ink-2);
  padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--panel-2);
}
.mdn-conn:hover { border-color: var(--accent-line); color: var(--ink-strong); }
.mdn-conn .ago { font-weight: 500; color: var(--dimmer); letter-spacing: 0; }

/* Inputs / forms */
.mdn-input, .fx-input, .pm-input, .mdn-select, select.fx-input, textarea.fx-input, textarea.pm-input {
  width: 100%; min-width: 0;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 9px 12px; font-family: var(--sans); font-size: 13.5px; line-height: 1.45;
  min-height: 40px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.mdn-input:focus, .fx-input:focus, .pm-input:focus, .mdn-select:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.18);
}
.mdn-input::placeholder, .fx-input::placeholder, .pm-input::placeholder { color: var(--dimmer); }
.mdn-label, .fx-label, .pm-label, label.fx-label {
  display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em;
  color: var(--dim); margin: 0 0 5px; text-transform: none;
}
.fx-formgrid, .pm-formgrid, .formgrid, .form-grid {
  display: grid; gap: 12px 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
}
.check-row { display: flex; align-items: center; gap: 9px; min-height: 38px; font-size: 13px; color: var(--ink-2); }
.check-row input[type="checkbox"], .check-row input[type="radio"] { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }

/* ═══ 08 · RESPONSIVE TABLE SYSTEM ═══════════════════════════════════════ */

.mdn-table-wrap, .fx-table-wrap, .table-wrap { min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-sm); }
.mdn-table-wrap.is-scroll { overflow-x: auto; }

table.mdn-table, table.fx-table, table.pm-table, table.data-table, table.admin-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
table.mdn-table th, table.fx-table th, table.pm-table th, table.data-table th, table.admin-table th {
  text-align: left; padding: 9px 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--dimmer); border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
  background: var(--panel); z-index: 1;
}
table.mdn-table td, table.fx-table td, table.pm-table td, table.data-table td, table.admin-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2); vertical-align: middle; min-width: 0;
  overflow-wrap: anywhere;
}
table.mdn-table tbody tr:last-child td, table.fx-table tbody tr:last-child td,
table.pm-table tbody tr:last-child td { border-bottom: 0; }
table.mdn-table tbody tr:hover td, table.fx-table tbody tr:hover td, table.pm-table tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 45%, transparent); }
.mono, .num { font-family: var(--mono); font-size: 12.5px; }
.mdn-table .row-actions, .fx-table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Cardify (≤768px): terminal.js marks .is-cardable; CSS turns rows into cards */
@media (max-width: 768px) {
  .mdn-table-wrap.is-cardable table, .mdn-table-wrap.is-cardable tbody,
  .mdn-table-wrap.is-cardable tr, .mdn-table-wrap.is-cardable td { display: block; }
  .mdn-table-wrap.is-cardable thead { display: none; }
  .mdn-table-wrap.is-cardable table { border: 0; }
  .mdn-table-wrap.is-cardable tr {
    border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 10px 12px; margin: 0 0 10px; background: var(--panel-2);
  }
  .mdn-table-wrap.is-cardable tr:hover td { background: transparent; }
  .mdn-table-wrap.is-cardable td {
    border: 0; padding: 6px 2px; display: flex; align-items: baseline; gap: 10px;
    white-space: normal;
  }
  .mdn-table-wrap.is-cardable td::before {
    content: attr(data-label);
    flex: none; min-width: 108px; max-width: 42%;
    font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--dimmer);
  }
  .mdn-table-wrap.is-cardable td:not([data-label])::before { content: none; }
  .mdn-table-wrap.is-scroll { border: 1px dashed var(--line-2); }
  /* Scroll affordance */
  .mdn-table-wrap.is-scroll::after {
    content: "swipe →"; display: block; text-align: right;
    font-size: 10px; color: var(--dimmer); padding: 4px 2px 2px;
    font-family: var(--mono); letter-spacing: 0.06em;
  }
}

/* ═══ 09 · MODALS · TOASTS · PALETTE · DRAWER SHELLS ═════════════════════ */

.mdn-toasts { position: fixed; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 28px)); }
@media (max-width: 900px) { .mdn-toasts { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.mdn-toast {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--panel-2); border: 1px solid var(--line-2);
  border-left: 3px solid var(--info);
  border-radius: var(--r-md); box-shadow: var(--shadow-3);
  padding: 12px 14px; font-size: 13px; color: var(--ink);
  animation: asp-toast-in var(--dur) var(--ease-out);
}
.mdn-toast.success { border-left-color: var(--up); }
.mdn-toast.error, .mdn-toast.danger { border-left-color: var(--down); }
.mdn-toast.warning { border-left-color: var(--warn); }
@keyframes asp-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Slide-over / modal scrim */
.pm-modal-backdrop, .fx-modal-backdrop, .mdn-palette-backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal-bg);
  background: var(--overlay); display: grid; place-items: center; padding: 18px;
}
.mdn-palette { width: min(600px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-3); overflow: hidden; }
.mdn-palette-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.mdn-palette-input { flex: 1; background: none; border: 0; color: var(--ink); font-size: 15px; outline: none; font-family: var(--sans); }
.mdn-palette-list { max-height: min(420px, 56vh); overflow-y: auto; padding: 6px; }
.mdn-palette-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.mdn-palette-item:hover, .mdn-palette-item.sel { background: var(--accent-soft); color: var(--ink-strong); }
.mdn-palette-item .k { font-family: var(--mono); font-size: 10px; color: var(--dimmer); margin-left: auto; border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }

/* Tabs (in-page tab strips on secondary pages) */
.mdn-tabs, .fx-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 0 2px; }
.mdn-tab, .fx-tab {
  padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--dim);
  text-decoration: none; border: 0; background: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: var(--sans);
  min-height: 40px;
}
.mdn-tab:hover { color: var(--ink); }
.mdn-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ═══ 11 · EMPTY / ERROR / TECH-DETAILS ══════════════════════════════════ */

.fx-empty, .pm-empty, .asp-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 34px 18px; border-radius: var(--r-md);
  border: 1px dashed var(--line-2); background: color-mix(in srgb, var(--panel-2) 40%, transparent);
  min-width: 0;
}
.fx-empty .icon, .pm-empty .icon, .asp-empty .ic { font-size: 22px; opacity: .5; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--panel-3); color: var(--dim); }
.fx-empty .title, .pm-empty .title, .asp-empty .t { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.fx-empty .sub, .pm-empty .sub, .asp-empty .s { font-size: 12.5px; color: var(--dim); max-width: 46ch; line-height: 1.55; }
.asp-empty .act { margin-top: 8px; }

/* Alerts / banners */
.asp-note {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: var(--r-md); padding: 12px 14px; font-size: 13px; line-height: 1.55;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2);
}
.asp-note.info { border-color: rgba(111,177,255,.25); background: var(--info-soft); color: var(--ink); }
.asp-note.ok { border-color: rgba(46,221,147,.25); background: var(--up-soft); }
.asp-note.warn { border-color: rgba(245,184,65,.3); background: var(--warn-soft); }
.asp-note.bad { border-color: rgba(255,107,129,.28); background: var(--down-soft); }

/* Technical details — always collapsed, never in the default experience */
details.tech {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--bg-2) 60%, transparent);
  margin-top: 10px; min-width: 0;
}
details.tech > summary {
  cursor: pointer; list-style: none; user-select: none;
  padding: 8px 12px; font-size: 11.5px; font-weight: 600; color: var(--dim);
  display: flex; align-items: center; gap: 7px;
  letter-spacing: 0.03em;
}
details.tech > summary::-webkit-details-marker { display: none; }
details.tech > summary::before { content: "▸"; color: var(--dimmer); transition: transform var(--dur-fast) var(--ease); }
details.tech[open] > summary::before { transform: rotate(90deg); }
details.tech > summary:hover { color: var(--ink-2); }
details.tech .tech-body { padding: 4px 12px 12px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); line-height: 1.7; overflow-x: auto; }
details.tech .tech-body code { color: var(--accent-3); }

/* ═══ 10 · PUBLIC SITE — PREMIUM FINTECH EXPERIENCE ══════════════════════ */
/* The public identity: deep indigo night sky, generous space, editorial
   type, restrained motion. Fully standalone from app chrome.            */

body.pub-body {
  background: var(--pub-bg);
  color: var(--pub-ink);
  font-size: 15px;
}
[data-theme="dark"] body.pub-body, body.pub-body[data-theme="dark"] { --pub-bg: #05070F; }

.pub-wrap { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
@media (max-width: 640px) { .pub-wrap { width: calc(100% - 32px); } }

/* ── Public nav ── */
.pub-nav {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--pub-bg) 82%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--pub-line);
}
.pub-nav .inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 64px; width: min(1180px, calc(100% - 40px)); margin-inline: auto;
}
@media (max-width: 640px) { .pub-nav .inner { width: calc(100% - 32px); min-height: 58px; } }
.pub-nav .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--pub-ink); }
.pub-nav .logo img, .pub-nav .logo .mark { width: 30px; height: 30px; border-radius: 8px; }
.pub-nav .logo .mark { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-500), var(--brand-400)); color: #fff; font-family: var(--display); font-weight: 700; }
.pub-nav .logo b { font-family: var(--display); font-size: 16px; letter-spacing: -0.01em; }
.pub-nav .links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.pub-nav .links a {
  padding: 8px 12px; border-radius: 8px; text-decoration: none;
  color: var(--pub-dim); font-size: 13.5px; font-weight: 550;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  min-height: 38px; display: inline-flex; align-items: center;
}
.pub-nav .links a:hover { color: var(--pub-ink); background: var(--pub-panel); }
.pub-nav .links a.on { color: var(--pub-ink); background: var(--pub-panel); }
.pub-nav .cta { display: flex; gap: 9px; align-items: center; }
.pub-nav .cta .pub-btn.sm { min-height: 38px; padding: 8px 14px; font-size: 13px; }

.pub-burger {
  display: none; margin-left: auto;
  width: 42px; height: 42px; border-radius: 9px;
  border: 1px solid var(--pub-line); background: var(--pub-panel);
  cursor: pointer; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.pub-burger span { display: block; width: 16px; height: 1.6px; background: var(--pub-ink); border-radius: 2px; transition: transform var(--dur) var(--ease), opacity var(--dur-fast) var(--ease); }
.pub-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
.pub-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.pub-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

.pub-mobile-nav {
  display: none; flex-direction: column; gap: 2px;
  padding: 8px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--pub-line);
  background: var(--pub-bg);
  max-height: calc(100dvh - 58px); overflow-y: auto;
}
.pub-mobile-nav.open { display: flex; }
.pub-mobile-nav a {
  padding: 13px 10px; border-radius: 10px; text-decoration: none;
  color: var(--pub-ink); font-size: 15px; font-weight: 550;
  border-bottom: 1px solid var(--pub-line);
}
.pub-mobile-nav a.on { color: var(--accent); }
.pub-mobile-nav .pm-cta { display: flex; gap: 10px; padding-top: 14px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .pub-nav .links { display: none; }
  .pub-nav .cta { display: none; }
  .pub-burger { display: inline-flex; }
}

/* ── Public buttons ── */
.pub-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 22px; border-radius: var(--r-md);
  font-family: var(--sans); font-size: 14px; font-weight: 650; line-height: 1.2;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.pub-btn.solid, .pub-btn.jade {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
  color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 8px 24px rgba(76, 95, 213, 0.35);
}
.pub-btn.solid:hover, .pub-btn.jade:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(76, 95, 213, 0.45); }
.pub-btn.line { background: transparent; color: var(--pub-ink); border-color: var(--pub-line-2); }
.pub-btn.line:hover { border-color: var(--accent); color: var(--accent); }
.pub-btn.light { background: var(--pub-panel); color: var(--pub-ink); border-color: var(--pub-line); }
.pub-btn.light:hover { border-color: var(--pub-line-2); }
.pub-btn.sm { min-height: 38px; padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.pub-btn.lg { min-height: 52px; padding: 15px 28px; font-size: 15px; }

/* ── Hero ── */
.pub-hero {
  position: relative; overflow: hidden;
  padding: clamp(56px, 9vw, 110px) 0 clamp(48px, 7vw, 90px);
  border-bottom: 1px solid var(--pub-line);
  background:
    radial-gradient(1100px 520px at 78% -12%, rgba(124, 140, 255, 0.16), transparent 62%),
    radial-gradient(760px 420px at 8% 112%, rgba(46, 221, 147, 0.07), transparent 60%),
    var(--pub-bg);
}
.pub-hero::before {  /* fine grid texture */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--pub-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--pub-line) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .35;
  mask-image: radial-gradient(900px 480px at 60% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(900px 480px at 60% 0%, #000 0%, transparent 72%);
}
.pub-hero .wrap { position: relative; display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: center; }
@media (max-width: 960px) { .pub-hero .wrap { grid-template-columns: 1fr; } }

.pub-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-3);
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  padding: 6px 12px; border-radius: 99px; margin: 0 0 18px;
}
.pub-h1 {
  font-family: var(--display);
  font-size: clamp(2.15rem, 5.4vw, 3.9rem);
  font-weight: 700; line-height: 1.06; letter-spacing: -0.03em;
  color: var(--pub-ink); margin: 0 0 18px;
}
.pub-h1 .grad {
  background: linear-gradient(100deg, var(--brand-400) 8%, var(--brand-300) 48%, var(--jade-500) 108%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pub-lead { font-size: clamp(15px, 1.6vw, 17.5px); line-height: 1.7; color: var(--pub-dim); max-width: 56ch; margin: 0 0 26px; }
.pub-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.pub-hero-trust { display: flex; gap: 10px 26px; flex-wrap: wrap; color: var(--pub-dim); font-size: 12.5px; }
.pub-hero-trust .ti { display: inline-flex; align-items: center; gap: 7px; }
.pub-hero-trust .ti::before { content: "✓"; color: var(--jade-500); font-weight: 700; }

/* Hero architecture animation */
.asp-hero-flow {
  position: relative;
  display: flex; flex-direction: column; gap: 0;
  background: color-mix(in srgb, var(--pub-panel) 72%, transparent);
  border: 1px solid var(--pub-line-2); border-radius: var(--r-xl);
  padding: clamp(18px, 2.6vw, 30px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.asp-hero-flow::before {
  content: ""; position: absolute; inset: 0; pointer-events: events; pointer-events: none;
  background: radial-gradient(420px 200px at 50% 0%, rgba(124, 140, 255, 0.10), transparent 70%);
}
.asp-hero-flow .hf-title {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--pub-dim); text-align: center; margin-bottom: 16px;
}
.hf-node {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--pub-bg); border: 1px solid var(--pub-line-2);
  position: relative;
}
.hf-node .hf-ic {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  display: grid; place-items: center; font-size: 15px;
  background: var(--accent-soft); color: var(--accent-3);
  border: 1px solid var(--accent-line);
}
.hf-node .hf-tx { min-width: 0; }
.hf-node .hf-tx b { display: block; font-size: 13px; font-weight: 650; color: var(--pub-ink); letter-spacing: -0.01em; }
.hf-node .hf-tx span { display: block; font-size: 11px; color: var(--pub-dim); line-height: 1.4; }
.hf-node.hl { border-color: rgba(46, 221, 147, 0.35); }
.hf-node.hl .hf-ic { background: var(--up-soft); color: var(--jade-500); border-color: rgba(46, 221, 147, 0.3); }
.hf-link {
  display: grid; place-items: center; height: 34px; position: relative; color: var(--dimmer);
}
.hf-link .flow-line {
  width: 2px; height: 100%; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), rgba(124, 140, 255, 0.15));
  position: relative; overflow: hidden;
}
.hf-link .flow-line::after {
  content: ""; position: absolute; left: 0; right: 0; height: 10px; top: -12px;
  background: linear-gradient(180deg, transparent, var(--brand-300));
  animation: hf-stream 2.6s linear infinite;
}
@keyframes hf-stream { 0% { top: -12px; } 100% { top: 100%; } }
@media (prefers-reduced-motion: reduce) { .hf-link .flow-line::after { animation: none; } }

/* Market strip */
.pub-markets-strip { border-bottom: 1px solid var(--pub-line); background: color-mix(in srgb, var(--pub-panel) 50%, transparent); }
.pub-markets-strip .inner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  width: min(1180px, calc(100% - 40px)); margin-inline: auto;
  padding: 13px 0;
}
.pub-markets-strip .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pub-dim); flex: none; }
.pub-mkt-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 99px; text-decoration: none;
  border: 1px solid var(--pub-line-2); background: var(--pub-bg);
  font-size: 12.5px; font-weight: 600; color: var(--pub-ink-2); letter-spacing: 0.02em;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.pub-mkt-chip:hover { border-color: var(--accent); color: var(--pub-ink); }
.pub-mkt-chip .mc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--jade-500); }

/* ── Sections ── */
.pub-section { padding: clamp(48px, 7vw, 92px) 0; border-bottom: 1px solid var(--pub-line); }
.pub-section.alt { background: color-mix(in srgb, var(--pub-panel) 55%, transparent); }
.pub-h2 {
  font-family: var(--display);
  font-size: clamp(1.65rem, 3.4vw, 2.5rem);
  font-weight: 700; line-height: 1.12; letter-spacing: -0.025em;
  color: var(--pub-ink); margin: 0 0 14px; max-width: 22ch;
}
.pub-section .sec-lead { font-size: 15.5px; line-height: 1.7; color: var(--pub-dim); max-width: 62ch; margin: 0 0 clamp(26px, 4vw, 44px); }
.pub-grid { display: grid; gap: 14px; }
.pub-grid.c2 { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.pub-grid.c3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.pub-grid.c4 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }

.pub-card {
  position: relative; display: flex; flex-direction: column; gap: 9px;
  padding: 22px; border-radius: var(--r-lg);
  background: var(--pub-panel); border: 1px solid var(--pub-line);
  min-width: 0;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.pub-card:hover { border-color: var(--pub-line-2); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.pub-card .ic {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 18px;
  background: var(--accent-soft); color: var(--accent-3);
  border: 1px solid var(--accent-line);
}
.pub-card h3 { font-family: var(--display); font-size: 16.5px; font-weight: 650; letter-spacing: -0.015em; color: var(--pub-ink); margin: 0; }
.pub-card p { font-size: 13.5px; line-height: 1.65; color: var(--pub-dim); margin: 0; }
.pub-card > a > p, a.pub-card p { font-size: 14px; color: var(--pub-ink-2); }

/* Steps (how it works) */
.pub-steps { counter-reset: step; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.pub-step { position: relative; padding: 20px; border-radius: var(--r-lg); background: var(--pub-panel); border: 1px solid var(--pub-line); counter-increment: step; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pub-step::before {
  content: "0" counter(step);
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  color: var(--accent-3);
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  width: fit-content; padding: 3px 9px; border-radius: 99px;
}
.pub-step .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; background: var(--accent-soft); color: var(--accent-3); border: 1px solid var(--accent-line); }
.pub-step h3 { font-family: var(--display); font-size: 15.5px; font-weight: 650; margin: 0; color: var(--pub-ink); letter-spacing: -0.01em; }
.pub-step p { font-size: 13px; line-height: 1.6; color: var(--pub-dim); margin: 0; }

/* Roles (admin vs client) */
.pub-roles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.pub-role { padding: 24px; border-radius: var(--r-lg); border: 1px solid var(--pub-line); background: var(--pub-panel); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pub-role .role-tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; width: fit-content; font-weight: 600; }
.pub-role.admin .role-tag { background: var(--info-soft); color: var(--info); border: 1px solid rgba(111,177,255,.25); }
.pub-role.core .role-tag { background: var(--accent-soft); color: var(--accent-3); border: 1px solid var(--accent-line); }
.pub-role.client .role-tag { background: var(--up-soft); color: var(--jade-500); border: 1px solid rgba(46,221,147,.25); }
.pub-role h3 { font-family: var(--display); font-size: 18px; font-weight: 700; margin: 0; color: var(--pub-ink); letter-spacing: -0.02em; }
.pub-role p { font-size: 13.5px; line-height: 1.65; color: var(--pub-dim); margin: 0; }
.pub-role ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.pub-role ul li { display: flex; gap: 9px; font-size: 13px; color: var(--pub-ink-2); line-height: 1.5; }
.pub-role ul li::before { content: "✓"; color: var(--jade-500); font-weight: 700; flex: none; }

/* Pricing cards */
.pub-price { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); align-items: stretch; }
.pub-price-card { padding: 26px; border-radius: var(--r-lg); border: 1px solid var(--pub-line); background: var(--pub-panel); display: flex; flex-direction: column; gap: 14px; min-width: 0; position: relative; }
.pub-price-card.feat { border-color: var(--accent-line); background: linear-gradient(180deg, rgba(124,140,255,0.07), transparent 46%), var(--pub-panel); }
.pub-price-card .pn { font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--pub-ink); }
.pub-price-card .pv { font-family: var(--display); font-size: 34px; font-weight: 700; color: var(--pub-ink); letter-spacing: -0.03em; }
.pub-price-card .pv small { font-size: 14px; color: var(--pub-dim); font-weight: 500; letter-spacing: 0; }
.pub-price-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pub-price-card ul li { display: flex; gap: 9px; font-size: 13px; color: var(--pub-ink-2); line-height: 1.5; }
.pub-price-card ul li::before { content: "✓"; color: var(--jade-500); font-weight: 700; flex: none; }

/* FAQ */
.pub-faq { display: flex; flex-direction: column; gap: 10px; max-width: 780px; }
.pub-faq details { border: 1px solid var(--pub-line); border-radius: var(--r-md); background: var(--pub-panel); overflow: hidden; }
.pub-faq summary { cursor: pointer; list-style: none; padding: 15px 18px; font-size: 14.5px; font-weight: 600; color: var(--pub-ink); display: flex; align-items: center; gap: 10px; min-height: 48px; }
.pub-faq summary::-webkit-details-marker { display: none; }
.pub-faq summary::after { content: "+"; margin-left: auto; color: var(--accent-3); font-size: 18px; font-weight: 500; transition: transform var(--dur-fast) var(--ease); }
.pub-faq details[open] summary::after { transform: rotate(45deg); }
.pub-faq details .a { padding: 0 18px 16px; font-size: 13.5px; line-height: 1.7; color: var(--pub-dim); }

/* Final CTA */
.pub-cta-band {
  position: relative; overflow: hidden;
  padding: clamp(52px, 8vw, 96px) 0; text-align: center;
  background:
    radial-gradient(760px 380px at 50% 120%, rgba(124, 140, 255, 0.2), transparent 66%),
    var(--pub-bg);
  border-bottom: 1px solid var(--pub-line);
}
.pub-cta-band h2 { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -0.025em; margin: 0 0 12px; color: var(--pub-ink); }
.pub-cta-band p { font-size: 15.5px; color: var(--pub-dim); margin: 0 auto 26px; max-width: 52ch; line-height: 1.65; }
.pub-cta-band .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Public footer ── */
.pub-foot { background: color-mix(in srgb, var(--pub-panel) 55%, transparent); border-top: 1px solid var(--pub-line); padding: 44px 0 28px; }
.pub-foot .cols { display: grid; gap: 30px; grid-template-columns: minmax(200px, 1.6fr) repeat(auto-fit, minmax(140px, 1fr)); }
@media (max-width: 700px) { .pub-foot .cols { grid-template-columns: 1fr 1fr; } }
.pub-foot h4 { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pub-dim); margin: 0 0 12px; }
.pub-foot a { display: block; color: var(--pub-ink-2); text-decoration: none; font-size: 13.5px; padding: 4px 0; }
.pub-foot a:hover { color: var(--accent-3); }
.pub-foot .fine { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--pub-line); margin-top: 34px; padding-top: 18px; font-size: 12px; color: var(--pub-dim); }

/* ═══ 10b · AUTH PAGES (login / signup / partner) ════════════════════════ */

.asp-auth {
  min-height: 100dvh; display: grid; place-items: center;
  padding: 28px 18px calc(28px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 480px at 82% -10%, rgba(124, 140, 255, 0.14), transparent 62%),
    radial-gradient(700px 380px at 6% 110%, rgba(46, 221, 147, 0.06), transparent 60%),
    var(--bg);
}
.asp-auth .auth-card {
  width: min(440px, 100%); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3); padding: clamp(24px, 4vw, 36px);
  display: flex; flex-direction: column; gap: 16px;
}
.asp-auth .brand { display: flex; align-items: center; gap: 11px; justify-content: center; text-decoration: none; }
.asp-auth .brand img, .asp-auth .brand .mark { width: 38px; height: 38px; border-radius: 10px; }
.asp-auth .brand .mark { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-500), var(--brand-400)); color: #fff; font-family: var(--display); font-weight: 700; font-size: 19px; }
.asp-auth .brand b { font-family: var(--display); font-size: 19px; color: var(--ink-strong); letter-spacing: -0.02em; }
.asp-auth h1 { font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin: 0; text-align: center; color: var(--ink-strong); }
.asp-auth .hint { text-align: center; font-size: 13.5px; color: var(--dim); margin: -6px 0 0; line-height: 1.6; }
.asp-auth form { display: flex; flex-direction: column; gap: 13px; }
.asp-auth .alt { text-align: center; font-size: 13px; color: var(--dim); }
.asp-auth .alt a { color: var(--accent-3); font-weight: 600; }
.asp-auth .legal { font-size: 11px; color: var(--dimmer); text-align: center; line-height: 1.6; }
.asp-auth .legal a { color: var(--dim); }
.asp-auth .flash-err {
  background: var(--down-soft); border: 1px solid rgba(255,107,129,.28); color: var(--down);
  border-radius: var(--r-sm); padding: 10px 13px; font-size: 13px; line-height: 1.5;
}

/* ═══ 12 · RESPONSIVE TIERS ══════════════════════════════════════════════
   V18.0.1 REGRESSION FIX: these desktop rail-width tiers were previously
   written as bare (max-width: …) queries AFTER §05's mobile block — at
   ≤900px the later 1024px rule out-cascaded §05's grid-template-columns:1fr,
   so phones rendered a 200px rail column + a sliver of content (the exact
   defect in the field reports: squeezed/clipped cards, half-empty screens).
   Desktop tiers are now gated to min-width: 901px so the §05 mobile
   architecture can never be out-cascaded again. */

@media (min-width: 901px) and (max-width: 1280px) {
  .mdn-app { grid-template-columns: 210px 1fr; }
  .mdn-app.rail-mini { grid-template-columns: 68px 1fr; }
}

@media (min-width: 901px) and (max-width: 1024px) {
  .mdn-app { grid-template-columns: 200px 1fr; }
  .asp-flow .node { flex: 1 1 120px; }
}

@media (max-width: 900px) {
  /* drawer + bnav tier handled in §05 — must beat the legacy 76px rule
     (terminal.css body:not(.no-sidebar) .mdn-main) on specificity AND order */
  body:not(.no-sidebar) main.mdn-main,
  body:not(.no-sidebar) .mdn-main { padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important; }
}

/* V18.0.1 — mobile shell re-assertion (defense-in-depth). §05 defines the
   ≤900px architecture; this trailing rule guarantees the single-column grid
   wins at phone widths no matter what desktop tiers are added above. */
@media (max-width: 900px) {
  .mdn-app,
  .mdn-app.rail-mini,
  .mdn-app.no-rail { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  body:not(.no-sidebar) main.mdn-main, body:not(.no-sidebar) .mdn-main { padding: 14px 14px calc(92px + env(safe-area-inset-bottom)) !important; gap: 12px; }
  .mdn-page-head { align-items: flex-start; }
  .mdn-page-head .actions { width: 100%; }
  .asp-kpi .v, .mdn-kpi .v, .fx-kpi .v, .pm-kpi .v { font-size: 21px; }
  .asp-status .st-val { font-size: 22px; }
  .asp-flow { flex-direction: column; }
  .asp-flow .arrow { transform: rotate(90deg); min-height: 26px; }
  .asp-btn, .mdn-btn { font-size: 13px; }
  .asp-btn:not(.sm) .mdn-btn:not(.sm) { min-height: 42px; }  /* touch targets */
}

@media (max-width: 480px) {
  body { font-size: 14px; }
  .asp-kpi-grid, .mdn-grid.kpi-6, .mdn-grid.kpi-4, .mdn-grid.kpi-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asp-hero-flow .hf-title { font-size: 9.5px; }
  .pub-hero-cta .pub-btn { width: 100%; }
  .pub-nav .inner { gap: 10px; }
  .mdn-bnav a, .mdn-bnav .bnav-more { font-size: 9px; }
  .pub-lead { font-size: 14.5px; }
}

@media (max-width: 360px) {
  .asp-kpi-grid, .mdn-grid.kpi-6, .mdn-grid.kpi-4, .mdn-grid.kpi-3 { grid-template-columns: 1fr; }
  .mdn-bnav a, .mdn-bnav .bnav-more { font-size: 8.5px; padding: 4px 1px; }
}

/* ═══ 12b · LIGHT MODE ADJUSTMENTS ═══════════════════════════════════════ */

[data-theme="light"] .mdn-app { background: var(--bg); }
[data-theme="light"] .mdn-rail { background: #FFFFFF; border-right-color: var(--line); }
[data-theme="light"] .mdn-topbar { background: rgba(255, 255, 255, 82%); border-bottom-color: var(--line); }
[data-theme="light"] .mdn-panel, [data-theme="light"] .fx-card, [data-theme="light"] .pm-card { background: #FFFFFF; }
[data-theme="light"] .mdn-panel .mdn-panel-head, [data-theme="light"] .fx-card .head, [data-theme="light"] .pm-card .head { background: var(--panel-2); }
[data-theme="light"] .mdn-input, [data-theme="light"] .fx-input, [data-theme="light"] .pm-input { background: #FFFFFF; }
[data-theme="light"] .asp-hero-flow { background: rgba(255, 255, 255, 0.8); }
[data-theme="light"] .hf-node { background: #FFFFFF; }
[data-theme="light"] .hf-link .flow-line { background: linear-gradient(180deg, var(--brand-500), rgba(76, 95, 213, 0.15)); }
[data-theme="light"] body.pub-body, body.pub-body { --pub-bg: #F6F7FB; }

/* pub tokens default (dark) — bridge to tokens-v18 if legacy files absent */
:root {
  --pub-bg: #05070F;
  --pub-panel: #0D1322;
  --pub-ink: #ECF0FC;
  --pub-ink-2: #C3CCE6;
  --pub-dim: #8B95B8;
  --pub-line: #1E2946;
  --pub-line-2: #2C3A5E;
  --pub-accent: #7C8CFF;
  --pub-accent-deep: #4C5FD5;
  --pub-accent-soft: rgba(124, 140, 255, 0.13);
}
[data-theme="light"] {
  --pub-bg: #F6F7FB;
  --pub-panel: #FFFFFF;
  --pub-ink: #141A2E;
  --pub-ink-2: #3E4763;
  --pub-dim: #5C6785;
  --pub-line: #DFE3F0;
  --pub-line-2: #C9D0E6;
  --pub-accent: #4C5FD5;
  --pub-accent-deep: #3A4BB8;
  --pub-accent-soft: rgba(76, 95, 213, 0.09);
}

/* ═══ 12c · UTILITIES + FIXES ════════════════════════════════════════════ */

.muted { color: var(--dim); }
.sub { color: var(--dim); font-size: 12.5px; }
.right { margin-left: auto; }
.inline { display: inline-flex; align-items: center; gap: 7px; }
.full { width: 100%; }
.accent { color: var(--accent-3); }
.hidden, .d-none { display: none !important; }

/* Flash pills (auto-toast source) — keep invisible layout footprint */
.flash { position: fixed; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Ticker bar (landing legacy carry-over) */
.fx-ticker-bar, .pub-ticker { max-width: 100vw; overflow: hidden; border-bottom: 1px solid var(--pub-line); background: var(--pub-bg); }
.fx-ticker-bar .tick-track { display: inline-flex; gap: 34px; white-space: nowrap; padding: 9px 0; animation: asp-tick 42s linear infinite; will-change: transform; }
@keyframes asp-tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .fx-ticker-bar .tick-track { animation: none; } }

/* Legacy chart + flow rows */
.fx-bar-chart { display: flex; align-items: flex-end; gap: 8px; min-height: 150px; padding-top: 8px; overflow-x: auto; }
.fx-bar-col { flex: 1 0 40px; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 40px; }
.fx-bar-val { font-family: var(--mono); font-size: 10px; color: var(--dim); }
.fx-bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--brand-400), var(--brand-500)); border-radius: 5px 5px 2px 2px; min-height: 3px; transition: filter var(--dur-fast) var(--ease); }
.fx-bar:hover { filter: brightness(1.2); }
.fx-bar-label { font-family: var(--mono); font-size: 9.5px; color: var(--dimmer); }
.capital-flow .flow-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.capital-flow .flow-row:last-child { border-bottom: 0; }
.capital-flow .flow-label { display: flex; align-items: center; gap: 9px; color: var(--ink-2); min-width: 0; }
.capital-flow .flow-label .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.capital-flow .flow-val { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.capital-flow .flow-val.up { color: var(--up); }
.capital-flow .flow-val.down { color: var(--down); }
.capital-flow .flow-val.accent { color: var(--accent-3); }
.capital-flow .flow-val.warning { color: var(--warn); }
.capital-flow .flow-val.muted { color: var(--dim); }
.capital-flow .flow-divider { height: 1px; background: var(--line); margin: 7px 0; }

/* Code blocks in app pages */
code, pre, kbd { font-family: var(--mono); font-size: 0.92em; }
pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; overflow-x: auto; line-height: 1.6; color: var(--ink-2); }
code.inline-code, .mdn-code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 11.5px; color: var(--accent-3); }

/* Legacy inline-heading strips */
h3.fx-title, .fx-card h3.title, .mdn-h3 { font-family: var(--display); font-size: 15px; font-weight: 650; color: var(--ink-strong); letter-spacing: -0.01em; margin: 0 0 8px; }

/* Impostor banner (base.html) */
.asp-imposter {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--warn-soft); border-bottom: 1px solid rgba(245, 184, 65, 0.4);
  padding: 8px 16px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; grid-column: 1 / -1;
}
.asp-imposter .who { font-size: 13px; color: var(--ink); }
.asp-imposter .who b { color: var(--warn); }

/* Legacy compat: table-wrap in panels shouldn't double-scroll the page */
.fx-card .body .table-wrap, .mdn-panel-body .mdn-table-wrap { margin: 0 -4px; padding: 0 4px; }

/* Print: hide chrome */
@media print {
  .mdn-rail, .mdn-topbar, .mdn-bnav, .pub-nav, .pub-foot, #mdnSideScrim { display: none !important; }
  .mdn-app { grid-template-columns: 1fr; }
  main.mdn-main { padding: 0; }
}
