/* ------------------------------------------------------------------ tokens */
:root {
  --accent: #e8a0b4;
  --accent-ink: #2a0f1a;
  --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
  --gold: #e6c9a0;
  --ink: #fbf3ef;
  --ink-2: rgba(251, 243, 239, 0.74);
  --ink-3: rgba(251, 243, 239, 0.5);
  --wine: #1a0b12;
  --wine-2: #2a1220;
  --glass: rgba(30, 12, 22, 0.52);
  --glass-strong: rgba(26, 10, 19, 0.82);
  --hair: rgba(255, 235, 240, 0.14);
  --hair-2: rgba(255, 235, 240, 0.24);
  --danger: #ff8a8a;
  --overlay: 0.55;

  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Jost', system-ui, -apple-system, sans-serif;
  --script: 'Pinyon Script', 'Snell Roundhand', cursive;

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.7);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--wine);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
img, video { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------------ background */
#bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
#bg .bg-photo {
  position: absolute; inset: -40px;
  background:
    radial-gradient(1200px 800px at 15% 10%, #5b1f3a 0%, transparent 60%),
    radial-gradient(900px 700px at 90% 30%, #3d1530 0%, transparent 60%),
    radial-gradient(1000px 900px at 50% 110%, #6a2a3d 0%, transparent 60%),
    linear-gradient(160deg, #22101b, #140810);
  background-size: cover; background-position: center;
  transition: filter .8s var(--ease), transform .8s var(--ease);
}
#bg.has-photo .bg-photo { background-color: var(--wine); }
body.inner #bg.has-photo .bg-photo { filter: blur(22px) saturate(1.1); transform: scale(1.06); }
#bg .bg-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 6, 14, calc(var(--overlay) * .55)) 0%, rgba(20, 6, 14, var(--overlay)) 45%, rgba(16, 5, 11, calc(var(--overlay) + .2)) 100%);
}
body.inner #bg .bg-veil { background: rgba(18, 6, 13, calc(var(--overlay) + .18)); }
#bg .bg-glow {
  position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 190, 210, .18) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 20%, rgba(255, 220, 200, .14) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 85% 70%, rgba(255, 190, 210, .14) 0 2px, transparent 3px),
    radial-gradient(circle at 35% 80%, rgba(255, 220, 200, .12) 0 1.5px, transparent 2.5px);
  background-size: 340px 340px, 260px 260px, 420px 420px, 300px 300px;
  animation: drift 60s linear infinite;
}
@keyframes drift { to { background-position: 340px -340px, -260px -260px, 420px -420px, -300px -300px; } }
@media (prefers-reduced-motion: reduce) { #bg .bg-glow { animation: none; } }

/* ------------------------------------------------------------------ layout */
#app { min-height: 100vh; min-height: 100dvh; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.topbar {
  position: sticky; top: 0; z-index: 30;
  padding-top: var(--safe-t);
  transition: background .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { background: rgba(22, 8, 16, .72); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border-color: var(--hair); }
.topbar .wrap { display: flex; align-items: center; gap: 8px; height: 60px; }
body:not(.inner) .topbar:not(.scrolled) .brand { opacity: 0; }
.brand { transition: opacity .3s; font: 400 30px/1 var(--script); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px 4px 0; }
.topbar .spacer { flex: 1; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 15px; padding: 8px 10px 8px 4px; margin-left: -6px; border-radius: 99px; min-width: 0; }
.back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.back:hover { color: var(--ink); }

main { padding-bottom: calc(80px + var(--safe-b)); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 99px;
  border: 1px solid var(--hair-2); background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-weight: 500; font-size: 15px; letter-spacing: .01em; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, border-color .2s;
}
.btn:hover { background: rgba(255, 255, 255, .11); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 10px 30px -10px var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(255, 138, 138, .35); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 99px; display: inline-grid; place-items: center;
  border: 1px solid var(--hair); background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .2s, transform .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .12); }
