/* Boomstick — navy with brass accents. Same component set as Ration and Pantry. */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #e9edf4;
  --border: #d9dfea;
  --text: #131a2a;
  --muted: #5d6679;
  --accent: #1f3a68;
  --accent-ink: #ffffff;
  --accent-soft: #e1e8f4;
  --brass: #9c6f1e;
  --brass-bright: #c4922f;
  --brass-soft: #f5ead3;
  --hero: #1f3a68;
  --hero-2: #14294d;
  --hero-ink: #ffffff;
  --hero-muted: #b9c8e3;
  --ok: #2b7a4b;  --ok-soft: #dff1e6;
  --warn: #a15800; --warn-soft: #fbecd6;
  --bad: #b3261e; --bad-soft: #fbe3e1;
  --idle: #7d8597; --idle-soft: #eceef3;
  --bar: #3d5f9c; --bar-2: #c4922f;
  --shadow: 0 1px 2px rgba(10,20,40,.06), 0 4px 16px rgba(10,20,40,.06);
  --radius: 14px;
  --tabbar: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1220; --surface: #141c2d; --surface-2: #1c263b; --border: #28344e; --text: #e6ebf4; --muted: #98a3ba;
    --accent: #8db0ec; --accent-ink: #0c1220; --accent-soft: #1d2c4a; --brass: #e0b25a; --brass-bright: #e8bd66; --brass-soft: #372b15;
    --hero: #18294a; --hero-2: #101c35; --hero-ink: #f2f5fb; --hero-muted: #9fb2d4;
    --ok: #6fcf97; --ok-soft: #173525; --warn: #e8a54b; --warn-soft: #3a2c17; --bad: #f07b72; --bad-soft: #3d2120;
    --idle: #8f97a8; --idle-soft: #232b3b; --bar: #6f93d6; --bar-2: #e0b25a;
    --shadow: 0 1px 2px rgba(0,0,0,.45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1220; --surface: #141c2d; --surface-2: #1c263b; --border: #28344e; --text: #e6ebf4; --muted: #98a3ba;
  --accent: #8db0ec; --accent-ink: #0c1220; --accent-soft: #1d2c4a; --brass: #e0b25a; --brass-bright: #e8bd66; --brass-soft: #372b15;
  --hero: #18294a; --hero-2: #101c35; --hero-ink: #f2f5fb; --hero-muted: #9fb2d4;
  --ok: #6fcf97; --ok-soft: #173525; --warn: #e8a54b; --warn-soft: #3a2c17; --bad: #f07b72; --bad-soft: #3d2120;
  --idle: #8f97a8; --idle-soft: #232b3b; --bar: #6f93d6; --bar-2: #e0b25a;
  --shadow: 0 1px 2px rgba(0,0,0,.45); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack > * + * { margin-top: 12px; }
.stack.tight > * + * { margin-top: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.caps { text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; font-weight: 700; color: var(--muted); }

/* ---------- layout */
#app { max-width: 820px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tabbar) + var(--safe-bottom) + 24px); }
.topbar {
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 10px; display: flex; align-items: center; gap: 8px;
}
.topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.topbar .brand svg { width: 42px; height: 42px; flex: none; }
.content { padding: 4px 16px 16px; }
.section { margin-top: 18px; }
.section.tight { margin-top: 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 8px; }
.section-head h2 { font-size: 1rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 14px; }
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 52px; border-top: 1px solid var(--border); }
.list > .item:first-child { border-top: 0; }
.item.tap { cursor: pointer; }
.item.tap:active { background: var(--surface-2); }
a.item { color: inherit; text-decoration: none; }
.item .title { font-weight: 560; }
.item .sub { font-size: .83rem; color: var(--muted); }
.item .end { text-align: right; flex: none; }
.item > svg, .item > span > svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); }
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.thumb svg { width: 24px; height: 24px; }

