:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --surface-raised: #22262f;
  --text: #f2f3f5;
  --text-muted: #9aa1ac;
  --accent: #ff6b4a;
  --accent-text: #1a0d08;
  --border: #2c3138;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

/* The browser's own [hidden] default (display:none) is easy to
   accidentally defeat — any class rule that sets `display` on the same
   element (e.g. `.planner-pick-form { display: flex }`) silently wins,
   because author stylesheets always override the browser's built-in
   styles regardless of selector specificity. This guarantees `hidden`
   always actually hides, everywhere in the app, permanently. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app-header {
  padding: 20px 110px 12px 16px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.subtitle a {
  color: var(--accent);
  text-decoration: none;
}

.subtitle a:hover {
  text-decoration: underline;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.filter-tab.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.filter-tab-date {
  font-weight: 400;
  font-size: 0.8em;
  opacity: 0.75;
}

.search-box {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.search-box::placeholder {
  color: var(--text-muted);
}

.cinema-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cinema-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.cinema-chip.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

main {
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
  min-height: 50vh;
}

.status {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 16px;
}

.status--compact {
  padding: 12px 4px;
  text-align: left;
  font-size: 0.85rem;
}

.show-more-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.show-more-btn:hover {
  background: var(--border);
}

.surprise-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 700px) {
  .surprise-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.surprise-column-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.day-group {
  margin-bottom: 24px;
}

.day-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.film-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.film-card-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.film-card-toggle--static {
  cursor: default;
}

.film-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
}

.film-summary {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.toggle-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.film-card-times {
  margin-top: 12px;
}

.cinema-group {
  margin-top: 10px;
}

.cinema-group:first-child {
  margin-top: 0;
}

.cinema-group-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.showing-entry {
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.showing-entry:first-of-type {
  border-top: none;
}

.showing-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.showing-cinema {
  flex: 1;
  min-width: 0;
}

.showing-format {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.showing-time {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 56px;
  text-align: right;
}

.book-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.book-btn:active {
  opacity: 0.8;
}

.app-footer {
  text-align: center;
  padding: 24px 16px 40px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.site-footer p {
  margin: 6px 0;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.version-tag {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 12px !important;
}

@media (min-width: 600px) {
  .app-header {
    padding: 28px 130px 16px 24px;
  }
  .controls {
    padding: 8px 24px 16px;
  }
  main {
    padding: 16px 24px;
  }
}

/* Top-level view switcher (Browse / Plan a double bill) */

.view-tabs {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--border);
}

.view-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.view-tab.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* LFF section's own sub-tabs (Double Bill / Triple Bill / Browse) — kept
   visually smaller and secondary to the top-level view tabs, with a
   small "LFF" eyebrow label on each one, so it reads as "inside the
   festival section" rather than a second, unrelated set of tabs with
   confusingly similar names. */
.lff-sub-tabs {
  padding: 10px 16px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.lff-sub-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: var(--radius);
  border-bottom: 1px solid var(--border);
  max-width: 140px;
}

.lff-tab-eyebrow {
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.lff-tab-label {
  font-size: 0.8rem;
}

/* Double-bill planner */

.planner-date-row,
.planner-pick-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.planner-date-row label,
.planner-pick-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.search-box:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pair-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.pair-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 10px;
}

.pair-film {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.pair-film:first-of-type {
  border-top: none;
  padding-top: 0;
}

.pair-film-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.pair-film-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.pair-film-details {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 4px 0 8px;
}

.pair-film-when {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin: 2px 0;
}

.pair-film-where {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.pair-gap-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pair-gap-divider::before,
.pair-gap-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.pair-gap-divider + .pair-film {
  border-top: none;
  padding-top: 0;
}

/* "Add to Bill" button on a planner result card */

.add-bill-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: none;
  letter-spacing: normal;
}

.add-bill-btn--saved {
  background: var(--accent);
  color: var(--accent-text);
}

/* "My Lists" menu button — sits top-right of the header */

.app-header {
  position: relative;
}

.lists-menu-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.lists-menu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 0.7rem;
  font-weight: 800;
}

@media (min-width: 600px) {
  .lists-menu-btn {
    top: 24px;
    right: 24px;
  }
}

/* "My Lists" panel — Watchlist / My Bill */

.lists-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  overflow-y: auto;
  padding: 16px;
}

.lists-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.lists-panel-tabs {
  display: flex;
  gap: 6px;
}

.lists-panel-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.lists-panel-tab.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.lists-panel-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

.lists-panel-section {
  max-width: 560px;
  margin: 0 auto;
}

.lists-panel-section .field-hint {
  margin-bottom: 10px;
}

.lists-panel-section .search-box {
  margin-bottom: 12px;
}

.lists-panel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.watchlist-item,
.bill-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.watchlist-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.watchlist-item-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.watchlist-item-toggle:disabled {
  cursor: default;
}

.watchlist-item-main {
  flex: 1;
  min-width: 0;
}

.watchlist-item-showings {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.watchlist-showing-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.watchlist-showing-when {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 108px;
}

.watchlist-showing-where {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.watchlist-item-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.planned-check {
  margin-left: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

.watchlist-item-info {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bill-item {
  flex-direction: column;
  align-items: stretch;
}

.bill-item-warning {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.bill-item-clash {
  color: #ff5c6c;
}

.bill-item-film {
  padding: 6px 0;
  border-top: 1px solid var(--border);
}

.bill-item-film:first-of-type {
  border-top: none;
  padding-top: 0;
}

.bill-item-film-title {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
}

.bill-item-film-details {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.list-remove-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.list-remove-btn--wide {
  align-self: flex-start;
  width: auto;
  height: auto;
  border-radius: 999px;
  padding: 6px 14px;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.bill-export-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.bill-export-btn {
  flex: 1;
  display: block;
  padding: 10px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: var(--accent-text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.bill-export-btn--secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.receipt-name-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.receipt-name-row .search-box {
  flex: 1;
}

.receipt-name-row .bill-export-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 10px 16px;
}

/* First-visit "what's new" callout */

.whats-new-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.whats-new-card {
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.whats-new-card h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.whats-new-list {
  margin: 0 0 12px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
}

.whats-new-list strong {
  color: var(--accent);
}

.whats-new-card .field-hint {
  margin-bottom: 16px;
}

.whats-new-dismiss-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: var(--accent-text);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

/* Per-showing ticket status (Ticketed / Standby) */

.status-control {
  position: relative;
  margin-top: 6px;
}

.status-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.status-toggle-btn--active {
  border-color: var(--accent);
  color: var(--accent);
}

.status-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 130px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-menu-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.status-menu-option:hover {
  background: var(--surface);
}

.status-menu-option.active {
  color: var(--accent);
}

#bill-status-filter-hint {
  margin-bottom: 12px;
}

/* My Bill's export-only status filter chips */

.status-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.status-filter-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.status-filter-chip.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.bill-export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
