@font-face { font-family: "Archivo Black"; src: url(/fonts/archivo-black.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #050f26;
  --navy-950: #061330;
  --navy-900: #0a1c45;
  --navy-800: #0f2758;
  --navy-700: #17336f;
  --navy-600: #224690;
  --line: rgba(160, 190, 255, 0.16);
  --yellow: #ffc72c;
  --yellow-hi: #ffd95e;
  --yellow-ink: #3a2a00;
  --white: #f4f7ff;
  --muted: #a9b7d6;
  --beard: #f06a2a;
  --keep: #37d896;
  --boat: #5cc8ff;
  --donate: #ff8f5e;
  --undecided: #c2cbe2;
  --danger: #ff5d5d;
  --radius: 18px;
  --tab-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --display: "Archivo Black", Impact, "Arial Black", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--navy-950); }
body {
  margin: 0; min-height: 100dvh; color: var(--white);
  font: 16px/1.4 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(120% 60% at 50% -10%, #1b3d86 0%, transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950) 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--yellow); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.splash { min-height: 100dvh; display: grid; place-content: center; text-align: center; gap: 8px; color: var(--muted); }
.splash img { filter: drop-shadow(0 6px 24px rgba(0,0,0,.5)); }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 8px) 14px 8px;
  background: linear-gradient(180deg, rgba(6,19,48,.97), rgba(6,19,48,.88));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .badge {
  width: 46px; height: 46px; border-radius: 14px; background: var(--yellow);
  display: grid; place-items: center; flex: none; box-shadow: 0 3px 0 #c89400;
}
.topbar .badge img { width: 40px; }
.topbar .title { flex: 1; min-width: 0; }
.topbar .title b { font-family: var(--display); font-weight: 400; font-size: 19px; display: block; line-height: 1.05; }
.topbar .title small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.backbtn { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--navy-800); font-size: 22px; flex: none; }

.syncpill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 8px 12px;
  border: 1px solid var(--line); background: var(--navy-800); font-size: 13px; font-weight: 700; white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis;
}
.syncpill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--keep); flex: none; box-shadow: 0 0 0 3px rgba(55,216,150,.2); }
.syncpill.pending .dot { background: var(--yellow); box-shadow: 0 0 0 3px rgba(255,199,44,.25); }
.syncpill.offline .dot { background: var(--donate); box-shadow: 0 0 0 3px rgba(255,143,94,.25); }
.syncpill.busy .dot { animation: pulse 0.9s infinite alternate; }
@keyframes pulse { to { transform: scale(.55); opacity: .5; } }

main.view { padding: 14px 14px calc(var(--tab-h) + var(--safe-b) + 24px); max-width: 720px; margin: 0 auto; }
main.view.has-savebar { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 110px); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--tab-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
  background: rgba(5, 15, 38, 0.97); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tab-h); color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a.on { color: var(--yellow); }
.tabbar a.log { position: relative; }
.tabbar a.log span.plus {
  width: 64px; height: 64px; margin-top: -26px; border-radius: 22px; background: var(--yellow); color: var(--navy-950);
  display: grid; place-items: center; box-shadow: 0 5px 0 #c89400, 0 10px 24px rgba(0,0,0,.45); transform: rotate(-4deg);
}
.tabbar a.log span.plus svg { width: 34px; height: 34px; }
.tabbar a.log.on span.plus { background: var(--yellow-hi); }

