:root {
  color-scheme: dark;
  --bg: #0e1116;
  --surface: #161b22;
  --surface-raised: #1c2230;
  --border: #2a3140;
  --text: #e6edf3;
  --text-dim: #8b96a5;
  --accent: #5b8cff;
  --accent-dim: #3a5bb0;
  --good: #3fb950;
  --warn: #d29922;
  --danger: #f85149;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Light mode removed for now: the hero artwork is a photographic dark scene
   (a glow only reads as a glow against darkness) — a good-looking light
   equivalent needs genuinely new artwork, not a palette swap. Dark is the
   only theme until that's worth investing in. */

* { box-sizing: border-box; }

/* The browser's built-in [hidden] rule is only `display: none` at UA-stylesheet
   strength, so any of our own display rules beats it — `.btn { display: inline-block }`
   meant a button with the `hidden` attribute stayed visible. Needed because the
   app toggles visibility via `el.hidden = true` in several places. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* Hero header — the brand artwork itself IS the header, used as a real
   background banner (not a thin logo strip), fading into the page below.
   Deliberately full-bleed (not constrained to .page's max-width) and NOT
   sticky — at this height, sticky would eat too much scroll space, and a
   one-time hero at the top of the page is the standard modern pattern
   (matches how marketing/dashboard hybrids handle a rich header image).
   Always the artwork's native dark palette regardless of page theme — same
   reasoning as before, this is brand art, not a themed UI surface. */
header.hero {
  position: relative;
  width: 100%;
  height: 264px;
  background-color: #0e1116;
  background-image: url('/cinemajar-hero-og.png');
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero-home-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Fades the artwork into the page background so there's no hard seam —
   the actual "fade out" effect requested.
   The 90% start is load-bearing, not arbitrary: the tagline sits low in the
   artwork, and an earlier start (72%, tuned for the previous artwork whose
   tagline sat higher) dissolved it into the background. Re-check this against
   a real screenshot if the hero art is ever replaced again. */
header.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(14, 17, 22, 0) 90%, var(--bg) 100%);
  pointer-events: none;
}

.hero-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 22px 28px;
}

/* Glass-style buttons so they stay legible over the busy photographic
   background regardless of what part of the artwork sits behind them. */
header.hero .icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(14, 17, 22, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e6edf3;
  font-size: 19px;
}

header.hero .icon-btn:hover {
  background: rgba(14, 17, 22, 0.8);
}

header.hero .btn {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-raised);
  color: var(--text);
}

.page-title-row {
  margin-bottom: 20px;
}

.page-title-row h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

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

.card h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.health-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
}

.health-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.health-item .label {
  color: var(--text-dim);
  font-size: 12px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.ok { background: var(--good); }
.status-dot.bad { background: var(--danger); }

.entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.entry:last-child { border-bottom: none; }

.entry-main { min-width: 0; }

.entry-title {
  font-weight: 600;
  font-size: 15px;
}

.filter-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(210, 153, 34, 0.15);
  color: var(--warn);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.entry-meta {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 2px;
}

/* Status-colored variants of .filter-badge — used on the admin users page for
   account status (approved/pending/denied) and role (admin), so the same pill
   shape carries meaning through color rather than needing extra text. */
.filter-badge.status-good { background: rgba(63, 185, 80, 0.15); color: var(--good); }
.filter-badge.status-warn { background: rgba(210, 153, 34, 0.15); color: var(--warn); }
.filter-badge.status-danger { background: rgba(248, 81, 73, 0.15); color: var(--danger); }
.filter-badge.status-accent { background: rgba(91, 140, 255, 0.15); color: var(--accent); }

/* Admin users page: one card per person, nested inside the "All users" card so
   Approve/Revoke stays reachable without expanding anything, and the tracking
   list only appears when there's something to show. */
.user-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.user-card:last-child { margin-bottom: 0; }

.user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.user-card-summary {
  color: var(--text);
  font-weight: 500;
}

.user-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.user-detail summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
}

.user-detail summary::-webkit-details-marker { display: none; }

.user-detail summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
}

.user-detail[open] summary::before { transform: rotate(90deg); }

.user-detail h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin: 16px 0 8px;
}

.user-detail h3:first-of-type { margin-top: 12px; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { background: var(--accent-dim); }

.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn.danger:hover { background: rgba(248, 81, 73, 0.1); }

.btn.secondary { background: var(--surface-raised); color: var(--text); border: 1px solid var(--border); }

.empty {
  color: var(--text-dim);
  font-size: 14px;
  padding: 8px 0;
}

form.add-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}

.field input {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
}

.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.field.combo { position: relative; }

.combo-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 240px;
  overflow-y: auto;
  margin-top: -1px;
}

.combo-option {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
}

.combo-option:last-child { border-bottom: none; }
.combo-option:hover, .combo-option.active { background: var(--accent-dim); }

.combo-option .sub {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 1px;
}

