:root {
  --bg: #f4f6fb;
  --bg-mesh: radial-gradient(ellipse 80% 60% at 10% -10%, rgba(99, 102, 241, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 50% at 95% 0%, rgba(236, 72, 153, 0.08), transparent 50%),
    var(--bg);
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.12);
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --accent-glow: rgba(79, 70, 229, 0.25);
  --wiki-heading: #0f172a;
  --header-bg: rgba(15, 23, 42, 0.92);
  --footer-bg: #0f172a;
  --gold: #f59e0b;
  --infobox-bg: #ffffff;
  --infobox-border: rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --sans: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg-mesh);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 0;
}

.logo {
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.logo-image {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.top-nav {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.nav-link {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.header-search {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin-left: auto;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.search-hero-form {
  grid-template-columns: 1fr 150px auto;
}

.search-form input,
.search-form select {
  width: 100%;
  padding: 0.72rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search input {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.header-search input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.header-search input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.14);
}

.search-form input:focus,
.search-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-form button,
.pager a,
.year-pill {
  border: none;
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 0.72rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s var(--ease), background 0.2s, box-shadow 0.2s;
}

.search-form button {
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  color: #fff;
  min-width: 48px;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.search-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.header-search button {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.header-search button:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: none;
}

.search-suggest {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 20;
}

.suggest-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  transition: background 0.15s;
}

.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover { background: var(--accent-soft); }
.suggest-item img { border-radius: 6px; object-fit: cover; }
.suggest-fallback { font-size: 1.2rem; }
.suggest-year { color: var(--muted); margin-left: 0.35rem; }

.main-content { padding: 2rem 0 4rem; }

.page-eyebrow {
  display: none;
}

.hero-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--wiki-heading);
}

/* ── Hero sections ── */
.catalog-hero,
.search-hero {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.catalog-hero::before,
.search-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, transparent 50%, rgba(236, 72, 153, 0.04) 100%);
  pointer-events: none;
}

.catalog-hero {
  grid-template-columns: 1.25fr 1fr;
  align-items: start;
}

.catalog-hero > *,
.search-hero > * {
  position: relative;
}

.catalog-hero-tagline,
.search-hero-intro {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 52ch;
  line-height: 1.65;
}

.catalog-search { max-width: 540px; }

.catalog-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (max-width: 520px) {
  .catalog-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.catalog-stats .stat {
  padding: 0.65rem 0.55rem;
  text-align: center;
  min-width: 0;
}

.catalog-stats .stat strong {
  display: block;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  word-break: break-word;
}

.catalog-stats .stat strong small {
  font-size: 0.65em;
  font-weight: 600;
  -webkit-text-fill-color: var(--muted);
  color: var(--muted);
}

.catalog-stats .stat span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  line-height: 1.25;
  color: var(--muted);
  hyphens: auto;
}

.stat,
.results-count {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat strong {
  display: block;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat span,
.results-count,
.muted { color: var(--muted); font-size: 0.88rem; }

.results-count {
  margin-bottom: 1rem;
  display: inline-block;
  font-weight: 600;
}

/* ── Year filter ── */
.year-nav-wrap {
  margin-bottom: 1.75rem;
  padding-bottom: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.year-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
  min-width: min-content;
  padding: 0.25rem 0;
}

.decade-label {
  flex-shrink: 0;
  margin: 0 0.25rem 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.decade-label:first-of-type { margin-left: 0; }

.year-pill {
  flex-shrink: 0;
  font-size: 0.82rem;
  padding: 0.42rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.year-pill.active,
.year-pill:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ── Film grid ── */
.film-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.25rem;
}

.film-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.film-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.film-card-poster {
  position: relative;
  background: #1e293b;
  overflow: hidden;
}

.film-card-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, 0.75) 100%);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.film-card:hover .film-card-poster::after {
  opacity: 1;
}

.film-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease);
}

.film-card:hover img {
  transform: scale(1.04);
}

.film-year-badge {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  z-index: 1;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
}

.film-card-body {
  padding: 0.95rem 1rem 1.1rem;
}

.film-card-body h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.film-card-body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.no-poster,
.no-poster-sm {
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 3;
  color: rgba(255, 255, 255, 0.35);
  font-size: 2rem;
  background: linear-gradient(145deg, #1e293b, #334155);
}

.no-poster-sm {
  width: 72px;
  height: 108px;
  font-size: 1.5rem;
  border-radius: 8px;
}

/* ── Search results ── */
.search-page { }

.search-results {
  display: grid;
  gap: 0.75rem;
}

.search-result-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1.1rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}

.search-result-card:hover {
  border-color: rgba(79, 70, 229, 0.25);
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

.search-result-card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.search-result-card:hover h2 {
  color: var(--accent);
}

.search-result-card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.55;
}

.result-poster img {
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.result-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.chip {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.chip-muted {
  background: var(--surface-2);
  color: var(--muted);
}

.rating-sm {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
}

mark {
  background: rgba(250, 204, 21, 0.35);
  color: inherit;
  padding: 0 0.15rem;
  border-radius: 3px;
}

.panel,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.empty-state h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.hint-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hint-chips .chip {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.15s;
}

.hint-chips .chip:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

/* ── Film article ── */
.film-hero {
  height: 280px;
  margin: -2rem -1.5rem 1.5rem;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.85) 100%),
    var(--hero-image) center/cover no-repeat;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.breadcrumb {
  margin-bottom: 1.25rem;
  font-size: 0.84rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.4rem;
  color: var(--muted);
  opacity: 0.5;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text); font-weight: 600; }

.wiki-article { max-width: 100%; }

.article-header { margin-bottom: 1.5rem; }

.article-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.article-alt-title {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-style: italic;
  font-size: 1.05rem;
}

.article-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.wiki-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
}

