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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #141414;
  color: #e5e5e5;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  background: #1a1a1a;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo { font-size: 1.2rem; font-weight: 800; color: #e50914; text-decoration: none; letter-spacing: -0.02em; }
.header-logo:hover { color: #f40612; }

.header-left { display: flex; align-items: center; gap: 1.5rem; }

.header-browse {
  color: #e5e5e5;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s;
}
.header-browse:hover { color: #e50914; }

.header-search {
  flex: 0 1 400px;
  display: flex;
  align-items: center;
  background: #2a2a2a;
  border-radius: 6px;
  padding: 0 0.75rem;
  transition: background 0.15s;
}
.header-search:focus-within { background: #333; outline: 1px solid #444; }
.header-search input {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: 0.85rem;
  padding: 0.5rem 0;
  outline: none;
}
.header-search input::placeholder { color: #666; }
.header-search button {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.25rem;
}
.header-search--hidden { display: none; }

.account-area { display: flex; align-items: center; gap: 0.5rem; position: relative; }

.account-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #e50914;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}

.account-dropdown {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  min-width: 150px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.account-dropdown.show { display: block; }
.account-dropdown a, .account-dropdown form button {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  color: #e5e5e5;
  text-decoration: none;
  font-size: 0.85rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}
.account-dropdown a:hover, .account-dropdown form button:hover { background: #2a2a2a; }

.sign-in-link {
  color: #e5e5e5;
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #444;
  border-radius: 4px;
  transition: all 0.15s;
}
.sign-in-link:hover { border-color: #e50914; color: #e50914; }

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  max-width: 640px;
  margin: 0 auto;
}
.hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.hero p { color: #666; font-size: 0.9rem; }
.hero-search {
  display: flex;
  margin-top: 1.5rem;
  background: #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  outline: 1px solid #333;
  transition: outline-color 0.15s;
}
.hero-search:focus-within { outline-color: #e50914; }
.hero-search input {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: 1rem;
  padding: 0.9rem 1.25rem;
  outline: none;
}
.hero-search input::placeholder { color: #555; }
.hero-search button {
  background: #e50914;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  padding: 0.9rem 1.75rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.hero-search button:hover { background: #f40612; }

/* Sections (home) */
.section { padding: 1.5rem 2rem; }
.section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }

.home-recs-grid {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.home-recs-grid::-webkit-scrollbar { height: 6px; }
.home-recs-grid::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.home-recs-card {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, background 0.15s;
  flex: 0 0 150px;
}
.home-recs-card:hover { transform: translateY(-2px); background: #222; }
.home-recs-poster {
  aspect-ratio: 2 / 3;
  background: #2a2a2a;
  overflow: hidden;
}
.home-recs-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-recs-poster .no-poster {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #444; font-size: 2rem;
}
.home-recs-body { padding: 0.6rem 0.75rem 0.75rem; }
.home-recs-title { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-recs-genre { font-size: 0.72rem; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-recs-meta { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.15rem; }
.home-recs-rating { font-size: 0.7rem; color: #f5c518; font-weight: 600; white-space: nowrap; }

.card-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.placeholder-card {
  min-width: 160px;
  height: 220px;
  background: #1e1e1e;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 0.8rem;
  border: 1px dashed #333;
}

/* Search results */
.section-results { padding: 1.5rem 2rem; max-width: 800px; margin: 0 auto; }
.section-results h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }

.result-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  transition: background 0.15s;
  margin-bottom: 0.25rem;
}
.result-card:hover { background: #1e1e1e; }
.result-card a { color: #e5e5e5; text-decoration: none; font-weight: 500; }
.result-card a:hover { color: #e50914; }
.result-card .genre { color: #666; font-size: 0.8rem; margin-top: 0.15rem; }

/* Movie Detail */
.movie-hero {
  height: 380px;
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  position: relative;
}

.movie-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(20,20,20,0.3) 0%, rgba(20,20,20,0.6) 50%, #141414 100%);
  display: flex;
  align-items: flex-end;
}

.movie-hero-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.movie-hero-info h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.movie-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #bbb;
}

.movie-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.movie-detail { max-width: 800px; margin: 0 auto; padding: 2rem; }

.movie-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.movie-header h1 { font-size: 1.65rem; font-weight: 700; line-height: 1.3; }
.movie-header .genre {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.imdb-rating {
  color: #f5c518;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0;
}

/* Thumbs - SVG-based */
.watched-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #777;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  color: #ddd;
}
.watched-btn:hover { color: #fff; border-color: #aaa; }
.watched-btn.is-watched { border-color: #666; color: #1d1d1d; background: #bbb; }

.wl-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #777;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  color: #ddd;
}
.wl-btn:hover { color: #fff; border-color: #aaa; }
.wl-btn.in-watchlist { border-color: #f9a825; color: #f9a825; background: rgba(249,168,37,0.1); }

.thumbs {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #777;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  color: #ddd;
}
.thumb:hover { color: #fff; border-color: #aaa; }
.thumb.active { }
.thumb-up.active { border-color: #2e7d32; background: #2e7d32; color: #fff; }
.thumb-down.active { border-color: #c62828; background: #c62828; color: #fff; }
.thumb.active svg { fill: currentColor; }

/* Aspect badges */
.aspects { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
.aspect-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}
.aspect-badge.pos { background: rgba(46,125,50,0.15); color: #66bb6a; }
.aspect-badge.neg { background: rgba(198,40,40,0.15); color: #ef5350; }

/* Summary */
.summary {
  background: linear-gradient(to right, #1a1a1a, #161616);
  border-left: 3px solid #e50914;
  padding: 1.25rem 1.5rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 2rem;
  line-height: 1.7;
  font-size: 0.9rem;
  color: #ccc;
}
.summary h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin-bottom: 0.5rem;
}

/* Recs section */
.recs { margin-bottom: 2rem; }
.recs-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.recs-header h3 { font-size: 1rem; font-weight: 600; }
.recs-header .recs-count { font-size: 0.8rem; color: #666; }

.recs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rec-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem;
  background: #1a1a1a;
  border-radius: 8px;
  transition: background 0.15s, transform 0.15s;
  text-decoration: none;
  color: inherit;
}
.rec-card:hover { background: #222; transform: translateY(-1px); }

.rec-card-poster {
  width: 50px;
  height: 74px;
  border-radius: 4px;
  background: #2a2a2a;
  flex-shrink: 0;
  overflow: hidden;
}
.rec-card-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-card-poster .no-poster {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 1.2rem;
}

.rec-card-body { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.rec-card-title { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-card-genre { font-size: 0.75rem; color: #666; margin-top: 0.15rem; }

/* Raw reviews */
.raw-reviews {
  margin-top: 0.5rem;
  cursor: pointer;
}
.raw-reviews summary {
  color: #555;
  font-size: 0.8rem;
  padding: 0.5rem 0;
  transition: color 0.15s;
}
.raw-reviews summary:hover { color: #888; }
.raw-reviews .reviews {
  max-height: 260px;
  overflow-y: auto;
  background: #111;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #777;
  margin-top: 0.5rem;
  border: 1px solid #1e1e1e;
}

/* Account pages */
.login-page { max-width: 360px; margin: 4rem auto; padding: 2rem; background: #1a1a1a; border-radius: 10px; border: 1px solid #2a2a2a; }
.login-page h1 { text-align: center; font-size: 1.3rem; margin-bottom: 1.5rem; }
.login-page form label { display: block; margin-bottom: 0.3rem; font-size: 0.8rem; color: #888; }
.login-page form input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}
.login-page form input:focus { border-color: #e50914; }
.login-page form button {
  width: 100%;
  padding: 0.7rem;
  background: #e50914;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.login-page form button:hover { background: #f40612; }
.login-page .error { color: #ef5350; margin-bottom: 1rem; text-align: center; font-size: 0.85rem; }

/* Profile page */
.profile-page {
  max-width: 560px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e50914;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.profile-info h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.profile-email { color: #888; font-size: 0.85rem; margin-bottom: 0.15rem; }

.profile-joined { color: #555; font-size: 0.8rem; }

.profile-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.profile-stat {
  flex: 1;
  background: #1a1a1a;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  border: 1px solid #2a2a2a;
}

.profile-stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #e5e5e5;
  margin-bottom: 0.2rem;
}

.profile-stat-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-section {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.profile-section h2 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #e5e5e5;
}

.profile-section--danger {
  border-color: rgba(198,40,40,0.25);
}

.profile-section--danger h2 { color: #ef5350; }

.profile-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.profile-action span {
  font-size: 0.82rem;
  color: #888;
}

.profile-confirm {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #2a2a2a;
}

.profile-confirm p {
  font-size: 0.82rem;
  color: #ef5350;
  margin-bottom: 0.75rem;
}

.profile-confirm form {
  display: flex;
  gap: 0.5rem;
}

.profile-btn {
  padding: 0.45rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.profile-btn--outline {
  background: none;
  border: 1px solid #444;
  color: #e5e5e5;
}
.profile-btn--outline:hover { border-color: #e50914; color: #e50914; }

.profile-btn--danger {
  background: #c62828;
  color: #fff;
}
.profile-btn--danger:hover { background: #d32f2f; }

/* Podium */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem;
  min-height: 180px;
  margin-bottom: 1rem;
}

.podium-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 130px;
}

.podium-spot--1 { order: 2; }
.podium-spot--2 { order: 1; }
.podium-spot--3 { order: 3; }

.podium-spot--1 .podium-poster,
.podium-spot--1 .podium-empty-poster {
  width: 110px;
  height: 156px;
  border: 2px solid #f9a825;
}
.podium-spot--2 .podium-poster,
.podium-spot--2 .podium-empty-poster {
  width: 100px;
  height: 142px;
  border: 2px solid #bdbdbd;
}
.podium-spot--3 .podium-poster,
.podium-spot--3 .podium-empty-poster {
  width: 90px;
  height: 128px;
  border: 2px solid #c47240;
}

.podium-poster {
  border-radius: 4px;
  overflow: hidden;
  background: #2a2a2a;
  flex-shrink: 0;
}
.podium-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.podium-empty-poster {
  border-radius: 4px;
  background: #1e1e1e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.podium-medal { font-size: 1.3rem; line-height: 1; }

.podium-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 130px;
}

.podium-empty-label {
  font-size: 0.7rem;
  color: #555;
  text-align: center;
}

.podium-edit-btn { display: block; margin: 0 auto; }

.no-poster-small {
  color: #444;
  font-size: 1rem;
}

/* Favorite editor overlay */
.fav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-editor {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  margin: 0 1rem;
}

.fav-editor h2 {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.fav-slots {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fav-slot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.fav-slot-medal {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.fav-search {
  flex: 1;
  padding: 0.65rem 0.75rem;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.fav-search:focus { border-color: #e50914; }
.fav-search::placeholder { color: #555; }

.fav-preview {
  font-size: 0.78rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  flex-shrink: 0;
}

.fav-preview-name { color: #ccc; }

.fav-dropdown {
  position: absolute;
  top: 100%;
  left: 44px;
  right: 0;
  margin-top: 0.25rem;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  z-index: 210;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.fav-option {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.fav-option:hover { background: #333; }

.fav-option-title {
  font-size: 0.82rem;
  color: #e5e5e5;
  font-weight: 500;
}

.fav-option-genre {
  font-size: 0.7rem;
  color: #666;
}

.fav-dropdown-empty {
  padding: 0.5rem 0.75rem;
  color: #555;
  font-size: 0.8rem;
}

.fav-editor-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Footer */
.footer { text-align: center; padding: 2rem; color: #333; font-size: 0.75rem; }

/* Autocomplete dropdown */
.ac-wrapper { pointer-events: auto; }

.ac-dropdown {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  max-height: 340px;
  overflow-y: auto;
}

.ac-dropdown::-webkit-scrollbar { width: 4px; }
.ac-dropdown::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.ac-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  color: #ccc;
  text-decoration: none;
  font-size: 0.83rem;
  transition: background 0.1s;
  border-bottom: 1px solid #1f1f1f;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover,
.ac-item.ac-active { background: #2a2a2a; }

.ac-title { font-weight: 500; color: #e5e5e5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-genre { font-size: 0.72rem; color: #555; white-space: nowrap; flex-shrink: 0; }

/* Browse page */
.browse-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid #222;
  gap: 1rem;
  flex-wrap: wrap;
}

.browse-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.browse-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.browse-count { color: #888; font-size: 0.85rem; }

.browse-clear {
  font-size: 0.75rem;
  color: #777;
  text-decoration: none;
  transition: color 0.15s;
}
.browse-clear:hover { color: #e50914; }

.browse-sort, .browse-per-page { display: flex; align-items: center; }

.toolbar-select {
  background: #2a2a2a;
  color: #e5e5e5;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}
.toolbar-select:focus { border-color: #e50914; }

.browse-divider {
  width: 1px;
  height: 20px;
  background: #333;
  margin: 0 0.25rem;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  background: none;
  border: 1px solid #444;
  border-radius: 4px;
  color: #e5e5e5;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.toolbar-btn:hover { border-color: #e50914; color: #e50914; }

.filter-badge {
  background: #e50914;
  color: #fff;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
  line-height: 1.2;
}

/* Dropdown panels */
.filter-group { position: relative; }

.filter-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.35rem;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  z-index: 50;
  min-width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.filter-panel.show { display: block; }

.filter-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: #2a2a2a;
  border: none;
  border-bottom: 1px solid #333;
  color: #fff;
  font-size: 0.8rem;
  outline: none;
  border-radius: 6px 6px 0 0;
}
.filter-search::placeholder { color: #555; }

.filter-checkboxes {
  max-height: 220px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
}

.filter-checkboxes::-webkit-scrollbar { width: 4px; }
.filter-checkboxes::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.82rem;
  color: #ccc;
  cursor: pointer;
  transition: color 0.1s;
  white-space: nowrap;
}
.filter-label:hover { color: #fff; }

.filter-label input[type="checkbox"] {
  accent-color: #e50914;
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Radio buttons in filter panels */
.filter-label input[type="radio"] {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid #555;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.filter-label input[type="radio"]:checked {
  border-color: #e50914;
  background: #e50914;
  box-shadow: inset 0 0 0 3px #1a1a1a;
}
.filter-label:hover input[type="radio"] { border-color: #888; }

.filter-actions {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #333;
}

.filter-apply-btn {
  width: 100%;
  padding: 0.4rem;
  background: #e50914;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.filter-apply-btn:hover { background: #f40612; }

/* Hierarchical genre groups */
.filter-genre-group {
  border-bottom: 1px solid #2a2a2a;
}
.filter-genre-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0.15rem 0;
  user-select: none;
}
.filter-genre-parent:hover {
  background: #2a2a2a;
}
.genre-caret {
  font-size: 0.65rem;
  color: #666;
  transition: transform 0.15s;
  flex-shrink: 0;
  margin-left: 0.25rem;
}
.genre-caret.open {
  transform: rotate(90deg);
}
.filter-genre-children {
  padding-left: 1.25rem;
  border-left: 1px solid #333;
  margin-left: 6px;
}
.filter-label--child {
  color: #aaa;
  font-size: 0.82rem;
}
.filter-label input[type="checkbox"]:indeterminate {
  accent-color: #666;
}

/* Active filter chips row */
.active-filters-row {
  padding: 0 2rem;
  border-bottom: 1px solid #222;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.6rem 0;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  background: rgba(229,9,20,0.12);
  border: 1px solid rgba(229,9,20,0.25);
  border-radius: 4px;
  font-size: 0.75rem;
  color: #e5e5e5;
  white-space: nowrap;
}

.chip-remove {
  cursor: pointer;
  color: rgba(229,9,20,0.6);
  font-size: 0.9rem;
  line-height: 1;
  transition: color 0.1s;
  margin-left: 0.1rem;
}
.chip-remove:hover { color: #fff; }

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1.5rem 2rem;
}

.browse-card {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, background 0.15s;
}
.browse-card:hover { transform: translateY(-2px); background: #222; }

.browse-poster {
  aspect-ratio: 2 / 3;
  background: #2a2a2a;
  overflow: hidden;
}
.browse-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.browse-poster .no-poster {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #444; font-size: 2rem;
}

.browse-body { padding: 0.6rem 0.75rem 0.75rem; }
.browse-title { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browse-genre { font-size: 0.72rem; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browse-meta { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.15rem; }
.browse-rating { font-size: 0.7rem; color: #f5c518; font-weight: 600; white-space: nowrap; }

.browse-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1.5rem 2rem 2rem;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.6rem;
  border-radius: 4px;
  background: #1a1a1a;
  color: #e5e5e5;
  text-decoration: none;
  font-size: 0.82rem;
  border: 1px solid #2a2a2a;
  transition: all 0.15s;
}
.page-link:hover { background: #2a2a2a; border-color: #e50914; }

.page-current {
  background: #e50914;
  border-color: #e50914;
  font-weight: 600;
}
.page-current:hover { background: #e50914; border-color: #e50914; }

.page-dots { border: none; background: none; color: #555; min-width: 24px; }
.page-dots:hover { background: none; border: none; }

.page-prev, .page-next { padding: 0 0.9rem; }

/* Browse filters */
.filter-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 2rem 1rem;
  flex-wrap: wrap;
}

.filter-group { position: relative; }

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #e5e5e5;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-toggle:hover { border-color: #e50914; }

.filter-badge {
  background: #e50914;
  color: #fff;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.filter-arrow { font-size: 0.6rem; color: #666; }

.filter-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.35rem;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  z-index: 50;
  min-width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.filter-panel.show { display: block; }

.filter-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: #2a2a2a;
  border: none;
  border-bottom: 1px solid #333;
  color: #fff;
  font-size: 0.8rem;
  outline: none;
  border-radius: 6px 6px 0 0;
}
.filter-search::placeholder { color: #555; }

.filter-checkboxes {
  max-height: 240px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.82rem;
  color: #ccc;
  cursor: pointer;
  transition: color 0.1s;
}
.filter-label:hover { color: #fff; }

.filter-label input[type="checkbox"] {
  accent-color: #e50914;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.filter-actions {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #333;
}

.filter-apply-btn {
  width: 100%;
  padding: 0.4rem;
  background: #e50914;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.filter-apply-btn:hover { background: #f40612; }

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #ccc;
}

.chip-remove {
  cursor: pointer;
  color: #888;
  font-size: 0.9rem;
  line-height: 1;
  transition: color 0.1s;
}
.chip-remove:hover { color: #e50914; }

.browse-clear {
  margin-left: 0.75rem;
  font-size: 0.75rem;
  color: #888;
  text-decoration: none;
  transition: color 0.15s;
}
.browse-clear:hover { color: #e50914; }

.browse-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 0;
  color: #666;
}
.browse-empty p { margin-bottom: 0.75rem; }
.browse-empty a { color: #e50914; text-decoration: none; font-size: 0.85rem; }
.browse-empty a:hover { text-decoration: underline; }

/* Taste summary */
.profile-taste {
  border-left: 3px solid #e50914;
  padding-left: 1.25rem;
}
.taste-summary {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #ccc;
  margin: 0;
}

/* Badge section */
.badge-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.badge-section-header h2 {
  margin: 0;
}
.badge-row {
  display: flex;
  gap: 1rem;
}
.badge-card {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid #333;
}
.badge-card--empty {
  cursor: pointer;
  border: 1px dashed #555;
  color: #666;
}
.badge-card--empty:hover {
  border-color: #e50914;
  color: #e50914;
}
.badge-card--small {
  flex-direction: row;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  min-width: auto;
}
.badge-icon {
  font-size: 1.25rem;
}
.badge-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e5e5e5;
}
.badge-card--small .badge-value {
  font-size: 1rem;
}
.badge-label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-select {
  width: 100%;
  padding: 0.5rem;
  background: #333;
  border: 1px solid #444;
  border-radius: 4px;
  color: #fff;
  font-size: 0.85rem;
}

/* Badge picker */
.badge-counter {
  font-size: 0.8rem;
  color: #666;
  font-weight: 400;
  margin-left: 0.5rem;
}

.badge-preview-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.badge-preview-slot {
  flex: 1;
  min-height: 72px;
  border-radius: 8px;
  border: 1px dashed #444;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.badge-preview-slot--filled {
  border: 1px solid #333;
  background: #1e1e1e;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.25rem;
}

.badge-preview-slot--filled .badge-icon { font-size: 1rem; }
.badge-preview-slot--filled .badge-value { font-size: 1.1rem; font-weight: 700; color: #e5e5e5; }
.badge-preview-slot--filled .badge-label { font-size: 0.65rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

.badge-preview-empty {
  font-size: 1.2rem;
  color: #444;
}

.badge-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 1.25rem;
}

.badge-picker-card {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  min-width: 90px;
  flex: 1 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  cursor: pointer;
  transition: border-color 0.15s, opacity 0.15s;
  user-select: none;
}

.badge-picker-card:hover {
  border-color: #555;
}

.badge-picker-card--selected {
  border-color: #e50914;
  background: rgba(229, 9, 20, 0.08);
}

.badge-picker-card--selected:hover {
  border-color: #e50914;
}

.badge-picker-card--disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.badge-picker-card .badge-icon { font-size: 1.1rem; }
.badge-picker-card .badge-value { font-size: 1.2rem; font-weight: 700; color: #e5e5e5; }
.badge-picker-card .badge-label { font-size: 0.7rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
