/* ============================================================
   MOVIE FINDER — "CALM SLATE"
   Cool near-black slate, one desaturated indigo accent, Inter,
   hairline separation instead of glow. Easier on the eyes.
   ============================================================ */

:root {
  color-scheme: dark;
  --bg-void: #0C0E12;
  --bg-glow: rgba(94, 106, 210, 0.05);
  --surface-velvet: #12151B;   /* cards, inset fields */
  --surface-raised: #191D25;   /* inputs, selects, pills, chips */
  --surface-glass: rgba(12, 14, 18, 0.82);
  --band: #171B22;             /* tr-head band, badges, deck toggle */
  --hover: #1F242E;            /* hover fills */
  --line-solid: #262C38;       /* control + card borders */
  --line-strong: #39414F;      /* hover borders, emphasis borders */
  --hairline: #1E232C;         /* page dividers */
  --accent: #5E6AD2;           /* the one accent: fills */
  --accent-deep: #4C56C0;      /* active date chip, selection */
  --accent-border: #6E79DD;    /* slider fill, focus borders, flash */
  --accent-text: #A3ACF7;      /* accent-colored text */
  --on-accent: #FFFFFF;
  --red: #E5484D;
  --red-bright: #F2708A;
  --text: #E8EAF0;
  --dim: #A0A8B8;
  --faint: #8B93A5;
  --quiet: #63D68F;
  --moderate: #E3B341;
  --busy: #F08A4B;
  --packed: #F2708A;
  --focus: #8A94F0;
  --aud: #7CB8F2;              /* audience score — blue, off the amber ramp */
  --star: #E5C558;             /* IMDb + star glyph only */
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0.25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scrollbar-width: thin; scrollbar-color: #2B313E transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2B313E; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: var(--accent-deep); color: #FFFFFF; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

body {
  background: radial-gradient(80% 40% at 50% 0%, var(--bg-glow), transparent 60%), var(--bg-void);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}

/* interactive baseline — every control is tactile */
button, .chip, .date-chip, .pill, .toggle-btn, .quiet-filter, select, input[type=range] {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
}

.booting .controls { opacity: 0.5; pointer-events: none; }

/* ---------------- top bar ---------------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
@supports not (backdrop-filter: blur(1px)) {
  .topbar, .controls { background: #101318; }
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 36px; height: 36px; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--line-solid);
}
.wordmark { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.wordmark b { font-weight: 600; color: var(--accent-text); }
.provider-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 1.2px;
  color: var(--dim);
  background: var(--band);
  border: 1px solid var(--line-solid);
  padding: 6px 12px; border-radius: 999px; cursor: help;
}

/* ---------------- glass control deck ---------------- */

.controls {
  position: sticky; top: 64px; z-index: 19;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
  padding: 16px 24px 14px;
  display: flex; flex-direction: column; gap: 14px;
  /* taller than the viewport (mobile, expanded): scroll inside the deck
     so the bottom controls (Search) stay reachable */
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.control-row { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; }

/* --- organized filter sections --- */
.deck-inner { gap: 12px; }
.fsec {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 14px 16px;
}
.fsec-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 12px;
}
.fsec-head svg { width: 15px; height: 15px; color: var(--accent-text); flex-shrink: 0; }
.fsec-hint { font-size: 11px; font-weight: 500; color: var(--faint); margin-left: 2px; }
.fsec-count {
  display: none;
  align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 7px;
  border-radius: 999px;
  background: var(--accent); color: #FFFFFF;
  font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.fsec-count.on { display: inline-flex; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.loc-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.slider-group.wide { min-width: 0; max-width: 340px; }
.fsliders { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin-top: 12px; max-width: 640px; }
.fsec .chip-set + .chip-set { margin-top: 10px; }
.deck-actions {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding-top: 4px;
}
.btn.ghost.clear-all { border-color: rgba(110, 121, 221, 0.4); color: var(--accent-text); }
.btn.ghost.clear-all:hover { background: rgba(110, 121, 221, 0.12); border-color: var(--accent-border); }
.search-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 26px; font-size: 13.5px; font-weight: 700;
}
.search-btn svg { width: 15px; height: 15px; }
.deck-actions .result-count { margin-left: auto; }
@media (max-width: 640px) {
  .search-btn { width: 100%; justify-content: center; }
}
@media (max-width: 760px) {
  .fgrid, .fsliders { grid-template-columns: 1fr; }
  .fsliders { gap: 4px; }
}

/* --- collapsible deck --- */
.deck-bar { display: flex; align-items: center; gap: 14px; min-height: 40px; cursor: pointer; }
.deck-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--band);
  border: 1px solid var(--line-solid);
  color: #C5CBD8; font-size: 13px; font-weight: 600;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease),
    color 140ms var(--ease), transform 140ms var(--ease);
}
.deck-toggle:hover { background: var(--hover); border-color: var(--line-strong); color: var(--text); }
.deck-toggle:active { transform: scale(0.96); }
.deck-chevron { display: inline-block; transition: transform 260ms var(--ease); font-size: 12px; }
.controls.collapsed .deck-chevron { transform: rotate(-90deg); }

