/* Packard Stock — iOS-grade shell (same system as the Bay2 campout app, in Packard's colors).
   Full-bleed photo heroes, inset grouped lists, a floating pill tab bar, sheets that slide up. */
:root {
  --bg: #0F1013;
  --card: #1A1C21;
  --card-2: #24272D;
  --sep: rgba(255, 255, 255, .08);
  --text: #F4F4F1;
  --text-2: #A4A7AE;
  --text-3: #74777E;
  --red: #FF020A;
  --tint: #FF4A4F;            /* Packard red, lifted for small text on dark */
  --go: #34D27F;
  --warn: #FFB224;
  --r-lg: 22px; --r-md: 16px; --r-sm: 12px;
  --tab-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow-float: 0 12px 40px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .44, 1);
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Inter', -apple-system, 'SF Pro Text', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { font-family: var(--body); color: var(--text); background: var(--bg); font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  min-height: 100dvh; overscroll-behavior-y: none; padding-bottom: calc(var(--tab-h) + 34px + var(--safe-b)); }
body.no-tabs { padding-bottom: calc(24px + var(--safe-b)); }
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001s !important; transition-duration: .001s !important; } }

.wrap { width: min(100% - 32px, 560px); margin-inline: auto; }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: .95; letter-spacing: .005em; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }

