:root {
  --bg: #0b0d12;
  --bg-elev: #12161f;
  --bg-elev-2: #181d28;
  --border: #232a3a;
  --border-strong: #2f384c;
  --text: #e7ecf3;
  --text-muted: #8c97ad;
  --text-dim: #65718a;
  --accent: #6aa3ff;
  --accent-dark: #4d8bff;
  --accent-strong: #4d8bff;
  --accent-soft: rgba(106, 163, 255, 0.12);
  --good: #38d39f;
  --good-soft: rgba(56, 211, 159, 0.14);
  --watching: #32d583;
  --watching-soft: rgba(50, 213, 131, 0.14);
  --finished: #e3b341;
  --finished-soft: rgba(227, 179, 65, 0.18);
  --dropped: #ff6b6b;
  --dropped-soft: rgba(255, 107, 107, 0.18);
  --progress-track: #4a1518;
  --progress-fill: #32d583;
  --warn: #ffb547;
  --bad: #ff6b6b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 8px;
  --page-gutter: clamp(20px, 3vw, 48px);
  --sidebar-width: 310px;
  --stat-yellow: #f5c400;
  --stat-green: #32d583;
  --stat-orange: #ff8a3d;
  --stat-pink: #ff3f75;
  --sync-btn-bg: linear-gradient(180deg, #ffd21a, #e7ad00);
  --sync-btn-text: #080b10;
  --sidebar-bg: linear-gradient(180deg, var(--bg-elev) 0%, var(--bg) 100%);
  --shelf-bg: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  --shelf-border: var(--border-subtle, var(--border));
  --aurora-clr-1: #00c2ff;
  --aurora-clr-2: #33ff8c;
  --aurora-clr-3: #ffc640;
  --aurora-clr-4: #e54cff;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body {
  min-height: 100vh;
}

a {
  color: var(--accent);
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---- app shell: sidebar + main ---- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  padding: 20px 22px 26px;
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  overflow-y: auto;
  transition: transform 0.25s ease;
}

html.sidebar-collapsed {
  --sidebar-width: 0px;
}

html.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
  pointer-events: none;
}

.sidebar-toggle {
  position: fixed;
  z-index: 35;
  top: 28px;
  left: calc(var(--sidebar-width) - 14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev-2);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: left 0.25s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

html.sidebar-collapsed .sidebar-toggle {
  left: 10px;
}

html.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-elev);
}

.sidebar-toggle svg {
  display: block;
  transition: transform 0.25s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.sidebar-header .sidebar-brand {
  margin-bottom: 0;
  min-width: 0;
}

.sidebar-top-actions {
  display: none;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  --brand-mark-size: 52px;
  margin: 0 0 14px;
  padding: 2px 0;
  text-decoration: none;
  color: var(--text);
}

.sidebar-brand-mark {
  display: block;
  width: var(--brand-mark-size);
  height: var(--brand-mark-size);
  flex-shrink: 0;
  object-fit: contain;
  filter: var(--brand-mark-filter, none);
}

.sidebar-brand-wordmark {
  font-weight: 800;
  font-size: 1.32rem;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--accent);
  transform: translateY(calc(var(--brand-mark-size) * var(--brand-wordmark-shift, 0.1045)));
}

