/* Crewport Pay: calm, numbers-first. Mobile first (390px), centered column on desktop. */

:root {
  --bg: #F4F6F9;
  --card: #FFFFFF;
  --ink: #14181F;
  --ink-2: #3E4654;
  --ink-3: #5F6878;
  --line: #E2E6EE;
  --line-2: #CBD2DE;
  --primary: #1A47C2;
  --primary-ink: #FFFFFF;
  --primary-soft: #E9EEFB;
  --alert: #9A3412;
  --alert-bg: #FCEBDD;
  --good: #166534;
  --good-bg: #E3F3E8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 31, 0.05), 0 2px 8px rgba(20, 24, 31, 0.04);
  /* System fonts: SF Pro on Apple devices, Segoe UI on Windows, Roboto on Android. No downloads. */
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --num: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --tabs-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
/* The hidden attribute always wins, even over a class that sets display. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.has-tabs { padding-bottom: calc(var(--tabs-h) + var(--safe-b)); }
body.noscroll { overflow: hidden; }

#app { max-width: 560px; margin: 0 auto; padding: 0 16px; }
.boot { padding: 40px 16px; color: var(--ink-3); text-align: center; }

h1 { font-size: 24px; line-height: 1.2; margin: 8px 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0; font-weight: 650; }
h3 { font-size: 16px; margin: 16px 0 6px; }
p { margin: 8px 0; }
a { color: var(--primary); }
.muted { color: var(--ink-3); }
.small { font-size: 15px; }
.mt { margin-top: 8px; }
.num, .money.num, .money.big { font-family: var(--num); font-variant-numeric: tabular-nums; }
.tile-next.is-full { border-style: solid; border-color: var(--primary-soft); background: #F7F9FE; }
.tile-next.is-full .t-amt { color: var(--ink); }

/* ---------------------------------------------------------------- header */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0 8px; position: sticky; top: 0; z-index: 5; background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; margin-right: auto; }
.logo {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--primary); color: #fff; font: 700 14px/1 var(--num); letter-spacing: 0.02em;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: rgba(20, 24, 31, 0.05); }

