/* ============================================================
   Feda — app shell glue. Loads AFTER tokens.css + components.css.
   Only app-specific layout the design system doesn't already give;
   no new design tokens (use var(--*) only). Strict-CSP safe.
   ============================================================ */

body { padding: 0; min-height: 100vh; overflow-x: hidden; }
body.nav-open { overflow: hidden; }

.skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--gold);
  color: var(--ink-on-gold);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }
.brand-link { color: inherit; text-decoration: none; }
.public-main {
  min-height: 100vh;
  background:
    radial-gradient(50% 46% at 50% 0%, var(--gold-glow), transparent 72%),
    radial-gradient(40% 38% at 12% 100%, var(--silver-glow), transparent 70%),
    var(--bg);
}

/* ---- Auth shell (login / TOTP / activate) ------------------ */
.auth {
  width: min(100%, 480px);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60% 40% at 50% 0%, var(--gold-glow), transparent 70%),
    radial-gradient(60% 30% at 50% 100%, var(--silver-glow), transparent 70%),
    var(--bg);
  position: relative;
  overflow: hidden;
}
.auth::before, .auth::after {
  content: ""; position: absolute;
  width: 220px; height: 220px; border-radius: 50%;
  border: 1px dashed rgba(207, 167, 87, .12);
  pointer-events: none;
}
.auth::before { top: -100px; inset-inline-end: -70px; }
.auth::after { bottom: -110px; inset-inline-start: -70px;
  border-color: rgba(200, 207, 216, .08); }
.auth-body {
  flex: 1; display: flex; flex-direction: column; gap: 22px;
  padding: 48px 28px 32px; position: relative;
}
.auth-body-center { justify-content: center; text-align: center; }
.auth-body-center .brand { justify-content: center; }
.auth-card {
  padding: 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-2);
}
.auth-error-code {
  margin-top: 24px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 56px;
  line-height: 1;
}
.auth-error-message { color: var(--ink-2); }
.auth-head { display: flex; flex-direction: column; gap: 8px; }
.auth-head .brand { margin-bottom: 12px; }
.auth-head h1 { font-size: var(--t-h1); margin: 0; letter-spacing: -.01em; font-weight: 600; }
.auth-head p { margin: 0; color: var(--ink-3); font-size: var(--t-sm); line-height: 1.6; }
.auth-foot { text-align: center; color: var(--ink-3); font-size: var(--t-xs);
  padding-bottom: 16px; margin-top: auto; }
.lock-row { display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--ink-3); font-size: var(--t-xs); padding: 16px 0 4px; }
.qr-box { background: #fff; padding: 16px; border-radius: var(--r-md);
  width: max-content; margin: 4px auto; }
.qr-box img { width: 200px; height: 200px; display: block; image-rendering: pixelated; }
.code-pill { font-family: var(--font-mono); font-size: 18px; letter-spacing: 2px;
  background: var(--inset); border: 1px dashed var(--gold-soft);
  color: var(--gold); padding: 14px; border-radius: var(--r-md);
  text-align: center; word-break: break-all; }
.otp-input {
  font-family: var(--font-mono);
  font-size: 22px;
  text-align: center;
  letter-spacing: 8px;
  direction: ltr;
}

/* ---- Trader mobile shell ----------------------------------- */
.shell { max-width: 480px; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column; background: var(--bg); }
.scroll-area { flex: 1; padding: 16px 16px 96px; }
.scroll-area:focus, .content:focus, .public-main:focus { outline: none; }

.hero {
  position: relative; border-radius: var(--r-xl); padding: 20px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(207,167,87,.18), transparent 60%),
    radial-gradient(120% 80% at 0% 100%, rgba(200,207,216,.07), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--hairline); box-shadow: var(--shadow-2);
}
.hero .lbl-row { display: flex; align-items: center; justify-content: space-between;
  color: var(--ink-3); font-size: var(--t-sm); margin-bottom: 8px; }
.hero .total { display: flex; align-items: baseline; gap: 6px; color: var(--ink);
  font-family: var(--font-mono); font-size: 34px; font-variant-numeric: tabular-nums;
  letter-spacing: -.01em; line-height: 1.1; direction: ltr; }
.hero .total .u { font-size: 14px; color: var(--ink-3); margin-inline-start: 4px; }
.hero .actions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px; margin-top: 18px; }
.hero .actions a {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  height: 64px; justify-content: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--hairline);
  color: var(--ink); border-radius: var(--r-md); font-size: var(--t-xs);
  text-decoration: none;
}
.hero .actions a:hover { background: var(--surface-3); }
.hero .actions svg { width: 18px; height: 18px; }

.section-title { display: flex; align-items: center; justify-content: space-between;
  margin: 22px 4px 12px; color: var(--ink); font-size: var(--t-h3); font-weight: 600; }
