:root {
  color-scheme: dark;
  --bg: #090d14;
  --rail: #0a0e15;
  --panel: #101722;
  --raised: #151f2d;
  --ink: #eef3fb;
  --muted: #8c9cb1;
  --line: #243043;
  --blue: #4285ff;
  --accent-ink: #7aa9ff;
  --blue-soft: #182d50;
  --primary: #266bf8;
  --on-primary: #fff;
  --green: #68d9b3;
  --green-soft: #13372e;
  --amber: #eebd69;
  --amber-soft: #392d1b;
  --red: #ff91a1;
  --red-soft: #3b202b;
  --shadow: 0 18px 64px #0006;
  --gutter: clamp(22px, 4vw, 56px);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

:root[data-theme=light] {
  color-scheme: light;
  --bg: #f3f6fb;
  --rail: #edf2f9;
  --panel: #fff;
  --raised: #edf2f9;
  --ink: #182338;
  --muted: #546780;
  --line: #dfe6ef;
  --blue: #286ce8;
  --accent-ink: #1f55bd;
  --blue-soft: #eaf1ff;
  --primary: #266bf8;
  --on-primary: #fff;
  --green: #17664d;
  --green-soft: #e3f4ec;
  --amber: #78511f;
  --amber-soft: #faf0da;
  --red: #a5394c;
  --red-soft: #fbe8ec;
  --shadow: 0 18px 64px #14294a24;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, summary, select { cursor: pointer; }
button { touch-action: manipulation; }
a { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .52; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.hidden { display: none !important; }
.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; }

.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: min(100%, 390px); padding: 36px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.brand-mark { display: block; flex: 0 0 auto; width: 50px; height: 50px; object-fit: contain; }
.brand-mark.small { width: 34px; height: 34px; }
.gate-brand { margin-top: 12px; color: var(--muted); font-weight: 650; }
.gate-card h1 { margin: 20px 0 10px; font-size: 25px; letter-spacing: -.045em; line-height: 1.15; }
.gate-card p { margin: 0 0 22px; color: var(--muted); }
.spinner { display: inline-block; flex: 0 0 auto; width: 19px; height: 19px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app { min-height: 100dvh; }
.topbar { display: flex; align-items: center; gap: 22px; min-height: 64px; padding: 10px var(--gutter); border-bottom: 1px solid var(--line); background: var(--rail); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 22px; letter-spacing: -.07em; }
.brand strong { font-weight: 750; }
.topbar-label { color: var(--muted); border-left: 1px solid var(--line); padding-left: 22px; font-size: 13px; }
.topbar-right { margin-left: auto; min-width: 0; text-align: right; }
.admin-identity { display: grid; min-width: 0; max-width: min(38vw, 320px); line-height: 1.25; }
.admin-identity strong, .admin-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-identity strong { font-weight: 650; font-size: 13px; }
.admin-identity span { color: var(--muted); font-size: 12px; }
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: calc(100dvh - 64px); max-width: 1450px; margin: 0 auto; }
.tabs { position: sticky; top: 0; align-self: start; display: grid; gap: 22px; padding: 32px 15px; }
.nav-group { display: grid; gap: 2px; }
.nav-caption { padding: 0 11px 7px; color: var(--muted); font-size: 12px; }
.tab { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; padding: 8px 10px; background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--muted); text-align: left; font-weight: 600; }
.tab:hover { color: var(--ink); background: var(--panel); }
.tab.active { color: var(--accent-ink); background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 16%, transparent); }
.nav-icon { width: 19px; flex: 0 0 auto; text-align: center; font-size: 19px; line-height: 1; font-weight: 400; }
.nav-title { min-width: 0; }
.nav-short { display: none; }
.tab-count { min-width: 21px; margin-left: auto; padding: 1px 4px; background: var(--raised); border: 1px solid var(--line); border-radius: 5px; color: var(--ink); text-align: center; font-size: 11px; font-variant-numeric: tabular-nums; }

