/* New analysis sections (11 Nov 2569). Scoped under .nx so the original sai-3d.css is untouched. */
.nx{color:var(--ink);font:15px/1.65 var(--f-th)}
.nx{
  --bg:#f6f7f3;--bg2:#eceee6;--surface:#fff;--surface2:#f9faf6;--line:rgba(52,42,30,.2);--line2:rgba(52,42,30,.1);
  --ink:#221e19;--ink2:#352f27;--muted:#5a5145;--accent:#b34812;--accent-soft:rgba(179,72,18,.09);--green:#2e6f34;--red:#b92d22;--amber:#8f470e;
  --pend:#7c2d92;--pend-soft:rgba(124,45,146,.09);--cloud:#ffffff;--interp:#9a8f80;
  --f-th:"IBM Plex Sans Thai",system-ui,sans-serif;--f-head:"Kanit","IBM Plex Sans Thai",system-ui,sans-serif;--f-en:"Oswald","Arial Narrow",sans-serif;
  --G1:#64748b;--G2:#0d9488;--G3:#7c3aed;--G4:#d97706;--G5:#e11d48;--G6:#2563eb;
}
.nx *{box-sizing:border-box}
.nx{scroll-behavior:smooth}
.nx{margin:0;background:var(--bg);color:var(--ink);font:15px/1.65 var(--f-th)}
.nx a{color:var(--accent);overflow-wrap:anywhere}
.nx .wrap{max-width:1180px;margin:0 auto;padding:0 28px}
@media(max-width:640px){.nx .wrap{padding:0 16px}
}
.nx /* header */
.top{background:var(--surface);border-bottom:1px solid var(--line)}
.nx .top .wrap{display:flex;align-items:center;gap:14px;min-height:72px;flex-wrap:wrap;padding-top:8px;padding-bottom:8px}
.nx .logos{display:flex;align-items:center;gap:10px}
.nx .logos img{display:block}
.nx .org b{display:block;font:600 17px/1.2 var(--f-head)}
.nx .org small{color:var(--muted);font-size:13px}
.nx .chip{margin-left:auto;border:1px solid var(--accent);color:var(--accent);background:var(--accent-soft);padding:4px 10px;border-radius:4px;font:500 13px var(--f-head)}
.nx .tnav{display:flex;gap:4px;flex-wrap:wrap;width:100%;border-top:1px solid var(--line2);padding-top:6px}
.nx .tnav a{font:500 13px var(--f-head);text-decoration:none;color:var(--ink2);padding:3px 9px;border-radius:4px}
.nx .tnav a:hover{background:var(--accent-soft);color:var(--accent)}
.nx /* brand */
.brand{background:linear-gradient(180deg,var(--surface), var(--bg));border-bottom:1px solid var(--line)}
.nx .brand .wrap{padding-top:34px;padding-bottom:26px}
.nx .brand .en{font:600 14px var(--f-en);letter-spacing:.22em;color:var(--accent);text-transform:uppercase}
.nx .brand h1{font:600 clamp(26px,4vw,42px)/1.25 var(--f-head);margin:6px 0 8px}
.nx .brand p.sub{font:500 clamp(19px,2.4vw,25px)/1.45 var(--f-head);color:var(--ink);margin:0 0 16px;max-width:960px}
.nx .brand p.sub b{color:var(--accent);font-weight:700}
.nx .objective-box{background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:0 6px 6px 0;padding:12px 16px;margin:0 0 16px;font-size:14.5px;line-height:1.65;color:var(--ink2);max-width:1040px}
.nx .objective-box b{color:var(--ink);font-family:var(--f-head)}
.nx details.more-box{background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--accent);border-radius:6px;padding:12px 16px;margin:10px 0}
.nx details.more-box > summary{font:600 clamp(16px,2vw,19px)/1.4 var(--f-head);color:var(--accent);cursor:pointer;padding:2px 0}
.nx details.more-box > summary:hover{text-decoration:underline}
.nx details.more-box > .more-body{margin-top:12px;padding-top:12px;border-top:1px solid var(--line2)}
.nx .zone-mineral-tag{display:inline-block;margin-top:2px;color:#92400e;background:#fef3c7;border:1px solid #fde68a;border-radius:3px;padding:1px 6px;font:500 11.5px/1.35 var(--f-head)}
.stimson-summary-box{background:rgba(179,72,18,.07);border:1px solid rgba(179,72,18,.28);border-left:4px solid #b34812;border-radius:0 6px 6px 0;padding:12px 16px;margin:10px 0 16px;font:14px/1.65 "IBM Plex Sans Thai",system-ui,sans-serif;color:var(--ink,#221e19)}
.stimson-summary-box b{font-family:"Kanit","IBM Plex Sans Thai",sans-serif}
.mine-type-badge{display:inline-block;padding:2px 9px;border-radius:4px;font:600 13.5px/1.4 "Kanit","IBM Plex Sans Thai",sans-serif;margin-bottom:3px}
.mine-type-badge.gold-confirmed{background:#fef3c7;color:#92400e;border:1px solid #f59e0b}
.mine-type-badge.gold-possible{background:#ffedd5;color:#9a3412;border:1px solid #fb923c}
.mine-type-badge.non-mine{background:#e2e8f0;color:#334155;border:1px solid #94a3b8}
:root[data-theme="dark"] .nx .zone-mineral-tag,
:root[data-theme="dark"] .mine-type-badge.gold-confirmed{background:rgba(245,158,11,.18);color:#fde68a;border-color:rgba(245,158,11,.45)}
:root[data-theme="dark"] .mine-type-badge.gold-possible{background:rgba(251,146,60,.18);color:#fed7aa;border-color:rgba(251,146,60,.45)}
:root[data-theme="dark"] .mine-type-badge.non-mine{background:rgba(148,163,184,.18);color:#cbd5e1;border-color:rgba(148,163,184,.4)}
:root[data-theme="dark"] .stimson-summary-box{background:rgba(242,154,63,.1);border-color:rgba(242,154,63,.35);border-left-color:var(--cyan,#f29a3f);color:var(--ink)}
.nx .partners{display:flex;align-items:center;gap:14px;flex-wrap:wrap;border-top:1px solid var(--line2);padding-top:14px}
.nx .partners span{font-size:12.5px;color:var(--muted)}
.nx .partners img{height:52px;width:auto;max-width:100%}
.nx .about{margin-top:14px;background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:8px 14px;font-size:14px}
.nx .about p{margin:8px 0}
.view[hidden]{display:none}
.nx .set-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:12px}
.nx .set-card{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:12px 16px}
.nx .set-card h3{margin:0 0 6px}
.nx .set-row{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;padding:6px 0;border-bottom:1px solid var(--line2);font-size:14px}
.nx .set-row:last-child{border-bottom:0}
.nx .set-row small{display:block;color:var(--muted);font-size:12.5px}
.nx .set-row select{width:auto;max-width:150px}
.nx .set-row input,.nx .set-row select{min-width:92px;font:inherit;padding:4px 6px;border:1px solid var(--line);border-radius:4px}
.nx .set-sum{font:600 14px var(--f-head);margin-top:6px}
.nx .set-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}
.nx .btn-go{background:var(--accent);color:#fff;border:0;border-radius:4px;padding:8px 18px;font:600 15px var(--f-head);cursor:pointer}
.nx .set-msg{font-size:13.5px;color:var(--green);min-height:1.5em}
.nx /* proto banner */
.proto{background:var(--pend-soft);border:1px solid rgba(124,45,146,.35);border-radius:6px;padding:14px 18px;margin:22px 0 0}
.nx .proto b{color:var(--pend)}
.nx .proto ul{margin:6px 0 0;padding-left:20px}
.nx /* sections */
section.page{padding:40px 0 10px}
.nx .eyebrow{font:500 13px var(--f-head);color:var(--muted);margin:0 0 4px;letter-spacing:.02em}
.nx .eyebrow .num{display:inline-block;background:var(--accent);color:#fff;padding:1px 8px;border-radius:3px;margin-right:8px}
.nx h2{font:600 clamp(22px,2.8vw,30px)/1.3 var(--f-head);margin:2px 0 10px}
.nx h3{font:600 18px/1.35 var(--f-head);margin:22px 0 8px}
.nx .lead{color:var(--ink2);max-width:900px}
.nx .note{font-size:13px;color:var(--muted)}
.nx .card{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:16px 18px}
.nx .pend{display:inline-block;background:var(--pend-soft);color:var(--pend);border:1px solid rgba(124,45,146,.35);border-radius:3px;padding:0 6px;font:500 12px var(--f-head);white-space:nowrap}
.nx .flag{border-left:4px solid var(--pend);background:var(--pend-soft);padding:10px 14px;border-radius:0 6px 6px 0;margin:12px 0;font-size:14px}
.nx /* hero */
.headline{font:600 clamp(22px,3vw,32px)/1.35 var(--f-head);margin:6px 0 12px}
.nx .headline em{font-style:normal;color:var(--G3)}
.nx .why{background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--accent);padding:10px 14px;border-radius:0 6px 6px 0;max-width:960px}
.nx .kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-top:16px}
@media(max-width:900px){.nx .kpis{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:520px){.nx .kpis{grid-template-columns:1fr}
}
.nx .kpi{background:var(--surface);border:1px solid var(--line);border-top:3px solid var(--accent);border-radius:4px;padding:12px 14px}
.nx .kpi .t{font-size:13px;color:var(--muted);margin:0}
.nx .kpi .v{font:600 30px/1.2 var(--f-head);margin:4px 0}
.nx .kpi .v small{font-size:14px;font-weight:400;color:var(--muted)}
.nx .kpi .s,.nx .kpi .src{font-size:12.5px;margin:2px 0;color:var(--ink2)}
.nx .kpi .src{color:var(--accent)}
.nx .advice{margin-top:14px;background:#fff7ed;border:1px solid #fdba74;border-radius:6px;padding:12px 16px}
.nx .advice b{font-family:var(--f-head)}
.nx /* method */
.steps{counter-reset:s;display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
@media(max-width:800px){.nx .steps{grid-template-columns:1fr}
}
.nx .step{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:12px 16px 12px 52px;position:relative}
.nx .step::before{counter-increment:s;content:counter(s);position:absolute;left:14px;top:12px;width:26px;height:26px;border-radius:50%;background:var(--accent);color:#fff;font:600 14px/26px var(--f-head);text-align:center}
.nx .step b{font-family:var(--f-head)}
.nx .step p{margin:4px 0 0;font-size:14px}
.nx code,.nx .mono{font-family:ui-monospace,Menlo,monospace;font-size:.92em}
.nx /* profile */
.ctrl{display:flex;flex-wrap:wrap;gap:12px 22px;align-items:center;margin:10px 0}
.nx .seg{display:inline-flex;border:1px solid var(--line);border-radius:5px;overflow:hidden}
.nx .seg button{border:0;background:var(--surface);padding:6px 12px;font:500 13.5px var(--f-head);cursor:pointer;color:var(--ink2)}
.nx .seg button+button{border-left:1px solid var(--line)}
.nx .seg button[aria-pressed=true]{background:var(--accent);color:#fff}
.nx .slider{flex:1 1 420px;min-width:260px}
.nx .slider input{width:100%;accent-color:var(--accent)}
.nx .ticks{position:relative;height:30px;font-size:11px;color:var(--muted)}
.nx .ticks span{position:absolute;transform:translateX(-50%);white-space:nowrap;cursor:pointer}
.nx .ticks span.series-start{color:var(--ink);font-weight:600}
.nx .ticks span:first-child{transform:none}
.nx .ticks span:last-child{transform:translateX(-100%)}
@media(max-width:640px){.nx .ticks span:not(.series-start){display:none}
}
.nx .daylabel{font:600 20px var(--f-head);min-width:150px}
.nx .daylabel small{display:block;font:400 12.5px var(--f-th);color:var(--muted)}
.nx svg.chart{width:100%;height:auto;display:block;background:var(--surface);border:1px solid var(--line);border-radius:6px}
.nx svg text{font-family:var(--f-th)}
.nx .tick{font-size:11px;fill:var(--muted)}
.nx .axt{font-size:12.5px;fill:var(--ink);font-weight:600}
.nx .stats{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:10px}
@media(max-width:800px){.nx .stats{grid-template-columns:repeat(2,1fr)}
}
.nx .stat{background:var(--surface);border:1px solid var(--line);border-radius:4px;padding:8px 10px}
.nx .stat span{display:block;font-size:12px;color:var(--muted)}
.nx .stat b{font:600 18px var(--f-head)}
.nx .legend{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:12.5px;color:var(--ink2);margin-top:8px}
.nx .legend i{display:inline-block;vertical-align:middle;margin-right:6px}
.nx /* tables */
.tw{overflow-x:auto;border:1px solid var(--line);border-radius:6px;background:var(--surface)}
.nx table{border-collapse:collapse;width:100%;font-size:13.5px}
.nx th,.nx td{padding:7px 9px;border-bottom:1px solid var(--line2);text-align:left;vertical-align:top}
.nx th{font:500 13px var(--f-head);background:var(--surface2);color:var(--ink2);position:sticky;top:0}
.nx td.num,.nx th.num{text-align:right;font-variant-numeric:tabular-nums}
.nx td.c{text-align:center;font-variant-numeric:tabular-nums;white-space:nowrap}
.nx tr.series-row td{background:var(--bg2);font:500 13px var(--f-head)}
.nx .cell-na{color:#a39a8c}
.nx .gid{display:inline-block;color:#fff;border-radius:3px;padding:0 6px;font:600 12px var(--f-head)}
.nx .bar{height:8px;background:var(--bg2);border-radius:4px;overflow:hidden;min-width:60px}
.nx .bar i{display:block;height:100%}
.nx details{margin:8px 0}
.nx summary{cursor:pointer;font:500 14px var(--f-head);color:var(--accent)}
.nx .params{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px;margin:10px 0}
.nx .params label{background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:8px 10px;font-size:13px;display:block}
.nx .params input{width:80px;font:inherit;padding:2px 4px;margin-left:6px}
.nx .btn{border:1px solid var(--accent);background:var(--surface);color:var(--accent);border-radius:4px;padding:5px 12px;font:500 13px var(--f-head);cursor:pointer}
.nx .refs li{margin:6px 0}
.nx .refs .tag{font:500 12px var(--f-head);color:var(--muted);margin-right:6px}
.nx footer{margin-top:48px;border-top:1px solid var(--line);padding:20px 0 40px;font-size:12.5px;color:var(--muted)}
.nx .qs li{margin:6px 0}

/* fixes for living inside the original page */
.nx .headline em{font:inherit;letter-spacing:0;text-transform:none}
.topbar .nav{overflow-x:auto;min-width:0;flex:1 1 auto;scrollbar-width:thin}
.topbar .nav a{flex:0 0 auto}
.nx-brand{border-bottom:1px solid var(--line)}

/* floating time player (left, always visible on the main view) */
.player[hidden]{display:none}
.nx.player{position:fixed;left:12px;top:50%;transform:translateY(-50%);z-index:60;width:96px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 6px 24px rgba(30,20,10,.16);padding:10px 8px;display:flex;flex-direction:column;align-items:center;gap:6px;font:13px/1.3 var(--f-th);color:var(--ink)}
.nx .pl-head{font:600 11px var(--f-head);color:var(--muted);letter-spacing:.04em}
.nx .pl-date{font:600 17px/1.15 var(--f-head);text-align:center}
.nx .pl-sub{font-size:11px;color:var(--muted);text-align:center}
.nx .pl-btns{display:flex;gap:4px}
.nx .pl-btns button{width:26px;height:30px;border:1px solid var(--line);background:#fff;border-radius:5px;cursor:pointer;font-size:11px;color:var(--ink2);padding:0}
.nx .pl-btns #pl-prev{transform:none}
.nx .pl-btns .pl-play{width:34px;background:var(--accent);border-color:var(--accent);color:#fff;font-size:13px}
.nx .pl-speed{font-size:11px;color:var(--muted);display:flex;flex-direction:column;align-items:center}
.nx .pl-speed select{font:inherit;font-size:11px;padding:1px 2px;margin-top:2px}
.nx .pl-dots{display:flex;flex-direction:column;gap:3px;align-items:center;padding:4px 0}
.nx .pl-dot{width:14px;height:9px;border-radius:3px;border:1px solid #b9b1a3;background:#efece5;cursor:pointer;padding:0}
.nx .pl-dot.gap{margin-top:6px}
.nx .pl-dot.hi{border-color:#b92d22}
.nx .pl-dot.on{background:var(--accent);border-color:var(--accent);width:22px}
.nx .pl-go{display:flex;flex-direction:column;gap:3px;width:100%;border-top:1px solid var(--line2);padding-top:6px}
.nx .pl-go span{font-size:10.5px;color:var(--muted);text-align:center}
.nx .pl-go button{border:0;background:var(--accent-soft);color:var(--accent);border-radius:4px;font:500 11.5px var(--f-head);padding:3px 2px;cursor:pointer}
/* package breakpoint was 1180px; raised to 1387px because in this page content starts 28px from the left edge
   and the right column takes 164px, so the left panel would sit on top of the text and the map panel below 1388px */
@media (max-width:1387px){
  .nx.player{top:auto;bottom:10px;left:10px;right:calc(var(--side) + 10px);transform:none;width:auto;flex-direction:row;flex-wrap:wrap;justify-content:center;padding:6px 10px;gap:6px 10px}
  .nx .pl-head,.nx .pl-sub,.nx .pl-speed{display:none}
  .nx .pl-dots{flex-direction:row;padding:0}
  .nx .pl-dot.gap{margin-top:0;margin-left:5px}
  .nx .pl-dot{width:9px;height:14px}.nx .pl-dot.on{width:9px;height:18px}
  .nx .pl-go{flex-direction:row;border-top:0;padding-top:0;width:auto}
  .nx .pl-go span{display:none}
  body{padding-bottom:76px}
}
@media (max-width:640px){ .nx .pl-dots{display:none} }
/* left panel mode: give the page a 120px left rail so nothing sits under the panel; main grows by the same 92px so content keeps its 1060px */
@media (min-width:1388px){ main,.foot{max-width:1372px;padding-left:120px} }
body.map-full-open .player{display:none} /* full-screen map has its own timeline */
.nx .about-open p{margin:8px 0}
.nx .about-open .partners img{height:52px;width:auto;max-width:100%}
/* phones: charts keep a readable size (tick text about 10px) and scroll sideways inside their own box (.cw) */
.nx .cw{overflow-x:auto}
@media(max-width:640px){.nx .cw svg{min-width:900px}
/* only the series-start labels show here; stagger them by visible order, not by image index, so one label is not left alone on row two */
.nx .ticks span:nth-child(odd of .series-start){top:0!important}
.nx .ticks span:nth-child(even of .series-start){top:14px!important}
/* workings tables already scroll sideways in .tw; one line per row keeps the 100-row tables short on phones */
#view-workings td{white-space:nowrap}
}

/* ---- dark mode: same switch as sai-3d.css (:root[data-theme="dark"]). Light mode is untouched: every rule below is dark-only.
   The palette is not repeated here; .nx hands its variables back to the dark values sai-3d.css sets on :root. */
:root[data-theme="dark"] .nx{
  --bg:inherit;--bg2:inherit;--surface:inherit;--surface2:inherit;--line:inherit;--line2:inherit;
  --ink:inherit;--ink2:inherit;--muted:inherit;--red:inherit;--amber:inherit;
  --accent:var(--cyan);--accent-soft:var(--cyan-soft);--green:var(--good);
  --pend:#dba8ee;--pend-soft:rgba(219,168,238,.12);--interp:var(--dim);--ms:#8ab4ff;
}
:root[data-theme="dark"] .nx :is(.btn-go,.eyebrow .num,.seg button[aria-pressed=true]),
:root[data-theme="dark"] .nx .step::before{color:var(--on-cyan)}
:root[data-theme="dark"] .nx :is(.pend,.proto){border-color:rgba(219,168,238,.4)}
:root[data-theme="dark"] .nx .advice{background:var(--accent-soft);border-color:rgba(242,154,63,.45)}
:root[data-theme="dark"] .nx.player{background:var(--surface);box-shadow:0 6px 24px rgba(0,0,0,.5)}
:root[data-theme="dark"] .nx .pl-btns button:not(.pl-play){background:var(--surface2)}
:root[data-theme="dark"] .nx .pl-btns .pl-play{color:var(--on-cyan)}
:root[data-theme="dark"] .nx .pl-dot:not(.on){background:var(--surface2);border-color:var(--line-strong)}
:root[data-theme="dark"] .nx .pl-dot.hi:not(.on){border-color:var(--red)}
:root[data-theme="dark"] .nx .partners img{background:#f6f7f3;border-radius:6px;padding:4px 10px;height:60px} /* logos have dark lettering on transparent */
/* Colours that sai-analysis.js writes straight into SVG attributes and inline styles, matched by value.
   If a colour changes in the JS, change the selector here too. */
:root[data-theme="dark"] .nx svg [stroke^="rgba(52,42,30"]{stroke:var(--line2)}
:root[data-theme="dark"] .nx svg [stroke="rgba(52,42,30,.3)"]{stroke:var(--line-strong)}
:root[data-theme="dark"] .nx svg [fill="#1d4ed8"]{fill:var(--ms)}
:root[data-theme="dark"] .nx svg [stroke="#1d4ed8"]{stroke:var(--ms)}
:root[data-theme="dark"] .nx svg [fill="#2e6f34"]{fill:var(--green)}
:root[data-theme="dark"] .nx svg [stroke="#2e6f34"]{stroke:var(--green)}
:root[data-theme="dark"] .nx svg [fill="#b92d22"]{fill:var(--red)}
:root[data-theme="dark"] .nx svg [stroke="#b92d22"]{stroke:var(--red)}
:root[data-theme="dark"] .nx svg [fill="#b34812"]{fill:var(--accent)}
:root[data-theme="dark"] .nx svg [stroke="#b34812"]{stroke:var(--accent)}
:root[data-theme="dark"] .nx svg [fill="#b45309"]{fill:var(--chart-std)}
:root[data-theme="dark"] .nx svg [stroke="#b45309"]{stroke:var(--chart-std)}
:root[data-theme="dark"] .nx svg [stroke="#a5461a"]{stroke:var(--chart-border-km)}
:root[data-theme="dark"] .nx svg [stroke="#8a8274"]{stroke:var(--muted)}
:root[data-theme="dark"] .nx svg polyline[stroke="#221e19"]{stroke:var(--ink)}
:root[data-theme="dark"] .nx svg circle[fill="#221e19"]{stroke:var(--ink);stroke-width:1.2} /* the text calls it a black dot, so keep it black and ring it */
:root[data-theme="dark"] .nx svg rect[fill="#7c2d12"]{stroke:rgba(244,238,227,.6);stroke-width:.8} /* SA01 stays dark brown as the caption says; outline so it shows on navy */
:root[data-theme="dark"] .nx svg rect[fill="#7c2d92"]{fill:var(--pend);stroke:var(--pend)}
/* group colours used as text (headline, zone labels on the profile chart): same hue, lifted so it reads on navy */
:root[data-theme="dark"] .nx .headline em,
:root[data-theme="dark"] .nx svg text:is([fill="#64748b"],[fill="#0d9488"],[fill="#7c3aed"],[fill="#d97706"],[fill="#e11d48"],[fill="#2563eb"]){filter:brightness(1.7)}
:root[data-theme="dark"] .nx [style*="color:#b92d22"]{color:var(--red)!important}
:root[data-theme="dark"] .nx .bar i[style*="#0369a1"]{background:var(--bar-conf)!important}

/* ==========================================================================
   PHONE LAYOUT · 12 Nov 2569
   Scope: screens up to 760px wide (360–430px phones, portrait). Wider screens are not touched,
   except the two rules right below marked "all widths" (a colour fix, and the section 07 picture the user asked for).
   Every narrow-screen rule lives in this one block. sai-3d.css is not edited; its rules are overridden from here,
   which is why many lines need !important (sai-3d.css uses it too).
   ========================================================================== */

/* all widths: the selected "cards / table" button used var(--navy), which is declared nowhere, so it drew white text on nothing */
.ranking-mode-switch .mode-btn.on{background:var(--cyan)!important;color:var(--on-cyan)!important}

/* all widths (user, 12 Nov): section 07 before/after picture. The timeline laid over the picture hid it, most of it on a phone.
   The picture keeps its own 1200:755 shape at the top and the timeline sits underneath, same dark tone.
   62.917 = 755/1200; cqw lets the zero-width divider and the drag slider match the picture height. */
.ge-compare-wrap{container-type:inline-size;aspect-ratio:auto;min-height:0;padding-top:62.917%}
.ge-compare-wrap > .ge-comp-img,.ge-comp-before-layer,.ge-divider,.ge-range-slider{height:62.917cqw;bottom:auto}
.ge-timeline-overlay{position:static;background:linear-gradient(180deg,#22304a,#0b1320);backdrop-filter:none;-webkit-backdrop-filter:none}

/* a sideways-scroll box shows its hint only when it really overflows: a scroll timeline is inactive on a box with
   nothing to scroll, so this keyframe never applies there. Browsers without scroll timelines run it on time and always show the hint. */
@keyframes sai-scroll-hint{from,to{--sai-hint:block}}

@media (max-width:760px){
  /* -- header. Row 1: logos, name, theme, info. Row 2: the section menu (the desktop left rail laid flat) with Σ and ⚙ pinned right.
        --top is already 102px at this width in sai-3d.css (57 + 45), so page offsets stay as they are. -- */
  .topbar{padding:0!important}
  .topbar-inner{height:57px;gap:8px;padding:0 max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left))}
  .wordmark{flex:1 1 auto;min-width:0}
  .wm-text{min-width:0}
  .wm-text b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .prefs{gap:6px}
  .top-nav{position:absolute;right:0;top:57px;height:45px;margin:0!important;gap:0!important;padding:0 4px;border-left:1px solid var(--line);border-top:1px solid var(--line2)}
  .top-nav-link{width:44px;height:44px;padding:0!important;align-items:center;justify-content:center}
  .top-nav-link small{display:none}
  .top-nav-link b{display:block;font-size:0}                 /* keep the full label for screen readers, show only its glyph */
  .top-nav-link b::first-letter{font-size:21px}
  #gauge-rail:not([hidden]){display:block!important;position:fixed;top:57px;left:0;right:97px;bottom:auto;width:auto;height:45px;padding:0;border:0;border-top:1px solid var(--line2);background:none;z-index:51}
  #gauge-rail::after{content:"";position:absolute;inset:1px 0 0 auto;width:22px;background:linear-gradient(90deg,transparent,var(--bg));pointer-events:none} /* fade = more to the right */
  #gauge-rail .gauge-plate{display:block;height:100%;border:0;border-radius:0;background:none}
  #gauge-rail .gauge-plate::before,#gauge-rail .gauge-water,#gauge-rail .mark-en,#gauge-rail .mark-label{display:none}
  #gauge-rail .gauge-marks{flex-direction:row;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain;padding:0 24px 0 4px}
  #gauge-rail .gauge-marks::-webkit-scrollbar{display:none}
  #gauge-rail .gauge-marks li{flex:none;border:0}
  #gauge-rail .gauge-marks a{height:44px;padding:0 9px;gap:6px;border-left:0;background:none;overflow:visible}
  #gauge-rail .gauge-marks a.is-active{box-shadow:inset 0 -3px 0 var(--cyan)}
  #gauge-rail .mark-info,#gauge-rail .mark-th{overflow:visible}

  /* -- page rhythm: less air so the conclusion and the KPI numbers arrive sooner -- */
  .nx .brand .wrap{padding-top:18px;padding-bottom:14px}
  .nx .brand p.sub{font-size:17px;margin-bottom:12px}
  section.page{padding:26px 0 12px}
  .nx .kpis{gap:8px;margin-top:12px}
  .nx .kpi{display:flex;flex-direction:column;padding:10px 14px}
  .nx .kpi .v{order:-1;margin:0 0 2px}                       /* the number first, then what it is */

  /* -- touch: 44px targets for buttons, fields, box headers -- */
  .sheet-trigger,#day,#exaggeration{min-height:44px}
  .nx label.note{display:inline-flex;align-items:center;gap:8px;min-height:44px}
  .nx label.note input{width:20px;height:20px;flex:none}
  .nx details > summary{padding-block:12px!important}
  .prc-breakdown-drawer > summary{min-height:44px!important}
  .nx .btn,.nx .btn-go{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding-inline:14px}
  .nx .set-row input,.nx .set-row select{min-height:44px;font-size:16px} /* 16px also stops iOS zooming into the field */
  .nx .set-row input{width:96px}
  .nx .set-actions > *{flex:1 1 auto}

  /* -- section 06 ranking cards: the name column was sized by its unwrapped text and pushed the scores off the card -- */
  .priority-rank-card{padding:14px!important}
  .prc-row-main{grid-template-columns:44px minmax(0,1fr)!important;gap:10px 12px!important}
  .prc-right-col{grid-column:1/-1!important;order:2!important;flex-direction:row!important;flex-wrap:wrap!important;align-items:center!important;gap:8px!important}
  .prc-metrics-inline{grid-column:1/-1!important;order:3!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important}
  .mini-lbl{flex-direction:column!important;align-items:flex-start!important}
  #score .zone-mineral-tag,#score .prc-zone small,#score .prc-zone small a{white-space:normal!important}
  .ranking-mode-switch{display:flex!important}
  .ranking-mode-switch .mode-btn{flex:1 1 0;min-height:44px;padding:8px 10px!important}
  /* the card tints and badges only had light-theme colours (a wide-screen dark-mode gap too, left for the card's owner) */
  :root[data-theme="dark"] .priority-rank-card:is(.tier-critical,.tier-high){background:var(--surface)!important}
  :root[data-theme="dark"] #score :is(.tier-badge,.prc-rank-badge){background:var(--surface2)!important;border-color:var(--line-strong)!important;color:var(--ink)!important}
  :root[data-theme="dark"] #score .m-num{filter:brightness(1.6)}

  /* -- tables and charts keep scrolling inside their own box, and now say so -- */
  .nx .tw,.nx .cw{animation:sai-scroll-hint 1s linear both;animation-timeline:scroll(self inline)}
  .nx .tw::before,.nx .cw::before{content:"↔ เลื่อนซ้าย-ขวาเพื่อดูทั้งหมด";display:var(--sai-hint,none);position:sticky;left:0;width:max-content;padding:6px 10px 4px;font:500 14px/1.3 var(--f-head);color:var(--muted)}

  /* -- section 07 picture on a phone: small date badges that stay in their own half; the picture layout itself is in the all-widths rule above -- */
  .ge-timeline-overlay .ge-years span[data-active="true"]{z-index:1;padding:0 4px;border-radius:3px;background:#18243a} /* the active year covers the neighbour it overlaps */
  .ge-badge{top:8px;max-width:calc(50% - 14px);padding:3px 8px;font-size:12px;line-height:1.3}
  .ge-badge-before{left:8px}
  .ge-badge-after{right:8px}

  /* -- nothing meant to be read is below 14px. Left smaller on purpose: zone badges (G1–G6), labels inside the stacked bars,
        unit suffixes (/100), chart axis text, date badges and year marks on the Google Earth picture, the university line in the header -- */
  .eyebrow,.eyebrow .num,.nx .eyebrow,.nx .eyebrow .num,.note,.nx .note,.hint,
  .nx .kpi .t,.nx .kpi .s,.nx .kpi .src,.nx .partners span,
  .nx table,.nx th,.nx td,.nx td small,.nx th small,.team-table td,
  .nx .btn,.nx .seg button,#profile .km-legend-top,.nx .stat span,.nx .stat b span,.nx .daylabel small,.nx .set-row small,.nx .refs .tag,.nx .pend,.nx .mono,
  .sheet-trigger span,.panel .kicker,.panel .sec-title,.panel .sec-title em,.panel .fly button,.panel .txt small,.panel .seg button,.panel .note,.panel .range span,
  #tl-sensor,.timeline .tl-months,.tl-stats,.tl-jump,.tl-legend,#gauge-rail .mark-th,#gauge-rail .mark-num,
  #score .mode-btn,#score .zone-mineral-tag,#score .prc-zone small,#score .m-name,#score .m-num,#score .tier-badge,#score .prc-level b,#score .sum-title,#score .sum-conf,#score .sum-conf b,#score .sub-label,#score .sub-val,#score .sub-val b,
  .tabs button,.facts small,.mine-type-badge,.h3 em,#ge-before-sub,.ge-credit,.ge-hint-text,.ge-after-info b,.ge-after-info small,
  .foot p,.foot button{font-size:14px!important}
  .nx .ticks{font-size:14px;height:40px}
  .nx .ticks span:nth-child(even of .series-start){top:19px!important}
}