.icon-btn:active { transform: scale(.94); }
.icon { width: 20px; height: 20px; flex: none; }
.icon.sm { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ home hero */
.hero { padding: 40px 0 34px; text-align: center; }
@media (min-width: 720px) { .hero { padding: 90px 0 60px; } }
.hero .hello { font: 500 13px/1 var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.hero h1 {
  font: 400 clamp(56px, 14vw, 128px)/0.95 var(--script); margin: 18px 0 8px;
  text-shadow: 0 4px 40px rgba(0, 0, 0, .45);
}
.hero .tagline { font: italic 400 clamp(19px, 3.6vw, 26px)/1.35 var(--serif); color: var(--ink-2); max-width: 640px; margin: 0 auto; text-wrap: balance; }
.together {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 26px; padding: 10px 20px;
  border-radius: 99px; border: 1px solid var(--hair-2); background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.together b { font: 500 26px/1 var(--serif); color: var(--accent); }
.together span { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.heart-beat { color: var(--accent); animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.18); } 24% { transform: scale(1); } 36% { transform: scale(1.12); } 48% { transform: scale(1); } }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 34px 0 16px; }
.section-head h2 { margin: 0; font: 500 30px/1.1 var(--serif); }
.section-head h2 em { font: 400 1.25em/1 var(--script); color: var(--accent); font-style: normal; padding-right: 4px; }
.eyebrow { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }

/* ------------------------------------------------------------------ category cards */
.cat-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; } }
@media (min-width: 1020px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }

.cat-card {
  position: relative; display: block; border-radius: var(--r-lg); overflow: hidden;
  aspect-ratio: 4 / 5; max-height: 460px; width: 100%;
  background: linear-gradient(150deg, #4a1d33, #2a1020);
  box-shadow: var(--shadow); isolation: isolate;
  transition: transform .4s var(--ease), box-shadow .4s;
}
@media (min-width: 640px) { .cat-card { aspect-ratio: 4 / 5; } }
.cat-card:hover { transform: translateY(-4px); box-shadow: 0 26px 60px -20px rgba(0, 0, 0, .8); }
.cat-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s var(--ease); }
.cat-card:hover img { transform: scale(1.04); }
.cat-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 3, 7, 0) 35%, rgba(18, 5, 12, .55) 62%, rgba(18, 5, 12, .94) 100%); }
.cat-card .body { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px; }
.cat-card h3 { margin: 6px 0 6px; font: 500 34px/1.05 var(--serif); }
.cat-card p { margin: 0; color: var(--ink-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-card .meta { display: flex; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--ink-3); }
.cat-card .placeholder-mark { position: absolute; inset: 0; display: grid; place-items: center; z-index: -1; font: 400 140px/1 var(--script); color: rgba(255, 200, 215, .12); padding-bottom: 80px; }

.progress { margin-top: 14px; }
.progress .bar { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: inherit; transition: width .8s var(--ease); }
.progress .lbl { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .08em; color: var(--ink-2); margin-top: 7px; }

.add-card {
  border: 1.5px dashed var(--hair-2); border-radius: var(--r-lg); min-height: 180px;
  display: grid; place-items: center; text-align: center; gap: 6px; padding: 24px;
  color: var(--ink-2); background: rgba(255, 255, 255, .025); transition: background .2s, color .2s, border-color .2s;
}
.add-card:hover { background: rgba(255, 255, 255, .06); color: var(--ink); border-color: var(--accent-line); }
.add-card .plus { width: 54px; height: 54px; border-radius: 99px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin: 0 auto 6px; }
.add-card b { font: 500 22px/1.2 var(--serif); color: var(--ink); display: block; }

/* recent strip */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip a { scroll-snap-align: start; position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-sm); overflow: hidden; background: var(--wine-2); }
.strip img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------------ page header (category / event) */
.page-hero { position: relative; margin: 6px 0 24px; border-radius: var(--r-lg); overflow: hidden; min-height: 260px; display: flex; align-items: end; box-shadow: var(--shadow); background: linear-gradient(150deg, #4a1d33, #2a1020); isolation: isolate; }
@media (min-width: 720px) { .page-hero { min-height: 380px; } }
.page-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.page-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 3, 7, .1) 20%, rgba(18, 5, 12, .9) 100%); }
.page-hero .body { padding: 24px; width: 100%; }
@media (min-width: 720px) { .page-hero .body { padding: 36px 40px; } }
.page-hero h1 { margin: 6px 0 4px; font: 500 clamp(40px, 9vw, 72px)/1 var(--serif); text-wrap: balance; }
.page-hero .sub { font: italic 400 20px/1.35 var(--serif); color: var(--ink-2); margin: 0; }
.page-hero .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.page-hero .actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); border: 1px solid var(--hair); font-size: 13px; color: var(--ink-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink); }
button.chip:hover { background: rgba(255, 255, 255, .16); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 18px; }
.toolbar .spacer { flex: 1; }

