:root{ --header-offset: 84px; --ring:#6366f1; --card:#111827; --glass:rgba(17, 24, 39, .72); }
@media (min-width:768px){ :root{ --header-offset: 96px; } }
html{scroll-behavior:smooth}
body{font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Helvetica Neue,Arial,sans-serif;background:#0B1120;color:#E2E8F0}
.animated-gradient{background:#0B1120!important;background-size:auto!important;animation:none!important}
.container{max-width:1200px;margin:0 auto}
.glass{background:var(--glass);backdrop-filter:blur(14px);border:1px solid rgba(148,163,184,.15)}
.card{background:rgba(30,41,59,.68);border:1px solid rgba(148,163,184,.15);border-radius:16px;transition:.25s}
.card:hover{box-shadow:0 0 28px rgba(99,102,241,.22);transform:translateY(-2px)}
.headline{font-weight:900;line-height:1.05}
.lead{color:#cbd5e1;font-size:1.125rem;line-height:1.75;margin-top:.75rem}
@media (min-width:768px){ .lead{font-size:1.25rem} }
.byline{display:flex;flex-wrap:wrap;gap:.5rem 1rem;align-items:center;color:#94a3b8}
.pill{background:#0f172a;border:1px solid #334155;color:#c7d2fe;padding:.35rem .6rem;border-radius:999px;font-weight:700;font-size:.75rem}
.dateline{font-variant-numeric:tabular-nums}
.hero{position:relative;overflow:hidden;border-radius:16px;background:#0b1222}
.hero .ph{aspect-ratio:16/9;width:100%}
.hero img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.hero + .glass-card{margin-top:1rem}
.prose{color:#d1d5db;max-width:78ch}
.prose h2{scroll-margin-top:var(--header-offset);font-size:1.5rem;color:#fff;font-weight:800;margin:.8rem 0 .6rem;padding-bottom:.4rem;border-bottom:1px solid #334155}
.prose h3{scroll-margin-top:var(--header-offset);font-size:1.125rem;color:#f3f4f6;font-weight:700;margin:.6rem 0 .35rem}
@media (min-width:768px){ .prose h2{font-size:1.8rem} .prose h3{font-size:1.25rem} }
.prose p{line-height:1.85;margin:1rem 0}
.prose a{color:#a5b4fc;text-decoration:underline}
.toc a{display:block;padding:.5rem .75rem;border-radius:.5rem;border-left:2px solid transparent}
.toc a:hover{background:rgba(99,102,241,.2);color:#fff;border-left-color:var(--ring)}
.anchor{display:none !important;}
#progress{position:fixed;top:0;left:0;height:4px;background:#4F46E5;width:0%;z-index:100;transition:width .1s}
.btn{display:inline-flex;align-items:center;gap:.5rem;padding:.6rem .9rem;border-radius:999px;font-weight:700}
.btn-cta{background:#4f46e5;color:#fff;border:1px solid #6b64f0}
.btn-cta:hover{background:#4338ca}
.btn-outline{background:transparent;color:#c7d2fe;border:1px solid #6366f1}
.btn-outline:hover{background:#1f2937}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media (max-width:640px){ .animated-gradient{animation:none} }
@media (prefers-reduced-motion:reduce){ .animated-gradient{animation:none!important} }
.tag-row{display:flex;flex-wrap:wrap;gap:.5rem}
.tag-chip{
  --b:#4f46e5;display:inline-flex;align-items:center;gap:.4rem;padding:.45rem .7rem;border-radius:999px;
  border:1px solid var(--b); color:#c7d2fe; background:rgba(79,70,229,.08);font-size:.78rem; font-weight:700; cursor:pointer; text-decoration:none;
  outline:none; transition:.18s;
}
.tag-chip:hover{ background:rgba(79,70,229,.18); color:#ffffff }
.tag-chip:focus{ box-shadow:0 0 0 3px rgba(79,70,229,.35) }
.tag-chip svg{ width:14px;height:14px;opacity:.9 }

/* Highlights */
.highlight-card{
  background:rgba(30,41,59,.78);
  border:1px solid rgba(99,102,241,.3);
  border-radius:14px;
  padding:1rem 1.1rem;
  box-shadow:0 12px 32px rgba(0,0,0,.3);
}
.highlight-list{
  list-style:disc;
  margin-left:1.2rem;
  color:#e5e7eb;
  display:grid;
  gap:.45rem;
  font-size:.98rem;
  line-height:1.5;
}
@media (max-width:640px){
  .highlight-card{padding:.9rem 1rem;}
  .highlight-list{font-size:.95rem}
}

/* ======= RICH TABLES (unchanged) ======= */
.table-wrap{position:relative; overflow:auto; -webkit-overflow-scrolling:touch; background:#0b1324; border:1px solid rgba(148,163,184,.18); border-radius:14px; box-shadow:inset 0 1px 0 rgba(255,255,255,.02); margin:1rem 0 1.25rem;}
.table-wrap:before,.table-wrap:after{content:""; position:sticky; top:0; width:24px; height:100%; pointer-events:none; z-index:1;}
.table-wrap:before{ left:0; background:linear-gradient(90deg, rgba(11,17,32,1), rgba(11,17,32,0)); }
.table-wrap:after{ right:0; background:linear-gradient(270deg, rgba(11,17,32,1), rgba(11,17,32,0)); }
.table-tools{display:flex; justify-content:flex-end; gap:.5rem; padding:.5rem .75rem .25rem;}
.table-tools button{background:#101827; border:1px solid #334155; color:#cbd5e1; padding:.35rem .6rem; border-radius:8px; font-size:.75rem; font-weight:600;}
.table-tools button:hover{ background:#0b1220; }
.rich-table{width:100%; border-collapse:separate; border-spacing:0; table-layout:auto; font-size:.95rem; min-width:600px;}
.rich-table caption{caption-side:top; text-align:left; color:#cbd5e1; font-weight:700; padding:.75rem .75rem 0;}
.rich-table thead th{position:sticky; top:0; background:#0f172a; color:#e5e7eb; z-index:2; border-bottom:1px solid #334155; padding:.75rem .75rem; text-align:left; white-space:nowrap;}
.rich-table tbody td{border-bottom:1px solid rgba(148,163,184,.12); padding:.7rem .75rem; vertical-align:top; color:#e2e8f0;}
.rich-table tbody tr:nth-child(odd){ background:rgba(148,163,184,.04); }
.rich-table tbody tr:hover{ background:rgba(99,102,241,.10); }
.rich-table tfoot td{border-top:1px solid #334155; font-weight:600; color:#cbd5e1; padding:.75rem .75rem;}
.rich-table [data-type="number"], .rich-table td.num, .rich-table th.num{ text-align:right; font-variant-numeric:tabular-nums; }
@media (max-width: 640px){
  .table-wrap{ border-radius:12px; }
  .rich-table{ min-width:0; width:100%; }
  .rich-table thead{ clip:rect(0 0 0 0); height:1px; width:1px; overflow:hidden; position:absolute; }
  .rich-table tbody, .rich-table tr, .rich-table td{ display:block; width:100%; }
  .rich-table tr{ background:transparent !important; margin:0 0 .75rem; padding:.5rem 0 .25rem; border-bottom:1px dashed #334155; }
  .rich-table td{ display:flex; gap:.75rem; align-items:flex-start; padding:.55rem .75rem; border:none; border-bottom:1px dashed rgba(148,163,184,.12); }
  .rich-table td:last-child{ border-bottom:none; }
  .rich-table td::before{ content:attr(data-th); flex:0 0 38%; color:#a5b4fc; font-weight:700; white-space:normal; }
  .table-tools{ padding:.5rem .5rem 0; }
}
#article-body img{ max-width:100%; height:auto; border-radius:10px; }
#article-body figure{ margin:1rem 0; }
/* Mobile polish */
@media (max-width:640px){
  body{ -webkit-font-smoothing:antialiased; }
  .card{padding:1rem}
  .headline{font-size:2rem}
  .lead{font-size:1.05rem; line-height:1.6}
  .byline{font-size:.9rem}
  .hero{border-radius:12px}
  .hero img{object-fit:cover}
}
/* ==== CLS fixes: ToC shell & ad slots ==== */
.toc-shell{
  min-height:96px;
  opacity:0;
  transition:opacity .25s ease-out;
}
.toc-shell.is-ready{
  opacity:1;
}
.ad-slot{
  position:relative;
  width:100%;
}
.ad-slot--inline{
  min-height:220px;
}
@media (min-width:768px){
  .ad-slot--corner{
    min-height:120px;
  }
}
.ad-slot img{
  max-width:100%;
  height:auto;
  display:block;
}
