:root {
  --bg: #0b0b0b;
  --bg-elev: #141414;
  --surface: #1b1b1b;
  --surface-hi: #232323;
  --line: rgba(255, 255, 255, .09);
  --line-hi: rgba(255, 255, 255, .18);
  --text: #f5f5f5;
  --muted: #9b9b9b;
  --muted-dim: #6f6f6f;
  --accent: #e50914;
  --accent-hi: #f6121d;
  --gold: #f5c518;
  --radius: 10px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .55);
  --bar-bg: rgba(11, 11, 11, .92);
  color-scheme: dark;
}

/* ---- Light (day) theme ---- */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-hi: #ececf0;
  --line: rgba(0, 0, 0, .11);
  --line-hi: rgba(0, 0, 0, .24);
  --text: #16161a;
  --muted: #5c5c66;
  --muted-dim: #8a8a93;
  --accent: #e50914;
  --accent-hi: #c20710;
  --gold: #a87900;
  --shadow: 0 12px 30px rgba(0, 0, 0, .14);
  --bar-bg: rgba(245, 245, 247, .9);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 32px 14px;
}
.brand {
  display: flex; align-items: center;
  color: var(--text); cursor: pointer;
}
.brand-logo { height: 40px; width: 40px; display: block; border-radius: 9px; object-fit: cover; }
.brand-name { margin-left: 11px; font-size: 19px; font-weight: 600; letter-spacing: 1.2px; color: var(--text); }
.brand-tld { color: var(--muted); font-weight: 500; }
.beta-badge {
  margin-left: 7px; align-self: flex-start;
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--muted); border: 1px solid var(--muted);
  border-radius: 4px; padding: 1px 4px; line-height: 1.3;
  opacity: 0.65; text-transform: uppercase; user-select: none;
}
.tagline { color: var(--muted); font-size: 14px; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--text); border: 1px solid var(--line-hi);
  padding: 7px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
  font-weight: 600; white-space: nowrap; transition: .15s; line-height: 1;
}
.icon-btn:hover { background: var(--surface-hi); border-color: var(--text); }
#authBtn.signed-in { padding: 5px 10px 5px 6px; }
/* "Add to Home Screen" — accent-filled so it stands out; hidden once installed. */
.install-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 7px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
  font-weight: 700; white-space: nowrap; transition: .15s; line-height: 1;
}
.install-btn:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.install-btn.hidden { display: none; }
/* Notifications bell + unread badge */
.bell-btn {
  position: relative; background: transparent; color: var(--text);
  border: 1px solid var(--line-hi); border-radius: 6px; padding: 6px 9px;
  cursor: pointer; font-size: 15px; line-height: 1; transition: .15s;
}
.bell-btn:hover { background: var(--surface-hi); border-color: var(--text); }
.bell-btn.hidden { display: none; }
/* White line-art bell (Netflix-style), inheriting the bar's text colour. */
.bell-ico {
  display: block; width: 18px; height: 18px;
  stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.bell-badge {
  position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
}
.bell-badge.hidden { display: none; }
/* Notifications modal list */
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.notif-actions { display: flex; gap: 8px; }
.notif-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.notif {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 12px 12px 14px; transition: background .15s, border-color .15s;
  touch-action: pan-y;   /* let horizontal swipes drive delete, not scroll */
}
.notif:hover { background: var(--surface-hi); border-color: var(--line-hi); }
.notif.unread { border-left: 3px solid var(--accent); }
.notif-main { flex: 1; min-width: 0; }
.notif-title { font-weight: 700; font-size: 13px; }
.notif.unread .notif-title { color: var(--accent); }
.notif-body { font-size: 14px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { color: var(--muted); font-size: 11px; }
.notif-x {
  flex: none; background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 2px 4px; border-radius: 5px; line-height: 1;
}
.notif-x:hover { background: var(--line-hi); color: var(--text); }
.avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* account dropdown */
.auth-wrap { position: relative; }
.auth-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 10px; min-width: 200px;
}
.auth-menu.hidden { display: none; }
.am-email { color: var(--muted); font-size: 12px; padding: 4px 8px 10px;
  border-bottom: 1px solid var(--line); margin-bottom: 8px; word-break: break-all; }
.am-signout {
  width: 100%; text-align: left; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px; padding: 9px 12px;
  cursor: pointer; font-size: 14px; font-weight: 600; transition: .15s;
}
.am-signout:hover { background: var(--surface-hi); border-color: var(--accent); color: var(--accent); }

/* sign-in nudge on the Favorites tab */
.sync-hint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 18px; color: var(--muted); font-size: 13px;
}
.sync-hint button { margin-left: auto; }

/* ---- Sticky toolbar (tabs + search + filters) ---- */
.toolbar {
  position: sticky; top: env(safe-area-inset-top, 0); z-index: 10;
  background: var(--bar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 10px 32px 14px;
}
/* Installed PWA: the page draws under the status bar/notch. Stick the toolbar
   just below it (top above) and cover the status-bar strip with a fixed filler
   so it stays visible and content can't peek under the translucent status bar. */
@media (display-mode: standalone) {
  body::before {
    content: ""; position: fixed; top: 0; left: 0; right: 0;
    height: env(safe-area-inset-top, 0); background: var(--bar-bg);
    backdrop-filter: blur(14px); z-index: 11;
  }
}

/* flat Netflix-style tab nav */
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 15px; font-weight: 600; padding: 10px 0 13px; position: relative;
  transition: color .15s; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 3px; background: var(--accent); border-radius: 3px 3px 0 0;
}

