/* ==========================================================================
   Cineroll design tokens
   Palette: near-black cinema charcoal, marquee-gold accent, film-reel teal.
   Display type: Oswald (condensed, marquee-poster feel) — body: Inter.
   Motif: the perforated "ticket stub" edge, used sparingly on hero cards.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1e2530;
  --border: #2a323f;
  --text: #f3f1ec;
  --text-muted: #8c93a1;
  --gold: #e8a33d;
  --gold-dim: #7a5a29;
  --teal: #3fa796;
  --red: #e2574c;
  --green: #5cb87a;

  --radius: 10px;
  --radius-lg: 16px;
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --glass-bg: rgba(255, 255, 255, 0.10);
  --glass-strong: rgba(255, 255, 255, 0.18);
  --glass-border: rgba(255, 255, 255, 0.24);
  --glass-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.38), inset 0 -1px 0 rgba(255, 255, 255, 0.06);

  color-scheme: dark;
}

:root[data-theme='light'] {
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-strong: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 12px 32px rgba(40, 40, 60, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(255, 255, 255, 0.4);
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-2: #ecebe6;
  --border: #ddd9d0;
  --text: #17181a;
  --text-muted: #6b6f76;
  --gold-dim: #f0d9ad;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #f5f4f1;
    --surface: #ffffff;
    --surface-2: #ecebe6;
    --border: #ddd9d0;
    --text: #17181a;
    --text-muted: #6b6f76;
    --gold-dim: #f0d9ad;
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-strong: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.85);
    --glass-shadow: 0 12px 32px rgba(40, 40, 60, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(255, 255, 255, 0.4);
    color-scheme: light;
  }
}

/* Glass lens tokens */
:root {
  --sel-tint: rgba(0, 0, 0, 0.30);
  --sel-hl: rgba(255, 255, 255, 0.85);
  --sel-hl-soft: rgba(255, 255, 255, 0.35);
  --sel-rim: rgba(255, 255, 255, 0.34);
  --sel-shadow: 0, 0, 0;
  --nav-fill: rgba(255, 255, 255, 0.010);
}
:root[data-theme='light'] {
  --sel-tint: rgba(20, 22, 34, 0.11);
  --sel-hl: rgba(255, 255, 255, 1);
  --sel-hl-soft: rgba(255, 255, 255, 0.7);
  --sel-rim: rgba(255, 255, 255, 0.95);
  --sel-shadow: 30, 30, 50;
  --nav-fill: rgba(255, 255, 255, 0.06);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --sel-tint: rgba(20, 22, 34, 0.11);
    --sel-hl: rgba(255, 255, 255, 1);
    --sel-hl-soft: rgba(255, 255, 255, 0.7);
    --sel-rim: rgba(255, 255, 255, 0.95);
    --sel-shadow: 30, 30, 50;
    --nav-fill: rgba(255, 255, 255, 0.06);
  }
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-padding-top: env(safe-area-inset-top, 0px); }
/* ONE sizing rule for the whole app, Safari and Home Screen alike: the page is the normal scrolling document and is at
   least one dynamic viewport tall (dvh follows Safari's toolbar as it shows/hides; installed, it is the full screen). */