/* ---------- generic ---------- */
.card { background: linear-gradient(180deg, rgba(23,51,111,.75), rgba(15,39,88,.75)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card, .section + .section { margin-top: 14px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 2px 10px; }
.section-title h2 { font-size: 18px; }
.section-title .muted { font-size: 13px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 20px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--navy-700); color: var(--white); font-weight: 800; font-size: 17px; text-decoration: none;
  transition: transform .08s ease;
}
.btn:active { transform: translateY(2px) scale(.99); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.primary { background: var(--yellow); color: var(--navy-950); border-color: transparent; box-shadow: 0 4px 0 #c89400; }
.btn.primary:active { box-shadow: 0 1px 0 #c89400; transform: translateY(3px); }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(255,93,93,.14); color: #ffb3b3; border-color: rgba(255,93,93,.35); }
.btn.block { width: 100%; }
.btn.big { min-height: 68px; font-size: 20px; font-family: var(--display); font-weight: 400; letter-spacing: .02em; border-radius: 20px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

input.text, select.text, textarea.text {
  width: 100%; min-height: 54px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--ink); color: var(--white); font-size: 17px; outline: none;
}
textarea.text { min-height: 96px; resize: vertical; line-height: 1.45; }
input.text:focus, select.text:focus, textarea.text:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,199,44,.18); }
label.lbl { display: block; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 2px 8px; }
.field + .field { margin-top: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--navy-800);
  font-weight: 700; font-size: 15.5px; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--yellow); color: var(--navy-950); border-color: var(--yellow); }
.chip.sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip .n { opacity: .7; font-weight: 600; }

/* ---------- toasts / overlays ---------- */
#toasts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 80; display: grid; gap: 8px; pointer-events: none; }
.toast {
  justify-self: center; max-width: 520px; background: var(--white); color: var(--navy-950); font-weight: 700; padding: 13px 18px; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: toastin .18s ease-out; pointer-events: auto;
}
.toast.warn { background: var(--yellow); }
.toast.err { background: #ffd2d2; color: #5b0000; }
@keyframes toastin { from { transform: translateY(12px); opacity: 0; } }

.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(2,8,22,.6); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 560px; background: var(--navy-900); border-top-left-radius: 24px; border-top-right-radius: 24px; border: 1px solid var(--line);
  padding: 10px 16px calc(16px + var(--safe-b)); animation: sheetin .2s ease-out; max-height: 88dvh; overflow: auto; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 12px; }
