/* Packing — styles. Light first (he packs at home in daylight); dark follows the phone. */
@font-face { font-family: "Plus Jakarta Sans"; src: url("fonts/PlusJakartaSans.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/Fraunces.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --bg: #F3F5F8;
  --bg-2: #E9EDF2;
  --card: #FFFFFF;
  --ink: #14202A;
  --muted: #66727F;
  --faint: #9AA6B2;
  --line: #E3E8ED;
  --line-strong: #C9D2DA;
  --sea: #0F7C86;
  --sea-ink: #0A5C64;
  --sea-soft: #E1F1F2;
  --buoy: #E4620E;
  --buoy-soft: #FCEBDD;
  --sand: #F6EFDF;
  --sand-ink: #5E4C2A;
  --off: #A9B3BD;
  --tally-empty: #DCE2E8;
  --shadow: 0 1px 2px rgba(20,32,42,.04), 0 10px 28px -14px rgba(20,32,42,.22);
  --shadow-sm: 0 1px 2px rgba(20,32,42,.05), 0 4px 12px -6px rgba(20,32,42,.14);
  --r: 18px;
  --r-sm: 13px;
  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
  --aside: #C98A1B;        /* stage 1: set aside */
  --aside-soft: #FBEFD6;
  --stagecol: var(--sea);  /* the colour of the stage in view */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1418; --bg-2: #151D23; --card: #182129; --ink: #E9EEF2; --muted: #9AA7B2; --faint: #66737F;
    --line: #253039; --line-strong: #35424D; --sea: #3DB4BD; --sea-ink: #7FD3DA; --sea-soft: #123B40;
    --buoy: #F47E3E; --buoy-soft: #3E2415; --sand: #2C271E; --sand-ink: #E6DAC0;
    --off: #5B6873; --tally-empty: #2A363F; --aside: #E3A83A; --aside-soft: #3B2E12;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 28px -14px rgba(0,0,0,.6);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 4px 12px -6px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
    --bg: #0E1418; --bg-2: #151D23; --card: #182129; --ink: #E9EEF2; --muted: #9AA7B2; --faint: #66737F;
    --line: #253039; --line-strong: #35424D; --sea: #3DB4BD; --sea-ink: #7FD3DA; --sea-soft: #123B40;
    --buoy: #F47E3E; --buoy-soft: #3E2415; --sand: #2C271E; --sand-ink: #E6DAC0;
    --off: #5B6873; --tally-empty: #2A363F;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 28px -14px rgba(0,0,0,.6);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 4px 12px -6px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 16px; line-height: 1.4; -webkit-font-smoothing: antialiased;
  padding-top: var(--sat); padding-bottom: calc(var(--sab) + 28px);
  overscroll-behavior-y: none;
}
body.has-nav { padding-bottom: calc(var(--sab) + var(--nav-h) + 24px); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; border-radius: 8px; }
a { color: var(--sea); }
[hidden] { display: none !important; }
svg { flex: none; }
.ico .f { fill: currentColor; fill-opacity: .16; }
.ci { width: 30px; height: 30px; border-radius: 10px; background: var(--sea-soft); color: var(--sea-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }

#app { max-width: 620px; margin: 0 auto; padding: 0 16px; }

/* ---------- type ---------- */
.eyebrow { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 6; padding: 12px 16px 10px; margin: 0 -16px;
  display: flex; align-items: center; gap: 10px; min-height: 60px;
  background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .bar { background: var(--bg); } }
.bar .title { flex: 1; min-width: 0; }
.bar h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .sub { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.bar.home { padding-top: 26px; padding-bottom: 8px; position: static; background: none; backdrop-filter: none; }
.bar.home h1 { font-size: 2.4rem; white-space: normal; }
.bar.home .sub { font-size: .95rem; margin-top: 4px; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); background: var(--card); box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn:active { transform: scale(.94); }
.iconbtn.theme { position: relative; }
.iconbtn.theme .tl { position: absolute; bottom: -1px; right: -1px; font-size: .5rem; font-weight: 800; letter-spacing: .02em; background: var(--sea); color: #fff; border-radius: 5px; padding: 1px 3px; line-height: 1.1; text-transform: uppercase; }

/* ---------- generic ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; border: 1px solid var(--line); }
.chead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.chead .ic { width: 34px; height: 34px; border-radius: 11px; background: var(--sea-soft); color: var(--sea-ink); display: inline-flex; align-items: center; justify-content: center; }
.chead .ic svg { width: 18px; height: 18px; }
.chead b { font-weight: 700; font-size: .98rem; display: block; }
.chead span { display: block; font-size: .78rem; color: var(--muted); }
.stack > * + * { margin-top: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 700; font-size: .95rem;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--sea); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px rgba(15,124,134,.7); }
.btn.wide { width: 100%; }
.btn.quiet { box-shadow: none; background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--buoy); }
.btn.buyon { background: var(--buoy-soft); color: var(--buoy); border-color: transparent; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .85rem; border-radius: 11px; }
.btn:active { transform: scale(.985); }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; font-size: .95rem; }
.empty svg { width: 40px; height: 40px; color: var(--faint); display: block; margin: 0 auto 10px; }

/* ---------- rings ---------- */
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--tally-empty); }
.ring .fill { stroke: var(--sea); transition: stroke-dashoffset .45s ease; }
.ring .aside { stroke: var(--aside); transition: stroke-dashoffset .45s ease; }
.ring .pct { position: absolute; font-family: var(--mono); font-size: .72rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ring.done .pct { color: var(--sea-ink); }

/* ---------- home ---------- */
.trip {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 16px 16px 16px 18px;
}
.trip .name { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; letter-spacing: -.01em; line-height: 1.15; }
.trip .meta { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.trip .stat { font-size: .8rem; color: var(--muted); margin-top: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.trip .stat b { color: var(--ink); font-weight: 700; }
.trip .stat .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.trip .stat .buy { color: var(--buoy); font-weight: 700; }
.trip .side { display: grid; gap: 10px; justify-items: center; }
.cardbtns { display: flex; gap: 6px; }
.iconbtn.sm { width: 36px; height: 36px; border-radius: 11px; }
.iconbtn.sm.del { color: var(--buoy); }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preset {
  text-align: left; background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  display: grid; gap: 8px; align-content: start; min-height: 118px;
}
.preset .ic { width: 36px; height: 36px; border-radius: 12px; background: var(--sea-soft); color: var(--sea-ink); display: inline-flex; align-items: center; justify-content: center; }
.preset .ic svg { width: 20px; height: 20px; }
.preset b { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.15; }
.preset span { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.preset .days { font-family: var(--mono); font-size: .72rem; color: var(--faint); }
.preset:active { transform: scale(.98); }
.linkcard { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 14px 16px; }
.linkcard .ic { width: 36px; height: 36px; border-radius: 12px; background: var(--sea-soft); color: var(--sea-ink); display: inline-flex; align-items: center; justify-content: center; }
.linkcard .ic svg { width: 18px; height: 18px; }
.linkcard b { display: block; font-weight: 700; }
.linkcard span { font-size: .8rem; color: var(--muted); }
.linkcard .chev { margin-left: auto; color: var(--faint); }
.rowbtns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.version { text-align: center; color: var(--faint); font-size: .7rem; margin-top: 18px; font-family: var(--mono); }
.notes-edit { width: 100%; min-height: 96px; resize: vertical; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; padding: 8px 12px calc(var(--sab) + 8px);
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .nav { background: var(--card); } }
.nav .in { max-width: 620px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.nav button { display: grid; justify-items: center; gap: 3px; padding: 6px 4px; border-radius: 12px; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.nav button svg { width: 22px; height: 22px; }
.nav button.on { color: var(--sea-ink); background: var(--sea-soft); }
.nav button .f { fill-opacity: 0; }
.nav button.on .f { fill-opacity: .22; }

/* ---------- setup ---------- */
.field { display: block; }
.field > .lbl { font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; display: block; }
.input {
  width: 100%; min-height: 46px; padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--bg); color: var(--ink);
}
.input:focus { border-color: var(--sea); outline: none; box-shadow: 0 0 0 3px var(--sea-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 8px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 14px; padding: 4px; border: 1px solid var(--line); }
.stepper button { width: 38px; height: 38px; border-radius: 10px; background: var(--card); box-shadow: var(--shadow-sm); font-size: 1.25rem; font-weight: 600; }
.stepper button:disabled { opacity: .4; }
.stepper .val { min-width: 44px; text-align: center; font-family: var(--mono); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; }
.switch-row + .switch-row { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.switch-row .t { font-weight: 700; font-size: .95rem; }
.switch-row .h { font-size: .78rem; color: var(--muted); margin-top: 1px; }
.switch { width: 52px; height: 32px; border-radius: 16px; background: var(--line-strong); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch.on { background: var(--sea); }
.switch.on::after { transform: translateX(20px); }
.wx { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wx button { display: grid; justify-items: center; gap: 4px; padding: 12px 4px 10px; border-radius: var(--r-sm); background: var(--bg); border: 1.5px solid transparent; color: var(--muted); font-size: .8rem; font-weight: 700; }
.wx button svg { width: 24px; height: 24px; color: var(--sea-ink); }
.wx button small { font-weight: 500; font-size: .66rem; color: var(--faint); }
.wx button.on { background: var(--sea-soft); border-color: var(--sea); color: var(--sea-ink); }
.wx button.on small { color: var(--sea-ink); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile {
  text-align: left; border-radius: var(--r-sm); padding: 12px; background: var(--bg); border: 1.5px solid transparent; min-height: 64px;
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
}
.tile .ic { width: 32px; height: 32px; border-radius: 10px; background: var(--card); color: var(--sea-ink); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.tile .ic svg { width: 18px; height: 18px; }
.tile b { display: block; font-weight: 700; font-size: .92rem; }
.tile span { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.tile.on { background: var(--sea-soft); border-color: var(--sea); }
.tile.on b { color: var(--sea-ink); }
.tile.on .ic { background: var(--sea); color: #fff; box-shadow: none; }
.tile.on .ic .f { fill-opacity: .28; }

/* ---------- list: overview ---------- */
.overview { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 14px 16px 12px; }
.overview .top { display: flex; align-items: center; gap: 14px; }
.overview .top > div { min-width: 0; flex: 1; }
.overview .big { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; line-height: 1; letter-spacing: -.01em; }
.overview .big small { font-family: var(--sans); font-weight: 600; font-size: .85rem; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.overview .line2 { font-size: .8rem; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.overview .line2 .buy { color: var(--buoy); font-weight: 700; }
.line2 .chip { font: inherit; color: var(--buoy); font-weight: 700; border: 1px solid transparent; border-radius: 8px; padding: 1px 7px; margin: -1px 0; background: var(--buoy-soft); }
.line2 .chip.on { background: var(--buoy); color: #fff; }
.overview .line2 .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.stages { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.stages button { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 13px; background: var(--bg); border: 1.5px solid transparent; text-align: left; color: var(--muted); }
.stages button b { width: 22px; height: 22px; border-radius: 50%; background: var(--card); color: var(--muted); font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center; box-shadow: var(--shadow-sm); }
.stages button span { font-weight: 700; font-size: .88rem; }
.stages button i { font-style: normal; font-family: var(--mono); font-size: .72rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.stages button.on { border-color: var(--stagecol); background: color-mix(in srgb, var(--stagecol) 12%, var(--card)); color: var(--ink); }
.stages button.on b { background: var(--stagecol); color: #fff; box-shadow: none; }
.stages button.on i { color: var(--ink); }
.filters { display: flex; background: var(--bg); border-radius: 13px; padding: 3px; gap: 2px; margin-top: 10px; }
.filters button { flex: 1 1 0; min-width: 0; min-height: 36px; border-radius: 10px; font-weight: 700; color: var(--muted); font-size: .72rem; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filters button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.cats button { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; border-radius: 12px; background: var(--bg); border: 1px solid transparent; }
.cats button .e { color: var(--sea-ink); display: inline-flex; padding: 2px 0 1px; }
.cats button .n { font-size: .62rem; font-weight: 700; color: var(--muted); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cats button .c { font-family: var(--mono); font-size: .66rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.cats button .bar2 { width: 70%; height: 3px; border-radius: 2px; background: var(--tally-empty); overflow: hidden; margin-top: 2px; position: relative; }
.cats button .bar2 i { position: absolute; left: 0; top: 0; height: 100%; background: var(--sea); }
.cats button .bar2 i.a { background: var(--aside); }
.cats button.done { background: color-mix(in srgb, var(--stagecol) 14%, var(--card)); }
.cats button.done .c { color: var(--stagecol); }
.cats button:active { transform: scale(.96); }

/* ---------- list: sections ---------- */
.sec { margin-top: 18px; scroll-margin-top: 74px; }
.sechead { width: 100%; text-align: left; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 6px 4px; }
.sechead .ci { width: 30px; height: 30px; }
.sechead .t { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.sechead .n { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sechead .chev { transition: transform .2s; color: var(--faint); }
.sec.collapsed .chev { transform: rotate(-90deg); }
.tally { display: flex; flex-wrap: wrap; gap: 3px; margin: 0 4px 6px 44px; }
.tally i { width: 8px; height: 8px; border-radius: 2.5px; background: var(--tally-empty); transition: background .25s; }
.tally i.on { background: var(--stagecol); }
.tally i.part { background: var(--stagecol); opacity: .45; }
.tally i.buy { background: var(--buoy-soft); }
.tally i.buy.on { background: var(--sea); }
.sec.collapsed .rows, .sec.collapsed .addwrap, .sec.collapsed .reason { display: none; }
.sec.collapsed .tally { margin-bottom: 2px; }

.rows { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.row { border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .main { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; min-height: 60px; }
.tick { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 60px; }
.tick i {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); display: block; position: relative;
  transition: background .18s, border-color .18s, transform .18s;
}
.row.packed .tick i { background: var(--stagecol); border-color: var(--stagecol); animation: pop .28s ease; }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.row.packed .tick i::after {
  content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.tick:active i { transform: scale(.9); }
.row .body { text-align: left; padding: 10px 10px 10px 0; min-width: 0; }
.row .name { font-weight: 600; font-size: .98rem; letter-spacing: -.005em; line-height: 1.25; }
.row .why { font-size: .78rem; color: var(--muted); margin-top: 2px; line-height: 1.3; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.row .qty { font-family: var(--mono); font-size: .8rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line); padding: 3px 9px; border-radius: 9px; font-variant-numeric: tabular-nums; margin-right: 14px; }
.qstep { display: inline-flex; align-items: center; gap: 2px; margin-right: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 2px; }
.qstep button { width: 30px; height: 30px; border-radius: 8px; font-size: 1.05rem; font-weight: 700; color: var(--muted); }
.qstep2 { display: grid; gap: 4px; margin-right: 10px; padding: 6px 0; }
.qstep2 .qstep { margin: 0; }
.qstep2 .qstep button { width: 26px; height: 26px; font-size: .95rem; }
.qstep2 .qn { min-width: 62px; text-align: left; padding-left: 4px; }
.qstep .qn em { font-style: normal; font-family: var(--sans); font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin-left: 4px; }
.qstep.a .qn b { color: var(--aside); }
.qstep.p .qn b { color: var(--sea-ink); }
.qstep.a .qn em { color: var(--aside); }
.qstep.p .qn em { color: var(--sea-ink); }
.qstep button:active { background: var(--card); }
.qstep button:disabled { opacity: .3; }
.qstep .qn { min-width: 38px; text-align: center; font-family: var(--mono); font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.qstep .qn b { color: var(--ink); font-weight: 700; }
.qstep .qn.over b { color: var(--sea-ink); }
.row.packed .qstep .qn b { color: var(--sea-ink); }
body.stage-aside .row.packed .qstep .qn b { color: var(--aside); }
.badge.aside { background: var(--aside-soft); color: var(--aside); }
.badge.packed { background: var(--sea-soft); color: var(--sea-ink); }
.row .qty.over { color: var(--sea-ink); background: var(--sea-soft); border-color: transparent; }
.row.packed .name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.row.part .tick i { border-color: var(--stagecol); }
.row.aside .tick i { background: var(--aside); border-color: var(--aside); animation: pop .28s ease; }
.row.aside .tick i::after { content: ""; position: absolute; left: 6px; top: 10px; width: 10px; height: 2.5px; background: #fff; border-radius: 2px; }
.row.part.aside .tick i { border-color: var(--aside); }
.tally i.aside { background: var(--aside); }
.tally i.worn { background: var(--ink); }
.row.worn .tick i { background: var(--ink); border-color: var(--ink); }
.row.worn .tick i::after { content: ""; position: absolute; left: 8px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 8px 0 -1px #fff; border: 0; transform: none; }
.row.worn .name { color: var(--muted); }
.badge.worn { background: var(--ink); color: var(--bg); }
.line2 .worncount, .stat .worncount { color: var(--ink); font-weight: 700; }
.line2 .chip.worncount { background: var(--bg-2); color: var(--ink); }
.line2 .chip.worncount.on { background: var(--ink); color: var(--bg); }
.btn.wornon { background: var(--ink); color: var(--bg); border-color: transparent; }
.stepper.worn .lbl { font-size: .72rem; font-weight: 700; color: var(--muted); padding: 0 8px 0 4px; letter-spacing: .04em; text-transform: uppercase; }
.tally i.apart { background: var(--aside); opacity: .45; }
.line2 .asidecount, .stat .asidecount { color: var(--aside); font-weight: 700; }
.row.off .name, .row.off .why { color: var(--off); }
.row.off .tick i { border-style: dashed; }
.badge { font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; line-height: 1.3; }
.badge.buy { background: var(--buoy-soft); color: var(--buoy); }
.badge.shared { background: var(--bg-2); color: var(--muted); }
.badge.opt { background: var(--bg-2); color: var(--faint); }

.detail { padding: 2px 16px 14px 54px; font-size: .88rem; background: var(--bg); border-top: 1px dashed var(--line); }
.detail p { margin: 10px 0 0; }
.detail .why2 { color: var(--muted); }
.detail .controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.detail .stepper { background: var(--card); }
.detail .stepper button { width: 34px; height: 34px; background: var(--bg); box-shadow: none; border: 1px solid var(--line); }
.detail .note { margin-top: 10px; }
.detail .note .input { min-height: 40px; font-size: .88rem; background: var(--card); }
.addwrap { margin-top: 8px; }
.addbtn { width: 100%; min-height: 42px; border-radius: var(--r-sm); border: 1.5px dashed var(--line-strong); color: var(--muted); font-weight: 600; font-size: .85rem; display: flex; align-items: center; justify-content: center; gap: 6px; }
.addbtn svg { width: 16px; height: 16px; }
.addrow { display: flex; gap: 8px; }
.addrow .input { min-height: 42px; background: var(--card); }
.addrow .btn { min-height: 42px; }
.reason { font-size: .78rem; color: var(--off); padding: 6px 12px; }
.footer-actions { margin-top: 24px; display: grid; gap: 8px; }

/* ---------- backups ---------- */
.snaps { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.snap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: .92rem; }
.snap:first-child { border-top: 0; }
.snap .small { margin-top: 2px; }

/* ---------- logic ---------- */
.logic { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 0 16px; }
.logic summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.logic summary::-webkit-details-marker { display: none; }
.logic summary .k { font-family: var(--serif); font-weight: 600; color: var(--sea-ink); margin-right: 8px; }
.logic summary::after { content: "+"; color: var(--faint); font-weight: 600; font-size: 1.1rem; }
.logic[open] summary::after { content: "\2013"; }
.lbody { padding: 0 0 14px; font-size: .92rem; }
.lbody p { margin: 0 0 8px; }
.lbody ul { margin: 0; padding-left: 18px; }
.lbody li + li { margin-top: 8px; }
.lbody .ex { display: block; color: var(--muted); font-size: .84rem; }
.ltable { margin-top: 10px; }
.lcat { font-weight: 700; margin: 12px 0 6px; display: flex; align-items: center; gap: 8px; }
.lcat .ci { width: 26px; height: 26px; border-radius: 8px; }
.lrow { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.lrow .ln { font-weight: 600; }
.lrow .lq { font-family: var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.lrow .lr { grid-column: 1 / -1; color: var(--muted); }
.lrow .lr i { font-style: normal; color: var(--faint); }
.lrow.off .ln { color: var(--off); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--sab) + 18px); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-size: .9rem; z-index: 50;
  box-shadow: var(--shadow); max-width: 90vw;
}
body.has-nav .toast { bottom: calc(var(--sab) + var(--nav-h) + 14px); }
.toast button { color: inherit; font-weight: 800; margin-left: 12px; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 360px) { .cats { grid-template-columns: repeat(3, 1fr); } .presets { grid-template-columns: 1fr; } }
@media (min-width: 560px) { .tiles { grid-template-columns: 1fr 1fr 1fr; } .cats { grid-template-columns: repeat(6, 1fr); } }
