@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #111018;
  --bg-soft: #181720;
  --panel: #201f29;
  --panel-2: #292832;
  --ink: #f8f4ea;
  --muted: #9995a5;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #ff6b5f;
  --accent-2: #f9c66a;
  --mint: #7bd9bb;
  --lavender: #b6a7ff;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.32);
  --radius: 22px;
  --sidebar: 240px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3efe6;
  --bg-soft: #eae4d9;
  --panel: #fffaf1;
  --panel-2: #eee7dc;
  --ink: #1b1920;
  --muted: #6f6874;
  --line: rgba(20, 18, 24, 0.1);
  --shadow: 0 20px 55px rgba(73, 56, 39, 0.13);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% -8%, rgba(255, 107, 95, 0.12), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.auth-gate {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(420px, 1.1fr);
  background:
    radial-gradient(circle at 20% 15%, rgba(182,167,255,.18), transparent 27%),
    radial-gradient(circle at 82% 76%, rgba(123,217,187,.11), transparent 28%),
    var(--bg);
}
.auth-visual { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 16px; border-right: 1px solid var(--line); font-family: "Manrope"; font-size: clamp(24px, 4vw, 54px); font-weight: 800; letter-spacing: .15em; }
.auth-visual::before, .auth-visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.auth-visual::before { width: 470px; height: 470px; top: -190px; left: -180px; }
.auth-visual::after { width: 320px; height: 320px; right: -170px; bottom: -120px; }
.auth-visual .brand-mark { width: 52px; height: 52px; padding: 10px; border-radius: 16px; }
.auth-card { width: min(440px, calc(100% - 48px)); align-self: center; justify-self: center; padding: 38px; border: 1px solid var(--line); border-radius: 28px; background: color-mix(in srgb, var(--panel) 87%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.auth-card h1 { margin: 0; font-family: "Manrope"; font-size: clamp(38px, 5vw, 60px); line-height: .98; letter-spacing: -.06em; }
.auth-card > p { margin: 17px 0 25px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.google-access-button { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: #202124; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 700; box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.google-access-button:hover { background: #f7f8f8; }
.google-access-button:disabled { opacity: .55; cursor: wait; }
.google-access-button span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #4285f4; font-family: Arial, sans-serif; font-size: 17px; font-weight: 800; }
.auth-status { margin: 9px 0 0 !important; text-align: center; font-size: 10px !important; }
.auth-status.is-error { color: #ff8d83; }
.auth-denied-actions { margin-top: 13px; text-align: center; }
.local-preview[hidden] { display: none; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--muted); font-size: 10px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.local-access-button { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.local-access-button:hover { background: var(--panel-2); color: var(--ink); }
.auth-privacy { display: block; margin-top: 13px; color: var(--muted); font-size: 9px; text-align: center; }

button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(123, 217, 187, 0.75);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 30px 22px 22px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  border: 0;
  padding: 0 5px;
  background: none;
  font-family: "Manrope", sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.16em;
  cursor: pointer;
}

.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 6px;
  border-radius: 10px;
  background: var(--accent);
  transform: rotate(-4deg);
}
.brand-mark i { border-radius: 6px; background: #fff8eb; }
.brand-mark i:nth-child(2) { transform: translateY(4px); }

.side-nav { display: grid; gap: 7px; margin-top: 48px; }
.nav-item {
  min-height: 47px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 0;
  border-radius: 13px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  transition: 180ms ease;
}
.nav-item:hover { color: var(--ink); background: var(--panel); }
.nav-item.is-active { color: var(--ink); background: var(--panel); }
.nav-item.is-active .nav-icon { color: var(--accent); }
.nav-icon { width: 22px; font-size: 22px; text-align: center; }
.nav-count {
  margin-left: auto;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.sidebar-lists { margin-top: 28px; }
.sidebar-lists-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 8px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-lists-heading button { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--panel); color: var(--muted); cursor: pointer; font-size: 16px; }
#sidebar-list-items { display: grid; gap: 3px; }
.sidebar-list-link { min-height: 38px; display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 9px; border: 0; border-radius: 10px; padding: 0 10px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: 11px; }
.sidebar-list-link:hover, .sidebar-list-link.is-active { background: var(--panel); color: var(--ink); }
.list-color { width: 8px; height: 8px; border-radius: 50%; background: var(--list-color, var(--accent)); }
.sidebar-list-link small { color: var(--muted); font-size: 9px; }

.sidebar-card {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(182, 167, 255, 0.11), rgba(123, 217, 187, 0.05));
}
.sidebar-card .eyebrow { margin: 0 0 5px; color: var(--lavender); }
.sidebar-card strong { font-family: "Manrope", sans-serif; font-size: 17px; }
.sidebar-card > span:not(.eyebrow) { color: var(--muted); font-size: 11px; }
.mini-bars { height: 28px; display: flex; align-items: end; gap: 4px; margin-top: 9px; }
.mini-bars i { flex: 1; min-height: 5px; border-radius: 4px; background: var(--lavender); opacity: 0.28; }
.mini-bars i:nth-child(2), .mini-bars i:nth-child(5) { height: 68%; opacity: 0.5; }
.mini-bars i:nth-child(3), .mini-bars i:nth-child(7) { height: 92%; opacity: 0.88; }
.mini-bars i:nth-child(6) { height: 42%; }

.sidebar-footer { display: flex; align-items: center; gap: 8px; margin-top: 21px; padding: 0 3px; }
.sidebar-profile { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.sidebar-profile > span:nth-child(2) { min-width: 0; display: grid; font-size: 12px; }
.sidebar-profile strong, .sidebar-profile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer small { color: var(--muted); }
.avatar {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #9f4262);
  color: white;
  font-size: 11px;
  font-weight: 700;
}
.icon-button { border: 0; background: transparent; margin-left: auto; color: var(--muted); cursor: pointer; font-size: 19px; }

main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
  height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(28px, 5vw, 70px);
  border-bottom: 1px solid var(--line);
}
.date-line { margin: 0; color: var(--muted); font-size: 12px; text-transform: capitalize; }
.mobile-brand { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-profile { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); cursor: pointer; }
.topbar-profile span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg, var(--accent), #9f4262); color: white; font-size: 9px; font-weight: 800; }
.search-trigger {
  width: min(390px, 42vw);
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 13px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}
.search-trigger > span:first-child { color: var(--ink); font-size: 20px; }
.search-trigger kbd {
  margin-left: auto;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 10px;
}

#view-root { max-width: 1500px; margin: auto; padding: 35px clamp(28px, 5vw, 70px) 80px; }
.view { animation: view-in 280ms ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 255px;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 5vw, 52px);
  border-radius: 28px;
  background:
    radial-gradient(circle at 77% 35%, rgba(255,255,255,0.15) 0 1.5px, transparent 2px),
    radial-gradient(circle at 66% 64%, rgba(255,255,255,0.12) 0 1px, transparent 1.5px),
    linear-gradient(115deg, #492e58 0%, #2d294f 44%, #163c43 100%);
  box-shadow: var(--shadow);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 50%;
}
.hero::before { width: 430px; height: 430px; top: -205px; right: -55px; }
.hero::after { width: 245px; height: 245px; top: -96px; right: 37px; }
.hero-art {
  position: absolute;
  right: clamp(28px, 8vw, 120px);
  top: 25px;
  width: 172px;
  height: 215px;
  transform: rotate(7deg);
}
.hero-art i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 80px 80px 18px 18px;
  background: linear-gradient(145deg, rgba(255,107,95,0.58), rgba(249,198,106,0.1));
  box-shadow: -22px 15px 0 rgba(123,217,187,0.14);
}
.hero-art i::before {
  content: "▶";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 40px;
  opacity: 0.78;
  transform: rotate(-7deg);
}
.hero-copy { position: relative; z-index: 2; max-width: 580px; }
.eyebrow { display: inline-block; margin-bottom: 12px; color: var(--mint); font-size: 11px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.hero h1 { max-width: 540px; margin: 0; font-family: "Manrope", sans-serif; font-size: clamp(32px, 4.5vw, 58px); line-height: 0.98; letter-spacing: -0.045em; }
.hero h1 { color: #fff8eb; }
.hero p { max-width: 475px; margin: 14px 0 0; color: rgba(255,255,255,0.71); font-size: 14px; line-height: 1.55; }
.hero-actions { display: flex; gap: 10px; margin-top: 21px; }
.hero .secondary-button { color: #fff8eb; }

.primary-button, .secondary-button, .chip, .tiny-button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: 180ms ease;
}
.primary-button { padding: 12px 17px; background: var(--accent); color: white; box-shadow: 0 8px 24px rgba(255, 107, 95, 0.2); }
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.05); }
.secondary-button { padding: 11px 16px; border: 1px solid var(--line); background: rgba(255,255,255,0.08); color: inherit; }
.secondary-button:hover { background: rgba(255,255,255,0.14); }
.secondary-button.is-following { border-color: rgba(123,217,187,.55); color: var(--mint); }
.tiny-button { padding: 7px 10px; background: var(--panel-2); color: var(--muted); font-size: 11px; }
.tiny-button:hover { color: var(--ink); }

.section { margin-top: 39px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-family: "Manrope", sans-serif; font-size: clamp(20px, 2.3vw, 29px); letter-spacing: -0.035em; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.text-button { border: 0; padding: 6px; background: none; color: var(--accent); font-weight: 700; cursor: pointer; }

.continue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.continue-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 17px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--panel);
}
.continue-card .poster { width: 92px; aspect-ratio: 2 / 3; }
.continue-copy { min-width: 0; align-self: center; }
.continue-copy h3 { margin: 5px 0 2px; overflow: hidden; font-family: "Manrope"; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.continue-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.continue-copy .primary-button { margin-top: 13px; padding: 9px 12px; font-size: 11px; }

.progress-track { height: 5px; overflow: hidden; margin-top: 12px; border-radius: 99px; background: var(--panel-2); }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--mint); }
.progress-meta { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 10px; }

.card-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(135px, 1fr));
  gap: 15px;
}
.show-card { min-width: 0; cursor: pointer; }
.show-card .poster { transition: 220ms ease; }
.show-card:hover .poster { transform: translateY(-5px); box-shadow: 0 17px 35px rgba(0,0,0,.32); }
.show-card h3 { margin: 10px 0 2px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.show-card p { margin: 0; color: var(--muted); font-size: 10px; }
.show-card:focus-visible { border-radius: 16px; }

.poster {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 15px;
  background: var(--poster, linear-gradient(145deg, #4c365a, #1e4650));
  background-position: center;
  background-size: cover;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}
.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7,7,11,.56), transparent 50%);
  pointer-events: none;
}
.poster-initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.74);
  font-family: "Manrope";
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -.08em;
}
.poster-badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  padding: 0 7px;
  border-radius: 9px;
  background: rgba(12,12,17,.72);
  color: white;
  font-size: 9px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.poster-badge.following { color: var(--mint); }