.sheet h3 { font-size: 20px; margin-bottom: 6px; }
.sheet p { margin: 4px 0 14px; color: var(--muted); }
.sheet .btn { width: 100%; margin-top: 10px; }
@keyframes sheetin { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: calc(var(--safe-t) + 24px) 22px calc(var(--safe-b) + 24px); max-width: 460px; margin: 0 auto; }
.login .logo { width: min(78vw, 330px); align-self: center; filter: drop-shadow(0 10px 30px rgba(0,0,0,.55)); background: radial-gradient(closest-side, rgba(255,199,44,.22), transparent); }
.login h1 { font-size: 30px; text-align: center; line-height: 1.05; }
.login h1 span { color: var(--yellow); }
.login .err { color: #ffb3b3; font-weight: 700; min-height: 1.4em; text-align: center; }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; padding: 18px 18px 18px 18px; min-height: 168px; }
.hero h1 { font-size: 26px; line-height: 1.05; max-width: 62%; }
.hero h1 span { color: var(--yellow); }
.hero p { margin: 8px 0 0; color: var(--muted); max-width: 60%; font-size: 15px; }
.hero .cb { position: absolute; right: -8px; bottom: -14px; height: 190px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.45)); animation: bob 3.6s ease-in-out infinite; transform-origin: bottom center; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(1.5deg); } }
.progress { margin-top: 16px; }
.hero .progress { margin-right: 112px; }
.progress .bar { height: 14px; border-radius: 99px; background: var(--ink); overflow: hidden; border: 1px solid var(--line); }
.progress .bar i { display: block; height: 100%; border-radius: 99px; background: repeating-linear-gradient(135deg, var(--yellow) 0 14px, var(--yellow-hi) 14px 28px); transition: width .5s ease; }
.progress .lbls { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.bigcount { font-family: var(--display); font-size: 54px; line-height: .95; color: var(--yellow); }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.quick .btn { min-height: 64px; }

.saillist { display: grid; gap: 10px; }
.sailrow {
  display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; background: rgba(15,39,88,.8); border: 1px solid var(--line);
  color: inherit; text-decoration: none; min-height: 84px;
}
.sailrow:active { background: var(--navy-700); }
.thumb { width: 64px; height: 64px; border-radius: 14px; background: var(--ink) center/cover no-repeat; flex: none; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.thumb svg { width: 30px; height: 30px; color: var(--navy-600); }
.sailrow .info { flex: 1; min-width: 0; }
.sailrow .num { font-family: var(--display); font-size: 20px; line-height: 1; }
.sailrow .num small { font-family: Inter, sans-serif; font-weight: 700; font-size: 11px; color: var(--muted); margin-right: 2px; }
.sailrow .sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.sailrow .tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.dispo-tag { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: rgba(194,203,226,.16); color: var(--undecided); white-space: nowrap; }
.dispo-tag.keep { background: rgba(55,216,150,.16); color: var(--keep); }
.dispo-tag.sell { background: rgba(92,200,255,.16); color: var(--boat); }
.dispo-tag.donate { background: rgba(255,143,94,.16); color: var(--donate); }
.tag { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--muted); }
.tag.warn { background: rgba(255,199,44,.18); color: var(--yellow); }
.tag.pend { background: rgba(255,143,94,.16); color: var(--donate); }

.grid-sails { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gcard { border-radius: 18px; overflow: hidden; background: rgba(15,39,88,.85); border: 1px solid var(--line); text-decoration: none; color: inherit; }
.gcard .ph { aspect-ratio: 1; background: var(--ink) center/cover no-repeat; display: grid; place-items: center; position: relative; }
.gcard .ph svg { width: 44px; height: 44px; color: var(--navy-600); }
.gcard .ph .numbadge { position: absolute; left: 8px; top: 8px; background: var(--yellow); color: var(--navy-950); font-family: var(--display); padding: 4px 9px; border-radius: 10px; font-size: 16px; }
.gcard .meta { padding: 9px 10px 11px; }
.gcard .meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .meta .dispo-tag { display: inline-block; margin-top: 5px; }

.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.empty img { height: 150px; display: block; margin: 0 auto 10px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.4)); }
.empty b { color: var(--white); font-size: 18px; display: block; margin-bottom: 4px; }

/* ---------- form ---------- */
.numbox { display: flex; align-items: stretch; gap: 8px; }
.numbox .stepper { width: 62px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--navy-800); font-size: 30px; font-weight: 800; flex: none; }
.numbox .numfield { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 4px; border-radius: 18px; border: 2px solid var(--yellow); background: var(--ink); padding: 0 10px; }
.numbox .numfield span { font-family: var(--display); color: var(--muted); font-size: 22px; }
.numbox .numfield input { width: 3.6ch; min-width: 0; background: transparent; border: 0; outline: none; font-family: var(--display); font-size: 52px; color: var(--yellow); text-align: center; padding: 6px 0; letter-spacing: .02em; }
.numstatus { margin-top: 8px; font-weight: 700; font-size: 14.5px; min-height: 22px; }
.numstatus.ok { color: var(--keep); }
.numstatus.warn { color: var(--yellow); }
.numstatus button { background: none; border: 0; color: var(--white); text-decoration: underline; font-weight: 800; padding: 4px; }

.photocat { border-radius: var(--radius); border: 1px solid var(--line); background: rgba(10,28,69,.75); padding: 12px; }
.photocat + .photocat { margin-top: 10px; }
.photocat header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.photocat header b { font-size: 16px; }
.photocat header .count { font-family: var(--display); background: var(--navy-700); border-radius: 10px; padding: 2px 9px; font-size: 14px; }
.photocat header .count.has { background: var(--yellow); color: var(--navy-950); }
.photocat header .lib { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: 13.5px; padding: 8px 4px; text-decoration: underline; }
.strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.strip::-webkit-scrollbar { display: none; }
.snap {
  flex: none; width: 92px; height: 92px; border-radius: 16px; border: 2px dashed rgba(255,199,44,.6); background: rgba(255,199,44,.08); color: var(--yellow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 800; font-size: 13px;
}
.snap svg { width: 32px; height: 32px; }
.snap.wide { width: auto; flex: 1; min-width: 92px; flex-direction: row; gap: 10px; font-size: 16px; }
.pthumb { flex: none; width: 92px; height: 92px; border-radius: 16px; background: var(--ink) center/cover no-repeat; border: 1px solid var(--line); position: relative; padding: 0; }
.pthumb .idx { position: absolute; left: 5px; top: 5px; background: rgba(5,15,38,.8); border-radius: 8px; font-size: 11px; font-weight: 800; padding: 1px 6px; }
.pthumb .up { position: absolute; right: 5px; bottom: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--donate); box-shadow: 0 0 0 2px rgba(5,15,38,.8); }

