/* DDFA. Layout: one phone-width column, a fixed tab bar at the bottom, sheets that slide up over the screen. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-var.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #f3f5f1;
  --card: #ffffff;
  --ink: #1d2b53;
  --mut: #5a6378;
  --line: #dce1da;
  --soft: #e8ece6;
  --red: #b5382f;
  --red-ink: #ffffff;
  --star: #c99a2e;
  --off: #cfd4cc;
  --david: #2e5e9e;
  --denise: #7f4a9a;
  --ok: #2e7d4f;
  --warn: #9a6a00;
  --scrim: rgba(14, 20, 40, 0.45);
  --shadow: 0 1px 2px rgba(29, 43, 83, 0.06), 0 4px 16px rgba(29, 43, 83, 0.06);
  --t-bowl: #fbe3d6; --t-cup: #efe3f6; --t-bread: #fcefd0; --t-coffee: #efe6da; --t-pizza: #fcefd0;
  --t-taco: #e6f1dc; --t-burger: #fbe9d4; --t-sushi: #fde4dc; --t-icecream: #fbe4ee; --t-drink: #fdf0cf; --t-fork: #e2ecf7;
  --f: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --m: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --tabs-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1528;
    --card: #182039;
    --ink: #e8ecf5;
    --mut: #a3acc3;
    --line: #2a3556;
    --soft: #212b48;
    --red: #e3675b;
    --red-ink: #0f1528;
    --star: #e3b74b;
    --off: #3a4566;
    --david: #7fa9e6;
    --denise: #c79be0;
    --ok: #7bcb9b;
    --warn: #e9b64d;
    --scrim: rgba(0, 0, 0, 0.6);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --t-bowl: color-mix(in srgb, #ff7a59 24%, #182039); --t-cup: color-mix(in srgb, #b98aed 24%, #182039); --t-bread: color-mix(in srgb, #f2b33d 24%, #182039); --t-coffee: color-mix(in srgb, #d39a6a 24%, #182039); --t-pizza: color-mix(in srgb, #f2b33d 24%, #182039);
    --t-taco: color-mix(in srgb, #7fd38a 24%, #182039); --t-burger: color-mix(in srgb, #f59e4c 24%, #182039); --t-sushi: color-mix(in srgb, #ff7b7b 24%, #182039); --t-icecream: color-mix(in srgb, #ff8cc0 24%, #182039); --t-drink: color-mix(in srgb, #f2cf4c 24%, #182039); --t-fork: color-mix(in srgb, #6fa8ff 24%, #182039);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2.5px solid var(--red); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
#app { max-width: 560px; margin: 0 auto; min-height: 100%; position: relative; }
.screen {
  padding: calc(var(--top) + 16px) max(18px, env(safe-area-inset-right, 0px)) calc(var(--tabs-h) + var(--bottom) + 24px) max(18px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 12px; min-height: 100%;
}
.screen.no-tabs { padding-bottom: calc(var(--bottom) + 24px); }
.paperhead { background-image: repeating-radial-gradient(circle at 85% -10%, transparent 0 11px, rgba(29, 43, 83, 0.045) 11px 12px); background-size: 100% 260px; background-repeat: no-repeat; }
@media (prefers-color-scheme: dark) { .paperhead { background-image: repeating-radial-gradient(circle at 85% -10%, transparent 0 11px, rgba(232, 236, 245, 0.035) 11px 12px); } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.title { font-weight: 700; font-size: 28px; letter-spacing: -0.015em; line-height: 1.1; margin: 0; }
.title-sm { font-weight: 700; font-size: 22px; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
.h2 { font-weight: 700; font-size: 17px; margin: 0; }
.lbl { font-family: var(--m); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mut); }
.mut { color: var(--mut); }
.sm { font-size: 13.5px; }
.xs { font-size: 12px; }
.mono { font-family: var(--m); font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- cards & lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.pad { padding: 14px 16px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; width: 100%; border: 0; border-bottom: 1px solid var(--soft); background: transparent; text-align: left; min-height: 62px; text-decoration: none; color: inherit; }
.item > svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--mut); }
.item:last-child { border-bottom: 0; }
button.item:active { background: var(--soft); }
.item .name { font-weight: 600; font-size: 15.5px; }
.item .sub { font-size: 12.5px; color: var(--mut); }
.item .meta { margin-left: auto; text-align: right; font-family: var(--m); font-size: 12px; color: var(--mut); white-space: nowrap; display: grid; gap: 3px; justify-items: end; }
.badge { font-family: var(--f); font-size: 11px; font-weight: 600; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; line-height: 18px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--soft); font-size: 15px; }
.kv > span:first-child { white-space: nowrap; }
.kv b.txt { font-family: var(--f); font-weight: 600; }
.kv:last-child { border-bottom: 0; }
.kv b { font-family: var(--m); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- art tiles ---------- */
.ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; background: var(--t-fork); }
.ico svg { width: 78%; height: 78%; }
.ico.lg { width: 60px; height: 60px; border-radius: 17px; }
.tint-bowl { background: var(--t-bowl); } .tint-cup { background: var(--t-cup); } .tint-bread { background: var(--t-bread); }
.tint-coffee { background: var(--t-coffee); } .tint-pizza { background: var(--t-pizza); } .tint-taco { background: var(--t-taco); }
.tint-burger { background: var(--t-burger); } .tint-sushi { background: var(--t-sushi); } .tint-icecream { background: var(--t-icecream); }
.tint-drink { background: var(--t-drink); } .tint-fork { background: var(--t-fork); }

