:root {
  --background:#0f0f0f;
  --surface:#1a1a1a;
  --border:#383838;
  --text:#f5f5f5;
  --muted:#b5b5b5;
  --accent:#00d4aa;
  --warning:#eac27b;
  --danger:#efa4a4;
  font-family:"Helvetica Neue",Helvetica,sans-serif;
  color:var(--text);
  background:var(--background);
  font-size:15px;
  color-scheme:dark;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

button,input,select {
  font:inherit;
}

button,a,input,select,summary {
  touch-action:manipulation;
}

button {
  cursor:pointer;
  background:transparent;
  color:var(--text);
  border:1px solid var(--border);
  border-radius:4px;
  padding:8px 12px;
  min-height:38px;
}

button:hover {
  background:#252525;
  border-color:#777;
}

button:disabled {
  opacity:.45;
  cursor:default;
}

button.primary {
  background:var(--accent);
  color:#0f0f0f;
  border-color:var(--accent);
  font-weight:600;
}

button.primary:hover {
  background:#52e3c6;
}

button.danger {
  color:var(--danger);
}

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

a {
  color:var(--accent);
  text-underline-offset:3px;
}

input,select {
  border:1px solid #777;
  border-radius:4px;
  background:var(--surface);
  color:var(--text);
  padding:9px;
  width:100%;
  min-width:0;
}

input::placeholder {
  color:#a7a7a7;
}

select[multiple] {
  padding:4px;
}

option {
  padding:5px 7px;
}

option:checked {
  background:#28534a;
  color:#fff;
}

label {
  display:flex;
  flex-direction:column;
  gap:8px;
  color:#ddd;
  font-size:14px;
}

h1,h2,h3,p {
  margin:0;
}

h1 {
  font-size:30px;
  font-weight:600;
  letter-spacing:-.7px;
}

h2 {
  font-size:22px;
  font-weight:600;
}

h3 {
  font-size:16px;
  font-weight:600;
}

.muted,.hint {
  color:var(--muted);
}

.hint {
  font-size:12px;
}

.visually-hidden {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

[hidden] {
  display:none!important;
}

.skip-link {
  position:absolute;
  top:-100px;
  left:16px;
  background:var(--surface);
  padding:12px;
  z-index:10;
}

.skip-link:focus {
  top:12px;
}

.site-header {
  display:flex;
  align-items:center;
  gap:40px;
  border-bottom:1px solid var(--border);
  padding:0 32px;
  min-height:76px;
}

.brand {
  font-size:24px;
  font-weight:700;
  text-decoration:none;
  color:var(--text);
  letter-spacing:-1px;
}

.brand-dot {
  color:var(--accent);
}

nav {
  display:flex;
  gap:24px;
  align-self:stretch;
}

nav button {
  border:0;
  border-radius:0;
  padding:0;
  border-bottom:2px solid transparent;
  font-size:14px;
  color:var(--muted);
}

nav button[aria-current="page"] {
  color:var(--text);
  border-color:var(--accent);
}

nav button:hover {
  background:none;
  color:var(--text);
}

.preferences-button {
  margin-left:auto;
}

main {
  max-width:1280px;
  margin:auto;
  padding:32px;
  min-height:75vh;
}

.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  margin-bottom:24px;
}

.page-heading p {
  color:var(--muted);
}

.browse-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  border-bottom:1px solid var(--border);
}

.tabs {
  display:flex;
  gap:28px;
}

.tabs button {
  border:0;
  border-bottom:2px solid transparent;
  border-radius:0;
  color:var(--muted);
  padding:16px 0;
}

.tabs button[aria-selected="true"] {
  color:var(--text);
  border-bottom-color:var(--accent);
}

.tabs button:hover {
  background:none;
  color:var(--text);
}

#search-form {
  display:flex;
  gap:8px;
  width:320px;
  padding-bottom:12px;
}

details {
  border-bottom:1px solid var(--border);
}

summary {
  padding:16px 0;
  cursor:pointer;
  width:fit-content;
  font-size:14px;
}

fieldset {
  padding:0;
  border:0;
  margin:0;
}

fieldset:disabled {
  opacity:.55;
}

.filter-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:20px 24px;
  padding:8px 0 20px;
}

