:root {
  color-scheme: dark;
  --bg: #070a12;
  --surface: #101625;
  --surface-2: #171f31;
  --surface-3: #202a40;
  --ink: #fbf8f1;
  --muted: #a8b0c1;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #ff6747;
  --accent-2: #ff947c;
  --cream: #fff1d9;
  --green: #58d4a3;
  --danger: #ff7c84;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -8%, rgba(255, 103, 71, 0.2), transparent 29rem),
    radial-gradient(circle at 92% 14%, rgba(88, 119, 212, .13), transparent 24rem),
    linear-gradient(180deg, #0c1120 0%, var(--bg) 40%);
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { color: inherit; }
a { color: var(--accent-2); }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .45rem; font-size: clamp(1.8rem, 7vw, 2.8rem); line-height: 1.02; letter-spacing: -.045em; }
h2 { margin-bottom: .4rem; font-size: 1.25rem; letter-spacing: -.025em; }
h3 { margin-bottom: .5rem; }
.muted, small { color: var(--muted); }
[hidden] { display: none !important; }

.brand { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  box-shadow: 0 6px 20px rgba(255, 103, 71, .15);
}
.brand div { display: flex; min-width: 0; flex-direction: column; }
.brand strong { font-size: 1rem; letter-spacing: -.02em; }
.brand span { overflow: hidden; color: var(--muted); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.brand--large { gap: 1rem; }
.brand--large img { width: 64px; height: 64px; border-radius: 19px; }
.brand--large strong { font-size: 1.35rem; }
.brand--large span { font-size: .86rem; }

.eyebrow {
  margin-bottom: .45rem;
  color: var(--accent-2);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.login-shell, .setup-body {
  min-height: 100vh;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}
.login-shell { display: grid; place-items: center; }
.login-card, .setup-card {
  width: min(100%, 480px);
  padding: clamp(24px, 6vw, 40px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(17, 24, 42, .94);
  box-shadow: var(--shadow);
}
.login-card { display: grid; gap: 2.2rem; }
.login-card form, .stack-form { display: grid; gap: 1rem; }
label { display: grid; gap: .45rem; color: var(--ink); font-size: .86rem; font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  color: var(--ink);
  background: var(--surface-2);
  transition: border-color .2s, box-shadow .2s;
}
input, select { min-height: 50px; padding: 0 14px; }
textarea { resize: vertical; padding: 13px 14px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 103, 71, .15); }
.password-field { position: relative; }
.password-field input { padding-right: 70px; }
.password-field .text-button { position: absolute; top: 0; right: 5px; height: 100%; }
.text-button {
  border: 0;
  color: var(--accent-2);
  background: none;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}
.form-message { margin: 0; padding: .8rem 1rem; border-radius: 13px; font-size: .88rem; }
.form-message p { margin: 0; }
.form-message p + p { margin-top: .35rem; }
.form-message--error { color: #ffdadd; background: rgba(255, 124, 132, .13); }

.button, .icon-button, .chip, .nav-item, .settings-row {
  border: 0;
  cursor: pointer;
}
.button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 800;
}
.button--primary { color: #1a0e09; background: linear-gradient(135deg, var(--accent-2), var(--accent)); box-shadow: 0 8px 24px rgba(255, 103, 71, .22); }
.button--quiet { color: var(--muted); background: var(--surface-2); }
.button--danger { color: #ffd8dc; background: rgba(255, 124, 132, .16); }
.button--wide { width: 100%; }
.button:disabled { cursor: wait; opacity: .55; }
.button, .icon-button, .chip, .nav-item, .quick-add, .poster-button, .show-more-button {
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.button:active, .icon-button:active, .chip:active, .nav-item:active, .quick-add:active, .poster-button:active, .show-more-button:active {
  transform: scale(.96);
}
.icon-button {
  display: inline-grid;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  place-items: center;
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface-2);
  font-size: 1.25rem;
}
.install-button { width: auto; color: var(--cream); font-size: .78rem; font-weight: 800; }

.app-shell { min-height: 100vh; }
.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(68px + env(safe-area-inset-top));
  padding: max(12px, env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7, 10, 18, .96), rgba(7, 10, 18, .78));
  backdrop-filter: blur(22px) saturate(140%);
}
.header-actions { display: flex; gap: .5rem; }
.app-main { width: min(100%, 1100px); margin: 0 auto; padding: 0 16px calc(94px + var(--safe-bottom)); }
.page { display: none; padding: 28px 0 22px; animation: fade-in .18s ease-out; }
.page.is-active { display: block; }
@keyframes fade-in { from { opacity: .35; transform: translateY(5px); } }
.page-description { margin: .35rem 0 0; color: var(--muted); font-size: .9rem; }
.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  padding: clamp(24px, 7vw, 44px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(120deg, rgba(255, 103, 71, .17), transparent 55%),
    var(--surface);
}
.hero::after {
  position: absolute;
  right: -50px;
  bottom: -65px;
  width: 190px;
  height: 190px;
  border: 38px solid rgba(255, 148, 124, .08);
  border-radius: 50%;
  content: "";
}
.hero p:last-child { max-width: 38rem; margin: 0; color: var(--muted); }
.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 470px;
  margin: -10px 0 34px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 30px;
  background: #101625;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
}
.home-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 9, 17, .98) 3%, rgba(6, 9, 17, .79) 52%, rgba(6, 9, 17, .28) 100%),
    linear-gradient(0deg, rgba(6, 9, 17, .88), transparent 55%);
  content: "";
}
.home-hero::after {
  position: absolute;
  z-index: -1;
  top: 34px;
  right: 30px;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(255, 255, 255, .025), 0 0 0 60px rgba(255, 255, 255, .018);
  content: "";
}
.home-hero__backdrop {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-position: 66% center;
  background-size: cover;
  opacity: .72;
  transform: scale(1.035);
  transition: background-image .35s ease, opacity .35s ease, transform 6s ease;
}
.page.is-active .home-hero__backdrop { transform: scale(1); }
.home-hero__content {
  display: flex;
  min-height: 470px;
  max-width: 700px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 7vw, 58px);
}
.home-hero h1 { max-width: 610px; margin-bottom: 16px; font-size: clamp(2.65rem, 10vw, 5rem); line-height: .9; letter-spacing: -.065em; }
.home-hero h1 em { color: var(--accent-2); font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.home-hero__intro { max-width: 540px; margin-bottom: 22px; color: #d3d8e3; font-size: clamp(.92rem, 2.8vw, 1.08rem); line-height: 1.55; }
.home-quick-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  width: min(100%, 570px);
  align-items: center;
  gap: 8px;
  padding: 7px 7px 7px 16px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 18px;
  background: rgba(248, 246, 240, .96);
  box-shadow: 0 16px 45px rgba(0, 0, 0, .28);
}
.home-quick-search > span { color: #687084; font-size: 1.35rem; }
.home-quick-search input {
  min-width: 0;
  min-height: 48px;
  padding: 0 5px;
  border: 0;
  color: #111827;
  background: transparent;
  box-shadow: none;
  font-size: 1rem;
}
.home-quick-search input::placeholder { color: #747b89; }
.home-quick-search input:focus { box-shadow: none; }
.home-quick-search button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  color: #190c08;
  background: var(--accent);
  font-weight: 900;
  cursor: pointer;
}
.hero-featured {
  display: grid;
  width: fit-content;
  max-width: 100%;
  margin-top: 20px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.hero-featured__label { color: var(--accent-2); font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.hero-featured strong { overflow: hidden; max-width: 440px; margin: 3px 0; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.hero-featured > span:last-child { color: var(--muted); font-size: .7rem; }
.discovery-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.discovery-heading h2 { margin-bottom: 3px; font-size: clamp(1.65rem, 6vw, 2.3rem); }
.discovery-heading p:last-child { margin: 0; color: var(--muted); font-size: .82rem; }
.refresh-button {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  font-size: 1.25rem;
  cursor: pointer;
}
.refresh-button:hover { color: var(--ink); transform: rotate(35deg); }
.discovery-toolbar { justify-content: flex-start; margin-top: 14px; }
.filter-group { display: grid; min-width: 0; gap: 7px; }
.filter-group > small { color: var(--muted); font-size: .67rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-heading h1 { margin-bottom: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 20px; }
.toolbar--wrap { flex-wrap: wrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: .82rem;
  font-weight: 800;
}
.chip.is-active { border-color: rgba(255, 103, 71, .5); color: var(--cream); background: rgba(255, 103, 71, .16); }
.select { width: auto; min-height: 43px; font-size: .8rem; font-weight: 700; }
.content-area { min-height: 220px; margin-top: 18px; }

.section-block { margin-bottom: 42px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-title h2 { margin: 0; }
.section-title div { display: grid; gap: 3px; }
.section-title small { color: var(--accent-2); font-size: .67rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.section-title span { color: var(--muted); font-size: .75rem; }
.poster-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.media-card {
  position: relative;
  min-width: 0;
  opacity: 0;
  transform: translateY(16px);
  animation: card-arrive .48s cubic-bezier(.2, .7, .2, 1) forwards;
  animation-delay: calc(var(--card-index, 0) * 38ms);
}
@keyframes card-arrive { to { opacity: 1; transform: translateY(0); } }
.poster-button {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 2 / 3;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: linear-gradient(145deg, var(--surface-2), #0d1320);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  cursor: pointer;
}
.poster-button img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.025); transition: opacity .35s ease, transform .45s ease; }
.poster-button img.is-loaded { opacity: 1; }
.poster-button:hover { border-color: rgba(255, 255, 255, .24); transform: translateY(-3px); box-shadow: 0 17px 38px rgba(0, 0, 0, .28); }
.poster-button:hover img { transform: scale(1.065); }
.poster-shine { position: absolute; inset: 0; background: linear-gradient(120deg, transparent 38%, rgba(255, 255, 255, .16) 50%, transparent 62%); opacity: 0; transform: translateX(-80%); pointer-events: none; }
.poster-button:hover .poster-shine { opacity: 1; transform: translateX(80%); transition: transform .65s ease, opacity .2s ease; }
.poster-fallback { display: grid; width: 100%; height: 100%; padding: 20px; place-items: center; color: var(--muted); text-align: center; }
.release-flag, .date-badge {
  position: absolute;
  top: 9px;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(6, 9, 17, .82);
  backdrop-filter: blur(8px);
  font-size: .64rem;
  font-weight: 900;
}
.release-flag { left: 9px; color: #08131b; text-transform: uppercase; }
.release-flag--cinema { background: linear-gradient(135deg, #ffd36f, #ff9a5f); }
.release-flag--premiere { color: #fff1e9; background: rgba(255, 103, 71, .88); }
.release-flag--tv { color: #eef4ff; background: rgba(89, 126, 227, .9); }
.date-badge { right: 9px; color: var(--cream); }
.card-info { padding: 9px 2px 0; }
.card-info h3 { overflow: hidden; margin: 0 0 3px; font-size: .92rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); font-size: .72rem; }
.quick-add {
  position: absolute;
  right: 8px;
  bottom: 48px;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 50%;
  color: #180d09;
  background: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
}
.quick-add.is-added { color: #071510; background: var(--green); }
.quick-add.is-popping { animation: add-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes add-pop {
  40% { transform: scale(1.28) rotate(-8deg); box-shadow: 0 0 0 10px rgba(88, 212, 163, .16); }
  100% { transform: scale(1); }
}
.card-controls { display: grid; grid-template-columns: 1fr 42px; gap: 7px; margin-top: 8px; }
.card-controls button {
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--cream);
  background: var(--surface-2);
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}
.card-controls button:last-child { color: var(--danger); font-size: 1.1rem; }

.skeleton-card {
  aspect-ratio: 2 / 3.55;
  border-radius: 18px;
  background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 40%, var(--surface) 60%);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { to { background-position-x: -220%; } }
.loading-intro { display: flex; align-items: center; justify-content: center; gap: 11px; margin: 26px 0 22px; color: var(--muted); font-size: .8rem; font-weight: 750; }
.loading-orbit { position: relative; width: 26px; height: 26px; border: 2px solid rgba(255, 255, 255, .1); border-top-color: var(--accent); border-radius: 50%; animation: orbit .75s linear infinite; }
.loading-orbit::after { position: absolute; top: 3px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); content: ""; box-shadow: 0 0 10px var(--accent); }
@keyframes orbit { to { transform: rotate(360deg); } }
.show-more-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .015));
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
}
.show-more-button:hover { border-color: rgba(255, 103, 71, .32); color: var(--ink); background: rgba(255, 103, 71, .08); }
.show-more-button span { color: var(--accent); }

.empty-state {
  display: grid;
  min-height: 270px;
  padding: 38px 22px;
  place-items: center;
  align-content: center;
  border: 1px dashed rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}
.empty-state h2 { margin-bottom: .35rem; color: var(--ink); }
.empty-state p { max-width: 24rem; margin-bottom: 0; }
.empty-symbol { display: grid; width: 54px; height: 54px; margin-bottom: 14px; place-items: center; border-radius: 17px; color: var(--accent-2); background: rgba(255, 103, 71, .12); font-size: 1.7rem; }
.error-state .button { margin-top: 1rem; }

.month-controls { display: flex; align-items: center; gap: 8px; }
.month-controls strong { min-width: 105px; text-align: center; }
.toggle { display: flex; grid-template-columns: none; align-items: center; gap: 9px; color: var(--muted); cursor: pointer; font-size: .78rem; }
.toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle span { position: relative; width: 44px; height: 25px; border-radius: 999px; background: var(--surface-3); transition: .2s; }
.toggle span::after { position: absolute; top: 4px; left: 4px; width: 17px; height: 17px; border-radius: 50%; background: var(--muted); content: ""; transition: .2s; }
.toggle input:checked + span { background: rgba(255, 103, 71, .35); }
.toggle input:checked + span::after { transform: translateX(19px); background: var(--accent); }
.agenda { display: grid; gap: 22px; }
.agenda-day { display: grid; grid-template-columns: 54px 1fr; gap: 12px; }
.agenda-date { padding-top: 4px; text-align: center; }
.agenda-date strong { display: block; font-size: 1.55rem; line-height: 1; }
.agenda-date span { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.agenda-items { display: grid; gap: 9px; }
.agenda-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.agenda-item img, .agenda-thumb { width: 48px; height: 52px; border-radius: 9px; object-fit: cover; background: var(--surface-3); }
.agenda-copy { min-width: 0; }
.agenda-copy strong { display: block; overflow: hidden; font-size: .87rem; text-overflow: ellipsis; white-space: nowrap; }
.agenda-copy span { color: var(--muted); font-size: .7rem; }
.agenda-item button { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.agenda-item .agenda-open { width: 48px; height: 52px; padding: 0; overflow: hidden; }
.agenda-item .agenda-copy { display: block; width: auto; height: auto; min-width: 0; padding: 0; color: var(--ink); background: transparent; text-align: left; }
.agenda-item button.is-added { color: #071510; background: var(--green); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-weekday { padding: 6px 0; color: var(--muted); font-size: .65rem; font-weight: 900; text-align: center; text-transform: uppercase; }
.calendar-day {
  min-height: 73px;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  font-size: .72rem;
}
.calendar-day.is-outside { opacity: .25; }
.calendar-day.is-today { border-color: var(--accent); }
.calendar-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.calendar-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.calendar-dot.tv { background: #7ba6ff; }
.calendar-months { display: grid; gap: 28px; }
.calendar-month h2 { margin: 0 0 10px; font-size: 1rem; }

.search-box { display: flex; gap: 9px; }
.search-box input { flex: 1; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: calc(70px + var(--safe-bottom));
  padding: 7px 8px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgba(10, 15, 28, .95);
  backdrop-filter: blur(18px);
}
.nav-item {
  display: grid;
  min-width: 0;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-size: .66rem;
  font-weight: 800;
}
.nav-item span { font-size: 1.28rem; line-height: 1; }
.nav-item.is-active { color: var(--cream); background: rgba(255, 103, 71, .1); }
.nav-item.is-active span { color: var(--accent); }

.sheet {
  width: min(100%, 720px);
  max-height: min(92vh, 900px);
  margin: auto auto 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sheet--small { padding: 22px; }
.sheet::backdrop { background: rgba(2, 4, 10, .76); backdrop-filter: blur(4px); }
.sheet[open] { animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(20px); opacity: .4; } }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.sheet-header h2 { margin: 0; }
.details-hero { position: relative; min-height: 260px; background: var(--surface-2); }
.details-hero > img { width: 100%; height: 330px; object-fit: cover; opacity: .58; }
.details-hero::after { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 15%, var(--surface) 100%); content: ""; }
.details-close { position: absolute; z-index: 2; top: 14px; right: 14px; background: rgba(7, 10, 19, .78); }
.details-title { position: absolute; z-index: 2; right: 20px; bottom: 17px; left: 20px; }
.details-title h2 { margin: 0 0 4px; font-size: clamp(1.65rem, 7vw, 2.5rem); line-height: 1.03; }
.details-title p { margin: 0; color: var(--cream); font-size: .82rem; }
.details-body { padding: 18px 20px calc(28px + var(--safe-bottom)); }
.details-loading { min-height: 70vh; padding: 28px 20px; }
.details-actions { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-bottom: 22px; }
.details-facts { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.fact { padding: 7px 10px; border-radius: 9px; color: var(--muted); background: var(--surface-2); font-size: .74rem; font-weight: 700; }
.synopsis { color: #d6dbe5; line-height: 1.6; }
.next-episode { padding: 14px; border-left: 3px solid #7ba6ff; border-radius: 8px 14px 14px 8px; background: rgba(123, 166, 255, .1); }
.cast-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 7px; }
.cast-person { flex: 0 0 82px; }
.cast-person img, .cast-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.cast-person strong { display: block; overflow: hidden; margin-top: 6px; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.cast-person span { display: block; overflow: hidden; color: var(--muted); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }

.settings-list { overflow: hidden; margin-bottom: 25px; border: 1px solid var(--line); border-radius: 18px; }
.settings-row {
  display: flex;
  width: 100%;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
}
.settings-row:last-child { border-bottom: 0; }
.settings-row span { display: grid; gap: 2px; }
.settings-row small { font-size: .72rem; font-weight: 500; }
.settings-row b { color: var(--muted); font-size: 1.3rem; }
.settings-row--danger strong { color: var(--danger); }
.about { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.about h3 { color: var(--ink); }
.tmdb-logo { width: 54px; height: auto; margin: 12px 0; }
.version { margin-top: 1.4rem; opacity: .65; }
.toast {
  position: fixed;
  z-index: 100;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #202a3d;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -15px);
  transition: .2s;
  font-size: .8rem;
  font-weight: 800;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.setup-body { display: grid; place-items: start center; }
.setup-card { margin: 20px 0; }
.setup-card > .brand { margin-bottom: 2rem; }
.setup-form { display: grid; gap: 20px; }
.setup-form fieldset { display: grid; gap: 14px; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 18px; }
.setup-form legend { padding: 0 8px; color: var(--accent-2); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.setup-result { padding: 20px 0 5px; text-align: center; }
.success-mark { display: grid; width: 68px; height: 68px; margin: 0 auto 20px; place-items: center; border-radius: 50%; color: #092217; background: var(--green); font-size: 2rem; font-weight: 900; }

@media (min-width: 640px) {
  .app-header { padding-right: 28px; padding-left: 28px; }
  .app-main { padding-right: 28px; padding-left: 28px; }
  .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 16px; }
  .sheet { margin-bottom: auto; border-radius: 28px; }
  .sheet--small { max-width: 480px; }
}

@media (min-width: 960px) {
  .poster-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .calendar-months { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .calendar-day { min-height: 64px; }
  .bottom-nav { right: auto; top: 92px; bottom: auto; left: 18px; width: 88px; min-height: auto; padding: 8px; grid-template-columns: 1fr; gap: 5px; border: 1px solid var(--line); border-radius: 20px; }
  .nav-item { min-height: 64px; }
  .app-main { padding-bottom: 40px; padding-left: 116px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