/* ---------- buttons ---------- */
.btn { min-height: 52px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; font-size: 16.5px; border: 0; width: 100%; padding: 0 18px; text-decoration: none; transition: transform 0.08s ease, opacity 0.15s; }
.btn:active { transform: scale(0.985); }
.btn svg { width: 21px; height: 21px; flex-shrink: 0; }
.btn.red { background: var(--red); color: var(--red-ink); }
.btn.navy { background: var(--ink); color: var(--paper); }
.btn.sec { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.link { background: transparent; color: var(--mut); min-height: 42px; font-weight: 500; font-size: 15px; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid var(--line); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.sm { min-height: 40px; font-size: 14.5px; border-radius: 12px; width: auto; padding: 0 14px; }
.iconbtn { width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--ink); flex-shrink: 0; position: relative; }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn.plain { background: transparent; border-color: transparent; }
.btnrow { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.actions { display: grid; gap: 4px; }

/* ---------- inputs ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; }
.input, textarea.input, select.input { width: 100%; min-height: 50px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); padding: 12px 14px; font-size: 16px; outline: none; }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--ink); }
.search { display: flex; align-items: center; gap: 10px; min-height: 50px; border-radius: 15px; background: var(--card); border: 1px solid var(--line); padding: 0 8px 0 14px; color: var(--mut); }
.search svg { width: 19px; height: 19px; flex-shrink: 0; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; color: var(--ink); padding: 12px 0; }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { border: 0; background: var(--soft); color: var(--mut); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.search .clear svg { width: 14px; height: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }

/* ---------- tabs ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--bottom); }
.tabs-inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabs-h); }
.tab { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mut); font-size: 11.5px; font-weight: 600; text-decoration: none; }
.tab svg { width: 24px; height: 24px; }
.tab .pic { width: 30px; height: 30px; filter: saturate(.35) opacity(.6); transition: filter .2s, transform .2s; }
.tab[aria-current="page"] .pic { filter: none; animation: hop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes hop { 40% { transform: translateY(-5px) scale(1.12) rotate(-6deg); } }
.tab[aria-current="page"] { color: var(--ink); }
.tab .live-dot { position: absolute; right: -2px; top: -2px; width: 12px; height: 12px; border-radius: 50%; background: #ffd34d; border: 2px solid var(--card); }
.tab { font-size: 10.5px; white-space: nowrap; }
.tab.centre .bubble { position: relative; width: 54px; height: 54px; margin-top: -24px; border-radius: 50%; background: var(--red); color: var(--red-ink); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(181,56,47,.35), 0 0 0 5px var(--card); }
.tab.centre .bubble svg { width: 26px; height: 26px; }
.tab.centre .bubble { background: var(--card); border: 2px solid var(--line); }
.tab.centre .bubble .pic { width: 40px; height: 40px; filter: none; }
.tab.centre:active .bubble .pic { transform: scale(.88) rotate(-8deg); }
.tab.centre[aria-current="page"] { color: var(--red); }

/* ---------- check-in ---------- */
.mapcard { position: relative; height: 150px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #e4eadf; flex-shrink: 0; }
@media (prefers-color-scheme: dark) { .mapcard { background: #1d2740; } .mapcard .tiles { filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.85) saturate(0.7); } }
.mapcard .tiles { position: absolute; inset: 0; }
.mapcard .tiles img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.mapcard .pin { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2.5px solid #fff; display: grid; place-items: center; font-family: var(--m); font-size: 10px; font-weight: 500; color: #fff; background: #1d2b53; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.mapcard .pin.seen { background: #b5382f; }
.mapcard .me { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #2f7be0; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.mapcard .me::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; background: rgba(47, 123, 224, 0.25); }
@media (prefers-reduced-motion: no-preference) { .mapcard .me::after { animation: ring 2.2s ease-out infinite; } @keyframes ring { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } } }
.mapcard .where { position: absolute; left: 8px; bottom: 8px; right: 8px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; pointer-events: none; }
.mapcard .where span { background: rgba(255,255,255,.94); color: #1d2b53; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; max-width: 75%; }
.mapcard .attrib { font-size: 9.5px !important; padding: 2px 6px !important; opacity: 0.85; }
.mapcard .empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--mut); font-size: 14px; padding: 16px; }
.illus { width: 100%; max-width: 260px; margin: 0 auto; border-radius: 20px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.notice svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--warn); margin-top: 1px; }
.skeleton { background: linear-gradient(90deg, var(--soft), var(--card), var(--soft)); background-size: 300% 100%; }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: shimmer 1.4s linear infinite; } @keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } } }
.skel-row { height: 62px; border-bottom: 1px solid var(--soft); }