body { min-height: 100vh; min-height: 100dvh; width: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

a { color: inherit; }
button { font-family: var(--font-body); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------------- */
/* Top navigation                                                         */
/* ---------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}
/* the iOS install banner already added the top inset above the bar */
html.has-ios-banner .topbar { padding-top: 0; }

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.03em;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.brand .plus { color: var(--gold); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.coffee-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.coffee-btn:hover { border-color: var(--gold); }

/* Primary nav (desktop: inline under topbar; mobile: bottom tab bar) */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 10px;
}
.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.nav-link.active { color: var(--text); background: var(--surface-2); border-color: var(--border); }

/* Circular gold add-movie button, embedded inline rather than floating. */
.fab-island, .fab-inline {
  border-radius: 50%;
  background: var(--gold);
  color: #1a1408;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.fab-island .icon, .fab-inline .icon { width: 24px; height: 24px; }

/* Desktop: sits inline among the top nav links. */
.fab-inline { width: 38px; height: 38px; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }

/* Mobile: sits inside the glass tab bar, in the middle. */
.fab-island {
  width: 50px;
  height: 50px;
  margin: 0 4px;
  background: linear-gradient(180deg, #f6c062, var(--gold));
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 16px rgba(232, 163, 61, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* ---------------------------------------------------------------------- */
/* Icons -- CSS-masked SVGs so color follows the theme automatically.     */
/* To use your own icons: replace the file at the same path in            */
/* public/icons/nav/ (keep it roughly square; a single-color line/glyph   */
/* SVG works best since mask-image ignores color and keeps only shape).   */
/* ---------------------------------------------------------------------- */
.icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  flex-shrink: 0;
}
.icon-home { -webkit-mask-image: url('/public/icons/nav/home.svg'); mask-image: url('/public/icons/nav/home.svg'); }
.icon-calendar { -webkit-mask-image: url('/public/icons/nav/calendar.svg'); mask-image: url('/public/icons/nav/calendar.svg'); }
.icon-watchlist { -webkit-mask-image: url('/public/icons/nav/watchlist.svg'); mask-image: url('/public/icons/nav/watchlist.svg'); }
.icon-pencil { -webkit-mask-image: url('/public/icons/nav/pencil.svg'); mask-image: url('/public/icons/nav/pencil.svg'); }
.icon-settings { -webkit-mask-image: url('/public/icons/nav/settings.svg'); mask-image: url('/public/icons/nav/settings.svg'); }
.icon-coffee { -webkit-mask-image: url('/public/icons/nav/coffee.svg'); mask-image: url('/public/icons/nav/coffee.svg'); }
.icon-account { -webkit-mask-image: url('/public/icons/nav/account.svg'); mask-image: url('/public/icons/nav/account.svg'); }
.icon-theater-price { -webkit-mask-image: url('/public/icons/nav/theater-price.svg'); mask-image: url('/public/icons/nav/theater-price.svg'); }
.icon-ticket { -webkit-mask-image: url('/public/icons/nav/ticket.svg'); mask-image: url('/public/icons/nav/ticket.svg'); }
.icon-search { -webkit-mask-image: url('/public/icons/nav/search.svg'); mask-image: url('/public/icons/nav/search.svg'); }
.icon-refresh { -webkit-mask-image: url('/public/icons/nav/refresh.svg'); mask-image: url('/public/icons/nav/refresh.svg'); }
.icon-bell { -webkit-mask-image: url('/public/icons/nav/bell.svg'); mask-image: url('/public/icons/nav/bell.svg'); }
.icon-user-plus { -webkit-mask-image: url('/public/icons/nav/user-plus.svg'); mask-image: url('/public/icons/nav/user-plus.svg'); }
.icon-plus { -webkit-mask-image: url('/public/icons/nav/plus.svg'); mask-image: url('/public/icons/nav/plus.svg'); }

.bottom-tabs .icon { width: 20px; height: 20px; }
.coffee-btn .icon { width: 16px; height: 16px; }

.bottom-tabs {
  display: none;
}

@media (max-width: 480px) {
  #sync-label { display: none; }
  .brand { font-size: 19px; }
  .topbar-inner { gap: 8px; }
}

@media (max-width: 720px) {
  .primary-nav { display: none; }
  /* Liquid-glass tab bar: a small floating pill. Layers, bottom to top:
       .nav-glass    frosted glass: very light fill, blur, drop shadow. NEVER cut, so the
                     bar stays frosted even under the selector.
       .nav-rim      reflection, specular rim and prismatic edge (cut under the selector)
       .nav-row      the real tabs (cut under the selector)
       .nav-selector the glass lens (see js/lib/glass-nav.js)
     JS cuts a lens-shaped hole in .nav-rim and .nav-row under the lens, so the lens's
     own copy is the only thing drawn there (no double images). */
  .bottom-tabs {
    display: block;
    position: fixed;
    left: 14px; right: 14px;
    max-width: 372px;
    margin: 0 auto;
    bottom: calc(4px + env(safe-area-inset-bottom, 0px) * 0.2);
    border-radius: 999px;
    z-index: 20;
    touch-action: pan-y; /* horizontal drags: the lens. vertical: the page. (`none` left iOS with stale touch regions after scrolling) */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-glass {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.02)), var(--nav-fill);
    -webkit-backdrop-filter: blur(3px) saturate(165%) brightness(1.04);
    backdrop-filter: blur(3px) saturate(165%) brightness(1.04);
    box-shadow: 0 10px 28px rgba(var(--sel-shadow), 0.26);
  }
  /* Chromium only: bend the page behind the bar's curved edge. */
  .lg-refract .nav-glass {
    backdrop-filter: url(#lg-bar) blur(1.5px) saturate(165%) brightness(1.04);
  }
  /* Bar edge light: only large, soft falloffs (no lines, no rings), so the glass reads as one
     smooth piece instead of a bar inside a bar. */
  .nav-rim {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    box-shadow:
      inset 0 0 12px rgba(255, 255, 255, 0.17),
      inset 0 2px 6px -3px rgba(255, 255, 255, 0.50),
      inset 0 -2px 6px -4px rgba(255, 255, 255, 0.16);
  }
  /* Soft diagonal reflection across the glass. */
  .nav-rim::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(112deg, transparent 12%, rgba(255, 255, 255, 0.07) 30%, rgba(255, 255, 255, 0.015) 44%, transparent 56%);
  }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .nav-glass { background: var(--surface); }
  }

  .nav-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px;
  }
  .bottom-tabs .nav-link {
    flex: 1;
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 7px 2px 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    color: var(--text-muted);
    transition: color 0.25s ease;
  }
  /* The lens replaces the old per-tab "active" pill; colour follows the lens via .lit. */
  .bottom-tabs .nav-link.active { background: none; border-color: transparent; box-shadow: none; color: var(--text-muted); }
  .bottom-tabs .nav-link.lit { color: var(--gold); }
  .bottom-tabs .fab-island { width: 44px; height: 44px; margin: 0 2px; }
  .bottom-tabs .fab-island .icon { width: 20px; height: 20px; }

  /* ---- The lens ---------------------------------------------------------------
     --g (0..1) is driven from JS: 0 = resting on the bar, 1 = grabbed/dragging.
     Its middle is clear glass; only the rim carries highlights. The bar's frosted
     glass keeps showing through it (the lens adds almost no blur of its own). */
  .nav-selector {
    --g: 0;
    position: absolute;
    left: 0; top: 0;
    z-index: 2;
    width: 60px; height: 46px;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    will-change: transform;
    -webkit-backdrop-filter: blur(calc(2px * var(--g)));
    backdrop-filter: blur(calc(2px * var(--g)));
    box-shadow: 0 calc(2px + 10px * var(--g)) calc(7px + 18px * var(--g)) rgba(var(--sel-shadow), calc(0.22 + 0.08 * var(--g)));
  }
  .nav-selector.is-ready { opacity: 1; }
  .nav-selector.is-ready.is-hidden { opacity: 0; }

  /* Resting tint: flatter and slightly darker; gone while dragging. */
  .nav-selector::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--sel-tint);
    opacity: calc(1 - var(--g));
  }
  .sel-clip {
    position: absolute;
    inset: 0;
    z-index: 1;
    clip-path: inset(0 round 999px);
    -webkit-clip-path: inset(0 round 999px);
    pointer-events: none;
  }
  /* Idle: a plain DOM copy of the tab row. Active: the smooth warped canvas instead. */
  .sel-static { position: absolute; inset: 0; pointer-events: none; }
  .sel-content {
    position: absolute;
    left: calc(var(--l) * -1px);
    top: calc(var(--t) * -1px);
    width: calc(var(--bw) * 1px);
    height: calc(var(--bh) * 1px);
    pointer-events: none;
  }
  .sel-content .nav-row { position: absolute; inset: 0; }
  .sel-canvas { position: absolute; display: block; pointer-events: none; visibility: hidden; }
  .nav-selector.is-warp .sel-canvas { visibility: visible; }
  .nav-selector.is-warp .sel-static { visibility: hidden; }

  /* Soft glass edge: feathered light that grows while dragging. No lines, no rings, no fixed
     colour. Colour only ever appears where the warped view bends something (see drawLens). */
  .nav-selector::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    box-shadow:
      inset 0 0 calc(4px + 8px * var(--g)) rgba(255, 255, 255, calc(0.07 + 0.10 * var(--g))),
      inset 0 2px 6px -3px rgba(255, 255, 255, calc(0.28 + 0.22 * var(--g))),
      inset 0 -2px 6px -4px rgba(255, 255, 255, calc(0.08 + 0.08 * var(--g)));
  }
  main.container { padding-bottom: 140px; }

  .toast { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
}