.section-title a { color: var(--gold); font-size: var(--t-xs); text-decoration: none; }

.panel { background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); overflow: hidden; }
.asset-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px;
  padding: 14px 16px; align-items: center; border-top: 1px solid var(--hairline); }
.asset-row:first-child { border-top: 0; }
.asset-row .title { font-size: var(--t-body); color: var(--ink);
  display: flex; align-items: center; gap: 8px; }
.asset-row .title small { color: var(--ink-3); font-size: var(--t-xs); }
.asset-row .sub-row { display: flex; gap: 10px; font-size: var(--t-xs);
  color: var(--ink-3); margin-top: 4px; font-family: var(--font-mono); direction: ltr; }
.asset-row .sub-row .res { color: var(--warn); }
.asset-row .right { text-align: end; }
.asset-row .v { font-family: var(--font-mono); font-size: var(--t-h3);
  font-variant-numeric: tabular-nums; color: var(--ink);
  direction: ltr; display: inline-block; }
.asset-row .vu { font-size: var(--t-xs); color: var(--ink-3); font-family: var(--font-mono); }

.act { display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-top: 1px solid var(--hairline); }
.act:first-child { border-top: 0; }
.act .ic { width: 36px; height: 36px; border-radius: 50%; background: var(--inset);
  border: 1px solid var(--hairline); display: flex; align-items: center;
  justify-content: center; color: var(--ink-2); flex: 0 0 auto; }
.act .meta { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.act .meta .t1 { font-size: var(--t-sm); color: var(--ink); }
.act .meta .t2 { font-size: var(--t-xs); color: var(--ink-3);
  font-family: var(--font-mono); direction: ltr; display: inline-block; }
.act .right { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }

.trust-strip { margin-top: 16px; padding: 12px 14px;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  display: flex; align-items: center; gap: 10px; font-size: var(--t-sm);
  color: var(--ink-2); line-height: 1.5; }
.trust-strip svg { color: var(--ok); flex: 0 0 auto; }
.trust-strip b { color: var(--ink); font-weight: 600; }

/* mobile bottom nav (real links, not mock chrome) */
.tabbar { margin-top: auto; position: sticky; bottom: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border-top: 1px solid var(--hairline); background: var(--bg-elev-0); }
.tabbar a { display: flex; flex-direction: column; gap: 3px;
  align-items: center; justify-content: center; height: 64px;
  color: var(--ink-3); font-size: 10.5px; text-decoration: none; position: relative; }
.tabbar a.active { color: var(--gold); }
.tabbar a.active::before { content: ""; position: absolute; top: 0;
  height: 2px; width: 28px; background: var(--gold); border-radius: 0 0 2px 2px; }
.tabbar svg { width: 22px; height: 22px; }

/* ---- Staff desktop shell ----------------------------------- */
.desk { display: flex; min-height: 100vh; background: var(--bg); }
.staff-mobile-bar { display: none; }
.sidebar-backdrop { display: none; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.sidebar-close { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto; }
.side-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink-3);
}
.side-dot.is-active { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-glow); }
.sidebar-logout { margin-top: auto; padding-top: 12px; }
.sidebar-identity { margin-top: 4px; }
.identity-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.identity-login { color: var(--ink); font-family: var(--font-ui); font-size: var(--t-sm); }
.identity-role { color: var(--ink-2); font-family: var(--font-ui); font-size: var(--t-xs); }
.sidebar .logout { margin-top: auto; }
.content { padding: 24px; flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.kpi { background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: 16px; display: flex;
  flex-direction: column; gap: 6px; }
.kpi .lbl { font-size: var(--t-xs); color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .06em; }
.kpi .val { font-family: var(--font-mono); font-size: 22px; color: var(--ink);
  font-variant-numeric: tabular-nums; direction: ltr; letter-spacing: -.01em; }
.kpi .meta { font-size: var(--t-xs); color: var(--ink-3);
  font-family: var(--font-mono); direction: ltr; }
.kpi.gold .val { color: var(--gold); }
.kpi.silver .val { color: var(--silver); }

.reco { background:
    radial-gradient(80% 60% at 100% 0%, var(--ok-soft), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.reco .head { display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seal-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.integrity-list { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 260px; }
.integrity-list .it { display: grid; grid-template-columns: 1fr auto;
  gap: 12px; padding: 10px 12px; background: var(--inset);
  border: 1px solid var(--hairline); border-radius: var(--r-sm); align-items: center; }
.integrity-list .it .a { font-size: var(--t-sm); color: var(--ink-2); }
.integrity-list .it .b { font-family: var(--font-mono); font-size: var(--t-sm);
  color: var(--ok); direction: ltr; }
.integrity-list .it.bad .b { color: var(--danger); }

.queue { background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); overflow: hidden; }
.queue .qhead { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--hairline); }
.queue .qhead h2 { font-size: var(--t-body); font-weight: 600;
  color: var(--ink); margin: 0; }
.queue .qhead .sub { color: var(--ink-3); font-size: var(--t-xs); }

/* flash messages */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border-radius: var(--r-md); background: var(--surface-2);
  border: 1px solid var(--hairline); font-size: var(--t-sm); }
.flash.ok { border-color: rgba(79,169,135,.4); color: var(--ok); }
.flash.error { border-color: rgba(225,96,91,.4); color: var(--danger); }

.page-title { font-size: var(--t-h1); font-weight: 700; margin: 0 0 4px;
  letter-spacing: -.01em; }
.page-sub { color: var(--ink-3); font-size: var(--t-sm); margin: 0 0 20px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
form.inline { display: inline; }

/* ---- Shared page language --------------------------------- */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.page-heading { min-width: 0; }
.page-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -.02em;
}
.page-heading p:not(.eyebrow) {
  max-width: 70ch;
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: var(--t-sm);
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .08em;
}
.section-block { margin-block: 18px; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}
.section-heading h2 { margin: 0; font-size: var(--t-h3); }
.section-copy { margin: 4px 0 0; color: var(--ink-2); font-size: var(--t-sm); }
.surface-heading { margin: 0; color: var(--ink); font-size: var(--t-h3); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 700;
  white-space: nowrap;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-success { color: var(--ok); background: var(--ok-soft); border-color: rgba(79,169,135,.34); }
.status-warning { color: var(--warn); background: var(--warn-soft); border-color: rgba(217,162,74,.34); }
.status-danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(225,96,91,.34); }
.status-neutral { color: var(--ink-2); background: var(--surface-2); }
.status-icon-success { color: var(--ok); }
.status-icon-warning { color: var(--warn); }
.status-icon-danger { color: var(--danger); }

.table-region { min-width: 0; border-radius: var(--r-lg); }
.table-region:focus-visible { box-shadow: var(--focus); }
.table-wrap.is-flush { border: 0; border-radius: 0; }
.queue .table-wrap { border: 0; border-radius: 0; }
.ledger .nowrap { white-space: nowrap; }
.ledger .actions-cell { min-width: 150px; }
.empty-state {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px;
  color: var(--ink-2);
  text-align: center;
}
.empty-state h2 { margin: 0; color: var(--ink); font-size: var(--t-h3); }
.empty-state p { max-width: 44ch; margin: 0; font-size: var(--t-sm); }
.empty-mark {
  width: 42px;
  height: 42px;
  border: 1px dashed var(--hairline-strong);
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow), transparent 70%);
}

