/* ==========================================================================
   YORU Design System — Sumi-e Night & Moonlit Amber (60/30/10, Anti-Slop v9)
   60% Canvas:   #0B0B0D (Warm Sumi-e Night Ink)
   30% Surfaces: #141418 / #1C1C22 (Japanese Cedar Slate & Lacquer Panels)
   10% Accent:   #E89B3C (Warm Lantern Amber / Moonlit Gold)
   ========================================================================== */

:root {
  --bg-canvas: #0B0B0D;
  --bg-surface: #141418;
  --bg-elevated: #1C1C22;
  --bg-hover: #24242C;

  --border: #26262F;
  --border-strong: #373743;
  --border-accent: rgba(232, 155, 60, 0.44);

  --text-primary: #F3F1ED;
  --text-secondary: #A3A09A;
  --text-muted: #706D68;

  --accent: #E89B3C;
  --accent-hover: #D68829;
  --accent-ink: #120E08;
  --accent-soft: rgba(232, 155, 60, 0.14);
  --accent-border: rgba(232, 155, 60, 0.44);

  --header-bg: rgba(11, 11, 13, 0.9);
  --hero-overlay: linear-gradient(95deg, rgba(11, 11, 13, 0.94) 0%, rgba(11, 11, 13, 0.74) 60%, rgba(11, 11, 13, 0.56) 100%);
  --cover-grad: linear-gradient(125deg, #211912 0%, #141418 52%, #251C13 100%);
  --cover-fade: linear-gradient(transparent, rgba(20, 20, 24, 0.88));

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;

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

  --header-h: 64px;
  --container-max: 1360px;
  --shadow-menu: 0 16px 36px rgba(0, 0, 0, 0.56);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.72);
}

/* Тема: Светлая (Тёплая бумага и медь) */
:root[data-theme="light"] {
  --bg-canvas: #F4F2EC;
  --bg-surface: #FFFFFF;
  --bg-elevated: #ECE9E0;
  --bg-hover: #E3DFD4;

  --border: #DFDBD0;
  --border-strong: #C9C3B5;
  --border-accent: rgba(196, 117, 24, 0.45);

  --text-primary: #181715;
  --text-secondary: #534F48;
  --text-muted: #7C776E;

  --accent: #C97A1B;
  --accent-hover: #B26912;
  --accent-ink: #FFFDF9;
  --accent-soft: rgba(201, 122, 27, 0.12);
  --accent-border: rgba(201, 122, 27, 0.42);

  --header-bg: rgba(244, 242, 236, 0.9);
  --hero-overlay: linear-gradient(95deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.82) 60%, rgba(255, 255, 255, 0.62) 100%);
  --cover-grad: linear-gradient(125deg, #EAE3D5 0%, #F5F2EB 52%, #E8DFCE 100%);
  --cover-fade: linear-gradient(transparent, rgba(255, 255, 255, 0.86));
  --shadow-menu: 0 14px 32px rgba(24, 23, 21, 0.14);
  --shadow-modal: 0 24px 60px rgba(24, 23, 21, 0.22);
}

/* Тема: AMOLED (Кинотеатр) */
:root[data-theme="amoled"] {
  --bg-canvas: #000000;
  --bg-surface: #0D0D10;
  --bg-elevated: #16161B;
  --bg-hover: #1E1E25;

  --border: #202028;
  --border-strong: #32323E;
  --border-accent: rgba(240, 168, 72, 0.46);

  --text-primary: #F6F4F0;
  --text-secondary: #A6A39D;
  --text-muted: #6E6B66;

  --accent: #F0A848;
  --accent-hover: #DC9434;
  --accent-ink: #0F0B06;
  --accent-soft: rgba(240, 168, 72, 0.14);
  --accent-border: rgba(240, 168, 72, 0.46);

  --header-bg: rgba(0, 0, 0, 0.92);
  --hero-overlay: linear-gradient(95deg, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.78) 60%, rgba(0, 0, 0, 0.58) 100%);
  --cover-grad: linear-gradient(125deg, #19120B 0%, #0D0D10 52%, #1D150D 100%);
  --cover-fade: linear-gradient(transparent, rgba(13, 13, 16, 0.92));
}