/* ------------------------------------------------------------------ event tiles */
.ev-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .ev-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1020px) { .ev-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }

.ev-tile { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: linear-gradient(160deg, #3f1a2c, #241019); box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .8); isolation: isolate; transition: transform .35s var(--ease); }
.ev-tile:hover { transform: translateY(-3px); }
.ev-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.ev-tile::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(18, 5, 12, .9) 100%); }
.ev-tile .letter { position: absolute; left: 14px; bottom: 34px; font: 500 62px/0.9 var(--serif); text-shadow: 0 2px 18px rgba(0, 0, 0, .45); max-width: calc(100% - 28px); white-space: nowrap; }
.ev-tile .letter.long { font-size: 26px; line-height: 1.1; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ev-tile .cap { position: absolute; left: 14px; right: 14px; bottom: 12px; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-tile .badge { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.ev-tile .badge span { height: 26px; min-width: 26px; padding: 0 8px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 12px; background: rgba(15, 5, 10, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ev-tile .badge .done { background: var(--accent); color: var(--accent-ink); }
.ev-tile.ghost { background: transparent; border: 1.5px dashed var(--hair-2); box-shadow: none; display: grid; place-items: center; text-align: center; }
.ev-tile.ghost::after { display: none; }
.ev-tile.ghost .ghost-letter { font: 500 64px/1 var(--serif); color: rgba(255, 220, 230, .22); transition: color .2s; }
.ev-tile.ghost .ghost-hint { position: absolute; bottom: 14px; left: 0; right: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); opacity: 0; transition: opacity .2s; }
.ev-tile.ghost:hover .ghost-letter { color: var(--accent); }
.ev-tile.ghost:hover .ghost-hint { opacity: 1; }
@media (hover: none) { .ev-tile.ghost .ghost-hint { opacity: 1; } }
.ev-tile.add { background: var(--accent-soft); border: 1.5px dashed var(--accent-line); box-shadow: none; display: grid; place-items: center; text-align: center; color: var(--ink); }
.ev-tile.add::after { display: none; }

/* ------------------------------------------------------------------ event page */
.story { background: var(--glass); border: 1px solid var(--hair); border-radius: var(--r); padding: 20px 22px; margin: 0 0 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.story p { margin: 0; font: 400 20px/1.55 var(--serif); color: var(--ink); white-space: pre-wrap; }
.story .eyebrow { display: block; margin-bottom: 8px; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--r); overflow: hidden; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(4, 1fr); gap: 8px; border-radius: 0; overflow: visible; } }
@media (min-width: 1020px) { .gallery { grid-template-columns: repeat(5, 1fr); } }
.g-item { position: relative; aspect-ratio: 1; background: rgba(255, 255, 255, .06); overflow: hidden; border: 0; padding: 0; display: block; width: 100%; }
@media (min-width: 640px) { .g-item { border-radius: var(--r-sm); } }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), opacity .4s; }
.g-item:hover img { transform: scale(1.04); }
.g-item .vid { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px; border-radius: 99px; background: rgba(0, 0, 0, .55); }
.g-item .cover-flag { position: absolute; top: 8px; left: 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.g-item.processing { display: grid; place-items: center; color: var(--ink-3); font-size: 12px; }
.g-item.processing .spin { width: 22px; height: 22px; border-radius: 99px; border: 2px solid var(--hair-2); border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 0 auto 6px; }
.g-item.error { display: grid; place-items: center; color: var(--danger); font-size: 12px; text-align: center; padding: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.g-item.selected::after { content: ''; position: absolute; inset: 0; border: 3px solid var(--accent); background: rgba(232, 160, 180, .25); }
.g-item .check { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 99px; border: 2px solid #fff; background: rgba(0, 0, 0, .3); display: none; z-index: 2; }
.selecting .g-item .check { display: block; }
.g-item.selected .check { background: var(--accent); border-color: var(--accent); }
.g-item.selected .check::after { content: ''; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-2); border: 1.5px dashed var(--hair-2); border-radius: var(--r-lg); background: rgba(255, 255, 255, .02); }
.empty h3 { font: 500 26px/1.2 var(--serif); color: var(--ink); margin: 10px 0 6px; }
.empty p { margin: 0 0 18px; }
.empty .big { font: 400 64px/1 var(--script); color: var(--accent); }

/* floating action button (mobile) */
.fab { position: fixed; right: 18px; bottom: calc(20px + var(--safe-b)); z-index: 40; width: 60px; height: 60px; border-radius: 99px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 14px 34px -8px rgba(0, 0, 0, .7), 0 0 0 6px var(--accent-soft); transition: transform .2s var(--ease); }
.fab:active { transform: scale(.94); }
.fab .icon { width: 26px; height: 26px; }

.selbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--safe-b)); z-index: 45; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px; border-radius: 99px; background: var(--glass-strong); border: 1px solid var(--hair-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow); white-space: nowrap; }