/* ---- Feedback and confirmation ---------------------------- */
.flash-mark { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 6px; border-radius: 50%; background: currentColor; }
.flash-ok, .flash-success { border-color: rgba(79,169,135,.4); color: var(--ok); }
.flash-error, .flash-danger { border-color: rgba(225,96,91,.4); color: var(--danger); }
.flash-warning, .flash-warn { border-color: rgba(217,162,74,.4); color: var(--warn); }
.flash-info, .flash-neutral { color: var(--ink-2); }
.notice-neutral { border-color: var(--hairline); color: var(--ink-2); }

.confirm-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-xl);
  background: var(--surface-2);
  box-shadow: var(--shadow-modal);
}
.confirm-dialog::backdrop { background: rgba(2, 4, 7, .76); backdrop-filter: blur(4px); }
.confirm-card { padding: 24px; }
.confirm-card h2 { margin: 14px 0 6px; font-size: var(--t-h2); }
.confirm-card p { margin: 0; color: var(--ink-2); line-height: 1.7; }
.dialog-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(217,162,74,.32);
  border-radius: 50%;
  background: var(--warn-soft);
  color: var(--warn);
  font-family: var(--font-mono);
  font-weight: 800;
}
.dialog-actions { justify-content: flex-end; }

/* ---- Reusable layout utilities ---------------------------- */
.stack-sm { --gap: 8px; }
.stack-md { --gap: 14px; }
.stack-lg { --gap: 20px; }
.mb-sm { margin-bottom: 10px; }
.mb-md { margin-bottom: 16px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.text-center { text-align: center; }
.text-xs { font-size: var(--t-xs); }
.text-sm { font-size: var(--t-sm); }
.text-secondary { color: var(--ink-2); }
.font-mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.wrap { flex-wrap: wrap; }
.align-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.max-w-sm { width: 100%; max-width: 560px; }
.max-w-md { width: 100%; max-width: 680px; }
.max-w-lg { width: 100%; max-width: 760px; }
.select-compact { width: auto; min-width: 88px; }
.input-action { width: 150px; }
.code-display { margin: 8px 0 16px; }
.secret-row { display: flex; align-items: stretch; gap: 8px; }
.secret-row .code-pill { flex: 1; margin: 0; }
.privacy-row { display: flex; align-items: center; gap: 12px; }
.privacy-copy { flex: 1; color: var(--ink-2); font-size: var(--t-sm); }
.switch-hit {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pagination { margin-top: 14px; align-items: center; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.decision-stack { display: flex; min-width: 290px; flex-direction: column; gap: 8px; }
.decision-form { display: flex; align-items: center; gap: 8px; }
.trader-balance-card, .ledger-asset-card { margin-bottom: 12px; }
.trader-name { margin: 0; color: var(--ink); font-size: var(--t-body); font-weight: 600; }
.ledger-asset-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ledger-asset-head h2 { display: inline; margin: 0; font-size: var(--t-body); }
.ledger-summary-table { margin-bottom: 14px; }
.ledger-net-row td { border-top: 1px solid var(--hairline-strong); background: var(--surface-2); }
.ledger-details { display: flex; flex-direction: column; gap: 12px; }
.deferred-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--r-md);
  background: var(--inset);
}
.deferred-details p { margin: 0; color: var(--ink-2); font-size: var(--t-sm); }
.ledger-leg { display: flex; align-items: center; gap: 8px; margin-block: 2px; }
.leg-account { display: inline-block; min-width: 120px; }

/* ---- Lightweight functional motion ----------------------- */
.content > *, .scroll-area > * {
  animation: surface-in 220ms var(--ease-out) both;
}
.content > *:nth-child(2), .scroll-area > *:nth-child(2) { animation-delay: 25ms; }
.content > *:nth-child(3), .scroll-area > *:nth-child(3) { animation-delay: 50ms; }
@keyframes surface-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) {
  .card, .kpi, .queue, .panel, .hero { transition: border-color var(--dur), transform var(--dur) var(--ease-out); }
  .card:hover, .kpi:hover, .queue:hover, .panel:hover { border-color: var(--hairline-strong); }
  .hero .actions a:hover { transform: translateY(-1px); }
}

