/* Base styles with light/dark themes */
:root{
  --bg:#0b0f14; --surface:#111827; --card:#0f172a; --text:#e6edf3; --muted:#9fb3c8;
  --primary:#5ac8fa; --border:#24324a; --table:#0d1322;
}
:root.light{
  --bg:#f7f9fc; --surface:#ffffff; --card:#ffffff; --text:#0c1424; --muted:#4b5563;
  --primary:#2563eb; --border:#e5e7eb; --table:#f2f5f9;
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial,sans-serif; background:var(--bg); color:var(--text)}
.wrap{max-width:1100px; margin-inline:auto; padding:16px}
a{color:var(--primary); text-decoration:none}
a:hover{text-decoration:underline}
.site-header{position:sticky; top:0; background:var(--surface); border-bottom:1px solid var(--border); z-index:10}
.site-header .brand{display:flex; align-items:center; justify-content:space-between}
.logo{font-weight:800; letter-spacing:.2px; color:var(--text)}
.logo span{opacity:.7; margin:0 .25rem}
.nav{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}
.nav a{padding:.5rem .7rem; border:1px solid var(--border); border-radius:10px; background:transparent}
.nav a.active{background:var(--card)}
.btn{padding:.5rem .8rem; border:1px solid var(--border); border-radius:10px; background:transparent; color:var(--text); cursor:pointer}
.content{padding-block:18px}
.card{background:var(--card); border:1px solid var(--border); border-radius:14px; padding:16px; margin-bottom:16px}
.kpi{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px}
.kpi .num{font-weight:700}
.table{width:100%; border-collapse:collapse; overflow:hidden; border-radius:10px; background:var(--table); border:1px solid var(--border)}
.table th,.table td{padding:12px 14px; border-bottom:1px solid var(--border); vertical-align:top; text-align:left}
.table th{background:color-mix(in srgb, var(--table), var(--surface) 25%)}
.bullets{line-height:1.75}
.sources li{margin:8px 0}
.muted{color:var(--muted)}
.site-footer{border-top:1px solid var(--border); background:var(--surface); padding:16px 0; position:sticky; bottom:0}
.site-footer .wrap{display:flex; align-items:center; justify-content:space-between}
.foot-nav{display:flex; gap:12px}

/* Anti-copy */
.no-select, .no-select *{user-select:none; -webkit-user-select:none}
@media print{
  body::before{
    content:"ปิดการพิมพ์สำหรับหน้านี้";
    position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
    background:#000; color:#fff; font-size:28px; z-index:999999;
  }
}