.wiki-content {
  min-width: 0;
  font-family: var(--serif);
  font-size: 1.02rem;
}

.toc {
  float: right;
  width: min(260px, 100%);
  margin: 0 0 1rem 1.5rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.86rem;
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.1rem;
}

.toc a {
  text-decoration: none;
  color: var(--accent);
  line-height: 1.7;
}

.wiki-section {
  margin-bottom: 2.25rem;
  clear: both;
}

.wiki-section h2 {
  font-family: var(--sans);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  color: var(--wiki-heading);
  letter-spacing: -0.02em;
}

.lead {
  font-size: 1.12rem;
  line-height: 1.8;
  margin-top: 0;
  color: #334155;
}

.source-note {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--muted);
}

.table-scroll { overflow-x: auto; border-radius: var(--radius); }

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.wiki-table th,
.wiki-table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.wiki-table th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.wiki-table tr:last-child td { border-bottom: 0; }
.wiki-table tbody tr:hover td { background: rgba(79, 70, 229, 0.03); }

.external-links {
  font-family: var(--sans);
  padding-left: 1.2rem;
}

.external-links a { font-weight: 500; }

/* ── Infobox ── */
.infobox {
  background: var(--infobox-bg);
  border: 1px solid var(--infobox-border);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--sans);
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 5.5rem;
}

.infobox-header {
  padding: 1rem 1rem 0.6rem;
  text-align: center;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
}

.infobox-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.infobox-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.infobox-poster img {
  width: 100%;
  display: block;
}

.infobox-tagline {
  padding: 0.6rem 0.9rem 0;
  font-style: italic;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.infobox-data {
  width: 100%;
  border-collapse: collapse;
}

.infobox-data th,
.infobox-data td {
  padding: 0.5rem 0.9rem;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.infobox-data th {
  width: 38%;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
}

.rating { color: var(--gold); letter-spacing: 0.05em; }

/* ── Pager ── */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.pager a:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Footer ── */
.site-footer {
  margin-top: 0;
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.72);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 2.5rem 0 2rem;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  max-width: 360px;
}

.footer-brand strong {
  color: #fff;
  font-size: 1.05rem;
  display: block;
  margin-bottom: 0.35rem;
}

.footer-brand p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.footer-logo {
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.footer-links {
  display: flex;
  gap: 0.5rem 1.25rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-links a:hover { color: #fff; }

/* Language bar */
.lang-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.9rem 0;
  font-size: 0.8rem;
}

.lang-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.lang-bar-label {
  color: rgba(255, 255, 255, 0.45);
  margin-inline-end: 0.25rem;
}

.lang-bar-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-bar-list li {
  display: inline-flex;
  align-items: center;
}

.lang-bar-list li:not(:last-child)::after {
  content: "·";
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.25);
}

.lang-bar-list a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.2s;
}

.lang-bar-list a:hover { color: #fff; }

.lang-bar-current {
  color: #fff;
  font-weight: 600;
}

/* RTL */
html[dir="rtl"] body { text-align: right; }

html[dir="rtl"] .breadcrumb ol,
html[dir="rtl"] .toc ol,
html[dir="rtl"] .external-links {
  padding-inline-start: 1.25rem;
  padding-inline-end: 0;
}

html[dir="rtl"] .wiki-table th,
html[dir="rtl"] .infobox-data th { text-align: right; }

html[dir="rtl"] .header-inner,
html[dir="rtl"] .footer-inner,
html[dir="rtl"] .lang-bar-inner,
html[dir="rtl"] .pager { direction: rtl; }

html[dir="rtl"] .search-result-card:hover { transform: translateX(-4px); }

/* Legal */
.legal-page {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.legal-page h1 {
  margin-top: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.legal-page h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1.75rem;
  color: var(--wiki-heading);
}

.legal-page h3 { font-size: 1rem; font-weight: 600; }
.legal-page section { margin-bottom: 1.25rem; }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  inset: auto 0.75rem 0.75rem 0.75rem;
  z-index: 200;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  color: #f8fafc;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 720px;
  margin: 0 auto;
}

.cookie-banner-inner { max-width: none; }

.cookie-banner h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
}

.cookie-banner a { color: #a5b4fc; }

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cookie-btn {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.cookie-btn:hover { background: rgba(255, 255, 255, 0.14); }

.cookie-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.cookie-btn-primary:hover { background: var(--accent-hover); }

.cookie-btn-link { background: transparent; }

.cookie-settings {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-option {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.86rem;
  margin-bottom: 0.5rem;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 960px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .header-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }

  .catalog-hero { grid-template-columns: 1fr; }
  .wiki-layout { grid-template-columns: 1fr; }
  .wiki-aside { order: -1; }
  .infobox { position: static; }

  .toc {
    float: none;
    width: 100%;
    margin: 0 0 1rem;
  }

  .search-hero-form { grid-template-columns: 1fr; }
  .film-hero {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }
}

@media (max-width: 640px) {
  .wrap { padding: 0 1rem; }

  .top-nav { width: 100%; }
  .search-form { grid-template-columns: 1fr; }
  .search-form button { width: 100%; }
  .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
  .search-result-card { grid-template-columns: 56px 1fr; padding: 0.9rem; }
  .cookie-banner { inset: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
