/* OffHitch — styles.
   Tokens first. The bare :root is the light "steel" palette of the Industry
   design system the app was designed in (accent deepened one step so text on
   it reaches 4.5:1); dark redefines only tokens; the "sand & orange" palette
   from the original brief overrides the same tokens. Components only ever
   read tokens, so every theme resolves as a set. */

:root {
  color-scheme: light;
  --bg: #f2f2f3;
  --surface: #e9e9ea;
  --text: #1d1f20;
  --muted: rgba(29, 31, 32, .7);
  --divider: rgba(29, 31, 32, .16);
  --mark: rgba(29, 31, 32, .55);
  --accent: #4a6f95;
  --accent-strong: #35526f;
  --accent-soft: #e2edf8;
  --accent-soft-text: #2c455d;
  --on-accent: #f7f9fb;
  --hitch: #1d2d3d;
  --hitch-text: #e3e6e9;
  --pto: #4a6f95;
  --pto-text: #f7f9fb;
  --pto-edge: #35526f;
  --travel-a: #c6c6ca;
  --travel-b: #e9e9ea;
  --travel-text: #4a4a4d;
  --home-text: #6d6d70;
  --home-edge: rgba(29, 31, 32, .16);
  --trip: #94bce3;
  --lost: #8d3b1f;
  --ho: #a8561c;
  --toast-bg: #1d1f20;
  --toast-text: #f2f2f3;
  --font-heading: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14181d;
    --surface: #1c2229;
    --text: #e4e8ec;
    --muted: rgba(228, 232, 236, .66);
    --divider: rgba(228, 232, 236, .16);
    --mark: rgba(228, 232, 236, .5);
    --accent: #7ea3c9;
    --accent-strong: #a9c6e3;
    --accent-soft: #22303f;
    --accent-soft-text: #cfe0f2;
    --on-accent: #10161c;
    --hitch: #2c455d;
    --hitch-text: #e3e6e9;
    --pto: #7ea3c9;
    --pto-text: #10161c;
    --pto-edge: #a9c6e3;
    --travel-a: #3a4149;
    --travel-b: #262c33;
    --travel-text: #b7bec6;
    --home-text: #9aa2ab;
    --home-edge: rgba(228, 232, 236, .16);
    --trip: #a9c6e3;
    --lost: #e09a76;
    --ho: #d98a4f;
    --toast-bg: #e4e8ec;
    --toast-text: #14181d;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14181d;
  --surface: #1c2229;
  --text: #e4e8ec;
  --muted: rgba(228, 232, 236, .66);
  --divider: rgba(228, 232, 236, .16);
  --mark: rgba(228, 232, 236, .5);
  --accent: #7ea3c9;
  --accent-strong: #a9c6e3;
  --accent-soft: #22303f;
  --accent-soft-text: #cfe0f2;
  --on-accent: #10161c;
  --hitch: #2c455d;
  --hitch-text: #e3e6e9;
  --pto: #7ea3c9;
  --pto-text: #10161c;
  --pto-edge: #a9c6e3;
  --travel-a: #3a4149;
  --travel-b: #262c33;
  --travel-text: #b7bec6;
  --home-text: #9aa2ab;
  --home-edge: rgba(228, 232, 236, .16);
  --trip: #a9c6e3;
  --lost: #e09a76;
  --ho: #d98a4f;
  --toast-bg: #e4e8ec;
  --toast-text: #14181d;
}

/* Sand & orange — the palette the original brief asked for (dark slate hitch,
   warm sand home, one strong orange for PTO). Picked in Settings > Look. */