.filter-grid label:first-child,.filter-grid label:nth-child(2) {
  grid-row:span 2;
}

.filter-grid .hint {
  display:inline;
}

.form-actions {
  display:flex;
  gap:12px;
  padding:12px 0;
}

.notice {
  border:1px solid var(--border);
  padding:16px;
  margin-bottom:24px;
}

.notice.warning {
  border-color:#695839;
  color:var(--warning);
}

.notice button {
  margin-left:16px;
  color:var(--warning);
}

.results-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:72px;
  color:var(--muted);
  font-size:14px;
}

.title-grid {
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:32px 20px;
}

.title-card {
  min-width:0;
}

.poster-button {
  width:100%;
  padding:0;
  border:0;
  border-radius:3px;
  display:block;
  background:var(--surface);
  overflow:hidden;
  aspect-ratio:2/3;
}

.poster-button:hover {
  border:0;
  background:#282828;
}

.poster-button img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.poster-empty {
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:12px;
  height:100%;
  color:#a7a7a7;
  padding:20px;
  font-size:13px;
}

.poster-empty svg {
  width:36px;
  height:36px;
}

.title-card h2 {
  margin:12px 0 6px;
  line-height:1.4;
}

.text-button {
  padding:0;
  min-height:0;
  border:0;
  text-align:left;
  border-radius:0;
  line-height:1.4;
  font-weight:600;
}

.text-button:hover {
  background:none;
  text-decoration:underline;
}

.title-meta {
  font-size:13px;
  color:var(--muted);
  line-height:1.6;
}

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

.card-actions button {
  font-size:12px;
  padding:6px 8px;
  min-height:32px;
}

.card-actions button[aria-pressed="true"],.detail-actions button[aria-pressed="true"] {
  color:var(--accent);
  border-color:#387568;
}

.empty-state {
  grid-column:1/-1;
  border-top:1px solid var(--border);
  padding:48px 0;
  max-width:640px;
}

.empty-state h2 {
  font-size:20px;
  margin-bottom:12px;
}

.empty-state p {
  color:var(--muted);
  line-height:1.6;
}

.pagination {
  display:flex;
  gap:20px;
  align-items:center;
  justify-content:center;
  padding:40px 0 8px;
}

.pagination span {
  color:var(--muted);
  font-size:14px;
}

footer {
  max-width:1280px;
  margin:auto;
  border-top:1px solid var(--border);
  padding:24px 32px;
  display:flex;
  gap:24px;
  justify-content:space-between;
  color:var(--muted);
  font-size:13px;
}

footer a {
  color:var(--muted);
}

dialog {
  background:var(--surface);
  color:var(--text);
  border:1px solid #555;
  border-radius:6px;
  padding:24px;
  width:min(680px,calc(100% - 32px));
  max-height:90vh;
}

dialog::backdrop {
  background:#000b;
}

dialog p {
  line-height:1.65;
  margin:12px 0;
}

dialog .dialog-top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border-bottom:1px solid var(--border);
  padding-bottom:16px;
  margin-bottom:24px;
}

#title-dialog {
  width:min(900px,calc(100% - 32px));
}

.detail-layout {
  display:grid;
  grid-template-columns:220px minmax(0,1fr);
  gap:28px;
}

.detail-poster {
  width:100%;
  border-radius:3px;
  grid-row:span 2;
  align-self:start;
  aspect-ratio:2/3;
  object-fit:cover;
  height:auto;
}

.detail-copy {
  grid-column:2;
}

.detail-layout h2 {
  font-size:28px;
  line-height:1.2;
}

.detail-facts {
  display:grid;
  grid-template-columns:auto 1fr;
  gap:8px 16px;
  font-size:14px;
  margin:20px 0;
}

.detail-facts dt {
  color:var(--muted);
}

.detail-facts dd {
  margin:0;
}

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

.availability {
  border-top:1px solid var(--border);
  margin-top:24px;
  padding-top:20px;
}

.availability ul {
  padding-left:20px;
  font-size:14px;
  line-height:1.8;
}

.preference-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
}

.preference-grid .wide {
  grid-column:1/-1;
}

.privacy {
  border-top:1px solid var(--border);
  margin-top:24px;
  padding-top:24px;
}

