:root{
  --bg:#ffffff;
  --text:#141414;
  --muted:#5b5b5b;
  --line:#e8e8e8;
  --chip:#f4f6ff;
  --accent:#1e4fff;
  --card:#ffffff;
  --shadow:0 1px 2px rgba(0,0,0,.05);
  --radius:14px;
  --max:1100px;
  --content:760px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.55;
  font-size:16px;
}

/* Prevent accidental horizontal scroll from long strings */
html, body { overflow-x:hidden; }

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

.container{max-width:var(--max);margin:0 auto;padding:0 14px}
.wrap{max-width:var(--max);margin:0 auto;padding:0 14px}

main{padding:18px 0 40px}

/* Responsive media safety */
img,svg,video,canvas{max-width:100%;height:auto;display:block}

/* Make wide tables scroll on small screens */
.snapshot table,
.changelog table{
  display:block;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

/* =========================
   HEADER (stable)
   ========================= */

.site-header{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--line);
}

.header-row{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:56px;
  flex-wrap:nowrap;
}

/* Brand */
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  flex:0 0 auto;
  min-width:0;
}
.brand-mark{
  width:28px;
  height:28px;
  flex:0 0 28px;
}
.brand-name{
  letter-spacing:.2px;
  white-space:nowrap;
}

/* Desktop nav (>=920px) */
.header-nav{
  display:none;
  align-items:center;
  gap:14px;
  margin-left:auto;
  min-width:0;

  overflow-x:auto;
  overflow-y:hidden;
  white-space:nowrap;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
.header-nav::-webkit-scrollbar{height:6px}
.header-nav::-webkit-scrollbar-thumb{
  background:rgba(0,0,0,.12);
  border-radius:999px;
}

.header-nav a{
  color:var(--muted);
  font-weight:600;
  font-size:14px;
  flex:0 0 auto;
}
.header-nav .chip{
  background:var(--chip);
  border:1px solid #dfe4ff;
  color:#1b2a8a;
  padding:6px 10px;
  border-radius:999px;
  white-space:nowrap;
}

.icon-btn{
  margin-left:auto;
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:8px 10px;
  font-weight:700;
  min-width:44px;
  min-height:44px;
}

/* Mobile menu */
.mobile-menu{padding:10px 0 14px}
.mobile-menu-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.mobile-menu-grid a{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  font-weight:650;
  color:#222;
  background:#fff;
}

@media (min-width: 920px){
  .header-nav{display:flex}
  .icon-btn{display:none}
  .mobile-menu{display:none}
}

/* =========================
   Typography
   ========================= */
h1{font-size:30px;line-height:1.15;margin:0 0 10px}
h2{font-size:20px;margin:22px 0 10px}
h3{font-size:16px;margin:18px 0 8px}
p{margin:0 0 12px}

.small{font-size:13px}
.muted{color:var(--muted)}
.tiny{ font-size:12px; line-height:1.4; }

/* SAFETY: long strings should wrap */
p, li, a, h1, h2, h3, code{
  overflow-wrap:anywhere;
  word-break:break-word;
}

.kicker{
  display:inline-flex;gap:8px;align-items:center;
  font-size:13px;font-weight:700;color:#17306a;
  background:var(--chip);border:1px solid #dfe4ff;
  padding:6px 10px;border-radius:999px;
}

/* =========================
   Layout
   ========================= */

.page-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:14px;
}

@media (min-width: 980px){
  .page-grid{
    grid-template-columns:minmax(0,var(--content)) 320px;
    gap:24px;
    align-items:start;
  }
}

/* =========================
   Cards / UI
   ========================= */

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
}
.card-tight{padding:12px}
.card-title{font-weight:800}
.card-meta{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}