@media (min-width: 721px) {
  .fab-island { display: none; }
}
@media (max-width: 720px) {
  .fab-inline { display: none; }
}

/* ---------------------------------------------------------------------- */
/* Cards + ticket stub motif                                              */
/* ---------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.ticket-stub {
  position: relative;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow: visible;
}
.ticket-stub::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: var(--bg);
  border-radius: 50%;
}
.ticket-stub::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: var(--bg);
  border-radius: 50%;
}

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-top: 16px; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-family: var(--font-display); font-size: 28px; }
.stat-value.gold { color: var(--gold); }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------- */
/* Forms                                                                  */
/* ---------------------------------------------------------------------- */

label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font-body);
}
input:focus, select:focus, textarea:focus, button:focus-visible, .nav-link:focus-visible, .option-chip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.field { margin-bottom: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1408; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: var(--red); background: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.option-chip {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 14px;
}
.option-chip.selected { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface-2)); }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------------------------------------------------------------------- */
/* Movie cards                                                            */
/* ---------------------------------------------------------------------- */

.movie-row {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
}
.movie-poster {
  width: 48px; height: 72px;
  border-radius: 6px;
  background: var(--surface-2);
  object-fit: cover;
  flex-shrink: 0;
}
.movie-row.planned { opacity: 0.55; }
.movie-title { font-weight: 600; }
.movie-meta { font-size: 13px; color: var(--text-muted); }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.badge.watched { color: var(--green); }
.badge.planned { color: var(--gold); }

.stars { color: var(--gold); letter-spacing: 2px; font-size: 15px; }