/* ------------------------------------------------------------------ sheets / modals */
.sheet-backdrop { position: fixed; inset: 0; z-index: 250; background: rgba(8, 2, 5, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
@media (min-width: 720px) { .sheet-backdrop { align-items: center; padding: 24px; } }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #2b1220, #1d0b15); border: 1px solid var(--hair-2);
  border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + var(--safe-b));
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .8); animation: up .32s var(--ease);
}
@media (min-width: 720px) { .sheet { border-radius: 28px; padding: 14px 28px 28px; animation: pop .25s var(--ease); } }
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--hair-2); margin: 0 auto 14px; }
@media (min-width: 720px) { .sheet .grab { display: none; } }
.sheet h2 { font: 500 30px/1.1 var(--serif); margin: 4px 0 4px; }
.sheet .lead { color: var(--ink-2); margin: 0 0 18px; }
.sheet .foot { display: flex; gap: 10px; margin-top: 22px; }
.sheet .foot .spacer { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

.field { display: block; margin: 0 0 16px; }
.field > span { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px; }
.input, .field input:not([type=checkbox]):not([type=range]):not([type=color]), .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--hair-2); outline: none;
  font-size: 16px; transition: border-color .2s, background .2s;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .input:focus { border-color: var(--accent); background: rgba(255, 255, 255, .09); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 22px) 21px, calc(100% - 16px) 21px; background-size: 6px 6px; background-repeat: no-repeat; }
.field .hint { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--hair); margin: 0 0 12px; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.toggle small { display: block; color: var(--ink-3); }

