/* ========== Watch Log 2.0 — Design System ========== */
:root {
  --bg: #0a0910;
  --bg-deep: #06050a;
  --bg-elevated: #12101a;
  --surface: #16141f;
  --surface-2: #1e1b28;
  --surface-3: #282433;
  --surface-hover: #2e2a3a;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);
  --text: #f4f0e8;
  --text-dim: #a39bb3;
  --text-faint: #6b6478;
  --text-inverse: #0a0910;

  --accent: #f2a154;
  --accent-hover: #f5b06e;
  --accent-soft: rgba(242,161,84,0.12);
  --accent-glow: rgba(242,161,84,0.25);

  --watching: #f2a154;
  --watching-soft: rgba(242,161,84,0.12);
  --completed: #7ecf9a;
  --completed-soft: rgba(126,207,154,0.12);
  --plan: #7ba3e0;
  --plan-soft: rgba(123,163,224,0.12);
  --dropped: #e07a6b;
  --dropped-soft: rgba(224,122,107,0.12);

  --watched: #5ec4cf;
  --rating: #c4a8f0;
  --score-chip: #e8c468;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow: 0 8px 32px rgba(0,0,0,0.45);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.55);
  --shadow-glow: 0 0 40px var(--accent-glow);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-display: 'Bebas Neue', system-ui, sans-serif;
  --font-body: 'Work Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --header-h: 64px;
  --nav-h: 52px;
  --bottom-nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
  --bg: #f7f3eb;
  --bg-deep: #efe9dd;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f0e6;
  --surface-3: #ebe4d6;
  --surface-hover: #e4dccb;
  --border: rgba(40,30,20,0.08);
  --border-strong: rgba(40,30,20,0.14);
  --text: #1a1620;
  --text-dim: #5c5468;
  --text-faint: #8f8799;
  --text-inverse: #f7f3eb;
  --shadow-sm: 0 2px 8px rgba(60,50,30,0.08);
  --shadow: 0 8px 28px rgba(60,50,30,0.1);
  --shadow-lg: 0 16px 40px rgba(60,50,30,0.14);
  --shadow-glow: 0 0 30px rgba(242,161,84,0.15);
}

[data-accent] {
  --accent: var(--user-accent, #f2a154);
  --accent-hover: color-mix(in srgb, var(--accent) 85%, white);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 25%, transparent);
  --watching: var(--accent);
  --watching-soft: var(--accent-soft);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, var(--accent-soft), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(123,163,224,0.06), transparent 45%),
    linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 40%, var(--bg-deep) 100%);
}
@media (prefers-reduced-motion: no-preference) {
  body::before { animation: ambientShift 28s ease-in-out infinite alternate; }
}
@keyframes ambientShift {
  0% { opacity: 1; }
  100% { opacity: 0.85; transform: scale(1.03); }
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}
button { cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px calc(var(--bottom-nav-h) + 32px);
}
@media (min-width: 768px) {
  .wrap { padding: 28px 28px 80px; }
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  letter-spacing: 1.5px;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.brand-logo {
  height: 40px;
  width: auto;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
.tagline {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 4px;
}
.stats-line {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 8px;
  letter-spacing: 0.2px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.stats-line strong {
  color: var(--accent);
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.15s var(--ease), background 0.15s, box-shadow 0.15s, filter 0.15s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-ghost {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}
.btn-small {
  padding: 7px 12px;
  font-size: 0.82rem;
  border-radius: 7px;
}
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1.05rem;
}

.top-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.top-nav::-webkit-scrollbar { display: none; }
.nav-link {
  flex: 1;
  min-width: max-content;
  text-align: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 560;
  color: var(--text-dim);
  transition: all 0.2s var(--ease);
  text-decoration: none !important;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tab {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 560;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: all 0.18s var(--ease);
  cursor: pointer;
}
.tab:hover { border-color: var(--border-strong); color: var(--text); }
.tab.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}
.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.sort-select, .search-mine {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.84rem;
  color: var(--text);
  transition: border-color 0.15s;
}
.sort-select:focus, .search-mine:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-mine {
  min-width: 160px;
  flex: 1;
  max-width: 240px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
}
.grid.compact-view {
  grid-template-columns: 1fr;
  gap: 10px;
}
.grid.compact-view .card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
.grid.compact-view .card-banner { display: none; }
.grid.compact-view .card-body { flex: 1; padding: 12px 14px; }
.grid.compact-view .poster { width: 64px; height: 96px; border-radius: var(--radius-sm); }
.grid.compact-view .card-collapsible { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s;
  position: relative;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card.card-enter {
  animation: cardEnter 0.45s var(--ease) both;
}
.card.card-pulse {
  animation: cardPulse 0.6s var(--ease);
}
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes cardPulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  40% { box-shadow: 0 0 0 4px var(--accent-glow); }
}

.card-banner {
  height: 90px;
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
  background-size: cover;
  background-position: center;
  position: relative;
}
.card-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, var(--surface) 100%);
}

.card-body {
  padding: 0 16px 16px;
  position: relative;
}
.card-top {
  display: flex;
  gap: 14px;
  margin-top: -36px;
  margin-bottom: 12px;
  align-items: flex-end;
}
.poster, .poster-fallback {
  width: 72px;
  height: 108px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-3);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  border: 2px solid var(--surface);
}
.poster-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}
.card-meta {
  flex: 1;
  min-width: 0;
  padding-bottom: 2px;
}
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--accent); }