.star-meter {
  position: relative;
  display: inline-block;
  color: var(--border);
  letter-spacing: 2px;
  font-size: 14px;
  line-height: 1;
}
.star-meter.plain { color: color-mix(in srgb, currentColor 28%, transparent); }
.star-meter.plain::before { color: currentColor; }
.star-meter::before {
  content: '★★★★★';
  position: absolute;
  inset: 0;
  width: var(--pct, 0%);
  overflow: hidden;
  color: var(--gold);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------- */
/* Calendar: each day is a poster-shaped (2:3) tile filled with the poster */
/* ---------------------------------------------------------------------- */

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--text-muted); padding-bottom: 4px; }
.cal-cell {
  position: relative;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
}
.cal-cell.outside { opacity: 0.35; }
.cal-cell.today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.cal-date { position: absolute; top: 4px; left: 6px; z-index: 2; font-size: 12px; color: var(--text-muted); }
.cal-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-poster.fallback {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 18px 4px 4px; font-size: 10px; line-height: 1.2; color: var(--text-muted);
  background: var(--surface-2); word-break: break-word;
}
.cal-cell.has-movie::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.62), transparent 42%);
}
.cal-cell.has-movie .cal-date { color: #fff; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
.cal-cell.planned-only { border-style: dashed; }
/* upcoming posters stay fully visible on the calendar (only Friends activity dims planned movies) */
.cal-count {
  position: absolute; right: 4px; bottom: 4px; z-index: 2;
  background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
}
@media (max-width: 640px) {
  .cal-grid { gap: 3px; }
  .cal-date { font-size: 10px; top: 3px; left: 4px; }
}

/* ---------------------------------------------------------------------- */
/* Guided add-movie prompts                                               */
/* ---------------------------------------------------------------------- */

.prompt-screen { max-width: 480px; margin: 0 auto; padding: 32px 4px; }
.prompt-question { font-family: var(--font-display); font-size: 24px; margin-bottom: 18px; }
.prompt-progress { display: flex; gap: 4px; margin-bottom: 24px; }
.prompt-progress span { flex: 1; height: 3px; background: var(--border); border-radius: 2px; }
.prompt-progress span.done { background: var(--gold); }

/* ---------------------------------------------------------------------- */
/* Sheets / modals                                                        */
/* ---------------------------------------------------------------------- */

.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } }
.sheet {
  background: var(--surface);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 640px) { .sheet { border-radius: 16px; } }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.close-x { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state .btn { margin-top: 14px; }

.sync-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.sync-dot.synced { background: var(--green); }
.sync-dot.syncing { background: var(--gold); animation: pulse 1.2s infinite; }
.sync-dot.error { background: var(--red); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.toast {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 60;
  pointer-events: none; /* a message must never catch taps meant for what is under it */
}

section.page { padding: 24px 0 48px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------------- */
/* Misc components added for Cineroll                                      */
/* ---------------------------------------------------------------------- */

.hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

.link-btn { background: none; border: none; padding: 0; color: var(--gold); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.card-head, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.btn.small { padding: 6px 12px; font-size: 12px; }
a.btn, a.option-chip { text-decoration: none; color: inherit; }

.sub-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.stat-row.compact { grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 14px; }
.stat-row.compact .stat-value { font-size: 24px; }

/* Segmented control (Watchlist/Watched, Tickets tabs) */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; margin-bottom: 16px; }
.seg button { flex: 1; border: none; background: transparent; color: var(--text-muted); padding: 9px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button.active { background: var(--gold); color: #1a1408; }

/* Profile */
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--gold); }
.avatar { position: relative; overflow: hidden; width: 48px; height: 48px; border-radius: 50%; background: var(--gold); color: #1a1408; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 22px; flex-shrink: 0; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 15px; }
.avatar.lg { width: 84px; height: 84px; font-size: 38px; }
.link-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.link-row { display: flex; align-items: center; gap: 12px; padding: 15px 16px; text-decoration: none; border-bottom: 1px solid var(--border); font-size: 15px; }
.link-row:last-child { border-bottom: none; }
.link-row .chev { margin-left: auto; color: var(--text-muted); font-size: 20px; }
.link-row small { color: var(--text-muted); }

/* Star slider (rating) */
.star-slider { --ss-size: 30px; display: inline-block; }
.star-slider.lg { --ss-size: 46px; }
.ss-track { --v: 0; position: relative; display: inline-block; font-size: var(--ss-size); line-height: 1.15; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; border-radius: 8px; }
.ss-row { display: flex; }
.ss-row span { width: 1.1em; text-align: center; flex: none; }
.ss-track > .ss-row { color: var(--border); }
.ss-fill { position: absolute; top: 0; left: 0; bottom: 0; width: calc(var(--v) * 1.1em); overflow: hidden; color: var(--gold); pointer-events: none; }
.ss-fill .ss-row { width: 5.5em; }
.ss-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--text-muted); }
.ss-value.set { color: var(--gold); font-weight: 700; }

/* ---------------------------------------------------------------------- */
/* v2: swipeable summary blocks, switches, search results, friends, etc.  */
/* ---------------------------------------------------------------------- */

.icon-spending { -webkit-mask-image: url('/public/icons/nav/spending.svg'); mask-image: url('/public/icons/nav/spending.svg'); }

/* Swipeable blocks (Home: subscription period / year) */
.swipe { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding: 2px 12px 6px; margin: 0 -12px; scroll-padding: 0 12px; scrollbar-width: none; }
.swipe::-webkit-scrollbar { display: none; }
.swipe-item { flex: 0 0 90%; scroll-snap-align: center; cursor: pointer; }
.swipe-item .ticket-stub { height: 100%; }
.swipe-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.swipe-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: background 0.2s, transform 0.2s; }
.swipe-dots span.on { background: var(--gold); transform: scale(1.25); }
@media (min-width: 760px) {
  .swipe-item { flex-basis: calc(50% - 6px); }
  .swipe-dots { display: none; }
}

/* Sub tabs (Monthly / Yearly / ...) under the main Spending toggle */
.subtabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { border: 1px solid var(--border); background: transparent; color: var(--text-muted); padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.subtabs button.active { color: var(--gold); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }

/* Toggle switches (privacy + notifications) */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; margin: 0; color: var(--text); font-size: 14px; }
.switch-row:last-of-type { border-bottom: none; }
.switch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-label { font-weight: 600; }
.switch-desc { font-size: 12px; color: var(--text-muted); font-weight: 400; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; padding: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); position: relative; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
input.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--text-muted); transition: transform 0.2s, background 0.2s; }
input.switch:checked { background: color-mix(in srgb, var(--gold) 30%, var(--surface-2)); border-color: var(--gold); }
input.switch:checked::after { transform: translateX(18px); background: var(--gold); }
input.switch:disabled { opacity: 0.45; cursor: not-allowed; }