.cover-pick { display: flex; align-items: center; gap: 14px; }
.cover-pick .prev { width: 84px; height: 84px; border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, .06); border: 1px solid var(--hair); flex: none; display: grid; place-items: center; color: var(--ink-3); }
.cover-pick .prev img { width: 100%; height: 100%; object-fit: cover; }
.cover-pick .btns { display: flex; flex-wrap: wrap; gap: 8px; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch { width: 38px; height: 38px; border-radius: 99px; border: 2px solid transparent; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25); }
.swatch.on { border-color: #fff; }
.swatches input[type=color] { width: 38px; height: 38px; border: 0; padding: 0; border-radius: 99px; background: none; }
input[type=range] { width: 100%; accent-color: var(--accent); }

.picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 50vh; overflow: auto; border-radius: 14px; }
.picker-grid button { aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .06); position: relative; }
.picker-grid img { width: 100%; height: 100%; object-fit: cover; }
.picker-grid button.on { outline: 3px solid var(--accent); outline-offset: -3px; }

.list { border: 1px solid var(--hair); border-radius: 16px; overflow: hidden; margin: 0 0 16px; }
.list > * { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--hair); }
.list > *:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list small { display: block; color: var(--ink-3); }
.settings-group { margin: 0 0 26px; }
.settings-group > h3 { font: 500 22px/1.2 var(--serif); margin: 0 0 12px; color: var(--gold); }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: calc(30px + var(--safe-t)) 16px calc(30px + var(--safe-b)); }
.login-card { width: 100%; max-width: 420px; text-align: center; }
.login-card h1 { font: 400 clamp(58px, 16vw, 92px)/0.95 var(--script); margin: 0 0 6px; text-shadow: 0 4px 40px rgba(0, 0, 0, .5); }
.login-card .lead { font: italic 400 21px/1.4 var(--serif); color: var(--ink-2); margin: 0 0 30px; }
.login-panel { background: var(--glass); border: 1px solid var(--hair-2); border-radius: var(--r-lg); padding: 26px 22px; backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); box-shadow: var(--shadow); text-align: left; }
.login-panel h2 { font: 500 26px/1.2 var(--serif); margin: 0 0 4px; text-align: center; }
.login-panel .sub { color: var(--ink-2); text-align: center; margin: 0 0 20px; font-size: 15px; }
.login-panel .err { color: var(--danger); font-size: 14px; min-height: 20px; margin: -4px 0 10px; text-align: center; }
.login-panel .link { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--ink-3); font-size: 14px; }
.login-hearts { color: var(--accent); margin: 0 auto 18px; display: block; }

/* ------------------------------------------------------------------ lightbox */
.lb { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; flex-direction: column; animation: fade .2s ease; touch-action: none; user-select: none; -webkit-user-select: none; }
.lb-stage { position: relative; flex: 1; overflow: hidden; }
.lb-track { position: absolute; inset: 0; display: flex; will-change: transform; }
.lb-slide { flex: 0 0 100%; height: 100%; position: relative; overflow: hidden; display: grid; place-items: center; }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: 0 0; will-change: transform; -webkit-user-drag: none; }
.lb-slide video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; background: #000; touch-action: auto; }
.lb-top, .lb-bottom { position: absolute; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 10px 12px; transition: opacity .25s; }
.lb-top { top: 0; padding-top: calc(10px + var(--safe-t)); background: linear-gradient(180deg, rgba(0, 0, 0, .65), transparent); }
.lb-bottom { bottom: 0; padding-bottom: calc(12px + var(--safe-b)); background: linear-gradient(0deg, rgba(0, 0, 0, .75), transparent); flex-direction: column; align-items: stretch; }
.lb.chrome-off .lb-top, .lb.chrome-off .lb-bottom { opacity: 0; pointer-events: none; }
.lb-count { flex: 1; text-align: center; font-size: 14px; color: var(--ink-2); }
.lb-caption { text-align: center; font: italic 400 19px/1.4 var(--serif); padding: 0 12px 10px; color: var(--ink); }
.lb-actions { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.lb-actions button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 70px; padding: 8px 6px; border: 0; background: none; color: var(--ink); font-size: 12px; border-radius: 12px; }
.lb-actions button:hover { background: rgba(255, 255, 255, .1); }
.lb-actions button .icon { width: 24px; height: 24px; }
.lb-actions button.danger { color: var(--danger); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; display: none; }
@media (hover: hover) { .lb-nav { display: grid; } }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }
.lb-zoom { position: absolute; right: 14px; bottom: 140px; z-index: 3; display: none; flex-direction: column; gap: 8px; }
@media (hover: hover) { .lb-zoom { display: flex; } }

