:root {
  color-scheme: light;
  --paper: #f5f7f4;
  --surface: #fff;
  --ink: #192822;
  --muted: #596960;
  --line: #dfe6df;
  --accent: #146349;
  --accent-hover: #0d4d39;
  --accent-soft: #e7f2ea;
  --rail: #14342a;
  --bad: #a12729;
  --bad-soft: #fdf1ef;
  --warn: #754f13;
  --warn-soft: #fcf5e3;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; color: var(--ink); background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, summary:focus-visible, .table-scroll:focus-visible { outline: 3px solid #5bab87; outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols, .sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip:focus { position: fixed; z-index: 10; left: 10px; top: 10px; padding: 9px 12px; color: var(--ink); background: var(--surface); }
h1, h2, h3, p { margin: 0; }
p { line-height: 1.6; }
h1 { font-size: clamp(1.75rem, 4vw, 2.45rem); letter-spacing: -.045em; line-height: 1.2; }
h2 { font-size: 1.09rem; line-height: 1.35; }
h3 { font-size: .95rem; }
.muted { color: var(--muted); }
.eyebrow { display: inline-block; color: var(--accent); font-weight: 750; font-size: .73rem; letter-spacing: .15em; margin-bottom: 8px; }
.eyebrow.light { color: #c0decb; }

.boot { display: grid; min-height: 100vh; place-items: center; color: var(--muted); }
.auth { display: grid; min-height: 100svh; place-items: center; padding: 28px 18px; }
.auth-shell { width: min(900px, 100%); display: grid; grid-template-columns: 1.05fr 1fr; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: var(--surface); box-shadow: 0 24px 75px #172d2014; }
.auth-cover { min-height: 500px; position: relative; overflow: hidden; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; color: #f4faf5; background: radial-gradient(ellipse at 105% 82%, #2b644d 0%, #193e30 53%, #102b23 100%); }
.auth-cover::before { content: ""; position: absolute; z-index: -1; inset: 0; opacity: .2; background-image: linear-gradient(to right, #abc7ac50 1px, transparent 1px), linear-gradient(to bottom, #abc7ac50 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(135deg, transparent 25%, #000); }
.auth-copy { margin: 65px 0 70px; max-width: 330px; }
.auth-copy h1 { font-size: clamp(2.2rem, 5.7vw, 4.2rem); line-height: 1.11; letter-spacing: -.07em; margin-bottom: 16px; }
.auth-copy p { color: #d9e9df; font-size: .94rem; }
.auth-decoration { position: absolute; z-index: -1; right: 25px; bottom: 0; display: flex; align-items: end; gap: 10px; opacity: .32; }
.auth-decoration span { width: 19px; height: 56px; border-radius: 6px 6px 0 0; background: #8cb89a; }
.auth-decoration span:nth-child(2) { height: 85px; }
.auth-decoration span:nth-child(3) { height: 74px; }
.auth-decoration span:nth-child(4) { height: 116px; }
.auth-content { align-self: center; padding: clamp(26px, 6vw, 60px); }
.auth-content h2 { font-size: 1.85rem; letter-spacing: -.04em; margin-bottom: 8px; }
.auth-content > p { font-size: .9rem; }
.login-methods { display: flex; gap: 8px; margin-top: 15px; }
.login-methods [aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-hover); }
.login-form { display: grid; gap: 9px; margin-top: 30px; }
.login-fields { display: grid; gap: 9px; min-width: 0; margin: 0; padding: 0; border: 0; }
.login-form label:not(:first-child) { margin-top: 9px; }
.login-form button { justify-content: space-between; margin-top: 9px; }

.brand { display: flex; align-items: center; gap: 11px; font-size: 1.25rem; font-weight: 760; letter-spacing: -.045em; }
.brand-action { padding: 0; border: 0; border-radius: 9px; color: inherit; background: transparent; text-align: left; }
.brand-action:not(:disabled):hover { background: #83a18e26; }
.brand-action:disabled { opacity: 1; }
.brand small { font-size: .7rem; letter-spacing: .03em; color: #b7cbbd; font-weight: 500; }
.brand-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #daebdd; color: #1b6449; }
.brand-icon svg { width: 22px; height: 22px; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 214px minmax(0, 1fr); }
.rail { position: sticky; top: 0; height: 100vh; padding: 27px 16px 18px; background: var(--rail); color: #f1f6f2; display: flex; flex-direction: column; }
.rail > .brand { padding-inline: 9px; margin-bottom: 43px; }
.rail-caption { font-size: .7rem; letter-spacing: .12em; color: #c2d4c7; padding: 0 11px 10px; }
.navigation { display: flex; flex-direction: column; gap: 4px; }
.navigation button { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 45px; padding: 9px 12px; text-align: left; background: transparent; color: #dbe8df; border: 1px solid transparent; border-radius: 9px; font-weight: 650; font-size: .89rem; }
.navigation button:hover { background: #23493b; }
.navigation button[aria-current="page"] { color: #f0f9f2; background: #2a5543; border-color: #3b6956; }
.rail-footer { margin-top: auto; padding: 12px 11px; display: flex; align-items: center; gap: 8px; font-size: .74rem; color: #c2d4c7; }
.rail-dot { width: 7px; height: 7px; border-radius: 50%; background: #91d1a9; }
.main { min-width: 0; }
.topbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; min-height: 62px; padding: 8px clamp(16px, 4vw, 46px); border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-context { color: var(--muted); font-size: .84rem; font-weight: 600; }
.mobile-brand { display: none; }
.account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-name { max-width: min(32vw, 220px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 680; font-size: .85rem; }
.logout { gap: 5px !important; }
.logout svg { width: 16px; height: 16px; }
.content { padding: 31px clamp(16px, 4vw, 46px) 26px; max-width: 1450px; margin-inline: auto; }
.content-footer { padding: 26px 0 8px; color: var(--muted); font-size: .72rem; }
.content-footer span { margin: 0 5px; }
.page-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 21px; }
.page-heading p { margin-top: 6px; color: var(--muted); font-size: .88rem; }
.page-heading h1:focus { outline: none; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 13px; border: 1px solid transparent; border-radius: 9px; white-space: nowrap; font-size: .86rem; font-weight: 680; }
.button.primary { color: #fff; background: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); }
.button.quiet { border-color: var(--line); color: var(--ink); background: var(--surface); }
.button.quiet:hover:not(:disabled) { background: var(--paper); }
.button.destructive { border-color: #edceca; color: var(--bad); background: var(--surface); }
.button.destructive:hover:not(:disabled) { background: var(--bad-soft); }
.button svg { width: 17px; height: 17px; }
label { font-weight: 680; font-size: .86rem; }
input, textarea, select { width: 100%; min-height: 45px; border: 1px solid #cdd9cf; background: #fff; color: var(--ink); border-radius: 9px; padding: 9px 11px; line-height: 1.45; }
textarea { display: block; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #68776e; }
select { cursor: pointer; }
.message { padding: 10px 13px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-hover); border: 1px solid #c9e3d1; line-height: 1.5; font-size: .85rem; overflow-wrap: anywhere; }
.message.error { background: var(--bad-soft); color: var(--bad); border-color: #edceca; }
#global-message { margin-bottom: 15px; }
.demo-notice { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 9px; border: 1px solid #ebdcb3; color: var(--warn); background: var(--warn-soft); margin-bottom: 16px; padding: 8px 12px; font-size: .81rem; border-radius: 9px; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { display: flex; flex-direction: column; gap: 7px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.metric span { color: var(--muted); font-size: .82rem; }
.metric strong { font-variant-numeric: tabular-nums; font-size: clamp(1.05rem, 3vw, 1.58rem); overflow-wrap: anywhere; letter-spacing: -.035em; }
.metric small { font-size: .73rem; color: var(--muted); }
.metric.emphasis { background: var(--accent-soft); border-color: #cce2d0; }

.panel { background: var(--surface); padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: .81rem; }
.panel-heading button { flex: none; }
.collection { display: grid; gap: 12px; }
.draw-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr)); }
.intake-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; }
.form-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 13px; font-size: .81rem; }
.activation-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--surface); }
.activation-dialog::backdrop { background: #14282270; }
.activation-times { display: grid; gap: 9px; margin: 0 0 18px; padding: 12px; border-radius: 9px; background: var(--paper); font-size: .86rem; }
.activation-times > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; }
.activation-times dt { color: var(--muted); }
.activation-times dd { margin: 0; font-weight: 680; font-variant-numeric: tabular-nums; }
#activation-form { display: grid; gap: 8px; }
#activation-form p { font-size: .82rem; }
#activation-form button { justify-self: start; }
#activation-message { margin-top: 10px; }
.order-fields { display: grid; gap: 12px; }
.order-field + .order-field { border-top: 1px solid var(--line); padding-top: 4px; }
.order-field-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.order-field-actions { display: flex; gap: 4px; }
.order-field-actions button { min-width: 44px; min-height: 44px; padding: 0 7px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .81rem; font-weight: 680; }
.order-field-actions button:hover:not(:disabled) { background: var(--paper); color: var(--ink); }
.order-field textarea { font-size: max(16px, 1rem); }
.intake-keyboard-open #intake { padding-bottom: var(--order-keyboard-inset); }
.intake-keyboard-open .order-field textarea { max-height: max(48px, calc(var(--order-viewport-height) - 24px)); }
.intake-tools { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: .81rem; }
.risk-table { min-width: 0; }
.risk-table summary { padding: 11px 2px; cursor: pointer; font-size: .84rem; font-weight: 680; }
.intake-actions .button { width: 100%; }
#intake-message { margin-top: 10px; }
.preview-status { font-size: .81rem; }
.preview-status:not(:empty) { margin-bottom: 9px; }
.tag { display: inline-flex; padding: 5px 9px; max-width: 100%; border-radius: 7px; background: #edf1ed; color: #44584b; font-size: .73rem; white-space: normal; overflow-wrap: anywhere; }
.tag.success { background: var(--accent-soft); color: var(--accent-hover); }
.tag.danger { color: var(--bad); background: var(--bad-soft); }
.tag.warning { color: var(--warn); background: var(--warn-soft); }
.empty { border: 1px dashed #ced9cf; border-radius: 12px; padding: 24px 16px; background: #f8faf7; color: var(--muted); text-align: center; font-size: .86rem; line-height: 1.55; grid-column: 1 / -1; }
.empty strong { display: block; font-weight: 680; color: var(--ink); margin-bottom: 5px; }

.record-list { display: grid; gap: 9px; }
.record { border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.record[open] { border-color: #bdcec2; }
.record summary { padding: 11px 12px; cursor: pointer; list-style: none; min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 9px; flex-wrap: wrap; }
.record summary::-webkit-details-marker { display: none; }
.record summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); flex: none; margin-right: 2px; }
.record[open] summary::before { transform: rotate(45deg) translateY(-2px); }
.record-title { flex: 1; font-size: .9rem; font-weight: 680; overflow-wrap: anywhere; }
.record-body { padding: 0 12px 12px; display: grid; gap: 10px; }
.raw-text { border: 1px solid var(--line); margin: 0; padding: 9px 10px; color: #34463b; border-radius: 8px; background: var(--paper); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .79rem; line-height: 1.55; font-family: inherit; max-height: 190px; overflow: auto; }
.order-card > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 10px; align-items: start; gap: 7px 9px; }
.order-card > summary::before { grid-column: 3; grid-row: 1; justify-self: center; margin: 7px 0 0; }
.order-card-excerpt { grid-column: 1; grid-row: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; font-weight: 680; line-height: 1.45; }
.order-card-outcome { grid-column: 2; grid-row: 1; display: grid; justify-items: end; gap: 3px; text-align: right; }
.order-card-wins { color: var(--muted); font-size: .73rem; }
.order-card-amounts { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.order-card-amount { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 7px; color: var(--muted); font-size: .78rem; }
.order-card-amount strong { max-width: 100%; color: var(--ink); font-size: .86rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.order-card-time { color: var(--muted); font-size: .76rem; }
.order-card-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.order-card-tools .button { margin-left: auto; }
.order-card-tools .message { flex: 0 0 100%; }
.record .raw-text:focus-visible { outline: 3px solid #5bab87; outline-offset: 2px; }
.line-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.order-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 8px; padding: 7px 8px; background: #f4f7f3; border-radius: 6px; font-size: .83rem; }
.order-line strong, .order-line .line-meta { min-width: 0; overflow-wrap: anywhere; }
.line-meta, .line-settlement { grid-column: 1 / -1; color: var(--muted); font-size: .76rem; }
.line-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; }
.line-meta .tag { padding: 2px 6px; }
.line-settlement { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 7px 0 0; }
.line-settlement dd, .settlement-totals dd { margin: 3px 0 0; font-weight: 680; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.line-amount { font-variant-numeric: tabular-nums; font-weight: 700; }
.amount-negative { color: var(--bad); }
.amount-positive { color: var(--accent); }
.orders-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 9px; }
.orders-tools .button { margin-left: auto; }
.orders-link { display: inline-flex; align-items: center; min-height: 40px; color: var(--accent); font-size: .84rem; font-weight: 680; }
.orders-action-message { margin-bottom: 10px; }
.order-history { margin-top: 16px; }
.settlement-revision { min-width: 0; padding: 9px; border-radius: 7px; background: var(--paper); }
.settlement-meta { margin-top: 4px; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.settlement-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 105px), 1fr)); gap: 7px; margin: 8px 0 0; font-size: .8rem; }
.settlement-totals dt { color: var(--muted); }

.risk-toolbar { display: flex; flex-wrap: wrap; gap: 9px 14px; margin: 0 0 13px; }
.risk-toolbar label { display: grid; gap: 5px; flex: 1 1 165px; }
.risk-toolbar select { min-height: 41px; font-size: .83rem; }
.risk-exposure { display: grid; gap: 10px; }
.risk-key { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: .79rem; }
.risk-peak-key { display: inline-flex; align-items: center; gap: 5px; color: var(--bad); }
.risk-peak-key::before, .risk-number.risk-peak::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--bad); }
.risk-matrix { display: grid; grid-template-columns: repeat(var(--risk-columns), minmax(0, 1fr)); gap: 4px; align-self: start; }
.risk-number { position: relative; min-height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--paper); font-size: .86rem; font-weight: 680; font-variant-numeric: tabular-nums; }
.risk-number:hover { border-color: var(--accent); }
.risk-number.risk-peak { border-color: #e0ada9; color: var(--bad); background: var(--bad-soft); }
.risk-number.risk-peak::after { position: absolute; top: 4px; right: 4px; }
.risk-number[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.risk-detail { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.risk-detail-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.risk-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 9px 0 0; }
.risk-values dt { color: var(--muted); font-size: .76rem; }
.risk-values dd { margin: 4px 0 0; font-size: .98rem; font-weight: 740; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { text-align: right; padding: 8px 10px; white-space: nowrap; border-bottom: 1px solid #e9eee9; }
.data-table thead th { color: var(--muted); background: #f3f6f2; font-weight: 680; font-size: .77rem; white-space: normal; }
.data-table th:first-child { text-align: left; white-space: nowrap; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.number-chip { display: inline-grid; place-items: center; font-weight: 730; min-width: 29px; height: 29px; padding: 0 4px; background: var(--wave-soft, #eaf1e9); color: var(--wave-ink, #285440); border-radius: 50%; }
.number-chip.wave-red { --wave-soft: #fce6e8; --wave-ink: #a2252e; }
.number-chip.wave-blue { --wave-soft: #e5eefb; --wave-ink: #24569a; }
.number-chip.wave-green { --wave-soft: #def2e5; --wave-ink: #166141; }
.number-chip.special { background: var(--wave-ink, var(--accent)); color: #fff; }
.risk-peak .number-chip { color: var(--bad); background: var(--bad-soft); }
.number-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.number-label { color: var(--muted); font-size: .72rem; margin-left: 3px; }
.draw-card p { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.draw-card .draw-next { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--accent); }
.draw-card .panel-heading { margin-bottom: 0; }
.rate-picker { display: grid; gap: 6px; max-width: 360px; }
.rate-sync { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 44px; margin-top: 5px; cursor: pointer; }
.rate-sync input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
.rates-note { margin-top: 8px; font-size: .82rem; }
.rate-category { margin-top: 9px; border: 1px solid var(--line); border-radius: 9px; }
.rate-category-title { padding: 10px; font-size: .87rem; }
summary.rate-category-title { cursor: pointer; }
.rate-current { display: block; color: var(--muted); font-size: .79rem; line-height: 1.5; margin-top: 4px; overflow-wrap: anywhere; }
.rate-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 9px; padding: 0 10px 10px; }
.rate-field { display: grid; align-content: start; gap: 5px; }
.rate-form .button, .rate-form .message { grid-column: 1 / -1; }
.rate-form .button { justify-self: start; }

@media (min-width: 1060px) {
  .risk-exposure { grid-template-columns: 1.6fr 1fr; }
  .risk-key, .risk-table { grid-column: 1 / -1; }
  .risk-detail { align-self: start; padding: 13px; }
}
@media (max-width: 930px) {
  .workspace { grid-template-columns: 168px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .intake-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .auth-shell { grid-template-columns: 1fr; }
  .activation-dialog { margin: 16px auto auto; padding: 16px; }
  .auth-cover { min-height: 0; padding: 21px 23px; }
  .auth-copy { margin: 24px 0 2px; }
  .auth-copy h1 { font-size: 2.15rem; }
  .auth-copy h1 br { display: none; }
  .auth-copy p { font-size: .82rem; }
  .auth-decoration { opacity: .2; }
  .workspace { display: flex; flex-direction: column; min-height: 100dvh; }
  .main { display: flex; flex-direction: column; flex: 1; }
  .rail { position: static; height: auto; padding: 0; }
  .rail > .brand, .rail-caption, .rail-footer { display: none; }
  .navigation { position: fixed; z-index: 3; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 4px 6px calc(5px + env(safe-area-inset-bottom)); }
  .intake-keyboard-open .navigation { display: none; }
  .navigation button { flex-direction: column; gap: 3px; align-items: center; justify-content: center; min-height: 48px; padding: 4px 0; color: var(--muted); font-size: .69rem; }
  .navigation button:hover { background: var(--paper); }
  .navigation button[aria-current="page"] { background: var(--accent-soft); color: var(--accent-hover); border-color: transparent; }
  .navigation svg { width: 19px; height: 19px; }
  .topbar { min-height: 57px; }
  .topbar-context { display: none; }
  .mobile-brand { display: flex; font-size: 1.12rem; gap: 7px; }
  .mobile-brand .brand-icon { width: 29px; height: 29px; }
  .mobile-brand svg { width: 18px; height: 18px; }
  .content { display: flex; flex-direction: column; flex: 1; width: 100%; padding-top: 19px; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .content-footer { margin-top: auto; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 11px; }
  .panel { padding: 13px; }
  .order-field textarea { line-height: 1.5; }
  .intake-tools .button, .intake-actions .button { min-height: 44px; }
  .data-table th, .data-table td { padding-inline: 6px; }
  .page-heading { margin-bottom: 15px; }
  .page-heading > .button { min-height: 38px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