.home-bottom { display: grid; grid-template-columns: 1.25fr .75fr; gap: 17px; }
.upcoming-card, .stats-card, .empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.upcoming-card { padding: 20px; }
.upcoming-item { display: grid; grid-template-columns: 45px 1fr auto; align-items: center; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.upcoming-item:last-child { border-bottom: 0; }
.date-tile { width: 43px; padding: 6px 0; display: grid; place-items: center; border-radius: 11px; background: var(--panel-2); color: var(--muted); font-size: 9px; text-transform: uppercase; }
.date-tile strong { color: var(--ink); font-family: "Manrope"; font-size: 17px; line-height: 1; }
.upcoming-item h3 { margin: 0; font-size: 12px; }
.upcoming-item p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.upcoming-item > small { color: var(--mint); font-size: 10px; }

.stats-card { position: relative; overflow: hidden; padding: 24px; background: linear-gradient(145deg, rgba(255,107,95,.14), rgba(182,167,255,.06)), var(--panel); }
.stats-card::after { content: ""; position: absolute; width: 160px; height: 160px; right: -72px; bottom: -81px; border: 26px solid rgba(249,198,106,.1); border-radius: 50%; }
.stats-card h3 { margin: 0 0 19px; font-family: "Manrope"; font-size: 18px; }
.stat-number { display: block; font-family: "Manrope"; font-size: 46px; line-height: 1; letter-spacing: -.06em; }
.stat-label { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 25px; }
.stat-pair div { padding-top: 13px; border-top: 1px solid var(--line); }
.stat-pair strong { font-size: 17px; }
.stat-pair small { display: block; color: var(--muted); font-size: 10px; }

.page-header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 28px; }
.page-header h1 { margin: 0; font-family: "Manrope"; font-size: clamp(32px, 5vw, 54px); letter-spacing: -.055em; }
.page-header p { margin: 7px 0 0; color: var(--muted); }
.filter-tabs { display: flex; gap: 7px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.chip { padding: 8px 12px; background: transparent; color: var(--muted); font-size: 11px; }
.chip.is-active { background: var(--panel-2); color: var(--ink); }
.library-tools { display: flex; align-items: center; gap: 9px; }
.list-tabs { display: flex; gap: 8px; overflow-x: auto; margin: -11px 0 24px; padding: 2px 1px 8px; scrollbar-width: none; }
.list-tab { min-height: 38px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--panel); color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.list-tab.is-active { border-color: color-mix(in srgb, var(--list-color, var(--accent)) 45%, var(--line)); background: color-mix(in srgb, var(--list-color, var(--accent)) 12%, var(--panel)); color: var(--ink); }
.list-tab-count { color: var(--muted); font-size: 9px; }

.library-grid { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 22px 16px; }
.library-card { position: relative; }
.library-card .card-menu { position: absolute; z-index: 3; top: 8px; left: 8px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 11px; background: rgba(12,12,17,.74); color: white; cursor: pointer; font-size: 19px; backdrop-filter: blur(8px); }
.library-card .card-menu:hover { background: var(--accent); }

.empty-state { padding: 60px 24px; text-align: center; }
.empty-symbol { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 17px; border-radius: 22px; background: var(--panel-2); color: var(--accent); font-size: 30px; transform: rotate(-4deg); }
.empty-state h2 { margin: 0; font-family: "Manrope"; }
.empty-state p { max-width: 430px; margin: 8px auto 20px; color: var(--muted); line-height: 1.55; }

.calendar-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 29px; }
.summary-tile { padding: 17px 19px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }
.summary-tile strong { display: block; font-family: "Manrope"; font-size: 26px; }
.summary-tile span { color: var(--muted); font-size: 11px; }
.calendar-group { margin-top: 25px; }
.calendar-day { display: flex; align-items: baseline; gap: 9px; margin-bottom: 11px; }
.calendar-day h2 { margin: 0; font-family: "Manrope"; font-size: 20px; }
.calendar-day span { color: var(--muted); font-size: 11px; }
.calendar-episode { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 14px; margin-bottom: 8px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.calendar-poster { width: 56px; height: 56px; border-radius: 12px; background-position: center; background-size: cover; }
.calendar-episode h3 { margin: 0; font-size: 13px; }
.calendar-episode p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.calendar-episode time { color: var(--mint); font-size: 11px; font-weight: 700; }

dialog { padding: 0; border: 0; background: transparent; color: var(--ink); }
dialog::backdrop { background: rgba(6,5,10,.72); backdrop-filter: blur(7px); }
.search-dialog { width: min(720px, calc(100% - 28px)); max-height: min(730px, calc(100vh - 40px)); margin-top: 8vh; border-radius: 22px; box-shadow: var(--shadow); }
.search-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--bg-soft); }
.search-input-wrap { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.search-input-wrap > span { color: var(--accent); font-size: 23px; }
.search-input-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-input-wrap input::placeholder { color: var(--muted); }
.dialog-close { width: 33px; height: 33px; border: 0; border-radius: 10px; background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 21px; }
.voice-button {
  min-width: 44px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 11px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.voice-button:hover { color: var(--ink); }
.voice-icon { width: 11px; height: 15px; display: inline-block; overflow: hidden; border: 2px solid currentColor; border-radius: 8px; color: var(--accent); font-size: 0; }
.voice-button.is-listening { border-color: rgba(255,107,95,.5); background: rgba(255,107,95,.13); color: var(--accent); }
.voice-button.is-listening .voice-icon { animation: voice-pulse 900ms ease-in-out infinite; }
@keyframes voice-pulse { 50% { transform: scale(.72); opacity: .45; } }
.search-status { display: flex; justify-content: space-between; gap: 10px; padding: 14px 19px 8px; color: var(--muted); font-size: 11px; }
.search-status small { opacity: .65; }
.search-results { min-height: 160px; max-height: 550px; overflow: auto; padding: 7px 11px 14px; }
.search-result { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 13px; padding: 9px; border: 0; border-radius: 13px; background: transparent; cursor: pointer; text-align: left; }
.search-result:hover { background: var(--panel); }
.result-poster { width: 48px; height: 67px; border-radius: 9px; background-position: center; background-size: cover; }
.search-result h3 { margin: 0; font-size: 13px; }
.search-result p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.result-action { color: var(--accent); font-size: 20px; }
.result-type { display: inline-flex; margin-right: 6px; padding: 2px 6px; border-radius: 5px; background: var(--panel-2); color: var(--mint); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.search-message { display: grid; place-items: center; min-height: 140px; padding: 30px; color: var(--muted); text-align: center; }

.detail-dialog { width: min(930px, calc(100% - 28px)); max-height: calc(100vh - 32px); border-radius: 25px; background: var(--bg-soft); box-shadow: var(--shadow); }
#detail-root { min-height: 400px; }
.detail-hero { position: relative; min-height: 315px; display: grid; grid-template-columns: 176px 1fr; align-items: end; gap: 25px; padding: 75px 34px 28px; overflow: hidden; }
.detail-backdrop { position: absolute; inset: 0; background-position: center; background-size: cover; filter: saturate(.8); opacity: .28; transform: scale(1.04); }
.detail-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(17,16,24,.22), var(--bg-soft) 94%); }
.detail-hero .poster { z-index: 1; width: 176px; }
.detail-copy { position: relative; z-index: 1; }
.detail-copy h1 { margin: 3px 0 8px; font-family: "Manrope"; font-size: clamp(29px, 5vw, 47px); line-height: 1; letter-spacing: -.055em; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; color: rgba(255,255,255,.65); font-size: 11px; }
.meta-pill { padding: 4px 8px; border: 1px solid rgba(255,255,255,.13); border-radius: 7px; background: rgba(0,0,0,.14); }
.detail-summary { max-width: 650px; margin: 13px 0 0; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.55; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; }
.detail-close { position: absolute; z-index: 4; top: 17px; right: 17px; }
.detail-content { padding: 5px 34px 34px; }
.detail-progress { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; margin: 4px 0 27px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.detail-progress strong { font-size: 12px; }
.detail-progress span { color: var(--muted); font-size: 10px; }
.season { margin-top: 8px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.season summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 18px; cursor: pointer; font-weight: 700; list-style: none; }
.season summary::-webkit-details-marker { display: none; }
.season summary small { color: var(--muted); font-weight: 400; }
.season-title { min-width: 0; }
.season-summary-meta { display: flex; align-items: center; gap: 10px; }
.season-check { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border: 1px solid rgba(123,217,187,.48); border-radius: 10px; background: rgba(123,217,187,.06); color: transparent; cursor: pointer; font-size: 17px; font-weight: 900; transition: 160ms ease; }
.season-check:hover { border-color: var(--mint); background: rgba(123,217,187,.12); }
.season-check.is-complete { border-color: var(--mint); background: var(--mint); color: #15352c; box-shadow: 0 5px 16px rgba(123,217,187,.18); }
.season-check:disabled { cursor: not-allowed; opacity: .3; }
.episodes { padding: 0 10px 10px; }
.episode-row { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 11px; min-height: 52px; padding: 6px 8px; border-top: 1px solid var(--line); }
.episode-check { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: transparent; cursor: pointer; }
.episode-check.is-watched { border-color: var(--mint); background: var(--mint); color: #163229; }
.episode-check:disabled { opacity: .35; cursor: not-allowed; }
.episode-row h4 { margin: 0; font-size: 11px; }
.episode-row p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.episode-row time { color: var(--muted); font-size: 9px; }
.detail-loading { min-height: 430px; display: grid; place-items: center; color: var(--muted); }
.movie-watch-card { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }
.movie-watch-card > span:first-child { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: var(--panel-2); color: var(--accent); font-size: 23px; }
.movie-watch-card h2 { margin: 0; font-family: "Manrope"; font-size: 15px; }
.movie-watch-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.spinner { width: 34px; height: 34px; margin: 0 auto 13px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.list-dialog { width: min(540px, calc(100% - 28px)); max-height: min(760px, calc(100dvh - 30px)); border-radius: 24px; background: var(--bg-soft); box-shadow: var(--shadow); }
.list-panel { min-height: 280px; }
.list-panel-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 23px 23px 17px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.list-panel-header h2 { margin: 0; font-family: "Manrope"; font-size: 22px; letter-spacing: -.035em; }
.list-panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.list-panel-body { max-height: 560px; overflow-y: auto; padding: 15px 18px 22px; }
.list-picker-items, .list-manager-items { display: grid; gap: 8px; }
.list-picker-row { min-height: 58px; display: grid; grid-template-columns: 37px 1fr auto; align-items: center; gap: 12px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); cursor: pointer; }
.list-picker-row:hover { border-color: color-mix(in srgb, var(--list-color) 45%, var(--line)); }
.list-symbol { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--list-color) 17%, var(--panel-2)); color: var(--list-color); font-family: "Manrope"; font-size: 13px; font-weight: 800; }
.list-picker-row strong { display: block; font-size: 12px; }
.list-picker-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.list-checkbox { width: 24px; height: 24px; margin: 0; accent-color: var(--list-color); cursor: pointer; }
.list-picker-actions { position: sticky; bottom: -22px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 18px -18px -22px; padding: 14px 18px max(18px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg-soft); }
.quick-list-form, .new-list-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 15px; }
.list-name-input { min-width: 0; height: 43px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; background: var(--panel); color: var(--ink); outline: 0; }
.list-name-input:focus { border-color: var(--mint); }
.manager-row { display: grid; grid-template-columns: 37px 1fr auto; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.manager-row input { width: 100%; min-width: 0; border: 0; border-bottom: 1px solid transparent; padding: 5px 2px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; outline: 0; }
.manager-row input:focus { border-bottom-color: var(--mint); }
.manager-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.delete-list { min-width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 14px; }
.delete-list.is-confirming { width: auto; padding: 0 9px; background: rgba(255,107,95,.14); color: var(--accent); font-size: 9px; font-weight: 800; }

.account-dialog { width: min(390px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow-y: auto; border-radius: 24px; background: var(--bg-soft); box-shadow: var(--shadow); }
.account-card { position: relative; padding: 32px 27px 27px; text-align: center; }
.account-card .dialog-close { position: absolute; top: 14px; right: 14px; }
.account-avatar { width: 72px; height: 72px; display: grid; place-items: center; margin: 3px auto 14px; border-radius: 23px; background: linear-gradient(145deg, var(--accent), #9f4262); color: white; font-family: "Manrope"; font-size: 20px; font-weight: 800; }
.account-card h2 { margin: 0; font-family: "Manrope"; font-size: 22px; }
.account-card > p { margin: 5px 0 20px; color: var(--muted); font-size: 11px; }
.account-data-note { display: grid; gap: 4px; margin-bottom: 17px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); text-align: left; }
.account-data-note strong { font-size: 10px; }
.account-data-note span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.account-card .primary-button { width: 100%; }
.account-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.account-tools .secondary-button { min-height: 40px; justify-content: center; }
.admin-access { margin: 18px 0; padding-top: 17px; border-top: 1px solid var(--line); text-align: left; }
.account-section-heading h3 { margin: 4px 0 12px; font-family: "Manrope"; font-size: 17px; }
.invite-user-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.invite-user-form input { min-width: 0; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--ink); }
.invite-user-form .primary-button { width: auto; }
.access-list { display: grid; gap: 7px; max-height: 180px; margin-top: 11px; overflow: auto; }
.access-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.access-row span { min-width: 0; }
.access-row strong, .access-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-row strong { font-size: 10px; }
.access-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.access-row button { border: 0; background: transparent; color: #ff8d83; cursor: pointer; font-size: 9px; font-weight: 700; }
.access-row button:disabled { color: var(--muted); cursor: not-allowed; }
.danger-link { margin: 4px auto 13px; border: 0; background: transparent; color: #ff8d83; cursor: pointer; font-size: 9px; text-decoration: underline; text-underline-offset: 3px; }
.migration-dialog { width: min(430px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow-y: auto; border-radius: 24px; background: var(--bg-soft); box-shadow: var(--shadow); }
.migration-card { padding: 29px; }
.migration-card h2 { margin: 7px 0 10px; font-family: "Manrope"; font-size: 25px; letter-spacing: -.04em; }
.migration-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.migration-actions { display: grid; gap: 8px; margin-top: 21px; }
.migration-actions .primary-button, .migration-actions .secondary-button { width: 100%; justify-content: center; }
.text-button { min-height: 36px; border: 0; background: transparent; color: var(--mint); cursor: pointer; font-weight: 700; }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { min-width: 240px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; animation: toast-in 220ms ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.skeleton { position: relative; overflow: hidden; background: var(--panel-2); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent, rgba(255,255,255,.07), transparent); transform: translateX(-100%); animation: shimmer 1.5s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-line { width: 80%; height: 10px; margin-top: 11px; border-radius: 5px; }
.skeleton-line.short { width: 48%; height: 7px; margin-top: 6px; }

.mobile-nav { display: none; }

:root[data-theme="light"] .detail-meta,
:root[data-theme="light"] .detail-summary { color: var(--muted); }
:root[data-theme="light"] .meta-pill { border-color: var(--line); background: rgba(255,255,255,.2); }

@media (max-width: 1180px) {
  .card-row { grid-template-columns: repeat(4, minmax(135px, 1fr)); }
  .card-row .show-card:nth-child(n+5) { display: none; }
  .library-grid { grid-template-columns: repeat(4, minmax(140px, 1fr)); }
}

@media (max-width: 860px) {
  :root { --sidebar: 80px; }
  .sidebar { align-items: center; padding: 26px 13px; }
  .brand > span:last-child, .nav-item > span:not(.nav-icon):not(.nav-count), .sidebar-card, .sidebar-lists, .sidebar-profile > span:nth-child(2) { display: none; }
  .brand { padding: 0; }
  .side-nav { width: 100%; }
  .side-nav .nav-item { justify-content: center; padding: 0; }
  .nav-count { position: absolute; margin: -27px 0 0 25px; min-width: 18px; padding: 1px 5px; background: var(--accent); color: white; }
  .sidebar-footer { margin-top: auto; flex-direction: column; }
  .sidebar-profile { flex: 0; }
  .sidebar-footer .icon-button { margin: 0; }
  .continue-grid { grid-template-columns: 1fr; }
  .home-bottom { grid-template-columns: 1fr; }
  .library-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .hero-art { opacity: .38; }
}

@media (max-width: 620px) {
  .app-shell { padding-bottom: 76px; }
  .sidebar { display: none; }
  main { margin-left: 0; }
  .topbar { height: 72px; padding: 0 18px; }
  .mobile-brand { display: block; font-family: "Manrope"; font-size: 17px; font-weight: 800; letter-spacing: .13em; }
  .date-line { font-size: 9px; }
  .search-trigger { width: 43px; min-height: 43px; justify-content: center; padding: 0; }
  .search-trigger > span:not(:first-child), .search-trigger kbd { display: none; }
  #view-root { padding: 20px 16px 30px; }
  .hero { min-height: 360px; align-items: end; padding: 27px 22px; border-radius: 23px; }
  .hero h1 { font-size: 38px; }
  .hero p { font-size: 12px; }
  .hero-art { right: -10px; top: 3px; }
  .hero-actions .secondary-button { display: none; }
  .card-row { display: flex; overflow-x: auto; margin: 0 -16px; padding: 0 16px 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .card-row .show-card, .card-row .show-card:nth-child(n+5) { display: block; flex: 0 0 142px; scroll-snap-align: start; }
  .section { margin-top: 31px; }
  .section-heading { align-items: start; }
  .continue-card { grid-template-columns: 76px 1fr; }
  .continue-card .poster { width: 76px; }
  .home-bottom { grid-template-columns: minmax(0, 1fr); }
  .page-header { align-items: start; flex-direction: column; gap: 16px; }
  .library-tools { width: 100%; flex-wrap: wrap; }
  .library-tools .filter-tabs { flex: 1; }
  .library-tools > .secondary-button { min-height: 45px; }
  .list-tabs { margin-top: -3px; margin-right: -16px; margin-left: -16px; padding-right: 16px; padding-left: 16px; }
  .filter-tabs { width: 100%; overflow-x: auto; }
  .library-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 20px 13px; }
  .calendar-summary { grid-template-columns: 1fr 1fr; }
  .calendar-summary .summary-tile:last-child { grid-column: 1 / -1; }
  .calendar-episode { grid-template-columns: 48px 1fr; }
  .calendar-poster { width: 46px; height: 46px; }
  .calendar-episode time { display: none; }
  .mobile-nav {
    position: fixed;
    z-index: 30;
    inset: auto 0 0;
    height: 72px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 5px 7px max(5px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(18px);
  }
  .mobile-nav .nav-item { min-height: 51px; flex-direction: column; justify-content: center; gap: 2px; padding: 0; font-size: 19px; }
  .mobile-nav .nav-item small { font-size: 8px; }
  .mobile-search { width: 48px; height: 48px; margin: -22px auto 0; border: 4px solid var(--bg); border-radius: 17px; background: var(--accent); color: white; font-size: 24px; box-shadow: 0 8px 22px rgba(255,107,95,.32); }
  .search-dialog { margin-top: 2vh; }
  .search-status small { display: none; }
  .detail-dialog { width: 100%; max-width: none; max-height: 94vh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .list-dialog { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .list-panel-header { padding: 20px 18px 15px; }
  .list-panel-body { max-height: calc(92dvh - 85px); padding-right: 14px; padding-left: 14px; }
  .list-picker-actions { margin-right: -14px; margin-left: -14px; padding-right: 14px; padding-left: 14px; }
  .detail-hero { min-height: 390px; grid-template-columns: 112px 1fr; gap: 17px; padding: 78px 20px 24px; }
  .detail-hero .poster { width: 112px; }
  .detail-copy h1 { font-size: 29px; }
  .detail-summary { display: none; }
  .detail-content { padding: 3px 16px 28px; }
  .detail-progress { grid-template-columns: 1fr auto; }
  .detail-progress .progress-track { grid-column: 1 / -1; grid-row: 2; }
  .episode-row { grid-template-columns: 32px 1fr; }
  .episode-row time { display: none; }
  .toast-region { right: 12px; bottom: 83px; left: 12px; }
  .toast { min-width: 0; }
}

@media (max-width: 760px) {
  .auth-gate { grid-template-columns: 1fr; padding: max(18px, env(safe-area-inset-top)) 0 max(18px, env(safe-area-inset-bottom)); }
  .auth-visual { min-height: 100px; border-right: 0; font-size: 25px; }
  .auth-visual .brand-mark { width: 38px; height: 38px; padding: 7px; border-radius: 12px; }
  .auth-visual::before { display: none; }
  .auth-card { align-self: start; width: calc(100% - 28px); padding: 28px 22px; border-radius: 23px; }
  .auth-card h1 { font-size: 43px; }
  .auth-card > p { margin: 13px 0 21px; font-size: 12px; }
  .account-tools, .invite-user-form { grid-template-columns: 1fr; }
  .invite-user-form .primary-button { width: 100%; }
}

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

/* Mobile-first interaction layer: these are the baseline product surfaces. */
@media (max-width: 620px) {
  body { background: var(--bg); }
  .topbar { position: sticky; z-index: 18; top: 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(18px); }
  #view-root { padding-top: 14px; }
  .hero { min-height: 335px; }
  .hero-copy { width: 100%; }
  .hero-actions .primary-button { width: 100%; min-height: 48px; }
  .section-heading h2 { font-size: 22px; }
  .show-card h3 { font-size: 14px; }
  .show-card p { font-size: 11px; }
  .search-dialog { width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .search-panel { min-height: 100%; border: 0; border-radius: 0; }
  .search-input-wrap { position: sticky; z-index: 2; top: 0; min-height: 68px; padding: max(12px, env(safe-area-inset-top)) 12px 10px; }
  .search-input-wrap input { font-size: 16px; }
  .voice-button { width: 44px; padding: 0; }
  .voice-label { display: none; }
  .dialog-close { width: 40px; height: 40px; }
  .search-results { max-height: calc(100dvh - 110px); padding: 5px 8px 90px; }
  .search-result { min-height: 82px; grid-template-columns: 49px minmax(0, 1fr) 24px; }
  .detail-dialog { max-height: 96dvh; }
  .detail-actions { display: grid; grid-template-columns: 1fr; }
  .detail-actions > button, .detail-actions > select { width: 100%; min-height: 46px; }
  .season summary { min-height: 58px; padding: 11px 10px 11px 14px; }
  .season-summary-meta { gap: 8px; }
  .season-check { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }
  .episode-row { min-height: 58px; }
  .episode-check { width: 32px; height: 32px; }
  .movie-watch-card { grid-template-columns: 46px 1fr; }
  .movie-watch-card .primary-button { grid-column: 1 / -1; min-height: 46px; }
}