/* ---------- full-bleed photo hero, title over the art ---------- */
.hero { position: relative; overflow: hidden; min-height: clamp(250px, 40vh, 360px); display: flex; align-items: flex-end; isolation: isolate; background: #000; }
.hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(15,16,19,.55) 0%, rgba(15,16,19,0) 30%, rgba(15,16,19,.2) 55%, var(--bg) 100%); }
.hero .in { width: min(100% - 32px, 560px); margin-inline: auto; padding: calc(84px + var(--safe-t)) 0 18px; }
.hero h1 { font-size: clamp(54px, 15vw, 80px); text-transform: uppercase; text-shadow: 0 2px 24px rgba(0,0,0,.5); }
.hero .lead { color: #E3E3DE; text-shadow: 0 1px 12px rgba(0,0,0,.6); margin-top: 6px; font-size: 16px; }
.hero .in > * { animation: rise .7s var(--ease-out) both; }
.hero .in > *:nth-child(2) { animation-delay: .1s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.mark { position: absolute; z-index: 5; left: 16px; top: calc(14px + var(--safe-t)); width: 58px; height: auto; filter: drop-shadow(0 4px 12px rgba(0,0,0,.5)); }
.glass-btn { position: absolute; z-index: 5; right: 14px; top: calc(12px + var(--safe-t)); height: 40px; min-width: 40px; padding: 0 14px; border-radius: 999px;
  background: rgba(26,28,33,.55); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.glass-btn svg { width: 20px; height: 20px; }

/* ---------- pushed pages: compact nav bar + large title ---------- */
.navbar { position: sticky; top: 0; z-index: 30; padding: calc(6px + var(--safe-t)) 8px 6px; display: flex; align-items: center; min-height: calc(52px + var(--safe-t));
  background: rgba(15,16,19,.82); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); border-bottom: 1px solid transparent; transition: border-color .2s; }
.navbar.scrolled { border-bottom-color: var(--sep); }
.navbar .back { display: flex; align-items: center; gap: 2px; color: var(--tint); font-weight: 600; font-size: 17px; padding: 8px 8px 8px 2px; }
.navbar .back svg { width: 24px; height: 24px; }
.navbar .t { position: absolute; left: 50%; transform: translateX(-50%); font-weight: 700; font-size: 17px; opacity: 0; transition: opacity .2s; white-space: nowrap; max-width: 56%; overflow: hidden; text-overflow: ellipsis; }
.navbar.scrolled .t { opacity: 1; }
.large-title { font-family: var(--display); font-weight: 700; font-size: 44px; text-transform: uppercase; line-height: .95; margin: 4px 0 4px; }

/* ---------- sections, inset grouped lists ---------- */
.sec { margin-top: 26px; }
.sec:first-child { margin-top: 8px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 4px 8px; }
.sec-h h2 { font-size: 26px; text-transform: uppercase; }
.sec-h .aside { color: var(--text-2); font-size: 14px; }
.sec-foot { color: var(--text-2); font-size: 13px; margin: 8px 4px 0; }
.list { background: var(--card); border-radius: var(--r-md); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 64px; position: relative; width: 100%; text-align: left; }
.li + .li::before { content: ''; position: absolute; top: 0; right: 0; left: 76px; border-top: 1px solid var(--sep); }
.list.plain .li + .li::before { left: 16px; }
.list.icons .li + .li::before { left: 66px; }
button.li:active, a.li:active { background: var(--card-2); }
.li .main { flex: 1; min-width: 0; }
.li .title { font-weight: 600; font-size: 16px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.li .sub { color: var(--text-2); font-size: 14px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .val { text-align: right; flex-shrink: 0; min-width: 44px; }
.li .val b { display: block; font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.li .val span { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: nowrap; }
.li .val.none b { color: var(--text-3); }
.chev { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; }
.thumb { width: 50px; height: 50px; border-radius: 11px; background: #fff; object-fit: contain; flex-shrink: 0; }
.glyph { width: 50px; height: 50px; border-radius: 11px; background: var(--card-2); display: grid; place-items: center; color: var(--text-2); flex-shrink: 0; }
.glyph svg { width: 26px; height: 26px; }
.gicon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: rgba(255,2,10,.14); color: var(--tint); }
.gicon svg { width: 22px; height: 22px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--card-2); color: var(--text); white-space: nowrap; }
.tag.red { background: rgba(255,2,10,.16); color: var(--tint); }
.tag.go { background: rgba(52,210,127,.15); color: var(--go); }
.tag.warn { background: rgba(255,178,36,.15); color: var(--warn); }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--r-lg); padding: 18px; }
.card + .card { margin-top: 12px; }
.card h3 { font-family: var(--display); font-size: 26px; text-transform: uppercase; line-height: 1; margin-bottom: 6px; }
.card p { color: var(--text-2); font-size: 15px; }
.card .btn { margin-top: 14px; }
.big { font-family: var(--display); font-weight: 700; font-size: 84px; line-height: .9; font-variant-numeric: tabular-nums; }
.big small { font-size: 24px; color: var(--text-2); margin-left: 6px; font-weight: 600; }
.progress { height: 10px; border-radius: 999px; background: var(--card-2); overflow: hidden; margin: 14px 0 4px; }
.progress i { display: block; height: 100%; border-radius: 999px; background: repeating-linear-gradient(61deg, var(--red) 0 8px, #C40007 8px 13px); transition: width .5s var(--ease-out); }
.how .li { align-items: flex-start; padding-top: 14px; padding-bottom: 14px; }
.how .li + .li::before { left: 58px; }
.how .num { width: 30px; height: 30px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.how .li .title { -webkit-line-clamp: unset; }
.how .li .sub { white-space: normal; }

/* ---------- buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 12px 18px; border-radius: 14px;
  background: var(--card-2); color: var(--text); font-weight: 700; font-size: 17px; transition: transform .12s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:active { background: #C40007; }
.btn.go { background: var(--go); color: #062614; }
.btn.tinted { background: rgba(255,2,10,.14); color: var(--tint); }
.btn[disabled] { opacity: .45; }
.btn + .btn { margin-top: 10px; }
.row-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.row-btns .btn { margin-top: 0; min-height: 50px; font-size: 16px; }
.link { color: var(--tint); font-weight: 600; padding: 14px 4px; display: inline-block; }

/* ---------- search ---------- */
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 0 6px 0 12px; height: 44px; }
.search svg { width: 18px; height: 18px; color: var(--text-2); flex-shrink: 0; }
.search input { flex: 1; height: 100%; font-size: 17px; outline: none; min-width: 0; }
.search input::placeholder { color: var(--text-3); }
.search .scan { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--text-2); }
.search .scan svg { width: 22px; height: 22px; }

/* ---------- forms + iOS switches ---------- */
.field { display: block; padding: 10px 16px; position: relative; }
.field span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 2px; }
.field input, .field select { width: 100%; font-size: 17px; outline: none; padding: 4px 0; }
.field select { appearance: none; -webkit-appearance: none; }
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; min-height: 52px; position: relative; cursor: pointer; }
.sw-row + .sw-row::before, .field + .field::before, .field + .sw-row::before, .sw-row + .field::before { content: ''; position: absolute; top: 0; right: 0; left: 16px; border-top: 1px solid var(--sep); }
.sw-row .lbl { flex: 1; }
.sw-row .lbl small { display: block; color: var(--text-2); font-size: 13px; }
input.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 999px; background: #3A3D44; position: relative; flex-shrink: 0; transition: background .2s; cursor: pointer; }
input.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .3s var(--spring); }
input.switch:checked { background: var(--go); }
input.switch:checked::after { transform: translateX(20px); }
.seg { display: flex; background: var(--card-2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 36px; border-radius: 8px; font-weight: 600; font-size: 15px; color: var(--text-2); }
.seg button.on { background: #3A3D44; color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--card-2); font-weight: 600; font-size: 14px; }
.chip:active { background: #3A3D44; }

/* ---------- item page ---------- */
.item-img { background: #fff; border-radius: var(--r-lg); height: 240px; display: grid; place-items: center; overflow: hidden; padding: 12px; }
.item-img img { max-height: 216px; object-fit: contain; }
.item-img.none { background: var(--card); color: var(--text-3); }
.item-img.none svg { width: 64px; height: 64px; }
.item-name { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1; margin-top: 16px; }
.item-meta { color: var(--text-2); margin-top: 6px; }

/* ---------- the counting sheet ---------- */
.sheet-veil { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .3s; }
.sheet-veil.show { opacity: 1; }
.sheet { position: fixed; z-index: 81; left: 0; right: 0; bottom: 0; top: calc(10px + var(--safe-t)); background: var(--bg); border-radius: 22px 22px 0 0;
  transform: translateY(105%); transition: transform .5s var(--spring); display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0,0,0,.5); }
.sheet.show { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: #3A3D44; margin: 8px auto 0; flex-shrink: 0; }
.sheet .bar { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px; min-height: 44px; flex-shrink: 0; }
.sheet .bar .cancel { color: var(--tint); font-weight: 600; padding: 8px 10px; min-width: 76px; text-align: left; }
.sheet .bar .ttl { font-weight: 700; }
.sheet .bar .side { min-width: 76px; text-align: right; color: var(--text-2); font-size: 14px; padding-right: 10px; }
.sheet .body { flex: 1; overflow-y: auto; padding: 0 16px 12px; width: min(100%, 560px); margin-inline: auto; }
.sheet .foot { padding: 10px 16px calc(10px + var(--safe-b)); border-top: 1px solid var(--sep); flex-shrink: 0; }
.sheet .foot .btn { max-width: 528px; margin-inline: auto; }
.c-item { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: var(--r-md); padding: 10px 12px; }
.c-item .thumb, .c-item .glyph { width: 58px; height: 58px; }
.c-item .title { font-weight: 700; line-height: 1.2; }
.c-item .sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.c-note { margin: 10px 2px 0; font-size: 14px; color: var(--text-2); }
.readout { position: relative; margin-top: 12px; background: var(--card); border-radius: 20px; min-height: 116px; display: flex; align-items: baseline; justify-content: flex-end; padding: 4px 18px 8px 34px; overflow: hidden; }
.readout::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 16px; background: repeating-linear-gradient(-29deg, var(--red) 0 6px, transparent 6px 11px); }
.readout .n { font-family: var(--display); font-weight: 700; font-size: 108px; line-height: 1; font-variant-numeric: tabular-nums; }
.readout .n.empty { color: #33363D; }
.readout .u { font-family: var(--display); font-size: 22px; color: var(--text-2); margin-left: 8px; }
.nudge { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 8px; }
.nudge button { min-height: 50px; border-radius: 14px; background: var(--card); font-family: var(--display); font-weight: 700; font-size: 24px; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keys button { min-height: 58px; border-radius: 16px; background: var(--card-2); font-family: var(--display); font-weight: 600; font-size: 34px; }
.keys button:active, .nudge button:active { background: #3A3D44; }
.keys button.fn { background: transparent; font-family: var(--body); font-size: 16px; font-weight: 600; color: var(--text-2); }
.photo-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.photo-row .btn { margin-top: 0; min-height: 46px; font-size: 15px; }
.photo-row img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; }

/* ---------- PIN screen ---------- */
.dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 22px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--text-2); }
.dots i.on { background: var(--red); border-color: var(--red); }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-big { font-family: var(--display); font-weight: 700; font-size: 64px; letter-spacing: .08em; text-align: center; }

/* ---------- review ---------- */
.counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.counts .c { background: var(--card-2); border-radius: 12px; padding: 6px 12px; display: flex; align-items: center; gap: 10px; }
.counts .c img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.counts .c b { font-family: var(--display); font-size: 28px; }
.choice { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px; }
.choice button { min-width: 64px; min-height: 48px; border-radius: 12px; background: var(--card-2); font-family: var(--display); font-weight: 700; font-size: 26px; padding: 0 10px; }
.choice button.on { background: rgba(52,210,127,.18); color: var(--go); box-shadow: inset 0 0 0 2px var(--go); }
.rv-head { display: flex; gap: 12px; align-items: center; }
.rv-head .title { font-weight: 700; line-height: 1.2; }
.rv-head .sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }

/* ---------- floating pill tab bar (Bay2 campout pattern) ---------- */
.tabbar { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); width: min(100% - 24px, 440px); height: var(--tab-h);
  border-radius: 999px; background: rgba(26,28,33,.80); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.10); box-shadow: var(--shadow-float); display: flex; align-items: center; padding: 6px; }
