:root {
  --void: #090a0d;
  --surface: #101216;
  --surface-raised: #15171c;
  --surface-soft: #0d0f12;
  --ink: #f4f1e9;
  --muted: #9b9b94;
  --quiet: #646660;
  --line: rgba(255, 255, 255, .14);
  --line-strong: rgba(255, 255, 255, .28);
  --acid: #d7ff3f;
  --orange: #ff6838;
  --red: #ff4f55;
  --blue: #7db4ff;
  --paper: #e6e2d8;
  --paper-ink: #17191d;
  --sidebar: 224px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--void);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--void); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--void); }
body.drawer-lock { overflow: hidden; }
body::selection { color: var(--void); background: var(--acid); }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .46; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 200; left: 14px; top: -100px; padding: 12px 16px; color: var(--void); background: var(--acid); text-decoration: none; font-weight: 800; }
.skip-link:focus { top: 14px; }

.system-label, .section-code, .panel-index, .eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.section-code { color: var(--acid); }
h1, h2, h3, p { text-wrap: pretty; }
em { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }

/* One-use login */
.auth-state { position: relative; min-height: 100vh; display: grid; place-items: center; overflow: hidden; padding: 28px; background: var(--void); }
.auth-grid { position: absolute; inset: 0; opacity: .32; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: min(12.5vw, 160px) min(12.5vw, 160px); mask-image: linear-gradient(to bottom, black, transparent 88%); }
.auth-card { position: relative; width: min(760px, 100%); min-height: 520px; display: grid; align-content: center; border: 1px solid var(--line-strong); padding: clamp(34px, 7vw, 88px); background: var(--surface); }
.auth-card::before { content: ""; position: absolute; top: -1px; left: -1px; width: 38%; height: 5px; background: var(--acid); }
.auth-index { position: absolute; right: 24px; top: 22px; color: var(--quiet); font-size: 11px; letter-spacing: .14em; }
.auth-card h1 { max-width: 600px; margin: 26px 0 22px; font-size: clamp(46px, 9vw, 96px); line-height: .82; letter-spacing: -.075em; }
.auth-card h1 em { color: var(--acid); }
.auth-card > p:not(.system-label) { max-width: 460px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.loader { display: flex; gap: 4px; margin-top: 34px; }
.loader span { width: 42px; height: 3px; background: var(--acid); transform-origin: left; animation: load-bar 1.2s infinite ease-in-out; }
.loader span:nth-child(2) { animation-delay: .12s; }
.loader span:nth-child(3) { animation-delay: .24s; }
@keyframes load-bar { 0%, 100% { opacity: .18; transform: scaleX(.15); } 46% { opacity: 1; transform: scaleX(1); } }

/* Application shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--void); }
.wordmark { min-height: 112px; display: grid; align-content: center; gap: 6px; border-bottom: 1px solid var(--line); padding: 22px 24px; text-decoration: none; }
.wordmark-main { font-size: 19px; font-weight: 800; letter-spacing: -.03em; }
.wordmark-sub { color: var(--acid); font-size: 9px; font-weight: 700; letter-spacing: .17em; }
.side-nav { display: grid; padding: 20px 0; }
.nav-link { min-height: 59px; display: grid; grid-template-columns: 36px 1fr; align-items: center; border: 0; border-left: 3px solid transparent; padding: 0 20px; color: var(--muted); background: transparent; text-align: left; }
.nav-link span { color: var(--quiet); font-size: 9px; letter-spacing: .14em; }
.nav-link strong { font-size: 13px; font-weight: 600; }
.nav-link:hover { color: var(--ink); background: var(--surface); }
.nav-link.is-active { border-left-color: var(--acid); color: var(--ink); background: var(--surface); }
.nav-link.is-active span { color: var(--acid); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 20px 24px 24px; }
.private-note { display: grid; grid-template-columns: 10px 1fr; gap: 10px; align-items: start; }
.private-note p { margin: 0; color: var(--quiet); font-size: 10px; line-height: 1.55; }
.private-note strong { color: var(--muted); font-weight: 600; }
.status-light { width: 7px; height: 7px; display: inline-block; margin-top: 3px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 3px rgba(215, 255, 63, .1); }
.text-button { border: 0; padding: 0; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; letter-spacing: .09em; text-decoration: underline; text-decoration-color: var(--quiet); text-underline-offset: 5px; text-transform: uppercase; }
.sidebar-foot .text-button { margin-top: 22px; }
.text-button:hover { color: var(--ink); text-decoration-color: var(--acid); }
.text-button-light { color: var(--ink); }

.shell-body { min-width: 0; grid-column: 2; }
.topbar { position: sticky; z-index: 40; top: 0; min-height: 72px; display: flex; align-items: stretch; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(9, 10, 13, .96); backdrop-filter: blur(12px); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; padding: 0 28px; color: var(--quiet); font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.breadcrumbs strong { color: var(--ink); }
.topbar-actions { min-width: 0; display: flex; align-items: stretch; }
.command-trigger { width: 225px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 0; border-left: 1px solid var(--line); padding: 0 18px; color: var(--muted); background: transparent; font-size: 11px; }
.command-trigger:hover { color: var(--ink); background: var(--surface); }
kbd { border: 1px solid var(--line-strong); padding: 3px 6px; color: var(--quiet); background: var(--surface); font-family: inherit; font-size: 9px; }
.bot-switcher { min-width: 226px; display: grid; align-content: center; gap: 3px; border-left: 1px solid var(--line); padding: 0 18px; }
.bot-switcher > span { color: var(--quiet); font-size: 8px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.bot-switcher select { max-width: 200px; border: 0; padding: 0 20px 0 0; color: var(--ink); background: var(--void); font-size: 12px; font-weight: 700; outline: 0; }
.service-state { min-width: 94px; display: flex; align-items: center; justify-content: center; gap: 9px; border-left: 1px solid var(--line); color: var(--acid); font-size: 8px; font-weight: 800; letter-spacing: .13em; }

.workspace { min-width: 0; padding: clamp(34px, 5vw, 76px) clamp(18px, 4vw, 60px) 88px; }
.view { max-width: 1540px; margin: 0 auto; }
.page-head, .section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: clamp(42px, 6vw, 82px); }
.page-head h1 { margin: 22px 0 0; font-size: clamp(54px, 7.1vw, 116px); font-weight: 700; line-height: .82; letter-spacing: -.075em; }
.page-head h1 em { color: var(--acid); }
.page-context { min-width: 210px; display: grid; gap: 7px; border-top: 1px solid var(--line-strong); padding-top: 14px; }
.page-context span { color: var(--quiet); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.page-context strong { font-size: 12px; font-weight: 500; }
.page-context .text-button { justify-self: start; margin-top: 10px; }
.section-head { align-items: end; margin-bottom: 34px; }
.section-head h1 { margin: 14px 0 0; font-size: clamp(50px, 6vw, 92px); line-height: .88; letter-spacing: -.065em; }
.section-head h1 em { color: var(--acid); }
.section-stat { min-width: 210px; border-top: 1px solid var(--line-strong); padding-top: 12px; }
.section-stat span { display: block; color: var(--quiet); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.section-stat strong { display: block; margin-top: 8px; font-size: 24px; font-weight: 500; }

/* Dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.kpi { min-height: 176px; display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px; background: var(--surface); }
.kpi-accent { background: var(--acid); color: var(--void); }
.kpi-payout { background: var(--paper); color: var(--paper-ink); }
.kpi-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.kpi-head small { color: var(--quiet); font-size: 8px; }
.kpi-accent .kpi-head small, .kpi-accent p { color: rgba(9, 10, 13, .65); }
.kpi strong { display: block; margin-top: auto; padding-top: 28px; font-size: clamp(32px, 3.5vw, 52px); font-weight: 600; line-height: .9; letter-spacing: -.055em; }
.kpi p { margin: 11px 0 0; color: var(--quiet); font-size: 10px; line-height: 1.35; }
.skeleton-text.is-loading { color: transparent; background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.18), rgba(255,255,255,.08)); background-size: 200% 100%; animation: skeleton-shift 1.2s infinite linear; }
@keyframes skeleton-shift { to { background-position: -200% 0; } }
.status-pending { border: 1px solid rgba(23, 25, 29, .3); padding: 4px 6px; color: var(--paper-ink) !important; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(270px, .9fr); margin-top: 26px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.data-panel { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.panel-head { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 20px 24px; }
.panel-head.compact { min-height: 78px; }
.panel-head h2 { margin: 7px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -.025em; }
.panel-index { color: var(--quiet); font-size: 8px; letter-spacing: .15em; }
.period-switch { display: flex; border: 1px solid var(--line); }
.period-switch button { min-width: 42px; min-height: 34px; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; }
.period-switch button:last-child { border-right: 0; }
.period-switch button:hover { color: var(--ink); }
.period-switch button.is-active { color: var(--void); background: var(--acid); }
.chart { position: relative; min-height: 340px; padding: 18px 14px 8px; overflow: hidden; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-loading, .chart-empty { min-height: 300px; display: grid; place-items: center; color: var(--quiet); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.chart .axis text { fill: var(--quiet); font-family: inherit; font-size: 9px; }
.chart .axis path { display: none; }
.chart .axis line { stroke: var(--line); }
.chart .grid line { stroke: var(--line); stroke-dasharray: 2 5; }
.chart .grid path { display: none; }
.chart-tooltip { position: absolute; z-index: 4; top: 14px; right: 14px; min-width: 150px; pointer-events: none; border: 1px solid var(--line-strong); padding: 10px 12px; color: var(--ink); background: var(--void); font-size: 10px; line-height: 1.45; }
.chart-tooltip strong { display: block; color: var(--acid); font-size: 16px; }
.chart-legend { min-height: 48px; display: flex; align-items: center; gap: 22px; border-top: 1px solid var(--line); padding: 0 24px; color: var(--quiet); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.chart-legend span:last-child { margin-left: auto; }
.legend-line { width: 18px; height: 2px; display: inline-block; margin-right: 7px; vertical-align: middle; background: var(--acid); }
.legend-refund { background: var(--orange); }
.info-dot { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font-family: Georgia, serif; font-style: italic; font-size: 12px; }
.traffic-figure { padding: 34px 26px 30px; }
.traffic-figure strong { display: block; font-size: clamp(48px, 5vw, 72px); line-height: .9; letter-spacing: -.065em; }
.traffic-figure > span { display: block; margin-top: 10px; color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.traffic-track { height: 5px; margin-top: 36px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.traffic-track i { width: 0; height: 100%; display: block; background: var(--blue); transition: width .45s ease; }
.traffic-scale { display: flex; justify-content: space-between; margin-top: 8px; color: var(--quiet); font-size: 8px; }
.fact-list { margin: 0; border-top: 1px solid var(--line); }
.fact-list div { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 0 26px; }
.fact-list div:last-child { border-bottom: 0; }
.fact-list dt { color: var(--muted); font-size: 10px; }
.fact-list dd { margin: 0; font-size: 14px; font-weight: 600; }
.split-section { display: grid; grid-template-columns: 1fr 1fr; margin-top: 26px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.panel-count { min-width: 32px; min-height: 32px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--acid); font-size: 10px; }
.bot-fleet { display: grid; }
.bot-row { min-height: 72px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); padding: 12px 24px; }
.bot-row:last-child { border-bottom: 0; }
.bot-row:hover, .bot-row.is-current { background: var(--surface-raised); }
.bot-row button { border: 0; padding: 0; color: var(--ink); background: transparent; text-align: left; }
.bot-row strong, .bot-row span { display: block; }
.bot-row strong { font-size: 12px; }
.bot-row small, .bot-row span { margin-top: 4px; color: var(--quiet); font-size: 9px; }
.bot-row > span { margin: 0; text-align: right; }
.bot-health { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); }
.bot-health.is-offline { background: var(--orange); }
.recent-list { display: grid; }
.recent-item { min-height: 72px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); padding: 12px 24px; }
.recent-item:last-child { border-bottom: 0; }
.recent-item strong, .recent-item span { display: block; }
.recent-item strong { font-size: 12px; }
.recent-item span { margin-top: 4px; color: var(--quiet); font-size: 9px; }
.recent-item > strong { color: var(--acid); font-size: 16px; }

/* Tables and controls */
.table-panel { border: 1px solid var(--line); background: var(--surface); }
.table-toolbar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--line); padding: 16px 20px; }
.search-field { min-width: 280px; max-width: 580px; flex: 1; display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line-strong); }
.search-field label { grid-column: 1 / -1; margin-bottom: 4px; color: var(--quiet); font-size: 8px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.search-field input { min-width: 0; min-height: 38px; border: 0; padding: 0; color: var(--ink); background: transparent; outline: 0; }
.search-field input::placeholder { color: var(--quiet); }
.search-field button { border: 0; padding: 0 8px; color: var(--acid); background: transparent; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.search-field:focus-within { border-bottom-color: var(--acid); }
.toolbar-controls { display: flex; align-items: center; gap: 14px; }
.segmented { display: flex; border: 1px solid var(--line); }
.segmented button { min-height: 36px; border: 0; border-right: 1px solid var(--line); padding: 0 11px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; }
.segmented button:last-child { border-right: 0; }
.segmented button:hover { color: var(--ink); }
.segmented button.is-active { color: var(--void); background: var(--acid); }
.sort-select { display: grid; gap: 4px; }
.sort-select span { color: var(--quiet); font-size: 7px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sort-select select { min-width: 142px; border: 0; border-bottom: 1px solid var(--line-strong); padding: 4px 18px 5px 0; color: var(--ink); background: var(--surface); font-size: 9px; outline: 0; }
.icon-text-button { min-height: 36px; border: 1px solid var(--line); padding: 0 11px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; }
.icon-text-button:hover { border-color: var(--acid); color: var(--ink); }
.toolbar-note { max-width: 340px; margin: 0; color: var(--quiet); font-size: 10px; line-height: 1.45; }
.table-state { height: 2px; overflow: hidden; }
.table-state.is-loading::after { content: ""; display: block; width: 35%; height: 100%; background: var(--acid); animation: progress 1s infinite ease-in-out; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(390%); } }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 11px; }
thead { background: var(--surface); }
th { height: 42px; border-bottom: 1px solid var(--line); padding: 0 14px; color: var(--quiet); font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
td { height: 70px; border-bottom: 1px solid var(--line); padding: 10px 14px; vertical-align: middle; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--surface-raised); }
.client-cell strong, .client-cell span { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-cell strong { color: var(--ink); font-size: 12px; }
.client-cell span { margin-top: 5px; color: var(--quiet); font-size: 9px; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { color: var(--acid); }
.status-trial, .status-partially_refunded { color: var(--blue); }
.status-expired, .status-refunded { color: var(--orange); }
.status-succeeded { color: var(--acid); }
.usage-cell { min-width: 130px; }
.usage-copy { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.mini-track { height: 2px; margin-top: 8px; background: rgba(255,255,255,.1); }
.mini-track i { height: 100%; display: block; background: var(--blue); }
.progress-0 { width: 0%; }
.progress-5 { width: 5%; }
.progress-10 { width: 10%; }
.progress-15 { width: 15%; }
.progress-20 { width: 20%; }
.progress-25 { width: 25%; }
.progress-30 { width: 30%; }
.progress-35 { width: 35%; }
.progress-40 { width: 40%; }
.progress-45 { width: 45%; }
.progress-50 { width: 50%; }
.progress-55 { width: 55%; }
.progress-60 { width: 60%; }
.progress-65 { width: 65%; }
.progress-70 { width: 70%; }
.progress-75 { width: 75%; }
.progress-80 { width: 80%; }
.progress-85 { width: 85%; }
.progress-90 { width: 90%; }
.progress-95 { width: 95%; }
.progress-100 { width: 100%; }
.row-action { min-width: 32px; min-height: 32px; border: 1px solid var(--line); color: var(--ink); background: transparent; }
.row-action:hover { border-color: var(--acid); color: var(--acid); }
.receipt-id { max-width: 150px; display: block; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.amount-positive { color: var(--acid); font-size: 13px; font-weight: 700; white-space: nowrap; }
.muted { color: var(--muted); }
.pagination { min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; color: var(--quiet); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.pagination div { display: flex; }
.pagination button { width: 38px; height: 34px; border: 1px solid var(--line); border-right: 0; color: var(--ink); background: transparent; }
.pagination button:last-child { border-right: 1px solid var(--line); }
.pagination button:hover:not(:disabled) { color: var(--void); background: var(--acid); }
.empty-state { min-height: 310px; padding: 50px 22px; text-align: center; }
.empty-state > span { color: var(--quiet); font-size: 44px; font-weight: 300; }
.empty-state h3 { margin: 18px 0 6px; font-size: 18px; }
.empty-state p { margin: 0; color: var(--quiet); font-size: 11px; }

/* Settlement economics */
.settlement-head { align-items: end; }
.settlement-lock { max-width: 360px; border-top: 4px solid var(--orange); padding: 16px 0 0; }
.settlement-lock span { color: var(--orange); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.settlement-lock p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.settlement-ledger { display: grid; grid-template-columns: 1.15fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.balance-hero { min-height: 330px; display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 32px; background: var(--paper); color: var(--paper-ink); }
.balance-hero .panel-index { color: rgba(23,25,29,.55); }
.balance-hero strong { display: block; margin-top: auto; font-size: clamp(66px, 9vw, 130px); font-weight: 600; line-height: .75; letter-spacing: -.08em; }
.balance-hero p:not(.panel-index) { max-width: 470px; margin: 28px 0 24px; color: rgba(23,25,29,.66); font-size: 12px; line-height: 1.55; }
.balance-hero .button { align-self: flex-start; }
.ledger-facts { margin: 0; border-bottom: 1px solid var(--line); }
.ledger-facts div { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 28px; }
.ledger-facts div:last-child { border-bottom: 0; }
.ledger-facts dt { color: var(--muted); font-size: 10px; }
.ledger-facts dd { margin: 0; font-size: 18px; font-weight: 600; }
.model-section { margin-top: 70px; }
.model-section > header { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 20px; margin-bottom: 24px; }
.model-section h2 { grid-column: 1; margin: 12px 0 0; font-size: clamp(30px, 4vw, 52px); letter-spacing: -.045em; }
.model-section header > p:last-child { grid-column: 2; grid-row: 1 / span 2; max-width: 310px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.model-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.model-card { min-height: 350px; display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 28px; background: var(--surface); }
.model-recommended { background: var(--acid); color: var(--void); }
.model-label { display: flex; justify-content: space-between; gap: 20px; font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.model-label small { color: var(--quiet); }
.model-card h3 { margin: 48px 0 0; font-size: clamp(28px, 3.2vw, 46px); line-height: .94; letter-spacing: -.045em; }
.model-card > strong { display: block; margin-top: auto; padding-top: 40px; font-size: clamp(36px, 5vw, 70px); line-height: .85; letter-spacing: -.06em; }
.model-card > p { max-width: 520px; margin: 18px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.model-recommended > p { color: rgba(9,10,13,.66); }
.rules-panel { display: grid; grid-template-columns: .8fr 1.2fr; gap: 50px; margin-top: 70px; border-top: 1px solid var(--line-strong); padding-top: 26px; }
.rules-panel h2 { margin: 12px 0 0; font-size: 30px; letter-spacing: -.04em; }
.rules-panel ol { margin: 0; padding: 0; list-style: none; }
.rules-panel li { min-height: 74px; display: grid; grid-template-columns: 50px 1fr; align-items: start; border-bottom: 1px solid var(--line); padding: 16px 0; }
.rules-panel li > span { color: var(--acid); font-size: 9px; font-weight: 700; }
.rules-panel li p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.rules-panel li strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 12px; }

/* Drawer and dialogs */
.drawer-backdrop { position: fixed; z-index: 80; inset: 0; background: rgba(0, 0, 0, .62); }
.drawer { position: fixed; z-index: 90; inset: 0 0 0 auto; width: min(620px, 100%); overflow-y: auto; transform: translateX(102%); border-left: 1px solid var(--line-strong); background: var(--surface); transition: transform .24s cubic-bezier(.25,.8,.25,1); }
.drawer[aria-hidden="true"] { visibility: hidden; }
.drawer.is-open { transform: translateX(0); }
.drawer-head { position: sticky; z-index: 2; top: 0; min-height: 110px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding: 20px 28px; background: rgba(16,18,22,.97); }
.drawer-head h2 { margin: 8px 0 0; font-size: 31px; letter-spacing: -.045em; }
.close-button { width: 42px; height: 42px; border: 1px solid var(--line); color: var(--ink); background: transparent; font-size: 24px; }
.close-button:hover { border-color: var(--acid); color: var(--acid); }
.drawer-content { padding: 0 28px 58px; }
.identity-strip { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); padding: 22px 0; }
.identity-strip p { margin: 6px 0 0; color: var(--quiet); font-size: 10px; }
.detail-section { border-bottom: 1px solid var(--line); padding: 28px 0; }
.detail-section h3 { margin: 0 0 18px; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.field-wide { grid-column: 1 / -1; }
.field input, .field textarea { width: 100%; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 0; padding: 10px 11px; color: var(--ink); background: var(--void); outline: 0; }
.field input:focus, .field textarea:focus { border-color: var(--acid); }
.field input[readonly] { color: var(--quiet); background: var(--surface-soft); }
.field-hint { margin: 0; color: var(--quiet); font-size: 10px; line-height: 1.5; letter-spacing: 0; text-transform: none; }
.section-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 4px; }
.access-summary { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin-bottom: 20px; }
.access-summary div { min-height: 74px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px; }
.access-summary span { color: var(--quiet); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.access-summary strong { display: block; margin-top: 8px; font-size: 13px; }
.reserve-preview { margin: 14px 0 0; border-left: 3px solid var(--blue); padding: 10px 12px; color: var(--muted); background: rgba(125,180,255,.06); font-size: 10px; line-height: 1.45; }
.danger-zone { border-bottom: 0; }
.danger-zone > p { color: var(--muted); font-size: 10px; line-height: 1.5; }
.button { min-height: 42px; border: 1px solid transparent; border-radius: 0; padding: 0 16px; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.button-primary { color: var(--void); background: var(--acid); }
.button-primary:hover { background: #e2ff72; }
.button-secondary { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.button-secondary:hover { border-color: var(--ink); }
.button-danger { color: var(--void); background: var(--orange); }
.button-danger:hover { background: #ff835d; }
.button-disabled { border-color: rgba(23,25,29,.28); color: rgba(23,25,29,.52); background: transparent; }
.confirm-dialog, .command-dialog { width: min(530px, calc(100% - 28px)); border: 1px solid var(--line-strong); border-radius: 0; padding: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgba(0,0,0,.75); }
.confirm-dialog form { border-top: 4px solid var(--orange); padding: 28px; }
.confirm-dialog h2 { margin: 12px 0 8px; font-size: 27px; letter-spacing: -.04em; }
.confirm-dialog p:not(.panel-index) { color: var(--muted); font-size: 12px; line-height: 1.5; }
.confirm-diff { margin: 20px 0; border: 1px solid var(--line); }
.confirm-diff div { display: grid; grid-template-columns: 1fr auto; gap: 20px; border-bottom: 1px solid var(--line); padding: 12px; font-size: 10px; }
.confirm-diff div:last-child { border-bottom: 0; }
.confirm-diff span { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.command-dialog form { border-top: 4px solid var(--acid); padding: 24px; }
.command-dialog label { display: block; margin-bottom: 14px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.command-dialog form > div { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line-strong); }
.command-dialog input { min-width: 0; min-height: 48px; border: 0; color: var(--ink); background: transparent; outline: 0; }
.command-dialog button { border: 0; padding: 0 14px; color: var(--void); background: var(--acid); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.command-dialog p { margin: 16px 0 0; color: var(--quiet); font-size: 9px; }
.toast-region { position: fixed; z-index: 120; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { max-width: 380px; border-left: 4px solid var(--acid); padding: 14px 16px; color: var(--ink); background: var(--surface-raised); box-shadow: 0 18px 60px rgba(0,0,0,.36); font-size: 11px; }
.toast.is-error { border-left-color: var(--orange); }

@media (max-width: 1180px) {
  :root { --sidebar: 190px; }
  .command-trigger { width: 170px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .split-section { grid-template-columns: 1fr; }
  .toolbar-controls { flex-wrap: wrap; justify-content: flex-end; }
  .table-toolbar { align-items: flex-start; }
}

@media (max-width: 820px) {
  :root { --sidebar: 0px; }
  .app-shell { display: block; }
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; flex-direction: row; align-items: stretch; border-right: 0; border-bottom: 1px solid var(--line); }
  .wordmark { min-width: 160px; min-height: 58px; border-bottom: 0; border-right: 1px solid var(--line); padding: 10px 14px; }
  .wordmark-main { font-size: 15px; }
  .wordmark-sub { font-size: 7px; }
  .side-nav { min-width: 0; display: flex; flex: 1; overflow-x: auto; padding: 0; }
  .nav-link { min-width: 54px; min-height: 58px; display: grid; grid-template-columns: 1fr; place-items: center; border-left: 0; border-bottom: 3px solid transparent; padding: 5px 10px; text-align: center; }
  .nav-link strong { font-size: 9px; }
  .nav-link span { display: none; }
  .nav-link.is-active { border-bottom-color: var(--acid); border-left-color: transparent; }
  .sidebar-foot { display: none; }
  .shell-body { grid-column: auto; }
  .topbar { top: 59px; min-height: 58px; }
  .breadcrumbs, .command-trigger, .service-state { display: none; }
  .topbar-actions { width: 100%; }
  .bot-switcher { width: 100%; border-left: 0; padding: 7px 14px; }
  .bot-switcher select { max-width: 100%; }
  .workspace { padding: 32px 14px 62px; }
  .page-head, .section-head { display: grid; gap: 26px; margin-bottom: 38px; }
  .page-head h1 { font-size: clamp(50px, 14vw, 78px); }
  .page-context, .section-stat { min-width: 0; width: 100%; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi { min-height: 150px; padding: 16px; }
  .kpi strong { font-size: clamp(28px, 9vw, 42px); }
  .panel-head { padding: 16px; }
  .chart { min-height: 300px; }
  .chart-legend { gap: 12px; padding: 0 14px; }
  .split-section { margin-top: 16px; }
  .table-toolbar { display: grid; padding: 14px; }
  .search-field { min-width: 0; max-width: none; width: 100%; }
  .toolbar-controls { justify-content: flex-start; }
  .segmented { max-width: 100%; overflow-x: auto; }
  .sort-select { flex: 1; }
  .sort-select select { min-width: 0; width: 100%; }
  th, td { padding-left: 11px; padding-right: 11px; }
  th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4), th:nth-child(6), td:nth-child(6) { display: none; }
  table { min-width: 560px; }
  .settlement-head { display: grid; }
  .settlement-ledger { grid-template-columns: 1fr; }
  .balance-hero { min-height: 300px; }
  .model-section > header { display: block; }
  .model-section header > p:last-child { margin-top: 16px; }
  .model-grid { grid-template-columns: 1fr; }
  .rules-panel { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 520px) {
  .wordmark { min-width: 116px; }
  .wordmark-sub { display: none; }
  .nav-link { padding-inline: 7px; }
  .nav-link strong { font-size: 8px; }
  .page-head h1 { font-size: 49px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi { min-height: 128px; }
  .kpi strong { padding-top: 20px; }
  #view-users table { min-width: 0; }
  #view-users thead { display: none; }
  #view-users tbody { display: grid; }
  #view-users tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; gap: 13px 10px; align-items: center; border-bottom: 1px solid var(--line); padding: 17px 12px; }
  #view-users tbody td { height: auto; border: 0; padding: 0; }
  #view-users tbody td:nth-child(1) { min-width: 0; }
  #view-users tbody td:nth-child(2) { justify-self: end; }
  #view-users tbody td:nth-child(3),
  #view-users tbody td:nth-child(4),
  #view-users tbody td:nth-child(6) { display: none; }
  #view-users tbody td:nth-child(5) { grid-column: 1 / -1; min-width: 0; }
  #view-users tbody td:nth-child(7) { grid-column: 3; grid-row: 1; }
  .panel-head { align-items: flex-start; }
  .chart-legend { min-height: 62px; flex-wrap: wrap; align-content: center; }
  .chart-legend span:last-child { width: 100%; margin-left: 0; }
  .traffic-figure { padding-inline: 18px; }
  .bot-row { grid-template-columns: 1fr auto; padding-inline: 16px; }
  .bot-row > span { display: none; }
  .recent-item { padding-inline: 16px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding-inline: 8px; }
  .icon-text-button { width: 100%; }
  .drawer-head, .drawer-content { padding-left: 18px; padding-right: 18px; }
  .form-grid, .access-summary { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .model-card { min-height: 310px; padding: 22px; }
  .balance-hero { padding: 24px; }
  .ledger-facts div { padding-inline: 18px; }
}

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