.combo-empty {
  padding: 10px 12px;
  color: var(--text-dim);
  font-size: 14px;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field { flex: 1; }

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

.alert-row {
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.alert-row:last-child { border-bottom: none; }

.alert-reason {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 8px;
}

.alert-reason.sold-out-recovered { background: rgba(63, 185, 80, 0.15); color: var(--good); }
.alert-reason.new-showtime { background: rgba(91, 140, 255, 0.15); color: var(--accent); }
.alert-reason.filtered-seats { background: rgba(210, 153, 34, 0.15); color: var(--warn); }

.alert-time { color: var(--text-dim); font-size: 12px; }

.error-banner {
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}

/* Modals — About and Settings share this structure. Scope is deliberately
   minimal for a single-user tool: no focus-trap/ARIA-live machinery, just the
   basics done correctly (role=dialog, focus in/out, three ways to close). */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.modal-body {
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
}

.modal-body p { margin: 0 0 12px; }
.modal-body p:last-child { margin-bottom: 0; }

.modal-body .field { margin-bottom: 16px; }
.modal-body .field:last-of-type { margin-bottom: 0; }

.modal-meta {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 16px !important;
}

.modal-meta code {
  background: var(--surface-raised);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 10px 16px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Add-form section divider */
.field-divider {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
}

/* Landing / gated pages */
.hero-card h1 { margin-top: 0; }

.lede {
  font-size: 17px;
  color: var(--text);
  line-height: 1.6;
}

.feature-list {
  margin: 20px 0 28px;
  padding-left: 20px;
  color: var(--text-dim);
  line-height: 1.9;
}

.btn-google {
  display: inline-block;
  font-size: 17px;
  padding: 14px 24px;
}

.notice-banner {
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.4);
  color: var(--good);
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 15px;
}

.review-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.signout-form { margin-top: 12px; }

/* Format filter — checkboxes styled as selectable chips. The native checkbox is
   visually hidden but still focusable, so keyboard/screen-reader behaviour is the
   real thing rather than a div pretending to be a control. */
.format-row { display: flex; flex-wrap: wrap; gap: 8px; }

.format-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.format-option span {
  display: inline-block;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 15px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.format-option span:hover { border-color: var(--accent); }
.format-option input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.format-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.field-hint {
  font-size: 14px;
  color: var(--text-dim);
  margin: 10px 0 0;
}

/* Showtime filter bar (time range + format chips) */
.filter-bar {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 4px;
}

.filter-times {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-times .field { flex: 1; max-width: 180px; }

.filter-label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 8px;
}

.filter-bar .format-option span {
  padding: 7px 12px;
  font-size: 15px;
}

.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.filter-actions .field-hint { margin: 0; }

/* Chips (date picker on the Showtimes tab) */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
}

.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.showtime-row { cursor: pointer; }
.showtime-row:hover { background: var(--surface-raised); border-radius: 8px; }

/* Seat map */
.seat-legend {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.seat-legend span { display: inline-flex; align-items: center; gap: 6px; }

.seat-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.seat-swatch.available { background: var(--good); }
.seat-swatch.occupied { background: var(--border); }

.seat-grid-wrap {
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.seat-grid { display: inline-flex; flex-direction: column; gap: 3px; }

.seat-grid-row { display: flex; align-items: center; gap: 3px; }

.seat-grid-gap { height: 14px; }

.seat-row-label {
  width: 20px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

.seat-col-label {
  width: 14px;
  flex-shrink: 0;
  font-size: 9px;
  color: var(--text-dim);
  text-align: center;
}

.seat-cell {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 3px;
}

.seat-cell.available { background: var(--good); cursor: default; }
.seat-cell.occupied { background: var(--border); }
.seat-cell.empty-cell { background: transparent; }

.seat-list { font-size: 14px; }

@media (max-width: 480px) {
  .page { padding: 16px 14px 48px; }
  /* Shorter than desktop on purpose: with background-size:cover a wide image
     in a narrow container is scaled by HEIGHT, so a shorter hero scales the
     artwork down and lets the full wordmark fit with margin instead of running
     edge to edge. 63% keeps the wordmark centred (the source art is 3.6:1, far
     too wide to show the jar and the wordmark together on a phone — mobile
     deliberately prioritises the legible wordmark).
     72% chosen by comparing real screenshots at 50/63/72/80: below ~70% a
     vertically-sliced fragment of the jar hangs off the left edge and reads as
     a rendering accident rather than artwork; above ~75% the wordmark drifts
     left and the right side goes empty. */
  header.hero { height: 186px; background-position: 72% center; }
  .hero-actions { padding: 14px 16px; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  header.hero .icon-btn { width: 38px; height: 38px; font-size: 17px; }
  .entry { flex-direction: column; align-items: stretch; }
  .field-row { flex-direction: column; }
  .seat-cell, .seat-col-label { width: 11px; }
  .seat-cell { height: 11px; }
}

/* "optional" hint beside a field label */
.label-optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
  opacity: 0.75;
}

/* Row/seat range pickers. Native selects so mobile shows a scroll-wheel picker. */
.field select {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 16px;
  font-family: var(--font);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

form.add-form .filter-label { margin-bottom: -4px; }

/* Layout-only seats: the room's shape with no availability fetched. */
.seat-cell.unknown { background: var(--border); opacity: 0.55; }

/* Seat-number axis along the bottom of the grid. */
.seat-grid-axis { margin-top: 4px; }
.seat-grid-axis .seat-col-label { color: var(--text-dim); }

/* Secondary note inside the About modal — scope/limitations, not a feature. */
.modal-note {
  color: var(--text-dim);
  font-size: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 16px;
}
