:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a25;
  --border: #25252f;
  --text: #ffffff;
  --text-muted: #9ca3af;
  --accent: #e50914;
  --accent-2: #ff3d5a;
  --success: #22c55e;
  --nav-h: 68px;
  --top-h: 56px;
}
[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --border: #e0e0e5;
  --text: #111111;
  --text-muted: #666666;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden; overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--text-muted); font-size: 13px; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ============ Announcement ============ */
.announcement {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  text-align: center;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
}
.announcement.info { background: linear-gradient(90deg, #3b82f6, #8b5cf6); }
.announcement.warn { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.announcement + .topbar { top: 40px; }
.announcement + .topbar + #app { padding-top: calc(var(--top-h) + 40px); }

/* ============ Top Bar ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 50;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  will-change: background;
  transition: background 0.25s, top 0.3s;
}
.topbar.solid { background: rgba(10,10,15,0.98); border-bottom: 1px solid var(--border); }
[data-theme="light"] .topbar { background: rgba(245,245,247,0.85); }
[data-theme="light"] .topbar.solid { background: rgba(245,245,247,0.98); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 900; font-size: 16px; color: white;
  box-shadow: 0 4px 14px rgba(229,9,20,0.4);
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.3px; }
.brand-name span { color: var(--accent); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; position: relative;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  transition: transform 0.15s, background 0.15s;
}
.icon-btn:active { transform: scale(0.92); background: rgba(255,255,255,0.1); }
.icon-btn svg { width: 18px; height: 18px; }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}

#app {
  min-height: 100vh; padding-top: var(--top-h);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
.page { display: none; animation: pageIn 0.28s ease-out; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.page-header { padding: 20px 16px 8px; }
.page-header h1 { margin: 0; font-size: 26px; font-weight: 800; }
.page-header .muted { margin: 4px 0 0; }

/* ============ Bottom Nav (no blur — performance) ============ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; justify-content: space-around; align-items: center;
  background: #0a0a0f;
  border-top: 1px solid var(--border); z-index: 60;
  transform: translateZ(0);
  will-change: transform;
}
[data-theme="light"] .bottom-nav { background: #ffffff; }
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 0; color: var(--text-muted);
  font-size: 10px; font-weight: 500; transition: color 0.2s; position: relative;
}
.nav-item svg { width: 22px; height: 22px; transition: transform 0.2s; }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { transform: scale(1.08); }
.nav-item.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 2px; border-radius: 2px; background: var(--accent);
}

/* ============ Hero ============ */
.hero { position: relative; height: 62vh; min-height: 380px; max-height: 620px; overflow: hidden; margin-bottom: 8px; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s; background-size: cover; background-position: center; }
.hero-slide.active { opacity: 1; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 0%, rgba(10,10,15,0.7) 30%, rgba(10,10,15,0.2) 60%, rgba(10,10,15,0.5) 100%); }
.hero-content { position: absolute; bottom: 24px; left: 0; right: 0; padding: 0 20px; z-index: 2; }
.hero-title { font-size: 30px; font-weight: 900; line-height: 1.05; margin: 0 0 8px; letter-spacing: -0.5px; text-shadow: 0 2px 20px rgba(0,0,0,0.6); }
.hero-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: #ddd; margin-bottom: 12px; flex-wrap: wrap; }
.hero-meta .rating { color: #ffd60a; font-weight: 700; }
.hero-actions { display: flex; gap: 10px; }
.hero-btn { flex: 1; max-width: 200px; padding: 12px 20px; border-radius: 12px; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.15s; }
.hero-btn:active { transform: scale(0.96); }
.hero-btn.primary { background: white; color: black; }
.hero-btn.secondary { background: rgba(255,255,255,0.16); color: white; border: 1px solid rgba(255,255,255,0.18); }
.hero-btn svg { width: 18px; height: 18px; }
.hero-dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 3; }
.hero-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.35); transition: all 0.3s; }
.hero-dot.active { width: 20px; border-radius: 4px; background: var(--accent); }

/* ============ Rows ============ */
.rows-container { padding-bottom: 20px; }
.row-section { margin: 22px 0; }
.row-header { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 12px; }
.row-title { font-size: 17px; font-weight: 800; margin: 0; letter-spacing: -0.2px; }
.row-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 8px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }

