:root, [data-theme="dark"] {
  --bg: #0b1622;
  --bg-elev: #11202f;
  --bg-card: #15263a;
  --bg-card-hover: #1a2e47;
  --border: #1e3349;
  --border-strong: #2a4868;
  --text: #e6edf5;
  --text-muted: #8ba1bc;
  --text-dim: #5d7592;
  --accent: #3db4f2;
  --accent-hover: #5cc4ff;
  --accent-dim: #1f6a99;
  --danger: #ef5350;
  --success: #66bb6a;
  --warning: #ffa726;
  --status-watching: #fdd835;     /* jaune */
  --status-completed: #66bb6a;    /* vert */
  --status-onhold: #ff7043;       /* orange */
  --status-dropped: #ef5350;      /* rouge */
  --status-planned: #42a5f5;      /* bleu */
  --bg-glow: rgba(61,180,242,.06);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.2);
  --shadow: 0 4px 12px rgba(0,0,0,.25);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.4);
}

[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-elev: #eef2f7;
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafc;
  --border: #e1e6ed;
  --border-strong: #cdd5e0;
  --text: #142032;
  --text-muted: #5b6b80;
  --text-dim: #8a98ad;
  --accent: #2196f3;
  --accent-hover: #1e88e5;
  --accent-dim: #bbdefb;
  --danger: #e53935;
  --success: #43a047;
  --warning: #fb8c00;
  --status-watching: #f9a825;
  --status-completed: #43a047;
  --status-onhold: #ef6c00;
  --status-dropped: #e53935;
  --status-planned: #1976d2;
  --bg-glow: rgba(33,150,243,.05);

  --shadow-sm: 0 1px 2px rgba(20,32,50,.06);
  --shadow: 0 4px 12px rgba(20,32,50,.08);
  --shadow-lg: 0 12px 32px rgba(20,32,50,.14);
}

:root {
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --transition: 200ms cubic-bezier(.4,0,.2,1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(ellipse at top, var(--bg-glow) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

img { display: block; max-width: 100%; }

[hidden] { display: none !important; }

::selection { background: var(--accent-dim); color: var(--text); }

/* ============ Topbar ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-4);
  height: 56px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
@media (min-width: 640px) {
  .topbar__inner { padding: 0 var(--space-6); gap: var(--space-6); }
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  flex-shrink: 0;
}
.brand__icon { width: 18px; height: 18px; color: var(--accent); }
.nav-burger { display: inline-flex; }
.nav--desktop { display: none; }
@media (min-width: 720px) {
  .nav-burger { display: none; }
  .nav--desktop { display: flex; gap: var(--space-1); margin-left: var(--space-2); }
}
.nav__link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav__link:hover { color: var(--text); background: var(--bg-elev); }
.nav__link.is-active { color: var(--text); background: var(--bg-elev); }

/* ========== Mobile drawer ========== */
.nav-drawer {
  position: fixed; inset: 0;
  z-index: 80;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 200ms ease;
}
.nav-drawer__panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 78%;
  max-width: 280px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: calc(56px + var(--space-4)) var(--space-3) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-1);
  animation: drawerIn 240ms cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}
@keyframes drawerIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.nav-drawer__link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition);
}
.nav-drawer__link i { width: 18px; height: 18px; }
.nav-drawer__link:hover, .nav-drawer__link.is-active {
  background: var(--bg-elev);
  color: var(--text);
}
.nav-drawer__link.is-active { color: var(--accent); }
.topbar__actions { margin-left: auto; display: flex; gap: var(--space-2); }
.iconbtn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}
.iconbtn:hover { color: var(--text); background: var(--bg-elev); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: white;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  text-transform: uppercase;
}

/* ============ App / views ============ */
.app {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  animation: fadeIn 300ms ease;
}
@media (min-width: 640px) {
  .app { padding: var(--space-8) var(--space-6); }
}
.view { animation: fadeIn 300ms ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ Auth ============ */
.auth {
  max-width: 380px;
  margin: 10vh auto;
  text-align: center;
  animation: fadeIn 400ms ease;
}
.auth__brand {
  font-size: 32px; font-weight: 700; letter-spacing: -.02em;
  margin-bottom: var(--space-2);
}
.auth__brand i { color: var(--accent); vertical-align: -4px; }
.auth__sub { color: var(--text-muted); margin-bottom: var(--space-8); }
.auth__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: left;
  box-shadow: var(--shadow);
}
.auth__tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: var(--space-5);
}
.auth__tab {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--transition);
}
.auth__tab.is-active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-sm); }