/* Тема: Сакура (Тёмная роза) */
:root[data-theme="sakura"] {
  --bg-canvas: #120D10;
  --bg-surface: #1B1418;
  --bg-elevated: #251C22;
  --bg-hover: #30242C;

  --border: #33262F;
  --border-strong: #473642;
  --border-accent: rgba(230, 126, 150, 0.48);

  --text-primary: #F7EFF2;
  --text-secondary: #B8A5AE;
  --text-muted: #84707A;

  --accent: #E67E96;
  --accent-hover: #D66983;
  --accent-ink: #1B0D12;
  --accent-soft: rgba(230, 126, 150, 0.15);
  --accent-border: rgba(230, 126, 150, 0.48);

  --header-bg: rgba(18, 13, 16, 0.9);
  --hero-overlay: linear-gradient(95deg, rgba(18, 13, 16, 0.94) 0%, rgba(18, 13, 16, 0.76) 60%, rgba(18, 13, 16, 0.56) 100%);
  --cover-grad: linear-gradient(125deg, #2A1821 0%, #1B1418 52%, #2B1A24 100%);
  --cover-fade: linear-gradient(transparent, rgba(27, 20, 24, 0.9));
}

/* Тема: Матча (Лесная ночь) */
:root[data-theme="matcha"] {
  --bg-canvas: #0B110E;
  --bg-surface: #131C18;
  --bg-elevated: #1B2722;
  --bg-hover: #24332C;

  --border: #25352E;
  --border-strong: #364B42;
  --border-accent: rgba(75, 184, 134, 0.46);

  --text-primary: #EFF5F2;
  --text-secondary: #9FB3A9;
  --text-muted: #6C8076;

  --accent: #4BB886;
  --accent-hover: #3BA373;
  --accent-ink: #08150F;
  --accent-soft: rgba(75, 184, 134, 0.15);
  --accent-border: rgba(75, 184, 134, 0.46);

  --header-bg: rgba(11, 17, 14, 0.9);
  --hero-overlay: linear-gradient(95deg, rgba(11, 17, 14, 0.94) 0%, rgba(11, 17, 14, 0.76) 60%, rgba(11, 17, 14, 0.56) 100%);
  --cover-grad: linear-gradient(125deg, #13251D 0%, #131C18 52%, #172B21 100%);
  --cover-fade: linear-gradient(transparent, rgba(19, 28, 24, 0.9));
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
  color: var(--text-primary);
  overflow-x: hidden;
}

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

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

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

.tabular {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Header — Strictly top: 0
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--container-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 8px 13px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  font-weight: 600;
}

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

/* ==========================================================================
   Notifications Bell & Popover
   ========================================================================== */
.notif-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notif-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.notif-btn:hover,
.notif-wrap.open .notif-btn {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-canvas);
}

.notif-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 390px;
  max-width: calc(100vw - 24px);
  max-height: 480px;
  display: none;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-menu);
  z-index: 140;
  overflow: hidden;
}

.notif-wrap.open .notif-popover {
  display: flex;
}

.notif-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notif-head-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.notif-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notif-item {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 11px;
  align-items: flex-start;
  transition: background 0.14s ease;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item.unread {
  background: rgba(232, 155, 60, 0.06);
  box-shadow: inset 3px 0 0 var(--accent);
}

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

.notif-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.notif-author {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-action-hint {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-secondary);
}

.notif-time {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.notif-anime-title {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 8px;
}

.notif-quote {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-muted);
  padding: 6px 10px;
  margin: 0 0 8px;
  border-left: 2px solid var(--border-strong);
  background: var(--bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-reason {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-primary);
  margin: 0 0 10px;
}

.notif-reason strong {
  color: var(--accent);
}

/* ==========================================================================
   Admin Panel, Role Badges & Warnings
   ========================================================================== */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  line-height: 1.3;
}

.friend-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  line-height: 1.3;
}

.user-link {
  cursor: pointer;
  transition: color 0.14s ease;
}

.user-link:hover {
  color: var(--accent);
}

/* Profile Comments List */
.profile-comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-comment-card {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  align-items: flex-start;
}

.profile-comment-poster {
  width: 52px;
  height: 76px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  flex-shrink: 0;
  cursor: pointer;
}

.profile-comment-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-comment-body {
  flex: 1;
  min-width: 0;
}

.profile-comment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.profile-comment-anime {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: color 0.14s ease;
}

.profile-comment-anime:hover {
  color: var(--accent);
}

.profile-comment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.profile-comment-votes {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Friends Grid & Incoming Requests */
.friends-subsection-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.friend-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.friend-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.friend-card-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-card-main:hover .friend-card-name {
  color: var(--accent);
}

.friend-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}

.friend-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.status-pill.warned {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.status-pill.banned {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-user-row {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-user-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 260px;
}

.admin-user-info {
  min-width: 0;
}

.admin-user-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-user-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-all;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.warning-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.warning-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.warning-card.inactive {
  opacity: 0.55;
}

@media (max-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.notif-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notif-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}

.header-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-md);
  padding: 3px 10px 3px 4px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.header-profile-btn:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.header-profile-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   Buttons & Inputs (Calibrated Geometry, Zero Colored Glow)
   ========================================================================== */
.btn-primary,
.btn-secondary,
.btn-ghost,
.icon-btn,
.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  margin: 0;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary,
.upload-btn {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover,
.upload-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-secondary.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0 12px;
  height: 38px;
}

.btn-ghost:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
}

.icon-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.full-width {
  width: 100%;
}

.field-input,
.field-textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.field-input {
  height: 42px;
  padding: 0 14px;
}

