/* ============================================================
   SCCC Queue — Requirement Analysis KB
   Design: "logistics dispatch board"  ·  Thai-first, font: Sarabun
   Body/Display/TH: Sarabun  ·  Data/codes/source-stamps: IBM Plex Mono (Thai falls back to Sarabun)
   ============================================================ */

:root{
  --ink:#14171B; --ink-soft:#3E454E; --muted:#6A7380; --faint:#97A0AC;
  --paper:#E6E9ED; --surface:#FFFFFF; --surface-2:#F3F5F8; --surface-3:#EAEEF2;
  --line:#D3D9E0; --line-soft:#E5E9EE;
  --steel:#1F262E; --steel-2:#2B343E; --steel-line:#3A444F;
  --insee:#E2231A; --insee-deep:#AE140D; --insee-tint:#FCEAE9;
  --st-confirmed:#1C9A5F; --st-confirmed-bg:#E6F5ED;
  --st-stated:#2C6BDC;    --st-stated-bg:#E8F0FD;
  --st-inferred:#7857E6;  --st-inferred-bg:#EEEAFC;
  --st-ambiguous:#CC7A06; --st-ambiguous-bg:#FBF0DC;
  --hazard:#E8A400; --hazard-ink:#5A4300;
  --radius:10px; --radius-sm:6px;
  --shadow:0 1px 2px rgba(20,30,45,.06), 0 6px 20px rgba(20,30,45,.05);
  --shadow-lift:0 10px 30px rgba(20,30,45,.12);
  --maxw:1180px;
  --mono:"IBM Plex Mono","Sarabun",ui-monospace,SFMono-Regular,Menlo,monospace;
  --sans:"Sarabun","IBM Plex Sans Thai",system-ui,-apple-system,"Segoe UI",sans-serif;
  --disp:"Sarabun","IBM Plex Sans Thai",system-ui,sans-serif;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{
  margin:0;background:var(--paper);color:var(--ink);
  font-family:var(--sans);font-weight:400;line-height:1.66;
  font-size:16.5px;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
}
a{color:inherit}
h1,h2,h3,h4{margin:0;line-height:1.25}
::selection{background:var(--insee);color:#fff}

.disp{font-family:var(--disp);font-weight:700;letter-spacing:0}
.eyebrow{font-family:var(--sans);font-size:12px;font-weight:600;letter-spacing:.1em;
  text-transform:uppercase;color:var(--muted)}
.mono{font-family:var(--mono)}

/* ============================================================ TOPBAR */
.topbar{position:sticky;top:0;z-index:40;background:var(--steel);color:#EDF1F5;border-bottom:1px solid var(--steel-line)}
.topbar-in{max-width:var(--maxw);margin:0 auto;padding:7px 24px;min-height:56px;display:flex;align-items:center;gap:16px}
.brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:#fff;font-weight:700;flex:none}
.brand>span{white-space:nowrap;line-height:1.15}
.brand .mark{width:26px;height:26px;border-radius:6px;background:var(--insee);
  display:grid;place-items:center;color:#fff;font-family:var(--disp);font-weight:800;font-size:15px;flex:none}
.brand .mark::after{content:"Q"}
.brand small{display:block;font-family:var(--mono);font-size:10px;letter-spacing:.1em;
  color:#9AA6B2;font-weight:400;text-transform:uppercase;margin-top:0}
.topnav{margin-left:auto;display:flex;gap:2px 3px;flex-wrap:wrap;justify-content:flex-end}
.topnav a{font-family:var(--mono);font-size:11px;letter-spacing:.02em;text-transform:uppercase;white-space:nowrap;
  color:#AEB8C4;text-decoration:none;padding:5px 7px;border-radius:6px}
.topnav a:hover,.topnav a:focus-visible{color:#fff;background:rgba(255,255,255,.08)}
.topnav a.cur{color:#fff;background:var(--insee)}

/* ============================================================ INDEX HERO / BOARD */
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 24px}
.hero{background:var(--steel);color:#EAEEF3;position:relative;overflow:hidden;border-bottom:3px solid var(--insee)}
.hero::before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.5;
  background:repeating-linear-gradient(90deg,transparent 0 78px,rgba(255,255,255,.025) 78px 80px)}
.hero-in{max-width:var(--maxw);margin:0 auto;padding:54px 24px 0;position:relative}
.hero .eyebrow{color:#8FA8C0}
.hero h1{font-family:var(--disp);font-weight:800;font-size:clamp(30px,5vw,52px);
  letter-spacing:-.01em;line-height:1.16;margin:14px 0 10px;color:#fff;max-width:22ch}
.hero h1 .accent{color:var(--insee)}
.hero .lede{color:#B9C5D2;max-width:66ch;font-size:17px;line-height:1.7}
.hero .lede strong{color:#fff}
.hero .meta-docs{display:flex;gap:8px;flex-wrap:wrap;margin-top:22px}
.docchip{font-family:var(--sans);font-size:12.5px;letter-spacing:.01em;color:#CDD6DF;
  background:rgba(255,255,255,.06);border:1px solid var(--steel-line);
  padding:6px 11px;border-radius:6px;text-decoration:none;display:inline-flex;gap:7px;align-items:center}
.docchip:hover{background:rgba(255,255,255,.12);color:#fff}
.docchip b{color:#fff;font-weight:700}

.pillars{display:flex;gap:10px;flex-wrap:wrap;margin-top:26px}
.pillar{flex:1 1 200px;background:rgba(255,255,255,.05);border:1px solid var(--steel-line);
  border-radius:var(--radius);padding:14px 16px}
.pillar .n{font-family:var(--mono);font-size:11px;color:var(--insee);letter-spacing:.1em}
.pillar h3{font-family:var(--disp);font-weight:700;font-size:18px;color:#fff;margin:4px 0 4px}
.pillar p{margin:0;font-size:13.5px;color:#AEBAC6;line-height:1.55}

.readout{margin:28px 0 0;border:1px solid var(--steel-line);border-radius:var(--radius);background:rgba(0,0,0,.18);overflow:hidden}
.readout-h{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--steel-line);
  font-family:var(--sans);font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#94A1AE}
.readout-h .dot{width:7px;height:7px;border-radius:50%;background:var(--insee);box-shadow:0 0 0 3px rgba(226,35,26,.25)}
.readout-grid{display:grid;grid-template-columns:repeat(6,1fr)}
.stat{padding:14px 14px 16px;border-right:1px solid var(--steel-line)}
.stat:last-child{border-right:none}
.stat .v{font-family:var(--disp);font-weight:800;font-size:26px;color:#fff;line-height:1}
.stat .v small{font-size:14px;color:var(--insee);font-weight:700}
.stat .k{font-family:var(--sans);font-size:12px;color:#9BA7B4;letter-spacing:.01em;margin-top:7px;line-height:1.4}
.hero-foot{height:30px}

/* ============================================================ SECTION BLOCKS (index) */
.section{padding:46px 0 8px}
.section-head{display:flex;align-items:baseline;gap:14px;margin-bottom:20px;flex-wrap:wrap}
.section-head h2{font-family:var(--disp);font-weight:700;font-size:25px;letter-spacing:-.01em}
.section-head .rule{flex:1;height:1px;background:var(--line)}
.section-head .count{font-family:var(--sans);font-size:13px;color:var(--muted)}

.oq-band{background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--hazard);
  border-radius:var(--radius);padding:22px 24px;box-shadow:var(--shadow)}
.oq-band .oq-top{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.oq-band .tag{font-family:var(--sans);font-size:12px;font-weight:600;letter-spacing:.04em;
  color:var(--hazard-ink);background:var(--st-ambiguous-bg);padding:3px 10px;border-radius:5px}
.oq-band h2{font-family:var(--disp);font-weight:700;font-size:23px}
.oq-band p.sub{color:var(--ink-soft);margin:5px 0 18px;font-size:15px;max-width:76ch;line-height:1.65}
.oq-list{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}
.oq-item{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid var(--line-soft);
  border-radius:var(--radius-sm);background:var(--surface-2);text-decoration:none;color:inherit}
.oq-item:hover{background:#fff;border-color:var(--hazard);box-shadow:var(--shadow)}
.oq-item .qn{font-family:var(--mono);font-size:11px;color:var(--hazard-ink);font-weight:600;flex:none;
  background:var(--st-ambiguous-bg);width:27px;height:27px;border-radius:5px;display:grid;place-items:center}
.oq-item .qt{font-size:14.5px;line-height:1.45;font-weight:600}
.oq-item .qt span{display:block;font-weight:400;color:var(--muted);font-size:12.5px;margin-top:3px;line-height:1.45}

.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.sec-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:18px 18px 16px;text-decoration:none;color:inherit;display:flex;flex-direction:column;gap:10px;
  box-shadow:var(--shadow);transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease;
  border-top:3px solid var(--accent,var(--steel-2))}
.sec-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lift);border-color:var(--line)}
.sec-card .sc-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.sec-card .sc-id{font-family:var(--mono);font-size:12px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.sec-card .sc-n{font-family:var(--disp);font-weight:800;font-size:15px;color:var(--accent,var(--steel));
  background:var(--surface-3);border-radius:5px;padding:2px 10px}
.sec-card h3{font-family:var(--disp);font-weight:700;font-size:20px;letter-spacing:-.005em;line-height:1.3}
.sec-card p{margin:0;font-size:14px;color:var(--ink-soft);line-height:1.58;flex:1}
.statusbar{display:flex;height:6px;border-radius:4px;overflow:hidden;background:var(--surface-3)}
.statusbar i{display:block;height:100%}
.sc-foot{display:flex;align-items:center;gap:6px;font-family:var(--sans);font-size:12.5px;color:var(--muted)}
.sc-foot .en{font-family:var(--mono);font-size:11px;letter-spacing:.04em;text-transform:uppercase}
.sc-foot .arrow{margin-left:auto;color:var(--insee);font-weight:700}

/* ============================================================ SECTION PAGE LAYOUT */
.page-hd{background:var(--surface);border-bottom:1px solid var(--line)}
.page-hd-in{max-width:var(--maxw);margin:0 auto;padding:30px 24px 26px}
.crumbs{font-family:var(--sans);font-size:13px;color:var(--muted);margin-bottom:12px}
.crumbs a{color:var(--insee);text-decoration:none}
.crumbs a:hover{text-decoration:underline}
.page-hd h1{font-family:var(--disp);font-weight:800;font-size:clamp(26px,4vw,38px);letter-spacing:-.01em;line-height:1.25}
.page-hd h1 .en{font-family:var(--mono);color:var(--muted);font-weight:500;font-size:.42em;letter-spacing:.06em;text-transform:uppercase}
.page-hd .lede{color:var(--ink-soft);max-width:78ch;margin-top:9px;font-size:16px;line-height:1.7}
.page-hd .accent-rail{height:3px;width:54px;background:var(--accent,var(--insee));border-radius:2px;margin-bottom:16px}

.layout{max-width:var(--maxw);margin:0 auto;padding:26px 24px 70px;display:grid;grid-template-columns:248px 1fr;gap:34px;align-items:start}
.toc{position:sticky;top:74px;align-self:start}
.toc h4{font-family:var(--mono);font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin-bottom:10px;padding-left:11px}
.toc a{display:flex;gap:9px;align-items:flex-start;padding:7px 11px;border-radius:6px;
  text-decoration:none;color:var(--ink-soft);font-size:13.5px;line-height:1.4;border-left:2px solid transparent}
.toc a:hover{background:var(--surface);color:var(--ink)}
.toc a.active{background:var(--surface);color:var(--ink);border-left-color:var(--insee);font-weight:600}
.toc a .sdot{width:7px;height:7px;border-radius:50%;margin-top:7px;flex:none}

.col{min-width:0;display:flex;flex-direction:column;gap:18px}

.rec{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);overflow:hidden;scroll-margin-top:74px;border-left:4px solid var(--st)}
.rec[data-status=confirmed]{--st:var(--st-confirmed)}
.rec[data-status=stated]{--st:var(--st-stated)}
.rec[data-status=inferred]{--st:var(--st-inferred)}
.rec[data-status=ambiguous]{--st:var(--st-ambiguous)}
.rec-head{padding:18px 22px 14px;border-bottom:1px solid var(--line-soft)}
.rec-eyebrow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.rec-eyebrow .rid{font-family:var(--mono);font-size:11px;color:var(--muted);letter-spacing:.02em}
.rec-eyebrow .type-pill{font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;
  color:#fff;background:var(--accent,var(--steel-2));padding:2px 7px;border-radius:4px}
.rec h2.rec-title{font-family:var(--sans);font-weight:700;font-size:20px;line-height:1.34;letter-spacing:0}
.badge{font-family:var(--sans);font-size:12px;font-weight:600;letter-spacing:.02em;
  padding:3px 11px;border-radius:20px;color:var(--st);background:var(--st-bg);white-space:nowrap}
.rec[data-status=confirmed] .badge{--st-bg:var(--st-confirmed-bg)}
.rec[data-status=stated] .badge{--st-bg:var(--st-stated-bg)}
.rec[data-status=inferred] .badge{--st-bg:var(--st-inferred-bg)}
.rec[data-status=ambiguous] .badge{--st-bg:var(--st-ambiguous-bg)}

.stamps{display:flex;gap:6px;flex-wrap:wrap;margin-top:13px;align-items:center}
.stamps .lbl{font-family:var(--sans);font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--faint);margin-right:2px}
.src{font-family:var(--mono);font-size:11px;font-weight:500;letter-spacing:.02em;
  color:var(--ink-soft);background:var(--surface-2);border:1px solid var(--line);
  padding:2px 7px;border-radius:5px;cursor:pointer;text-decoration:none;white-space:nowrap;
  display:inline-flex;align-items:center;gap:5px}
.src::before{content:"";width:6px;height:6px;border-radius:1px;background:var(--insee);opacity:.85}
.src[data-doc=sum]::before{background:#2C6BDC}
.src[data-doc=min]::before{background:var(--muted)}
.src:hover{background:#fff;border-color:var(--insee);color:var(--ink)}
.src.static{cursor:default}.src.static:hover{border-color:var(--line);background:var(--surface-2)}

.rec-body{padding:18px 22px 22px;font-size:15.5px;line-height:1.72}
.rec-body>:first-child{margin-top:0}
.rec-body h1,.rec-body h2,.rec-body h3{font-family:var(--sans);letter-spacing:0;margin:22px 0 9px;line-height:1.4}
.rec-body h1{font-size:18.5px;font-weight:700}
.rec-body h2{font-size:16px;font-weight:700;color:var(--ink);padding-bottom:6px;border-bottom:1px solid var(--line-soft)}
.rec-body h3{font-size:14.5px;font-weight:600;color:var(--ink-soft)}
.rec-body p{margin:10px 0}
.rec-body ul,.rec-body ol{margin:10px 0;padding-left:23px}
.rec-body li{margin:5px 0}
.rec-body li::marker{color:var(--insee)}
.rec-body strong{font-weight:700;color:var(--ink)}
.rec-body code{font-family:var(--mono);font-size:.84em;background:var(--surface-3);padding:1px 5px;border-radius:4px;color:var(--insee-deep)}
.rec-body blockquote{margin:11px 0;padding:9px 15px;border-left:3px solid var(--line);color:var(--ink-soft);background:var(--surface-2);border-radius:0 6px 6px 0}
.rec-body a{color:var(--insee-deep);text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}
.xref{font-weight:600;color:var(--insee-deep);text-decoration:none;border-bottom:1px dotted var(--insee);white-space:nowrap}
.xref::before{content:"\2197";font-size:.78em;margin-right:1px;opacity:.6}
.xref:hover{background:var(--insee-tint)}
.rec-body .tbl-scroll{overflow-x:auto;margin:15px 0;border:1px solid var(--line);border-radius:8px}
.rec-body table{border-collapse:collapse;width:100%;font-size:13.5px;min-width:520px}
.rec-body th,.rec-body td{text-align:left;padding:9px 12px;border-bottom:1px solid var(--line-soft);vertical-align:top;line-height:1.55}
.rec-body thead th{background:var(--surface-3);font-family:var(--sans);font-size:11.5px;font-weight:700;
  letter-spacing:.02em;text-transform:uppercase;color:var(--ink-soft);position:sticky;top:0}
.rec-body tbody tr:last-child td{border-bottom:none}
.rec-body tbody tr:hover{background:var(--surface-2)}
.rec-body td code{font-size:.82em}

.rec-rel{padding:13px 22px 16px;border-top:1px solid var(--line-soft);background:var(--surface-2);
  display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.rec-rel .lbl{font-family:var(--sans);font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--faint)}
.rec-rel a{font-size:12.5px;text-decoration:none;color:var(--ink-soft);
  background:var(--surface);border:1px solid var(--line);padding:3px 10px;border-radius:20px;
  max-width:330px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;line-height:1.6}
.rec-rel a:hover{border-color:var(--insee);color:var(--insee-deep)}
.rec-rel a .rt{font-family:var(--mono);font-size:9px;color:var(--faint);text-transform:uppercase;margin-right:6px}

/* ============================================================ GLOSSARY / SOURCES */
.gallery{max-width:var(--maxw);margin:0 auto;padding:26px 24px 70px}
.gal-group{margin-bottom:30px}
.gal-group h3{font-family:var(--disp);font-weight:700;font-size:21px;margin-bottom:5px}
.gal-group p{color:var(--muted);font-size:13.5px;margin:0 0 16px}
.thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:12px}
.thumb{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--surface);cursor:pointer;box-shadow:var(--shadow);transition:transform .12s,box-shadow .12s}
.thumb:hover{transform:translateY(-2px);box-shadow:var(--shadow-lift);border-color:var(--insee)}
.thumb img{width:100%;height:150px;object-fit:cover;object-position:top;display:block;background:#fff}
.thumb .cap{font-family:var(--mono);font-size:10.5px;color:var(--ink-soft);padding:6px 8px;border-top:1px solid var(--line-soft);display:flex;justify-content:space-between}

/* ============================================================ LIGHTBOX */
.lb{position:fixed;inset:0;z-index:90;background:rgba(15,19,24,.86);backdrop-filter:blur(3px);display:none;align-items:center;justify-content:center;padding:28px}
.lb.open{display:flex}
.lb-stage{max-width:1000px;width:100%;max-height:92vh;display:flex;flex-direction:column;gap:10px}
.lb-bar{display:flex;align-items:center;gap:12px;color:#E6EBF0;font-family:var(--mono);font-size:12px}
.lb-bar .ttl{font-weight:600;letter-spacing:.04em}
.lb-bar .sp{flex:1}
.lb-btn{background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.2);color:#fff;font-family:var(--mono);font-size:12px;padding:6px 12px;border-radius:6px;cursor:pointer}
.lb-btn:hover{background:rgba(255,255,255,.2)}
.lb-btn[disabled]{opacity:.35;cursor:default}
.lb-img{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;background:#fff;border-radius:8px;overflow:auto}
.lb-img img{max-width:100%;max-height:84vh;display:block}

/* ============================================================ FOOTER */
.foot{background:var(--steel);color:#9AA6B2;border-top:3px solid var(--insee);margin-top:20px}
.foot-in{max-width:var(--maxw);margin:0 auto;padding:26px 24px;display:flex;gap:18px;flex-wrap:wrap;align-items:center;font-family:var(--sans);font-size:13px;letter-spacing:.01em}
.foot a{color:#CDD6DF;text-decoration:none}.foot a:hover{color:#fff}
.foot .sp{flex:1}

/* ============================================================ A11Y / RESPONSIVE */
:focus-visible{outline:2px solid var(--insee);outline-offset:2px;border-radius:3px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
@media (max-width:920px){
  .readout-grid{grid-template-columns:repeat(3,1fr)}
  .stat:nth-child(3){border-right:none}
  .grid{grid-template-columns:repeat(2,1fr)}
  .oq-list{grid-template-columns:1fr}
  .layout{grid-template-columns:1fr;gap:8px}
  .toc{position:static;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);padding:14px 12px;margin-bottom:8px}
}
@media (max-width:620px){
  .readout-grid{grid-template-columns:repeat(2,1fr)}
  .stat:nth-child(3){border-right:1px solid var(--steel-line)}
  .stat:nth-child(2n){border-right:none}
  .grid{grid-template-columns:1fr}
  .pillars{flex-direction:column}
  .topnav{display:none}
  .hero h1{font-size:29px}
}
