:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  background: #121316;
  color: #f7f4ec;
  --accent: #f6cd70;
  --muted: #b9b7bf;
  --border: #3b3b44;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.top, main, footer { width: min(100% - 2rem, 68rem); margin-inline: auto; }
.top { padding-block: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; font-size: 1.25rem; font-weight: 750; color: inherit; text-decoration: none; }
.mark { flex: none; width: 2.25rem; height: 2.25rem; }
h1, h2, h3, p { margin: 0; }
#library-title { font-size: clamp(1.5rem, 3vw, 2rem); }
#search { display: flex; gap: .5rem; max-width: 24rem; margin-bottom: 1.5rem; }
#query { flex: 1; min-width: 0; }
input, button, select { font: inherit; }
input[type="search"], button, select { color: inherit; background: #202127; border: 1px solid var(--border); border-radius: .65rem; padding: .6rem .7rem; }
button, select, input[type="checkbox"] { cursor: pointer; }
button:hover, select:hover { border-color: var(--accent); }
.primary { background: var(--accent); color: #231b0b; border-color: var(--accent); font-weight: 700; }
.primary:hover { background: #ffe2a0; }
:focus-visible { outline: .16rem solid #ffd67c; outline-offset: .2rem; }
#results-section { margin-bottom: 1.75rem; }
@media (min-width: 52rem) {
  .top, main, footer { width: calc(100% - clamp(2rem, 4vw, 4rem)); }
  #library { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
}
.section-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .9rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: .9rem; }
.card { display: flex; align-items: flex-start; gap: 1rem; min-width: 0; padding: 1rem; border: 1px solid var(--border); background: #1b1c21; border-radius: 1rem; }
.card--available {
  background-image: linear-gradient(rgb(98 166 117 / 16%) 0 0);
  border-color: #385144;
}
.card--upcoming {
  background-image: linear-gradient(rgb(218 178 76 / 14%) 0 0);
  border-color: #564832;
}
.poster { flex: 0 0 4.3rem; width: 4.3rem; aspect-ratio: 2 / 3; border-radius: .4rem; object-fit: cover; background: #342c2d; display: grid; place-items: center; color: var(--accent); }
.card-body { min-width: 0; display: grid; gap: .4rem; }
.card h3, .air-date { overflow-wrap: anywhere; }
.air-date { color: var(--accent); font-size: .9rem; }
.card a, footer a { color: inherit; }
.meta, .empty, footer, #feedback { color: var(--muted); }
.meta { font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .35rem; }
.actions button, .actions select { font-size: .875rem; }
.empty { grid-column: 1 / -1; padding: 1.25rem; border: 1px dashed var(--border); border-radius: 1rem; }
#feedback { margin-top: .9rem; }
#feedback:empty { display: none; }
footer { padding-block: 2rem; font-size: .875rem; }
dialog { width: min(35rem, calc(100% - 2rem)); max-height: 80vh; color: inherit; background: #1b1c21; border: 1px solid var(--border); border-radius: 1rem; padding: 1.25rem; }
dialog::backdrop { background: #000b; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
legend { color: var(--accent); margin-bottom: .35rem; font-weight: 700; }
#episode-feedback:not(:empty) { margin-bottom: .65rem; }
.episode-actions { margin-bottom: .65rem; }
.season-watch { margin-block: .25rem .5rem; font-size: .875rem; }
#episodes button:disabled { cursor: default; opacity: .65; }
.episode { display: flex; gap: .7rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.episode input { accent-color: var(--accent); flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
#open-account { max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#account-dialog, #sharing-dialog, #watchlist-link-dialog {
  width: min(28rem, calc(100% - 2rem));
  padding: clamp(1.125rem, 5vw, 1.75rem);
}

#account-dialog .section-head { margin-bottom: 1.25rem; }
#account-dialog button { min-height: 2.75rem; }
#passkey-login { width: 100%; }

.account-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }

#account-create {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  gap: .5rem;
}

#account-create h3 { margin-bottom: .375rem; }
#account-create label { font-size: .9375rem; font-weight: 600; }

#account-dialog input:is([type="text"], [type="email"]), #sharing-dialog input {
  width: 100%;
  min-height: 2.75rem;
  color: inherit;
  background: #202127;
  border: 1px solid var(--border);
  border-radius: .65rem;
  padding: .65rem .75rem;
}

#account-create .primary { margin-top: .375rem; }
#account-name { overflow-wrap: anywhere; }
#account-message:not(:empty) { margin-block: .75rem; color: var(--muted); }

#account-email-form, .sharing-section {
  border-top: 1px solid var(--border);
  padding-top: .9rem;
}
#account-email-form, #verified-email, #sharing-body { overflow-wrap: anywhere; }
#sharing-message:not(:empty) { margin-top: .75rem; }
.library-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.sharing-person { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sharing-person button { flex-shrink: 0; }
.sharing-invite { flex-wrap: wrap; }
.sharing-invite .actions { margin-top: 0; }

#watchlist-link-url {
  width: 100%;
  min-height: 2.75rem;
  color: inherit;
  background: #202127;
  border: 1px solid var(--border);
  border-radius: .65rem;
  padding: .65rem .75rem;
}
#published-watchlist-link .actions { align-items: center; }
#preview-watchlist-link { color: var(--accent); }
#watchlist-link-feedback:empty { display: none; }
.public-show-title { min-width: 0; overflow-wrap: anywhere; font-size: 1.125rem; }