.badge{
  display:inline-flex;align-items:center;gap:6px;
  font-size:12px;font-weight:700;
  padding:5px 8px;border-radius:999px;
  border:1px solid var(--line);
  color:#2a2a2a;background:#fafafa;
}
.badge.green{border-color:#c8f0d4;background:#f1fff5;color:#0f5b2c}
.badge.yellow{border-color:#ffe4a7;background:#fffaf0;color:#6b4b00}
.badge.red{border-color:#ffc0c0;background:#fff4f4;color:#6a1010}

.section-nav{
  display:flex;
  gap:8px;
  overflow:auto;
  padding-bottom:6px;
  margin:8px 0 4px;
  scrollbar-width:thin;
}
.section-nav a{
  white-space:nowrap;
  border:1px solid var(--line);
  padding:8px 10px;border-radius:999px;
  font-weight:700;font-size:13px;color:#2a2a2a;background:#fff;
}
.section-nav a:hover{text-decoration:none;border-color:#cfd6ff}

/* Small chip rows used in empty states / hubs */
.chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.chips .chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:700;
  font-size:13px;
}

.note{color:var(--muted);font-size:13px}

.empty{
  border:1px dashed rgba(0,0,0,.15);
  border-radius:16px;
  padding:14px;
  background:#fff;
}

/* Wrap chips on small screens (fix JanuaryFebruary... issue) */
@media (max-width: 720px){
  .section-nav{
    flex-wrap:wrap;
    overflow:visible;
    white-space:normal;
  }
}

/* =========================
   Movie grid
   ========================= */

/* FIX: cards should not stretch heights unpredictably */
.movie-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  align-items:start;
}
@media (min-width: 720px){
  .movie-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (min-width: 980px){
  .movie-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}

.movie-card{
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  overflow:hidden;
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  min-width:0; /* safety */
}

/* Poster container: safe for BOTH <img> and background-image */
.poster{
  aspect-ratio:2/3;
  width:100%;
  background-color:#f2f2f2;
  background-image:linear-gradient(135deg,#f2f2f2,#fafafa); /* default placeholder */
  background-position:center;
  background-repeat:no-repeat;
  background-size:cover; /* critical for background posters */
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  color:#888;
}

/* If you render <img> inside poster */
.poster img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* OPTIONAL: if you still use .ph as placeholder, keep it */
.poster.ph{ background-image:linear-gradient(135deg,#f2f2f2,#fafafa); }

/* FIX: your HTML uses .meta directly (not .body). style both */
.movie-card .body,
.movie-card .meta{
  padding:10px;
}

.movie-card .title{font-weight:800;line-height:1.2}

/* FIX: your HTML uses ".sub muted" not ".meta as container".
   Ensure .sub renders properly and doesn't inherit padding bugs */
.movie-card .sub{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
}

/* Keep old structure if any pages still use nested .meta block */
.movie-card .meta{
  margin-top:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}

/* =========================
   Buttons / ads
   ========================= */

.btn{
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid var(--line);
  background:#fff;border-radius:12px;
  min-height:44px;padding:10px 12px;
  font-weight:800;
}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn-row{display:flex;gap:10px;flex-wrap:wrap}

.ad-slot{
  border:1px dashed #d8d8d8;
  border-radius:14px;
  background:#fbfbfb;
  padding:10px;
  margin:14px 0;
  min-height:120px;
}
.ad-slot::before{
  content:"Advertisement";
  display:block;
  font-size:11px;
  color:#777;
  letter-spacing:.25px;
  margin-bottom:6px;
}

/* =========================
   Facts
   ========================= */

.fact-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;
}
@media (min-width: 720px){
  .fact-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
.fact{
  border:1px solid var(--line);
  border-radius:14px;padding:10px;background:#fff;
}
.fact .k{font-size:12px;color:#666;font-weight:750}
.fact .v{margin-top:4px;font-weight:800}
.fact .src{margin-top:6px;font-size:12px;color:#3b57d8;font-weight:700}

/* Sources per fact card */
.fact-sources{margin-top:.35rem;font-size:.85rem;line-height:1.35;color:#444}
.fact-sources-label{font-weight:600;margin-right:.35rem}
.fact-sources a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.fact-sources a.is-lookup{opacity:.75}
.sources-list a.is-lookup{opacity:.75}

/* --- Also appears in --- */
.also{margin:14px 0 0;padding:12px;border:1px solid rgba(0,0,0,.08);border-radius:14px;background:#fff}
.also-title{font-weight:700;margin:0 0 8px}
.also-links{display:flex;flex-wrap:wrap;gap:8px}
.also-links a{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;border:1px solid rgba(0,0,0,.10);text-decoration:none}
.also-links a:hover{border-color:rgba(0,0,0,.20)}

/* --- FAQ --- */
.faq{margin-top:18px}
.faq .faq-item{padding:12px;border:1px solid rgba(0,0,0,.08);border-radius:14px;background:#fff;margin:10px 0}
.faq .faq-q{margin:0 0 6px;font-size:1rem}
.faq .faq-a{margin:0;color:rgba(0,0,0,.78)}

/* --- Cite this page + Fact snapshot --- */
.snapshot{margin-top:12px;padding:12px;border:1px solid rgba(0,0,0,.08);border-radius:14px;background:#fff}
.snapshot h2{margin:0 0 10px;font-size:1.05rem}
.snapshot table{width:100%;border-collapse:collapse}
.snapshot td{padding:8px 6px;border-top:1px solid rgba(0,0,0,.06);vertical-align:top}
.snapshot td.k{width:42%;color:rgba(0,0,0,.65)}
.snapshot td.v{font-weight:600}

.citebox{margin-top:12px;padding:12px;border:1px solid rgba(0,0,0,.08);border-radius:14px;background:#fff}
.citebox h2{margin:0 0 10px;font-size:1.05rem}
.cite-actions{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.cite-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px 10px;border-radius:12px;border:1px solid rgba(0,0,0,.12);background:#fff;cursor:pointer}
.cite-btn:hover{border-color:rgba(0,0,0,.22)}
.cite-out{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  font-size:.85rem;
  white-space:pre-wrap;
  word-break:break-word;
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.10);
  background:rgba(0,0,0,.02)
}

/* --- Update diff / history --- */
.updatediff{margin-top:12px;padding:12px;border:1px solid rgba(0,0,0,.08);border-radius:14px;background:#fff}
.updatediff h2{margin:0 0 8px;font-size:1.05rem}
.updatediff .delta{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.updatediff .chip{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;border:1px solid rgba(0,0,0,.10);background:#fff}
.updatediff .history{margin:10px 0 0;padding-left:18px}
.updatediff .history li{margin:6px 0}

/* --- Source quality badges (heuristic) --- */
.src-badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;border:1px solid rgba(0,0,0,.12);font-size:.75rem;margin-left:8px;color:rgba(0,0,0,.7);background:#fff}
.src-badge.primary{border-color:rgba(0,0,0,.22);font-weight:600}
.src-badge.trade{border-color:rgba(0,0,0,.18)}
.src-badge.secondary{border-color:rgba(0,0,0,.12)}
.src-summary{margin-top:8px}
.src-summary .chip{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;border:1px solid rgba(0,0,0,.10);background:#fff;margin-right:8px;margin-top:6px}

/* --- Fact-level sources --- */
.fact-src{font-weight:400;font-size:.82rem;margin-left:10px;color:rgba(0,0,0,.62)}
.fact-src a{color:inherit;text-decoration:underline;text-decoration-color:rgba(0,0,0,.25)}
.fact-src a:hover{text-decoration-color:rgba(0,0,0,.55)}

/* --- Fact evidence lines --- */
.fact-evidence{display:block;margin-top:4px;font-size:.78rem;color:rgba(0,0,0,.62);font-weight:400}
.fact-evidence b{font-weight:600}

/* --- Citation coverage badge --- */
.coverage{margin-top:10px;padding:10px 12px;border-radius:14px;border:1px solid rgba(0,0,0,.08);background:#fff}
.coverage-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.coverage-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;border:1px solid rgba(0,0,0,.12);background:#fff;font-weight:600}
.coverage-badge.ok{border-color:rgba(0,0,0,.22)}
.coverage-badge.warn{border-color:rgba(0,0,0,.18)}
.coverage-list{margin:8px 0 0;padding-left:18px}
.coverage-list li{margin:4px 0}

/* --- Hub source coverage badge --- */
.hubcov{margin:12px 0;padding:10px 12px;border-radius:14px;border:1px solid rgba(0,0,0,.08);background:#fff}
.hubcov-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.hubcov-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;border:1px solid rgba(0,0,0,.12);background:#fff;font-weight:600}
.hubcov-badge.ok{border-color:rgba(0,0,0,.22)}
.hubcov-badge.warn{border-color:rgba(0,0,0,.18)}

/* --- Verified Facts widget --- */
.vfacts{margin:14px 0;padding:12px;border-radius:16px;border:1px solid rgba(0,0,0,.08);background:#fff}
.vfacts-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.vfacts-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;border:1px solid rgba(0,0,0,.14);font-weight:700}
.vfacts-badge.ok{background:#f6fff8}
.vfacts-badge.warn{background:#fff8f6}
.vfacts-list{margin-top:8px}
.vfacts-item{display:flex;gap:8px;align-items:center;margin:4px 0}
.vfacts-item .k{font-weight:600}

/* --- Per-movie changelog --- */
.changelog{margin-top:14px;padding:10px 12px;border-radius:14px;border:1px solid rgba(0,0,0,.08);background:#fff}
.changelog h2{margin:0 0 8px}
.changelog table{width:100%;border-collapse:collapse}
.changelog th,.changelog td{padding:8px;border-top:1px solid rgba(0,0,0,.06);vertical-align:top}
.changelog th{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:rgba(0,0,0,.6)}
.changelog td{font-size:14px}

/* --- Social share --- */
.sharebox{margin:14px 0;padding:10px 12px;border-radius:14px;border:1px solid rgba(0,0,0,.08);background:#fff}
.sharebox h2{margin:0 0 8px}
.share-actions{display:flex;gap:8px;flex-wrap:wrap}
.share-btn{appearance:none;border:1px solid rgba(0,0,0,.14);background:#fff;border-radius:999px;padding:8px 12px;font-weight:600;font-size:14px}
.share-btn.primary{border-color:rgba(0,0,0,.28)}

/* --- AI-friendly summary --- */
.ai-summary{margin:12px 0 14px;padding:10px 12px;border-radius:14px;border:1px solid rgba(0,0,0,.08);background:#fff}
.ai-summary h2{margin:0 0 8px}
.ai-summary ul{margin:0;padding-left:18px}
.ai-summary li{margin:6px 0}
.ai-summary .badge{display:inline-block;font-size:12px;font-weight:700;padding:4px 8px;border-radius:999px;border:1px solid rgba(0,0,0,.12);background:rgba(0,0,0,.02);margin-left:8px}

/* --- Share hooks --- */
.share-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0 14px;padding:10px 12px;border-radius:14px;border:1px solid rgba(0,0,0,.08);background:#fff}
.share-left{font-size:14px}
.share-right{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.share-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px 10px;border-radius:999px;border:1px solid rgba(0,0,0,.12);background:#fff;color:inherit;text-decoration:none;font-weight:700;font-size:13px}
.share-btn.primary{border-color:rgba(0,0,0,.20);background:rgba(0,0,0,.04)}
@media (max-width:520px){
  .share-bar{flex-direction:column;align-items:stretch}
  .share-right{justify-content:flex-start}
}

/* --- Year switcher (cross-year handoff) --- */
.year-switcher{margin-top:14px;padding:12px;border-radius:14px;border:1px solid rgba(0,0,0,.08);background:#fff}
.year-switcher .muted{margin:0}
.year-switcher .actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}

/* Footer */
.site-footer{
  border-top:1px solid var(--line);
  padding:20px 0;
  background:#fff;
}
.footer-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
}
@media (min-width: 900px){
  .footer-grid{grid-template-columns:1.4fr 1fr 1fr}
}
.footer-title{font-weight:900;margin-bottom:8px}
.footer-links{list-style:none;padding:0;margin:0;display:grid;gap:6px}
.footer-links a{color:var(--muted);font-weight:650}

/* Mobile typography */
@media (max-width: 520px){
  h1{font-size:24px;line-height:1.18;letter-spacing:-0.2px}
  h2{font-size:18px;line-height:1.25;margin:18px 0 10px}
  h3{font-size:15px;line-height:1.28;margin:16px 0 8px}
}


/* Poster picture wrapper */
.poster picture{width:100%;height:100%;display:block}
.poster picture img{width:100%;height:100%;object-fit:cover;display:block}