/* ---------- live ---------- */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--red); }
.status i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
@media (prefers-reduced-motion: no-preference) { .status i { animation: pulse 1.4s ease-in-out infinite; } @keyframes pulse { 50% { opacity: 0.25; } } }
.hero { display: flex; align-items: center; gap: 4px; padding: 10px 18px 10px 6px; border-radius: 20px; border: 1px solid var(--line); }
.hero .t { display: grid; gap: 4px; }
.timer { font-family: var(--m); font-weight: 500; font-size: 50px; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.steam path { fill: none; stroke: var(--mut); stroke-width: 2.6; stroke-linecap: round; opacity: 0.5; }
@media (prefers-reduced-motion: no-preference) {
  .steam path { animation: rise 2.6s ease-in-out infinite; opacity: 0; }
  .steam path:nth-child(2) { animation-delay: 0.8s; }
  .steam path:nth-child(3) { animation-delay: 1.6s; }
  @keyframes rise { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: 0.75; } 100% { opacity: 0; transform: translateY(-8px); } }
}

/* ---------- photos ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 13px; overflow: hidden; background: var(--soft); border: 0; padding: 0; display: block; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .tick { position: absolute; right: 7px; top: 7px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--paper); }
.ph .tick svg { width: 15px; height: 15px; }
.ph.off img { opacity: 0.35; }
.ph.off .tick { background: var(--card); color: transparent; border: 2px solid var(--off); box-shadow: none; }
.ph .up { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 10.5px; border-radius: 8px; padding: 1px 6px; }
.ph.pending { display: grid; place-items: center; color: var(--mut); }
.ph.pending svg { width: 30%; height: 30%; }
.strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 0 18px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip .ph { flex: 0 0 82%; aspect-ratio: 4/3; scroll-snap-align: center; border-radius: 18px; }
.strip .ph.only { flex-basis: 100%; }

/* ---------- reviews & stars ---------- */
.progress { display: flex; gap: 6px; }
.progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.progress i.on { background: var(--ink); }
.av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0; background: var(--david); }
.av.p1 { background: var(--denise); }
.av.p2 { background: #2e7d4f; } .av.p3 { background: #9a6a00; }
.av.s { width: 24px; height: 24px; font-size: 10px; }
@media (prefers-color-scheme: dark) { .av { color: #0f1528; } }
.rate { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--soft); }
.rate:last-child { border-bottom: 0; }
.rate .lab { font-weight: 600; font-size: 15.5px; }
.stars { display: flex; align-items: center; }
.stars button { border: 0; background: transparent; padding: 0; width: 36px; height: 44px; display: grid; place-items: center; color: var(--off); }
.stars button svg { width: 28px; height: 28px; }
.stars button.on { color: var(--star); }
.stars .zero { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--off); color: var(--mut); font-family: var(--m); font-size: 12px; font-weight: 500; margin-right: 4px; }
.stars .zero.on { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.mini { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 1px 16px; font-size: 12px; }
.mini .s { color: var(--star); letter-spacing: -1px; white-space: nowrap; font-size: 14px; line-height: 1.2; }
.mini .s i { color: var(--off); font-style: normal; }
.mini .none { color: var(--mut); font-size: 12px; line-height: 1.6; }
.quote { font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.review { display: grid; gap: 7px; }

/* ---------- feed ---------- */
.vcard { display: grid; gap: 12px; padding: 12px; text-decoration: none; position: relative; }
.vcard .pics { display: grid; gap: 5px; border-radius: 12px; overflow: hidden; }
.vcard .pics img { width: 100%; height: 100%; object-fit: cover; background: var(--soft); }
.vcard .banner { height: 76px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.vcard .banner svg { width: 58px; height: 58px; }
.seal { display: inline-block; transform: rotate(-8deg); flex-shrink: 0; }
.livebar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--ink); color: var(--paper); text-decoration: none; }
.livebar .status { color: #ff8a7e; }
.livebar .status i { background: #ff8a7e; }
.empty-state { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 24px 8px; }
.empty-state > img { width: 220px; height: 220px; object-fit: contain; }
@media (prefers-color-scheme: dark) { .empty-state > img, .illus, .story-img { filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)); } }
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px; padding: 0 18px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.syncdot { position: absolute; right: 5px; top: 5px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--card); background: var(--ok); }
.syncdot.pending { background: var(--warn); }
.syncdot.offline { background: var(--off); }
.syncdot.error { background: var(--red); }

/* ---------- stats ---------- */
.tiles3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { padding: 12px; }
.tile b { display: block; font-weight: 700; font-size: 23px; line-height: 1.1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12.5px; color: var(--mut); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding-top: 6px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bars i { display: block; width: 100%; background: var(--ink); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars span { font-family: var(--m); font-size: 10.5px; color: var(--mut); }
.hbar { display: grid; grid-template-columns: 64px 1fr 34px; gap: 10px; align-items: center; font-size: 13.5px; }
.hbar .tr { height: 9px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; border-radius: 6px; }
.hbar b { font-family: var(--m); font-weight: 500; font-size: 13px; text-align: right; }

/* ---------- sheets, toasts, viewer ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 50; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--card); border-radius: 24px 24px 0 0; padding: 10px max(18px, env(safe-area-inset-left, 0px)) calc(var(--bottom) + 18px); display: grid; gap: 14px; max-width: 560px; margin: 0 auto; max-height: 88vh; overflow-y: auto; box-shadow: 0 -8px 30px rgba(0,0,0,.15); }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up 0.22s ease-out; } @keyframes up { from { transform: translateY(60px); } } }
.grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line); justify-self: center; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--bottom) + 14px); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--paper); border-radius: 14px; padding: 12px 16px; font-size: 14.5px; display: flex; align-items: center; gap: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100% - 32px); width: max-content; }
.toast button { border: 0; background: transparent; color: inherit; font-weight: 700; text-decoration: underline; padding: 4px; }
.viewer { position: fixed; inset: 0; z-index: 45; background: #000; display: flex; flex-direction: column; }
.viewer img { flex: 1; min-height: 0; object-fit: contain; width: 100%; }
.viewer .bar { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--top) + 10px) 14px 10px; color: #fff; }
.viewer .bar.bottom { padding: 10px 14px calc(var(--bottom) + 14px); }
.viewer .iconbtn { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
.viewer .btn { width: auto; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--soft); vertical-align: top; }
.table-wrap th { font-family: var(--m); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mut); font-weight: 500; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--red); }

/* ---------- covers & where-to ---------- */
.cover { position: relative; overflow: hidden; display: grid; place-items: center; width: 100%; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pick-card { padding: 10px; display: grid; gap: 10px; cursor: pointer; text-align: left; }
.pick-card.compact { padding: 8px; gap: 6px; }
.pick-badge { position: absolute; left: 10px; top: 10px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.94); color: #1d2b53; }
.pick-badge.k-saved { background: #1d2b53; color: #fff; }
.pick-badge.k-new { background: #e3f1e6; color: #1e5136; }
.reason { font-size: 14px; color: var(--mut); line-height: 1.4; }
.reason:first-of-type { color: var(--ink); font-weight: 500; }
.pick-stars { display: flex; gap: 14px; font-size: 12.5px; color: var(--mut); }
.pick-stars b { font-family: var(--m); font-weight: 500; color: var(--star); font-size: 14px; }
.deck-actions { display: flex; justify-content: center; align-items: center; gap: 22px; padding: 2px 0; }
.round { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--mut); display: grid; place-items: center; box-shadow: var(--shadow); transition: transform .1s ease; }
.round:active { transform: scale(.94); }
.round svg { width: 28px; height: 28px; }
.round.save { width: 52px; height: 52px; color: var(--ink); }
.round.save svg { width: 22px; height: 22px; }
.round.save.on { color: var(--red); }
.round.go { width: 76px; height: 76px; background: var(--red); border-color: var(--red); color: var(--red-ink); }
.round.go svg { width: 34px; height: 34px; }
.plan { display: grid; gap: 12px; padding: 14px; border-radius: 18px; background: var(--ink); color: var(--paper); }
.plan .btn.sec { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 30%, transparent); }
.filters.icons .chip.ic { padding: 0 8px; min-width: 44px; display: grid; place-items: center; }
.filters.icons .chip.ic svg { width: 26px; height: 26px; }
.filters.icons .chip.ic[aria-pressed="true"] { background: var(--soft); color: var(--ink); border-color: var(--ink); border-width: 2px; }
.iconbtn .count { position: absolute; right: -4px; top: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--red); color: var(--red-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--paper); }
.duel-opt { border: 0; background: transparent; padding: 0; text-align: left; width: 100%; border-radius: 16px; }
.duel-opt:active .card { transform: scale(.985); border-color: var(--ink); }
.vs { text-align: center; font-family: var(--m); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); margin: -4px 0; }
.winner-stamp { color: var(--star); }
.winner-stamp svg { width: 30px; height: 30px; }
.spinner { position: fixed; inset: 0; z-index: 70; background: rgba(14,20,40,.82); display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; }
.spin-window { width: min(86vw, 420px); min-height: 96px; border-radius: 22px; background: #fff; display: grid; place-items: center; padding: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.35); overflow: hidden; }
.spin-name { font-size: 26px; font-weight: 700; color: #1d2b53; text-align: center; line-height: 1.15; }
@media (prefers-reduced-motion: no-preference) {
  .spin-name.roll { animation: roll .09s ease-out; }
  @keyframes roll { from { transform: translateY(-40%); opacity: .2; } }
  .spin-name.landed { animation: land .5s cubic-bezier(.3,1.6,.5,1); color: #b5382f; }
  @keyframes land { from { transform: scale(1.4); } }
}

/* ---------- map ---------- */
.mapscreen { position: fixed; top: 0; bottom: calc(var(--tabs-h) + var(--bottom)); left: 0; right: 0; max-width: 560px; margin: 0 auto; overflow: hidden; background: #e4eadf; }
@media (prefers-color-scheme: dark) { .mapscreen { background: #1d2740; } .map .tiles { filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.85) saturate(0.7); } }
.map { position: absolute; inset: 0; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.map .tiles img { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; will-change: transform; }
.map .pins { position: absolute; inset: 0; pointer-events: none; }
/* Map pins: one teardrop shape; colour says been / want to go / tonight, the sticker says what food. */
.mpin { position: absolute; left: 0; top: 0; width: 38px; height: 46px; margin: -46px 0 0 -19px; border: 0; background: none; padding: 0; pointer-events: auto; --pin: #c8402f; }
.mpin::before { content: ""; position: absolute; left: 2px; top: 2px; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pin); border: 2px solid #fff; box-shadow: -2px 3px 5px rgba(0,0,0,.3); box-sizing: border-box; }
.mpin img, .mpin svg { position: absolute; left: 6px; top: 5px; width: 26px; height: 26px; border-radius: 50%; background: #fff; padding: 2px; box-sizing: border-box; pointer-events: none; }
.mpin b { position: absolute; right: -5px; top: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #1d2b53; color: #fff; border: 2px solid #fff; font: 600 10.5px/14px var(--m); box-sizing: border-box; }
.mpin.k-saved { --pin: #1d2b53; }
.mpin.k-plan { --pin: #e9a100; }
.mpin { transform-origin: 19px 46px; transition: scale .18s ease; }
.mpin.sel { z-index: 2; scale: 1.25; }
.map .me { position: absolute; left: 0; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #2f7be0; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.map-top { position: absolute; left: 0; right: 0; top: calc(var(--top) + 12px); padding: 0 14px; }
.map-top .filters { margin: 0; padding: 0; }
.map-top .chip { box-shadow: var(--shadow); }
.map-ctrl { position: absolute; right: 12px; top: calc(var(--top) + 64px); display: grid; gap: 8px; }
.map-ctrl .iconbtn { box-shadow: var(--shadow); }
.map-attr { position: absolute; left: 8px; bottom: 6px; font-size: 10px; background: rgba(255,255,255,.85); color: #1d2b53; padding: 1px 6px; border-radius: 6px; }
.map-card { position: absolute; left: 12px; right: 12px; bottom: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.map-empty { position: absolute; left: 16px; right: 16px; bottom: 30px; text-align: center; font-size: 14px; }

/* ---------- year story ---------- */
.story { position: fixed; inset: 0; z-index: 30; background: #1d2b53; color: #fff; display: flex; flex-direction: column; padding: calc(var(--top) + 10px) 18px calc(var(--bottom) + 18px); max-width: 560px; margin: 0 auto; background-image: repeating-radial-gradient(circle at 90% 0%, transparent 0 15px, rgba(243,245,241,.05) 15px 16px); }
.story .lbl { color: #f3e3c0; }
.story-bars { display: flex; gap: 4px; }
.story-bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.25); }
.story-bars i.on, .story-bars i.done { background: #fff; }
.story-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; position: relative; z-index: 3; }
.story-top .iconbtn { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
.story-top .chip { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); min-height: 32px; text-decoration: none; display: inline-grid; place-items: center; }
.story-top .chip.on { background: #fff; color: #1d2b53; }
.story-body { flex: 1; display: flex; position: relative; z-index: 2; pointer-events: none; }
.story-body a, .story-body button { pointer-events: auto; }
.story-c { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
@media (prefers-reduced-motion: no-preference) { .story-c { animation: storyin .25s ease-out; } @keyframes storyin { from { opacity: .4; transform: translateY(10px); } } }
.story-big { font-size: 64px; line-height: .98; font-weight: 700; letter-spacing: -.03em; margin: 0; }
.story-mid { font-size: 34px; line-height: 1.08; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.story-sub { font-size: 19px; line-height: 1.45; margin: 0; color: rgba(255,255,255,.85); }
.story-star { color: #f2c94c; font-family: var(--m); font-weight: 500; }
.story-img { width: 100%; margin-top: 8px; }
.story-icons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; }
.story-icons > div { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 13px; color: rgba(255,255,255,.85); }
.story-icons b { color: #fff; font-size: 16px; }
.story-fav { display: grid; gap: 4px; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.18); }
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.story-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; width: 100%; }
.story-nav { position: absolute; top: 0; bottom: 0; border: 0; background: transparent; z-index: 1; }
.story-nav.prev { left: 0; width: 30%; }
.story-nav.next { right: 0; width: 70%; }

/* ---------- stats extras & memories ---------- */
.tile b small { font-size: 13px; font-weight: 600; color: var(--mut); }
.recap-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--ink); color: var(--paper); text-decoration: none; }
.recap-banner > svg:first-child { width: 26px; height: 26px; color: #f2c94c; flex-shrink: 0; }
.recap-banner > svg:last-child { width: 20px; height: 20px; }
.passport { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
.passport > div { display: grid; justify-items: center; gap: 3px; text-align: center; }
.passport .missing .ico { filter: grayscale(1); opacity: .35; }
.passport .missing { color: var(--mut); }
.memory { display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 12px; align-items: center; padding: 10px; text-decoration: none; }
.memory .cover { border-radius: 12px; }
.memory .lbl { color: var(--red); }
.memory-actions { display: flex; gap: 8px; margin-top: 8px; }

.pick-card { touch-action: pan-y; user-select: none; -webkit-user-select: none; will-change: transform; }
.pick-card.going { box-shadow: 0 0 0 3px #2e7d4f; }
.pick-card.skipping { box-shadow: 0 0 0 3px var(--mut); }
.stamp-moment { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: color-mix(in srgb, var(--paper) 55%, transparent); pointer-events: none; }
.stamp-moment .seal { transform: rotate(-12deg); }
@media (prefers-reduced-motion: no-preference) {
  .stamp-moment .seal { animation: thud .38s cubic-bezier(.25,1.7,.5,1) both; }
  @keyframes thud { from { transform: scale(2.6) rotate(-4deg); opacity: 0; } to { transform: scale(1) rotate(-12deg); opacity: 1; } }
  .stamp-moment.out { transition: opacity .25s; opacity: 0; }
}
.cover img.web { opacity: 0; transition: opacity .3s ease; }
.cover.has-web img.web { opacity: 1; }
.cover.has-web svg { display: none; }
.hours { font-size: 12.5px; font-weight: 600; }
.hours.open { color: var(--ok); }
.hours.closed { color: var(--mut); }
.webstrip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 0 18px; scrollbar-width: none; }
.webstrip::-webkit-scrollbar { display: none; }
.webstrip button { flex: 0 0 72%; aspect-ratio: 4/3; border: 0; padding: 0; border-radius: 16px; overflow: hidden; background: var(--soft); scroll-snap-align: start; position: relative; }
.webstrip img { width: 100%; height: 100%; object-fit: cover; }
.webstrip .src { position: absolute; left: 8px; bottom: 8px; font-size: 11px; background: rgba(0,0,0,.55); color: #fff; padding: 2px 7px; border-radius: 8px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- native feel ---------- */
html { touch-action: manipulation; overscroll-behavior-y: none; }
/* Settings: grouped lists, like the iPhone's. */
.settings { gap: 8px; }
.settings .topbar { margin-bottom: 4px; }
.settings .lbl { margin: 12px 4px 0; }
.settings .item { min-height: 50px; padding: 8px 14px; gap: 12px; font-size: 15.5px; }
.settings .item .name, .settings .item .sub { display: block; }
.settings .item > svg { width: 18px; height: 18px; }
.settings .val { color: var(--mut); font-size: 15px; text-align: right; }
.sico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--soft); color: var(--ink); flex-shrink: 0; }
.sico svg { width: 17px; height: 17px; }
.item.act { color: var(--ink); font-weight: 600; font-size: 15.5px; }
.item.act.danger { color: var(--red); justify-content: center; text-align: center; }
.iconbtn.plain { border: 0; background: transparent; color: var(--mut); width: 36px; height: 36px; }
.iconbtn.plain svg { width: 19px; height: 19px; }
/* ---------- illustrated touches ---------- */
.banner { height: 150px; overflow: hidden; background: var(--soft);
  margin: calc(-16px - var(--top)) calc(-1 * max(18px, env(safe-area-inset-right, 0px))) -2px calc(-1 * max(18px, env(safe-area-inset-left, 0px))); }
.banner img { width: 100%; height: 100%; object-fit: cover; animation: drift 24s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.04) translateX(-1.5%); } to { transform: scale(1.1) translateX(1.5%); } }
.btn .pic { width: 28px; height: 28px; margin: -6px 0; }
.iconbtn .pic { width: 28px; height: 28px; }
.btn.has-stk { position: relative; overflow: visible; }
.stk { position: absolute; right: -10px; top: -18px; width: 48px; height: 48px; transform: rotate(14deg); pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); animation: stk-in .5s cubic-bezier(.3,1.6,.5,1) .15s both; }
@keyframes stk-in { from { transform: scale(0) rotate(-40deg); } }
.btn:active .stk { animation: wiggle .4s ease; }
@keyframes wiggle { 30% { transform: rotate(-8deg) scale(1.15); } 70% { transform: rotate(26deg) scale(1.05); } }
.rain { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.rain img { position: absolute; top: -80px; animation: rain var(--d) cubic-bezier(.35,.1,.6,1) both; filter: drop-shadow(0 3px 4px rgba(0,0,0,.2)); }
@keyframes rain { to { transform: translateY(calc(100vh + 160px)) rotate(var(--r)); } }
@media (prefers-color-scheme: dark) {
  .banner img { filter: brightness(.8) saturate(.9); }
  .pic { filter: drop-shadow(0 0 .6px #fff) drop-shadow(0 0 .6px #fff); }
  .tab .pic { filter: saturate(.35) brightness(1.3) opacity(.6); }
  .tab[aria-current="page"] .pic { filter: drop-shadow(0 0 .6px #fff) drop-shadow(0 0 .6px #fff); }
}
@media (prefers-reduced-motion: reduce) { .banner img, .stk, .tab .pic { animation: none !important; } }
/* Paper behind the status bar, so scrolled content never shows under the clock. */
body::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: var(--top); background: var(--paper); z-index: 25; pointer-events: none; }
/* App chrome: no link previews, callouts or stray text selection on long press. */
a, button, img, .tabs, .topbar, .chip { -webkit-touch-callout: none; }
button, .btn, .chip, .tabs, .item, .iconbtn, .lbl { -webkit-user-select: none; user-select: none; }
.viewer img { -webkit-touch-callout: default; }
.chip:active, .iconbtn:active, .tab:active { opacity: .7; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, .quote { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; }
a.card:active, a.item:active, button.item:active, .livebar:active, .recap-banner:active { filter: brightness(0.97); }
@media (prefers-color-scheme: dark) { a.card:active, a.item:active, button.item:active { filter: brightness(1.15); } }
#screen { min-height: 100%; background: var(--paper); }
#splash { position: fixed; inset: 0; z-index: 100; background: #1d2b53; display: grid; place-items: center; transition: opacity .35s ease; }
#splash img { width: 112px; height: 112px; border-radius: 26px; }
#splash.gone { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { #splash img { animation: splash 1.2s ease-in-out infinite alternate; } @keyframes splash { to { transform: scale(1.05); } } }
.ptr { position: fixed; top: calc(var(--top) - 40px); left: 50%; width: 40px; height: 40px; border-radius: 50%; background: var(--card); box-shadow: 0 2px 10px rgba(0,0,0,.15); display: grid; place-items: center; z-index: 25; color: var(--mut); transform: translate(-50%, 0); }
.ptr svg { width: 20px; height: 20px; }
.ptr.ready { color: var(--red); }
@media (prefers-reduced-motion: no-preference) { .ptr.spinning svg { animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } }
.ptr.done { opacity: 0; transition: opacity .25s; }
.tabs { view-transition-name: tabs; }
::view-transition-group(tabs) { animation: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
html[data-nav="forward"]::view-transition-new(root) { animation-name: vt-in-right; }
html[data-nav="forward"]::view-transition-old(root) { animation-name: vt-out-left; }
html[data-nav="back"]::view-transition-new(root) { animation-name: vt-in-left; }
html[data-nav="back"]::view-transition-old(root) { animation-name: vt-out-right; }
html[data-nav="tab"]::view-transition-old(root) { animation: vt-fade-out .12s ease both; }
html[data-nav="tab"]::view-transition-new(root) { animation: vt-fade-in .18s ease both; }
@keyframes vt-in-right { from { transform: translateX(100%); } }
@keyframes vt-out-left { to { transform: translateX(-30%); opacity: .6; } }
@keyframes vt-in-left { from { transform: translateX(-30%); opacity: .6; } }
@keyframes vt-out-right { to { transform: translateX(100%); } }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