/* prominent search */
.search-wrap { position: relative; margin: 16px 0 12px; }
.search-wrap .ico {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 17px; color: var(--muted); pointer-events: none;
}
#q {
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 44px 14px 46px; font-size: 16px; outline: none; transition: .15s;
}
#q::placeholder { color: var(--muted-dim); }
#q:focus { border-color: var(--line-hi); background: var(--surface-hi); }
.search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: var(--surface-hi); border: none; color: var(--muted);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 14px;
  display: none; align-items: center; justify-content: center; transition: .15s;
}
.search-clear:hover { color: var(--text); background: var(--line-hi); }
.search-wrap.has-text .search-clear { display: flex; }

/* filter row */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.select {
  position: relative; display: inline-flex;
}
select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 34px 9px 14px; font-size: 14px; font-weight: 500;
  outline: none; cursor: pointer; transition: .15s;
}
select:hover { border-color: var(--line-hi); }
select:focus { border-color: var(--line-hi); }
.select::after {
  content: "▾"; position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: 12px;
}
.select.hidden { display: none; }

/* search-row is transparent on desktop (search + hidden filter btn act as toolbar kids) */
.search-row { display: contents; }
.filter-btn, .bottom-nav, .sheet, .home-cats { display: none; }

/* Per-tab controls: search only where you can search; filters where they apply. */
.toolbar:not([data-view="movies"]):not([data-view="theaters"]) .search-wrap { display: none; }
.toolbar[data-view="map"] .filters,
.toolbar[data-view="watchlist"] .filters,
.toolbar[data-view="favcinemas"] .filters,
.toolbar[data-view="watched"] .filters,
.toolbar[data-view="search"] .filters,
.toolbar[data-view="settings"] .filters { display: none; }
.toolbar[data-view="map"] .filter-btn,
.toolbar[data-view="watchlist"] .filter-btn,
.toolbar[data-view="favcinemas"] .filter-btn,
.toolbar[data-view="watched"] .filter-btn,
.toolbar[data-view="search"] .filter-btn,
.toolbar[data-view="settings"] .filter-btn { display: none; }

/* ---- Home category chips (mobile) ---- */
.cat {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 14px; font-weight: 600; padding: 6px 0; white-space: nowrap;
  transition: color .15s;
}
.cat.active { color: var(--text); }

/* ---- Favorites home card ---- */
.fav-home { display: none; }   /* mobile-only (desktop keeps the Favorites tab) */
.fav-home-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; color: var(--text); transition: .15s;
}
.fav-home-card:hover { background: var(--surface-hi); border-color: var(--line-hi); }
.fhc-ico {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 19px;
}
.fhc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fhc-title { font-weight: 700; font-size: 15px; }
.fhc-sub { color: var(--muted); font-size: 12.5px; }
.fhc-count {
  flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--surface-hi); color: var(--text); font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.fhc-chev { flex: none; color: var(--muted); font-size: 22px; line-height: 1; }

/* ---- Genres browser ---- */
.genre-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.genre-tile {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; cursor: pointer; color: var(--text); transition: .15s;
}
.genre-tile:hover { background: var(--surface-hi); border-color: var(--line-hi); }
.gt-name { font-weight: 700; font-size: 15px; }
.gt-count { color: var(--muted); font-size: 12px; font-weight: 700; }
.genre-back {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 14px; font-weight: 600; padding: 4px 0 12px;
}
.genre-back:hover { color: var(--text); }

/* ---- Pill toggles (Open-air / Nearest-first / Filters on Cinemas + Map) ---- */
.oa-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.oa-count {
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #fff;
  color: var(--accent); font-size: 10px; font-weight: 800; line-height: 17px; text-align: center;
  display: inline-block; margin-left: 2px;
}
.oa-toggle {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 700; transition: .15s;
}
.oa-toggle:hover { background: var(--surface-hi); border-color: var(--line-hi); }
.oa-toggle.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Search view (bottom-nav lens) ---- */
.search-view { max-width: 720px; margin: 0 auto; }
.sv-bar {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; margin-bottom: 18px;
}
.sv-ico {
  flex: none; width: 20px; height: 20px; stroke: var(--muted); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
#svInput {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--text); font-size: 16px; padding: 15px 10px;
}
#svInput::placeholder { color: var(--muted-dim); }
.sv-clear {
  display: none; flex: none; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--surface-hi); color: var(--muted); font-size: 14px;
}
.sv-clear:hover { color: var(--text); background: var(--line-hi); }
.sv-tools { display: flex; align-items: center; gap: 10px; margin: -6px 2px 14px; }
.sv-filter {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; transition: .15s;
}
.sv-filter:hover { background: var(--surface-hi); border-color: var(--line-hi); }
.sv-filter.on { border-color: var(--accent); color: var(--accent); }
.sv-filter-ico { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.sv-fcount {
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent);
  color: #fff; font-size: 10px; font-weight: 800; line-height: 17px; text-align: center;
}
.sv-filter-clear {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 4px;
}
.sv-filter-clear:hover { color: var(--text); }
.sv-results { display: flex; flex-direction: column; gap: 4px; }
.sv-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 10px; padding: 8px 8px;
  cursor: pointer; color: var(--text); transition: background .15s;
}
.sv-row:hover { background: var(--surface); }
.sv-thumb {
  flex: none; width: 44px; height: 64px; border-radius: 6px; overflow: hidden;
  background: var(--surface-hi); display: flex; align-items: center; justify-content: center;
}
.sv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sv-thumb.cinema, .sv-thumb.hist { width: 44px; height: 44px; border-radius: 50%; font-size: 19px; }
.sv-rt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sv-title { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-sub { color: var(--muted); font-size: 12px; }
.sv-chev { flex: none; color: var(--muted); font-size: 20px; line-height: 1; }
.sv-x {
  flex: none; color: var(--muted); font-size: 13px; padding: 6px 8px; border-radius: 6px;
}
.sv-x:hover { color: var(--text); background: var(--line-hi); }
.sv-hist-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 6px 8px; color: var(--muted); font-size: 13px; font-weight: 700;
}
.sv-hist-clear {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 13px; font-weight: 700; padding: 4px;
}