:root[data-palette="sand"] {
  color-scheme: light;
  --bg: #f5ecdd;
  --surface: #ede2cd;
  --text: #2a2320;
  --muted: rgba(42, 35, 32, .72);
  --divider: rgba(42, 35, 32, .18);
  --mark: rgba(42, 35, 32, .55);
  --accent: #b84a18;
  --accent-strong: #8f3a12;
  --accent-soft: #fae3d2;
  --accent-soft-text: #7a3410;
  --on-accent: #fff7ef;
  --hitch: #2f3a46;
  --hitch-text: #e8ecf0;
  --pto: #b84a18;
  --pto-text: #fff7ef;
  --pto-edge: #8f3a12;
  --travel-a: #c9c2b6;
  --travel-b: #e8dfcf;
  --travel-text: #4a423b;
  --home-text: #6e6259;
  --home-edge: rgba(42, 35, 32, .2);
  --trip: #e9a97f;
  --lost: #9c2f1c;
  --ho: #7a4a10;
  --toast-bg: #2a2320;
  --toast-text: #f5ecdd;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="sand"]:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1b1714;
    --surface: #262019;
    --text: #f1e9dc;
    --muted: rgba(241, 233, 220, .66);
    --divider: rgba(241, 233, 220, .16);
    --mark: rgba(241, 233, 220, .5);
    --accent: #e8823f;
    --accent-strong: #f4a66f;
    --accent-soft: #3a2416;
    --accent-soft-text: #f7cfae;
    --on-accent: #1b1714;
    --hitch: #3b4a58;
    --hitch-text: #e8ecf0;
    --pto: #e8823f;
    --pto-text: #1b1714;
    --pto-edge: #f4a66f;
    --travel-a: #4a423a;
    --travel-b: #2e2822;
    --travel-text: #cfc4b5;
    --home-text: #a99e90;
    --home-edge: rgba(241, 233, 220, .16);
    --trip: #f4a66f;
    --lost: #f0a184;
    --ho: #e0a35c;
    --toast-bg: #f1e9dc;
    --toast-text: #1b1714;
  }
}
:root[data-palette="sand"][data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1714;
  --surface: #262019;
  --text: #f1e9dc;
  --muted: rgba(241, 233, 220, .66);
  --divider: rgba(241, 233, 220, .16);
  --mark: rgba(241, 233, 220, .5);
  --accent: #e8823f;
  --accent-strong: #f4a66f;
  --accent-soft: #3a2416;
  --accent-soft-text: #f7cfae;
  --on-accent: #1b1714;
  --hitch: #3b4a58;
  --hitch-text: #e8ecf0;
  --pto: #e8823f;
  --pto-text: #1b1714;
  --pto-edge: #f4a66f;
  --travel-a: #4a423a;
  --travel-b: #2e2822;
  --travel-text: #cfc4b5;
  --home-text: #a99e90;
  --home-edge: rgba(241, 233, 220, .16);
  --trip: #f4a66f;
  --lost: #f0a184;
  --ho: #e0a35c;
  --toast-bg: #f1e9dc;
  --toast-text: #1b1714;
}