@media (max-width: 1080px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .js .desk { padding-top: 56px; }
  .js .staff-mobile-bar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 80;
    display: flex;
    height: 56px;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--hairline);
    background: rgba(16, 20, 27, .94);
    backdrop-filter: blur(12px);
  }
  .js .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 100;
    width: min(320px, calc(100vw - 40px));
    transform: translateX(110%);
    visibility: hidden;
    box-shadow: var(--shadow-modal);
    transition: transform var(--dur) var(--ease-out), visibility 0s linear var(--dur);
  }
  .js .sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
    transition-delay: 0s;
  }
  .js .sidebar-close { display: inline-flex; }
  .js .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(2, 4, 7, .72);
  }
  .js .sidebar-backdrop[hidden] { display: none; }
  html:not(.js) .desk { display: block; }
  html:not(.js) .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    visibility: visible;
    transform: none;
    box-shadow: none;
  }
  html:not(.js) .side-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  html:not(.js) .sidebar-logout { margin-top: 12px; }
  .topbar { display: none; }
  .content { padding: 20px 16px; }
}

@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4,
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .page-header { align-items: stretch; }
  .btn-row > .btn { flex: 1 1 auto; }
  .auth-body { padding: 36px 20px 24px; }
  .table-region {
    margin-inline: -4px;
    padding-bottom: 4px;
    background: linear-gradient(to left, var(--surface-3), transparent 10px) left center / 10px 100% no-repeat;
  }
  table.ledger { min-width: 620px; }
  .secret-row { flex-direction: column; }
  .section-block.row-flex { flex-wrap: wrap; }
  .section-block.row-flex > .input { flex: 1 1 180px; }
  .decision-form { align-items: stretch; flex-direction: column; }
  .decision-form .input-action { width: 100%; }
  .deferred-details { align-items: stretch; flex-direction: column; }
}

@media (max-width: 480px) {
  .scroll-area { padding-inline: 14px; }
  .hero { padding: 18px 16px; }
  .hero .total { font-size: 29px; }
  .hero .actions { gap: 6px; }
  .tabbar a { min-width: 0; }
  .tabbar a span { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
  .privacy-row { flex-wrap: wrap; }
  .privacy-copy { flex-basis: calc(100% - 56px); }
  .privacy-row .btn { width: 100%; }
  html:not(.js) .side-nav { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .scroll-area { padding-bottom: calc(var(--s-10) * 2); }
  .hero .actions,
  .tabbar { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); height: auto; }
  .tabbar a { height: var(--s-9); }
  .row { align-items: stretch; flex-wrap: wrap; }
  .row .main,
  .row .trailing { flex: 1 1 100%; width: 100%; }
  .row .trailing { align-items: stretch; text-align: start; }
  .row .trailing .inline,
  .row .trailing .btn { width: 100%; }
}

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