.card-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.status-select {
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 24px 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a39bb3' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  cursor: pointer;
}
.status-select:focus { border-color: var(--accent); }

.progress-bar-wrap {
  height: 4px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #5ec4cf));
  border-radius: 99px;
  transition: width 0.4s var(--ease);
}
.progress-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
}
.rating-bars {
  display: flex;
  gap: 2px;
}
.rating-bar {
  width: 10px;
  height: 16px;
  border-radius: 2px;
  background: var(--surface-3);
  transition: background 0.12s, transform 0.12s;
  padding: 0;
}
.rating-bar:hover { transform: scaleY(1.15); }
.rating-bar.filled { background: var(--rating); }
.rating-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 42px;
}

.quick-bump {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius-sm);
  margin: 10px 0;
}
.quick-bump-label {
  font-size: 0.8rem;
  font-weight: 560;
  color: var(--accent);
}
.quick-bump-btn {
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 0.75rem;
  font-weight: 650;
  padding: 5px 12px;
  border-radius: 6px;
  transition: filter 0.15s;
}
.quick-bump-btn:hover { filter: brightness(1.1); }

.details-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 0;
  font-size: 0.82rem;
  font-weight: 560;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  margin-top: 8px;
  transition: color 0.15s;
}
.details-toggle:hover { color: var(--text); }
.chevron {
  transition: transform 0.25s var(--ease);
  font-size: 0.9rem;
}
.details-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.card-collapsible {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}
.card-collapsible.open { max-height: 2000px; }
.collapsible-inner { padding-top: 12px; }

.section-label {
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.seasons { display: flex; flex-direction: column; gap: 12px; }
.season {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.season-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}
.season-label {
  font-weight: 650;
  font-size: 0.88rem;
}
.season-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}
.ep-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ep {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  color: var(--text-dim);
  transition: all 0.12s;
  cursor: pointer;
  border: 1px solid transparent;
}
.ep:hover { border-color: var(--border-strong); color: var(--text); }
.ep.watched {
  background: var(--watched);
  color: var(--text-inverse);
}
.ep.pop { animation: epPop 0.35s var(--ease-spring); }
@keyframes epPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.notes-input, .tag-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.86rem;
  resize: vertical;
  min-height: 64px;
  transition: border-color 0.15s;
}
.notes-input:focus, .tag-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.tag-input { min-height: auto; margin-top: 6px; }
.tag-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 560;
  background: var(--surface-3);
  color: var(--text-dim);
}
.tag-chip { background: var(--accent-soft); color: var(--accent); }
.tag-remove {
  font-size: 0.9rem;
  line-height: 1;
  opacity: 0.7;
  padding: 0 2px;
}
.tag-remove:hover { opacity: 1; }

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.mal-link {
  font-size: 0.8rem;
  font-weight: 560;
}
.remove-btn {
  font-size: 0.8rem;
  color: var(--dropped);
  font-weight: 560;
  opacity: 0.8;
}
.remove-btn:hover { opacity: 1; }