/* filter-count badge inside the button */
.deck-count {
  display: none;
  align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px;
  border-radius: 999px;
  background: var(--accent); color: #FFFFFF;
  font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.deck-count.on { display: inline-flex; }

/* collapsed = the "in your face" state: accent-filled, bigger, pulsing */
.controls.collapsed .deck-toggle {
  position: relative;
  height: 44px; padding: 0 20px;
  background: var(--accent);
  border-color: transparent;
  color: #FFFFFF;
  font-size: 13.5px; font-weight: 700;
}
.controls.collapsed .deck-toggle::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: 999px;
  pointer-events: none;
  animation: pulseRing 2.4s cubic-bezier(0.2, 0.7, 0.3, 1) infinite;
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(110, 121, 221, 0.55); }
  70%, 100% { box-shadow: 0 0 0 14px rgba(110, 121, 221, 0); }
}
.controls.collapsed .deck-toggle:hover {
  background: #6873DC; border-color: transparent; color: #FFFFFF;
  transform: translateY(-1px);
}
.controls.collapsed .deck-toggle:active { transform: scale(0.96); }
.controls.collapsed .deck-chevron { animation: chevPulse 2.4s ease-in-out infinite; }
@keyframes chevPulse {
  0%, 100% { transform: rotate(-90deg) scale(1); }
  50% { transform: rotate(-90deg) scale(1.3); }
}
.controls.collapsed .deck-toggle .deck-count.on { background: #FFFFFF; color: var(--accent-deep); }
.deck-summary {
  font-size: 12.5px; font-weight: 500; color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity 200ms var(--ease);
}
.controls.collapsed .deck-summary { opacity: 1; }
.deck-body {
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows 260ms var(--ease);
}
.deck-inner {
  overflow: hidden; min-height: 0;
  display: flex; flex-direction: column; gap: 14px;
  opacity: 1; transition: opacity 200ms var(--ease);
  padding-top: 14px;
}
.controls.collapsed .deck-body { grid-template-rows: 0fr; }
.controls.collapsed .deck-inner { opacity: 0; pointer-events: none; padding-top: 0; }

/* ---------------- date strip ---------------- */

.date-strip {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.date-strip::-webkit-scrollbar { display: none; }
.date-chip {
  scroll-snap-align: start;
  min-width: 68px; height: 56px; padding: 8px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--line-solid);
  color: var(--text);
  transition: border-color 150ms var(--ease), transform 150ms var(--ease),
    background-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.date-chip .dow { font-size: 10px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 1.2px; }
.date-chip .day { font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; }
.date-chip:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.date-chip:active { transform: scale(0.97); transition-duration: 80ms; }
.date-chip.active {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.date-chip.active .dow { color: rgba(255, 255, 255, 0.8); opacity: 1; }

/* ---------------- ZIP + Set ---------------- */

.loc-group { display: flex; gap: 10px; align-items: center; }
.zip {
  height: 44px; width: 148px; padding: 0 14px;
  border-radius: 10px;
  background: var(--surface-velvet);
  border: 1px solid var(--line-solid);
  color: var(--text);
  font-family: var(--font-body); font-weight: 500; font-size: 15px;
  font-variant-numeric: tabular-nums;
  caret-color: var(--accent-text);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.zip::placeholder { color: var(--faint); }
.zip:focus { outline: none; border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(110, 121, 221, 0.3); }
.zip.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.25);
  animation: shake 240ms var(--ease);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
.loc-label { font-size: 12px; font-weight: 600; color: var(--red-bright); }

.btn {
  height: 44px; padding: 0 20px; border-radius: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  border: 1px solid var(--line-solid);
  background: var(--surface-raised); color: var(--text);
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease),
    transform 140ms var(--ease), box-shadow 140ms var(--ease);
}
.btn:active { transform: scale(0.98); transition-duration: 80ms; }
.btn.gold {
  position: relative;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid transparent;
}
.btn.gold:hover:not(:disabled) { background: #6873DC; transform: translateY(-1px); }
.btn.gold:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn.gold:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.gold.busy { opacity: 0.7; }
.btn.gold.busy .btn-label { visibility: hidden; }
.btn.gold.busy::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.ghost {
  height: 40px; padding: 0 18px; border-radius: 10px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text); font-size: 13px;
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); }

/* ---------------- sliders ---------------- */

.slider-group { display: flex; flex-direction: column; gap: 2px; min-width: 170px; }
.slider-group label, .time-group > label {
  font-size: 11px; font-weight: 600; color: var(--dim);
  text-transform: uppercase; letter-spacing: 1px;
}
.slider-group b { color: var(--text); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; }

input[type=range] {
  appearance: none; -webkit-appearance: none;
  height: 40px; width: 100%;
  background: transparent;
  touch-action: pan-y;
  --fill: 50%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px;
  background:
    linear-gradient(var(--accent-border), var(--accent-border)) no-repeat,
    var(--line-solid);
  background-size: var(--fill) 100%;
}
input[type=range]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line-solid); }
input[type=range]::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--accent-border); }
input[type=range]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; margin-top: -8px; border-radius: 50%;
  background: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease);
}
input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease);
}
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.1); }
input[type=range]:hover::-moz-range-thumb { transform: scale(1.1); }
input[type=range]:active::-webkit-slider-thumb { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45), 0 0 0 8px rgba(110, 121, 221, 0.18); }
input[type=range]:active::-moz-range-thumb { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45), 0 0 0 8px rgba(110, 121, 221, 0.18); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45), 0 0 0 3px var(--focus); }
input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45), 0 0 0 3px var(--focus); }