.sidebar-brand-tld {
  color: var(--good, var(--accent-dark));
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.tab-btn-link {
  text-decoration: none;
  box-sizing: border-box;
}

.tab-btn-link .tab-icon svg {
  color: var(--accent);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 650;
  text-align: left;
  border-left: 3px solid transparent;
  line-height: 1.25;
}

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.tab-icon svg {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

.tab-btn.active {
  background: var(--tab-active-bg, var(--accent-soft));
  border-left-color: var(--accent);
  color: var(--text);
}

.tab-btn:hover {
  color: var(--text);
  background: var(--tab-hover, var(--accent-soft));
}

/* Aurora shimmer on Add Show tab + panel title (colors only in text glyphs) */
.aurora-title {
  position: relative;
  display: inline-block;
  overflow: hidden;
  line-height: 1.15;
  background: var(--aurora-bg, var(--bg));
}

.aurora-title-text {
  position: relative;
  z-index: 1;
  color: var(--aurora-text, #fff);
}

.aurora {
  position: absolute;
  inset: 0;
  z-index: 2;
  mix-blend-mode: var(--aurora-blend-mode, darken);
  pointer-events: none;
}

.aurora__item {
  overflow: hidden;
  position: absolute;
  width: var(--aurora-size, 12rem);
  height: var(--aurora-size, 12rem);
  background-color: var(--aurora-clr-1);
  border-radius: 37% 29% 27% 27% / 28% 25% 41% 37%;
  filter: blur(var(--aurora-blur, 0.65rem));
  mix-blend-mode: var(--aurora-item-blend-mode, overlay);
  opacity: var(--aurora-item-opacity, 1);
}

.aurora__item:nth-of-type(1) {
  top: -50%;
  animation: aurora-border 6s ease-in-out infinite, aurora-1 12s ease-in-out infinite alternate;
}

.aurora__item:nth-of-type(2) {
  background-color: var(--aurora-clr-3);
  right: 0;
  top: 0;
  animation: aurora-border 6s ease-in-out infinite, aurora-2 12s ease-in-out infinite alternate;
}

.aurora__item:nth-of-type(3) {
  background-color: var(--aurora-clr-2);
  left: 0;
  bottom: 0;
  animation: aurora-border 6s ease-in-out infinite, aurora-3 8s ease-in-out infinite alternate;
}

.aurora__item:nth-of-type(4) {
  background-color: var(--aurora-clr-4);
  right: 0;
  bottom: -50%;
  animation: aurora-border 6s ease-in-out infinite, aurora-4 24s ease-in-out infinite alternate;
}

.tab-btn-aurora .aurora-title {
  --aurora-blur: 0.3rem;
  --aurora-size: 4.5rem;
  --aurora-bg: transparent;
}

.tab-btn-aurora:hover .aurora-title {
  --aurora-bg: var(--tab-hover, color-mix(in srgb, var(--accent) 8%, transparent));
}

.tab-btn-aurora.active .aurora-title {
  --aurora-bg: var(--tab-active-bg, var(--accent-soft));
}

@keyframes aurora-1 {
  0% {
    top: 0;
    right: 0;
  }

  50% {
    top: 100%;
    right: 75%;
  }

  75% {
    top: 100%;
    right: 25%;
  }

  100% {
    top: 0;
    right: 0;
  }
}

@keyframes aurora-2 {
  0% {
    top: -50%;
    left: 0%;
  }

  60% {
    top: 100%;
    left: 75%;
  }

  85% {
    top: 100%;
    left: 25%;
  }

  100% {
    top: -50%;
    left: 0%;
  }
}

@keyframes aurora-3 {
  0% {
    bottom: 0;
    left: 0;
  }

  40% {
    bottom: 100%;
    left: 75%;
  }

  65% {
    bottom: 40%;
    left: 50%;
  }

  100% {
    bottom: 0;
    left: 0;
  }
}

@keyframes aurora-4 {
  0% {
    bottom: -50%;
    right: 0;
  }

  50% {
    bottom: 0%;
    right: 40%;
  }

  90% {
    bottom: 50%;
    right: 25%;
  }

  100% {
    bottom: -50%;
    right: 0;
  }
}

@keyframes aurora-border {
  0% {
    border-radius: 37% 29% 27% 27% / 28% 25% 41% 37%;
  }

  25% {
    border-radius: 47% 29% 39% 49% / 61% 19% 66% 26%;
  }

  50% {
    border-radius: 57% 23% 47% 72% / 63% 17% 66% 33%;
  }

  75% {
    border-radius: 28% 49% 29% 100% / 93% 20% 64% 25%;
  }

  100% {
    border-radius: 37% 29% 27% 27% / 28% 25% 41% 37%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aurora__item {
    animation: none !important;
  }
}

.sidebar-filter {
  display: block;
  margin: 0;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
}

.sidebar-filter select {
  width: 100%;
  min-width: 0;
}

.sidebar-filter-collapsible {
  padding-top: 14px;
  padding-bottom: 14px;
}

.sidebar-filter-collapsible > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.sidebar-filter-collapsible > summary::-webkit-details-marker {
  display: none;
}

.sidebar-filter-collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.sidebar-filter-collapsible-summary::after {
  content: '▾';
  color: var(--text-dim);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.sidebar-filter-collapsible[open] > .sidebar-filter-collapsible-summary::after {
  transform: rotate(180deg);
}

.sidebar-filter-collapsible-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-filter-collapsible-body select {
  width: 100%;
  min-width: 0;
}

.sidebar-check-list {
  display: grid;
  gap: 6px;
}

.sidebar-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.sidebar-check input {
  margin: 0;
  accent-color: var(--accent);
}

.sidebar-details > summary {
  list-style: none;
}

.sidebar-details > summary::-webkit-details-marker {
  display: none;
}

.sidebar-details-summary {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}

.sidebar-details-summary::after {
  content: '▾';
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.sidebar-details[open] > .sidebar-details-summary::after {
  transform: rotate(180deg);
}

.sidebar-details-body {
  margin-top: 16px;
}

.sidebar-stats {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.sidebar-stats div {
  padding: 10px 0;
}

.sidebar-stats div:nth-child(-n + 2) {
  padding-bottom: 14px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border-subtle, var(--border));
}

.sidebar-stats span {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
}

.sidebar-stats strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  margin-top: 2px;
}

.stat-green {
  color: var(--good, var(--stat-green)) !important;
}

.stat-orange {
  color: var(--stat-orange) !important;
}

.stat-pink {
  color: var(--stat-pink) !important;
}

.app-shell {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  transition: margin-left 0.25s ease;
  position: relative;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(4px);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.app-loading[hidden] {
  display: none;
}

.app-loading p {
  margin: 0;
}

.content {
  flex: 1;
  padding: 28px 42px 28px;
}

.list-filter-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 0;
}

.list-filter-input {
  width: 220px;
  max-width: min(280px, 28vw);
  min-width: 0;
  height: 40px;
  min-height: 40px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
  line-height: 38px;
  box-sizing: border-box;
}

.list-filter-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.list-filter-clear {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.mobile-app-support-bar {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(820px, calc(100vw - 32px));
  padding: 8px 10px 8px 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
}

.mobile-app-support-bar.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.mobile-app-support-drag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: grab;
  touch-action: none;
}

.mobile-app-support-drag:hover,
.mobile-app-support-drag:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--bg-elev-2, var(--bg-elev)) 75%, transparent);
}

.mobile-app-support-bar.is-dragging .mobile-app-support-drag {
  cursor: grabbing;
}

.mobile-app-support-body {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.mobile-app-support-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-app-support-close:hover,
.mobile-app-support-close:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--bg-elev-2, var(--bg-elev)) 75%, transparent);
}