.tabbar[hidden] { display: none; }
.tabbar .hl { position: absolute; top: 6px; bottom: 6px; left: 6px; width: 60px; border-radius: 999px; background: rgba(255,255,255,.10); transition: transform .42s var(--spring), width .3s var(--ease-out); pointer-events: none; }
.tabbar a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%; border-radius: 999px;
  color: #9A9DA4; font: 700 11px var(--body); letter-spacing: .01em; transition: color .25s, transform .15s; }
.tabbar a:active { transform: scale(.92); }
.tabbar a svg { width: 24px; height: 24px; transition: transform .35s var(--spring); }
.tabbar a[aria-current] { color: var(--text); }
.tabbar a[aria-current] svg { color: var(--red); transform: translateY(-1px); }
.tabbar .badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* ---------- HUD toast + scanner ---------- */
#toast { position: fixed; z-index: 95; left: 50%; top: calc(14px + var(--safe-t)); transform: translate(-50%, -30px); opacity: 0; pointer-events: none;
  background: rgba(244,244,241,.96); color: #0F1013; font-weight: 600; font-size: 15px; padding: 11px 18px; border-radius: 999px; max-width: 92vw; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: transform .45s var(--spring), opacity .25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); color: #fff; }
.scanner { position: fixed; inset: 0; background: #000; z-index: 99; display: flex; flex-direction: column; }
.scanner video { flex: 1; width: 100%; object-fit: cover; }
.scanner .frame { position: absolute; left: 10%; right: 10%; top: 32%; height: 22%; border: 3px solid var(--red); border-radius: 16px; pointer-events: none; }
.scanner .bar { padding: 16px 16px calc(16px + var(--safe-b)); background: var(--bg); }
.empty { text-align: center; padding: 30px 12px; color: var(--text-2); }
.spin { width: 28px; height: 28px; border: 3px solid var(--card-2); border-top-color: var(--red); border-radius: 50%; animation: sp .8s linear infinite; margin: 60px auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mark { width: 74px; }