/* ---------- tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding-bottom: var(--safe-bottom);
}
.tabbar nav { max-width: 820px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 600; }
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--accent); }
.tab .badge { position: absolute; top: 7px; left: calc(50% + 6px); background: var(--bad); color: #fff; border-radius: 9px;
  font-size: .65rem; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; }

/* ---------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.brass { background: var(--brass-bright); color: #1b1406; border-color: var(--brass-bright); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .88rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 0; background: transparent;
  cursor: pointer; color: var(--text); flex: none; text-decoration: none; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn.small svg { width: 18px; height: 18px; }
.icon-btn.accent { color: var(--accent); }
.icon-btn.boxed { border: 1px solid var(--border); background: var(--surface); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }

.field { display: block; }
.field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin: 0 2px 5px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); outline: none; font-size: 16px;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.code { font-size: 1.5rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.search { position: relative; }
.search .input { padding-left: 38px; padding-right: 48px; }
.search > span svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .icon-btn { position: absolute; right: 2px; top: 1px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 40px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.multi { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; min-height: 46px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); align-items: center; }
.multi .tag { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--text); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: .88rem; font-weight: 560; }
.multi .tag button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; font-size: 1rem; line-height: 1; }
.multi select { border: 0; background: transparent; min-height: 32px; flex: 1; min-width: 120px; outline: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 7px 13px;
  font-size: .86rem; font-weight: 560; cursor: pointer; color: var(--text); text-decoration: none; white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.idle { background: var(--idle-soft); color: var(--idle); }
.pill.navy { background: var(--accent-soft); color: var(--accent); }
.pill.brass { background: var(--brass-soft); color: var(--brass); }
.note { border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.info { background: var(--accent-soft); color: var(--text); }

.fab {
  position: fixed; right: max(16px, calc(50vw - 410px + 16px)); bottom: calc(var(--tabbar) + var(--safe-bottom) + 16px); z-index: 15;
  width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 20px rgba(10,20,40,.25); display: grid; place-items: center; cursor: pointer;
}
.fab svg { width: 26px; height: 26px; }

/* ---------- home */
.hero { background: linear-gradient(145deg, var(--hero), var(--hero-2)); color: var(--hero-ink); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.hero .lbl { color: var(--hero-muted); font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.hero .big { font-size: 2.1rem; font-weight: 760; letter-spacing: -.02em; line-height: 1.1; margin: 2px 0 12px; }
.hero .split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid rgba(255,255,255,.14); padding-top: 12px; }
.hero .split .v { font-weight: 700; font-size: 1.02rem; }
.hero .split .k { color: var(--hero-muted); font-size: .74rem; font-weight: 600; }
.hero .brass-line { color: var(--brass-bright); }
.hero .seg { background: rgba(255,255,255,.1); margin-top: 12px; }
.hero .seg button { color: var(--hero-muted); }
.hero .seg button.on { background: rgba(255,255,255,.18); color: var(--hero-ink); box-shadow: none; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); display: block; }
.tile .v { font-size: 1.45rem; font-weight: 740; letter-spacing: -.01em; }
.tile .k { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tile .s { font-size: .78rem; color: var(--muted); }

/* caliber bars */
.bars > a, .bars > div { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 14px;
  border-top: 1px solid var(--border); text-decoration: none; color: var(--text); }
.bars > :first-child { border-top: 0; }
.bars .name { font-weight: 560; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 9px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bars .fill { height: 100%; border-radius: 6px; background: var(--bar); }
.bars.brass .fill { background: var(--bar-2); }
.bars .val { font-weight: 650; font-size: .9rem; min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.bars .low .fill { background: var(--bad); }
.bars .low .val { color: var(--bad); }

/* ---------- gun card */
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: thin; }
.gallery img { height: 220px; width: auto; max-width: 88vw; border-radius: 14px; object-fit: cover; scroll-snap-align: start; cursor: zoom-in; background: var(--surface-2); flex: none; }
.gallery .add { height: 220px; width: 150px; border: 2px dashed var(--border); border-radius: 14px; display: grid; place-items: center; color: var(--muted);
  cursor: pointer; background: var(--surface); flex: none; text-align: center; font-weight: 600; font-size: .9rem; }
.gallery .add svg { width: 28px; height: 28px; display: block; margin: 0 auto 6px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); }
.facts > div { padding: 10px 14px; border-top: 1px solid var(--border); min-width: 0; }
.facts > div:nth-child(-n+2) { border-top: 0; }
.facts > div:nth-child(odd) { border-right: 1px solid var(--border); }
.facts .k { font-size: .74rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts .v { font-weight: 600; overflow-wrap: anywhere; }
.facts .wide { grid-column: 1 / -1; border-right: 0 !important; }
.ammo-card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ammo-card .rounds { font-size: 1.6rem; font-weight: 760; letter-spacing: -.02em; color: var(--brass); }
.serial { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
details.orig summary { cursor: pointer; color: var(--muted); font-size: .85rem; font-weight: 600; }
details.orig p { margin-top: 6px; font-size: .85rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.lightbox .icon-btn { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); color: #fff; background: rgba(0,0,0,.4); }
.lightbox .close { right: 10px; }
.lightbox .prev { left: 10px; top: 50%; }
.lightbox .next { right: 10px; top: 50%; }
.lightbox .cap { position: absolute; bottom: calc(var(--safe-bottom) + 16px); left: 0; right: 0; text-align: center; color: #fff; font-size: .9rem; }

/* ---------- ammo */
.qty { display: grid; grid-template-columns: 54px 1fr 54px; gap: 8px; align-items: center; }
.qty .btn { min-height: 54px; font-size: 1.4rem; padding: 0; }
.qty .input { text-align: center; font-size: 1.5rem; font-weight: 700; min-height: 54px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick .chip { padding: 6px 12px; }
.adj { display: flex; gap: 6px; flex: none; }
.adj .icon-btn { border: 1px solid var(--border); background: var(--surface); width: 38px; height: 38px; border-radius: 10px; }

/* ---------- places */
.tree .item { padding-left: calc(14px + var(--depth, 0) * 18px); }
.tree .kind-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.tree .kind-ic svg { width: 17px; height: 17px; }
.tree .kind-ic.safe { background: var(--brass-soft); color: var(--brass); }
.codebox { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.35rem; font-weight: 700; letter-spacing: .08em;
  background: var(--brass-soft); color: var(--brass); border-radius: 10px; padding: 6px 12px; display: inline-block; }
.lock-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--brass-soft); color: var(--brass); font-weight: 600; }
.lock-banner svg { width: 20px; height: 20px; flex: none; }

/* ---------- sheets, toasts */
.scrim { position: fixed; inset: 0; background: rgba(5,10,20,.45); z-index: 40; opacity: 0; transition: opacity .18s; }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 640px; margin: 0 auto;
  background: var(--bg); border-radius: 20px 20px 0 0; max-height: 92vh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -8px 30px rgba(0,0,0,.2);
}
.sheet.tall { height: 92vh; }
.sheet.show { transform: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 8px 18px; }
.sheet-head h2 { flex: 1; font-size: 1.1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { overflow-y: auto; padding: 4px 18px calc(18px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; flex: 1; }
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; border-radius: 20px; transform: translateY(-40%) scale(.98); opacity: 0; }
  .sheet.show { transform: translateY(-50%); opacity: 1; }
  .sheet.tall { height: 86vh; }
}
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + var(--safe-bottom) + 12px); z-index: 90; display: grid;
  justify-items: center; gap: 6px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: center; max-width: 520px; font-size: .92rem; }
.toast.error { background: var(--bad); color: #fff; }
.toast button { border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---------- barcode scanner (same as Ration and Pantry) */
.scanner { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; display: flex; flex-direction: column; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; left: 8%; right: 8%; top: 32%; height: 22%; border: 3px solid rgba(255,255,255,.9); border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); pointer-events: none; }
.scanner .frame.hit { border-color: #e0b25a; }
.scanner .frame::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: rgba(255,80,80,.8); }
.scanner .top, .scanner .bottom { position: relative; z-index: 2; padding: 14px 16px; }
.scanner .top { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); display: flex; gap: 8px; align-items: center; }
.scanner .bottom { margin-top: auto; padding-bottom: calc(var(--safe-bottom) + 16px); background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.scanner .icon-btn { color: #fff; background: rgba(0,0,0,.35); }
.scanner .hint { text-align: center; font-size: .9rem; opacity: .9; margin: 8px 0; text-shadow: 0 1px 3px #000; }
.scanner .input { background: rgba(255,255,255,.95); color: #111; }

/* ---------- sign-in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 400px; padding: 24px; }
.logo { width: 84px; height: 84px; display: grid; place-items: center; margin-bottom: 8px; }
.logo svg { width: 84px; height: 84px; }
.lg-rifle { stroke: var(--accent); } .lg-round { stroke: var(--brass-bright); }
.qr { background: #fff; border-radius: 12px; padding: 8px; width: 210px; margin: 0 auto; }
.qr img { width: 100%; display: block; image-rendering: pixelated; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; letter-spacing: .05em; text-align: center;
  background: var(--surface-2); border-radius: 10px; padding: 8px; overflow-wrap: anywhere; user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; }
.codes span { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; text-align: center; }
ol.steps { padding-left: 20px; margin: 0; }
ol.steps li + li { margin-top: 6px; }

@media (max-width: 380px) {
  .hero .big { font-size: 1.8rem; }
  .facts { grid-template-columns: 1fr; }
  .facts > div { border-right: 0 !important; }
  .facts > div:nth-child(2) { border-top: 1px solid var(--border); }
}
@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .gallery img, .gallery .add { height: 260px; }
}
@media print {
  .tabbar, .topbar .icon-btn, .fab { display: none !important; }
}

.bars .more { display: block; text-align: center; padding: 10px; font-weight: 600; font-size: .9rem; color: var(--accent); border-top: 1px solid var(--border); background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; cursor: pointer; }
/* Any icon without its own size rule gets a sensible one (zero specificity, so every real rule wins). */
:where(#app, .sheet, .toasts) :where(svg) { width: 20px; height: 20px; flex: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips.wrap .chip { white-space: normal; max-width: 100%; text-align: left; }
