:root {
  color-scheme: light;
  --ink: #14171a;
  --muted: #626b73;
  --paper: #f5f7f8;
  --panel: #ffffff;
  --line: #d8dee3;
  --red: #b23a34;
  --green: #1f6b58;
  --blue: #285d8f;
  --gold: #a5792a;
  --shadow: 0 14px 32px rgb(20 23 26 / 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  margin: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.brand {
  color: var(--ink);
  display: inline-flex;
  flex-wrap: wrap;
  font-size: 20px;
  font-weight: 850;
  gap: 8px;
  line-height: 1.1;
  text-decoration: none;
}

.brand span + span {
  color: var(--muted);
  font-weight: 750;
}

.filter-shell {
  background: rgb(255 255 255 / 0.97);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.filter-bar {
  align-items: center;
  display: flex;
  gap: 12px;
  margin: 0 auto;
  max-width: 1120px;
  min-height: 56px;
  padding: 8px 16px 7px;
}

.hidden-tray summary::-webkit-details-marker,
.multi-dropdown > summary::-webkit-details-marker {
  display: none;
}

.filter-view-tabs {
  flex: 1 1 auto;
  max-width: 340px;
  min-width: 0;
}

.filter-view-tabs .filter-row {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-view-tabs .chip span {
  justify-content: center;
  width: 100%;
}

.filter-date-strip {
  border-top: 1px solid #e9edf0;
}

.filter-date-strip .date-row {
  margin: 0 auto;
  max-width: 1120px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 16px 10px;
}

.filter-date-strip .chip span {
  justify-content: center;
  min-width: 92px;
}

.icon-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: 42px;
  justify-content: center;
  padding: 0;
  width: 42px;
}

.icon-button:hover {
  border-color: #aab5bd;
}

.icon {
  display: block;
  height: 21px;
  width: 21px;
}

.filter-scrim {
  background: rgb(20 23 26 / 0.28);
  inset: 0;
  position: fixed;
  z-index: 80;
}

.filter-panel {
  background: var(--panel);
  box-shadow: 18px 0 36px rgb(20 23 26 / 0.18);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  inset-block: 0;
  left: 0;
  max-height: 100vh;
  overflow: hidden;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
  pointer-events: none;
  position: fixed;
  transform: translateX(calc(-100% - 2px));
  transition:
    transform 180ms ease,
    visibility 0s linear 180ms;
  visibility: hidden;
  width: min(390px, calc(100vw - 34px));
  z-index: 90;
}

@supports (height: 100dvh) {
  .filter-panel {
    height: 100dvh;
    max-height: 100dvh;
  }
}

.filter-shell[data-panel-open] .filter-panel {
  pointer-events: auto;
  transform: translateX(0);
  transition: transform 180ms ease;
  visibility: visible;
}

html.filter-panel-open,
html.filter-panel-open body {
  overflow: hidden;
}

.filter-panel-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.filter-panel-head h2 {
  margin-top: 2px;
}

.filter-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 10px 0 0;
}

.filter-panel-actions {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding-top: 10px;
}

.filters {
  align-content: start;
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 2px 16px;
  -webkit-overflow-scrolling: touch;
}

.filter-control {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.filter-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.filter-panel .scroll-row {
  margin-inline: 0;
  padding-inline: 0;
}

.scroll-row {
  margin-inline: -16px;
  overflow-x: auto;
  padding-inline: 16px;
  scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  flex: 0 0 auto;
}

.chip input {
  block-size: 1px;
  inline-size: 1px;
  opacity: 0;
  position: absolute;
}

.chip span,
.ghost-link,
.book-link,
.hide-button,
.unhide-button,
.clear-hidden,
.clear-filters,
.apply-filters,
.time-chip {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  font-size: 14px;
  font-weight: 750;
  min-height: 38px;
  padding: 8px 11px;
  text-decoration: none;
  white-space: nowrap;
}

.chip input:focus-visible + span,
.multi-option input:focus-visible,
button:focus-visible,
a:focus-visible,
.multi-dropdown > summary:focus-visible {
  outline: 3px solid rgb(40 93 143 / 0.28);
  outline-offset: 2px;
}

.chip input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.multi-select {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.control-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.multi-dropdown {
  min-width: 0;
  position: relative;
}

.multi-dropdown > summary {
  align-items: center;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 52% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 12px) 52% / 6px 6px no-repeat,
    white;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  list-style: none;
  min-height: 42px;
  padding: 8px 34px 8px 11px;
}

.multi-dropdown > summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-dropdown[open] > summary {
  border-color: #aab5bd;
  box-shadow: 0 0 0 3px rgb(31 107 88 / 0.14);
}

.multi-menu {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 2px;
  left: 0;
  margin-top: 4px;
  max-height: min(360px, calc(100vh - 180px));
  min-width: 100%;
  overflow: auto;
  padding: 6px;
  position: absolute;
  top: 100%;
  z-index: 30;
}

.multi-option {
  align-items: center;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  min-height: 34px;
  min-width: 0;
  padding: 6px 8px;
}

.multi-option:hover {
  background: #eef3f5;
}

.multi-option input {
  accent-color: var(--ink);
  flex: 0 0 auto;
  margin: 0;
}

.multi-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden-tray {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.hidden-tray summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0 auto;
  max-width: 1120px;
}

.hidden-tray summary > span:first-child,
.kicker {
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  margin: 0;
  text-transform: uppercase;
}

.hidden-tray summary > span:last-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.hidden-tray summary::after {
  border-color: var(--muted);
  border-style: solid;
  border-width: 0 2px 2px 0;
  content: "";
  height: 7px;
  margin-left: auto;
  transform: rotate(45deg);
  width: 7px;
}

.hidden-tray[open] summary::after {
  transform: rotate(225deg);
}

.hidden-tray-body {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 10px auto 0;
  max-width: 1120px;
  min-width: 0;
}

.hidden-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.unhide-button {
  background: #eef3f5;
  color: var(--green);
  min-height: 34px;
  padding: 6px 9px;
}

.clear-hidden {
  background: #fff;
  color: var(--muted);
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 9px;
}

.clear-filters {
  background: #fff;
  color: var(--muted);
  justify-content: center;
}

.apply-filters {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  justify-content: center;
}

.content {
  margin: 0 auto;
  max-width: 1120px;
  padding: 16px;
}

.result-bar {
  align-items: end;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.result-bar p:last-child {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  margin: 0;
}

.timeline,
.movie-list {
  display: grid;
  gap: 12px;
}

.show-card,
.movie-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  padding: 12px;
}

.show-card {
  grid-template-columns: 84px 92px 1fr;
}

.movie-card {
  grid-template-columns: 92px 1fr;
}

.time-rail {
  align-content: start;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-right: 10px;
}

.time-rail time {
  color: var(--green);
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}

.time-rail .hide-button {
  font-size: 12px;
  justify-content: center;
  line-height: 1.1;
  min-height: 32px;
  padding: 5px 7px;
  text-align: center;
  white-space: normal;
  width: 100%;
}

.poster {
  aspect-ratio: 2 / 3;
  background:
    linear-gradient(145deg, #b23a34 0%, #1f6b58 62%, #14171a 100%);
  background-position: center;
  background-size: cover;
  border-radius: 7px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.poster img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.show-main,
.movie-main {
  min-width: 0;
}

.show-head {
  align-items: start;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

h1,
h2 {
  font-size: 20px;
  line-height: 1.1;
  margin: 0;
}

.show-head .kicker {
  margin-bottom: 6px;
}

.hide-button {
  background: #fff;
  color: var(--muted);
  min-height: 34px;
  padding: 6px 9px;
}

.hide-button-mobile {
  display: none;
}

.meta-grid,
.show-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.meta-grid:empty,
.show-details:empty,
.actions:empty {
  display: none;
}

.meta-grid span,
.show-details span {
  background: #eef3f5;
  border-radius: 7px;
  color: #30363b;
  font-size: 12px;
  font-weight: 750;
  padding: 5px 7px;
}

.description {
  color: #30363b;
  font-size: 14px;
  margin: 10px 0 0;
}

.description-toggle {
  background: transparent;
  border: 0;
  color: var(--blue);
  display: none;
  font-size: 14px;
  font-weight: 800;
  margin-top: 4px;
  min-height: 32px;
  padding: 0;
}

.cast {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.book-link {
  background: var(--red);
  border-color: var(--red);
  color: white;
}

.ghost-link {
  background: white;
  color: var(--blue);
}

.theater-times {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
}

.theater-line {
  display: grid;
  gap: 6px;
}

.theater-line strong {
  font-size: 14px;
}

.theater-line div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.time-chip {
  background: #eef3f5;
  color: var(--green);
  min-height: 34px;
  padding: 6px 9px;
}

.empty-state {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.empty-state p {
  color: var(--muted);
  margin: 8px 0 0;
}

.footer,
.noscript {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin-top: 28px;
  padding: 18px 16px 30px;
}

.footer p {
  margin: 0 auto 12px;
  max-width: 1120px;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 auto;
  max-width: 1120px;
}

.source-list a {
  border-bottom: 1px solid currentColor;
  font-size: 13px;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 680px) {
  .site-header {
    padding: 10px 12px;
  }

  .brand {
    display: grid;
    font-size: 18px;
    gap: 2px;
  }

  .brand span + span {
    font-size: 13px;
  }

  .filter-bar {
    gap: 8px;
    min-height: 54px;
    padding: 8px 12px 6px;
  }

  .filter-view-tabs {
    max-width: none;
  }

  .icon-button {
    height: 40px;
    width: 40px;
  }

  .filter-date-strip .date-row {
    display: grid;
    gap: 8px;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    margin: 0;
    max-width: none;
    overflow: visible;
    padding: 8px 12px 10px;
  }

  .filter-date-strip .chip {
    min-width: 0;
  }

  .filter-date-strip .chip span {
    min-width: 0;
    width: 100%;
  }

  .filter-panel {
    padding-inline: 12px;
    width: calc(100vw - 30px);
  }

  .filter-time .time-row {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-time .chip {
    min-width: 0;
  }

  .filter-time .chip span {
    justify-content: center;
    min-width: 0;
    width: 100%;
  }

  .filters {
    padding: 12px 2px 16px;
  }

  .multi-dropdown {
    position: static;
  }

  .multi-menu {
    box-shadow: none;
    max-height: min(34vh, 280px);
    overscroll-behavior: contain;
    position: static;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  @supports (height: 100dvh) {
    .multi-menu {
      max-height: min(34dvh, 280px);
    }
  }

  .scroll-row {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .result-bar {
    align-items: start;
    display: grid;
  }

  .show-card {
    grid-template-areas:
      "poster"
      "time"
      "main";
    grid-template-columns: 1fr;
  }

  .movie-card {
    grid-template-columns: 1fr;
  }

  .show-card .time-rail {
    align-items: center;
    border-bottom: 1px solid var(--line);
    border-right: 0;
    display: flex;
    grid-area: time;
    justify-content: space-between;
    padding: 0 0 10px;
  }

  .show-card .time-rail .hide-button {
    white-space: nowrap;
    width: auto;
  }

  .hide-button-desktop {
    display: none;
  }

  .hide-button-mobile {
    display: inline-flex;
  }

  .show-card .poster {
    grid-area: poster;
    width: 100%;
  }

  .show-card .show-main {
    grid-area: main;
  }

  .movie-card .poster {
    width: 100%;
  }

  .time-rail time {
    font-size: 21px;
  }

  .show-card:not([data-description-expanded]) .description,
  .movie-card:not([data-description-expanded]) .description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
  }

  .description-toggle {
    display: inline-flex;
  }

  .description-toggle[hidden] {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .hidden-tray-body {
    align-items: start;
    display: grid;
    justify-content: stretch;
  }

  .show-card {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 860px) {
  .filter-date-strip .date-row {
    flex-wrap: wrap;
    margin-inline: auto;
    overflow: visible;
    padding-inline: 16px;
  }

  .timeline,
  .movie-list {
    gap: 14px;
  }
}