.mobile-app-support-bar[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .mobile-app-support-bar {
    display: none !important;
  }
}

.mobile-app-support-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--text-muted);
  white-space: nowrap;
}

.mobile-app-support-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mobile-app-support-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-elev-2, var(--bg-elev)) 55%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s, filter 0.15s;
}

.mobile-app-support-btn:hover:not(:disabled),
.mobile-app-support-btn:focus-visible {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark, var(--accent-strong)));
  color: var(--accent-text, #111);
  font-weight: 700;
  box-shadow: 0 0 16px var(--accent-glow, transparent);
  filter: brightness(1.05);
}

.mobile-app-support-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.mobile-app-support-icon {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--text-muted);
  background-color: currentColor;
  transition: color 0.15s, background-color 0.15s;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.mobile-app-support-icon--android {
  mask-image: url('/assets/mobile-app/android-support.png');
  -webkit-mask-image: url('/assets/mobile-app/android-support.png');
}

.mobile-app-support-icon--ios {
  mask-image: url('/assets/mobile-app/ios-support.png');
  -webkit-mask-image: url('/assets/mobile-app/ios-support.png');
}

.mobile-app-support-icon--unsure {
  mask-image: url('/assets/mobile-app/unsure-support.png');
  -webkit-mask-image: url('/assets/mobile-app/unsure-support.png');
}

.mobile-app-support-btn:hover:not(:disabled) .mobile-app-support-icon,
.mobile-app-support-btn:focus-visible .mobile-app-support-icon {
  color: inherit;
}

.content-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 8px;
}

.content-topbar.compact h1 {
  font-size: 28px;
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.hero-title img.hero-art {
  width: auto;
  height: auto;
  max-width: min(108px, 22vw);
  max-height: 90px;
  object-fit: contain;
  flex-shrink: 0;
}

.hero-title h1 {
  font-size: 32px;
  margin: 0 0 4px;
  line-height: 1.1;
  color: var(--text);
}

.hero-title p {
  color: var(--text-muted);
  margin: 2px 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.hero-title p.muted {
  font-size: 0.82rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sync-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark, var(--accent-strong)));
  color: var(--accent-text, #fff);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 16px var(--accent-glow, transparent);
}

.sync-btn:hover {
  filter: brightness(1.05);
}

.shelf {
  margin-top: 20px;
  padding: 28px 20px;
  border-radius: 24px;
  background: var(--shelf-bg);
  border: 1px solid var(--shelf-border);
}

.search-shelf {
  margin-top: 28px;
  padding: 24px;
  border-radius: 24px;
  background: var(--shelf-bg);
  border: 1px solid var(--shelf-border);
}

.search-hint {
  color: var(--text-muted);
  margin: 16px 0 0;
  font-size: 0.95rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-title h2 {
  font-size: 25px;
  margin: 0;
  color: var(--text);
}

.section-title-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.section-title-heading h2 {
  margin: 0;
}

.shelf-mark-all-watched {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--good);
  border: 1px solid transparent;
  color: #041810;
  cursor: pointer;
}

.shelf-mark-all-watched:disabled {
  opacity: 0.55;
  cursor: wait;
}

.shelf-scrolls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.shelf-scroll {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.shelf-scroll svg {
  display: block;
}

.shelf-scroll[hidden] {
  display: none;
}

.shelf-scroll:hover {
  border-color: var(--border-strong);
}

.shelf-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 170px);
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.episode-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  min-height: 280px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.episode-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.episode-card img.poster {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: var(--bg-elev-2);
}

.episode-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--good);
  color: var(--accent-text, #fff);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.episode-badge-coming {
  background: var(--warn);
  color: #1a1208;
}

.episode-air-date {
  position: relative;
  z-index: 2;
  margin: 0 12px 12px;
  font-size: 12px;
  font-weight: 650;
  color: var(--warn);
}

.episode-card.coming-item,
.episode-card.new-item {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding-bottom: 0;
}

.episode-card-foot {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.episode-card.coming-item .episode-provider-pills,
.episode-card.new-item .episode-provider-pills {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  margin: 0;
}

.episode-card.coming-item .episode-provider-pill,
.episode-card.new-item .episode-provider-pill {
  margin: 0;
}

.episode-card.coming-item .episode-air-date {
  margin: 0;
}

.episode-provider-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  gap: 5px;
  color: var(--text);
}

.episode-provider-pill img {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.coming-tree-summary .episode-provider-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin: 0 0 0 auto;
  flex-shrink: 0;
}

.coming-tree-summary .episode-provider-pill {
  margin: 0;
  flex-shrink: 0;
}

.coming-tree-section .section-title {
  margin-bottom: 16px;
}

.coming-tree-root {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  --tree-line: color-mix(in srgb, var(--border) 88%, var(--text-muted));
  --tree-bg: var(--bg-elev);
}

.coming-tree-children {
  list-style: none;
  margin: 0 0 0 11px;
  padding: 0 0 0 22px;
  border-left: 1px solid var(--tree-line);
}

.coming-tree-node {
  position: relative;
  margin: 0;
  padding: 0;
}

.coming-tree-children > .coming-tree-node::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 17px;
  width: 22px;
  border-top: 1px solid var(--tree-line);
}

.coming-tree-children > .coming-tree-node-episode::before {
  top: 16px;
  width: 24px;
}

