:root {
  color-scheme: dark;
  --bg: #101014;
  --surface: #1b1b23;
  --line: #ffffff20;
  --text: #f8f6f3;
  --muted: #b9b6c0;
  --gold: #f6bf59;
  --bottom: calc(68px + env(safe-area-inset-bottom));
  --gutter: clamp(18px, 4vw, 48px);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100dvh; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .64; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.top {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 12px;
  background: #101014e8; backdrop-filter: blur(18px); border-bottom: 1px solid #ffffff0c;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 780; letter-spacing: -.6px; }
.brand img { width: 29px; height: 29px; }
.server { font-size: 10px; font-weight: 750; letter-spacing: .16em; color: var(--muted); }
.server span, .kicker { color: var(--gold); }
#view { padding-bottom: calc(var(--bottom) + 22px); }
.loading, .message { padding: 15px var(--gutter); color: var(--muted); }
.kicker { margin: 0 0 8px; font-size: 11px; letter-spacing: .18em; font-weight: 800; text-transform: uppercase; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(31px, 7vw, 56px); line-height: 1.03; letter-spacing: -.055em; }
h2 { font-size: clamp(19px, 4vw, 26px); letter-spacing: -.035em; }
.muted { color: var(--muted); }
.hero {
  display: flex; align-items: end; position: relative; overflow: hidden;
  min-height: clamp(260px, 48vh, 500px); background: radial-gradient(ellipse at 70% 10%, #493831, #17141c 64%);
}
.hero img, .detail-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #101014 0%, #101014f4 10%, #1010145a 67%, #10101420); }
.hero-inner { position: relative; z-index: 1; padding: 54px var(--gutter) 22px; max-width: 580px; }
.hero-inner > p:not(.kicker), .intro > p:not(.kicker) { margin-top: 10px; color: var(--muted); line-height: 1.5; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.button {
  border: 1px solid transparent; border-radius: 999px; background: var(--gold); color: #181109;
  min-height: 44px; padding: 10px 18px; font-weight: 750; display: inline-flex; align-items: center; justify-content: center;
}
.secondary { background: #ffffff13; border-color: var(--line); color: var(--text); }
.danger { background: #461f2a; border-color: #bb6278; color: #ffd7df; }
.shelf { margin-top: 20px; }
.shelf h2 { margin: 0 var(--gutter) 12px; }
.rail { display: flex; gap: 11px; padding: 0 var(--gutter) 13px; overflow-x: auto; scroll-snap-type: x proximity; }
.rail .card { width: clamp(106px, 29vw, 165px); flex: none; scroll-snap-align: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 102px), 1fr)); gap: 16px 10px; margin-top: 18px; }
.card { appearance: none; color: var(--text); text-align: start; padding: 0; border: 0; background: transparent; min-width: 0; }
.cover { display: block; position: relative; width: 100%; aspect-ratio: 2/3; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(150deg, #39313e, #1b1b23); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card strong { display: block; margin-top: 7px; font-size: 13px; line-height: 1.25; }
.card small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.card .recommendation-reason { color: var(--gold); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recommendation-context { color: var(--gold); margin-top: 8px; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 770; background: #131317e8; }
.cover .badge { position: absolute; left: 5px; top: 6px; }
.ready { color: #baf2c8; }
.intro, .screen { padding: 27px var(--gutter) 0; max-width: 1040px; margin-inline: auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 17px; }
.login { width: min(calc(100% - 2 * var(--gutter)), 440px); margin: 7vh auto 0; padding: 26px; }
.login .sub { margin: 12px 0 22px; line-height: 1.5; }
.stack { display: grid; gap: 12px; }
.stack label { display: grid; gap: 5px; font-size: 13px; font-weight: 650; }
input { min-width: 0; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); padding: 10px 12px; background: #121217; color: var(--text); font-size: 16px; }
.note { color: var(--muted); font-size: 13px; line-height: 1.45; }
.login .note { margin-top: 13px; }
.filters { display: flex; gap: 7px; margin-top: 12px; }
.filters button { min-height: 40px; }
.filters .selected { background: #ffcf8620; color: var(--gold); border-color: #f6bf5966; }
.request-tabs { flex-wrap: wrap; }
.shelf-filters { padding: 0 var(--gutter) 13px; }
.plex-account-select { min-height: 44px; width: 100%; padding: 8px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font: inherit; }
#nav { position: fixed; z-index: 3; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; height: var(--bottom); padding: 3px 9px env(safe-area-inset-bottom); background: #16161dec; border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
#nav button { display: grid; align-content: center; justify-items: center; gap: 4px; flex: 1; max-width: 165px; border: 0; color: var(--muted); background: transparent; font-size: 11px; font-weight: 660; }
#nav button[aria-current="page"] { color: var(--gold); }
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
dialog { width: min(100%, 560px); max-width: 100%; max-height: 90dvh; margin: auto auto 0; padding: 0; border: 1px solid var(--line); border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text); }
dialog::backdrop { background: #070609c7; }
.detail-visual { position: relative; height: 205px; overflow: hidden; background: linear-gradient(140deg, #403044, #18181e); }
.detail-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent, var(--surface)); }
.detail-content { position: relative; margin-top: -37px; padding: 0 20px calc(24px + env(safe-area-inset-bottom)); }
.detail-content h2 { font-size: 31px; }
.summary { color: var(--muted); margin: 12px 0; line-height: 1.5; }
.close { position: absolute; z-index: 2; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #101014db; color: var(--text); font-size: 23px; }
.listing { display: grid; gap: 8px; margin-top: 15px; }
.listing .panel { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.listing a { display: block; }
.listing p { margin-top: 4px; }
.listing .request-card, .request-heading {
  display: grid; grid-template-columns: clamp(72px, 21vw, 106px) minmax(0, 1fr);
  align-items: start; gap: clamp(12px, 3vw, 20px);
}
.request-poster {
  aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(145deg, #3a303e, #15151d);
}
.request-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.request-info { min-width: 0; overflow-wrap: anywhere; }
.request-status.pending { background: #392b18; color: #ffd78d; }
.request-status.done { background: #19372a; color: #bcf2ce; }
.request-status.declined { background: #43242b; color: #ffd0d9; }
.request-title { display: block; margin-top: 5px; font-size: 17px; line-height: 1.15; }
.listing .request-preview {
  margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.request-detail { margin-top: 14px; }
.request-detail .request-heading { grid-template-columns: clamp(82px, 25vw, 142px) minmax(0, 1fr); }
.request-heading h1 { margin: 7px 0 8px; font-size: clamp(24px, 6vw, 48px); }
.request-heading .note + .note { margin-top: 4px; }
.request-synopsis-title { margin-top: 19px; }
.request-detail .request-synopsis { margin-top: 6px; }
.listing .user-row { flex-wrap: wrap; }
.user-row > span { overflow-wrap: anywhere; }
.user-row .actions { margin-top: 0; }
.confirmation { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); }
.confirmation .note:not(:empty) { margin-top: 10px; }
.admin-row { margin-top: 16px; }
#toast { position: fixed; bottom: calc(var(--bottom) + 12px); left: 50%; transform: translateX(-50%); z-index: 10; width: max-content; max-width: calc(100% - 32px); }
#toast:not(:empty) { background: #34323d; color: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; box-shadow: 0 4px 20px #0008; }
@media (min-width: 650px) {
  dialog { margin: auto; border-radius: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