/* Movie search dropdown */
.search-results { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }

/* Friends + activity */
.feed-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; border-bottom: 1px solid var(--border); }
.feed-row:last-child { border-bottom: none; }
.feed-row .feed-text { min-width: 0; flex: 1; font-size: 14px; line-height: 1.35; }
.feed-row .feed-text strong { font-weight: 600; }
.feed-row .movie-poster { width: 34px; height: 51px; }
.pill-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; margin-left: 6px; }
.member-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); margin-right: 4px; }
.status-dot.going { background: var(--green); }
.status-dot.declined { background: var(--red); }

/* Profile */
.profile-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.profile-hero .handle { font-family: var(--font-display); font-size: 26px; line-height: 1.1; word-break: break-all; }
.fav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.fav-slot { position: relative; aspect-ratio: 2 / 3; border-radius: 8px; border: 1px dashed var(--border); background: var(--surface-2); overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text-muted); font-size: 22px; cursor: pointer; padding: 0; }
.fav-slot.filled { border-style: solid; }
.fav-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fav-slot .fav-title { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 4px; font-size: 10px; line-height: 1.2; color: var(--text); word-break: break-word; }
.fav-slot.readonly { cursor: default; }

/* Concessions */
.money-input { display: flex; align-items: center; gap: 8px; }
.money-input span { color: var(--text-muted); font-size: 18px; }
.calendar-nav-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
.calendar-nav-wrap .watchlist-link-row { display: flex; justify-content: flex-end; }
.forgot-link { background: none; border: none; padding: 0; color: var(--text-muted); font-size: 12px; text-decoration: underline; cursor: pointer; }
.forgot-link:hover { color: var(--gold); }
.auth-btn-active { background: var(--gold) !important; border-color: var(--gold) !important; color: #1a1408 !important; }
.notice { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.notice strong { color: var(--text); }
.danger-zone { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 18px; }

/* ---------------------------------------------------------------------- */
/* Sept 2026 round: calendar nav, auth, Home strips, friends, info sheets  */
/* ---------------------------------------------------------------------- */

/* Calendar: Today - Prev - Month/Year - Next, one symmetrical row above the date blocks */
.cal-nav { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px; margin-bottom: 14px; }
.cal-nav .btn { padding: 9px 14px; }
.cal-title { font-family: var(--font-display); font-size: 18px; text-align: center; white-space: nowrap; }
@media (max-width: 480px) {
  .cal-nav { gap: 6px; }
  .cal-nav .btn { padding: 9px 11px; }
  .cal-title { font-size: 16px; }
  .cal-step .btn-word { display: none; }
}

/* Auth */
.auth-hero { text-align: center; padding-top: 28px; }
.auth-choice { width: 100%; padding: 15px 18px; font-size: 16px; }
.auth-switch { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; font-size: 14px; color: var(--text-muted); }
.gate-badge { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--gold) 16%, var(--surface-2)); color: var(--gold); }
.gate-badge .icon { width: 26px; height: 26px; }

/* Home header actions (search + bell) */
.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn .icon { width: 20px; height: 20px; }
.bell-btn { position: relative; }
.bell-badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.bell-badge[hidden] { display: none; }
.notif-h { font-size: 13px; color: var(--text-muted); margin: 14px 0 4px; font-weight: 600; }

