:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #66625d;
  --panel: #ffffff;
  --paper: #f4f5f0;
  --line: #d9d8d0;
  --tomato: #df3f32;
  --tomato-dark: #a32622;
  --teal: #00766f;
  --gold: #d49b22;
  --shadow: 0 18px 60px rgba(25, 25, 25, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, #f8f8f5 0%, #eef4f1 48%, #f7eeee 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
a {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 22px;
  width: min(1280px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
}

.control-panel,
.result-panel {
  border: 1px solid rgba(21, 21, 21, 0.08);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.control-panel {
  border-radius: 8px;
  padding: 24px;
  align-self: start;
}

.result-panel {
  position: relative;
  display: grid;
  min-height: calc(100vh - 32px);
  overflow: hidden;
  border-radius: 8px;
}

.brand-row,
.slider-head,
.status-row,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.3rem, 6vw, 4.7rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--tomato-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

form {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.field-label {
  display: block;
  margin-bottom: 10px;
  color: #343331;
  font-size: 0.88rem;
  font-weight: 800;
}

.slider-head .field-label {
  margin-bottom: 0;
}

.settings-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

input[type="password"] {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

.checkbox-grid,
.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-pill,
.chip-grid label,
.segments label {
  cursor: pointer;
  user-select: none;
}

.check-pill span,
.chip-grid span,
.segments span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #33312e;
  background: #fff;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.check-pill input,
.chip-grid input,
.segments input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.check-pill input:checked + span,
.chip-grid input:checked + span,
.segments input:checked + span {
  border-color: rgba(0, 118, 111, 0.65);
  color: #053d39;
  background: #ddf2ef;
}

.check-pill input:focus-visible + span,
.chip-grid input:focus-visible + span,
.segments input:focus-visible + span,
button:focus-visible,
a:focus-visible,
input[type="range"]:focus-visible,
input[type="password"]:focus-visible {
  outline: 3px solid rgba(223, 63, 50, 0.25);
  outline-offset: 2px;
}

.segments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--tomato);
}

output {
  color: var(--tomato-dark);
  font-weight: 900;
}

button,
.link-action {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.settings-toggle {
  width: 48px;
  height: 40px;
  color: #fff;
  background: var(--ink);
}

.primary-action {
  width: 100%;
  padding: 0 16px;
  color: #fff;
  background: var(--tomato);
}

.primary-action:hover {
  background: var(--tomato-dark);
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.compact {
  width: auto;
  min-width: 94px;
}

.empty-state {
  position: relative;
  min-height: 100%;
}

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

.empty-state::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18));
}

.empty-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  gap: 16px;
  max-width: 680px;
  min-height: calc(100vh - 32px);
  padding: 48px;
  color: #fff;
}

.empty-copy .eyebrow {
  color: #ffb5aa;
}

.empty-copy p:not(.eyebrow) {
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.06rem;
  line-height: 1.6;
}

.movie-card {
  display: grid;
  grid-template-columns: minmax(250px, 0.44fr) minmax(0, 0.56fr);
  gap: 0;
  min-height: 100%;
  background: var(--panel);
}

.poster-wrap {
  background: #181715;
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  min-height: 650px;
  object-fit: cover;
}

.movie-details {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(28px, 5vw, 64px);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-size: 0.82rem;
  font-weight: 900;
}

.badge-quiet {
  color: #4b3300;
  background: #ffe2a1;
}

.meta-line {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.overview {
  max-width: 64ch;
  color: #343331;
  font-size: 1.03rem;
  line-height: 1.65;
}

.watch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.provider-pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: #173a37;
  background: #ddf2ef;
  font-size: 0.84rem;
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 8px;
  color: #fff;
  background: rgba(21, 21, 21, 0.92);
  box-shadow: var(--shadow);
  font-weight: 800;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .result-panel,
  .empty-copy {
    min-height: 640px;
  }

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

  .poster-wrap img {
    height: min(72vh, 620px);
    min-height: 420px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100vw - 20px, 1280px);
    margin: 10px auto;
  }

  .control-panel,
  .movie-details,
  .empty-copy {
    padding: 20px;
  }

  .checkbox-grid,
  .chip-grid,
  .segments {
    grid-template-columns: 1fr;
  }

  .brand-row,
  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .compact {
    width: 100%;
  }
}