.main { min-width: 0; padding: 32px var(--gutter) 48px; border-left: 1px solid var(--line); }
.workspace-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 27px; }
.workspace-heading > div { min-width: 0; }
.workspace-heading h1 { margin: 0 0 6px; font-size: clamp(25px, 3.3vw, 42px); line-height: 1.08; letter-spacing: -.045em; font-weight: 740; overflow-wrap: anywhere; }
.workspace-heading p { margin: 0; color: var(--muted); }
.refresh { flex: 0 0 auto; }
.refresh > span { font-size: 18px; line-height: 1; }
.operator-overview { margin-bottom: 26px; }
.operator-overview h2, .list-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(127px, 1fr)); gap: 8px; margin-top: 9px; }
.metric { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.metric-label { color: var(--muted); font-size: 12px; line-height: 1.35; }
.metric-value { display: block; margin-top: 6px; color: var(--ink); font-size: 25px; font-weight: 680; letter-spacing: -.055em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric.accent { background: var(--blue-soft); }
.metric.accent .metric-value { color: var(--accent-ink); }
.metric-link { display: grid; justify-items: start; align-content: space-between; gap: 6px; min-height: 96px; padding-right: 25px; color: var(--ink); text-align: left; position: relative; }
.metric-link:hover, .metric-link:focus-visible { border-color: var(--blue); }
.metric-link[data-attention=true] { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 24%, var(--line)); }
.metric-link[data-attention=true] .metric-value { color: var(--accent-ink); }
.metric-link[data-attention=true] .metric-label { color: var(--ink); }
.metric-arrow { position: absolute; right: 10px; bottom: 12px; color: var(--muted); font-size: 15px; }
.desk-status { margin-top: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.desk-status summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; }
.desk-status summary::-webkit-details-marker { display: none; }
.desk-status summary::before { content: '›'; color: var(--blue); font-size: 21px; line-height: 1; }
.desk-status[open] summary::before { transform: rotate(90deg); }
.status-short { margin-left: auto; padding-left: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.status-short[data-tone=attention] { color: var(--amber); }
#source-sync-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.summary-stats { display: flex; flex-wrap: wrap; gap: 9px 23px; margin: 0 0 13px; }
.summary-stats > div { display: flex; align-items: baseline; gap: 8px; }
.summary-stats dt { color: var(--muted); font-size: 12px; }
.summary-stats dd { margin: 0; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }

.workspace { min-width: 0; }
.list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.result-count { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 43px; max-width: 100%; padding: 9px 13px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 650; line-height: 1.3; text-align: center; text-decoration: none; }
.button:hover:enabled, a.button:hover { filter: brightness(1.1); }
.button.primary { background: var(--primary); color: var(--on-primary); }
.button.secondary { border-color: var(--line); background: var(--raised); color: var(--ink); }
.button.positive { border-color: color-mix(in srgb, var(--green) 27%, var(--line)); background: var(--green-soft); color: var(--green); }
.button.danger { border-color: color-mix(in srgb, var(--red) 23%, var(--line)); background: var(--red-soft); color: var(--red); }
.button.ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.button.small { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.button:disabled { filter: none; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
input:not([type=checkbox]), select, textarea { min-height: 43px; max-width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.filters { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.search { display: flex; align-items: center; flex: 1 1 265px; gap: 9px; min-width: 0; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.search:focus-within { border-color: var(--blue); }
.search > span { color: var(--muted); font-size: 24px; line-height: 1; }
.search input { width: 100%; min-width: 0; padding: 9px 0; border: 0; background: transparent; outline: 0; }
.select-wrap { display: flex; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.filters select { width: 100%; }
.add-admin { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 11px; margin: 0 0 19px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.add-admin > div { align-self: center; flex: 1 1 250px; }
.add-admin p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.add-admin label { min-width: 0; }
.error-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--red) 24%, var(--line)); border-left: 3px solid var(--red); border-radius: 7px; background: var(--red-soft); color: var(--red); }
.error-banner > span { overflow-wrap: anywhere; }
.error-banner > button { flex: 0 0 auto; }
.list { display: grid; gap: 8px; }
.person-card, .order-card { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.person-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.person-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-info { min-width: 0; }
.person-name { font-size: 15px; font-weight: 660; overflow-wrap: anywhere; }
.username { margin-left: 7px; color: var(--muted); font-size: 12px; font-weight: 450; }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 7px; background: var(--raised); color: var(--ink); font-size: 13px; font-weight: 650; }
.person-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; margin: 5px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.card-right { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.card-right .button.positive { background: var(--primary); color: var(--on-primary); }
.pill { display: inline-flex; align-items: center; width: fit-content; min-width: 0; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--raised); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pill.good { color: var(--green); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 20%, var(--line)); }
.pill.wait { color: var(--amber); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 20%, var(--line)); }
.pill.bad { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 20%, var(--line)); }
.pill.blue { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 20%, var(--line)); }
.copy-button { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; padding: 2px 0; border: 0; background: transparent; color: var(--muted); text-align: left; overflow-wrap: anywhere; }
.copy-button:hover { color: var(--blue); }
.copy-icon { flex: 0 0 auto; font-size: 13px; }
.copy-value { min-width: 0; font-variant-numeric: tabular-nums; }
.order-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 13px; }
.order-card > div { min-width: 0; }
.order-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 11px; margin-bottom: 4px; }
.order-amount { font-size: 24px; font-weight: 670; line-height: 1.2; letter-spacing: -.045em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.order-bank, .order-side { color: var(--muted); font-size: 12px; }
.order-person { font-weight: 620; overflow-wrap: anywhere; }
.order-ids { display: flex; flex-wrap: wrap; gap: 4px 13px; margin-top: 7px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.order-states { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.order-side { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; gap: 8px; }
.order-date { text-align: right; font-variant-numeric: tabular-nums; }
.empty { display: grid; justify-items: start; align-content: center; gap: 5px; min-height: 122px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.empty-icon { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 3px; border-radius: 5px; background: var(--blue-soft); color: var(--blue); font-size: 16px; }
.empty strong { font-size: 15px; }
.empty p { margin: 0; color: var(--muted); font-size: 13px; }
.empty .button { margin-top: 7px; }
.loading { display: flex; align-items: center; gap: 10px; padding: 25px 14px; color: var(--muted); }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 13px; color: var(--muted); font-size: 12px; }

.order-dialog { position: fixed; inset: 0; margin: auto; padding: 0; width: min(700px, calc(100% - 36px)); max-height: calc(100dvh - 36px); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.order-dialog::backdrop { background: #070b14c0; }
.dialog-header { position: sticky; z-index: 1; top: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 23px; border-bottom: 1px solid var(--line); background: var(--panel); }
.dialog-header h2 { margin: 3px 0 0; font-size: 23px; line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 640; letter-spacing: .035em; }
.close-button { flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 7px; background: var(--raised); color: var(--ink); font-size: 24px; line-height: 1; }
.dialog-body { padding: 20px 23px; }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: 20px; }
.detail-label { margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.detail-value { overflow-wrap: anywhere; font-size: 14px; }
.detail-value.amount { font-size: 25px; font-weight: 680; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.detail-wide { grid-column: 1/-1; }
.section-block { padding-top: 16px; border-top: 1px solid var(--line); min-width: 0; }
.section-block + .section-block { margin-top: 20px; }
.section-block h3 { margin: 0 0 7px; font-size: 16px; line-height: 1.3; letter-spacing: -.015em; }
.section-block > p { margin: 0 0 13px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.section-block > .actions, .section-block .order-states { margin: 0 0 13px; }
.detail-form, .detail-form label { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.detail-form { gap: 11px; }
.detail-form label, .secret-value { color: var(--muted); font-size: 13px; }
.detail-form :is(input:not([type=checkbox]), textarea), .secret-value textarea { width: 100%; min-width: 0; background: var(--bg); }
.detail-form textarea { resize: vertical; min-height: 72px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-error { margin: 0; color: var(--red); font-size: 12px; }
.recorded-note { padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--raised); overflow-wrap: anywhere; }
.recorded-note p { margin: 0; }
.recorded-note small { color: var(--muted); font-size: 12px; }
.toast { position: fixed; z-index: 30; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 30px); padding: 11px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--ink); box-shadow: var(--shadow); font-size: 13px; overflow-wrap: anywhere; }
.noscript { position: fixed; inset: auto 15px 15px; padding: 14px; background: var(--red-soft); color: var(--red); }

.trader-name-button { display: block; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; }
.trader-name-button:hover, .trader-avatar-button:hover { color: var(--blue); }
.trader-profile { min-width: 0; margin-bottom: 16px; padding: 19px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.trader-profile-header { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 18px; margin-bottom: 15px; }
.trader-identity { min-width: 0; }
.trader-identity h3, .partner-profile > h3 { margin: 4px 0 0; font-size: 24px; line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; }
.trader-metrics, .trader-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.trader-money { margin-top: 8px; }
.trader-stat { background: var(--bg); }
.trader-stat .metric-value { font-size: 22px; }
.stat-note, .trader-profile-note { margin: 6px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.trader-conflict-note, .api-group-delivery-note { margin: 12px 0 0; padding: 9px 11px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: var(--amber); font-size: 13px; overflow-wrap: anywhere; }
.trader-filters { margin-bottom: 12px; }
.trader-limits { padding: 13px; margin: 14px 0; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
.trader-limits h4, .trader-telegram-group h4 { margin: 0 0 8px; font-size: 14px; }
.trader-limit-current { margin: 0 0 6px; font-weight: 650; }
.trader-limit-usage { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12px; }
.trader-limit-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 9px; margin-top: 12px; }
.trader-limit-form label { display: flex; flex: 1 1 170px; flex-direction: column; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; }
.trader-limit-form input, .trader-limit-form select { width: 100%; }
.trader-limit-form .form-error { flex-basis: 100%; }
.trader-limit-form input[aria-invalid=true] { border-color: var(--red); }
.trader-withdrawal-actions { margin-top: 12px; }
.withdrawal-wallet, .withdrawal-rejection { padding-top: 13px; margin-top: 14px; border-top: 1px solid var(--line); }
.withdrawal-allocations { display: grid; gap: 7px; }
.withdrawal-allocation { padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
.withdrawal-allocation > .button { margin-top: 6px; }

.partner-profile > h3 { margin: 13px 0 5px; }
.partner-profile > .actions, .partner-profile .trader-money { margin: 11px 0 15px; }
.partner-profile > .section-block { margin-top: 17px; }
.partner-order-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.partner-order-row > .person-meta { flex: 1 1 140px; }
.partner-profile .detail-form { max-width: 540px; }
.partner-payout-section, .api-partner-group { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.partner-payout-section .detail-form, .api-group-info { margin-top: 10px; }
.partner-payment-record { padding: 9px 0; border-bottom: 1px solid var(--line); }
.partner-payment-record:last-child { border-bottom: 0; }
.partner-payment-record .copy-button { margin-right: 12px; }
.payment-reference summary { min-height: 35px; padding: 7px 0; color: var(--blue); }
.api-group-info { display: grid; justify-items: start; gap: 5px; overflow-wrap: anywhere; }
.api-group-steps { margin: 10px 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.api-group-steps li + li { margin-top: 4px; }
.api-group-form, .api-group-commands { margin-top: 12px; }
.api-group-commands code { color: var(--ink); }
.webhook-enabled { flex-direction: row !important; align-items: center; }
.webhook-enabled input { width: 17px; height: 17px; }
.secret-value { display: grid; gap: 6px; margin: 13px 0; }
.secret-value textarea { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }

@media (max-width: 920px) {
  .shell { grid-template-columns: 178px minmax(0, 1fr); }
  .tab { gap: 6px; padding-inline: 7px; font-size: 13px; }
  .tabs { padding-inline: 9px; }
  .metrics { grid-template-columns: repeat(auto-fit, minmax(119px, 1fr)); }
}

@media (max-width: 680px) {
  :root { --gutter: 14px; }
  .topbar { min-height: 54px; gap: 10px; }
  .topbar-label { display: none; }
  .brand { gap: 8px; font-size: 21px; }
  .brand-mark.small { width: 30px; height: 30px; }
  .admin-identity { max-width: 42vw; }
  .admin-identity strong, .admin-identity span { font-size: 11px; }
  .shell { display: block; }
  .main { padding: 19px var(--gutter) calc(84px + env(safe-area-inset-bottom)); border-left: 0; }
  .tabs { position: fixed; z-index: 10; inset: auto 0 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--rail); }
  .nav-group { display: contents; }
  .nav-caption, .nav-long { display: none; }
  .nav-short { display: inline; }
  .tab { flex-direction: column; justify-content: center; gap: 3px; min-height: 47px; padding: 4px 1px; font-size: 10px; text-align: center; line-height: 1.15; }
  .nav-icon { width: auto; font-size: 18px; }
  .tab-count { position: absolute; top: 1px; right: 2px; min-width: 15px; padding: 1px 3px; font-size: 9px; }
  .workspace-heading { gap: 9px; margin-bottom: 18px; }
  .workspace-heading p { font-size: 13px; }
  .refresh { min-height: 40px; padding-inline: 8px; font-size: 12px; }
  .operator-overview { margin-bottom: 17px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .metric-link { min-height: 67px; padding: 7px 20px 7px 10px; gap: 0; }
  .metric-link .metric-value { margin-top: 2px; font-size: 22px; }
  .metric-arrow { right: 6px; bottom: 6px; }
  .filters { gap: 6px; margin-bottom: 13px; }
  .search { flex-basis: 100%; }
  .select-wrap { flex: 1 1 130px; }
  .filters > .button { flex: 1 1 65px; }
  .filters:is([data-mode=pending], [data-mode=admins]) .search { flex-basis: 140px; }
  .filters:is([data-mode=pending], [data-mode=admins]) > .button { flex: 0 0 auto; }
  .add-admin label { flex: 1 1 130px; }
  .add-admin input { width: 100%; }
  .person-card, .order-card { padding: 12px; gap: 9px; }
  .person-card { flex-direction: column; align-items: stretch; }
  .card-right { justify-content: flex-start; }
  .card-right .actions { margin-left: auto; }
  .order-card { grid-template-columns: 1fr; }
  .order-side { flex-direction: row; align-items: center; }
  .order-date { text-align: left; }
  .button.small { min-height: 40px; }
  .order-dialog { inset: 0; margin: 0; width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .dialog-header { padding: 13px var(--gutter); }
  .dialog-body { padding: 15px var(--gutter) calc(22px + env(safe-area-inset-bottom)); }
  .details-grid { gap: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .trader-profile, .api-partner-group, .partner-payout-section { padding: 12px; }
  .trader-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trader-money { grid-template-columns: 1fr; }
  .trader-stat .metric-value { font-size: 20px; }
  .trader-limit-form label { flex-basis: 100%; }
  .trader-limit-form > .button, .partner-payout-section .button { width: 100%; }
  .toast { bottom: calc(69px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
