/* v54: persistent system/day/night themes for mobile and desktop */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 6px;
  background: transparent;
  color: #f9f2e5;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 10px;
  font-weight: bold;
  transition: border-color .18s ease,background .18s ease,color .18s ease,transform .18s ease;
}
.theme-toggle:hover { border-color: rgba(255,240,202,.6); background: rgba(255,255,255,.1); color: #fff0ca; transform: translateY(-1px); }
.theme-toggle > span:first-child { width: 16px; font-size: 14px; line-height: 1; }

html[data-theme="dark"] {
  --red: #f05a50;
  --red-dark: #ff9189;
  --ink: #f2eee5;
  --ink-soft: #d8d5cc;
  --cream: #11130f;
  --paper: #1a1d18;
  --line: #3b3e35;
  --muted: #aaa99f;
  --green: #62d29b;
  --amber: #efb958;
  --blue: #83b6f1;
  --shadow: 0 18px 45px rgba(0,0,0,.34);
}

body,
.quick-controls,.filters,.movie-card,.cinema-group,.cinema-group-head,.showtime-row,
.showtime-chip,.session-detail,.active-filters button,.catalog-switch,.catalog-switch button,
.filter-grid input,.filter-grid select,.sort select,.data-tooltip,dialog,.seat-livebar,
.seat,.mobile-toolbar,.compare-tray,.toast {
  transition: background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease;
}

html[data-theme="dark"] body { background: var(--cream); color: var(--ink); }
html[data-theme="dark"] .topbar,
html[data-theme="dark"] footer,
html[data-theme="dark"] .mobile-toolbar,
html[data-theme="dark"] .compare-tray { background: #0d0f0c; }
html[data-theme="dark"] .view-tabs button[aria-pressed="true"] { border-color: #efbe5a; background: #262922; color: #fff6e8; }
html[data-theme="dark"] .search-stage::before { background: radial-gradient(circle at 10% 0%,rgba(255,179,82,.18),transparent 27%),linear-gradient(115deg,#8e2722 0%,#54191a 54%,#281113 100%); }
html[data-theme="dark"] .search-stage::after { opacity: .34; }
html[data-theme="dark"] .ticket-edge { background: radial-gradient(circle at 10px 14px,transparent 10px,var(--cream) 11px) 0 0/20px 14px repeat-x; }
html[data-theme="dark"] .search-input-wrap { border-color:#62645b; background:#20231e; box-shadow:0 13px 0 rgba(0,0,0,.23),0 22px 44px rgba(0,0,0,.28); }
html[data-theme="dark"] .search-input-wrap svg { stroke:#b6b3a9; }
html[data-theme="dark"] .search-input-wrap input { color:var(--ink); }
html[data-theme="dark"] .search-input-wrap input::placeholder { color:#898980; }
html[data-theme="dark"] .search-input-wrap button { background:#070806; color:#fff; }
html[data-theme="dark"] .search-input-wrap button:hover { background:#2d3029; }

html[data-theme="dark"] .quick-controls { border-color:var(--line); background:#171a15; box-shadow:0 10px 30px rgba(0,0,0,.16); }
html[data-theme="dark"] #nowButton,
html[data-theme="dark"] .nearby-button { border-color:#57594f; background:#20231d; color:var(--ink); }
html[data-theme="dark"] #nowButton:hover,
html[data-theme="dark"] .nearby-button:hover { border-color:#9c7f49; background:#282b24; }
html[data-theme="dark"] .date-shortcuts button { border-color:var(--line); background:#1c1f1a; color:var(--ink); }
html[data-theme="dark"] .date-shortcuts button:hover { border-color:#696b62; background:#252821; }
html[data-theme="dark"] .date-shortcuts button[aria-pressed="true"] { border-color:#f05a50; background:#f05a50; color:#fff; box-shadow:inset 0 -2px #ffb2ac,0 4px 14px rgba(0,0,0,.28); }
html[data-theme="dark"] .nearby-icon { background:#090a08; color:#fff; }
html[data-theme="dark"] .nearby-button[data-state="active"] { border-color:#4d8c6d; background:#173126; }
html[data-theme="dark"] .nearby-button[data-state="error"] { border-color:#94544f; background:#351c1a; }

html[data-theme="dark"] .filters { border-color:var(--line); background:#171a15; box-shadow:0 12px 34px rgba(0,0,0,.16); }
html[data-theme="dark"] .filter-grid select,
html[data-theme="dark"] .filter-grid input,
html[data-theme="dark"] .sort select { border-color:var(--line); background:#20231e; color:var(--ink); color-scheme:dark; }
html[data-theme="dark"] .filter-grid input::placeholder { color:#85857d; }
html[data-theme="dark"] .filter-grid select:hover,
html[data-theme="dark"] .filter-grid input:hover,
html[data-theme="dark"] .sort select:hover { border-color:#65685e; background:#252821; }

html[data-theme="dark"] .catalog-switch { border-color:var(--line); background:#242720; }
html[data-theme="dark"] .catalog-switch button { color:#bdbab0; }
html[data-theme="dark"] .catalog-switch button[aria-selected="true"] { background:#34372f; color:#ff9c94; box-shadow:0 1px 4px rgba(0,0,0,.35); }
html[data-theme="dark"] .active-filters button { border-color:#4b4e45; background:#20231e; color:var(--ink); }
html[data-theme="dark"] .loading,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .result-more { background:#171a15; }

html[data-theme="dark"] .movie-card { border-color:var(--line); background:var(--paper); box-shadow:0 3px 14px rgba(0,0,0,.18); }
html[data-theme="dark"] .movie-card-actions button { border-color:#55584e; background:#242720; color:var(--ink); }
html[data-theme="dark"] .movie-card-actions button:first-child { border-color:var(--red); background:#cf443c; color:#fff; }
html[data-theme="dark"] .movie-grid-skeleton i { background:linear-gradient(100deg,#252821 25%,#34372f 45%,#252821 65%); background-size:220% 100%; }
html[data-theme="dark"] .cinema-group { border-color:var(--line); background:var(--paper); box-shadow:0 10px 28px rgba(0,0,0,.2); }
html[data-theme="dark"] .cinema-group:hover { border-color:#606359; box-shadow:0 16px 36px rgba(0,0,0,.27); }
html[data-theme="dark"] .cinema-group-head { background:linear-gradient(100deg,#1d201b,#24221b); }
html[data-theme="dark"] .cinema-group-head li { border-color:#4b4c42; background:#292b24; color:#c7c3b8; }
html[data-theme="dark"] .showtime-row { background:#151812; }
html[data-theme="dark"] .showtime-chip { border-color:#4b4e44; background:#23261f; color:var(--ink); }
html[data-theme="dark"] .showtime-chip:hover { border-color:#777a70; background:#2a2d26; }
html[data-theme="dark"] .showtime-chip[aria-pressed="true"] { border-color:#f05a50; background:#cf443c; color:#fff; box-shadow:0 5px 14px rgba(0,0,0,.34); }
html[data-theme="dark"] .showtime-chip[aria-pressed="true"] small { color:#ffe0dc; }
html[data-theme="dark"] .tag { border-color:#494c43; background:#262921; color:#d3d0c6; }
html[data-theme="dark"] .best-badge { background:#4b3517; color:#f4ca76; }
html[data-theme="dark"] .availability-band { background:#183226; color:#6bd8a3; }
html[data-theme="dark"] .availability-band[data-level="limited"] { background:#3a2e15; color:#efc368; }
html[data-theme="dark"] .availability-band[data-level="scarce"] { background:#3d1d1b; color:#ff9e96; }
html[data-theme="dark"] .meter { background:#3a3c35; }
html[data-theme="dark"] .distance-badge,
html[data-theme="dark"] .group-badge.yes,
html[data-theme="dark"] .compare-button[aria-pressed="true"],
html[data-theme="dark"] .vote-button[aria-pressed="true"] { border-color:#437d60; background:#183226; color:#71daa8; }
html[data-theme="dark"] .price-action,
html[data-theme="dark"] .compare-content article { background:#211f19; }
html[data-theme="dark"] .utility-actions button,
html[data-theme="dark"] .utility-actions a,
html[data-theme="dark"] .compare-button { border-color:#4b4e45; background:#20231e; color:var(--ink); }
html[data-theme="dark"] .utility-actions button[aria-pressed="true"] { border-color:#9b7733; background:#3d3018; color:#f0c979; }

html[data-theme="dark"] .data-tooltip { border-color:#575342; background:#22251f; color:var(--ink); box-shadow:0 18px 42px rgba(0,0,0,.42); }
html[data-theme="dark"] .data-tooltip::after { border-color:#575342; background:#22251f; }
html[data-theme="dark"] .data-tooltip > strong,
html[data-theme="dark"] .source-tooltip-list b { color:#f1ede4; }
html[data-theme="dark"] .data-tooltip > p,
html[data-theme="dark"] .source-tooltip-list small,
html[data-theme="dark"] .source-tooltip-list small span { color:#b6b3aa; }
html[data-theme="dark"] .source-tooltip-list { border-color:var(--line); }

html[data-theme="dark"] dialog { border-color:#4a4d44; background:#1b1e19; color:var(--ink); box-shadow:0 25px 80px rgba(0,0,0,.55); }
html[data-theme="dark"] dialog::backdrop { background:rgba(0,0,0,.72); }
html[data-theme="dark"] .dialog-close { color:var(--ink); }
html[data-theme="dark"] .seat-map-button { border-color:#806c3f; background:#372f1b; color:#f0dfb9; }
html[data-theme="dark"] .seat-map-button:hover { border-color:#bd8f42; background:#43361b; color:#ffd588; }
html[data-theme="dark"] .seat-map-button > span:first-child { background:#090a08; }
html[data-theme="dark"] .seat-map-unavailable { border-color:#4a4c44; background:#20231e; }
html[data-theme="dark"] .seat-livebar { border-color:#3d7457; background:#183126; }
html[data-theme="dark"] .seat-livebar[data-mode="snapshot"] { border-color:#80683a; background:#382e18; }
html[data-theme="dark"] .seat-livebar[data-mode="error"] { border-color:#7e4843; background:#381d1b; }
html[data-theme="dark"] .seat-livebar button:hover { background:rgba(255,255,255,.08); }
html[data-theme="dark"] .seat.available { border-color:#4e8c69; background:#183126; color:#7adbac; }
html[data-theme="dark"] .seat.occupied { border-color:#55574f; background:#353830; color:#aaa9a0; }
html[data-theme="dark"] .seat.blocked { border-color:#766979; background:#302a32; color:#bbb0be; }
html[data-theme="dark"] .seat.suggested { border-color:#d69b31; background:#4a3514; color:#ffd27b; box-shadow:0 0 0 2px rgba(214,155,49,.16); }
html[data-theme="dark"] .screen::before { background:linear-gradient(90deg,transparent,#a8a79d,transparent); }
html[data-theme="dark"] .toast { background:#f0ece3; color:#11130f; }
html[data-theme="dark"] .skip { background:#f2eee5; color:#11130f; }

@media (max-width:680px) {
  .theme-toggle { width:36px; padding:7px; }
  .theme-toggle #themeLabel { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  html[data-theme="dark"] .filters { background:#171a15; }
  html[data-theme="dark"] .mobile-toolbar button,
  html[data-theme="dark"] .mobile-toolbar label { border-color:rgba(255,255,255,.24); color:#fff; }
  html[data-theme="dark"] .mobile-toolbar select { background:#0d0f0c; color:#fff; color-scheme:dark; }
}

@media (prefers-reduced-motion:reduce) {
  body,.quick-controls,.filters,.movie-card,.cinema-group,.cinema-group-head,.showtime-row,
  .showtime-chip,.session-detail,.active-filters button,.catalog-switch,.catalog-switch button,
  .filter-grid input,.filter-grid select,.sort select,.data-tooltip,dialog,.seat-livebar,
  .seat,.mobile-toolbar,.compare-tray,.toast { transition:none!important; }
}
