@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-latin-700-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --navy: #07182c;
  --navy-soft: #17304a;
  --ivory: #f6f2e9;
  --ivory-deep: #ece5d8;
  --gold: #b78a2e;
  --gold-soft: #eadbb9;
  --walnut: #754426;
  --white: #fffdfa;
  --ink-muted: #536071;
  --line: #d8d2c7;
  --success: #2e684d;
  --success-bg: #e7f0e9;
  --warning: #765816;
  --warning-bg: #f7eed8;
  --danger: #8a3831;
  --danger-bg: #f7e8e4;
  --shadow: none;
  --radius: 10px;
  --focus: 0 0 0 3px #f6f2e9, 0 0 0 6px #b78a2e;
}

* { box-sizing: border-box; }
html { background: var(--ivory); color: var(--navy); font-family: "Inter", sans-serif; scroll-behavior: smooth; }
body { margin: 0; background: var(--ivory); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong, b { font-weight: 700; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 3vw, 32px); line-height: 1.15; letter-spacing: -0.035em; }
h2 { margin-bottom: 8px; font-size: 20px; line-height: 1.2; letter-spacing: -0.02em; }
p { color: var(--ink-muted); }
code, .tabular, .metric-value, .number { font-family: inherit; font-variant-numeric: tabular-nums; }
[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; }
.skip-link { position: fixed; z-index: 999; top: 10px; left: 10px; padding: 10px 14px; background: var(--white); border: 2px solid var(--gold); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: none; box-shadow: var(--focus); }

.eyebrow { margin-bottom: 8px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow-light { color: #fcdb85; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--navy); }
.login-panel { width: min(420px, 100%); padding: 40px; background: var(--ivory); border-radius: 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28); }
.login-brand { display: grid; justify-items: center; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); text-align: center; }
.login-brand img { display: block; width: 200px; height: auto; }
.login-brand h1 { margin: 8px 0 0; color: var(--navy); font-size: 20px; letter-spacing: -0.025em; }
.login-form { display: grid; gap: 8px; }
.login-form label, .filter-bar label, .report-form label, .referral-card label { color: var(--navy); font-size: 12px; font-weight: 700; }
.login-form input, .filter-bar input, .filter-bar select, .report-form input, .report-form select, .heading-controls select, .copy-field input {
  width: 100%; min-height: 44px; padding: 10px 12px; color: var(--navy); background: var(--white); border: 1px solid var(--line); border-radius: 8px;
}
.login-form input { margin-bottom: 7px; }
.form-message { min-height: 21px; margin: 8px 0 0; color: var(--danger); font-size: 12px; }
.support-note { margin: 16px 0 0; font-size: 12px; text-align: center; }
.support-note a, .account-list a { text-decoration-color: var(--gold); text-underline-offset: 3px; }