.pill {
  display: inline-block; font-size: 14px; font-weight: 600; line-height: 1; padding: 6px 9px;
  border-radius: 999px; background: var(--primary-soft); color: var(--primary); white-space: nowrap;
}
.pill.soft { background: #EEF0F4; color: var(--ink-2); font-weight: 500; padding: 4px 8px; vertical-align: 1px; }
.pill-sample { background: #FFF3C4; color: #6B4E00; }
.confirm {
  display: inline-block; margin-left: 4px; font-size: 12.5px; font-weight: 600; line-height: 1;
  padding: 3px 6px; border-radius: 999px; background: var(--alert-bg); color: var(--alert);
  vertical-align: 2px; font-family: var(--font); letter-spacing: 0.01em;
}
.ok-pill {
  display: inline-block; margin-left: 4px; font-size: 12.5px; font-weight: 600; line-height: 1;
  padding: 3px 6px; border-radius: 999px; background: var(--good-bg); color: var(--good); vertical-align: 2px;
}

/* ------------------------------------------------------------------ cards */
.screen { padding-bottom: 8px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin: 12px 0;
}
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.soon { background: #FAFBFD; box-shadow: none; border: 1px dashed var(--line-2); }
.soon h2 { color: var(--ink-2); }
.note { color: var(--ink-2); background: #F2F4F8; border-radius: var(--radius-sm); padding: 8px 10px; }
.good { color: var(--good); background: var(--good-bg); border-radius: var(--radius-sm); padding: 8px 10px; }
.alert { color: var(--alert); background: var(--alert-bg); }
.bullets { padding-left: 18px; margin: 8px 0 0; }
.bullets li { margin: 4px 0; }

/* ------------------------------------------------------- tappable figures */
.money {
  appearance: none; border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit;
  cursor: pointer; text-decoration: underline dotted rgba(26, 71, 194, 0.45); text-underline-offset: 4px;
  text-decoration-thickness: 1.5px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.money:hover { text-decoration-color: var(--primary); }
.money:focus-visible, .tile:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .trip-head:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px;
}
.money.big { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; text-underline-offset: 6px; }

/* ------------------------------------------------------------------- home */
.hero { padding: 18px 16px; }
.eyebrow { font-size: 15px; font-weight: 600; color: var(--ink-3); text-transform: none; }
.hero-amt { margin: 6px 0 2px; }
.hero-sub { color: var(--ink-2); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.mini { background: var(--bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.mini.is-next { background: var(--primary-soft); }
.mini-label { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.mini .money { font-size: 19px; font-weight: 650; }
.mini-note { font-size: 14px; color: var(--ink-3); }

.kv { margin: 0; display: grid; gap: 10px; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; padding-bottom: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.kv dd .money { font-size: 19px; font-weight: 600; }
.kv small { color: var(--ink-3); font-size: 14px; }

.countdown { font-size: 17px; margin: 4px 0 10px; }
.countdown .num { font-size: 28px; font-weight: 700; margin-right: 4px; }
.dates { list-style: none; margin: 0; padding: 0; }
.dates li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 16px; }
.dates li span:first-child { color: var(--ink-2); }

/* -------------------------------------------------------------------- pay */
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.period-label { text-align: center; }
.period-code { font: 700 22px/1.1 var(--num); letter-spacing: 0.02em; }
.rate-line { text-align: center; color: var(--ink-2); font-size: 16px; margin: 4px 0 0; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile {
  appearance: none; border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--bg); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.tile:hover { background: #EBEEF3; }
.t-date { font-size: 14px; font-weight: 600; color: var(--ink-3); }
.t-amt { font: 650 21px/1.2 var(--num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.t-net { font-size: 14.5px; color: var(--ink-2); }
.t-what { font-size: 14px; color: var(--ink-3); line-height: 1.3; margin-top: 2px; }
.tile-next {
  grid-column: 1 / -1; background: transparent; border: 1.5px dashed var(--line-2);
  display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: baseline;
}
.tile-next .t-date { grid-column: 1; grid-row: 1; }
.tile-next .t-what { grid-column: 1; grid-row: 2; margin: 0; }
.tile-next .t-amt { grid-column: 2; grid-row: 1; text-align: right; color: var(--primary); }
.tile-next .t-net { grid-column: 2; grid-row: 2; text-align: right; }
.lag { font-size: 15px; color: var(--ink-3); margin: 10px 0 0; }

.whatif { display: grid; gap: 6px; }
.wi-hours { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; }
.wi-hours span:first-child { margin-right: auto; }
.wi-input { width: 5.4em; padding: 8px 10px; text-align: right; font: 700 20px var(--num); color: var(--primary); }
.wi-amt { font: 700 30px/1.15 var(--num); margin-top: 6px; }
.wi-amt .money { font-family: var(--num); }
.wi-amt small { font: 500 15px var(--font); color: var(--ink-3); }
.wi-sub { color: var(--ink-2); margin: 2px 0 0; }
input[type="range"] { width: 100%; accent-color: var(--primary); height: 32px; margin: 4px 0 0; }
.range-scale { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); margin-top: -2px; }

.calc { font-size: 17px; margin: 10px 0 4px; }
.calc .money { font-size: 19px; font-weight: 650; }

.trips, .addons { display: grid; gap: 10px; margin-top: 8px; }
.trip { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.trip.open { border-color: var(--line-2); }
.trip-head { display: flex; align-items: center; gap: 10px; padding: 12px; cursor: pointer; user-select: none; }
.trip-name { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.trip-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-meta { font-size: 14px; color: var(--ink-3); }
.trip-sum { font-weight: 650; white-space: nowrap; }
.chev { color: var(--ink-3); transition: transform 0.15s; flex: none; }
.trip.open .chev { transform: rotate(180deg); }
.trip-body { padding: 0 12px 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.trip-body > :first-child { margin-top: 12px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }

.addon { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.addon-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.addon-head .icon-btn { width: 42px; height: 42px; margin: -6px -6px 0 0; }
.addon-head .icon-btn svg { width: 18px; height: 18px; }

.bko-val { font-weight: 600; color: var(--primary); margin-left: 6px; }
.btn-pair { display: inline-flex; gap: 6px; }
textarea.paste {
  width: 100%; min-height: 140px; padding: 10px 12px; font: 16px/1.4 ui-monospace, Menlo, monospace; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); resize: vertical;
}
textarea.paste:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.recap-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; }
.recap-card .btn { width: 100%; }
.checks { margin: 10px 0 0; padding-left: 18px; color: var(--ink-3); }
.checks li { margin: 3px 0; }
.fares { border-top: 1px solid var(--line); padding-top: 10px; }
.check.fare { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; margin: 8px 0; }
.check.fare small { color: var(--ink-3); }
.dps { display: grid; gap: 6px; margin-top: 8px; }
.dp { display: grid; grid-template-columns: 18px 1fr 1fr 1fr 40px; gap: 6px; align-items: center; }
.dp input { min-height: 46px; padding: 8px; text-align: center; }
.dp-n { font-size: 14px; font-weight: 600; color: var(--ink-3); text-align: center; }
.dp-head span { font-size: 13.5px; font-weight: 600; color: var(--ink-3); text-align: center; line-height: 1.2; }
.dp-x { width: 40px; height: 40px; }
.dp-x svg { width: 16px; height: 16px; }
.dps > .btn { justify-self: start; }

.math { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.math li { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; font-size: 15.5px; padding: 6px 0; border-top: 1px solid var(--line); }
.m-label { font-weight: 600; grid-column: 1; }
.m-text { color: var(--ink-3); grid-column: 1; font-variant-numeric: tabular-nums; }
.m-amt { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-weight: 600; }
.m-toward { font-weight: 500; color: var(--ink-3); font-size: 14px; }
.subtotal { display: flex; justify-content: space-between; align-items: baseline; font-weight: 650; padding-top: 8px; border-top: 1px solid var(--line-2); margin: 6px 0 0; }

.ledger { list-style: none; margin: 8px 0 0; padding: 0; }
.ledger li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 16px; }
.ledger li > span:first-child { color: var(--ink-2); min-width: 0; }
.ledger li.sum { font-weight: 650; border-top: 1.5px solid var(--ink); }
.ledger li.sum > span:first-child { color: var(--ink); }
.ledger + .ledger { margin-top: 14px; }
.history li { align-items: center; }
.history li .muted { margin-left: auto; }
.ytd { font-size: 17px; }
.ytd .money { font-size: 19px; font-weight: 650; }
.audit-diff { padding: 8px 10px; border-radius: var(--radius-sm); background: #F2F4F8; }
.equiv { margin: 4px 0 0; padding-left: 18px; font-size: 15.5px; }
.equiv li { margin: 3px 0; }
/* Line-by-line stub check: one row per kind of pay, opens to show the stub's lines next to the app's. */
.audit-rows { display: grid; gap: 8px; margin-top: 10px; }
.audit-row { border: 1px solid var(--line); border-radius: 12px; }
.audit-row.short { border-color: #E9B48F; }
.audit-row > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: start; padding: 10px 12px; cursor: pointer; list-style: none; }
.audit-row > summary::-webkit-details-marker { display: none; }
.a-label { font-weight: 600; min-width: 0; }
.a-label small, .a-nums small { display: block; font-weight: 400; font-size: 14.5px; color: var(--ink-3); }
.a-nums { text-align: right; font-weight: 600; }
.a-pill { grid-column: 1 / -1; justify-self: start; font-size: 14.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--good-bg); color: var(--good); }
.a-pill.short { background: var(--alert-bg); color: var(--alert); }
.a-pill.over { background: #EEF0F4; color: var(--ink-2); }
.a-body { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.a-body > b { display: block; margin-top: 10px; }
.note.alert { background: var(--alert-bg); color: var(--alert); }

/* ------------------------------------------------------------------ banks */
.tabs-top { margin-top: 4px; }
.alert-text { color: var(--alert); }
.ok-text { color: var(--good); }
.kv > div.is-alert dt { color: var(--alert); font-weight: 600; }
.flags { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.flags li { font-size: 16px; padding: 8px 10px; border-radius: var(--radius-sm); background: #F2F4F8; color: var(--ink-2); }
.flags li.alert { background: var(--alert-bg); color: var(--alert); }
.ledger.bal li > span:first-child, .entries li > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.ledger.bal small, .entries small { font-size: 14.5px; color: var(--ink-3); font-weight: 400; }
.ledger.bal li.warn small { color: var(--alert); }
.entries { list-style: none; margin: 4px 0 0; padding: 0; }
.entries li { display: grid; grid-template-columns: 1fr auto 42px; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 16px; }
.entries li > .num { text-align: right; display: flex; flex-direction: column; align-items: flex-end; font-weight: 600; }
.entries .icon-btn { width: 42px; height: 42px; }
.entries .icon-btn svg { width: 16px; height: 16px; }
.note-inline { color: var(--ink-2) !important; margin-top: 2px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.cmp th, .cmp td { padding: 7px 4px; border-top: 1px solid var(--line); text-align: right; vertical-align: top; }
.cmp th:first-child, .cmp td:first-child { text-align: left; }
.cmp thead th { font-size: 13.5px; color: var(--ink-3); font-weight: 600; border-top: 0; }
.cmp td small { display: block; font-size: 13.5px; color: var(--ink-3); }
.cmp tfoot td { font-weight: 650; border-top: 1.5px solid var(--ink); }
.hotel-cmp input { min-height: 44px; padding: 6px 8px; font-size: 18px; text-align: right; max-width: 110px; }
.hotel-cmp th[scope="row"] { font-weight: 500; color: var(--ink-2); font-size: 15.5px; }
.hotel-big { margin: 4px 0 6px; }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:hover { box-shadow: 0 0 0 1.5px var(--primary-soft), var(--shadow); }
.link-amt { font-size: 24px; font-weight: 700; margin: 2px 0; }
details.card > summary { cursor: pointer; }

/* ------------------------------------------------------------------ forms */
.stack { display: grid; gap: 12px; }
.intro { margin: 8px 0 4px; }
.lede { color: var(--ink-2); font-size: 18px; margin-top: 0; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field legend { font-weight: 600; font-size: 16px; margin-bottom: 6px; padding: 0; }
.hint { font-size: 15px; color: var(--ink-3); margin: 6px 0 0; }
.form-error { color: var(--alert); background: var(--alert-bg); padding: 10px 12px; border-radius: var(--radius-sm); margin: 0; }

.f { display: grid; gap: 4px; min-width: 0; }
.f > span:first-child { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.grid2.align-end { align-items: end; }

input[type="text"], input:not([type]), input[type="date"], input[inputmode], select {
  width: 100%; min-height: 52px; padding: 10px 12px; font: 18px var(--font); color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); appearance: none;
  font-variant-numeric: tabular-nums;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235F6878' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
input.invalid { border-color: var(--alert); background: var(--alert-bg); }
.suffix-wrap { position: relative; display: block; }
.suffix-wrap input { padding-right: 30px; }
.suffix-wrap i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-3); }

.check { display: flex; align-items: center; gap: 10px; font-size: 16px; cursor: pointer; padding: 6px 0; }
.check input { width: 26px; height: 26px; margin: 0; accent-color: var(--primary); flex: none; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: #E9ECF2; padding: 4px; border-radius: 12px; }
.seg-opt { position: relative; cursor: pointer; min-width: 0; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: 6px 6px; border-radius: 9px; font-size: 16px; color: var(--ink-2);
}
.seg-opt b { font-weight: 600; }
.seg-opt small { font-size: 13.5px; color: var(--ink-3); font-weight: 500; }
.seg-opt input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 24, 31, 0.12); }
.seg-opt input:checked + span b { color: var(--primary); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--primary); }
.seg-tall .seg-opt span { min-height: 54px; }
.seg-small .seg-opt span { min-height: 44px; font-size: 15px; }
.seg-inline { display: inline-grid; padding: 3px; }
.seg-inline .seg-opt span { min-height: 38px; padding: 4px 10px; }

details.more { background: #F7F8FA; border-radius: 12px; padding: 4px 12px; }
details.more summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
details.more[open] { padding-bottom: 12px; }
details.more > *:not(summary) { margin-top: 10px; }

.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 52px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); font: 600 17px var(--font); cursor: pointer; text-decoration: none;
}
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.danger { color: var(--alert); border-color: #F1C9AE; }
.btn.danger.big { background: var(--alert); color: #fff; border-color: var(--alert); }
.btn.big { min-height: 60px; font-size: 18px; }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: 16px; }
.hero .btn { width: 100%; }
.link { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: var(--primary); cursor: pointer; font-weight: 600; }

/* ---------------------------------------------------------------- footer */
.disclaimer { font-size: 14px; color: var(--ink-3); text-align: center; padding: 16px 8px 20px; line-height: 1.4; }

/* ---------------------------------------------------------------- tab bar */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabs-h); color: var(--ink-3); text-decoration: none; font-size: 13.5px; font-weight: 600;
}
.tab.active { color: var(--primary); }
@media (min-width: 600px) {
  .tabs { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; }
}

/* ------------------------------------------------------------------ sheet */
.sheet-root { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 24, 31, 0.4); opacity: 0; transition: opacity 0.16s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow: auto;
  background: #fff; border-radius: 20px 20px 0 0; padding: 4px 16px calc(20px + var(--safe-b));
  transform: translateY(16px); opacity: 0; transition: transform 0.16s, opacity 0.16s;
  max-width: 560px; margin: 0 auto;
}
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet-root.open .sheet { transform: none; opacity: 1; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; background: #fff; padding: 12px 0 8px; }
.sheet-head h2 { font-size: 19px; }

.x-line { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.x-label { font-weight: 600; font-size: 16px; }
.x-math { color: var(--ink-3); font-size: 15.5px; grid-column: 1; font-variant-numeric: tabular-nums; }
.x-amt { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: 600 17px var(--num); font-variant-numeric: tabular-nums; }
.x-total { display: flex; justify-content: space-between; font-weight: 700; padding: 10px 0; border-top: 1.5px solid var(--ink); font-family: var(--num); }
.x-total span:first-child { font-family: var(--font); }
.x-note { font-size: 15.5px; color: var(--ink-2); background: #F2F4F8; padding: 8px 10px; border-radius: var(--radius-sm); }
.x-h { margin-top: 18px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.x-src { padding: 8px 0; border-top: 1px solid var(--line); }
.x-src-head { font-weight: 600; font-size: 16px; }
.x-src p { margin: 4px 0 0; font-size: 15.5px; color: var(--ink-2); }

.picks { display: grid; gap: 8px; }
.pick {
  appearance: none; text-align: left; display: flex; flex-direction: column; gap: 2px; font: inherit; color: inherit;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer;
}
.pick:hover { border-color: var(--primary); }

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 12px); transform: translate(-50%, 8px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 16px; font-weight: 500;
  opacity: 0; transition: opacity 0.18s, transform 0.18s; z-index: 60; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* 401(k) */
.meter { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.meter span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.meter.over span { background: var(--alert); }
.k-table { width: 100%; border-collapse: collapse; font-size: 16px; margin-top: 6px; }
.k-table th, .k-table td { padding: 8px 4px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.k-table thead th { border-top: 0; color: var(--ink-3); font-weight: 500; font-size: 14px; }
.k-table th[scope="row"] { text-align: left; font-weight: 500; color: var(--ink-2); white-space: normal; }
.k-table tr.total th, .k-table tr.total td { font-weight: 650; color: var(--ink); border-top: 1.5px solid var(--ink); }
.k-table .money { font-size: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.block { display: block; }
.link-amt small { font-size: 15px; font-weight: 400; }

/* ------------------------------------------------------------ retirement */
.r-table th, .r-table td { padding: 8px 3px; }
.r-table th[scope="row"] { font-size: 15px; }
.r-table th[scope="row"] small { display: block; font-weight: 400; color: var(--ink-3); font-size: 13.5px; }
.r-table td { font-size: 15.5px; }
.r-table .money { font-size: 15.5px; }
.r-bars { margin-top: 14px; display: grid; gap: 8px; }
.r-bar { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.r-track { display: flex; height: 14px; background: var(--line); border-radius: 4px; overflow: hidden; }
.r-track span { display: block; height: 100%; }
.s-pen { background: var(--primary); }
.s-cb { background: var(--good); }
.s-k { background: #7F95D1; }
.r-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--ink-3); }
.r-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.slide { padding: 10px 0 4px; border-top: 1px solid var(--line); }
.slide:first-of-type { border-top: 0; }
.slide-label { font-size: 16px; color: var(--ink-2); }
.slide-num { width: 84px; flex: none; }
.slide-num input { padding: 6px 30px 6px 8px; text-align: right; }
.slide-num:not(.suffix-wrap) input { padding-right: 10px; }
.file-btn { position: relative; overflow: hidden; display: flex; justify-content: center; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ------------------------------------------------------------- feedback */
.fb-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1.5px dashed var(--line-2); }
.fb-card h2 { margin: 0 0 2px; }
.fb-card .btn { flex: none; }
.foot-link { display: inline-block; margin-top: 8px; padding: 4px 8px; color: var(--primary); font-weight: 600; text-decoration: none; }
.update-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + var(--safe-b) + 10px); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: #fff; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 16px;
  max-width: 560px; margin: 0 auto; box-shadow: var(--shadow);
}
/* ------------------------------------------------- first-time setup wizard */
.wiz { padding: 8px 0 24px; display: grid; gap: 14px; }
.wiz-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.wiz-count { color: var(--ink-3); font-weight: 600; }
.wiz-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.wiz-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.wiz h1 { font-size: 30px; margin: 14px 0 6px; }
.wiz-opts { display: grid; gap: 12px; }
.wiz-opt {
  appearance: none; width: 100%; min-height: 84px; padding: 16px 20px; border-radius: 16px; cursor: pointer;
  border: 2px solid var(--line-2); background: #fff; color: var(--ink); font: 650 22px var(--font); text-align: left;
  box-shadow: var(--shadow);
}
.wiz-opt:hover, .wiz-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.wiz-opt:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.wiz-field { display: grid; gap: 14px; }
.wiz-field input[type="date"], .wiz-field select { min-height: 64px; font-size: 22px; }
.wiz-field .link { justify-self: start; padding: 10px 0; font-size: 17px; }
.wiz-note { color: var(--ink-3); margin: 0; }

/* ----------------------------------------------- guide steps, action lists */
.btn.wide { width: 100%; }
.center { text-align: center; }
.step-n {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; flex: none;
  background: var(--primary); color: #fff; font: 700 16px/1 var(--num); vertical-align: 2px; margin-right: 6px;
}
.guide { border: 2px solid var(--primary); }
.step, .act {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 0;
  border-top: 1px solid var(--line); color: inherit; text-decoration: none;
}
.step > svg, .act > svg { flex: none; color: var(--ink-3); width: 22px; height: 22px; }
.step .step-n { margin-right: 0; width: 36px; height: 36px; font-size: 18px; }
.step.done .step-n { background: var(--good); }
.step.done b { color: var(--ink-3); font-weight: 500; }
.acts { margin-top: 8px; }
.act-t { display: flex; flex-direction: column; min-width: 0; margin-right: auto; gap: 1px; }
.act-t b { font-weight: 600; font-size: 18px; line-height: 1.25; }
.act-t small { font-size: 15px; line-height: 1.3; }
.act-v { font-weight: 650; white-space: nowrap; font-size: 18px; }
.act:hover b, .step:hover b { color: var(--primary); }

/* --------------------------------------------------------- folded sections */
details.fold { padding: 0; }
details.fold > summary {
  display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 16px; cursor: pointer; list-style: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary .chev { transform: rotate(180deg); }
details.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold-body { padding: 12px 16px 16px; }
dl.fold-body { margin: 0; }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--primary); } 100% { box-shadow: var(--shadow); } }
details.more summary { padding: 13px 0; }
details.fold > summary b .step-n { vertical-align: 1px; }
.trip-body details.more { background: #F7F8FA; }
.trip-head { min-height: 64px; }
ul.fold-body { margin: 0; padding-left: 34px; }
.trip-title { white-space: normal; }
.wi-hours span:first-child { white-space: nowrap; }
.wi-hours .wi-input { width: 6em; flex: none; }
@media (max-width: 350px) {
  .tile { padding: 10px 8px; }
  .t-amt { font-size: 18px; }
  .wiz h1 { font-size: 26px; }
}
.wiz-opts.tight .wiz-opt { min-height: 68px; padding: 12px 20px; font-size: 20px; }
.logo { background: none; width: 32px; height: 32px; border-radius: 8px; display: block; }