.dispo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dispo button {
  min-height: 92px; border-radius: 20px; border: 2px solid var(--line); background: var(--navy-800); padding: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 15.5px; line-height: 1.15; text-align: center;
}
.dispo button svg { width: 30px; height: 30px; }
.dispo button small { font-weight: 600; font-size: 12px; color: var(--muted); }
.dispo button.keep.on { background: var(--keep); border-color: var(--keep); color: #04291a; }
.dispo button.sell.on { background: var(--boat); border-color: var(--boat); color: #032338; }
.dispo button.donate.on { background: var(--donate); border-color: var(--donate); color: #3a1200; }
.dispo button.undecided.on { background: var(--undecided); border-color: var(--undecided); color: #1a2238; }
.dispo button.on small { color: inherit; opacity: .8; }

.voice { display: grid; gap: 10px; }
.micbtn {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 76px; border-radius: 22px; border: 2px solid var(--beard);
  background: rgba(240,106,42,.12); color: #ffd1bb; font-weight: 800; font-size: 18px;
}
.micbtn svg { width: 30px; height: 30px; }
.micbtn.rec { background: var(--beard); color: #fff; animation: recglow 1s infinite alternate; }
@keyframes recglow { to { box-shadow: 0 0 0 10px rgba(240,106,42,.18); } }
.livetext { border-radius: 16px; border: 1.5px dashed rgba(240,106,42,.6); background: rgba(240,106,42,.08); padding: 12px 14px; font-size: 17px; line-height: 1.45; min-height: 52px; }
.livetext small { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.vnote { border-radius: 16px; border: 1px solid var(--line); background: rgba(5,15,38,.6); padding: 10px; display: grid; gap: 8px; }
.vnote audio { width: 100%; height: 40px; }
.vnote .playbtn { min-height: 48px; justify-content: flex-start; font-size: 15px; }
.vnote .vhead { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); font-weight: 700; gap: 8px; }
.vnote .vhead button { background: none; border: 0; color: #ffb3b3; font-weight: 800; padding: 6px; }
.vnote textarea { min-height: 70px; }

.savebar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 25; padding: 10px 14px;
  background: linear-gradient(180deg, transparent, rgba(5,15,38,.96) 30%); display: flex; gap: 10px;
}
.savebar:not(.solo) { bottom: calc(var(--tab-h) + var(--safe-b) + 12px); background: none; padding-top: 0; padding-bottom: 0; }
.savebar.solo { bottom: 0; padding-bottom: calc(12px + var(--safe-b)); }
main.view.has-savebar.no-tabs { padding-bottom: calc(var(--safe-b) + 120px); }
body:has(.savebar.solo) #toasts { bottom: calc(var(--safe-b) + 100px); }
.savebar .btn { flex: 1; box-shadow: 0 4px 0 #c89400, 0 10px 30px rgba(0,0,0,.5); }
.savebar .btn.ghost { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.savebar .btn.ghost { flex: 0 0 auto; background: var(--navy-800); }
.draftnote { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255,199,44,.12); color: var(--yellow); font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.draftnote button { background: none; border: 0; color: var(--white); font-weight: 800; text-decoration: underline; padding: 6px; }

/* ---------- detail ---------- */
.dhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dhead .bignum { font-family: var(--display); font-size: 46px; line-height: .9; color: var(--yellow); }
.dhead .bignum small { display: block; font-size: 15px; color: var(--muted); letter-spacing: .05em; }
.dhead .kind { text-align: right; font-weight: 800; font-size: 17px; }
.dhead .kind div { color: var(--muted); font-weight: 600; font-size: 14px; }
.gallery { position: relative; margin: 0 -14px; }
.gallery .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 8px; padding: 0 14px; }
.gallery .track::-webkit-scrollbar { display: none; }
.gallery .slide { flex: none; width: calc(100% - 28px); aspect-ratio: 4/3; scroll-snap-align: center; border-radius: 20px; overflow: hidden; background: var(--ink); position: relative; border: 1px solid var(--line); padding: 0; }
.gallery .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .slide .cap { position: absolute; left: 10px; bottom: 10px; background: rgba(5,15,38,.85); border-radius: 10px; padding: 4px 10px; font-weight: 800; font-size: 13px; }
.gallery .counter { position: absolute; right: 24px; top: 10px; background: rgba(5,15,38,.85); border-radius: 10px; padding: 4px 10px; font-weight: 800; font-size: 13px; pointer-events: none; }
.gallery .noph { aspect-ratio: 4/3; margin: 0 14px; border-radius: 20px; border: 2px dashed var(--line); display: grid; place-content: center; text-align: center; color: var(--muted); gap: 4px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.facts div { background: var(--navy-900); padding: 12px 14px; min-height: 64px; }
.facts div.wide { grid-column: 1 / -1; }
.facts dt { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 3px 0 0; font-weight: 700; font-size: 16px; white-space: pre-wrap; word-break: break-word; }
.dupwarn { border-radius: 16px; background: rgba(255,199,44,.14); border: 1.5px solid rgba(255,199,44,.5); color: var(--yellow); padding: 12px 14px; font-weight: 700; margin-bottom: 12px; }
.dupwarn a { color: var(--white); }

.viewer { position: fixed; inset: 0; z-index: 95; background: #000; display: flex; flex-direction: column; animation: fade .15s; }
.viewer .vtop { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 8px) 12px 8px; gap: 8px; }
.viewer .vtop .btn { min-height: 46px; padding: 0 14px; font-size: 15px; }
.viewer .vtrack { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.viewer .vtrack::-webkit-scrollbar { display: none; }
.viewer .vslide { flex: none; width: 100vw; height: 100%; scroll-snap-align: center; display: grid; place-items: center; overflow: auto; }
.viewer .vslide img { max-width: 100vw; max-height: 100%; object-fit: contain; touch-action: pinch-zoom; }
.viewer .vcap { text-align: center; padding: 8px 12px calc(var(--safe-b) + 12px); color: var(--muted); font-weight: 700; }

/* ---------- find ---------- */
.searchbox { position: relative; }
.searchbox input { padding-left: 50px; min-height: 64px; font-size: 20px; border-radius: 18px; font-weight: 700; }
.searchbox svg { position: absolute; left: 16px; top: 50%; width: 24px; height: 24px; transform: translateY(-50%); color: var(--muted); }
.scanbtn { margin-top: 10px; }
.jump { margin-top: 12px; }
.filters { display: grid; gap: 8px; margin-top: 14px; }
.filters .selrow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.filters select.text { min-height: 48px; font-size: 15px; padding: 8px 10px; }
.viewtoggle { display: flex; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.viewtoggle button { width: 50px; min-height: 48px; border: 0; background: var(--navy-800); color: var(--muted); }
.viewtoggle button.on { background: var(--yellow); color: var(--navy-950); }
.viewtoggle svg { width: 22px; height: 22px; }

.scanner { position: fixed; inset: 0; z-index: 96; background: #000; display: flex; flex-direction: column; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .reticle { position: absolute; left: 50%; top: 45%; width: min(70vw, 320px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 28px; box-shadow: 0 0 0 200vmax rgba(0,0,0,.55); border: 4px solid var(--yellow); }
.scanner .reticle::after { content: ""; position: absolute; left: 8%; right: 8%; top: 50%; height: 3px; background: var(--yellow); box-shadow: 0 0 12px var(--yellow); animation: scanline 1.6s ease-in-out infinite alternate; }
@keyframes scanline { from { top: 12%; } to { top: 88%; } }
.scanner .stop { position: relative; z-index: 2; margin-top: auto; padding: 14px 16px calc(var(--safe-b) + 18px); display: grid; gap: 10px; }
.scanner .msg { position: relative; z-index: 2; padding: calc(var(--safe-t) + 18px) 18px 0; text-align: center; font-weight: 800; font-size: 18px; text-shadow: 0 2px 8px #000; }

/* ---------- stats ---------- */
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { border-radius: var(--radius); padding: 14px; background: var(--navy-800); border: 1px solid var(--line); }
.stat .v { font-family: var(--display); font-size: 36px; line-height: 1; }
.stat .k { color: var(--muted); font-weight: 700; font-size: 13.5px; margin-top: 4px; }
.stat.keep .v { color: var(--keep); } .stat.sell .v { color: var(--boat); } .stat.donate .v { color: var(--donate); } .stat.undecided .v { color: var(--undecided); }
.bars { display: grid; gap: 10px; }
.bars .b { display: grid; grid-template-columns: 112px 1fr 34px; align-items: center; gap: 10px; font-weight: 700; font-size: 14.5px; }
.bars .b .t { height: 14px; background: var(--ink); border-radius: 99px; overflow: hidden; }
.bars .b .t i { display: block; height: 100%; background: var(--yellow); border-radius: 99px; }
.bars .b span:last-child { text-align: right; font-family: var(--display); }
.board { display: grid; gap: 8px; }
.board .p { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--navy-800); border: 1px solid var(--line); }
.board .p .rank { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); background: var(--navy-700); flex: none; font-size: 17px; }
.board .p:first-child { border-color: rgba(255,199,44,.6); background: linear-gradient(90deg, rgba(255,199,44,.18), var(--navy-800)); }
.board .p:first-child .rank { background: var(--yellow); color: var(--navy-950); }
.board .p .who { flex: 1; min-width: 0; }
.board .p .who b { display: block; }
.board .p .who small { color: var(--muted); font-weight: 600; }
.board .p .score { font-family: var(--display); font-size: 24px; }
.leaderhero { display: flex; align-items: center; gap: 12px; }
.leaderhero img { height: 96px; }

/* ---------- celebration ---------- */
.celebrate { position: fixed; inset: 0; z-index: 85; pointer-events: none; overflow: hidden; }
.celebrate .flag { position: absolute; top: -30px; width: 14px; height: 22px; clip-path: polygon(0 0, 100% 50%, 0 100%); animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.celebrate .cb { position: absolute; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) - 10px); height: 210px; transform: translate(-50%, 110%); animation: popup 1.9s cubic-bezier(.2,1.4,.4,1) forwards; filter: drop-shadow(0 10px 22px rgba(0,0,0,.5)); }
@keyframes popup { 18% { transform: translate(-50%, 0) rotate(-3deg); } 70% { transform: translate(-50%, 0) rotate(3deg); } 100% { transform: translate(-50%, 115%); } }
.celebrate .bubble { position: absolute; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 200px); transform: translateX(-50%) scale(.6); opacity: 0; background: var(--yellow); color: var(--navy-950);
  font-family: var(--display); font-size: 22px; padding: 12px 18px; border-radius: 18px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: bubble 1.9s ease forwards; }
@keyframes bubble { 15% { opacity: 1; transform: translateX(-50%) scale(1.05); } 25% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

.kv { display: grid; gap: 10px; }
.kv .r { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.kv .r span:last-child { font-weight: 800; text-align: right; }
.list-actions { display: grid; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
@media (min-width: 720px) {
  .hero h1 { font-size: 32px; }
}