.coming-tree-children > .coming-tree-node:last-child::after {
  content: '';
  position: absolute;
  left: -23px;
  top: 18px;
  bottom: 0;
  width: 3px;
  background: var(--tree-bg);
}

.coming-tree-details > summary {
  list-style: none;
}

.coming-tree-details > summary::-webkit-details-marker {
  display: none;
}

.coming-tree-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 8px 4px 2px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}

.coming-tree-summary:hover,
.coming-tree-node-episode:hover {
  background: color-mix(in srgb, var(--bg-elev-2) 75%, transparent);
}

.coming-tree-twisty {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
}

.coming-tree-twisty::before {
  content: '▸';
  transition: transform 0.15s ease;
}

.coming-tree-details[open] > .coming-tree-summary .coming-tree-twisty::before {
  transform: rotate(90deg);
}

.coming-tree-twisty-leaf::before {
  content: none;
}

.coming-tree-poster {
  width: 24px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg-elev-2);
  box-shadow: 0 0 0 1px var(--border);
}

.coming-tree-season-icon {
  width: 26px;
  height: 28px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
}

.coming-tree-season-tv {
  padding: 2px;
  border: 1.5px solid var(--text-muted);
  border-radius: 4px 4px 2px 2px;
  background: color-mix(in srgb, var(--text-muted) 22%, var(--bg-elev));
  line-height: 0;
}

.coming-tree-season-screen {
  width: 18px;
  height: 13px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--bg-elev-2) 55%, #060d18);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 70%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--warn);
  line-height: 1;
}

.coming-tree-season-stand {
  position: relative;
  width: 10px;
  height: 3px;
  margin-top: 1px;
  border-radius: 0 0 2px 2px;
  background: var(--text-muted);
}

.coming-tree-season-stand::before,
.coming-tree-season-stand::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 0 0 1px 1px;
}

.coming-tree-season-stand::before {
  left: -4px;
  transform: rotate(-18deg);
  transform-origin: right bottom;
}

.coming-tree-season-stand::after {
  right: -4px;
  transform: rotate(18deg);
  transform-origin: left bottom;
}