/* ---------------- selects (time window + sort) ---------------- */

.time-group { display: flex; flex-direction: column; gap: 6px; }
.time-selects { display: flex; align-items: center; gap: 8px; }
.time-dash { color: var(--faint); }
.time-sel, .sort {
  appearance: none; -webkit-appearance: none;
  height: 44px; padding: 0 34px 0 12px;
  border-radius: 10px;
  background: var(--surface-raised)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238B93A5' stroke-width='1.5' stroke-linecap='round'/></svg>")
    no-repeat right 12px center;
  border: 1px solid var(--line-solid);
  color: var(--text);
  font-family: var(--font-body); font-weight: 500; font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.sort { padding-right: 40px; background-position: right 14px center; }
.time-sel:hover, .sort:hover { border-color: var(--line-strong); }
.time-sel:focus, .sort:focus { outline: none; border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(110, 121, 221, 0.3); }

/* ---------------- filter chips ---------------- */

.chip-set { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip-set::before {
  content: attr(data-label);
  font-size: 10px; font-weight: 600; color: var(--faint);
  text-transform: uppercase; letter-spacing: 1.5px; margin-right: 8px;
}
.chip {
  height: 40px; padding: 0 16px;
  display: inline-flex; align-items: center;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  background: transparent;
  border: 1px solid var(--line-solid);
  color: var(--dim);
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease),
    color 140ms var(--ease), transform 140ms var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip:active { transform: scale(0.96); transition-duration: 80ms; }
.chip.on {
  background: rgba(94, 106, 210, 0.15);
  border-color: rgba(110, 121, 221, 0.55);
  color: var(--accent-text);
  font-weight: 600;
}
.chip.on::before { content: '✓ '; font-size: 11px; margin-right: 2px; }

/* ---------------- view toggle ---------------- */

.bottom-row { justify-content: flex-start; align-items: center; }
.view-toggle {
  position: relative;
  display: inline-flex; gap: 0;
  height: 48px; padding: 4px;
  border-radius: 12px;
  background: #14171E;
  border: 1px solid var(--line-solid);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.toggle-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: 0;
  border-radius: 8px;
  background: #2B313E;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 220ms var(--ease-spring), width 220ms var(--ease-spring);
}
.toggle-btn {
  position: relative; z-index: 1;
  height: 40px; padding: 0 20px;
  border-radius: 8px; border: none; background: transparent;
  font-size: 13px; font-weight: 600;
  color: var(--dim);
  transition: color 220ms var(--ease);
}
.toggle-btn:not(.active):hover { color: var(--text); }
.toggle-btn:active { transform: scale(0.97); }
.toggle-btn.active { color: var(--text); }

/* ---------------- quiet switch ---------------- */

.quiet-filter {
  display: flex; gap: 10px; align-items: center;
  min-height: 40px; padding: 0 6px;
  font-size: 13px; font-weight: 500; color: var(--dim);
}
.fsec .quiet-filter { padding: 0; margin-top: 10px; }
.quiet-filter:has(input:checked) .switch-label { color: var(--accent-text); }
.quiet-filter input {
  appearance: none; -webkit-appearance: none;
  width: 44px; height: 24px; border-radius: 999px;
  background: var(--line-solid);
  position: relative; cursor: pointer; flex-shrink: 0;
  transition: background-color 180ms var(--ease);
}
.quiet-filter input::before {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--faint);
  transition: transform 180ms var(--ease-spring), background-color 180ms var(--ease);
}
.quiet-filter input:checked { background: var(--accent); }
.quiet-filter input:checked::before {
  transform: translateX(20px);
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.result-count {
  margin-left: auto;
  font-size: 12.5px; font-weight: 600; color: var(--dim);
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-solid);
  border-radius: 999px; padding: 6px 14px;
}
.result-count:empty { display: none; }
.result-count.tick { animation: ack 180ms var(--ease); }
@keyframes ack { from { opacity: 0; transform: translateY(2px); } }

/* ---------------- Now Playing poster rail ---------------- */

.rail-wrap { max-width: 1100px; margin: 22px auto 0; padding: 0 24px; }
.rail-title { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; margin-bottom: 4px; }
.rail-stage { position: relative; }
.rail {
  display: flex; gap: 14px;
  overflow-x: auto; scroll-snap-type: x proximity;
  padding: 12px 2px 14px;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}
.rail::-webkit-scrollbar { display: none; }
.rail-card {
  flex: 0 0 auto; width: 150px;
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 6px;
  background: none; border: none; padding: 0; text-align: left;
  transition: transform 160ms var(--ease);
}
.rail-card:hover { transform: translateY(-2px); }
.rail-card:active { transform: scale(0.97); }
.rail-poster {
  width: 150px; height: 214px; object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.55);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
  display: flex; align-items: center; justify-content: center; font-size: 40px;
}
.rail-card:hover .rail-poster {
  border-color: var(--line-strong);
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.6);
}
.rail-name {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.rail-meta { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.rail-arrow {
  position: absolute; top: 92px; z-index: 5;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1; padding-bottom: 3px;
  background: rgba(12, 14, 18, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-solid);
  color: var(--text);
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease);
}
.rail-arrow:hover { background: var(--hover); border-color: var(--line-strong); }
.rail-arrow:active { transform: scale(0.92); }
.rail-arrow.prev { left: -12px; }
.rail-arrow.next { right: -12px; }

/* landing flash when jumping from the rail to a movie card */
.card.flash { animation: cardFlash 1.4s var(--ease); }
@keyframes cardFlash {
  0%, 60% { border-color: var(--accent-border); box-shadow: 0 0 0 2px rgba(110, 121, 221, 0.45), 0 12px 32px -16px rgba(0, 0, 0, 0.45); }
  100% { border-color: var(--line-solid); }
}

/* ---------------- results ---------------- */

.results {
  padding: 28px 24px 64px;
  display: flex; flex-direction: column; gap: 20px;
  max-width: 1100px; margin: 0 auto;
}
.results[aria-busy="true"] { opacity: 0.6; }

.card {
  background: var(--surface-velvet);
  border: 1px solid var(--line-solid);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px -16px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  position: relative;
  animation: rise 260ms ease-out both;
  animation-delay: calc(var(--i, 0) * 40ms);
  transition: border-color 220ms var(--ease);
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: rgba(255, 255, 255, 0.04);
}
.card:hover { border-color: var(--line-strong); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* movie head */
.movie-head { display: flex; gap: 18px; padding: 20px; }
.poster {
  width: 122px; height: 176px; border-radius: 10px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; font-size: 34px; text-align: center;
  position: relative; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 16px -8px rgba(0, 0, 0, 0.55);
}
.poster::after, .mini-poster::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 8%, transparent 40%, rgba(0, 0, 0, 0.35));
}
.poster > span { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); z-index: 1; }
.poster small {
  z-index: 1;
  font-weight: 600; font-size: 11px;
  letter-spacing: 0.5px; color: #FFF; padding: 0 6px; line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
/* real key art: title caption sits on the bottom scrim */
.poster.has-img { justify-content: flex-end; padding-bottom: 8px; }
.poster.has-img::after {
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.78));
}
.movie-info { flex: 1; min-width: 0; }
.movie-title { font-weight: 600; font-size: 19px; letter-spacing: -0.015em; margin-bottom: 5px; }
.movie-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 7px; }
.mpaa {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: var(--dim);
  border: 1px solid var(--line-strong);
  padding: 3px 8px; border-radius: 4px;
}
.meta-dim { font-size: 13px; color: var(--dim); }
.score {
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  display: inline-flex; gap: 4px; align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px; padding: 3px 9px;
}
.score.fresh { color: var(--quiet); }
.score.rotten { color: var(--red-bright); }
.score.aud { color: var(--aud); }
.score.imdb { color: var(--star); }
.trailer-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  color: var(--accent-text);
  text-decoration: none;
  border: 1px solid rgba(110, 121, 221, 0.4);
  border-radius: 8px; padding: 3px 10px;
  min-height: 26px;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease);
}
.trailer-btn::after { content: ''; position: absolute; inset: -7px; }  /* 40px tap target */
.trailer-btn:hover { background: rgba(110, 121, 221, 0.12); border-color: var(--accent-border); }
.trailer-btn:active { transform: scale(0.96); }
.blurb { font-size: 13.5px; color: var(--dim); line-height: 1.6; max-width: 640px; }