/* ---- Main ---- */
main { padding: 26px 32px 64px; max-width: 1320px; margin: 0 auto; }
.loading, .empty { color: var(--muted); padding: 64px 20px; text-align: center; font-size: 15px; }
.result-count { color: var(--muted); font-size: 13px; margin: 0 2px 16px; }
.cinemas-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cinemas-head .result-count { margin: 0; }
.cinemas-head .block-title { margin: 0; }
.cinemas-head:has(.block-title) { margin-top: 24px; }
.expand-all { background: var(--surface); color: var(--text); border: 1px solid var(--line-hi);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap; }
.expand-all:hover { background: var(--surface-hi); border-color: var(--accent); color: var(--accent); }
.block-title { margin: 24px 0 14px; font-size: 19px; font-weight: 800; }

/* ---- Poster grid (Netflix-style cards) ---- */
.grid {
  display: grid; gap: 22px 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.poster-card { cursor: pointer; min-width: 0; }  /* let cards shrink so long titles ellipsis instead of stretching the column */
.poster {
  aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; background: var(--surface);
  position: relative; transition: transform .22s ease, box-shadow .22s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.poster-card:hover .poster {
  transform: scale(1.06); box-shadow: var(--shadow); z-index: 2;
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster .noimg { display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 44px; opacity: .25; }
/* Inline rating leading the card meta line (IMDb 0–10 or Athinorama ★/5). */
.r-rating { color: var(--gold); font-weight: 700; }
.imdb-chip { background: #f5c518 !important; color: #111 !important; border-color: #f5c518 !important;
  font-weight: 700; text-decoration: none; }
.imdb-chip:hover { background: #ffd633 !important; }
/* Athinorama reference link — discreet, gold star tint, used only as IMDb fallback. */
.ath-chip { color: var(--gold) !important; text-decoration: none; border-color: rgba(245, 197, 24, .35) !important; }
.ath-chip:hover { border-color: var(--gold) !important; }
.poster-card .pc-title {
  font-weight: 600; margin: 10px 2px 2px; font-size: 14px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pc-sub { color: var(--muted); font-size: 12px; margin: 0 2px; }
.pc-meta { color: var(--muted-dim); font-size: 11px; margin: 1px 2px 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

/* Coming-soon cards — distinct accent + badge, no cinema/showtime line. */
.poster-card.coming .poster { box-shadow: 0 4px 14px rgba(0, 0, 0, .4), inset 0 0 0 2px var(--accent); }
.soon-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: .5px; text-transform: uppercase; padding: 3px 7px; border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.pc-opens { color: var(--accent); font-size: 12px; font-weight: 700; margin: 0 2px; }
/* Coming-soon modal: opening-date callout, accent chip, and a "not yet" note. */
.chip.soon-chip { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.coming-opens { margin: 10px 0 4px; font-size: 15px; color: var(--text); }
.coming-opens b { color: var(--accent); }
.coming-note { color: var(--muted); font-size: 13px; font-style: italic; margin-top: 6px; }

/* discreet "already watched" marker on the listings */
.poster-card.seen .poster img { opacity: .72; }
.watched-badge {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .62); color: rgba(255, 255, 255, .92);
  font-size: 12px; font-weight: 800; line-height: 1;
  backdrop-filter: blur(2px); pointer-events: none;
}

/* favorite heart */
.fav {
  position: absolute; top: 6px; left: 6px; width: 34px; height: 34px;
  border-radius: 50%; border: none; cursor: pointer; font-size: 16px;
  background: rgba(0, 0, 0, .6); color: rgba(255, 255, 255, .8); line-height: 1;
  transition: .15s; display: flex; align-items: center; justify-content: center;
  opacity: 0;
}
.poster-card:hover .fav { opacity: 1; }
.fav:hover { transform: scale(1.14); color: #fff; }
.fav.on { color: var(--accent); opacity: 1; }

/* card hover quick-actions (desktop) */
.card-hover {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px;
  padding: 10px 8px 8px; justify-content: flex-end; opacity: 0; transform: translateY(6px);
  background: linear-gradient(transparent, rgba(0, 0, 0, .8)); transition: .18s; pointer-events: none;
}
.poster-card:hover .card-hover { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ch-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: #111; font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.ch-btn:hover { transform: scale(1.12); }
.ch-btn.primary { background: var(--accent); color: #fff; }

/* ---- Hero billboard ---- */
.hero {
  position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 30px;
  min-height: 320px; display: flex; align-items: flex-end; cursor: pointer;
  border: 1px solid var(--line);
}
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center 25%;
  filter: blur(2px) saturate(1.1); transform: scale(1.08);
}
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.7) 45%, rgba(0,0,0,.25) 100%),
              linear-gradient(0deg, rgba(0,0,0,.85), transparent 60%);
}
.hero-inner { position: relative; display: flex; gap: 26px; padding: 28px 32px; width: 100%; align-items: center; }
.hero-poster { width: 150px; flex: none; border-radius: 10px; overflow: hidden;
  aspect-ratio: 2/3; box-shadow: var(--shadow); }
.hero-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-poster .noimg { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 40px; opacity: .3; }
.hero-text { max-width: 620px; color: #fff; }
.hero-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.hero-title { font-size: 32px; font-weight: 900; margin: 0 0 10px; line-height: 1.05; letter-spacing: -.5px; }
.hero-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: #ddd;
  font-size: 13px; margin-bottom: 12px; }
.hero-credit { color: #cfcfcf; font-size: 13px; line-height: 1.4; margin: 0 0 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hero-credit span { color: #9a9a9a; }
.hero-syn { color: #cfcfcf; font-size: 14px; line-height: 1.55; margin: 8px 0 16px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions .btn-trailer { background: #fff; color: #111; }
.hero-actions .btn-trailer:hover { background: #e6e6e6; }

/* ---- Settings tab ---- */
.settings { max-width: 580px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-label { font-weight: 700; font-size: 16px; flex: 1 1 auto; min-width: 0; }
.set-num { color: var(--accent); font-weight: 800; }
/* iOS "install for notifications" hint row */
.ios-hint { background: var(--surface); border-left: 3px solid var(--accent); border-radius: 8px;
  padding: 14px; margin-top: 4px; }
.ios-hint .set-label { font-weight: 600; font-size: 13px; color: var(--muted); }
/* Group of controls on the right of a settings row, kept together on one line. */
.set-ctl { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.notif-view { white-space: nowrap; }
.set-foot { color: var(--muted); font-size: 12px; padding: 18px 2px 4px; text-align: center; }
/* Terms & Conditions modal */
.terms { font-size: 13.5px; line-height: 1.65; color: var(--text); }
.terms h3 { font-size: 14px; font-weight: 700; margin: 16px 0 4px; }
.terms p { color: var(--muted); margin: 0; }
.terms strong { color: var(--text); }
.terms-upd { font-size: 12px; margin-bottom: 6px !important; }
.terms-copy { margin-top: 18px !important; padding-top: 12px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { background: var(--surface); color: var(--muted); border: none; padding: 9px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: #fff; }
.set-on { color: #3ddc84; font-weight: 700; }
.set-loc { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.set-acct-info { display: inline-flex; flex-direction: column; margin-right: 12px; vertical-align: middle; }
.set-acct { color: var(--text); word-break: break-all; font-weight: 600; }
.set-acct-email { color: var(--muted); font-size: 12px; word-break: break-all; }

/* admin usage-stats screen */
.stats-id { color: var(--muted); font-size: 12px; margin: 4px 0 16px; word-break: break-all; }
.stats-id code { color: var(--text); }
.stat-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; }
.stat-num { font-size: 22px; font-weight: 800; }
.stat-lbl { color: var(--muted); font-size: 12px; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.stat-table td:last-child { text-align: right; color: var(--accent); font-weight: 700; white-space: nowrap; }
.set-desc { color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 3px; }

/* new-films notice banner */
.notice-banner {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  max-width: 1320px; margin: 14px auto 0; padding: 12px 18px;
  background: linear-gradient(90deg, rgba(229, 9, 20, .18), var(--bg-elev));
  border: 1px solid var(--accent); border-radius: 10px; font-size: 14px; font-weight: 600;
}
.notice-banner span { flex: 1; min-width: 0; }
.notice-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 6px; }
.notice-x:hover { color: var(--text); }
@media (max-width: 640px) { .notice-banner { margin: 12px 14px 0; } }
.seg-btn { background: var(--surface); color: var(--text); border: 1px solid var(--line-hi);
  border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s; }
.seg-btn:hover { background: var(--surface-hi); border-color: var(--accent); color: var(--accent); }

/* opt-in location button */
.geo-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-hi);
  border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .15s;
}
.geo-cta:hover { background: var(--surface-hi); border-color: var(--accent); color: var(--accent); }
.geo-cta:disabled { opacity: .6; cursor: default; }
.geo-err { color: var(--muted); font-size: 13px; margin: -12px 0 18px; max-width: 520px; }

/* ---- Horizontal rows ---- */
.row { margin-bottom: 26px; }
.row-title { font-size: 17px; font-weight: 800; margin: 0 0 12px; }
.row-scroll {
  display: flex; gap: 14px; overflow-x: auto; overflow-y: visible;
  padding: 6px 2px 10px; scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.row-scroll::-webkit-scrollbar { height: 8px; }
.row-scroll::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 4px; }
.row-scroll .poster-card { width: 150px; flex: none; scroll-snap-align: start; }
.row-scroll .poster-card:hover .poster { transform: scale(1.04); }
.row-scroll-wrap { position: relative; }
.row-arrow { display: none; }   /* off on touch/mobile — swipe is natural there */
/* Desktop (mouse) only: arrows replace the scrollbar. */
@media (min-width: 721px) and (hover: hover) {
  .row-scroll { scrollbar-width: none; }
  .row-scroll::-webkit-scrollbar { display: none; }
  .row-arrow {
    display: grid; place-items: center; position: absolute; top: 42%;
    transform: translateY(-50%); z-index: 6; width: 40px; height: 40px;
    border-radius: 50%; border: 1px solid var(--line-hi); cursor: pointer;
    background: rgba(15, 15, 15, .82); color: #fff; font-size: 24px; line-height: 1;
    backdrop-filter: blur(3px); transition: opacity .15s ease, background .15s ease;
  }
  .row-arrow.left { left: -4px; }
  .row-arrow.right { right: -4px; }
  .row-arrow:hover { background: rgba(0, 0, 0, .95); }
  .row-scroll-wrap.at-start .row-arrow.left,
  .row-scroll-wrap.at-end .row-arrow.right,
  .row-scroll-wrap.no-overflow .row-arrow { opacity: 0; pointer-events: none; }
}

/* ---- Theater rows ---- */
.theater-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; padding: 16px 20px; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px;
  cursor: pointer; transition: .15s;
}
.theater-row:hover { background: var(--surface-hi); border-color: var(--line-hi); }
.tr-name { font-weight: 700; font-size: 16px; }
.tr-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.tr-dist { color: var(--accent); font-weight: 700; }
.tr-right { display: flex; align-items: center; gap: 14px; }
.tr-right .fav { position: static; opacity: 1; background: var(--surface); border: 1px solid var(--line); }
.tr-count { color: var(--text); font-weight: 700; white-space: nowrap; font-size: 14px;
  background: none; border: none; cursor: pointer; display: inline-flex; align-items: center;
  gap: 5px; padding: 6px 6px; border-radius: 6px; }
.tr-count:hover { color: var(--accent); }
.tr-count b { color: var(--accent); }
.tr-exp { display: inline-block; transition: transform .18s; color: var(--muted); }
.tr-count.open .tr-exp { transform: rotate(180deg); }

/* inline expanded film list under a cinema row */
.theater-row:has(+ .cinema-movies) { margin-bottom: 0; border-bottom: none;
  border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.cinema-movies { margin: 0 0 10px; padding: 0 12px; background: var(--bg-elev);
  border: 1px solid var(--line); border-top: none; border-radius: 0 0 10px 10px;
  display: flex; flex-direction: column; }
.cm-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; border-top: 1px solid var(--line); color: var(--text);
  cursor: pointer; font-size: 14px; padding: 13px 4px; }
.cm-row:first-child { border-top: none; }
.cm-row:hover .cm-title { color: var(--accent); }
.cm-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-chev { color: var(--muted); font-weight: 700; }
/* discreet "already watched" marker on a cinema's film rows */
.cm-seen { color: var(--muted); font-weight: 800; font-size: 12px; flex: none; line-height: 1; }
.cm-row.seen .cm-title { color: var(--muted-dim); }
.cm-empty { color: var(--muted); padding: 14px 4px; font-size: 14px; }

/* chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { font-size: 11px; color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; }
.chip.summer { color: var(--gold); border-color: rgba(245, 197, 24, .35); }

/* ---- Modal ---- */
/* No backdrop-filter here: it creates a containing block that would break
   position:fixed on the close button (making it scroll away). */
/* z-index must clear Leaflet's panes/controls (up to ~1000) so the programme
   modal opens ABOVE the map, not hidden behind it. */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .82);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px; overflow-y: auto; z-index: 2000;
  /* Keep modal scrolling from chaining to the page behind it (the "screen
     drifts over the top" effect on phones), and smooth momentum on iOS. */
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal.hidden { display: none; }
/* While a modal is open, freeze the page behind it so only the modal scrolls. */
html.modal-open, html.modal-open body { overflow: hidden; }
.modal-card { background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 14px; max-width: 760px; width: 100%; padding: 28px 28px 0;
  position: relative; box-shadow: var(--shadow); }
/* Fixed so it stays reachable while a long modal scrolls. */
.close { position: fixed; top: calc(16px + env(safe-area-inset-top, 0));
  right: calc(16px + env(safe-area-inset-right, 0)); background: var(--surface);
  border: 1px solid var(--line-hi); color: var(--text); width: 38px; height: 38px;
  border-radius: 50%; cursor: pointer; font-size: 15px; transition: .15s; z-index: 60;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.close:hover { background: var(--surface-hi); }
/* Sticky bottom bar so Close is always within thumb reach. */
.modal-foot { position: sticky; bottom: 0; margin-top: 22px;
  padding: 14px 0 calc(16px + env(safe-area-inset-bottom, 0));
  background: var(--bg-elev); border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; }
.modal-close-btn { background: var(--surface-hi); color: var(--text);
  border: 1px solid var(--line-hi); border-radius: 8px; padding: 11px 26px;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: .15s; }
.modal-close-btn:hover { background: var(--line-hi); }
.modal-head { display: flex; gap: 22px; }
.modal-head .poster { width: 150px; flex: none; }
.modal-head .poster:hover { transform: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.mh-title { font-size: 24px; font-weight: 800; margin: 0 0 6px; line-height: 1.15; }
.mh-orig { color: var(--muted); font-size: 14px; font-style: italic; margin: -2px 0 8px; }
.mh-summary { color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 12px; }
.mh-credit { font-size: 13px; line-height: 1.5; margin: 8px 0 0; color: var(--text); }
.mh-credit-l { color: var(--muted); margin-right: 4px; }
/* Follow/unfollow chips for cast & directors. The leading ☆/★ is driven by
   the .on class, so syncFavUI toggling the class updates the star for free. */
.person-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.person-chip {
  font: inherit; font-size: 12px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 9px 3px 7px; transition: .15s; line-height: 1.4;
}
.person-chip::before { content: "☆ "; color: var(--muted); }
.person-chip:hover { border-color: var(--line-hi); }
.person-chip.on { border-color: var(--gold); color: var(--gold); }
.person-chip.on::before { content: "★ "; color: var(--gold); }
.fav-people { margin: 0 0 8px; }
.block-subtitle { margin: 18px 0 12px; font-size: 15px; font-weight: 700; color: var(--muted); }

/* ---- Cinema reviews ---- */
.rs-title { font-weight: 700; font-size: 14px; margin: 4px 0 2px; }
.rs-grid { display: grid; gap: 4px; margin: 2px 0 4px; }
.rs-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rs-label { color: var(--muted); font-size: 13px; }
.rs-stars { display: inline-flex; gap: 3px; }
.rs-star { color: var(--line-hi); font-size: 20px; cursor: pointer; line-height: 1; transition: transform .1s; }
.rs-star:hover { transform: scale(1.15); }
.rs-star.on { color: var(--gold); }
.rv-signin, .rv-empty { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.rv-gate { color: var(--text); font-size: 14px; line-height: 1.6; margin: 16px 0 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
/* aggregate badge on the cinema row */
.rv-badge { color: var(--gold); font-weight: 700; font-size: 12px; white-space: nowrap; }
.rv-badge .rv-n { color: var(--muted); font-weight: 500; }
/* per-category breakdown in the cinema detail */
.rv-breakdown { margin: 2px 0 4px; }
.rv-summary { color: var(--gold); font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.rv-row { display: flex; align-items: center; gap: 10px; margin: 5px 0; font-size: 13px; }
.rv-cat { color: var(--muted); width: 120px; flex: none; }
.rv-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-hi); overflow: hidden; }
.rv-bar span { display: block; height: 100%; background: var(--gold); }
.rv-val { width: 28px; text-align: right; font-weight: 600; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn-trailer, .btn-fav, .btn-imdb, .btn-watched, .btn-remind, .btn-spotify {
  padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: .15s;
  display: inline-flex; align-items: center; gap: 6px; }
.btn-spotify { background: #1DB954; color: #fff; }
.btn-spotify:hover { background: #1ed760; }
.btn-remind { background: var(--surface); color: var(--text); border-color: var(--line-hi); }
.btn-remind:hover { background: var(--surface-hi); }
.btn-remind.on { color: var(--accent); border-color: var(--accent); }
.btn-trailer { background: var(--accent); color: #fff; }
.btn-trailer:hover { background: var(--accent-hi); }
.btn-imdb { background: #f5c518; color: #111; }
.btn-imdb:hover { background: #ffd633; }
.btn-watched { background: var(--surface); color: var(--text); border-color: var(--line-hi); }
.btn-watched:hover { background: var(--surface-hi); }
.btn-watched.on { color: #3ddc84; border-color: #3ddc84; }
.btn-fav { background: var(--surface); color: var(--text); border-color: var(--line-hi); }
.btn-fav:hover { background: var(--surface-hi); }
.btn-fav.on { color: var(--accent); border-color: var(--accent); }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); margin: 26px 0 12px; font-weight: 700; }

/* date calendar inside modals */
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 16px;
  scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }
.date-pill { flex: none; display: flex; flex-direction: column; align-items: center;
  gap: 2px; min-width: 54px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  cursor: pointer; font-weight: 600; transition: .15s; }
.date-pill:hover { border-color: var(--line-hi); color: var(--text); }
.date-pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.date-pill .dp-wd { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.date-pill .dp-dm { font-size: 14px; font-weight: 800; }
.date-pill.today .dp-wd { color: var(--accent); }
.date-pill.on .dp-wd { color: #fff; }
.showing {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 8px; }
.sh-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.sh-info { min-width: 0; }
.sh-times { text-align: right; }
.sh-where { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sh-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.imdb-mini { background: #f5c518; color: #111; font-weight: 800; font-size: 10.5px;
  padding: 2px 6px; border-radius: 4px; line-height: 1.3; }
/* Athinorama ★/5 fallback pill — gold star on dark, distinct from the yellow IMDb pill. */
.ath-mini { color: var(--gold); font-weight: 700; font-size: 10.5px;
  padding: 2px 6px; border-radius: 4px; line-height: 1.3; border: 1px solid rgba(245, 197, 24, .35); }
.showing .sh-fav {
  position: static; flex: none; opacity: 1; width: 34px; height: 34px;
  background: var(--surface-hi); border: 1px solid var(--line);
}
.sh-info.sh-link { cursor: pointer; }
.sh-info.sh-link:hover .sh-where { color: var(--accent); }
.sh-chev { color: var(--muted); font-weight: 700; }
.sh-links { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.sh-dir { color: #1a73e8; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.sh-dir:hover { text-decoration: underline; }
.no-book { color: var(--muted-dim); font-size: 12px; white-space: nowrap; }
.tel-link { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.tel-link:hover { text-decoration: underline; }
.times { display: flex; gap: 7px; flex-wrap: wrap; }
.time {
  background: var(--surface-hi); border: 1px solid var(--line-hi);
  color: var(--text); font-weight: 700; font-size: 14px; padding: 6px 12px;
  border-radius: 7px; text-decoration: none; transition: .15s; }
a.time:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.book-link { color: var(--accent); font-size: 13px; text-decoration: none; font-weight: 600; }
.book-link:hover { text-decoration: underline; }

/* ---- Map ---- */
#mapview { height: 72vh; min-height: 440px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); }
.map-geo { margin-bottom: 12px; }
/* Active-filters summary above the film rows */
.filter-summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 4px 0 18px; font-size: 13px;
}
.fs-label { color: var(--muted); font-weight: 600; }
.fs-chip {
  background: var(--surface); border: 1px solid var(--line-hi); color: var(--text);
  border-radius: 999px; padding: 4px 11px; font-weight: 600;
}
.fs-clear {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 13px; font-weight: 700; padding: 4px 6px; margin-left: auto;
}
.fs-clear:hover { text-decoration: underline; }

/* custom red cinema pin */
.cine-pin { background: none; border: none; }
.cine-pin .pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0;
  background: var(--accent); transform: rotate(-45deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5); border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
}
.cine-pin .pin span { transform: rotate(45deg); font-size: 14px; line-height: 1; }
/* "You are here" — a pulsing blue dot, distinct from the red cinema pins. */
.me-pin { background: none; border: none; }
.me-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #1a73e8; border: 2px solid #fff; box-sizing: border-box;
  box-shadow: 0 0 0 0 rgba(26, 115, 232, .5); animation: me-pulse 2s infinite;
}
@keyframes me-pulse {
  0% { box-shadow: 0 0 0 0 rgba(26, 115, 232, .5); }
  70% { box-shadow: 0 0 0 12px rgba(26, 115, 232, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0); }
}

/* popup */
.leaflet-popup-content { font-family: inherit; font-size: 13px; line-height: 1.55; margin: 12px 14px; }
.popup-name { font-weight: 800; font-size: 14px; }
.popup-addr { color: #666; margin: 2px 0 4px; }
.popup-count { font-weight: 700; }
.popup-actions { display: flex; gap: 8px; margin-top: 9px; }
.popup-dir, .popup-prog {
  display: inline-flex; align-items: center; gap: 4px; text-decoration: none;
  font-weight: 700; font-size: 12.5px; padding: 6px 10px; border-radius: 7px; }
.popup-dir { background: #1a73e8; color: #fff !important; }
.popup-dir:hover { background: #1666d4; }
.popup-prog { background: var(--accent); color: #fff !important; }
.popup-prog:hover { background: var(--accent-hi); }

/* ---- Footer ---- */
.foot { display: flex; justify-content: space-between; color: var(--muted-dim);
  font-size: 12px; padding: 18px 32px; border-top: 1px solid var(--line); }

/* ---- Watched: logging form ---- */
.wform { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.wform label { display: flex; flex-direction: column; gap: 6px; font-size: 13px;
  font-weight: 600; color: var(--muted); }
.wform input[type=date], .wform input[list], .wform textarea {
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 12px; font-size: 15px; font-family: inherit;
  outline: none; width: 100%; }
.wform select {
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 38px 11px 12px; font-size: 15px; font-family: inherit;
  outline: none; width: 100%; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 12px 8px;
  text-overflow: ellipsis;
}
.wform select:hover { border-color: var(--line-hi); }
.wform input:focus, .wform textarea:focus, .wform select:focus { border-color: var(--line-hi); }
.wform textarea { resize: vertical; }
.wform .wphoto input[type=file] { font-size: 13px; color: var(--muted); }
.wpreview img { max-width: 100%; max-height: 260px; border-radius: 10px; margin-top: 2px; display: block; }

/* ---- Watched: diary list ---- */
.watched-list { display: flex; flex-direction: column; gap: 14px; }
.watched-card { display: flex; gap: 14px; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.wc-poster { width: 72px; flex: none; aspect-ratio: 2/3; border-radius: 8px;
  overflow: hidden; background: var(--surface); cursor: pointer; }
.wc-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wc-poster .noimg { display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 28px; opacity: .3; }
.wc-body { flex: 1; min-width: 0; }
.wc-title { font-weight: 700; font-size: 16px; }
.wc-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.wc-review { margin-top: 8px; font-size: 14px; line-height: 1.5; white-space: pre-wrap;
  word-break: break-word; }
.wc-photo { margin-top: 10px; max-width: 100%; max-height: 300px; border-radius: 10px; display: block; }
.wc-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn-share { background: #25d366; color: #06310f; border: none; font-weight: 800;
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-share:hover { filter: brightness(1.05); }
.btn-mini { background: var(--surface); color: var(--text); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-mini:hover { background: var(--surface-hi); }
.btn-mini.danger:hover { color: var(--accent); border-color: var(--accent); }

/* ---- Mobile filter button ---- */
.filter-btn {
  align-items: center; gap: 7px; white-space: nowrap;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 14px; height: 44px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: .15s; position: relative;
}
.filter-btn:active { background: var(--surface-hi); }
.filter-btn .fb-ico { font-size: 16px; }
.filter-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.filter-count[hidden] { display: none; }

/* ---- Mobile bottom tab bar ---- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--bar-bg); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.navbtn {
  flex: 1; min-width: 0; background: none; border: none; cursor: pointer; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 2px 7px; font-size: 9.5px; font-weight: 600; transition: color .15s;
}
.navbtn .nav-lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbtn .nav-ico {
  width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; transition: .15s;
}
.navbtn.active { color: var(--accent); }
.navbtn.active .nav-ico { transform: translateY(-1px); }

/* ---- Bottom sheet (filters) ---- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet.hidden { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6);
  animation: fade .2s ease; }
.sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--bg-elev); border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0; padding: 8px 18px calc(20px + env(safe-area-inset-bottom, 0));
  box-shadow: var(--shadow); animation: slideup .26s cubic-bezier(.2, .8, .2, 1);
  max-height: 85vh; overflow-y: auto;
}
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line-hi);
  margin: 6px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; }
.sheet-head #sheetTitle { font-size: 18px; font-weight: 800; }
.sheet-done { background: none; border: none; color: var(--accent); font-size: 15px;
  font-weight: 700; cursor: pointer; padding: 6px 4px; }
.sheet-body { display: flex; flex-direction: column; gap: 12px; }
.sheet-body .select { display: flex; }
.sheet-body .select select { width: 100%; padding: 14px 16px; font-size: 15px; border-radius: 10px; }
.sheet-body .select::after { right: 16px; }
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .topbar { padding: calc(14px + env(safe-area-inset-top, 0)) 16px 8px; gap: 10px; }
  .brand { font-size: 21px; }
  .tagline { display: none; }
  /* Signed out: a small, discreet "Sign in" sits just left of the bell.
     Signed in: hidden (the profile lives in the bottom nav). */
  .install-btn { order: 1; }
  .auth-wrap { order: 2; }
  .bell-btn { order: 3; }
  #authBtn { padding: 5px 9px; font-size: 12px; gap: 4px; border-color: var(--line); }
  #authBtn.signed-in { display: none; }

  /* Category chips below the logo line — shown on every view */
  .home-cats {
    display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none;
    padding: 6px 16px 10px; background: var(--bg);
  }
  .home-cats::-webkit-scrollbar { display: none; }

  /* Favorites entry card on the home page */
  .fav-home { display: block; }

  /* No toolbar on mobile: navigation is the bottom nav + category chips,
     search is the bottom-nav lens, and filters live on the Search page. */
  .toolbar { display: none; }

  .bottom-nav { display: flex; }
  .sheet:not(.hidden) { display: block; }

  /* bottom padding clears the tab bar + the iPhone home-indicator inset */
  main { padding: 16px 14px calc(84px + env(safe-area-inset-bottom, 0)); }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 14px 9px; }
  .poster { border-radius: 7px; }
  .poster-card .pc-title { font-size: 12px; margin-top: 7px; }
  .pc-sub { font-size: 10.5px; }
  .fav { opacity: 1; width: 30px; height: 30px; font-size: 14px; }
  .result-count { margin-bottom: 12px; }
  .poster-card:hover .poster { transform: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
  .card-hover { display: none; }   /* no hover on touch */

  /* hero stacks; poster on top of the text */
  .hero { min-height: 0; margin-bottom: 24px; border-radius: 14px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 18px; }
  .hero-poster { width: 96px; }
  .hero-title { font-size: 24px; }
  .hero-syn { -webkit-line-clamp: 3; font-size: 13px; }

  /* tighter row cards */
  .row { margin-bottom: 22px; }
  .row-title { font-size: 15px; margin-bottom: 10px; }
  .row-scroll { gap: 10px; }
  .row-scroll .poster-card { width: 132px; }
  .row-scroll .poster-card .pc-title { font-size: 12px; }

  .modal { padding: 0; }
  /* dvh tracks the *visible* viewport, so the card doesn't run under the
     mobile browser's address bar (the old 100vh overshot it). */
  /* Pad past the notch/status bar in standalone PWA mode so the title and the
     fixed ✕ aren't tucked under it. */
  .modal-card { border-radius: 0; min-height: 100dvh;
    padding: calc(22px + env(safe-area-inset-top, 0)) 16px 0; }
  .modal-foot { margin-top: 18px; padding-left: 16px; padding-right: 16px; margin-left: -16px; margin-right: -16px; }
  .modal-close-btn { flex: 1; padding: 14px; }
  .modal-head { flex-direction: column; }
  .modal-head .poster { width: 130px; }
  .showing { flex-direction: column; align-items: flex-start; }
  .showing > div:last-child { text-align: left !important; width: 100%; }
  .foot { display: none; }
}

/* Slightly tighter still on very small phones */
@media (max-width: 360px) {
  .navbtn .nav-lbl { font-size: 9.5px; }
}