.field-textarea {
  padding: 12px 14px;
  resize: vertical;
  min-height: 92px;
  line-height: 1.5;
}

.field-input:focus,
.field-textarea:focus {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

/* ==========================================================================
   Custom JS Dropdowns (No Native Select)
   ========================================================================== */
.dropdown {
  position: relative;
  display: inline-block;
  min-width: 156px;
}

.dropdown-trigger {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-align: left;
}

.dropdown-trigger:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.dropdown.open .dropdown-trigger {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.dropdown-trigger.accent-filled {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.dropdown-trigger.accent-filled:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.dropdown-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-chevron {
  flex-shrink: 0;
  transition: transform 0.18s ease;
  opacity: 0.78;
}

.dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-width: 280px;
  max-height: 290px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: var(--shadow-menu);
  z-index: 120;
  display: none;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown.align-right .dropdown-menu {
  left: auto;
  right: 0;
}

.dropdown-option {
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.12s ease, color 0.12s ease;
}

.dropdown-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.dropdown-option.selected {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 2px;
}

/* ==========================================================================
   Avatars
   ========================================================================== */
.avatar-circle {
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  user-select: none;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-circle.sm { width: 30px; height: 30px; font-size: 12.5px; }
.avatar-circle.md { width: 40px; height: 40px; font-size: 15px; }
.avatar-circle.xs { width: 30px; height: 30px; font-size: 12px; }
.avatar-circle.xl { width: 112px; height: 112px; font-size: 38px; border: 4px solid var(--bg-surface); }

/* ==========================================================================
   Mobile Drawer
   ========================================================================== */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 150;
  display: none;
}

.mobile-drawer-backdrop.open {
  display: block;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 84vw;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  z-index: 160;
  display: flex;
  flex-direction: column;
  padding: 16px;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-link {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.drawer-link.active,
.drawer-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.drawer-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Main Layout & Sections
   ========================================================================== */
.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.section-block {
  margin-top: 40px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.section-link:hover {
  color: var(--accent);
}

/* ==========================================================================
   Auth Cards & 6-Digit OTP Input
   ========================================================================== */
.auth-page-wrap {
  max-width: 460px;
  margin: 36px auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 22px;
}

.auth-tab {
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.auth-heading {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.auth-lead {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.5;
}

.auth-error {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
  display: none;
}

.auth-error.show {
  display: block;
}

.auth-info-box {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.auth-link-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 13px;
}

.text-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.text-link-btn:hover {
  text-decoration: underline;
}

.otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 18px 0 20px;
}

.otp-cell {
  width: 100%;
  height: 52px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.otp-cell:focus {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

/* ==========================================================================
   Home Hero Banner
   ========================================================================== */
.home-hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  min-height: 360px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 32px;
  align-items: center;
  padding: 36px 40px;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(0.85);
  opacity: 0.24;
  transform: scale(1.1);
  pointer-events: none;
}

.home-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  pointer-events: none;
}

.home-hero-content,
.home-hero-poster {
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  max-width: 680px;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.hero-desc {
  margin: 14px 0 22px;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 620px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-hero-poster {
  width: 210px;
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  justify-self: end;
}

.home-hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Unboxed Anime Cards & Horizontal Rails
   ========================================================================== */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 24px 18px;
}

.anime-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 178px;
  gap: 16px;
  overflow-x: auto;
  padding-top: 6px;
  margin-top: -6px;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.anime-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.anime-poster-frame {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: border-color 0.18s ease, transform 0.2s ease;
}

.anime-card:hover .anime-poster-frame {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.anime-poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.anime-card:hover .anime-poster-frame img {
  transform: scale(1.03);
}

.card-badge-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: flex-start;
  pointer-events: none;
}

.card-badge-top.has-fav {
  right: 40px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: rgba(11, 11, 13, 0.88);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
}

.tag-badge.accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 700;
}

.tag-badge.anons {
  background: rgba(20, 17, 13, 0.92);
  color: var(--accent);
  border-color: var(--border-accent);
  font-weight: 700;
}

.card-fav-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(11, 11, 13, 0.86);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.card-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(transparent, rgba(11, 11, 13, 0.94));
  padding: 18px 8px 8px;
}

.card-progress-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.progress-track {
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
}

.anime-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.32;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.anime-card:hover .anime-card-title {
  color: var(--accent);
}

.anime-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Catalog Toolbar & Genre Filter System
   ========================================================================== */
.catalog-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-search {
  flex: 1 1 260px;
  min-width: 220px;
}

.genre-filter-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: none;
}

.genre-filter-panel.open {
  display: block;
}

.genre-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.genre-search-input {
  max-width: 260px;
  height: 36px;
  padding: 0 12px;
}

.genre-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
}

.genre-chip {
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
}

.genre-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.genre-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.active-filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.catalog-summary {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

/* ==========================================================================
   Schedule View (Японский эфир по дням недели)
   ========================================================================== */
.schedule-days-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.day-tab {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.day-tab:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.day-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.day-count {
  font-size: 12px;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
}

.schedule-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.schedule-item {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.schedule-item:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.schedule-thumb {
  width: 68px;
  height: 98px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.schedule-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.schedule-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.schedule-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.schedule-meta {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.schedule-ep-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-top: 8px;
}

/* ==========================================================================
   Profile Page (Tall Cover Banner + Watch Time Stats + Lists)
   ========================================================================== */
.profile-banner-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.profile-cover {
  height: clamp(220px, 26vw, 340px);
  background: var(--cover-grad);
  position: relative;
  overflow: hidden;
}

.profile-cover-blur {
  position: absolute;
  inset: -16px;
  background-size: cover;
  background-position: center;
  filter: blur(22px) brightness(0.45);
  transform: scale(1.08);
  pointer-events: none;
}

.profile-cover-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-cover.fit-contain .profile-cover-img {
  object-fit: contain;
}

.profile-cover::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 92px;
  z-index: 2;
  background: var(--cover-fade);
  pointer-events: none;
}

/* Live Banner Preview inside Edit Profile Modal */
.banner-preview-box {
  width: 100%;
  aspect-ratio: 16 / 5;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-strong);
  background: var(--cover-grad);
  margin-bottom: 10px;
}

.banner-preview-box img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-preview-box.fit-contain img {
  object-fit: contain;
}

.banner-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.banner-fit-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--border);
}

.banner-fit-btn {
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.banner-fit-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.banner-pos-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 180px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.banner-pos-slider input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

.profile-identity-row {
  padding: 0 28px 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.profile-identity-left {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-top: -56px;
  position: relative;
  z-index: 2;
  min-width: 0;
}

.profile-name-block {
  padding-bottom: 6px;
  min-width: 0;
}

.profile-username {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.profile-handle {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-top: 3px;
}

.profile-bio-wrap {
  padding: 0 28px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.profile-bio {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 720px;
  white-space: pre-line;
}

.profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-stats-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  margin-bottom: 30px;
}

.stats-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
}

.stats-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.watchtime-hero {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.watchtime-hero .accent-unit {
  color: var(--accent);
}

.watchtime-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  margin-bottom: 20px;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.metric-item {
  min-width: 0;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.genre-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.genre-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 36px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.genre-bar-name {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.genre-bar-track {
  height: 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.genre-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}

.genre-bar-count {
  text-align: right;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tabs-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 9px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.tab-btn.active .tab-count {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.tab-count {
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Anime Detail View
   ========================================================================== */
.back-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.anime-hero-panel {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 28px;
  margin-bottom: 28px;
}

.anime-hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(32px) brightness(0.45);
  opacity: 0.35;
  transform: scale(1.1);
  pointer-events: none;
}

.anime-hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 28px;
  align-items: start;
}

.anime-detail-poster {
  width: 230px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
}

.anime-detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.anime-detail-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.anime-detail-orig {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.detail-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.star-rating-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.star-rating-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stars-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, color 0.12s ease;
}

.star-btn:hover {
  transform: scale(1.14);
}

.star-btn.filled,
.star-btn.hovered {
  color: var(--accent);
}

.star-value-text {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  min-width: 28px;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 16px 0;
}

.fact-label {
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.fact-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.detail-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.65;
  white-space: pre-line;
}

/* ==========================================================================
   Player Section
   ========================================================================== */
.player-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  margin-bottom: 32px;
}

.player-controls-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.studio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.studio-btn {
  padding: 8px 13px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.studio-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.studio-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.episodes-scroller {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 7px;
  max-height: 176px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 16px;
}

.ep-btn {
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: all 0.14s ease;
}

.ep-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.ep-btn.watched {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.ep-btn.watched::after {
  content: '✓';
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

.ep-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text-primary);
  font-weight: 700;
}

.player-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.now-playing-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.quality-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.q-btn {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.q-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.q-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.player-shell video,
.player-shell iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
  background: #000000;
}

.skip-overlay-btn {
  position: absolute;
  bottom: 66px;
  right: 20px;
  z-index: 15;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: none;
}

.skip-overlay-btn:hover {
  background: var(--accent-hover);
}

/* ==========================================================================
   Comments Section (TikTok / Instagram 1-Level Reply Threads + Like/Dislike)
   ========================================================================== */
.comments-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-top: 32px;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.comment-composer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.comment-composer-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.comment-thread {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.comment-thread:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.comment-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 10px;
  margin: -8px -10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.comment-item.comment-highlight {
  animation: commentFlash 2.8s ease forwards;
}

@keyframes commentFlash {
  0% {
    background: rgba(232, 155, 60, 0.22);
    border-color: var(--accent);
  }
  65% {
    background: rgba(232, 155, 60, 0.15);
    border-color: var(--accent-border);
  }
  100% {
    background: transparent;
    border-color: transparent;
  }
}

.comment-main {
  flex: 1;
  min-width: 0;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-time {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.comment-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  word-wrap: break-word;
  white-space: pre-wrap;
}

.reply-mention {
  color: var(--accent);
  font-weight: 600;
  margin-right: 5px;
}

.spoiler-mask {
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.vote-btn,
.reply-trigger-btn,
.comment-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease;
}

.vote-btn:hover,
.reply-trigger-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.vote-btn.active-like {
  color: var(--accent);
  background: var(--accent-soft);
}

.vote-btn.active-dislike {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.comment-delete-btn:hover {
  color: var(--accent);
}

.replies-block {
  margin-left: 50px;
  margin-top: 10px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

.replies-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.replies-toggle-btn::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--border-strong);
}

.replies-toggle-btn:hover {
  color: var(--text-primary);
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.inline-reply-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.inline-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Modal Dialogs (Fixed Form Label Selector!)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 8, 0.82);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: grid;
}

.modal-dialog {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-modal);
}

.modal-dialog.wide {
  max-width: 720px;
}

/* ==========================================================================
   Import & Export Lists Modal
   ========================================================================== */
.import-formats-banner {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.import-formats-banner strong {
  color: var(--text-primary);
  font-weight: 600;
}

.import-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.import-controls-grid .dropdown {
  width: 100%;
}

.import-controls-grid .dropdown-trigger {
  width: 100%;
}

.import-source-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.import-source-row .upload-btn {
  min-width: 0;
  height: 40px;
}

.import-source-row .upload-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-loading-box,
.import-empty-box {
  padding: 26px 18px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-canvas);
  font-size: 13.5px;
  color: var(--text-secondary);
}

.import-preview-panel {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-canvas);
  overflow: hidden;
}

.import-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.import-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.import-format-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.import-counts-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.import-counts-text strong {
  color: var(--text-primary);
}

.import-subtabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.import-preview-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.import-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.import-row:last-child {
  border-bottom: none;
}

.import-row:hover {
  background: var(--bg-surface);
}

.import-row.selected {
  background: rgba(232, 155, 60, 0.04);
}

.import-row-check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.import-row-poster {
  width: 34px;
  height: 48px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.import-row-info {
  flex: 1;
  min-width: 0;
}

.import-row-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-row-meta {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-row-source {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-row-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.import-list-pill {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
}

.import-existing-pill {
  font-size: 11px;
  color: var(--text-muted);
}

.import-fuzzy-pill {
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.import-unmatched-note {
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.import-unmatched-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.import-unmatched-row:last-child {
  border-bottom: none;
}

.import-unmatched-num {
  font-size: 12.5px;
  color: var(--text-muted);
  min-width: 22px;
  padding-top: 1px;
}

.import-format-hint {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ==========================================================================
   Profile Lists Toolbar (Search + Sort) & Announcements Notice
   ========================================================================== */
.profile-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.profile-list-search {
  flex: 1 1 260px;
  max-width: 420px;
}

.profile-list-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-list-toolbar-right .dropdown {
  min-width: 215px;
}

.profile-list-toolbar-right .dropdown-trigger {
  width: 100%;
}

.profile-list-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.profile-list-meta:empty {
  display: none;
}

.profile-list-meta strong {
  color: var(--text-primary);
}

.fact-value-accent {
  color: var(--accent);
}

.anons-notice-panel {
  border-color: var(--border-accent);
}

.anons-notice-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  max-width: 640px;
}

.anons-notice-title {
  margin: 0;
  font-family: 'Unbounded', 'Onest', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.anons-notice-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.anons-notice-text strong {
  color: var(--text-primary);
}

.anons-notice-actions {
  margin-top: 4px;
}

/* ==========================================================================
   Privacy Settings, Blocklist & Restricted Profile UI
   ========================================================================== */
.privacy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.privacy-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--border);
}

.privacy-setting-info {
  flex: 1;
  min-width: 0;
}

.privacy-setting-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.privacy-setting-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
}

.privacy-setting-control {
  flex-shrink: 0;
  min-width: 196px;
}

.privacy-setting-control .dropdown,
.privacy-setting-control .dropdown-trigger {
  width: 100%;
}

.privacy-blocklist-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.privacy-blocklist-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-elevated);
}

.blocklist-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.blocklist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--border);
}

.blocklist-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.privacy-locked-panel {
  padding: 28px 22px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  text-align: center;
  margin-bottom: 24px;
}

.privacy-locked-panel h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.privacy-locked-panel p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.comment-blocked-placeholder {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.notif-anime-poster {
  width: 38px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.user-search-box {
  margin-bottom: 24px;
}

.user-search-bar {
  max-width: 460px;
}

.user-search-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Trailers, Screenshot Gallery & Fullscreen Lightbox
   ========================================================================== */
.media-gallery-section {
  margin-top: 28px;
}

.trailers-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 270px;
  gap: 14px;
  overflow-x: auto;
  padding-top: 4px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.trailer-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.trailer-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: border-color var(--transition), transform var(--transition);
}

.trailer-card:hover .trailer-thumb {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.trailer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease;
}

.trailer-card:hover .trailer-thumb img {
  transform: scale(1.04);
}

.trailer-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(11, 11, 13, 0.84);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  padding-left: 2px;
  transition: background var(--transition), color var(--transition);
}

.trailer-card:hover .trailer-play-btn {
  background: var(--accent);
  color: var(--accent-ink);
}

.trailer-kind-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: rgba(11, 11, 13, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
}

.trailer-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trailer-iframe-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.trailer-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.screenshots-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 230px;
  gap: 12px;
  overflow-x: auto;
  padding-top: 4px;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.screenshot-card {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}

.screenshot-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.screenshot-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease;
}

.screenshot-card:hover img {
  transform: scale(1.04);
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(7, 7, 9, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(1080px, 88vw);
  max-height: 86vh;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  object-fit: contain;
  background: var(--bg-surface);
}

.lightbox-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.lightbox-close-btn {
  position: fixed;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox-close-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(20, 20, 24, 0.9);
  color: var(--text-primary);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox-nav-btn.prev { left: 18px; }
.lightbox-nav-btn.next { right: 18px; }

.lightbox-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 768px) {
  .trailers-rail {
    grid-auto-columns: 230px;
  }

  .screenshots-rail {
    grid-auto-columns: 196px;
  }

  .lightbox-backdrop {
    padding: 12px;
  }

  .lightbox-nav-btn {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .lightbox-nav-btn.prev { left: 8px; }
  .lightbox-nav-btn.next { right: 8px; }
}

@media (max-width: 768px) {
  .privacy-setting-row {
    flex-direction: column;
    align-items: stretch;
  }

  .privacy-setting-control {
    min-width: 0;
    width: 100%;
  }

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

  .profile-list-search {
    flex: 0 0 auto;
    height: 44px;
    max-width: none;
    width: 100%;
  }

  .profile-list-toolbar-right {
    width: 100%;
  }

  .profile-list-toolbar-right .dropdown {
    flex: 1;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .import-controls-grid {
    grid-template-columns: 1fr;
  }

  .import-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .import-row-badges {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding-left: 28px;
    flex-wrap: wrap;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field > .form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Empty / Loading / Toast / Related
   ========================================================================== */
.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-state h3 {
  margin: 0 0 6px;
  color: var(--text-primary);
  font-size: 16px;
}

.loading-sentinel {
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}

.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 44px);
}

.toast {
  padding: 11px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-menu);
}

.toast.accent {
  border-color: var(--accent-border);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.related-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.related-card:hover {
  border-color: var(--accent);
}

.related-thumb {
  width: 54px;
  height: 78px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.related-relation {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
}

.related-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Site Footer & Community Rules Page
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 40px 24px 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.footer-desc {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 380px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-col-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer-link,
.footer-link-btn {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: fit-content;
}

.footer-link:hover,
.footer-link-btn:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 20px;
  font-size: 12.5px;
  color: var(--text-muted);
}

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

/* Community Rules Page (Open Editorial Grid) */
.rules-layout {
  max-width: 920px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 36px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.rule-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rule-num {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.rule-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.rule-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.62;
  color: var(--text-secondary);
}

.rules-sanctions-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
}

.sanctions-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 18px;
}

.sanction-step {
  padding-top: 14px;
  border-top: 2px solid var(--border-strong);
}

.sanction-step.final {
  border-top-color: var(--accent);
}

.sanction-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.sanction-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-inner {
    padding: 32px 14px 22px;
  }

  .rules-grid,
  .sanctions-steps {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Responsive Breakpoints (1024px, 768px, 480px)
   ========================================================================== */
@media (max-width: 1024px) {
  .home-hero {
    grid-template-columns: 1fr 170px;
    padding: 28px;
  }

  .home-hero-poster {
    width: 170px;
  }

  .profile-stats-layout {
    grid-template-columns: 1fr;
  }

  .anime-hero-grid {
    grid-template-columns: 190px 1fr;
    gap: 22px;
  }

  .anime-detail-poster {
    width: 190px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 60px;
  }

  .header-inner {
    padding: 0 14px;
    gap: 10px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .random-label,
  .header-profile-name {
    display: none;
  }

  .notif-popover {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }

  .header-profile-btn {
    padding: 2px;
    border-radius: 50%;
  }

  .app-main {
    padding: 18px 14px 56px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    padding: 22px 18px;
    min-height: auto;
  }

  .home-hero-poster {
    display: none;
  }

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

  .filter-row .dropdown,
  .filter-row .field-input,
  .filter-row .filter-search,
  .filter-row .btn-secondary,
  .filter-row .btn-primary {
    width: 100%;
    flex: 0 0 auto;
  }

  .dropdown-trigger,
  .field-input,
  .btn-primary,
  .btn-secondary {
    height: 44px;
  }

  .anime-grid {
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    gap: 18px 12px;
  }

  .anime-hero-panel {
    padding: 18px;
  }

  .anime-hero-grid {
    grid-template-columns: 1fr;
  }

  .anime-detail-poster {
    width: 164px;
    margin: 0 auto;
  }

  .profile-cover {
    height: 200px;
  }

  .profile-identity-row {
    padding: 0 16px 18px;
  }

  .profile-bio-wrap {
    padding: 0 16px 18px;
  }

  .profile-identity-left {
    margin-top: -46px;
    gap: 14px;
  }

  .avatar-circle.xl {
    width: 86px;
    height: 86px;
    font-size: 30px;
  }

  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .replies-block {
    margin-left: 22px;
    padding-left: 12px;
  }

  .schedule-list {
    grid-template-columns: 1fr;
  }

  .auth-page-wrap {
    padding: 22px 18px;
    margin: 12px auto;
  }
}

@media (max-width: 480px) {
  .brand-name {
    display: none;
  }

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

  .anime-rail {
    grid-auto-columns: 148px;
    gap: 12px;
  }

  .player-section,
  .comments-section,
  .stats-panel {
    padding: 16px 14px;
  }

  .modal-dialog {
    padding: 18px 16px;
  }

  .genre-bar-row {
    grid-template-columns: 100px 1fr 30px;
  }

  .detail-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-actions-bar .dropdown,
  .detail-actions-bar .btn-secondary,
  .detail-actions-bar .star-rating-box {
    width: 100%;
    justify-content: space-between;
  }

  .dropdown-menu {
    max-width: calc(100vw - 28px);
  }

  .otp-cell {
    height: 46px;
    font-size: 19px;
  }
}


/* Comment Editing, Taste Compatibility & Collections (Anixart-style) */
.anime-detail-subtitle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.anime-detail-subtitle-row .anime-detail-orig {
  margin: 0;
}

.alt-titles-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.alt-titles-trigger:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.alt-titles-modal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
}

.alt-title-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-canvas);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.alt-title-row:hover {
  border-color: var(--border-accent);
  background: var(--bg-elevated);
}

.alt-title-text {
  font-size: 13.5px;
  line-height: 1.4;
  word-break: break-word;
}

.alt-title-badge {
  font-size: 11.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.alt-title-row:hover .alt-title-badge {
  color: var(--accent);
}

.fact-link-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 4px;
}

.fact-link-btn {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(232, 155, 60, 0.55);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--transition), text-decoration-color var(--transition);
  text-align: left;
}

.fact-link-btn:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

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

.footer-tg-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.footer-tg-link svg {
  color: var(--accent);
  flex-shrink: 0;
}

.drawer-social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.drawer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.drawer-social-link:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.drawer-social-link svg {
  color: var(--accent);
  flex-shrink: 0;
}

.tg-community-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* ==========================================================================
   Theme Switcher (Header Popover, Drawer Swatches & Settings Grid)
   ========================================================================== */
:root[data-theme="light"] .tag-badge {
  background: rgba(24, 23, 21, 0.82);
  color: #F7F5F0;
}

:root[data-theme="light"] .tag-badge.accent {
  background: var(--accent);
  color: var(--accent-ink);
}

:root[data-theme="light"] .card-progress-bar {
  color: #F7F5F0;
}

:root[data-theme="light"] .card-fav-indicator {
  background: rgba(24, 23, 21, 0.82);
}

.theme-switcher-wrap {
  position: relative;
}

.theme-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 248px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-menu);
  z-index: 140;
  display: none;
}

.theme-switcher-wrap.open .theme-popover {
  display: block;
}

.theme-popover-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 6px 8px;
  letter-spacing: 0.02em;
}

.theme-options-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.theme-option-btn:hover {
  background: var(--bg-elevated);
}

.theme-option-btn.active {
  background: var(--accent-soft);
  border-color: var(--border-accent);
  color: var(--accent);
  font-weight: 600;
}

.theme-swatch-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.theme-swatch-dot::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 46%;
  background: var(--swatch-accent);
}

.theme-option-check {
  margin-left: auto;
  font-size: 13px;
  color: var(--accent);
}

.drawer-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--border);
}

.drawer-theme-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.drawer-theme-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-theme-dot-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.drawer-theme-dot-btn::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 46%;
  background: var(--swatch-accent);
}

.drawer-theme-dot-btn.active {
  border-color: var(--accent);
  transform: scale(1.12);
}

.settings-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 8px;
}

.settings-theme-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-canvas);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.settings-theme-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.settings-theme-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.settings-theme-preview {
  height: 28px;
  border-radius: 5px;
  border: 1px solid rgba(128, 128, 128, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
}

.settings-theme-bar {
  width: 46%;
  height: 8px;
  border-radius: 4px;
}

.settings-theme-pill {
  width: 24%;
  height: 10px;
  border-radius: 999px;
}

.settings-theme-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-edited-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
}