.empty-state {
  text-align: center;
  padding: 60px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 1px;
  margin: 0 0 8px;
  color: var(--text);
}
.empty-state p {
  color: var(--text-dim);
  margin: 0 0 20px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6,5,10,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s;
}
.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 80px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s var(--ease);
}
.modal-backdrop.open .modal {
  transform: none;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.3rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover {
  background: var(--surface-3);
  color: var(--text);
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.search-box {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.95rem;
  margin-bottom: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-hint {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin: 0 0 12px;
}
.results-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}
.result-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
}
.result-item:hover, .result-item:focus {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.result-poster {
  width: 44px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}
.result-info { flex: 1; min-width: 0; }
.result-title {
  font-weight: 650;
  font-size: 0.9rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-meta {
  font-size: 0.75rem;
  color: var(--text-faint);
}
.mini-toggle {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.84rem;
  font-weight: 560;
  color: var(--text-dim);
}
.mini-toggle:hover { color: var(--accent); }
.mini-form {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.mini-form.open { display: flex; }
.mini-form label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  display: block;
  margin-bottom: 4px;
}
.mini-form input, .mini-form textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.88rem;
}
.row { display: flex; gap: 8px; align-items: center; }

.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 560;
  box-shadow: var(--shadow);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease);
  max-width: 90vw;
  text-align: center;
}
@media (min-width: 768px) {
  .toast { bottom: 32px; }
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 500;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (max-width: 767px) {
  .bottom-nav { display: flex; }
  .top-nav { display: none; }
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-faint);
  text-decoration: none !important;
  transition: color 0.15s;
  padding: 6px 0;
}
.bottom-nav a.active { color: var(--accent); }
.bottom-nav .nav-icon { font-size: 1.25rem; line-height: 1; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.5px;
  color: var(--accent);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 4px;
  font-weight: 560;
}
.chart-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.chart-section h3 {
  margin: 0 0 16px;
  font-size: 0.95rem;
  font-weight: 700;
}
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}
.bar-label { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track {
  height: 8px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.5s var(--ease);
}
.bar-count { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-faint); text-align: right; }

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.schedule-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 120px;
}
.schedule-day.today {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.schedule-day-label {
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 10px;
  color: var(--text-dim);
}
.schedule-day.today .schedule-day-label { color: var(--accent); }
.schedule-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.schedule-item:last-child { border-bottom: none; }
.schedule-item-title {
  display: block;
  font-weight: 600;
  font-size: 0.84rem;
  margin-bottom: 2px;
}
.schedule-item-meta {
  font-size: 0.74rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.schedule-empty {
  color: var(--text-faint);
  font-size: 0.85rem;
  margin: 0;
}

.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.discover-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.discover-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.discover-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: var(--surface-3);
}
.discover-info { padding: 10px 12px; }
.discover-title {
  font-weight: 650;
  font-size: 0.86rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.discover-score {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--score-chip);
  margin-top: 4px;
}

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.settings-section h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.settings-section p {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: var(--text-dim);
}
.theme-toggle-row, .accent-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.theme-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 560;
  font-size: 0.88rem;
  transition: all 0.15s;
}
.theme-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.accent-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.accent-swatch:hover { transform: scale(1.1); }
.accent-swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg); }

.search-status {
  font-size: 0.86rem;
  color: var(--text-faint);
  text-align: center;
  padding: 20px;
}
.airing-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--plan-soft);
  color: var(--plan);
  font-family: var(--font-mono);
}
.description-zone {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 8px 0;
}
.description-zone.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.no-seasons, .discovering-note {
  font-size: 0.84rem;
  color: var(--text-faint);
  margin: 0;
}
.add-season-zone { margin-top: 8px; }
.notes-zone, .tags-zone { margin-top: 14px; }

.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: 0.5; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Compatibility with existing JS-generated markup */
.empty-state .big {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 1px;
  margin: 0 0 8px;
  color: var(--text);
}
.card-meta-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.rating { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.rating-text { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); min-width: 42px; }
.drag-handle { cursor: grab; opacity: 0.4; font-size: 0.9rem; }
.drag-handle:hover { opacity: 0.8; }
.body-spacer { height: 4px; }
.status-pill {
  font-size: 0.72rem;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.bottom-nav a.nav-link-bottom {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-faint);
  text-decoration: none !important;
  transition: color 0.15s;
  padding: 6px 0;
}
.bottom-nav a.nav-link-bottom.active { color: var(--accent); }

.empty-state {
  max-width: 480px;
  margin: 20px auto;
}
.grid:has(.empty-state) {
  display: block;
}
/* Ensure status tabs look good */
.tab[data-status="watching"].active { --tab-color: var(--watching); }
.tab[data-status="completed"].active { --tab-color: var(--completed); }
.tab[data-status="plan"].active { --tab-color: var(--plan); }
.tab[data-status="dropped"].active { --tab-color: var(--dropped); }