/* ── base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
body {
  margin: 0; min-height: 100%; overflow: hidden; overscroll-behavior-y: none;
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.12; letter-spacing: .005em; margin: 0; text-wrap: balance; }
h3 { font-size: 24px; }
h4 { font-size: 21px; }
p { margin: 0; }
b, strong { font-weight: 600; }
button { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
.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; }

.app {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0;
  display: flex; flex-direction: column;
  max-width: 520px; margin: 0 auto; background: var(--bg);
}
@media (min-width: 600px) {
  body { background: var(--surface); }
  .app { max-width: 480px; border-left: 1px solid var(--divider); border-right: 1px solid var(--divider); }
}

/* ── header ───────────────────────────────────────────────────────── */
.hdr {
  order: 0; flex: none; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 6px;
}
.brand { color: inherit; text-decoration: none; font-family: var(--font-heading); font-weight: 600; font-size: 19px; letter-spacing: .05em; white-space: nowrap; }
.brand:hover { color: var(--accent-strong); }
.setup-hint { order: 2; flex: none; margin: 2px 14px 8px; padding: 10px; border: 1px solid var(--divider); background: var(--accent-soft); color: var(--accent-soft-text); font-size: 12px; line-height: 1.4; }
.setup-hint[hidden] { display: none; }
.setup-hint .actions { margin-top: 7px; }
.setup-hint .btn { padding: 5px 8px; font-size: 12px; }
.sub { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hdr .tag { flex: none; }
.ml { margin-left: auto; }

.years {
  order: 1; flex: none; display: flex; gap: 4px; padding: 2px 14px 8px;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.years::-webkit-scrollbar { display: none; }
.chip, .tab {
  flex: 1 0 auto; min-width: 64px; cursor: pointer;
  border: 1px solid var(--divider); background: transparent; color: var(--text);
  font-family: var(--font-heading); font-weight: 600; font-size: 14.5px; letter-spacing: .03em;
  padding: 7px 10px; border-radius: 0; -webkit-appearance: none; appearance: none;
}
.chip:hover, .tab:hover { background: var(--surface); }
.chip[aria-current="true"], .tab[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip:active, .tab:active { opacity: .85; }

/* ── scroller ─────────────────────────────────────────────────────── */
.view {
  order: 2; flex: 1; min-height: 0; position: relative;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 0 14px 18px;
}
.sticky-summary { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 0; }

/* ── blueprint cards ──────────────────────────────────────────────── */
.card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 12px; margin-bottom: 14px;
  border: 1px solid var(--divider); border-radius: 0; background: transparent;
}
.card.ledger { background: var(--bg); margin-bottom: 0; }
.card.next { margin-top: 14px; }
.blueprint > .corner { position: absolute; width: 11px; height: 11px; color: var(--mark); pointer-events: none; }
.blueprint > .corner::before, .blueprint > .corner::after { content: ""; position: absolute; background: currentColor; }
.blueprint > .corner::before { left: 5px; top: 0; width: 1px; height: 100%; }
.blueprint > .corner::after { top: 5px; left: 0; width: 100%; height: 1px; }
.blueprint > .corner.tl { top: -6px; left: -6px; }
.blueprint > .corner.tr { top: -6px; right: -6px; }
.blueprint > .corner.bl { bottom: -6px; left: -6px; }
.blueprint > .corner.br { bottom: -6px; right: -6px; }

.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row.base { align-items: baseline; }
.row.end { align-items: flex-end; }
.grow { flex: 1; min-width: 0; }
.kicker { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-strong); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.caps { letter-spacing: .08em; text-transform: uppercase; font-size: 10.5px; }
.rule { height: 1px; background: var(--divider); }

.bignums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.num {
  display: block; font-family: var(--font-heading); font-weight: 600; font-size: 36px; line-height: 1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.num.roll { color: var(--accent-strong); }
.num.lost { color: var(--lost); }
.num-sm { font-family: var(--font-heading); font-weight: 600; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.lbl { display: block; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.advice { font-family: var(--font-heading); font-weight: 500; font-size: 17.5px; line-height: 1.25; text-wrap: balance; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 12px; font-size: 10.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 12px; height: 12px; display: inline-block; border: 1px solid transparent; }
.sw.hitch { background: var(--hitch); }
.sw.pto { background: var(--pto); }
.sw.travel { background: repeating-linear-gradient(45deg, var(--travel-a) 0 3px, var(--travel-b) 3px 6px); }
.sw.home { border-color: var(--home-text); }
.sw.trip { box-shadow: inset 0 0 0 2px var(--trip); }
.sw.seo { background: repeating-linear-gradient(45deg, var(--pto) 0 3px, var(--bg) 3px 6px); border-color: var(--pto-edge); }
.sw.sew { background: var(--hitch); box-shadow: inset 0 0 0 2px var(--accent); }
.sw.ho { background: var(--ho); }
.sw.hol { border-radius: 50%; width: 8px; height: 8px; background: var(--ho); border: 0; margin: 0 2px; }
.legend .glyph { font-size: 10px; font-weight: 700; color: var(--text); }
.viewbar { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.viewbar .seg { display: inline-flex; }
.viewbar .chip { min-width: 0; flex: none; font-size: 12.5px; padding: 5px 12px; }
.viewbar .chip + .chip { margin-left: -1px; }
.payline { font-size: 11px; color: var(--muted); text-align: right; line-height: 1.3; }
.payline b { color: var(--text); font-weight: 600; }
.warn { color: var(--lost); }
.exnote { line-height: 1.3; }
.exnote[hidden] { display: none; }
.center { text-align: center; }

/* ── month grid ───────────────────────────────────────────────────── */
.month { padding: 11px; gap: 7px; margin-bottom: 16px; scroll-margin-top: 8px; }
.month .note { white-space: nowrap; }
.wd { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.wd span { font-size: 9px; text-align: center; letter-spacing: .08em; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cell {
  position: relative; height: 46px; display: flex; align-items: center; justify-content: center;
  margin: 0; padding: 0; border: 1px solid transparent; border-radius: 0; background: transparent;
  font-family: var(--font-body); font-size: 13.5px; font-variant-numeric: tabular-nums;
  color: var(--text); user-select: none; -webkit-user-select: none; -webkit-appearance: none; appearance: none;
  transition: transform .08s ease;
}
html.dense .cell { height: 38px; }
.cell.blank { visibility: hidden; }
.cell.k-hitch { background: var(--hitch); color: var(--hitch-text); border-color: var(--hitch); cursor: pointer; }
.cell.k-travel { background: repeating-linear-gradient(45deg, var(--travel-a) 0 3px, var(--travel-b) 3px 6px); color: var(--travel-text); }
.cell.k-home { color: var(--home-text); border-color: var(--home-edge); }
.cell.pto { background: var(--pto); color: var(--pto-text); border-color: var(--pto-edge); font-weight: 700; }
.cell.trip { box-shadow: inset 0 0 0 2px var(--trip); }
.cell.solid { background: var(--hitch); color: var(--hitch-text); border-color: var(--hitch); }
.cell.k-home, .cell.k-travel { cursor: pointer; }
.cell.mk-seo { background: repeating-linear-gradient(45deg, var(--pto) 0 4px, var(--bg) 4px 8px); color: var(--text); border-color: var(--pto-edge); font-weight: 700; }
.cell.mk-sew { background: var(--hitch); color: var(--hitch-text); border-color: var(--hitch); box-shadow: inset 0 0 0 2px var(--accent); font-weight: 700; }
.cell.mk-ho { background: var(--ho); color: #fff; border-color: var(--ho); font-weight: 700; }
.cell.mk-seo.trip, .cell.mk-sew.trip { box-shadow: inset 0 0 0 2px var(--trip); }
.cell .mk { position: absolute; left: 0; right: 0; bottom: 2px; font-size: 7px; font-style: normal; font-weight: 700; letter-spacing: .06em; line-height: 1; text-align: center; opacity: .95; }
.cell.mk-seo .mk { color: var(--pto-edge); }
.cell .pm { position: absolute; top: 2px; left: 3px; font-size: 8px; font-style: normal; font-weight: 700; line-height: 1; opacity: .85; }
.cell .hm { position: absolute; bottom: 3px; left: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--ho); }
.cell.k-hitch .hm, .cell.solid .hm, .cell.mk-sew .hm { background: #f4c78f; }
html.dense .cell .mk { display: none; }
.cell.today::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 3px; height: 2px; background: currentColor; opacity: .9; }
.cell.k-home.today { border-color: var(--text); }
.cell .dot { position: absolute; top: 3px; right: 3px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .85; }
button.cell:active { transform: scale(.93); }
button.cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }

/* ── year view ────────────────────────────────────────────────────── */
.yv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.ym { display: flex; flex-direction: column; gap: 4px; padding: 6px; margin: 0; border: 1px solid var(--divider); border-radius: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; -webkit-appearance: none; appearance: none; }
.ym:hover { background: var(--surface); }
.ym:active { opacity: .85; }
.ymh { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-heading); font-size: 13px; font-weight: 600; letter-spacing: .03em; }
.ymh .muted { font-size: 10px; font-weight: 500; }
.yg { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.yc { display: block; aspect-ratio: 1; border: 1px solid var(--divider); background: transparent; }
.yc.blank { border-color: transparent; }
.yc.on { background: var(--hitch); border-color: var(--hitch); }
.yc.half-r { background: linear-gradient(90deg, transparent 50%, var(--hitch) 50%); }
.yc.half-l { background: linear-gradient(90deg, var(--hitch) 50%, transparent 50%); }
.yc.travel { background: repeating-linear-gradient(45deg, var(--travel-a) 0 2px, var(--travel-b) 2px 4px); }
.yc.pto { background: var(--pto); border-color: var(--pto-edge); }
.yc.seo { background: repeating-linear-gradient(45deg, var(--pto) 0 2px, var(--bg) 2px 4px); border-color: var(--pto-edge); }
.yc.sew { background: var(--hitch); box-shadow: inset 0 0 0 1px var(--accent); }
.yc.ho { background: var(--ho); border-color: var(--ho); }
.yc.trip { box-shadow: inset 0 0 0 1px var(--trip); }
.yc.today { outline: 2px solid var(--text); outline-offset: -1px; }
@media (max-width: 360px) { .yv { grid-template-columns: repeat(2, 1fr); } }

/* ── tags & buttons ───────────────────────────────────────────────── */
.tag { display: inline-flex; align-items: center; font-size: 11px; letter-spacing: .02em; padding: 3px 9px; border-radius: 0; white-space: nowrap; }
.tag-accent { background: var(--accent-soft); color: var(--accent-soft-text); }
.tag-outline { border: 1px solid var(--accent); color: var(--accent-strong); }
.tag-hol { border: 1px solid var(--ho); color: var(--ho); }
.tag-seo { background: repeating-linear-gradient(45deg, var(--accent-soft) 0 4px, transparent 4px 8px); border: 1px solid var(--pto-edge); color: var(--accent-soft-text); }
.tag-sew { background: var(--hitch); color: var(--hitch-text); box-shadow: inset 0 0 0 1px var(--accent); }
.tag-ho { background: var(--ho); color: #fff; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  font-family: var(--font-heading); font-weight: 600; font-size: 14.5px; letter-spacing: .02em; line-height: 1.2;
  color: var(--text); background: transparent; border: 1px solid var(--divider); border-radius: 0;
  padding: 9px 13px; -webkit-appearance: none; appearance: none; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface); }
.btn:active { opacity: .8; }
.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { border-color: transparent; color: var(--accent-strong); padding-inline: 6px; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── hitch list ───────────────────────────────────────────────────── */
.page-head { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 12px; }
.year-group { display: flex; flex-direction: column; }
.year-head { font-size: 28px; padding: 6px 0 10px; }
.year-group + .year-group .year-head { border-top: 1px solid var(--divider); padding-top: 14px; margin-top: 4px; }
.hitch { padding: 10px 11px; gap: 6px; margin-bottom: 12px; }
.hitch .range { font-family: var(--font-heading); font-weight: 600; font-size: 18px; }
.hitch.current { border-color: var(--accent); }
.hitch.past .range { color: var(--muted); }

/* ── settings ─────────────────────────────────────────────────────── */
.settings { display: flex; flex-direction: column; padding-top: 8px; }
.settings .card { gap: 10px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checks2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.checks2 .check { padding: 4px 0; font-size: 13.5px; }
.presets { display: flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 10.5px; }
.presets .btn { padding: 3px 8px; font-size: 12px; }
.presets .muted { margin-left: 4px; }
.span2 { grid-column: 1 / -1; }
.field > label { display: block; font-size: 12px; margin-bottom: 4px; color: var(--muted); }
.input {
  width: 100%; min-height: 40px; padding: 6px 10px; font: inherit; font-size: 15px;
  color: var(--text); background: var(--surface); caret-color: var(--accent);
  border: 1px solid var(--divider); border-radius: 0; -webkit-appearance: none; appearance: none;
}
.input:hover { border-color: var(--muted); }
.input:focus-visible { border-color: var(--accent); outline: none; }
select.input { padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.input { min-height: 96px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
input[type="date"].input { min-width: 0; }
/* 16px stops iOS Safari zooming the fixed shell when a field is focused. */
@media (pointer: coarse) { .input, select.input, textarea.input { font-size: 16px; } }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; padding: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--divider); font-size: 14px; }
.li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .swap-date, .li .swap-type { flex: 1; min-width: 0; min-height: 36px; padding: 4px 8px; }
.li.swap { align-items: flex-start; padding: 9px 0; }
.li.swap .row { gap: 6px; }
.li.swap .swap-note { display: block; margin-top: 5px; line-height: 1.35; }
.li.swap .btn-ghost { margin-top: 2px; }
.chip-mode { min-width: 0; color: var(--accent-strong); }
.indent { padding-left: 28px; border-left: 1px solid var(--divider); margin: 2px 0 4px 8px; }
.indent .check { padding: 4px 0; }
.indent[hidden] { display: none; }
.paste summary { cursor: pointer; padding: 4px 0; }
.paste[open] summary { margin-bottom: 8px; }
.paste .btn { margin-top: 8px; }
.about { text-align: center; padding: 4px 0 8px; }

/* ── tab bar (before the view in the DOM for keyboard order, last on screen) ── */
.tabs {
  order: 3; flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  border-top: 1px solid var(--divider); background: var(--bg);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
}
.tab { min-width: 0; padding: 9px 6px; font-size: 14.5px; }

/* ── toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom));
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none; z-index: 50;
  max-width: calc(100% - 28px); padding: 9px 14px; text-align: center;
  background: var(--toast-bg); color: var(--toast-text); font-size: 13.5px; line-height: 1.35;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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