.comment-edit-form {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Taste Compatibility Card */
.taste-compat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.taste-compat-left {
  flex: 1;
  min-width: 0;
}

.taste-compat-score-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.taste-compat-pct {
  font-family: 'Onest', sans-serif;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.taste-compat-meta {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.taste-compat-meta strong {
  color: var(--text-primary);
}

.taste-compat-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.taste-compat-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
  margin-top: 12px;
}

.taste-compat-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.35s ease;
}

.taste-compat-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.taste-compat-posters {
  display: flex;
  align-items: center;
}

.taste-compat-posters img {
  width: 38px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid var(--bg-surface);
  background: var(--bg-elevated);
  margin-left: -10px;
}

.taste-compat-posters img:first-child {
  margin-left: 0;
}

/* Shared Anime Modal */
.shared-modal-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.shared-modal-summary strong {
  color: var(--text-primary);
}

.shared-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shared-anime-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  max-height: 430px;
  overflow-y: auto;
}

.shared-anime-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.shared-anime-row:last-child {
  border-bottom: none;
}

.shared-anime-row:hover {
  background: var(--bg-elevated);
}

.shared-anime-poster {
  width: 38px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-surface);
}

.shared-anime-info {
  flex: 1;
  min-width: 0;
}

.shared-anime-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shared-anime-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.shared-anime-compare {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.shared-compare-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.shared-compare-who {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collections Directory & Cards */
.collections-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

.collections-search-input {
  flex: 1 1 280px;
  min-width: 0;
}

.collections-toolbar-sort {
  flex-shrink: 0;
  min-width: 210px;
}

.collections-toolbar-sort .dropdown,
.collections-toolbar-sort .dropdown-trigger {
  width: 100%;
}

.collections-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.collection-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}

.collection-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.collection-card-media {
  position: relative;
}

.collection-cover-box {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
  overflow: hidden;
}

.collection-cover-box > img,
.collection-hero-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.collection-cover-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.collection-mosaic {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 2px;
  background: var(--bg-canvas);
}

.collection-mosaic.m-1 {
  grid-template-columns: 1fr;
}

.collection-mosaic.m-2 {
  grid-template-columns: 1fr 1fr;
}

.collection-mosaic.m-4 {
  grid-template-columns: repeat(4, 1fr);
}

.collection-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.collection-card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.collection-card-body {
  padding: 14px 16px 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.collection-card-title {
  margin: 0;
  font-family: 'Onest', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.collection-card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.collection-card-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.collection-card-author {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.collection-card-author span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-card-author:hover {
  color: var(--accent);
}

.collection-card-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.collection-card-date {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Collection Detail Hero & Viewer Stats Panel */
.collection-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 22px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.collection-hero-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.collection-hero-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.collection-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.collection-hero-date {
  font-size: 12.5px;
  color: var(--text-muted);
}

.collection-hero-title {
  margin: 0;
  font-family: 'Onest', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.collection-hero-author-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.collection-author-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.collection-hero-desc {
  margin: 2px 0 4px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-line;
}

.collection-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
}

.collection-stats-panel {
  padding: 18px 20px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 26px;
}

.collection-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.collection-stats-total {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.collection-stats-total strong {
  color: var(--accent);
}

.collection-stat-chips {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.collection-stat-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--border);
}

.collection-stat-chip.has-items {
  border-color: var(--border-accent);
  background: var(--accent-soft);
}

.collection-stat-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collection-stat-chip.has-items .collection-stat-label {
  color: var(--text-primary);
}

.collection-stat-val {
  font-family: 'Onest', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
}

.collection-stat-chip.has-items .collection-stat-val {
  color: var(--accent);
}

/* Collection Editor Modal Picker */
.col-editor-cover-preview {
  width: 100%;
  max-height: 170px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-canvas);
}

.col-editor-cover-preview img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.col-picker-results:empty {
  display: none;
}

.col-picker-results,
.col-selected-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  max-height: 220px;
  overflow-y: auto;
}

.col-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.col-picker-row:last-child {
  border-bottom: none;
}

@media (max-width: 1024px) {
  .collection-hero {
    grid-template-columns: 260px 1fr;
  }

  .collection-stat-chips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .taste-compat-card {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .taste-compat-right {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .shared-anime-row {
    flex-wrap: wrap;
  }

  .shared-anime-compare {
    width: 100%;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid var(--border);
  }

  .shared-compare-col {
    align-items: flex-start;
  }

  .collection-hero {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .collection-hero-title {
    font-size: 21px;
  }

  .collection-stat-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collections-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .collections-search-input {
    flex: 0 0 auto;
    height: 44px;
    width: 100%;
  }

  .collections-toolbar-sort {
    min-width: 0;
    width: 100%;
  }

  .collections-grid {
    grid-template-columns: 1fr;
  }
}