.portal { min-height: 100vh; }
.portal-header { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px max(24px, calc((100% - 1120px) / 2)); color: var(--ivory); background: var(--navy); }
.portal-brand { display: flex; align-items: center; gap: 18px; text-decoration: none; }
.portal-brand img { width: 140px; height: auto; object-fit: contain; }
.portal-brand span { padding-left: 18px; border-left: 1px solid rgba(246, 242, 233, 0.35); color: var(--ivory); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.header-context { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }
.as-of { color: #d9d9d0; font-size: 12px; white-space: nowrap; }
.environment-pill { padding: 4px 8px; color: var(--ivory); border: 1px solid #b78a2e; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.text-button, .text-link { padding: 4px; background: transparent; border: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.text-button { color: var(--ivory); }
.text-link { color: var(--navy); font-weight: 700; }

.portal-shell { max-width: 1168px; margin: 0 auto; padding: 0 24px; }
.side-navigation { display: grid; grid-template-columns: 1fr auto; align-items: center; padding-top: 20px; color: var(--navy); border-bottom: 1px solid var(--line); }
.partner-block { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.partner-block .eyebrow { display: none; }
.partner-block strong { font-size: 13px; }
.partner-block code { color: var(--ink-muted); font-size: 12px; user-select: all; }
.nav-list { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 24px; margin-top: 12px; overflow-x: auto; }
.mobile-navigation { display: none; }
.mobile-navigation select { width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; font-weight: 700; color: var(--navy); background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.nav-item { min-height: 48px; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 0; color: var(--ink-muted); background: transparent; border: 0; border-bottom: 2px solid transparent; font-weight: 400; text-align: left; cursor: pointer; white-space: nowrap; }
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.nav-item:first-child svg { fill: currentColor; stroke: none; }
.nav-item:hover, .nav-item.is-active { color: var(--navy); border-bottom-color: var(--navy); }
.nav-item.is-active { font-weight: 700; }
.nav-item:active { transform: translateY(1px); }
.side-note { grid-column: 2; grid-row: 1; color: var(--ink-muted); font-size: 12px; }
.side-note strong { font-weight: 400; }
.side-note span { display: none; }

.portal-content { min-width: 0; padding: 32px 0 64px; }
.view-panel { margin: 0 auto; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.view-panel .eyebrow { display: none; }
.page-heading > div:first-child { max-width: 720px; }
.page-heading p:last-child { margin-bottom: 0; font-size: 14px; }
.heading-controls { min-width: 170px; display: grid; gap: 6px; }
.heading-controls label { color: var(--ink-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

.state-banner, .notice { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 22px; padding: 14px 16px; border-radius: 10px; }
.state-banner { color: var(--danger); background: var(--danger-bg); border: 1px solid #e7c6bf; }
.state-banner.is-warning, .notice.neutral { color: var(--warning); background: var(--warning-bg); border: 1px solid var(--gold-soft); }
.state-banner strong, .notice strong { flex: 0 0 auto; }
.notice span { color: inherit; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric-card { display: flex; flex-direction: column; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-primary { color: var(--ivory); background: var(--navy); border-color: var(--navy); }
.metric-label { color: var(--ink-muted); font-size: 12px; font-weight: 700; }
.metric-primary .metric-label, .metric-primary .metric-note { color: #ccd4dc; }
.metric-value { display: block; margin: 16px 0 10px; font-size: clamp(24px, 2.5vw, 30px); line-height: 1.1; letter-spacing: -0.04em; white-space: nowrap; }
.metric-skeleton { color: transparent; background: var(--ivory-deep); border-radius: 6px; user-select: none; }
.metric-primary .metric-skeleton { background: var(--navy-soft); }
.metric-note { color: var(--ink-muted); font-size: 11px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.65fr); align-items: start; gap: 24px; margin-bottom: 24px; }
.panel-card { min-width: 0; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.card-heading h2, .section-heading h2 { margin-bottom: 0; }
.card-heading .eyebrow, .section-heading .eyebrow { margin-bottom: 4px; }
.action-card { display: flex; flex-direction: column; align-items: flex-start; background: transparent; border: 0; box-shadow: none; }
.action-card p:not(.eyebrow) { flex: 1; }
.definition-strip { display: grid; grid-template-columns: 0.65fr 2fr; gap: 30px; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.definition-strip dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 0; }
.definition-strip dt { margin-bottom: 5px; font-weight: 700; }
.definition-strip dd { margin: 0; color: var(--ink-muted); font-size: 12px; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; cursor: pointer; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button-primary { color: var(--ivory); background: var(--navy); border-color: var(--navy); }
.button-secondary { color: var(--navy); background: transparent; border-color: var(--navy); }
.button-quiet { min-height: 36px; padding: 6px 10px; color: var(--navy); background: var(--ivory); border-color: var(--line); }

.order-list { display: grid; }
.order-list-item { display: grid; grid-template-columns: minmax(130px, 1fr) auto auto; align-items: center; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.order-list-item:first-child { border-top: 0; }
.order-list-item strong { display: block; font-size: 13px; }
.order-list-item small { color: var(--ink-muted); }

.status { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 4px 8px; border-radius: 5px; font-size: 11px; font-weight: 400; white-space: nowrap; }
.status::before { width: 6px; height: 6px; content: ""; background: currentColor; border-radius: 50%; }
.status-success { color: var(--success); background: var(--success-bg); }
.status-warning { color: var(--warning); background: var(--warning-bg); }
.status-danger { color: var(--danger); background: var(--danger-bg); }
.status-neutral { color: var(--navy-soft); background: var(--ivory); }

.filter-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 12px; margin-bottom: 16px; }
.filter-bar .search-field { grid-column: span 2; }
.filter-bar > div, .report-form > div { display: grid; gap: 6px; }
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 16px; color: var(--ink-muted); background: transparent; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 400; text-align: left; white-space: nowrap; }
td { padding: 15px 16px; border-bottom: 1px solid #e8e2d8; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong { display: block; font-size: 13px; }
td small { color: var(--ink-muted); }
th.number, td.number { text-align: right; }
.order-link { color: var(--navy); background: transparent; border: 0; font-weight: 700; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; cursor: pointer; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; color: var(--ink-muted); border-top: 1px solid var(--line); font-size: 12px; }
.pagination > div { display: flex; gap: 8px; }

.empty-state, .error-state, .loading-state { padding: 42px 24px; text-align: center; }
.empty-state h3, .error-state h3 { margin-bottom: 7px; font-size: 17px; }
.empty-state p, .error-state p { max-width: 520px; margin: 0 auto; }
.error-state h3 { color: var(--danger); }
.skeleton { height: 16px; margin: 10px auto; background: var(--ivory-deep); border-radius: 5px; }
.skeleton:nth-child(1) { width: 42%; }
.skeleton:nth-child(2) { width: 70%; }
.skeleton:nth-child(3) { width: 56%; }

.bucket-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.bucket-card { padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.bucket-card span { color: var(--ink-muted); font-size: 12px; font-weight: 700; }
.bucket-card strong { display: block; margin: 12px 0 6px; font-size: 29px; font-variant-numeric: tabular-nums; }
.bucket-card small { color: var(--ink-muted); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.formula { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 8px; margin: 22px 0; color: var(--navy); text-align: center; }
.formula span { display: grid; place-items: center; min-height: 74px; padding: 12px; background: var(--ivory); border-radius: 8px; font-size: 12px; font-weight: 700; }
.formula b { color: var(--gold); }
.fine-print { margin-bottom: 0; font-size: 12px; }
.state-inline { padding: 16px; color: var(--warning); background: var(--warning-bg); border-left: 3px solid var(--gold); }
.card-heading-padded { margin: 0; padding: 22px 24px 16px; }

.report-builder { display: grid; grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr); gap: 32px; margin-bottom: 28px; }
.traffic-panel { margin-bottom: 28px; }
.traffic-source, .traffic-scope { color: var(--ink-muted); font-size: 12px; }
.traffic-filters { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; align-items: end; gap: 12px; }
.traffic-filters > div { display: grid; gap: 6px; min-width: 0; }
.traffic-filters label, .traffic-sort label { font-size: 12px; }
.traffic-filters input, .traffic-filters select, .traffic-sort select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; color: var(--navy); background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.traffic-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; border-bottom: 1px solid var(--line); }
.traffic-metrics button { min-width: 0; padding: 0 0 16px; text-align: left; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.traffic-metrics button[aria-pressed="true"] { border-bottom-color: var(--navy); }
.traffic-metrics span { display: block; color: var(--ink-muted); font-size: 12px; }
.traffic-metrics strong { display: block; margin-top: 6px; font-size: 26px; font-variant-numeric: tabular-nums; }
.traffic-scope { margin: 16px 0 8px; }
.traffic-chart { width: 100%; }
.traffic-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.traffic-chart text { fill: var(--ink-muted); font-family: "Inter", sans-serif; font-size: 12px; }
.traffic-gridline { stroke: var(--line); stroke-width: 1; }
.traffic-line { stroke: var(--navy); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.traffic-dot { fill: var(--navy); stroke: var(--white); stroke-width: 2; }
.traffic-readout { min-height: 36px; margin: 8px 0; font-size: 12px; color: var(--navy); }
.traffic-details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.traffic-details summary { cursor: pointer; min-height: 32px; }
.traffic-sort { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 12px 0; }
.traffic-sort select { width: auto; }
.traffic-table { max-height: 320px; overflow: auto; }
.report-builder .form-message { grid-column: 1 / -1; margin: 0; }
.form-message:empty { display: none; }
.report-builder > div > p:last-child { margin-bottom: 0; }
.report-sheets { padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; }
.report-form { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 12px; }
.report-form > div:first-child { grid-column: 1 / -1; }
.timezone-field { align-content: center; min-height: 44px; padding: 8px 12px; background: var(--ivory); border-radius: 8px; }
.timezone-field span { color: var(--ink-muted); font-size: 10px; text-transform: uppercase; }
.report-form .button { align-self: end; }
.reports-list { margin-top: 10px; }
.report-record small, .report-scope small { display: block; margin-top: 3px; }
.table-note { margin: 12px 0 0; color: var(--ink-muted); font-size: 12px; }
.unavailable-label { color: var(--ink-muted); font-size: 12px; }

.referral-layout { margin-bottom: 18px; }
.referral-card label { display: block; margin-top: 22px; }
.copy-field { display: flex; gap: 8px; margin: 7px 0 12px; }
.copy-field input { min-width: 0; user-select: all; }
.copy-field .button { flex: 0 0 auto; white-space: nowrap; }
.referral-qr { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.referral-qr img { width: 112px; height: 112px; padding: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; image-rendering: pixelated; }
.account-list { margin: 18px 0; }
.account-list div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 15px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.account-list dt { color: var(--ink-muted); }
.account-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 18px; }
.help-grid p { margin: 5px 0 0; font-size: 12px; }

.order-dialog { width: min(680px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 0; color: var(--navy); background: var(--white); border: 0; border-radius: 14px; box-shadow: 0 28px 80px rgba(7, 24, 44, 0.35); overflow: auto; }
.order-dialog::backdrop { background: rgba(7, 24, 44, 0.72); }
.dialog-heading { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 20px; padding: 22px 24px; background: var(--white); border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin-bottom: 0; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.password-dialog { width: min(460px, calc(100% - 30px)); }
.password-form { display: grid; gap: 10px; padding: 24px; }
.password-form > p:first-child { margin: 0 0 6px; color: var(--muted); }
.password-form .form-message { margin: 0; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; color: var(--navy); background: var(--ivory); border: 1px solid var(--line); border-radius: 50%; font-size: 25px; line-height: 1; cursor: pointer; }
.dialog-body { padding: 24px; }
.detail-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.detail-summary div { padding: 12px; background: var(--ivory); border-radius: 8px; }
.detail-summary span, .timeline span { display: block; color: var(--ink-muted); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; }
.detail-summary strong { display: block; margin-top: 4px; font-size: 13px; }
.detail-section { padding: 20px 0; border-top: 1px solid var(--line); }
.detail-section h3 { margin-bottom: 12px; font-size: 15px; }
.detail-line { display: flex; justify-content: space-between; gap: 20px; padding: 6px 0; }
.detail-line span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.timeline strong { display: block; margin-top: 4px; font-size: 12px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: min(360px, calc(100% - 32px)); padding: 12px 16px; color: var(--ivory); background: var(--navy); border: 1px solid #fcdb85; border-radius: 8px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 160ms ease, transform 160ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

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

@media (max-width: 900px) {
  .traffic-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-header { padding-inline: 24px; }
  .as-of { display: none; }
  .overview-grid, .two-column { grid-template-columns: 1fr; }
  .report-builder { grid-template-columns: 1fr; gap: 24px; }
  .definition-strip { grid-template-columns: 1fr; gap: 14px; }
  .filter-bar { grid-template-columns: repeat(2, 1fr); }
  .search-field { grid-column: span 2; }
  .filter-bar .button { justify-self: start; }
}

@media (max-width: 680px) {
  .traffic-panel { padding: 16px; }
  .traffic-panel .card-heading { display: block; }
  .traffic-filters > div:first-child, .traffic-filters > button { grid-column: 1 / -1; }
  .traffic-filters input { font-size: 12px; padding-inline: 8px; }
  .traffic-source { display: block; margin-top: 6px; }
  .traffic-metrics { gap: 8px; }
  .traffic-metrics span { min-height: 36px; }
  .traffic-metrics strong { font-size: 22px; }
  .traffic-sort { align-items: stretch; flex-direction: column; gap: 6px; }
  .traffic-sort select { width: 100%; }
  .traffic-table { overflow: auto !important; }
  .login-view { padding: 16px; }
  .login-panel { padding: 28px 24px; border-radius: 14px; }
  .login-brand { margin-bottom: 24px; padding-bottom: 20px; }
  .login-brand img { width: 180px; }
  .portal-header { gap: 12px; padding: 12px 16px; }
  .portal-brand { gap: 10px; }
  .portal-brand span { display: none; }
  .header-context { flex-direction: column; align-items: flex-end; gap: 4px; }
  .portal-shell { padding: 0 16px; }
  .portal-content { padding: 24px 0 48px; }
  .side-navigation { padding-top: 16px; }
  .side-note { display: none; }
  .nav-list { display: none; }
  .mobile-navigation { display: block; grid-column: 1 / -1; margin: 12px 0 16px; }
  .nav-item svg { display: none; }
  .page-heading { display: grid; gap: 18px; margin-bottom: 24px; }
  .state-banner, .notice { display: grid; gap: 4px; }
  .heading-controls { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { padding: 14px; }
  .metric-value { font-size: clamp(18px, 4.8vw, 26px); }
  .metric-label { min-height: 36px; }
  .definition-strip dl { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar .search-field { grid-column: auto; }
  .filter-bar .button { width: 100%; }
  .bucket-grid { grid-template-columns: 1fr; }
  .formula { grid-template-columns: 1fr; gap: 6px; margin: 16px 0; }
  .formula span { min-height: 44px; }
  .report-form { grid-template-columns: 1fr; }
  .copy-field { display: grid; }
  .referral-qr { align-items: flex-start; flex-direction: column; }
  .account-list div { grid-template-columns: 1fr; gap: 3px; }
  .help-grid { grid-template-columns: 1fr; }
  .detail-summary, .timeline { grid-template-columns: 1fr; }

  .table-wrap { overflow: visible; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  tbody tr { padding: 16px; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  td, td.number { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 5px 0; border: 0; text-align: right; }
  td::before { content: attr(data-label); color: var(--ink-muted); font-size: 11px; font-weight: 700; text-align: left; text-transform: uppercase; }
  td > * { margin-left: auto; }
  td.report-record, td.report-scope { display: block; }
  td.report-record::before, td.report-scope::before { float: left; }
  td:last-child { padding-top: 12px; }
  td:last-child .button, td:last-child .order-link { width: 100%; min-height: 42px; border: 1px solid var(--navy); border-radius: 8px; text-decoration: none; }
  .order-list-item { grid-template-columns: 1fr auto; }
  .order-list-item .status { grid-column: 1; }
}

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