/* ============ Cards ============ */
.movie-card { flex: 0 0 130px; scroll-snap-align: start; transition: transform 0.15s; cursor: pointer; }
.movie-card:active { transform: scale(0.95); }
.movie-card .poster { position: relative; width: 100%; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; background: var(--surface-2); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.movie-card .poster img { width: 100%; height: 100%; object-fit: cover; }
.movie-card .rating-badge { position: absolute; top: 6px; right: 6px; padding: 3px 7px; background: rgba(0,0,0,0.75); border-radius: 6px; font-size: 10px; font-weight: 700; color: #ffd60a; }
.movie-card .rating-badge::before { content: "★ "; font-size: 9px; }
.movie-card .card-title { margin: 8px 2px 2px; font-size: 12px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.movie-card .card-sub { font-size: 10px; color: var(--text-muted); margin: 0 2px; }
.movie-card.wide { flex: 0 0 240px; }
.movie-card.wide .poster { aspect-ratio: 16/9; }
.movie-card.wide .play-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.25); }
.movie-card.wide .play-overlay svg { width: 44px; height: 44px; color: white; }

/* ============ Skeletons ============ */
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.6s infinite; border-radius: 12px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-card { flex: 0 0 130px; }
.skel-card .skel-poster { width: 100%; aspect-ratio: 2/3; }
.skel-card .skel-line { height: 10px; margin-top: 8px; border-radius: 4px; }
.skel-hero { width: 100%; height: 62vh; border-radius: 0; }

/* ============ Search ============ */
.search-header { padding: 12px 16px 8px; }
.search-box { position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 12px; }
.search-box:focus-within { border-color: var(--accent); }
.search-icon { width: 18px; height: 18px; color: var(--text-muted); }
.search-box input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 15px; padding: 13px 10px; }
.search-box input::placeholder { color: var(--text-muted); }
.clear-btn { width: 24px; height: 24px; border-radius: 50%; background: rgba(128,128,128,0.2); font-size: 16px; display: none; place-items: center; }
.clear-btn.show { display: grid; }

.search-tabs { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.search-tabs::-webkit-scrollbar { display: none; }
.stab { flex-shrink: 0; padding: 7px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 12px; font-weight: 600; }
.stab.active { background: var(--accent); border-color: var(--accent); color: white; }
.filter-btn { flex-shrink: 0; padding: 7px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 12px; font-weight: 600; margin-left: auto; }

.active-filters { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chip-filter { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 12px; background: rgba(229,9,20,0.15); border: 1px solid var(--accent); color: var(--accent); font-size: 11px; font-weight: 600; }
.chip-filter button { color: inherit; font-size: 14px; line-height: 1; }

.search-results { padding: 8px 16px 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-2 .movie-card { flex: initial; }
.search-hint { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.search-hint h3 { color: var(--text); margin: 16px 0 6px; }

/* ============ Library tabs ============ */
.lib-tabs { display: flex; gap: 6px; padding: 0 16px 12px; }
.lib-tab { padding: 8px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 13px; font-weight: 600; }
.lib-tab.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ============ Profile ============ */
.profile-hero { text-align: center; padding: 40px 20px 24px; }
.avatar { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-size: 34px; font-weight: 900; color: white; box-shadow: 0 8px 32px rgba(229,9,20,0.4); overflow: hidden; }
.profile-hero h2 { margin: 0 0 4px; font-size: 20px; }
.profile-hero .muted { margin: 0 0 18px; }

.btn-primary { padding: 12px 32px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(229,9,20,0.35); transition: transform 0.15s; }
.btn-primary:active { transform: scale(0.96); }
.btn-secondary { padding: 12px 24px; border-radius: 12px; background: rgba(128,128,128,0.12); border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: 14px; transition: transform 0.15s; }
.btn-secondary:active { transform: scale(0.96); }

.profile-menu { padding: 8px 16px 20px; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 14px; border-bottom: 1px solid var(--border); font-size: 15px; text-align: left; }
.menu-item span:first-child { font-size: 18px; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 16px; margin-bottom: 20px; }
.stat-big { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.stat-big .stat-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; }
.stat-big .stat-val { font-size: 24px; font-weight: 900; }

/* ============ Empty ============ */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.35; }
.empty-state h3 { margin: 8px 0 4px; }

/* ============ Modals (no blur — performance) ============ */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.22s; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-content { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); padding-bottom: env(safe-area-inset-bottom, 0px); will-change: transform; }
.modal.open .modal-content { transform: translateY(0); }
.modal-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,0.7); display: grid; place-items: center; font-size: 22px; line-height: 1; color: white; z-index: 5; }
[data-theme="light"] .modal-close { background: rgba(255,255,255,0.9); color: black; }