/* ============ Forms ============ */
.field { margin-bottom: var(--space-4); }
.label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.req { color: var(--danger); margin-left: 2px; }
.input {
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61,180,242,.18);
}
.input::placeholder { color: var(--text-dim); }
textarea.input { resize: vertical; min-height: 80px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent);
  color: #061521;
}
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(61,180,242,.3); }
.btn--ghost { color: var(--text-muted); }
.btn--ghost:hover { background: var(--bg-elev); color: var(--text); }
.btn--outline { border: 1px solid var(--border); color: var(--text); }
.btn--outline:hover { border-color: var(--border-strong); background: var(--bg-elev); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: rgba(239,83,80,.1); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn i { width: 16px; height: 16px; }

/* ============ Page header ============ */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.page-title {
  font-size: 24px; font-weight: 700; letter-spacing: -.02em;
}
.page-sub { color: var(--text-muted); margin-top: var(--space-1); font-size: 13px; }

/* ============ Toolbar ============ */
.toolbar {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.toolbar__group {
  display: flex; gap: var(--space-2);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
  scroll-snap-type: x proximity;
  padding-bottom: 2px;
}
.toolbar__group::-webkit-scrollbar { display: none; }
.toolbar__group .chip { scroll-snap-align: start; }
@media (min-width: 640px) {
  .toolbar__group {
    flex-wrap: wrap;
    overflow: visible;
    width: auto;
    scroll-snap-type: none;
  }
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-3);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.chip__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.chip__count {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transition: all var(--transition);
}
.chip[data-status="watching"] .chip__dot { background: var(--status-watching); }
.chip[data-status="completed"] .chip__dot { background: var(--status-completed); }
.chip[data-status="onhold"] .chip__dot { background: var(--status-onhold); }
.chip[data-status="dropped"] .chip__dot { background: var(--status-dropped); }
.chip[data-status="planned"] .chip__dot { background: var(--status-planned); }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.is-active { color: var(--text); }
.chip.is-active .chip__count { background: rgba(255,255,255,.15); color: var(--text); }
[data-theme="light"] .chip.is-active .chip__count { background: rgba(0,0,0,.08); }
.chip.is-active[data-status="all"] { background: var(--accent-dim); border-color: var(--accent-dim); }
.chip.is-active[data-status="watching"] { background: rgba(253, 216, 53, .18); border-color: var(--status-watching); }
.chip.is-active[data-status="completed"] { background: rgba(102, 187, 106, .18); border-color: var(--status-completed); }
.chip.is-active[data-status="onhold"] { background: rgba(255, 112, 67, .18); border-color: var(--status-onhold); }
.chip.is-active[data-status="dropped"] { background: rgba(239, 83, 80, .18); border-color: var(--status-dropped); }
.chip.is-active[data-status="planned"] { background: rgba(66, 165, 245, .18); border-color: var(--status-planned); }
.select {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.select:focus { outline: 0; border-color: var(--accent); }

.view-toggle {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}
.view-toggle__btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 30px;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all var(--transition);
}
.view-toggle__btn i { width: 16px; height: 16px; }
.view-toggle__btn:hover { color: var(--text); }
.view-toggle__btn.is-active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }

/* ============ List view ============ */
.row-list {
  display: flex; flex-direction: column;
  gap: var(--space-2);
}
.row-item {
  display: grid;
  grid-template-columns: 48px 1fr 180px 60px;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.row-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateX(2px);
}
.row-item__cover {
  width: 48px; aspect-ratio: 2/3;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  overflow: hidden;
  flex-shrink: 0;
}
.row-item__cover img { width: 100%; height: 100%; object-fit: cover; }
.row-item__main { min-width: 0; }
.row-item__title {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: 14px; font-weight: 600;
  margin-bottom: var(--space-1);
}
.row-item__title > span:nth-child(2) {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.row-item__dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.row-item__fav { width: 14px; height: 14px; color: #ffd54f; flex-shrink: 0; }
.row-item__meta {
  display: flex; gap: var(--space-3);
  font-size: 11px; color: var(--text-muted);
  flex-wrap: wrap;
}
.row-item__statusLabel {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 10px;
}
.row-item__statusLabel[data-status="watching"] { color: var(--status-watching); }
.row-item__statusLabel[data-status="completed"] { color: var(--status-completed); }
.row-item__statusLabel[data-status="onhold"] { color: var(--status-onhold); }
.row-item__statusLabel[data-status="dropped"] { color: var(--status-dropped); }
.row-item__statusLabel[data-status="planned"] { color: var(--status-planned); }
.row-item__progress {
  display: flex; flex-direction: column; gap: 4px;
}
.row-item__progressBar {
  width: 100%; height: 4px;
  background: var(--bg-elev);
  border-radius: 99px;
  overflow: hidden;
}
.row-item__progressBar span {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.row-item__progressTxt { font-size: 11px; color: var(--text-muted); }
.row-item__score {
  text-align: right;
  font-size: 13px;
}

@media (max-width: 700px) {
  .row-item { grid-template-columns: 44px 1fr auto; }
  .row-item__progress { display: none; }
  .row-item__cover { width: 44px; }
}

/* ============ Grid + Cards ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}
@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: var(--space-5);
  }
}
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.card__poster {
  position: relative;
  aspect-ratio: 2 / 3;
  background: var(--bg-elev);
  overflow: hidden;
}
.card__poster img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.card:hover .card__poster img { transform: scale(1.04); }
.card__status {
  position: absolute; top: 8px; left: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,.5);
}
.card__fav {
  position: absolute; top: 8px; right: 8px;
  color: #ffd54f;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}
.card__fav i { width: 16px; height: 16px; }
.card__seasons {
  position: absolute; bottom: 8px; right: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}
.card__format {
  display: inline-block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.card__format[data-format="MOVIE"] { color: var(--accent); }
.card__format[data-format="OVA"], .card__format[data-format="ONA"], .card__format[data-format="SPECIAL"] { color: var(--status-onhold); }
.card__body { padding: var(--space-3); }
.card__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-1);
}
.card__meta {
  display: flex; gap: var(--space-2);
  font-size: 11px; color: var(--text-dim);
}
.score {
  color: #ffd54f;
  font-weight: 600;
}
.score i { width: 12px; height: 12px; vertical-align: -2px; fill: currentColor; }
.card__progress {
  margin-top: var(--space-2);
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: var(--space-2);
}
.card__progress-bar {
  flex: 1; height: 3px; border-radius: 99px;
  background: var(--bg-elev); overflow: hidden;
}
.card__progress-bar span {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

/* Status dot helpers */
.dot-watching { background: var(--status-watching); }
.dot-completed { background: var(--status-completed); }
.dot-onhold { background: var(--status-onhold); }
.dot-dropped { background: var(--status-dropped); }
.dot-planned { background: var(--status-planned); }

/* ============ Skeletons ============ */
.skel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.skel__poster { aspect-ratio: 2/3; background: linear-gradient(90deg, var(--bg-elev) 0%, var(--bg-card-hover) 50%, var(--bg-elev) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skel__line { height: 10px; border-radius: 4px; background: var(--bg-elev); margin: var(--space-2) var(--space-3); }
.skel__line:first-of-type { width: 80%; }
.skel__line:last-of-type { width: 50%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============ Empty ============ */
.empty {
  margin-top: var(--space-12);
  padding: var(--space-12);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-muted);
}
.empty i { width: 32px; height: 32px; color: var(--text-dim); margin-bottom: var(--space-3); }
.empty p { margin-bottom: var(--space-4); }

/* ============ Detail page ============ */
.detail__banner {
  position: relative;
  margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-4)) 0;
  height: 180px;
  overflow: hidden;
}
@media (min-width: 640px) {
  .detail__banner { margin: calc(-1 * var(--space-8)) calc(-1 * var(--space-6)) 0; height: 240px; }
}
.detail__banner img { width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.detail__banner::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent, var(--bg) 90%);
}
.detail__head {
  position: relative;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-6);
  margin-top: -80px;
  z-index: 1;
}
.detail__discover {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
}
@media (max-width: 640px) {
  .detail__discover { position: static; margin-top: var(--space-3); }
}
@media (max-width: 640px) {
  .detail__head { grid-template-columns: 1fr; margin-top: -40px; }
  .detail__poster { max-width: 160px; margin: 0 auto; }
}
.detail__poster {
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.detail__poster img { width: 100%; height: 100%; object-fit: cover; }
.detail__title { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-bottom: var(--space-2); }
.detail__sub { color: var(--text-muted); margin-bottom: var(--space-4); }
.detail__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.tag { padding: 4px 10px; border-radius: 99px; font-size: 11px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); }
.detail__synopsis {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  line-height: 1.65;
}
.detail__sectionTitle {
  font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin: var(--space-8) 0 var(--space-3);
}

/* User entry panel */
.entry-panel {
  margin-top: var(--space-5);
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-4);
}
.status-picker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.status-pill {
  position: relative;
  padding: 6px 12px 6px 28px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}
.status-pill::before {
  content: '';
  position: absolute;
  left: 12px; top: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  transform: translateY(-50%);
}
.status-pill[data-status="watching"]::before { background: var(--status-watching); }
.status-pill[data-status="completed"]::before { background: var(--status-completed); }
.status-pill[data-status="onhold"]::before { background: var(--status-onhold); }
.status-pill[data-status="dropped"]::before { background: var(--status-dropped); }
.status-pill[data-status="planned"]::before { background: var(--status-planned); }
.status-pill:hover { color: var(--text); border-color: var(--border-strong); }
.status-pill.is-active { color: var(--text); }
.status-pill.is-active[data-status="watching"] { background: rgba(253, 216, 53, .18); border-color: var(--status-watching); }
.status-pill.is-active[data-status="completed"] { background: rgba(102, 187, 106, .18); border-color: var(--status-completed); }
.status-pill.is-active[data-status="onhold"] { background: rgba(255, 112, 67, .18); border-color: var(--status-onhold); }
.status-pill.is-active[data-status="dropped"] { background: rgba(239, 83, 80, .18); border-color: var(--status-dropped); }
.status-pill.is-active[data-status="planned"] { background: rgba(66, 165, 245, .18); border-color: var(--status-planned); }

/* ============ Stats ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.stat__label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: var(--space-2); }
.stat__value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.stat__sub { font-size: 12px; color: var(--text-muted); margin-top: var(--space-1); }

/* ============ Toast ============ */
.toast-host {
  position: fixed; bottom: var(--space-6); right: var(--space-6);
  z-index: 100;
  display: flex; flex-direction: column; gap: var(--space-2);
  pointer-events: none;
}
.toast {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  animation: toastIn 250ms cubic-bezier(.4,0,.2,1);
  pointer-events: auto;
  max-width: 320px;
}
.toast--success { border-color: var(--success); }
.toast--error { border-color: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 200ms ease;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 600px; width: 100%;
  max-height: 85vh;
  display: flex; flex-direction: column;
  animation: modalIn 240ms cubic-bezier(.4,0,.2,1);
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal__head {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.modal__title { font-size: 16px; font-weight: 700; }
.modal__sub { font-size: 13px; color: var(--text-muted); margin-top: var(--space-1); }
.modal__body { padding: var(--space-3); overflow-y: auto; flex: 1; }
.modal__foot {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  display: flex; gap: var(--space-3); justify-content: space-between; align-items: center;
}
.modal__foot-actions { display: flex; gap: var(--space-2); }

.related-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.related-item:hover { background: var(--bg-elev); }
.related-item__cover {
  width: 44px; aspect-ratio: 2/3;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  overflow: hidden;
  flex-shrink: 0;
}
.related-item__cover img { width: 100%; height: 100%; object-fit: cover; }
.related-item__body { flex: 1; min-width: 0; }
.related-item__title {
  font-weight: 600; font-size: 13px; line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.related-item__meta {
  font-size: 11px; color: var(--text-muted);
  display: flex; gap: var(--space-2);
}
.related-item__rel {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
}
.related-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ============ Dropdown ============ */
.menu {
  position: absolute;
  min-width: 180px;
  padding: var(--space-2);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  animation: fadeIn 150ms ease;
}
.menu__item {
  display: flex; align-items: center; gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  text-align: left;
  transition: all 150ms;
}
.menu__item:hover { background: var(--bg-elev); color: var(--text); }
.menu__item i { width: 14px; height: 14px; }
.menu__sep { height: 1px; background: var(--border); margin: var(--space-1) 0; }

/* ============ Utility ============ */
.row { display: flex; gap: var(--space-3); align-items: center; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.center { text-align: center; }