.home-block { margin-bottom: 20px; }
.strip-title { font-size: 14px; color: var(--text-muted); margin-bottom: 10px; font-family: var(--font-body); font-weight: 600; }
.strip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* Poster strips. Recently watched = 54x80. Friends activity + Trending = exactly 1.5x = 81x120. */
.poster-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; align-items: flex-start; }
.poster-tile { position: relative; flex-shrink: 0; cursor: pointer; }
.poster-tile.sm { width: 54px; }
.poster-tile.lg { width: 81px; }
.poster-img { display: block; border-radius: 6px; background: var(--surface-2); object-fit: cover; }
.poster-tile.sm .poster-img { width: 54px; height: 80px; }
.poster-tile.lg .poster-img { width: 81px; height: 120px; }
.poster-tile.planned .poster-img { opacity: 0.6; outline: 1px dashed var(--border); outline-offset: -1px; }
/* the text under each large poster (same look for trending and friends) */
.poster-caption { margin-top: 5px; line-height: 1.25; }
.poster-caption .cap-rank { font-size: 11px; font-weight: 700; color: var(--gold); }
.poster-caption .cap-title { font-size: 11px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poster-caption .cap-who { font-size: 11px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.poster-caption .cap-meta { font-size: 10px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 1px; }

/* Empty-state outlines: dashed placeholders that disappear once real content exists */
.poster-outline { flex-shrink: 0; border: 1.5px dashed var(--border); border-radius: 6px; background: transparent; color: var(--text-muted); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.poster-outline.sm { width: 54px; height: 80px; }
.poster-outline.lg { width: 81px; height: 120px; }
.poster-outline .icon { width: 18px; height: 18px; opacity: 0.7; }
.poster-outline:hover { border-color: var(--gold); color: var(--gold); }
.outline-row { border-style: dashed; background: transparent; cursor: pointer; margin-bottom: 8px; }
.outline-row .poster-outline { width: 48px; height: 72px; }
.ghost-line { height: 10px; border-radius: 5px; background: var(--surface-2); margin-bottom: 8px; }
.ghost-line.short { height: 8px; }

/* Invite tiles: as wide as two posters (81 + 8 + 81 = 170px) so an invite can't be missed */
.invite-tile { flex-shrink: 0; width: 170px; height: 120px; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; border: 1px solid var(--gold); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.invite-tile .movie-poster { width: 40px; height: 60px; }
.invite-tile .avatar { width: 40px; height: 40px; font-size: 18px; }
.invite-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.invite-from { font-size: 10px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.03em; }
.invite-movie { font-size: 12px; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.invite-actions { display: flex; gap: 4px; margin-top: 4px; }
.invite-actions .btn.small { padding: 4px 8px; font-size: 11px; }

/* Movie info / friend activity sheets */
.info-top { display: flex; gap: 14px; margin-bottom: 14px; }
.info-poster { width: 92px; height: 138px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.info-plot { font-size: 14px; line-height: 1.55; margin: 0 0 12px; }
.info-credits { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.info-credits span { display: inline-block; min-width: 72px; color: var(--text-muted); }

/* Letterboxd activity rows: [dot] title ........ stars (stars take the text colour) */
.lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; cursor: pointer; }
.theater-ico { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.theater-ico.on { color: var(--text); }
.theater-ico.off { color: var(--text-muted); opacity: 0.85; }
.earned-stars { color: var(--text); letter-spacing: 1px; font-size: 14px; white-space: nowrap; }
.earned-stars .half-star { font-size: 11px; vertical-align: 1px; margin-left: 1px; }
.lb-title { min-width: 0; }
.lb-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ---------- Oct 2026 round ---------- */
.spin { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Add-movie search: the box stays at the top of the sheet and results scroll underneath it */
.prompt-screen.searching { display: flex; flex-direction: column; max-height: calc(var(--vvh, 100vh) - 90px); }
.prompt-screen.searching .search-pane { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sticky-search { position: sticky; top: 0; z-index: 2; background: var(--surface); padding-bottom: 6px; }

/* Segmented controls inside forms (Monthly / Yearly, % / $ …) */
.mini-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; background: var(--surface-2); gap: 2px; }
.mini-seg button { border: 0; background: transparent; color: var(--text-muted); padding: 6px 14px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; }
.mini-seg button.active { background: var(--gold); color: #111; font-weight: 600; }

/* Settings: subscription tiles */
.sub-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; cursor: pointer; }
.sub-tile:hover { border-color: var(--gold); }
.sub-tile .sub-main { flex: 1; min-width: 0; }
.sub-tile .sub-name { font-weight: 600; }
.sub-tile .sub-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sub-tile .sub-price { font-family: var(--font-display); font-size: 18px; white-space: nowrap; }
.sub-group-title { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin: 18px 0 8px; }
.sub-group-title:first-child { margin-top: 0; }
.set-section { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 18px; }
.set-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.set-section h4 { font-size: 14px; margin: 0 0 4px; }
.set-section .hint { color: var(--text-muted); font-size: 12px; margin: 0 0 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.set-row + .set-row { border-top: 1px solid var(--border); }
.set-row .lbl { min-width: 0; }
.set-row .lbl small { display: block; color: var(--text-muted); font-size: 12px; word-break: break-all; }

/* Profile bio + links */
.profile-bio { font-size: 14px; line-height: 1.5; margin: 12px 0 0; white-space: pre-wrap; word-break: break-word; }
.profile-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.profile-links a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--text); text-decoration: none; background: var(--surface-2); }
.profile-links a:hover { border-color: var(--gold); }

/* Giphy picker */
.gif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-auto-rows: 84px; gap: 8px; max-height: 46vh; overflow-y: auto; margin-top: 10px; align-content: start; }
.gif-grid button { position: relative; width: 100%; height: 84px; min-height: 0; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: pointer; }
.gif-grid button:hover, .gif-grid button:focus-visible { border-color: var(--gold); }
.gif-grid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.giphy-credit { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* Movie info block inside the details sheet */
.info-inline { display: flex; gap: 12px; margin-bottom: 16px; }
.info-inline .info-poster { width: 72px; flex-shrink: 0; border-radius: 8px; }
.info-inline .info-plot { font-size: 13px; line-height: 1.45; margin: 6px 0 0; color: var(--text-muted); }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.back-pill { display: inline-flex; align-items: center; gap: 6px; }

.hint-line { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }

/* Home > Coming up: one wide card, then a column at the Trending poster size (81x120) */
.up-poster { width: 81px; height: 120px; object-fit: cover; border-radius: 8px; background: var(--surface-2); flex-shrink: 0; }
.up-hero { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--gold-dim); border-radius: 14px; background: var(--surface-2); cursor: pointer; align-items: center; }
.up-hero .up-title { font-family: var(--font-display); font-size: 22px; line-height: 1.15; margin: 2px 0 6px; }
.up-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.up-row { display: flex; gap: 14px; align-items: center; padding: 10px 2px; cursor: pointer; border-top: 1px solid var(--border); }
.up-row:first-of-type { margin-top: 10px; }
.up-info { min-width: 0; flex: 1; }

.sub-tile.is-off { opacity: .8; cursor: default; }
.sub-tile .switch { flex-shrink: 0; }

/* Profile banner: a GIF that starts at the very top of the page and fades out by the end of the bio/links */
.profile-top { position: relative; isolation: isolate; }
.profile-banner { position: absolute; z-index: -1; left: -20px; right: -20px; top: -140px; bottom: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 18%, rgba(0,0,0,.55) 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 18%, rgba(0,0,0,.55) 55%, transparent 100%); }
.profile-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 25%, transparent), color-mix(in srgb, var(--bg) 60%, transparent)); }
.has-banner .page-header h1, .has-banner .profile-hero .handle { text-shadow: 0 1px 8px rgba(0,0,0,.6); }

/* ---------- Oct 2026 round 2 ---------- */
/* Horizontal poster strips (profile + Coming up): swipe sideways, date under each poster */
.hstrip { display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-bottom: 6px; margin: 0 -2px; scrollbar-width: none; }
.hstrip::-webkit-scrollbar { display: none; }
.hstrip-item { flex: 0 0 auto; width: 84px; cursor: pointer; scroll-snap-align: start; }
.hstrip-poster { width: 84px; height: 124px; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: block; }
.hstrip-title { font-size: 12px; font-weight: 600; margin-top: 6px; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hstrip-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.25; }

/* Pinned "this period / this month" card on Spending */
.now-card { margin-bottom: 14px; }
.now-card .now-sub { font-size: 12px; color: var(--text-muted); margin: 2px 0 10px; }

/* Keyboard: never let a form field zoom the page on iPhone (that was the "pulls the page down" jump) */
@media (max-width: 720px) { input, select, textarea { font-size: 16px; } }
.sheet-backdrop.kb-open { bottom: auto; }
.sheet-backdrop.kb-open .sheet { max-height: 100%; }

/* Notification updates */
.notif-update { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14px; }

/* ---------- Liquid-glass pass ---------- */
:root { --lg-fill: rgba(255, 255, 255, 0.07); --lg-fill-2: rgba(255, 255, 255, 0.11); --lg-line: rgba(255, 255, 255, 0.16); --lg-hi: rgba(255, 255, 255, 0.28); }
:root[data-theme='light'] { --lg-fill: rgba(255, 255, 255, 0.55); --lg-fill-2: rgba(255, 255, 255, 0.7); --lg-line: rgba(0, 0, 0, 0.08); --lg-hi: rgba(255, 255, 255, 0.9); }
@media (prefers-color-scheme: light) { :root:not([data-theme='dark']) { --lg-fill: rgba(255, 255, 255, 0.55); --lg-fill-2: rgba(255, 255, 255, 0.7); --lg-line: rgba(0, 0, 0, 0.08); --lg-hi: rgba(255, 255, 255, 0.9); } }

/* Something colourful behind the glass so it has something to refract */
body { background-color: var(--bg); background-image:
  radial-gradient(60vmax 60vmax at 8% -5%, rgba(232, 163, 61, 0.20), transparent 60%),
  radial-gradient(55vmax 55vmax at 105% 30%, rgba(63, 167, 150, 0.16), transparent 60%),
  radial-gradient(50vmax 50vmax at 20% 110%, rgba(120, 90, 220, 0.14), transparent 60%);
  background-attachment: fixed; }

.topbar { background: rgba(255, 255, 255, 0.04); -webkit-backdrop-filter: blur(22px) saturate(1.8); backdrop-filter: blur(22px) saturate(1.8); border-bottom: 1px solid var(--lg-line); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05); }
.coffee-btn { background: var(--lg-fill-2); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6); border: 1px solid var(--lg-line); box-shadow: inset 0 1px 0 var(--lg-hi); }