.privacy p {
  color:var(--muted);
  font-size:14px;
}

#preference-status,#provider-status {
  font-size:13px;
  color:var(--warning);
}

#provider-status {
  margin-bottom:12px;
}

#search-help {
  font-size:13px;
  margin-bottom:12px;
}

@media(max-width:1100px) {
  .title-grid {
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
  .site-header {
    gap:24px;
  }
  nav {
    gap:16px;
  }
}

@media(max-width:700px) {
  .site-header {
    flex-wrap:wrap;
    gap:16px;
    padding:20px 20px 0;
  }
  .brand {
    font-size:22px;
  }
  .preferences-button {
    font-size:13px;
  }
  nav {
    order:3;
    width:100%;
    gap:24px;
    overflow:auto;
    min-height:48px;
  }
  nav button {
    white-space:nowrap;
  }
  main {
    padding:24px 20px;
  }
  .page-heading {
    margin-bottom:16px;
  }
  .page-heading p {
    font-size:13px;
  }
  h1 {
    font-size:26px;
  }
  .browse-toolbar {
    align-items:stretch;
    flex-direction:column;
    gap:16px;
  }
  #search-form {
    width:100%;
    padding-bottom:16px;
  }
  .filter-grid {
    grid-template-columns:1fr 1fr;
    gap:16px;
  }
  .filter-grid label:first-child,.filter-grid label:nth-child(2) {
    grid-row:auto;
  }
  .title-grid {
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:24px 12px;
  }
  .card-actions button {
    font-size:12px;
  }
  .detail-layout {
    grid-template-columns:100px minmax(0,1fr);
    gap:16px;
  }
  .detail-layout h2 {
    font-size:23px;
  }
  .detail-copy {
    grid-column:1/-1;
  }
  .detail-poster {
    grid-row:auto;
  }
  .detail-facts {
    grid-template-columns:1fr 2fr;
  }
  .preference-grid {
    gap:16px;
  }
  footer {
    padding:24px 20px;
    flex-direction:column;
    gap:12px;
  }
}

@media(max-width:440px) {
  .title-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .page-heading {
    flex-wrap:wrap;
    gap:8px;
  }
  .preference-grid {
    grid-template-columns:1fr;
  }
  .detail-layout {
    grid-template-columns:80px minmax(0,1fr);
  }
  dialog {
    padding:20px;
  }
  .results-toolbar {
    align-items:flex-start;
    padding:20px 0;
  }
  .notice button {
    margin:12px 0 0;
  }
}

.recommend-basics {display:flex; align-items:end; gap:24px; margin-bottom:20px; flex-wrap:wrap;}
.recommend-basics > label:first-child {width:200px;}
.checkbox-label {display:flex; flex-direction:row; align-items:center; gap:8px; padding-bottom:10px;}
.checkbox-label input {width:auto;}
.recommendation-reasons {padding-left:18px; font-size:13px; line-height:1.6; color:var(--muted);}
.recommendation-reasons li + li {margin-top:6px;}
#recommend-controls + .results-toolbar + .title-grid:has(.recommendation-reasons) {grid-template-columns:repeat(3,minmax(0,1fr)); max-width:960px;}
@media(max-width:600px) {#recommend-controls + .results-toolbar + .title-grid:has(.recommendation-reasons) {grid-template-columns:1fr;} .recommend-basics {gap:12px;}}

.tmdb-credit {display:inline-block; margin:16px 0;}
.tmdb-credit img {display:block; width:120px; height:auto;}

/* Control boundaries and keyboard focus remain visible on the dark surfaces. */
button:not(.primary):not(.text-button):not(.poster-button):not([data-view]):not([role="tab"]) {border-color:#777;}
.title-card h2 {font-size:16px;}
#page-title:focus, #detail-title:focus {outline:2px solid var(--accent); outline-offset:4px;}
.detail-facts dd, .title-card h2, .detail-copy {overflow-wrap:anywhere;}
summary {min-height:44px;}
@media(max-width:700px) {
  nav {overflow:visible; flex-wrap:wrap; gap:0 20px; padding:4px 0;}
  nav button {min-height:44px;}
  button:not(.text-button):not(.poster-button), .checkbox-label {min-height:44px;}
}
