:root {
  color-scheme: light;
  --paper: #f8f6f2;
  --paper-2: #efeae1;
  --ink: #0f2438;
  --ink-2: #2b4257;
  --muted: #536679;
  --line: #ded7cb;
  --accent: #c08a2e;
  --accent-2: #795519;
  --gold-soft: #e8c98a;
  --emerald: #176447;
  --card: #fffdfa;
  --dark: #0b1c2c;
  --danger: #a3221b;
  --pad: clamp(20px, 3vw, 96px);
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 12px 32px rgba(11,28,44,.07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 17px; color: var(--ink); background: var(--paper); line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; }
main { flex: 1; }
h1, h2, h3 { margin: 0 0 12px; font-family: 'Fraunces', Georgia, serif; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: clamp(30px, 4vw, 44px); }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
p { margin: 0 0 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, input, summary, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: 2px solid var(--accent-2); outline-offset: 5px; }
img { max-width: 100%; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
code { font-size: .88em; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 16px; z-index: 100; background: var(--ink); color: white; padding: 12px 18px; border-radius: var(--radius); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.wrap { width: 100%; margin-inline: 0; padding-inline: var(--pad); }
.page { padding-top: 38px; padding-bottom: 24px; }
.page-narrow { width: 100%; }
.page-head, .section-head, .detail-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 18px; margin-bottom: 26px; }
.page-head > div { flex: 1 1 300px; min-width: 0; }
.page-head p { color: var(--muted); max-width: 65ch; margin-bottom: 0; }
.eyebrow { display: block; margin: 0 0 12px; color: var(--accent-2); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.muted, .hint, .small-copy { color: var(--muted); }
.hint { font-size: 14px; }
.small-copy { font-size: 16px; max-width: 70ch; }
.hint { margin: 7px 0 0; }
.text-link { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0 14px; font-size: 16px; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.stack { display: grid; gap: 22px; align-content: start; min-width: 0; }
.section-space { margin-top: 30px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }

.app-header { background: rgba(248,246,242,.97); border-bottom: 1px solid var(--line); }
.app-nav { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 86px; gap: 16px; padding-block: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { height: 44px; width: 44px; object-fit: contain; }
.brand-name { display: flex; flex-direction: column; font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 22px; line-height: 1.12; }
.brand-name small { margin-top: 4px; font-family: 'Space Grotesk', sans-serif; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.app-nav-right { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.nav-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 13px; border: 0; border-radius: 9px; color: var(--ink-2); background: transparent; font-size: 16px; font-weight: 600; cursor: pointer; text-align: center; }
.nav-link:hover { background: var(--paper-2); }
.nav-link[aria-current="page"] { background: var(--ink); color: #fff; }
.nav-link:disabled { cursor: wait; opacity: .65; }
.account-bar { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 18px; padding-bottom: 12px; }
.who { color: var(--muted); font-size: 14px; min-width: 0; }
.who b { color: var(--ink); font-weight: 500; }
.workspace-tag { font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--accent-2); text-transform: uppercase; }
.header-message:has(.note:not(:empty)) { padding-bottom: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; max-width: 100%; padding: 12px 22px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-weight: 600; font-size: 16px; line-height: 1.4; text-align: center; cursor: pointer; transition: background .18s, box-shadow .18s, color .18s; }
.btn:hover:not(:disabled) { box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-accent { color: var(--dark); background: var(--gold-soft); border-color: var(--gold-soft); }
.btn-accent:hover:not(:disabled) { background: #dfba72; border-color: #dfba72; }
.btn-primary { color: white; background: var(--ink); }
.btn-primary:hover:not(:disabled) { background: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--paper-2); }
.btn-sm { min-height: 44px; padding: 10px 16px; font-size: 15px; }
.btn-link { min-height: 44px; padding: 8px 0; border: 0; background: none; color: var(--accent-2); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; font-size: 16px; }
.btn-link:disabled { color: var(--muted); text-decoration: none; cursor: not-allowed; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.full-width { width: 100%; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 3.4vw, 34px); min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.field { min-width: 0; margin-bottom: 18px; }
.field label { display: block; margin-bottom: 8px; font-size: 16px; font-weight: 600; color: var(--ink-2); }
.optional { color: var(--muted); font-weight: 400; font-size: 14px; }
.field input, .field select, .field textarea { display: block; width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px; border: 1px solid #aab1b7; border-radius: 9px; background: #fff; color: var(--ink); font-size: 16px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent-2); outline: 3px solid rgba(121,85,25,.24); outline-offset: 2px; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field input[readonly] { background: var(--paper-2); color: var(--muted); }
.field textarea { resize: vertical; min-height: 115px; }
.row, .address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.span-2 { grid-column: 1 / -1; }
.disclosure { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 20px 0 24px; padding: 0 2px; }
.disclosure summary { min-height: 48px; padding: 13px 0; font-size: 16px; font-weight: 600; cursor: pointer; }
.disclosure[open] summary { margin-bottom: 10px; }
.check-field { display: flex; gap: 12px; align-items: flex-start; margin: 22px 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); font-size: 16px; cursor: pointer; }
.check-field input { width: 19px; height: 19px; flex-shrink: 0; margin: 2px 0; accent-color: var(--ink); }
.form-legend { font-family: 'Fraunces', Georgia, serif; font-size: 21px; margin: 6px 0 16px; }
.field .otp-input { font-family: 'Space Grotesk', sans-serif; font-size: 28px; text-align: center; letter-spacing: .32em; padding-left: calc(14px + .32em); font-variant-numeric: tabular-nums; }
.note { margin: 12px 0 0; font-size: 16px; overflow-wrap: anywhere; max-width: 75ch; }
.note:empty { margin: 0; }
.note.ok { color: var(--emerald); }
.note.err { color: var(--danger); font-weight: 500; }
.note.info { color: var(--ink-2); }
.banner { padding: 20px 24px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--paper-2); font-size: 16px; }
.banner strong { display: block; margin-bottom: 4px; font-size: 17px; }
.banner p { margin: 0; max-width: 75ch; }
.banner p + p { margin-top: 7px; }
.banner-info { background: #edf1f5; border-color: #c0cdd8; border-left-color: var(--ink-2); }
.banner-warn, .banner-test { background: #fcf1d9; border-color: #d8bd82; border-left-color: var(--accent-2); }
.banner-ok { background: #edf5ee; border-color: #b9cfbd; border-left-color: var(--emerald); }
.state-panel, .empty { border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 40px 24px; text-align: center; color: var(--muted); }
.state-panel h2, .empty h2 { color: var(--ink); font-size: 24px; }
.state-panel .spinner { width: 23px; height: 23px; margin-bottom: 8px; }

.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card { padding: 23px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.stat-card dt { font-size: 16px; font-weight: 500; color: var(--muted); }
.stat-card dd { margin: 7px 0; font-family: 'Fraunces', Georgia, serif; font-size: clamp(26px, 3vw, 35px); line-height: 1.2; }
.stat-card p { margin: 0; font-size: 14px; color: var(--muted); }
.next-action { display: flex; align-items: center; justify-content: space-between; gap: 26px; padding: clamp(25px, 4vw, 38px); border-radius: var(--radius-lg); background: var(--ink); color: #fff; margin-bottom: 30px; }
.next-action > div { min-width: 0; flex: 1; }
.next-action .eyebrow { color: var(--gold-soft); }
.next-action h2 { font-size: clamp(25px, 3vw, 32px); }
.next-action p { color: #d4dfe8; font-size: 17px; max-width: 65ch; margin: 0; }
.next-action .btn { flex-shrink: 0; }
.next-action :focus-visible { outline-color: var(--gold-soft); }
.section-head { align-items: center; margin-bottom: 18px; }
.section-head h2, .section-head p { margin-bottom: 0; }
.wo-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 24px; padding: 0; margin: 0; }
.wo-list li { min-width: 0; }
.wo-card { display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; transition: border-color .2s, box-shadow .2s; }
.wo-card:hover { box-shadow: var(--shadow-sm); border-color: var(--accent); }
.wo-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 15px; }
.wo-id, .big-id { font-family: ui-monospace, 'Cascadia Code', monospace; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.wo-id { flex: 1 1 180px; }
.big-id { font-size: 15px; display: block; margin: 5px 0 12px; }
.wo-meta { color: var(--muted); font-size: 16px; }
.wo-amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.wo-amounts span { display: block; color: var(--muted); font-size: 14px; }
.wo-amounts strong { font-size: 25px; font-family: 'Fraunces', Georgia, serif; }
.wo-amounts .paid, .paid { display: block; color: var(--emerald); font-size: 14px; font-weight: 500; }
.wo-amounts .due, .due { color: var(--accent-2); font-size: 14px; font-weight: 600; }
.card-action { display: block; margin-top: 17px; font-size: 16px; color: var(--accent-2); font-weight: 600; }
.pill-row { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { display: inline-block; max-width: 100%; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.5; border: 1px solid transparent; }
.pill-await, .pill-due { color: var(--accent-2); background: #fcf1d9; border-color: #d8bd82; }
.pill-active { color: var(--emerald); background: #edf5ee; border-color: #b9cfbd; }
.pill-closed { color: var(--muted); background: #eef0f2; border-color: #cbd2d8; }

.detail-grid, .profile-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 24px; }
.kv { display: grid; grid-template-columns: minmax(100px, .65fr) minmax(0, 1fr); gap: 14px 24px; font-size: 16px; margin: 22px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; }
.money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.money > div { background: var(--paper-2); border-radius: var(--radius); padding: 17px; }
.money span { display: block; font-size: 14px; color: var(--muted); }
.money strong { display: block; font-family: 'Fraunces', Georgia, serif; font-size: clamp(22px, 2.5vw, 28px); margin-block: 4px; }
.money .paid { color: var(--emerald); }
.money .due { color: var(--accent-2); }
.detail-grid .money { grid-template-columns: 1fr 1fr; }
.detail-grid .money > div:first-child { grid-column: 1 / -1; background: var(--ink); color: white; }
.detail-grid .money > div:first-child span { color: #d4dfe8; }
.timeline { border-left: 2px solid var(--line); padding: 0 0 0 22px; margin: 22px 0 0 6px; list-style: none; }
.timeline li { position: relative; padding-bottom: 23px; font-size: 16px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -29px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid #aab1b7; }
.timeline li.done::before { background: var(--emerald); border-color: var(--emerald); }
.timeline li.now::before { background: var(--accent); border-color: var(--accent-2); }
.timeline b { display: block; }
.timeline small { color: var(--muted); font-size: 14px; }
.payment-record { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.payment-record h3 { font-size: 18px; }
.receipt-list { margin: 20px 0 0; padding: 0; list-style: none; }
.receipt-item { display: flex; align-items: center; flex-wrap: wrap; gap: 15px 22px; padding: 20px 0; border-top: 1px solid var(--line); }
.receipt-item > div { flex: 1 1 240px; min-width: 0; }
.receipt-item > strong { font-size: 21px; }
.receipt-item .hint { margin-bottom: 0; }
.payment-plan-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.payment-plan-controls .field { flex: 1 1 190px; margin-bottom: 0; }
.payment-plan-controls input { text-transform: uppercase; }
.fee-breakdown { margin: 18px 0; }

.steps { display: flex; gap: 14px; padding: 0; margin: 0 0 28px; list-style: none; }
.steps li { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 15px; }
.steps span { display: grid; place-items: center; width: 27px; height: 27px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--card); }
.steps [aria-current="step"] { color: var(--ink); font-weight: 600; }
.steps [aria-current="step"] span { background: var(--ink); color: white; border-color: var(--ink); }
.step-legend { float: left; width: 100%; font-family: 'Fraunces', Georgia, serif; font-size: 23px; margin-bottom: 10px; }
.step-legend + * { clear: both; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.pick { position: relative; display: flex; align-items: flex-start; gap: 11px; padding: 19px 17px; border: 1px solid #aab1b7; border-radius: var(--radius); background: white; cursor: pointer; }
.pick:hover { border-color: var(--accent-2); }
.pick:has(input:checked) { border-color: var(--accent-2); background: #fcf6e9; box-shadow: 0 0 0 1px var(--accent-2); }
.pick:focus-within { outline: 3px solid rgba(121,85,25,.4); outline-offset: 3px; }
.pick input { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--ink); }
.pick-body { min-width: 0; }
.pick-title { display: block; font-family: 'Fraunces', Georgia, serif; font-size: 19px; line-height: 1.3; margin-bottom: 7px; }
.pick-meta { display: block; color: var(--muted); font-size: 15px; margin-bottom: 9px; }
.pick-detail { display: block; font-size: 16px; font-weight: 500; }
.quote-expiry { font-size: 14px; color: var(--muted); }
.fee-adjusted { margin-bottom: 16px; }
.fee-adjusted del { color: var(--muted); margin-right: 6px; }
#woForm { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: start; gap: 28px; }
#schemeFields, #categoryFields { grid-column: 1; }
#quoteCard { grid-column: 2; grid-row: 1 / span 2; }

.auth-page { padding-block: 36px; }
.auth-shell { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-sm); background: var(--card); }
.auth-story { display: flex; flex-direction: column; justify-content: space-between; gap: 45px; padding: clamp(28px, 4vw, 46px); color: #fff; background: linear-gradient(145deg, rgba(11,28,44,.96), rgba(11,28,44,.87)), url('/img/office.jpg') center / cover; }
.auth-story .eyebrow { color: var(--gold-soft); }
.auth-story h2 { font-size: clamp(32px, 3.5vw, 58px); line-height: 1.18; max-width: 21ch; }
.auth-story h2 em { color: var(--gold-soft); font-style: normal; }
.auth-story p { font-size: 17px; color: #d4dfe8; max-width: 62ch; }
.auth-points { display: grid; gap: 22px; padding: 0; margin: 26px 0 0; list-style: none; }
.auth-points li { display: flex; gap: 15px; align-items: baseline; }
.auth-points span { font-size: 15px; color: var(--gold-soft); }
.auth-points strong { display: block; font-size: 18px; margin-bottom: 3px; }
.auth-points p { font-size: 16px; margin-bottom: 0; }
.auth-story .auth-disclaimer { padding-top: 22px; border-top: 1px solid #445360; font-size: 14px; margin: 0; }
.auth-card { width: 100%; max-width: 720px; padding: clamp(25px, 4vw, 46px); align-self: center; justify-self: center; min-width: 0; }
.auth-card h1 { font-size: clamp(28px, 3vw, 35px); }
.auth-card .state-panel { padding: 26px 18px; }
.auth-card .banner { margin-bottom: 20px; }
.auth-terms { border-top: 1px solid var(--line); padding-top: 22px; margin: 24px 0 0; font-size: 14px; color: var(--muted); }
.auth-terms a { text-decoration: underline; text-underline-offset: 3px; }
.profile-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr); }
.profile-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--ink); color: var(--gold-soft); font-family: 'Fraunces', Georgia, serif; font-size: 23px; margin-bottom: 18px; }

dialog { width: min(570px, calc(100% - 32px)); max-height: calc(100svh - 36px); padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); color: var(--ink); box-shadow: 0 30px 90px #0b1c2c33; }
dialog::backdrop { background: rgba(11,28,44,.66); }
dialog h2 { font-size: 29px; }
body.payment-wait-open { overflow: hidden; }
dialog.payment-wait { inset: 0; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: clamp(18px, 4vw, 48px); border: 0; border-radius: 0; background: transparent; overflow-y: auto; }
dialog.payment-wait[open] { display: grid; align-items: safe center; justify-items: center; }
dialog.payment-wait::backdrop { background: rgba(6,18,31,.84); backdrop-filter: blur(4px); }
.payment-wait-panel { width: min(620px, 100%); min-width: 0; padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: 0 24px 90px #0005; text-align: center; }
.payment-wait-panel h2 { font-size: clamp(27px, 3.5vw, 38px); text-wrap: balance; }
.payment-wait-panel h2:focus { outline: none; } /* Initial reading focus; interactive controls retain their focus ring. */
.payment-wait-animation { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0 28px; color: var(--accent-2); }
.payment-wait-animation .spinner { width: 64px; height: 64px; border-width: 4px; }
.payment-wait-amount { font-size: 20px; font-weight: 600; color: var(--ink); }
.payment-wait-status { margin: 22px 0; padding: 14px 16px; border: 1px solid #c0cdd8; border-radius: 10px; background: #edf1f5; color: var(--ink-2); font-size: 16px; }
.payment-wait-safety { color: var(--muted); font-size: 15px; }
.payment-wait-actions { display: grid; gap: 12px; margin-top: 24px; }
.payment-wait-panel > .hint { margin-top: 16px; }
@media (max-height: 800px) and (min-width: 620px) {
  dialog.payment-wait { padding: 18px; }
  .payment-wait-panel { padding: 20px 28px; }
  .payment-wait-panel .eyebrow { display: none; }
  .payment-wait-animation { margin: 6px 0 12px; }
  .payment-wait-animation .spinner { width: 44px; height: 44px; }
  .payment-wait-panel h2 { font-size: 28px; }
  .payment-wait-panel p { line-height: 1.5; }
  .payment-wait-amount { font-size: 18px; margin-bottom: 12px; }
  .payment-wait-status { margin: 14px 0; padding: 12px; }
  .payment-wait-safety { font-size: 14px; margin-bottom: 12px; }
  .payment-wait-actions { gap: 10px; margin-top: 12px; }
  .payment-wait-actions .btn { min-height: 44px; padding-block: 10px; }
  .payment-wait-panel > .hint { margin-top: 12px; }
}
.spinner { display: inline-block; width: 16px; height: 16px; flex-shrink: 0; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.note[aria-busy="true"]::before { content: ''; display: inline-block; width: 16px; height: 16px; margin-right: 10px; vertical-align: -.15em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.request-progress { position: fixed; z-index: 90; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 36px); padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); font-size: 15px; pointer-events: none; }
.btn[aria-busy="true"], .nav-link[aria-busy="true"], .btn-link[aria-busy="true"] { opacity: 1; cursor: progress; }
.nav-link[aria-busy="true"], .btn-link[aria-busy="true"] { display: inline-flex; align-items: center; gap: 9px; }
@keyframes spin { to { transform: rotate(360deg); } }
.app-footer { border-top: 1px solid var(--line); padding: 30px 0; margin-top: 50px; color: var(--muted); font-size: 15px; }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px 40px; }
.footer-brand { color: var(--ink); font-family: 'Fraunces', Georgia, serif; font-size: 17px; }
.footer-grid p { margin: 3px 0 10px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 2px 18px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.footer-note { border-top: 1px solid var(--line); padding-top: 18px; margin: 22px 0 0; font-size: 14px; }

@media (max-width: 1100px) {
  #woForm { grid-template-columns: 1fr; }
  #quoteCard { grid-column: 1; grid-row: auto; }
}

@media (max-width: 920px) {
  .detail-grid, .profile-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { gap: 20px; }
  .auth-story h2 { max-width: 20ch; }
  .auth-points { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .auth-points li { display: block; }
  .auth-points span { display: block; margin-bottom: 6px; }
  .auth-card { order: -1; width: 100%; max-width: 630px; margin-inline: auto; }
}
@media (max-width: 640px) {
  :root { --pad: 18px; }
  .app-nav { gap: 14px; }
  .app-nav-right { width: 100%; justify-content: space-between; }
  .nav-link { flex: 1; padding: 9px 8px; font-size: 14px; }
  .account-bar { padding-top: 0; }
  .workspace-tag { display: none; }
  .page { padding-top: 28px; }
  .row, .address-grid, .money, .overview-grid { grid-template-columns: 1fr; }
  .overview-grid { gap: 10px; }
  .stat-card { padding: 18px 20px; }
  .stat-card dd { font-size: 30px; }
  .next-action { align-items: stretch; flex-direction: column; gap: 23px; }
  .wo-card { padding: 20px; }
  .wo-amounts { grid-template-columns: 1fr 1fr; gap: 14px; }
  .wo-amounts > div:first-child { grid-column: 1 / -1; }
  .kv { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; }
  .steps { gap: 10px; justify-content: space-between; }
  .steps li { font-size: 13px; gap: 6px; }
  .auth-page { padding-block: 22px; }
  .auth-story { padding: 26px; }
  .auth-story h2 { font-size: 31px; }
  .auth-points { grid-template-columns: 1fr; gap: 13px; margin-top: 22px; }
  .auth-points li { display: flex; gap: 12px; }
  .auth-points p { display: none; }
  .auth-points span { margin: 0; }
  .auth-story .auth-disclaimer { padding-top: 16px; }
  .auth-card { padding: 27px 22px; }
  .button-row .btn { flex: 1 1 180px; }
  .footer-grid { gap: 12px; }
  .app-footer { margin-top: 34px; }
}
@media (max-width: 380px) {
  .detail-grid .money { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 3px; }
  .kv dd { margin-bottom: 12px; }
  .steps li { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  /* Essential progress remains visible at a gentler speed; decorative motion stays suppressed. */
  .spinner, .note[aria-busy="true"]::before { animation-duration: 2.4s !important; animation-iteration-count: infinite !important; }
}