.detail-backdrop { position: relative; width: 100%; aspect-ratio: 16/9; background-size: cover; background-position: center; }
.detail-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg), rgba(10,10,15,0.2) 60%, rgba(10,10,15,0.4)); }
.detail-body { padding: 0 20px 30px; margin-top: -40px; position: relative; z-index: 2; }
.detail-title { font-size: 24px; font-weight: 900; margin: 0 0 8px; letter-spacing: -0.3px; }
.detail-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--text-muted); margin-bottom: 14px; flex-wrap: wrap; }
.detail-meta .chip { padding: 3px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; }
.detail-meta .rating { color: #ffd60a; font-weight: 800; }
.detail-actions { display: flex; gap: 8px; margin-bottom: 18px; }
.detail-actions button { padding: 12px; border-radius: 12px; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: transform 0.15s; }
.detail-actions button:active { transform: scale(0.96); }
.detail-actions .play { flex: 1; background: white; color: black; }
.detail-actions .icon-action { width: 44px; padding: 0; background: rgba(128,128,128,0.12); border: 1px solid var(--border); color: var(--text); }
.detail-actions .icon-action.active { background: var(--accent); border-color: var(--accent); color: white; }
.detail-actions .icon-action svg { width: 20px; height: 20px; }
.detail-overview { font-size: 14px; line-height: 1.65; color: var(--text-muted); margin: 0 0 18px; }
.detail-section-title { font-size: 15px; font-weight: 800; margin: 22px 0 12px; }

/* ============ TV picker ============ */
.tv-picker { margin-bottom: 18px; }
.season-select { width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 14px; margin-bottom: 12px; }
.episode-grid { display: flex; flex-direction: column; gap: 8px; }
.ep-card { display: flex; gap: 10px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: transform 0.15s; }
.ep-card:active { transform: scale(0.98); }
.ep-card.current { border-color: var(--accent); background: rgba(229,9,20,0.08); }
.ep-card .ep-thumb { width: 100px; height: 56px; border-radius: 6px; background: var(--surface-2); object-fit: cover; flex-shrink: 0; }
.ep-card .ep-info { flex: 1; min-width: 0; }
.ep-card .ep-info b { display: block; font-size: 12px; margin-bottom: 3px; }
.ep-card .ep-info small { font-size: 11px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============ Server pick ============ */
.server-pick { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: transform 0.15s; }
.server-pick:active { transform: scale(0.98); }
.server-pick .srv-icon { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; flex-shrink: 0; font-size: 16px; color: white; }
.server-pick.auto .srv-icon { background: linear-gradient(135deg, #3b82f6, #8b5cf6); }
.server-pick .srv-meta { flex: 1; }
.server-pick .srv-meta b { display: block; font-size: 13px; }
.server-pick .srv-meta small { color: var(--text-muted); font-size: 11px; }

/* ============ Reviews ============ */
.review-card { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-weight: 800; font-size: 14px; color: white; }
.review-name { font-size: 13px; font-weight: 700; }
.review-stars { font-size: 11px; color: #ffd60a; }
.review-text { font-size: 13px; line-height: 1.55; color: var(--text-muted); }

.star-row { display: flex; gap: 6px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.star-row .star { font-size: 30px; cursor: pointer; color: #444; transition: color 0.15s; }
.star-row .star.on { color: #ffd60a; }

/* ============ Person modal ============ */
.person-head { display: flex; gap: 14px; padding: 20px; align-items: center; }
.person-head img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; }
.person-head .info h2 { margin: 0 0 4px; font-size: 20px; }
.person-head .info p { margin: 0; font-size: 12px; color: var(--text-muted); }
.person-bio { padding: 0 20px 20px; font-size: 13px; line-height: 1.6; color: var(--text-muted); }

/* ============ Filter sheet ============ */
.filter-sheet { max-height: 90vh; display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.sheet-head .modal-close { position: static; }
.filter-body { padding: 0 20px; overflow-y: auto; flex: 1; }
.sheet-foot { display: flex; gap: 10px; padding: 16px 20px 24px; border-top: 1px solid var(--border); }
.sheet-foot button { flex: 1; }
.genre-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.genre-chip { padding: 7px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; font-weight: 600; transition: all 0.15s; }
.genre-chip.on { background: var(--accent); border-color: var(--accent); color: white; }

/* ============ Player ============ */
.player-modal { background: rgba(0,0,0,0.98); display: flex; align-items: center; justify-content: center; }
.player-wrap { width: 100%; aspect-ratio: 16/9; background: black; position: relative; }
.player-wrap iframe { width: 100%; height: 100%; border: 0; background: black; }
.player-close { position: absolute; top: 20px; right: 20px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.15); color: white; font-size: 24px; line-height: 1; z-index: 10; }
.player-controls { position: absolute; bottom: 20px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 10; }
.pc-title { color: white; font-size: 13px; font-weight: 600; text-shadow: 0 2px 8px rgba(0,0,0,0.8); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-buttons { display: flex; gap: 6px; }
.pc-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.15); color: white; font-size: 16px; display: grid; place-items: center; }
.player-server-list { position: absolute; bottom: 70px; right: 20px; background: rgba(20,20,30,0.98); border: 1px solid var(--border); border-radius: 12px; padding: 8px; max-width: 280px; z-index: 11; }
.player-server-list button { display: block; width: 100%; padding: 8px 12px; text-align: left; font-size: 12px; color: white; border-radius: 6px; white-space: nowrap; }
.player-server-list button.active { background: var(--accent); }
.sleep-timer-panel { position: absolute; bottom: 70px; right: 20px; background: rgba(20,20,30,0.98); border: 1px solid var(--border); border-radius: 12px; padding: 8px; display: flex; gap: 6px; z-index: 11; }
.sleep-timer-panel button { padding: 8px 12px; font-size: 12px; color: white; border-radius: 6px; background: rgba(255,255,255,0.1); }

/* ============ Share ============ */
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0; }
.share-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 11px; color: var(--text); transition: transform 0.15s; }
.share-btn:active { transform: scale(0.95); }
.share-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: white; font-weight: 900; font-size: 18px; }

/* ============ Notifications ============ */
.notif-content { max-height: 80vh; display: flex; flex-direction: column; }
.notif-list { flex: 1; overflow-y: auto; padding: 0 16px; }
.notif-item { padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.notif-item.unread { border-color: var(--accent); }
.notif-item .n-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.notif-item .n-msg { font-size: 12px; color: var(--text-muted); }
.notif-item .n-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* ============ Auth box ============ */
.auth-modal-content { max-width: 480px; margin: 0 auto; border-radius: 24px 24px 0 0; }
.auth-box { padding: 40px 28px 32px; text-align: center; }
.auth-box h2 { margin: 0 0 6px; font-size: 22px; }
.auth-box .muted { margin-bottom: 28px; }
.form-group { text-align: left; margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 13px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 14px; outline: none; transition: border-color 0.15s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
.auth-submit { width: 100%; margin-top: 8px; padding: 14px; font-size: 15px; }
.auth-switch { font-size: 13px; color: var(--text-muted); margin: 20px 0 0; }
.auth-switch button { color: var(--accent); font-weight: 700; margin-left: 4px; }
.auth-logo { width: 56px; height: 56px; font-size: 26px; margin: 0 auto 16px; }

/* ============ Admin ============ */
.admin-tabs { display: flex; gap: 6px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { flex-shrink: 0; padding: 8px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 13px; font-weight: 600; transition: all 0.15s; }
.admin-tab.active { background: var(--accent); border-color: var(--accent); color: white; }
.admin-content { padding: 0 16px 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.stat-card .stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 26px; font-weight: 900; }

.admin-form-card { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; }
.admin-form-card h3 { margin: 0 0 14px; font-size: 15px; font-weight: 800; }
.admin-form-card .form-group { margin-bottom: 10px; }
.admin-form-card .form-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
.admin-form-card .form-group input, .admin-form-card .form-group select, .admin-form-card .form-group textarea { width: 100%; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 13px; outline: none; transition: border-color 0.15s; }
.admin-form-card .form-group input:focus, .admin-form-card .form-group select:focus { border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.srv-preview { display: flex; gap: 10px; padding: 10px; background: var(--surface-2); border-radius: 10px; margin: 8px 0; }
.srv-preview img { width: 44px; height: 66px; border-radius: 6px; object-fit: cover; }
.srv-preview .info b { display: block; font-size: 13px; margin-bottom: 2px; }
.srv-preview .info small { color: var(--text-muted); font-size: 11px; }

.srv-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.srv-item .srv-info { flex: 1; min-width: 0; }
.srv-item .srv-info b { display: block; font-size: 13px; margin-bottom: 3px; }
.srv-item .srv-info small { color: var(--text-muted); font-size: 11px; }
.srv-item .srv-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.srv-item .srv-del { width: 30px; height: 30px; border-radius: 8px; background: rgba(229,9,20,0.15); border: 1px solid var(--accent); color: #ff6b74; font-size: 16px; flex-shrink: 0; }

.admin-item { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.admin-item .item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 10px; }
.admin-item .item-title { font-weight: 700; font-size: 14px; }
.admin-item .item-meta { font-size: 12px; color: var(--text-muted); }
.admin-item .item-body { font-size: 13px; color: var(--text-muted); margin-top: 6px; word-break: break-word; }
.admin-item .item-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.chip-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.chip-badge.admin { background: var(--accent); color: white; }
.chip-badge.mod { background: #3b82f6; color: white; }
.chip-badge.pending { background: #f59e0b; color: black; }
.chip-badge.resolved { background: var(--success); color: black; }

.btn-sm { padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); transition: transform 0.15s; }
.btn-sm:active { transform: scale(0.95); }
.btn-sm.danger { background: rgba(229,9,20,0.15); border-color: var(--accent); color: #ff6b74; }
.btn-sm.success { background: rgba(34,197,94,0.15); border-color: var(--success); color: var(--success); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.toggle-row .toggle-label { font-size: 14px; font-weight: 600; }
.toggle-row .toggle-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.toggle { position: relative; width: 46px; height: 26px; flex-shrink: 0; background: var(--surface-2); border-radius: 13px; border: 1px solid var(--border); cursor: pointer; transition: background 0.25s; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #666; transition: all 0.25s; }
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on::after { left: 22px; background: white; }

/* ============ Library list card ============ */
.lib-card { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; cursor: pointer; transition: transform 0.15s; }
.lib-card:active { transform: scale(0.98); }
.lib-card .lc-info { flex: 1; }
.lib-card .lc-info b { display: block; font-size: 14px; margin-bottom: 3px; }
.lib-card .lc-info small { font-size: 11px; color: var(--text-muted); }
.lib-card .lc-badge { font-size: 11px; color: var(--text-muted); }

/* ============ Add to list ============ */
.at-list { max-height: 300px; overflow-y: auto; margin-bottom: 10px; }
.at-list .at-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; cursor: pointer; transition: all 0.15s; }
.at-list .at-item.on { border-color: var(--accent); background: rgba(229,9,20,0.08); }

/* ============ Downloads ============ */
.dl-item { display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.dl-item .dl-poster { width: 60px; height: 90px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.dl-item .dl-info { flex: 1; min-width: 0; }
.dl-item .dl-info b { display: block; font-size: 13px; margin-bottom: 4px; }
.dl-item .dl-info small { font-size: 11px; color: var(--text-muted); }
.dl-item .dl-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ============ Toast ============ */
.toast { position: fixed; bottom: calc(var(--nav-h) + 20px); left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(30,30,45,0.98); color: white; padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); box-shadow: 0 8px 30px rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 200; white-space: nowrap; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
[data-theme="light"] .toast { background: rgba(255,255,255,0.98); color: black; border-color: #ddd; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ============ Info banner ============ */
.info-banner { padding: 12px; background: rgba(59,130,246,0.12); border: 1px solid #3b82f6; color: #93c5fd; border-radius: 10px; font-size: 12px; margin-bottom: 12px; }

/* ============ Person card ============ */
.person-card { flex: 0 0 110px; text-align: center; cursor: pointer; transition: transform 0.15s; }
.person-card:active { transform: scale(0.95); }
.person-card .pc-avatar { width: 110px; height: 110px; border-radius: 50%; overflow: hidden; background: var(--surface-2); margin-bottom: 8px; display: grid; place-items: center; font-size: 30px; }
.person-card .pc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-card .pc-name { font-size: 12px; font-weight: 600; }
.person-card .pc-role { font-size: 10px; color: var(--text-muted); }

/* ============ Responsive ============ */
@media (min-width: 768px) {
  .bottom-nav { max-width: 640px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
  #app, .topbar { max-width: 640px; left: 50%; transform: translateX(-50%); }
  .topbar { width: 100%; }
  .grid-2 { grid-template-columns: repeat(3, 1fr); }
}