:root {
  --page: #f4f2ec;
  --ink: #171717;
  --muted: #626760;
  --panel: #fffdfa;
  --line: #d8d3c7;
  --accent: #c02f2a;
  --accent-dark: #8c201e;
  --forest: #1f6f53;
  --blue: #315569;
  --gold: #d89a24;
  --shadow: 0 18px 52px rgba(33, 35, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 23, 23, 0.035) 1px, transparent 1px),
    linear-gradient(145deg, #fbf8f0 0%, var(--page) 58%, #e9e3d6 100%);
  background-size: 34px 34px, 34px 34px, auto;
}

.app-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.lookup-panel,
.movie-panel,
.status-panel,
.results-panel,
.session-results,
.details-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
}

.lookup-panel {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 28px;
  align-items: end;
  padding: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 5.8vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.intro {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
}

.lookup-form,
.field-grid {
  display: grid;
  gap: 14px;
}

.select-field {
  display: grid;
  gap: 7px;
}

.select-field span {
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #3e433f;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #c8c3b8;
  border-radius: 8px;
  padding: 0 42px 0 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: 0;
}

select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 85, 105, 0.18);
}

select:disabled {
  color: #8a8d87;
  background: #f2f0ea;
}

.action-row {
  display: flex;
  justify-content: flex-end;
}

.selection-summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed #c8c3b8;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
  box-shadow: 0 10px 24px rgba(192, 47, 42, 0.22);
  white-space: nowrap;
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.movie-panel {
  margin-top: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.movie-panel img {
  width: 86px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  background: #eee9de;
}

.movie-panel h2 {
  margin-bottom: 6px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.1;
}

.movie-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.status-panel {
  margin-top: 18px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 20px;
  align-items: center;
}

.status-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-panel h2 {
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.status-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.sold-meter {
  aspect-ratio: 1;
  border: 1px solid rgba(49, 85, 105, 0.22);
  border-radius: 8px;
  display: grid;
  place-content: center;
  gap: 2px;
  text-align: center;
  background: #eef5f2;
}

.sold-meter span {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 0.95;
}

.sold-meter small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-panel.loading .sold-meter {
  border-color: rgba(216, 154, 36, 0.36);
  background: #fff6df;
}

.status-panel.success .status-kicker,
.status-panel.success .sold-meter small {
  color: var(--forest);
}

.status-panel.success .sold-meter {
  border-color: rgba(31, 111, 83, 0.28);
  background: #e9f4ee;
}

.status-panel.error .status-kicker {
  color: var(--accent);
}

.status-panel.error .sold-meter {
  border-color: rgba(192, 47, 42, 0.28);
  background: #fff0ee;
}

.results-panel {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.metric {
  min-height: 132px;
  padding: 20px;
  border-left: 1px solid var(--line);
  display: grid;
  align-content: space-between;
  gap: 16px;
}

.metric:first-child {
  border-left: 0;
}

.metric.primary {
  background: #fff4f2;
}

.metric-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric strong {
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1;
}

.details-panel {
  margin-top: 18px;
  padding: 20px;
  display: grid;
  gap: 14px;
}

.session-results {
  margin-top: 18px;
  padding: 22px;
}

.results-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.results-heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.1;
}

.session-list {
  display: grid;
  gap: 12px;
}

.session-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.session-card:hover {
  border-color: rgba(31, 111, 83, 0.42);
  box-shadow: 0 10px 24px rgba(33, 35, 34, 0.1);
  transform: translateY(-1px);
}

.session-poster {
  width: 72px;
  height: 104px;
  object-fit: cover;
  border-radius: 6px;
  background: #eee9de;
}

.session-body {
  min-width: 0;
}

.session-meta {
  margin-bottom: 5px;
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.session-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.session-counts,
.session-seats {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.session-counts strong {
  color: var(--ink);
  font-weight: 900;
}

.session-seats {
  margin-top: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.site-footer {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.site-footer a {
  color: var(--blue);
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.detail-row,
.sold-seats {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
}

.detail-row span,
.sold-seats span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

code,
.sold-seats p {
  margin: 0;
  color: #242927;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .lookup-panel,
  .status-panel,
  .action-row,
  .detail-row,
  .sold-seats {
    grid-template-columns: 1fr;
  }

  .lookup-panel,
  .status-panel,
  .movie-panel,
  .results-panel,
  .session-results,
  .details-panel {
    box-shadow: 0 12px 36px rgba(33, 35, 34, 0.1);
  }

  .lookup-panel {
    padding: 22px;
  }

  button {
    width: 100%;
  }

  .status-panel {
    align-items: stretch;
  }

  .sold-meter {
    min-height: 120px;
    aspect-ratio: auto;
  }

  .results-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .metric:first-child,
  .metric:nth-child(2) {
    border-top: 0;
  }
}

@media (max-width: 500px) {
  .app-shell {
    width: min(100vw - 20px, 1120px);
    padding-top: 18px;
  }

  .movie-panel {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .session-card {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 12px;
  }

  .session-poster {
    width: 56px;
    height: 82px;
  }

  .movie-panel img {
    width: 68px;
    height: 96px;
  }

  .results-panel {
    grid-template-columns: 1fr;
  }

  .metric:nth-child(2) {
    border-top: 1px solid var(--line);
  }
}