/* ------------------------------------------------------------------ toasts / upload progress */
#toasts { position: fixed; left: 0; right: 0; top: calc(12px + var(--safe-t)); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 440px; width: fit-content; padding: 12px 18px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--hair-2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow); font-size: 15px; animation: drop .3s var(--ease); }
.toast.err { border-color: rgba(255, 138, 138, .5); }
.toast .bar { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .15); overflow: hidden; margin-top: 8px; min-width: 240px; }
.toast .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }

.install-tip { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 60; max-width: 460px; margin: 0 auto; padding: 16px 18px; border-radius: 20px; background: var(--glass-strong); border: 1px solid var(--hair-2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start; font-size: 15px; animation: up .4s var(--ease); }
.install-tip img { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.install-tip b { font-weight: 600; }
.install-tip .x { margin-left: auto; background: none; border: 0; color: var(--ink-3); padding: 2px; }

.loading { min-height: 60vh; display: grid; place-items: center; color: var(--accent); }
.fade-in { animation: fadeUp .5s var(--ease) backwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

/* ------------------------------------------------------------------ heart map & check-ins */
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.map-card { position: relative; height: 62vh; min-height: 360px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--hair); background: #1b0d14; margin: 6px 0 18px; }
.map-card .leaflet-container { width: 100%; height: 100%; background: #1b0d14; font: inherit; }
.mini-map { height: 240px; border-radius: 16px; overflow: hidden; border: 1px solid var(--hair-2); margin: 0 0 8px; background: #1b0d14; }
.mini-map .leaflet-container { width: 100%; height: 100%; background: #1b0d14; }
.map-hint { font-size: 13px; color: var(--ink-3); margin: 0 0 16px; }
.leaflet-tile-pane { filter: saturate(.75) hue-rotate(-12deg) brightness(1.05); }
.heart-pin { color: var(--accent); filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .55)); transition: transform .2s; }
.heart-pin svg { width: 100%; height: 100%; display: block; }
.heart-pin.focus { animation: pinpop 1.6s ease-in-out 3; }
@keyframes pinpop { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.35); } }
.leaflet-popup-content-wrapper { background: var(--glass-strong) !important; color: var(--ink) !important; border: 1px solid var(--hair-2); border-radius: 18px !important; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow) !important; }
.leaflet-popup-tip { background: #2a1220 !important; }
.leaflet-popup-content { margin: 14px 16px !important; min-width: 210px; font: 14px/1.45 var(--sans); }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-2) !important; }
.leaflet-control-attribution { background: rgba(20, 8, 14, .7) !important; color: var(--ink-3) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.leaflet-bar a { background: var(--glass-strong) !important; color: var(--ink) !important; border-color: var(--hair) !important; }
.pop h4 { margin: 0 0 2px; font: 500 21px/1.15 var(--serif); }
.pop .when { color: var(--gold); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.pop .note { margin: 8px 0 0; font: italic 16px/1.4 var(--serif); color: var(--ink-2); }
.pop .ev { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--ink) !important; }
.pop .ev img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; }
.pop .row-btns { display: flex; gap: 6px; margin-top: 10px; }
.checkin-list { display: grid; gap: 10px; }
.checkin-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; background: var(--glass); border: 1px solid var(--hair); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); text-align: left; width: 100%; }
.checkin-item .pin { width: 40px; height: 40px; flex: none; border-radius: 99px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.checkin-item .grow { flex: 1; min-width: 0; }
.checkin-item b { display: block; font: 500 19px/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.checkin-item small { color: var(--ink-3); }
.map-stats { display: flex; gap: 18px; color: var(--ink-2); font-size: 14px; }
.map-stats b { font: 500 26px/1 var(--serif); color: var(--accent); display: block; }
.pop a.btn, .pop a.btn:visited { color: var(--ink) !important; }
.place-search { position: relative; margin: 0 0 10px; }
.place-search .ps-icon { position: absolute; left: 14px; top: 15px; color: var(--ink-3); pointer-events: none; }
.place-search input { width: 100%; min-height: 48px; padding: 12px 16px 12px 40px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid var(--hair-2); outline: none; font-size: 16px; -webkit-appearance: none; appearance: none; }
.place-search input:focus { border-color: var(--accent); background: rgba(255, 255, 255, .09); }
.ps-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1000; max-height: 300px; overflow: auto; border-radius: 16px; background: #2b1220; border: 1px solid var(--hair-2); box-shadow: var(--shadow); }
.ps-results button { display: block; width: 100%; text-align: left; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--hair); background: none; }
.ps-results button:last-child { border-bottom: 0; }
.ps-results button:hover, .ps-results button:focus { background: rgba(255, 255, 255, .06); }
.ps-results b { display: block; font-weight: 500; }
.ps-results small { color: var(--ink-3); }
.ps-msg { padding: 14px 16px; color: var(--ink-2); font-size: 14px; }

/* ------------------------------------------------------------------ the plan (itinerary) */
.plan { background: var(--glass); border: 1px solid var(--hair); border-radius: var(--r); padding: 18px 20px; margin: 0 0 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.plan-empty { margin: 6px 0 0; color: var(--ink-2); font: italic 18px/1.4 var(--serif); }
.timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 78px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--hair); cursor: pointer; position: relative; }
.tl-item:first-child { border-top: 0; }
.tl-time { font: 500 19px/1.2 var(--serif); color: var(--accent); white-space: nowrap; padding-top: 1px; }
.tl-body b { display: block; font-weight: 500; font-size: 16px; }
.tl-body small { display: block; color: var(--ink-3); margin-top: 3px; }
.tl-body p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; white-space: pre-wrap; }
.tl-loc, .tl-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; margin-right: 12px; color: var(--ink-2); font-size: 14px; text-decoration: underline; text-decoration-color: var(--hair-2); text-underline-offset: 3px; }
.tl-flag { display: inline-block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); vertical-align: 2px; margin-left: 4px; }
.tl-item.surprise .tl-body b { color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; display: inline !important; }
.planner-tag { position: absolute; top: 10px; left: 10px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 99px; background: rgba(15, 5, 10, .55); color: var(--ink-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); max-width: calc(100% - 70px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Whose turn is always shown on empty letter tiles that have a planner. */
.ev-tile.ghost .ghost-hint { opacity: 1; }
.ev-tile.ghost:not(:hover) .ghost-hint { color: var(--ink-3); }
.ev-tile.ghost .planner-tag { background: rgba(255, 255, 255, .06); border: 1px solid var(--hair); }

/* Tile text: activity, then food, then the spot — stacked from the bottom. */
.ev-tile .tile-text { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; flex-direction: column; gap: 3px; }
.ev-tile .tile-text .letter, .ev-tile .tile-text .cap { position: static; max-width: none; }
.ev-tile .tile-text .letter { margin-bottom: 3px; }
.ev-tile .cap.food { display: flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 500; }
.ev-tile .cap.food .icon { color: var(--accent); flex: none; }
.page-hero .food-line { display: flex; align-items: center; gap: 8px; color: var(--ink); font-style: normal; }
.page-hero .food-line .icon { color: var(--accent); width: 18px; height: 18px; }
.ev-tile .letter.longer { font-size: 22px; }
@media (min-width: 640px) { .ev-tile .letter.longer { font-size: 24px; } }

/* ------------------------------------------------------------------ gestures (installed app) */
#app { will-change: auto; }
#app.swiping { box-shadow: -24px 0 50px rgba(0, 0, 0, .55); min-height: 100vh; background: var(--wine); }
.ptr { position: fixed; left: 50%; top: calc(var(--safe-t) + 6px); z-index: 90; width: 40px; height: 40px; margin-top: -44px; border-radius: 99px; display: grid; place-items: center; color: var(--ink-3); background: var(--glass-strong); border: 1px solid var(--hair-2); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 0) scale(.6); pointer-events: none; }
.ptr .icon { width: 20px; height: 20px; }
.ptr.ready, .ptr.spinning { color: var(--accent); }
.ptr.spinning .icon { animation: beat 1s ease-in-out infinite; }
.back-hint { position: fixed; left: 8px; top: 50%; z-index: 90; width: 40px; height: 40px; border-radius: 99px; display: grid; place-items: center; background: var(--glass-strong); border: 1px solid var(--hair-2); color: var(--ink); opacity: 0; transform: translate(0, -50%); pointer-events: none; transition: opacity .2s; }

/* Pinned top bar. position:sticky can vanish while scrolling in iPhone home-screen apps;
   position:fixed doesn't. main gets the same space the bar used to take up. */
.topbar { position: fixed; top: 0; left: 0; right: 0; }
#app > main { padding-top: calc(var(--safe-t) + 60px); }
#app.swiping { box-shadow: none; background: none; }
#app.swiping main { box-shadow: -24px 0 50px rgba(0, 0, 0, .55); background: var(--wine); min-height: 100vh; }

/* adventure type picker */
.type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.type-pick label { position: relative; cursor: pointer; }
.type-pick input { position: absolute; opacity: 0; pointer-events: none; }
.type-pick span { display: block; height: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--hair-2); background: rgba(255, 255, 255, .04); transition: border-color .2s, background .2s; }
.type-pick b { display: block; font-weight: 500; }
.type-pick small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.type-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.type-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ the usuals */
.tabs { display: flex; gap: 6px; padding: 5px; margin: 0 0 18px; border-radius: 99px; background: var(--glass); border: 1px solid var(--hair); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabs button { flex: 1; height: 42px; border: 0; border-radius: 99px; background: none; color: var(--ink-2); font-weight: 500; font-size: 15px; transition: background .2s, color .2s; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.usual-group { margin: 0 0 22px; }
.usual-kind { font: 500 13px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; }
.usual-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .usual-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .usual-grid { grid-template-columns: repeat(3, 1fr); } }
.usual { background: var(--glass); border: 1px solid var(--hair); border-radius: var(--r); padding: 14px 16px 16px; cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: border-color .2s, transform .2s; }
.usual:hover { border-color: var(--accent-line); }
.usual:active { transform: scale(.99); }
.usual header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.usual h3 { margin: 0; font: 500 24px/1.15 var(--serif); }
.usual ul { list-style: none; margin: 8px 0 0; padding: 0; }
.usual li { position: relative; padding: 5px 0 5px 22px; font-size: 16px; border-top: 1px solid var(--hair); }
.usual li:first-child { border-top: 0; }
.usual li::before { content: '♥'; position: absolute; left: 2px; top: 6px; font-size: 11px; color: var(--accent); }
.usual-notes { margin: 10px 0 0; font: italic 17px/1.4 var(--serif); color: var(--ink-2); white-space: pre-wrap; }
.back span { max-width: 34vw; }
.usual li.prompt { color: var(--ink-3); }
.usual li.prompt::before { color: var(--ink-3); opacity: .6; }
.usual li.prompt span { opacity: .5; }
.usual.untouched { border-style: dashed; }
.usual .fill-in { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.ps-kind { display: inline-block; margin-right: 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.tl-kind { margin-right: 6px; }