.card, .ticket-stub, .link-list, .up-hero, .swipe-item .ticket-stub {
  background: var(--lg-fill);
  -webkit-backdrop-filter: blur(20px) saturate(1.7); backdrop-filter: blur(20px) saturate(1.7);
  border: 1px solid var(--lg-line);
  box-shadow: inset 0 1px 0 var(--lg-hi), inset 0 -1px 0 rgba(255, 255, 255, 0.04), 0 8px 28px rgba(0, 0, 0, 0.18);
}
.sub-tile, .movie-row, .fav-slot { background: var(--lg-fill); border-color: var(--lg-line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.up-hero { background: var(--lg-fill-2); border-color: var(--gold-dim); }
.sheet { background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6); border-color: var(--lg-line); }
.sheet .card, .sheet .ticket-stub, .sheet .movie-row { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Profile: links no longer crowd the favorites card */
.profile-top { padding-bottom: 6px; }
.profile-links { margin-bottom: 18px; }
.profile-top + .card, .profile-top + * { margin-top: 4px; }

/* ---------- Search sheets: box on top, results fill the middle, buttons sit above the keyboard ---------- */
.sheet-backdrop:has(.searching) { align-items: flex-start; }
.sheet:has(.searching) { height: 100%; max-height: 100%; border-radius: 0 0 16px 16px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; overflow: hidden; }
.sheet:has(.searching) > .searching { flex: 1; min-height: 0; display: flex; flex-direction: column; max-width: none; padding: 0; margin: 0; max-height: none; }
.searching .search-top { display: flex; align-items: center; gap: 8px; }
.searching .search-top input { flex: 1; }
.searching .search-pane { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; max-height: none; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.searching .search-actions { display: flex; gap: 8px; padding-top: 10px; flex: 0 0 auto; }
.searching .search-actions .btn { flex: 1; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.searching .search-actions .btn.primary { flex: 1.6; }
.sheet-backdrop.kb-open { align-items: flex-start; }

/* ---------- v9 ---------- */
.swipe-del { position: relative; border-radius: var(--radius); overflow: hidden; }
.swipe-del-bg { position: absolute; inset: 0; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: flex-end; padding-right: 22px; font-weight: 600; font-size: 14px; opacity: 0; }
.swipe-del-row { position: relative; touch-action: pan-y; will-change: transform; }
.swipe-del > .swipe-del-row { background-color: color-mix(in srgb, var(--surface) 92%, transparent); }
.btn.on { background: var(--gold); border-color: var(--gold); color: #1a1205; font-weight: 600; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 28%, transparent); }

/* Top bar: same see-through glass as the tab bar, so a profile banner shows through it */
.topbar { background: var(--nav-fill, rgba(255, 255, 255, 0.06)); -webkit-backdrop-filter: blur(6px) saturate(165%); backdrop-filter: blur(6px) saturate(165%); border-bottom-color: var(--lg-line); }
/* The glass top bar overlaps the top of the page, so a profile banner shows through it (height measured from the bar itself) */
.topbar { z-index: 30; margin-bottom: calc(-1 * var(--topbar-h, 0px)); }
main.container { padding-top: var(--topbar-h, 0px); }
main.container .profile-banner { top: calc(-1 * var(--topbar-h, 0px) - 140px); }
.profile-header { justify-content: flex-end; margin-bottom: 8px; }

/* Glass icon button + glass link rows (Settings button, Profile quick links) */
.icon-btn.glass-btn, .icon-btn { background: var(--lg-fill-2); border: 1px solid var(--lg-line); -webkit-backdrop-filter: blur(16px) saturate(1.7); backdrop-filter: blur(16px) saturate(1.7); box-shadow: inset 0 1px 0 var(--lg-hi), 0 4px 14px rgba(0, 0, 0, 0.18); }
.link-list { background: var(--lg-fill); border-color: var(--lg-line); }
.link-row { border-bottom-color: var(--lg-line); -webkit-tap-highlight-color: transparent; transition: background .15s ease; }
.link-row:active, .link-row:hover { background: var(--lg-fill-2); }

/* Profile editor (live preview) */
.sheet:has(.profile-editor) { height: 100%; max-height: 100%; border-radius: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.sheet:has(.profile-editor) > .profile-editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.pe-preview { position: relative; flex: 0 0 auto; padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px; overflow: hidden; isolation: isolate; }
.pe-preview .profile-top { padding: 0; }
.pe-preview .profile-banner { left: -20px; right: -20px; top: -80px; }
.pe-controls { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 20px; -webkit-overflow-scrolling: touch; }
.pe-actions { flex: 0 0 auto; display: flex; gap: 10px; padding: 10px 20px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--lg-line); }
.pe-actions .btn { flex: 1; }
.btn.glass-btn { background: var(--lg-fill-2); border: 1px solid var(--lg-line); -webkit-backdrop-filter: blur(16px) saturate(1.7); backdrop-filter: blur(16px) saturate(1.7); box-shadow: inset 0 1px 0 var(--lg-hi); color: var(--text); }

/* ---------- v10 ---------- */
/* Profile: in-place editing */
.profile-header { gap: 10px; }
.profile-header.edit-bar { justify-content: space-between; }
.avatar-wrap { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex-shrink: 0; line-height: 0; }
.avatar-plus { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #1a1205; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; line-height: 1; border: 2px solid var(--bg); }
.banner-plus { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 8px 14px; border-radius: 999px; border: 1px dashed var(--lg-hi); background: var(--lg-fill-2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; -webkit-backdrop-filter: blur(4px) saturate(165%); backdrop-filter: blur(4px) saturate(165%); }

/* Coming up: the sideways list starts exactly under the big card's poster */
.hstrip-home { margin-top: 14px; padding-left: 12px; padding-right: 12px; scroll-padding-left: 12px; }
.hstrip-home .hstrip-item { width: 81px; }
.hstrip-home .hstrip-poster { width: 81px; height: 120px; }

/* ONE glass strength everywhere: the same recipe as the nav bar (very light fill, light blur, saturation lift) */
:root { --glass-filter: blur(4px) saturate(165%) brightness(1.04); --lg-fill: var(--nav-fill, rgba(255, 255, 255, 0.06)); --lg-fill-2: var(--nav-fill, rgba(255, 255, 255, 0.06)); }
.card, .ticket-stub, .link-list, .up-hero, .swipe-item .ticket-stub, .sub-tile, .movie-row, .fav-slot, .icon-btn, .coffee-btn, .btn.glass-btn, .banner-plus, .set-section, .feed-row, .pill, .badge {
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
}
.card, .ticket-stub, .link-list, .up-hero, .sub-tile, .movie-row, .fav-slot, .icon-btn, .coffee-btn, .btn.glass-btn, .set-section { background: var(--lg-fill); box-shadow: inset 0 1px 0 var(--lg-hi); }
.up-hero { border-color: var(--gold-dim); }
.sheet { background: color-mix(in srgb, var(--surface) 70%, transparent); -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter); }
.swipe-del > .swipe-del-row { background-color: transparent; }