.coming-tree-episode-icon {
  width: 18px;
  height: 14px;
  margin-left: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.coming-tree-episode-icon svg {
  display: block;
}

.coming-tree-text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.coming-tree-label {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}

.coming-tree-node-show > .coming-tree-details > .coming-tree-summary .coming-tree-label {
  font-weight: 700;
}

.coming-tree-meta {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.coming-tree-meta::before {
  content: '· ';
}

.coming-tree-node-episode {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 8px 4px 0;
  border-radius: 6px;
  cursor: pointer;
}

.coming-tree-node-episode .coming-tree-episode-icon {
  margin-left: 0;
}

.coming-tree-episode-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.coming-tree-episode-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coming-tree-episode-date {
  font-size: 12px;
  font-weight: 650;
  color: var(--warn);
  white-space: nowrap;
}

.episode-card h3 {
  position: relative;
  z-index: 2;
  font-size: 15px;
  line-height: 1.2;
  margin: 12px 12px 4px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-card .episode-meta {
  position: relative;
  z-index: 2;
  margin: 0 12px 4px;
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-card .episode-release-note {
  position: relative;
  z-index: 2;
  margin: 0 12px 10px;
  font-size: 11px;
  line-height: 1.4;
}

.episode-provider-icon {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 12px 12px;
  width: 36px;
  height: 24px;
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elev-2);
}

.episode-provider-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.episode-card-actions {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.episode-card:hover .episode-card-actions {
  opacity: 1;
}

.episode-card-actions button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  color: var(--text);
}

.episode-card-actions .btn-mark-watched {
  background: var(--good);
  border-color: transparent;
  color: #041810;
}

.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 24px 42px 32px;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input,
input[type="search"]:not(.list-filter-input),
select {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font: inherit;
  min-width: 220px;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  padding: 10px 16px;
  touch-action: manipulation;
}

button.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

button.primary:hover {
  filter: brightness(1.08);
}

button.ghost {
  background: transparent;
}

.sync-progress {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 40;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 10px 42px;
  transition: left 0.25s ease;
}

.sync-progress-bar {
  height: 4px;
  background: var(--progress-track);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.sync-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--progress-fill);
  border-radius: inherit;
  transition: width 0.2s ease;
}

@media (max-width: 1100px) {
  .sidebar-toggle {
    display: none;
  }

  html.sidebar-collapsed {
    --sidebar-width: auto;
  }

  html.sidebar-collapsed .sidebar {
    transform: none;
    pointer-events: auto;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 25;
    width: auto;
    padding: 12px 16px max(12px, env(safe-area-inset-top)) 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  }

  .sidebar-brand {
    margin-bottom: 0;
    --brand-mark-size: 44px;
  }

  .sidebar-header {
    margin-bottom: 10px;
    min-width: 0;
    overflow: visible;
  }

  .sidebar-header .sidebar-brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .sidebar-brand-wordmark {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-top-actions {
    display: flex;
    flex-shrink: 0;
    overflow: visible;
  }

  .user-menu-panel {
    z-index: 100;
    max-width: min(280px, calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    width: max-content;
    box-sizing: border-box;
  }

  .user-menu-panel.is-fixed {
    position: fixed;
    left: auto;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .list-filter-bar {
    flex: 1;
    min-width: 0;
  }

  .list-filter-input {
    width: 100%;
    max-width: none;
  }

  .sidebar-brand-mark {
    width: var(--brand-mark-size);
    height: var(--brand-mark-size);
  }

  .sidebar-brand-wordmark {
    font-size: 1.18rem;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto;
    padding: 10px 14px;
    font-size: 0.84rem;
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    min-height: 44px;
  }

  .tab-btn.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }

  .sidebar-details-summary {
    display: flex;
    margin-top: 10px;
  }

  .sidebar-details:not([open]) .sidebar-details-body {
    display: none;
  }

  .sidebar-details[open] .sidebar-details-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
  }

  .sidebar-filter {
    margin: 0;
    padding: 14px;
  }

  .sidebar-stats {
    padding: 14px;
  }

  .sidebar-stats div {
    padding: 8px 0;
  }

  .sidebar-stats div:nth-child(-n + 2) {
    padding-bottom: 10px;
  }

  .sidebar-stats strong {
    font-size: 26px;
  }

  .app-shell {
    margin-left: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sync-progress {
    left: 0;
    padding: 8px 16px;
  }

  .content {
    padding: 16px;
  }

  .hero-title h1 {
    font-size: 24px;
  }

  .content-topbar.compact h1 {
    font-size: 22px;
  }

  .hero-title p {
    font-size: 0.85rem;
  }

  .shelf,
  .search-shelf {
    margin-top: 16px;
    padding: 16px 14px;
    border-radius: 18px;
  }

  .section-title h2 {
    font-size: 20px;
  }

  .shelf-grid {
    grid-auto-columns: minmax(128px, 38vw);
    gap: 14px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .content-topbar,
  .hero-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-title img.hero-art {
    max-width: 72px;
    max-height: 60px;
  }

  .site-footer {
    padding: 16px;
    font-size: 0.75rem;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-header {
    flex-wrap: wrap;
  }

  .season-header {
    flex-wrap: wrap;
  }

  .season-header .btn-season-watch {
    width: 100%;
    text-align: center;
  }

  .search-wrap {
    min-width: 0;
    width: 100%;
  }

  .search-input,
  input[type="search"],
  select {
    min-width: 0;
    width: 100%;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .sidebar {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .content {
    padding: 14px max(12px, env(safe-area-inset-left)) 18px max(12px, env(safe-area-inset-right));
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
  }

  /* Compact horizontal show rows — ~60% less vertical space than full-width posters. */
  .card-grid .card {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: stretch;
  }

  .card-grid .card .show-status-banner {
    grid-column: 1 / -1;
    padding: 4px 8px;
    font-size: 0.62rem;
  }

  .card-grid .card .card-poster {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    width: 84px;
  }

  .card-grid .card .poster {
    width: 84px;
    height: 126px;
    aspect-ratio: auto;
    object-fit: cover;
    border-radius: 0;
  }

  .card-grid .card .card-body {
    grid-column: 2;
    grid-row: 2;
    padding: 8px 10px;
    min-width: 0;
    align-self: center;
  }

  .card-grid .card .title {
    font-size: 0.88rem;
    -webkit-line-clamp: 2;
  }

  .card-grid .card .meta {
    margin-top: 3px;
    font-size: 0.72rem;
  }

  .card-grid .card .progress-bar {
    margin-top: 6px;
    height: 3px;
  }

  .card-grid .card .provider-row {
    margin-top: 5px;
    max-height: none;
    overflow: visible;
  }

  /* Icon-only provider pills on mobile — names stay in title/aria-label. */
  .provider-pill--icon-only,
  .provider-pill:not(.provider-pill--no-logo) {
    padding: 5px 6px;
    gap: 0;
  }

  .provider-pill--icon-only .provider-pill-label,
  .provider-pill:not(.provider-pill--no-logo) .provider-pill-label {
    display: none;
  }

  .provider-pill--icon-only img,
  .provider-pill:not(.provider-pill--no-logo) img {
    width: 21px;
    height: 21px;
  }

  .card-grid .card .provider-pill--icon-only,
  .card-grid .card .provider-pill:not(.provider-pill--no-logo) {
    padding: 4px 5px;
  }

  .card-grid .card:hover {
    transform: none;
  }

  .watching-list {
    gap: 24px;
  }

  .watching-section-title {
    margin-bottom: 10px;
  }

  .watching-section-title h2 {
    font-size: 1.1rem;
  }

  .episode-card {
    min-height: 0;
  }

  .episode-card img.poster {
    height: 110px;
  }

  .shelf-grid {
    grid-auto-columns: minmax(104px, 36vw);
    gap: 10px;
  }

  #new-list .shelf-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-columns: unset;
    overflow-x: visible;
    overflow-y: visible;
  }

  #new-list .shelf-scrolls {
    display: none;
  }

  .new-list-truncated {
    margin: 0 4px 12px;
    line-height: 1.4;
  }

  .episode-card:hover {
    transform: none;
  }

  .episode-card-actions {
    opacity: 1;
  }

  .episode-card h3 {
    font-size: 0.88rem;
  }

  .episode-card .episode-meta,
  .episode-card .episode-release-note {
    font-size: 0.72rem;
  }

  .shelf-foot {
    padding: 8px 4px 0;
  }

  .shelf-deferred-hint {
    margin: 0 4px 8px;
  }

  .hero-title img.hero-art {
    display: none;
  }

  .hero-title h1 {
    font-size: 22px;
  }

  .sync-btn {
    height: 44px;
    padding: 0 14px;
    font-size: 0.82rem;
  }

  .modal-backdrop {
    padding: 0;
    align-items: stretch;
  }

  .modal {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal-header {
    flex-shrink: 0;
    padding: 14px max(14px, env(safe-area-inset-left)) 10px max(14px, env(safe-area-inset-right));
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .modal-info-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elev-2);
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 650;
    cursor: pointer;
    user-select: none;
  }

  .modal-info-summary::after {
    content: '▾';
    color: var(--text-dim);
    transition: transform 0.2s ease;
  }

  .modal-info-details[open] > .modal-info-summary::after {
    transform: rotate(180deg);
  }

  .modal-info-details:not([open]) .modal-info-body {
    display: none;
  }

  .modal-info-details[open] .modal-info-body {
    display: block;
    margin-top: 10px;
  }

  .modal-body {
    max-height: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 14px max(14px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right));
  }

  .modal-header > img,
  .modal-header #modal-poster {
    width: 64px;
    height: 96px;
  }

  .modal-header-top h2 {
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .modal-header-top .modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .modal-header-top .modal-close-btn svg {
    width: 16px;
    height: 16px;
  }

  .modal-overview {
    font-size: 0.84rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .modal-info-details[open] .modal-overview {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  .modal-toolbar {
    margin-top: 8px;
    gap: 5px;
    flex-direction: column;
    align-items: stretch;
  }

  .modal-toolbar .modal-hide-watched {
    margin-left: 0;
    align-self: flex-start;
    font-size: 0.78rem;
  }

  .modal-toolbar .modal-hide-watched input {
    width: 14px;
    height: 14px;
  }

  .modal-toolbar button {
    min-height: 0;
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  .episode-row {
    grid-template-columns: auto 1fr;
    gap: 8px;
  }

  .episode-row .ep-num {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .empty-state {
    padding: 32px 16px;
  }

  .prefs-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    margin: auto;
  }
}

@media (max-width: 480px) {
  .tab-btn {
    justify-content: center;
    min-width: 44px;
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .tab-btn .tab-label {
    display: none;
  }

  .tab-icon,
  .tab-icon svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .sidebar-stats strong {
    font-size: 22px;
  }

  .sidebar-filter {
    font-size: 0.84rem;
  }

  .section-title {
    flex-wrap: wrap;
    gap: 10px;
  }

  .shelf-grid {
    grid-auto-columns: minmax(118px, 44vw);
  }

  .coming-tree-root {
    padding: 10px 10px 10px 8px;
  }

  .coming-tree-children {
    margin-left: 8px;
    padding-left: 16px;
  }

  .coming-tree-children > .coming-tree-node::before {
    left: -16px;
    width: 16px;
  }

  .coming-tree-children > .coming-tree-node-episode::before {
    width: 18px;
  }

  .coming-tree-children > .coming-tree-node:last-child::after {
    left: -17px;
  }

  .coming-tree-episode-row {
    flex-wrap: wrap;
    row-gap: 2px;
  }

  .coming-tree-episode-date {
    margin-left: 0;
  }
}

@media (min-width: 1101px) {
  .sidebar-details > .sidebar-details-summary {
    display: none;
  }

  .sidebar-details .sidebar-details-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
}

#panel-library {
  display: block;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: 20px;
  width: 100%;
  margin-top: 20px;
}

.watching-list {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin-top: 20px;
}

.watching-section .card-grid {
  margin-top: 0;
}

.watching-section-title {
  margin-bottom: 16px;
}

.watching-section-title h2 {
  font-size: 1.35rem;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  position: relative;
}

.show-status-banner {
  display: block;
  width: 100%;
  padding: 6px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text-muted);
}

.show-status-banner.watching {
  color: var(--watching);
  background: var(--watching-soft);
  border-bottom-color: color-mix(in srgb, var(--watching) 35%, transparent);
}

.show-status-banner.caught_up {
  color: var(--good);
  background: var(--good-soft);
  border-bottom-color: color-mix(in srgb, var(--good) 35%, transparent);
}

.show-status-banner.finished {
  color: var(--finished);
  background: var(--finished-soft);
  border-bottom-color: rgba(227, 179, 65, 0.4);
}

.show-status-banner.dropped {
  color: var(--dropped);
  background: var(--dropped-soft);
  border-bottom-color: color-mix(in srgb, var(--dropped) 40%, transparent);
}

.show-status-banner.not_started {
  color: var(--text-dim);
}

.card-status-watching {
  border-color: color-mix(in srgb, var(--watching) 35%, transparent);
}

.card-status-watching .progress-fill {
  background: var(--watching);
}

.card-status-caught_up {
  border-color: color-mix(in srgb, var(--good) 35%, transparent);
}

.card-status-caught_up .progress-fill {
  background: var(--good);
}

.card-status-finished {
  opacity: 0.45;
  border-color: rgba(227, 179, 65, 0.3);
  background: rgba(18, 22, 31, 0.25);
  box-shadow: none;
}

.card-status-finished .show-status-banner.finished {
  background: rgba(227, 179, 65, 0.08);
}

.card-status-finished .progress-fill {
  background: var(--finished);
}

.card-status-finished:hover {
  opacity: 1;
  background: var(--bg-elev);
  border-color: rgba(227, 179, 65, 0.45);
  box-shadow: var(--shadow);
}

.card-status-finished:hover .show-status-banner.finished {
  background: var(--finished-soft);
}

.card-status-dropped {
  opacity: 0.45;
  border-color: color-mix(in srgb, var(--dropped) 30%, transparent);
  background: rgba(18, 22, 31, 0.25);
  box-shadow: none;
}

.card-status-dropped .show-status-banner.dropped {
  background: rgba(255, 107, 107, 0.08);
}

.card-status-dropped .progress-fill {
  background: var(--dropped);
}

.card-status-dropped:hover {
  opacity: 1;
  background: var(--bg-elev);
  border-color: color-mix(in srgb, var(--dropped) 45%, transparent);
  box-shadow: var(--shadow);
}

.card-status-dropped:hover .show-status-banner.dropped {
  background: var(--dropped-soft);
}

.modal > .show-status-banner {
  border-radius: var(--radius) var(--radius) 0 0;
}

.card-poster {
  position: relative;
  overflow: hidden;
}

.card-series-ended {
  border-color: rgba(180, 140, 40, 0.55);
}

.card-series-cancelled {
  border-color: rgba(180, 30, 30, 0.55);
}

.card-series-ended .card-poster::after,
.card-series-cancelled .card-poster::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: multiply;
}

.card-series-ended .card-poster::after {
  background: linear-gradient(135deg, rgba(180, 130, 20, 0.28), rgba(90, 60, 10, 0.38));
}

.card-series-cancelled .card-poster::after {
  background: linear-gradient(135deg, rgba(190, 28, 28, 0.32), rgba(120, 8, 8, 0.4));
}

.series-status-stamp {
  display: none;
}

.card-series-ended .series-status-stamp.ended,
.card-series-cancelled .series-status-stamp.cancelled {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-28deg);
  z-index: 4;
  color: #fff;
  font-weight: 800;
  font-size: clamp(9px, 1.8vw, 13px);
  letter-spacing: 0.1em;
  padding: 3px 14px 3px 16px;
  width: 180%;
  max-width: none;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.88);
  outline: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
}

.card-series-ended .series-status-stamp.ended {
  background: linear-gradient(180deg, #c9921a 0%, #8a5a08 100%);
}

.card-series-cancelled .series-status-stamp.cancelled {
  background: linear-gradient(180deg, #c41a1a 0%, #8a0a0a 100%);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.card .poster {
  aspect-ratio: 2/3;
  width: 100%;
  object-fit: cover;
  display: block;
  background: var(--bg-elev-2);
}

.card .card-body {
  padding: 12px;
}

.card .title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.progress-bar {
  height: 4px;
  background: var(--progress-track);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: inherit;
}

.provider-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.provider-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.provider-pill img {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.new-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.new-list .empty-state {
  margin-top: 28px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.modal {
  width: min(920px, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: auto;
}

.modal-header {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header > img,
.modal-header #modal-poster {
  width: 100px;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.modal-header h2 {
  margin: 0 0 8px;
}

.modal-header-content {
  flex: 1;
  min-width: 0;
}

.modal-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.modal-header-top h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.modal-close-btn {
  flex-shrink: 0;
}

.modal-overview {
  color: var(--text-muted);
  margin: 0 0 12px;
}

.modal-info-details > summary {
  list-style: none;
}

.modal-info-details > summary::-webkit-details-marker {
  display: none;
}

.modal-info-summary {
  display: none;
}

.modal-info-body {
  margin-top: 12px;
}

.modal-toolbar {
  margin-top: 12px;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.modal-toolbar .modal-hide-watched {
  align-self: center;
  flex-shrink: 0;
  white-space: nowrap;
}

@media (min-width: 641px) {
  .modal-toolbar .modal-hide-watched {
    margin-left: auto;
  }
}

@media (min-width: 641px) {
  .modal-info-details > .modal-info-summary {
    display: none;
  }

  .modal-info-details .modal-info-body {
    display: block;
    margin-top: 0;
  }
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-hide-watched {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.modal-hide-watched input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.modal-seasons-empty {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.season-progress {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.82rem;
}

.season-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}

.season-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  cursor: pointer;
}

.season-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.season-start {
  color: var(--text-dim);
  font-weight: 400;
}

.episode-list {
  padding: 8px 0;
}

.episode-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}

.episode-row:first-child {
  border-top: none;
}

.episode-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.episode-row .ep-num {
  color: var(--text-dim);
  font-size: 0.8rem;
  min-width: 48px;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  max-height: 420px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: var(--shadow);
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-year {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-add-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 0.85rem;
}

.search-in-library {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.search-result:hover {
  background: var(--bg-elev-2);
}

.search-thumb {
  width: 36px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg-elev-2);
}

.search-preview-meta {
  color: var(--text-muted);
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.search-result-info .provider-row {
  margin-top: 4px;
}

.provider-section {
  margin-top: 12px;
}

.provider-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.provider-section-empty {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0;
}

.search-preview-overview {
  color: var(--text-muted);
  margin: 12px 0 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.search-preview-modal .modal-header {
  border-bottom: none;
  align-items: flex-start;
}

.search-preview-modal .modal-header .search-thumb {
  margin-top: 2px;
}


/* ---- topbar icon buttons & preferences dialog ---- */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev-2);
  color: var(--text);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.topbar-actions .icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn svg {
  display: block;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-elev);
}

.user-menu {
  position: relative;
}

.user-menu-icon-stack {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.user-menu-icon {
  display: block;
  width: 26px;
  height: 26px;
}

.user-menu-icon-default {
  background-color: currentColor;
  mask: url('/assets/user-profile-icon.png') center / contain no-repeat;
  -webkit-mask: url('/assets/user-profile-icon.png') center / contain no-repeat;
  transition: opacity 0.15s ease;
}

.user-menu-icon-hover {
  position: absolute;
  inset: 0;
  background: url('/assets/user-profile-icon-hover.png') center / contain no-repeat;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.user-menu-btn:hover .user-menu-icon-default,
.user-menu-btn[aria-expanded="true"] .user-menu-icon-default {
  opacity: 0;
}

.user-menu-btn:hover .user-menu-icon-hover,
.user-menu-btn[aria-expanded="true"] .user-menu-icon-hover {
  opacity: 1;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 40;
}

.user-menu-header {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.user-menu-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.user-menu-email {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
  word-break: break-word;
}

.user-menu-usage {
  margin: 4px 0 0;
  font-size: 0.78rem;
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

a.user-menu-item:hover {
  color: var(--accent);
}

button.user-menu-item:hover {
  background: var(--bg-elev-2);
  color: var(--bad);
}

button.user-menu-item#user-menu-notifications:hover {
  color: var(--accent);
}

.user-menu-item-with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-menu-item-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  flex-shrink: 0;
}

.ad-slot {
  margin: 16px 0 0;
  min-height: 0;
  text-align: center;
}

.ad-slot-modal {
  margin: 0;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
}

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

.prefs-dialog {
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.prefs-dialog::backdrop {
  background: rgba(8, 10, 16, 0.55);
  backdrop-filter: blur(2px);
}

.prefs-dialog form {
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: inherit;
  min-height: 0;
}

.prefs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.prefs-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.prefs-body {
  padding: 20px 22px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 22px 26px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.prefs-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  min-height: 0;
}

.prefs-column > .prefs-field {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

@media (max-width: 820px) {
  .prefs-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .prefs-platform-list {
    min-height: 220px;
    max-height: 42vh;
  }
}

.prefs-field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.prefs-footnote {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.prefs-footnote code {
  font-size: 0.75rem;
  background: var(--bg-elev-2);
  padding: 1px 5px;
  border-radius: 4px;
}

.prefs-platform-help {
  margin: 0 0 10px;
}

.prefs-platform-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 8px 12px;
  flex: 1;
  min-height: 280px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
}

.prefs-platform-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.prefs-platform-check input {
  margin: 0;
  accent-color: var(--accent);
}

.prefs-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.85rem;
}

/* ---- auth (login) ---- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.auth-page {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.auth-brand-mark {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: var(--brand-mark-filter, none);
}

.auth-brand-wordmark {
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--accent);
}

.auth-brand-tld {
  color: var(--good, var(--accent-dark));
}

.auth-card {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.auth-lead {
  margin: 0 0 16px;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form .cf-turnstile {
  margin: 4px 0 2px;
}

.auth-form input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.auth-submit {
  width: 100%;
}

.auth-error {
  margin: 12px 0 0;
  color: var(--bad);
  font-size: 0.9rem;
}

.auth-footer {
  text-align: center;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.prefs-account-field {
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.search-result-expand {
  border-style: dashed;
  background: var(--bg);
}

.search-result-expand:hover {
  border-color: var(--accent);
}

.search-result-expand.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.search-result-note {
  cursor: default;
  background: transparent;
  border: none;
  padding-top: 4px;
}

.search-result-note:hover {
  background: transparent;
}

/* ---- Floating notification inbox ---- */

.notification-fab-wrap {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
}

.notification-fab {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #080b10;
  background: linear-gradient(135deg, var(--accent, #f5c518), var(--good, #2ecc71));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.notification-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

.notification-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  border: 2px solid var(--bg, #0a0c10);
}

.notification-panel {
  position: fixed;
  right: 22px;
  bottom: 90px;
  z-index: 1201;
  width: min(380px, calc(100vw - 44px));
  max-height: min(560px, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--border);
}

.notification-panel-header h2 {
  margin: 0;
  flex: 1;
  font-size: 15px;
  font-weight: 700;
}

.notification-panel-mark-all {
  font-size: 12px;
  padding: 6px 10px;
}

.notification-panel-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.notification-panel-tab {
  flex: 1;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.notification-panel-tab:hover {
  color: var(--text);
  background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.notification-panel-tab.active {
  color: var(--text);
  background: var(--bg-elev-2);
}

.notification-panel-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.notification-panel-pane {
  min-height: 0;
}

.notification-panel-list {
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notification-panel-empty {
  margin: 0;
  padding: 12px 16px 16px;
  text-align: center;
  font-size: 13px;
}

.notification-item.read {
  opacity: 0.88;
}

.notification-item-when {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.notification-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.notification-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.notification-item.unread {
  border-color: color-mix(in srgb, var(--accent, #f5c518) 35%, var(--border));
}

.notification-item-poster {
  width: 40px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
}

.notification-item-body {
  min-width: 0;
  flex: 1;
}

.notification-item-kind {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--good);
  margin-bottom: 2px;
}

.notification-item-kind.status-cancelled {
  color: var(--bad, #f87171);
}

.notification-item-kind.status-ended {
  color: var(--accent, #f5c518);
}

.notification-item-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.notification-item-detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .notification-fab-wrap {
    right: 14px;
    bottom: 14px;
  }

  .notification-panel {
    right: 14px;
    bottom: 78px;
    width: calc(100vw - 28px);
  }
}