/* expandable full synopsis */
.blurb-long {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 280ms var(--ease);
}
.blurb-long-inner { overflow: hidden; min-height: 0; max-width: 640px; }
.blurb-long.open { grid-template-rows: 1fr; }
.blurb-long p { font-size: 13.5px; color: var(--dim); line-height: 1.6; margin: 10px 0 0; }
.blurb-toggle {
  display: inline-flex; align-items: center;
  margin-top: 4px; padding: 10px 0; min-height: 40px;
  background: none; border: none;
  color: var(--accent-text); font-size: 12.5px; font-weight: 600;
  transition: color 140ms var(--ease);
}
.blurb-toggle:hover { color: #C0C6FA; text-decoration: underline; text-underline-offset: 3px; }

/* theater rows */
.theater-row, .movie-row { border-top: 1px solid var(--hairline); padding: 14px 20px; transition: background-color 150ms var(--ease); }
.theater-row:hover, .movie-row:hover { background: rgba(255, 255, 255, 0.02); }
.tr-head {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  margin-bottom: 12px; padding: 10px 14px;
  background: var(--band);
  border-radius: 8px;
}
.tr-name { font-weight: 600; font-size: 15px; }

/* brand badge — instant theater recognition */
.tr-badge {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 9px; border-radius: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  border: 1px solid;
}
.tr-badge[data-brand="AMC"] { color: #FF8A93; border-color: rgba(229, 25, 55, 0.4); background: rgba(229, 25, 55, 0.13); }
.tr-badge[data-brand="Regal"] { color: #93B2FF; border-color: rgba(70, 105, 200, 0.45); background: rgba(70, 105, 200, 0.15); }
.tr-badge[data-brand="Touchstar"] { color: #5CDCC8; border-color: rgba(35, 160, 145, 0.4); background: rgba(35, 160, 145, 0.13); }
.tr-badge[data-brand="Majestic"] { color: #CFAAFF; border-color: rgba(140, 85, 220, 0.4); background: rgba(140, 85, 220, 0.14); }
.tr-badge[data-brand="Cinepolis"] { color: #79C4FF; border-color: rgba(30, 110, 190, 0.45); background: rgba(30, 110, 190, 0.14); }
.tr-badge[data-brand="CMX"] { color: #FFB077; border-color: rgba(220, 110, 30, 0.4); background: rgba(220, 110, 30, 0.13); }

/* branded logo plate (after the text-badge colors so it wins): white so any
   logo colorway reads; CMX's white logo gets a dark plate; AMC's mark is its own tile */
.tr-badge.tr-logo {
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 8px; height: 26px; border-radius: 6px;
}
.tr-badge.tr-logo img { display: block; height: 18px; width: auto; max-width: 76px; object-fit: contain; }
.tr-badge.tr-logo[data-brand="AMC"] { padding: 0; background: none; border: none; }
.tr-badge.tr-logo[data-brand="AMC"] img { height: 26px; border-radius: 6px; }
.tr-badge.tr-logo[data-brand="CMX"] { background: #20242E; border-color: var(--line-solid); }

.tr-dist { color: var(--dim); font-size: 12.5px; }
.tr-dist::before { content: '· '; color: var(--faint); }
.stars { font-size: 13px; display: inline-flex; gap: 3px; align-items: baseline; }
.stars .num { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stars .star-glyph { color: var(--star); }
.stars .cnt { color: var(--faint); font-weight: 400; font-size: 12px; }
.amenity {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-solid);
  border-radius: 5px; padding: 3px 8px;
}

/* busyness meter */
.busy-wrap { display: inline-flex; gap: 7px; align-items: center; font-size: 12px; }
.busy-wrap .lbl { font-weight: 700; color: var(--state); }
.busy-meter { display: inline-flex; gap: 3px; align-items: flex-end; height: 14px; }
.busy-meter i { width: 5px; border-radius: 2px; background: #2B313E; display: block; transition: background-color 200ms var(--ease); }
.busy-meter i:nth-child(1) { height: 5px; } .busy-meter i:nth-child(2) { height: 8px; }
.busy-meter i:nth-child(3) { height: 11px; } .busy-meter i:nth-child(4) { height: 14px; }
.busy-meter i.f { background: var(--state); }
.b-quiet { --state: var(--quiet); }
.b-moderate { --state: var(--moderate); }
.b-busy { --state: var(--busy); }
.b-packed { --state: var(--packed); }

/* showtime pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  position: relative;
  min-width: 84px; min-height: 56px; padding: 8px 14px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--line-solid);
  transition: border-color 160ms var(--ease), transform 160ms var(--ease),
    box-shadow 160ms var(--ease), background-color 160ms var(--ease);
}
.pill::after {
  content: '';
  position: absolute; left: 12px; right: 12px; bottom: 7px; height: 2px; border-radius: 1px;
  background: var(--state);
  opacity: 0.9;
}
.pill .t { font-weight: 600; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.pill .f { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); }
.pill .b { font-size: 10px; font-weight: 700; color: var(--state); }
.pill.p-quiet { --state: var(--quiet); }
.pill.p-moderate { --state: var(--moderate); }
.pill.p-busy { --state: var(--busy); }
.pill.p-packed { --state: var(--packed); }
.pill:hover {
  background: var(--hover);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.5);
}
.pill:active { transform: scale(0.96); }

/* theater-view */
.theater-head { padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.theater-head .tr-name { font-size: 17px; }
.th-addr { width: 100%; font-size: 12.5px; color: var(--faint); }
.movie-row { display: flex; gap: 14px; }
.mini-poster {
  width: 69px; height: 98px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  position: relative; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.movie-row .movie-title { font-size: 17px; }
.mr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

/* ---------------- empty state ---------------- */

.empty { text-align: center; color: var(--dim); padding: 88px 20px; font-size: 14px; line-height: 1.8; }
.empty-rule {
  width: 40px; height: 2px; margin: 0 auto 22px;
  background: #2B313E; border-radius: 1px;
  position: relative;
}
.empty-rule span {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  color: var(--faint); font-size: 14px;
  background: var(--bg-void); padding: 0 8px;
}
.empty-head { font-weight: 600; font-size: 17px; color: var(--text); margin-bottom: 8px; }
.empty-sub { max-width: 46ch; margin: 0 auto 20px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.loading-state { font-size: 15px; color: var(--faint); }

/* ---------------- footer ---------------- */

.foot {
  text-align: center; font-size: 12px; color: var(--faint);
  padding: 28px 24px 44px; line-height: 1.7;
  position: relative;
}
.foot::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: var(--hairline);
}
.foot b { color: var(--dim); font-weight: 600; }

/* ---------------- responsive ---------------- */

@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .controls { padding: 12px 14px 10px; }
  .results { padding: 16px 12px 40px; }
  .card { border-radius: 14px; }
  .movie-head { padding: 14px; gap: 12px; }
  .poster { width: 101px; height: 144px; }
  .movie-title { font-size: 17px; }
  .date-strip { gap: 6px; }
  .slider-group, .time-group { min-width: 100%; }
  .time-sel { flex: 1; }
  .bottom-row { gap: 10px; }
  .result-count { margin-left: 0; width: 100%; text-align: center; }
  .rail-wrap { padding: 0 12px; margin-top: 14px; }
  .rail-arrow { display: none; }   /* touch scroll on mobile */
  .rail-card, .rail-poster { width: 118px; }
  .rail-poster { height: 168px; }

  /* abbreviate descriptions on small screens; Full synopsis un-clamps */
  .blurb {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
  .movie-info:has(.blurb-long.open) .blurb {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
}

/* ---------------- reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
  .card { animation: none; }
}
