/* ==========================================================================
   Dark theme — Instagram-inspired UI (default)
   ========================================================================== */

:root {
  --bg: #000000;
  --bg-elevated: #121212;
  --bg-card: #121212;
  --bg-card-hover: #1a1a1a;
  --border: #363636;
  --border-strong: #525252;
  --text: #fafafa;
  --text-muted: #a8a8a8;
  --accent: #0095f6;
  --accent-dim: rgba(0, 149, 246, 0.14);
  --title-accent: #c4a882;
  --tab-active-fg: #fafafa;
  --search-field-bg: #262626;
  --filter-field-bg: #1a1a1a;
  --movie: #0095f6;
  --movie-dim: rgba(0, 149, 246, 0.14);
  --tv: #a855f7;
  --tv-dim: rgba(168, 85, 247, 0.14);
  --anime: #ed4956;
  --anime-dim: rgba(237, 73, 86, 0.14);
  --franchise: #58c322;
  --franchise-dim: rgba(88, 195, 34, 0.12);
  --watched: #58c322;
  --in-progress: #fb923c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

::selection {
  background: rgba(0, 149, 246, 0.35);
  color: #fff;
}

body {
  letter-spacing: 0.01em;
  background: var(--bg);
}

.app {
  padding: 2.25rem 1.5rem 3.5rem;
}

/* — Header — */
.header {
  margin-bottom: 1.35rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.header__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0.55rem 0.85rem;
}

.header__brand {
  display: contents;
}

.header__title-wrap {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.header__actions {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  flex-shrink: 0;
}

.header__stats {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.header__stats::-webkit-scrollbar {
  display: none;
}

html[data-theme="dark"] .header__title,
html:not([data-theme]) .header__title,
html[data-theme="dark"] .list-title-dropdown__trigger,
html:not([data-theme]) .list-title-dropdown__trigger {
  margin: 0;
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.01em;
  line-height: 1.08;
  font-size: clamp(1.75rem, 4.8vw, 2.35rem);
  color: var(--title-accent);
  text-wrap: balance;
}


.header__stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.32rem;
  padding: 0.28rem 0.62rem;
  font-size: 0.78rem;
  line-height: 1.15;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-shrink: 0;
}

.header__stat-chip--filter {
  cursor: pointer;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.header__stat-chip--filter:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong, #525252);
}

.header__stat-chip--filter:focus-visible {
  outline: 2px solid var(--accent, #7c6aff);
  outline-offset: 2px;
}

.header__stat-chip--filter.header__stat-chip--active {
  background: rgba(255, 255, 255, 0.06);
  border-color: color-mix(in srgb, var(--accent, #7c6aff) 45%, var(--border));
}

.header__stat-chip--filter.header__stat-chip--active.header__stat-chip--watched {
  border-color: color-mix(in srgb, var(--watched) 55%, var(--border));
  background: color-mix(in srgb, var(--watched) 10%, transparent);
}

.header__stat-chip--filter.header__stat-chip--active.header__stat-chip--in-progress {
  border-color: color-mix(in srgb, var(--in-progress, #fb923c) 55%, var(--border));
  background: color-mix(in srgb, var(--in-progress, #fb923c) 10%, transparent);
}

.header__stat-value {
  font-weight: 600;
  font-size: inherit;
  line-height: inherit;
  color: #fafafa;
  font-variant-numeric: tabular-nums;
}

.header__stat-chip--watched .header__stat-value {
  color: var(--watched);
}

.header__stat-chip--in-progress .header__stat-value {
  color: var(--in-progress, #fb923c);
}

.header__stat-label {
  font-weight: 500;
  font-size: inherit;
  line-height: inherit;
  color: #a8a8a8;
}

.header__stat-chip--sync {
  background: rgba(255, 255, 255, 0.03);
}

.header__stat-chip--sync[data-status="pending"] {
  border-color: rgba(0, 149, 246, 0.28);
  background: rgba(0, 149, 246, 0.08);
}

.header__stat-chip--sync[data-status="pending"] .header__stat-label {
  color: #6ec0ff;
}

.header__stat-chip--sync[data-status="error"] {
  border-color: rgba(201, 146, 146, 0.32);
  background: rgba(201, 146, 146, 0.08);
}

.header__stat-chip--sync[data-status="error"] .header__stat-label {
  color: #d4a0a0;
}

.header__stat-chip--sync[data-status="saved"] {
  border-color: rgba(146, 196, 168, 0.28);
  background: rgba(146, 196, 168, 0.08);
}

.header__stat-chip--sync[data-status="saved"] .header__stat-label {
  color: #9ec4ae;
}

.header__stat-chip--sync[data-status="offline"] {
  border-color: rgba(164, 164, 176, 0.28);
  background: rgba(164, 164, 176, 0.08);
}

.header__stat-chip--sync[data-status="offline"] .header__stat-label {
  color: #b8b8c4;
}

.header__sync-retry {
  margin: 0;
  padding: 0.08rem 0.42rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.header__sync-retry:hover {
  background: rgba(255, 255, 255, 0.08);
}

.header__sync-retry:focus-visible {
  outline: 2px solid #0095f6;
  outline-offset: 2px;
}


.header__toolbar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: none;
}

.header__toolbar .account-menu__trigger {
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  min-height: 34px;
  border: 1px solid transparent;
}

.header__toolbar .account-menu__trigger:hover,
.header__toolbar .account-menu__trigger:focus-visible {
  background: #262626;
  border-color: var(--border);
}

.account-menu__panel {
  border-radius: 12px;
  padding: 0.4rem;
  border-color: var(--border);
  background: #262626;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
}

.account-menu__item:hover,
.account-menu__item:focus-visible {
  background: #363636;
}

.account-menu__item {
  border-radius: 8px;
}

/* — Filter panel — */
.panel {
  margin-bottom: 1.75rem;
  background: var(--bg-elevated);
  border-color: var(--border);
  border-radius: 0;
  box-shadow: none;
}

.type-tabs {
  gap: 0;
  padding: 0;
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.type-tab {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 0;
  padding: 0.55rem 0.55rem;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  background: transparent;
}

.type-tab:hover {
  color: var(--text);
  background: transparent;
}

.type-tab--active {
  color: var(--tab-active-fg);
  background: transparent;
  border-bottom-color: var(--tab-active-fg);
  box-shadow: none;
}

.type-tab--active:hover {
  color: var(--tab-active-fg);
  background: transparent;
}

.type-tab--active .type-tab__count {
  color: var(--text-muted);
  opacity: 1;
}

.panel__filters {
  padding: 0.75rem;
  gap: 0.55rem;
}

html[data-theme="dark"] .search__input,
html:not([data-theme]) .search__input,
html[data-theme="dark"] .gate__input,
html:not([data-theme]) .gate__input,
html[data-theme="dark"] .form-input,
html:not([data-theme]) .form-input,
html[data-theme="dark"] .form-textarea,
html:not([data-theme]) .form-textarea,
html[data-theme="dark"] .tds-episode-jump__input,
html:not([data-theme]) .tds-episode-jump__input {
  background-color: var(--search-field-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
}

html[data-theme="dark"] .genre-filter__select,
html:not([data-theme]) .genre-filter__select,
html[data-theme="dark"] .panel__filters .select,
html:not([data-theme]) .panel__filters .select,
html[data-theme="dark"] .watched-filter__select,
html:not([data-theme]) .watched-filter__select,
html[data-theme="dark"] .rating-filter__select,
html:not([data-theme]) .rating-filter__select {
  background-color: var(--filter-field-bg);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
}

html[data-theme="dark"] .search__input::placeholder,
html:not([data-theme]) .search__input::placeholder,
html[data-theme="dark"] .gate__input::placeholder,
html:not([data-theme]) .gate__input::placeholder,
html[data-theme="dark"] .form-input::placeholder,
html:not([data-theme]) .form-input::placeholder,
html[data-theme="dark"] .form-textarea::placeholder,
html:not([data-theme]) .form-textarea::placeholder,
html[data-theme="dark"] .tds-episode-jump__input::placeholder,
html:not([data-theme]) .tds-episode-jump__input::placeholder {
  color: #a8a8a8;
}

html[data-theme="dark"] .search__input:focus,
html:not([data-theme]) .search__input:focus,
html[data-theme="dark"] .filter:focus,
html:not([data-theme]) .filter:focus,
html[data-theme="dark"] .genre-filter__select:focus,
html:not([data-theme]) .genre-filter__select:focus,
html[data-theme="dark"] .panel__filters .select:focus,
html:not([data-theme]) .panel__filters .select:focus,
html[data-theme="dark"] .watched-filter__select:focus,
html:not([data-theme]) .watched-filter__select:focus,
html[data-theme="dark"] .rating-filter__select:focus,
html:not([data-theme]) .rating-filter__select:focus,
html[data-theme="dark"] .gate__input:focus,
html:not([data-theme]) .gate__input:focus,
html[data-theme="dark"] .form-input:focus,
html:not([data-theme]) .form-input:focus,
html[data-theme="dark"] .form-textarea:focus,
html:not([data-theme]) .form-textarea:focus,
html[data-theme="dark"] .tds-episode-jump__input:focus,
html:not([data-theme]) .tds-episode-jump__input:focus {
  border-color: #525252;
  box-shadow: none;
  outline: none;
}

html[data-theme="dark"],
html:not([data-theme]) {
  color-scheme: dark;
}

/* — Select dropdowns (native list popup) — dark theme only */
html[data-theme="dark"] select,
html:not([data-theme]) select,
html[data-theme="dark"] .genre-filter__select,
html:not([data-theme]) .genre-filter__select,
html[data-theme="dark"] .watched-filter__select,
html:not([data-theme]) .watched-filter__select,
html[data-theme="dark"] .select,
html:not([data-theme]) .select,
html[data-theme="dark"] .account-menu__select,
html:not([data-theme]) .account-menu__select,
html[data-theme="dark"] #titleSearchType,
html:not([data-theme]) #titleSearchType,
html[data-theme="dark"] #listSwitcher,
html:not([data-theme]) #listSwitcher,
html[data-theme="dark"] #formType,
html:not([data-theme]) #formType,
html[data-theme="dark"] #formGenre,
html:not([data-theme]) #formGenre,
html[data-theme="dark"] #searchConfirmType,
html:not([data-theme]) #searchConfirmType,
html[data-theme="dark"] #searchConfirmGenre,
html:not([data-theme]) #searchConfirmGenre {
  color-scheme: dark;
  accent-color: #0095f6;
  color: var(--text);
  background-color: #262626;
}

html[data-theme="dark"] select option,
html:not([data-theme]) select option,
html[data-theme="dark"] .genre-filter__select option,
html:not([data-theme]) .genre-filter__select option,
html[data-theme="dark"] .watched-filter__select option,
html:not([data-theme]) .watched-filter__select option,
html[data-theme="dark"] .select option,
html:not([data-theme]) .select option,
html[data-theme="dark"] .account-menu__select option,
html:not([data-theme]) .account-menu__select option {
  background-color: #262626;
  color: var(--text);
}

html[data-theme="dark"] select option:checked,
html:not([data-theme]) select option:checked,
html[data-theme="dark"] .genre-filter__select option:checked,
html:not([data-theme]) .genre-filter__select option:checked,
html[data-theme="dark"] .watched-filter__select option:checked,
html:not([data-theme]) .watched-filter__select option:checked,
html[data-theme="dark"] .select option:checked,
html:not([data-theme]) .select option:checked,
html[data-theme="dark"] .account-menu__select option:checked,
html:not([data-theme]) .account-menu__select option:checked {
  background-color: #363636;
  color: #fafafa;
}

html[data-theme="dark"] select option:hover,
html:not([data-theme]) select option:hover,
html[data-theme="dark"] .genre-filter__select option:hover,
html:not([data-theme]) .genre-filter__select option:hover,
html[data-theme="dark"] .watched-filter__select option:hover,
html:not([data-theme]) .watched-filter__select option:hover,
html[data-theme="dark"] .select option:hover,
html:not([data-theme]) .select option:hover {
  background-color: #1a1a1d;
  color: var(--text);
}

/* Firefox: highlight color inside open list */
@-moz-document url-prefix() {
  select option:checked {
    background-color: rgba(0, 149, 246, 0.22);
    color: var(--text);
  }
}

/* — Buttons — */
.btn {
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn--primary {
  color: #ffffff;
  background: #0095f6;
  border-color: transparent;
  box-shadow: none;
}

.btn--primary:hover {
  background: #1877f2;
  border-color: transparent;
}

.btn--ghost {
  background: transparent;
}

.btn--ghost:hover {
  background: #262626;
  border-color: var(--border);
}

/* — Layout toggles — */
.page-toolbar {
  margin: -0.75rem 0 1.5rem;
}

.layout-bar {
  padding: 0.2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  gap: 0.15rem;
}

.layout-toggle--active {
  color: var(--text);
  background: #262626;
  border-color: var(--border-strong);
  box-shadow: none;
}

.layout-toggle {
  border-radius: 999px;
  border-color: transparent;
  background: transparent;
}

/* — Genre sections — */
.genre-section {
  margin-bottom: 2.75rem;
}

.genre-section__header {
  margin-bottom: 1.1rem;
  padding: 0;
  border: none;
}

.genre-section__header::after {
  display: none;
}

.genre-section__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.genre-section--all-match .genre-section__bar {
  border-color: #0095f6;
  background: rgba(0, 149, 246, 0.08);
}

.genre-section__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex: 0 1 auto;
}

.genre-section__badges:empty {
  display: none;
}

.genre-section__title {
  flex: 1 1 8rem;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.02em;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.genre-section__type {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
}

.genre-section__count {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.28rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #262626;
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .genre-section__bar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title count";
    padding: 0.6rem 0.75rem;
    gap: 0.45rem 0.55rem;
  }

  .genre-section__bar:has(.genre-section__badges:not(:empty)) {
    grid-template-areas:
      "badges count"
      "title title";
  }

  .genre-section__badges {
    grid-area: badges;
  }

  .genre-section__title {
    grid-area: title;
    font-size: 1.05rem;
  }

  .genre-section__count {
    grid-area: count;
    margin-left: 0;
  }
}

/* — Cards — */
.cards {
  gap: 1.1rem;
}

.card {
  padding: 1.1rem;
  border-radius: 0;
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: none;
}

.card:hover {
  border-color: #525252;
  box-shadow: none;
  background: var(--bg-card-hover);
  transform: none;
}

.card--linked:hover .card__title {
  color: #fafafa;
}

.card--watched {
  opacity: 0.82;
}

.card__title {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.badge {
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.48rem;
}

.badge--genre-primary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
}

.card__lead {
  color: #0095f6;
  font-size: 0.8rem;
}

.card__facts {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.card__summary {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.card__footer {
  border-top-color: var(--border);
}

.card__rating {
  border-radius: 8px;
  background: #262626;
  border-color: var(--border);
}

.card__rating-score {
  color: var(--accent);
}

.card-menu__trigger {
  border-radius: 8px;
  background: #262626;
}

.card-menu__trigger:hover {
  border-color: var(--border-strong);
}

/* Poster layout */
.app[data-layout="poster"] .cards {
  gap: 1.15rem;
}

.app[data-layout="poster"] .card {
  border-radius: 14px;
  overflow: hidden;
}

.app[data-layout="poster"] .card__body {
  padding: 0.95rem 1rem 1.05rem;
}

.app[data-layout="poster"] .card__media {
  border-bottom: 1px solid var(--border);
}

/* — Footer — */
.footer {
  margin-top: 3.5rem;
  border-top-color: var(--border);
}

.footer p {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* — Modals & dialogs — */
.modal__panel,
.app-dialog__panel {
  background: #262626;
  border-color: var(--border);
  border-radius: 12px;
  box-shadow: none;
}

.modal__title,
.app-dialog__title {
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.02em;
}

.modal__close {
  border-radius: 999px;
}

.add-mode-tabs {
  background: #121212;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.28rem;
}

.add-mode-tab--active {
  color: #ffffff;
  background: #0095f6;
  border-radius: 6px;
}

.add-mode-tab--active:hover,
.add-mode-tab--active:focus,
.add-mode-tab--active:focus-visible {
  color: #ffffff;
  background: #0095f6;
}

.add-panel-hint {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: #121212;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.add-panel-hint strong {
  color: var(--text);
  font-weight: 600;
}

.title-search__item {
  border-radius: 12px;
}

.title-search__item:hover {
  background: #262626;
}

/* — Gate — dark theme defaults */
html[data-theme="dark"] .gate__card,
html:not([data-theme]) .gate__card {
  border-radius: 12px;
  background: #121212;
  border-color: var(--border);
  box-shadow: none;
}

html[data-theme="dark"] .gate__modes,
html:not([data-theme]) .gate__modes {
  background: #000000;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.28rem;
}

html[data-theme="dark"] .gate__mode--active,
html:not([data-theme]) .gate__mode--active {
  color: #0c0c0d;
  background: linear-gradient(180deg, #d4b896 0%, #c4a882 100%);
}

html[data-theme="dark"] .gate .btn--primary,
html:not([data-theme]) .gate .btn--primary {
  color: #0c0c0d;
  background: linear-gradient(180deg, #d4b896 0%, #c4a882 100%);
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

html[data-theme="dark"] .gate .btn--primary:hover,
html:not([data-theme]) .gate .btn--primary:hover {
  background: linear-gradient(180deg, #dfc9a8 0%, #ceb08a 100%);
  border-color: transparent;
}

.gate__title {
  font-weight: 700;
  font-style: normal;
}

.gate__mode {
  border-radius: 6px;
  font-weight: 600;
}

.gate__submit {
  border-radius: 8px;
}

.gate__theme-open {
  width: 100%;
  margin-top: 0.85rem;
}

.gate__toolbar {
  justify-content: flex-start;
}

html[dir="rtl"] .gate__toolbar {
  justify-content: flex-end;
}

.gate__theme-row {
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
}

.gate__lang--compact {
  margin-top: 0;
}

.gate__lang-btn--icon {
  border: 1px solid var(--border);
}

/* — Theme modal — */
.theme-modal__intro {
  margin-top: 0;
  text-align: center;
}

.theme-options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1rem;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  text-align: start;
  font: inherit;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.theme-option:hover,
.theme-option:focus-visible {
  border-color: #525252;
  background: #121212;
  outline: none;
}

.theme-option--active {
  border-color: #0095f6;
  background: rgba(0, 149, 246, 0.1);
  box-shadow: none;
}

.theme-option__preview {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.theme-option__preview--dark {
  background: #000000;
  border: 1px solid #363636;
}

.theme-option__preview--light {
  background: linear-gradient(135deg, #ffffff 0%, #f3f2ee 55%, #8a6d42 100%);
}

.theme-option__preview--purple {
  background: linear-gradient(135deg, #1a0f30 0%, #07040f 50%, #c49cff 100%);
}

.theme-option__preview--brown {
  background: linear-gradient(135deg, #fff8f0 0%, #c9956a 28%, #3d2518 62%, #18100c 100%);
}

.theme-option__preview--pink {
  background: linear-gradient(180deg, #8e1448 0%, #d81b60 45%, #e84878 78%, #c2185b 100%);
}

.theme-option__title {
  font-size: 0.9rem;
  font-weight: 600;
}

.account-menu__lang {
  padding: 0.35rem 0.55rem 0.45rem;
}

.gate__lang-btn {
  flex: 1;
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

html[data-theme="dark"] .gate__lang-btn--active,
html:not([data-theme]) .gate__lang-btn--active {
  color: #0c0c0d;
  background: linear-gradient(180deg, #d4b896 0%, #c4a882 100%);
  border-color: transparent;
}

/* — Chips & misc — */
.genre-chip--filter {
  border-radius: 999px;
}

html[data-theme="dark"] .genre-chip--filter,
html:not([data-theme]) .genre-chip--filter {
  color: #0c0c0d;
  background: linear-gradient(180deg, #d4b896 0%, #c4a882 100%);
  border-color: rgba(212, 184, 150, 0.45);
}

html[data-theme="dark"] .genre-chip--filter .genre-chip__remove:hover,
html:not([data-theme]) .genre-chip--filter .genre-chip__remove:hover {
  background: rgba(12, 12, 13, 0.1);
}

html[data-theme="dark"] .genre-chip--secondary,
html:not([data-theme]) .genre-chip--secondary {
  color: #0c0c0d;
  background: linear-gradient(180deg, #d4b896 0%, #c4a882 100%);
  border-color: rgba(212, 184, 150, 0.45);
}

html[data-theme="dark"] .genre-chip--secondary .genre-chip__remove:hover,
html:not([data-theme]) .genre-chip--secondary .genre-chip__remove:hover {
  background: rgba(12, 12, 13, 0.1);
}

.genre-section__match {
  letter-spacing: 0.06em;
}

.rating-picker__star--filled .rating-picker__star-icon {
  color: var(--accent);
}

.link-preview-popover__inner {
  border-radius: 14px;
  border-color: var(--border-strong);
}

.empty-state__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: normal;
}

html[lang="ar"] {
  --font: "Noto Sans Arabic", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Noto Sans Arabic", "Plus Jakarta Sans", system-ui, sans-serif;
}

.account-menu__lang-row {
  display: flex;
  gap: 0.35rem;
}

.account-menu__lang-btn {
  flex: 1;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.account-menu__lang-btn:hover,
.account-menu__lang-btn:focus-visible {
  color: var(--text);
  outline: none;
}

.account-menu__lang-btn--active {
  color: #ffffff;
  background: #0095f6;
  border-color: transparent;
}

.btn:focus-visible,
.watched-btn:focus-visible,
.filter:focus,
.search__input:focus,
.filter-check:has(input:focus-visible),
.layout-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(196, 168, 130, 0.1);
}

/* Desktop list density — 5 cards across the 1200px app column; mobile unchanged */
@media (min-width: 641px) {
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
    gap: 0.85rem;
    align-items: stretch;
  }

  .app[data-layout="poster"] .cards {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.9rem;
  }

  .card {
    padding: 1rem;
  }

  .app[data-layout="poster"] .card__body {
    padding: 0.75rem 0.85rem 0.85rem;
  }

  .card__rating-badges {
    margin-bottom: 0.55rem;
  }

  .card:has(.card__body) .card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .card__genre-row {
    min-height: 2.85rem;
    align-content: flex-start;
  }
}
