/* ยกระดับผลสัมฤทธิ์ด้วยครูน่าน 1 — โทนกรมท่า/ทองเดียวกับ portal + ม่วงจากโปสเตอร์โครงการ */
:root {
  --navy-900: #071528;
  --navy-800: #0b1f3a;
  --navy-700: #12305a;
  --gold-300: #f6d78f;
  --gold-400: #f3c969;
  --gold-600: #b9842a;
  --violet-700: #4c1d95;
  --violet-600: #5b21b6;
  --violet-100: #ede9fe;
  --blue-600: #2f5fc4;

  --bg: #f6f4ef;
  --bg-alt: #efece4;
  --surface: #ffffff;
  --ink: #14233d;
  --ink-soft: #4b5873;
  --ink-mute: #7b869b;
  --line: #e6e1d5;
  --ok: #0f766e;
  --shadow-sm: 0 1px 2px rgba(20,35,61,.06), 0 4px 14px rgba(20,35,61,.05);
  --shadow-md: 0 2px 4px rgba(20,35,61,.05), 0 16px 40px rgba(20,35,61,.12);
  --radius: 18px;
  --wrap: 1680px; /* เนื้อหาขยายตามจอ — จำกัดเฉพาะจอกว้างมากให้อ่านง่าย */
  --top-h: 62px;

  /* สีประจำวิชาเดียวกับหน้าผังข้อสอบใน DSMS */
  --c-THAI: #e11d48; --c-ENG: #d97706; --c-MATH: #4f46e5; --c-SCI: #059669; --c-RT: #7c3aed;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  margin: 0;
  font-family: "Sarabun", system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .prompt, .btn, .tabs, .chip { font-family: "Prompt", sans-serif; }
a { color: inherit; }
img { max-width: 100%; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 3vw, 44px); }
.muted { color: var(--ink-mute); }
[hidden] { display: none !important; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 2px; }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--navy-900); }
.btn-blue { background: linear-gradient(135deg, #3b6fd8, #1b3f8f); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-line { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: var(--gold-600); }
.btn-text { background: transparent; color: inherit; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- โครงหน้า: เมนูด้านซ้าย + เนื้อหา ---------- */
:root { --side-w: 264px; }
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
.main > main { flex: 1; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 70;
  display: flex; flex-direction: column; gap: 4px; padding: 18px 14px;
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900)); color: #fff;
  border-right: 1px solid rgba(255,255,255,.06);
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.1); text-decoration: none; color: #fff; }
.side-brand .logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 22px; color: var(--navy-900); background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); }
.side-brand b { display: block; font-family: "Prompt", sans-serif; font-weight: 600; font-size: 16px; line-height: 1.25; }
.side-brand small { display: block; font-family: "Prompt", sans-serif; color: var(--gold-300); font-size: 13.5px; }
.side-nav { display: grid; gap: 2px; }
.nav-i {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none;
  font-family: "Prompt", sans-serif; font-size: 15px; color: rgba(255,255,255,.72); transition: background .15s ease, color .15s ease;
}
.nav-i .ico { font-size: 19px; flex: none; }
.nav-i span { flex: 1; min-width: 0; }
.nav-i:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-i.on { background: rgba(243,201,105,.14); color: #fff; box-shadow: inset 3px 0 0 var(--gold-400); }
.nav-i.on .ico { color: var(--gold-400); }
.nav-i:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 1px; }
.nav-n { font-style: normal; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; background: var(--gold-400); color: var(--navy-900); font-size: 12.5px; font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: 2px; }
.side-foot .nav-i { font-size: 14px; }
.layout { transition: grid-template-columns .22s ease; }
.side-top { display: flex; align-items: flex-start; gap: 6px; }
.side-top .side-brand { flex: 1; min-width: 0; }
.side-pin {
  flex: none; width: 34px; height: 34px; margin-top: 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18);
  background: transparent; color: rgba(255,255,255,.75); display: grid; place-items: center; cursor: pointer; font-size: 18px;
}
.side-pin:hover { color: #fff; border-color: var(--gold-400); }
.side-pin .ico { transition: transform .2s ease; }
/* ย่อเมนูเหลือแถบไอคอน — เนื้อหาได้พื้นที่เต็มจอ (จำค่าไว้ในเบราว์เซอร์) */
body.side-mini { --side-w: 76px; }
body.side-mini .side { padding: 18px 10px; }
body.side-mini .side-top { flex-direction: column; align-items: center; }
body.side-mini .side-brand { padding: 4px 0 14px; justify-content: center; }
body.side-mini .side-brand > span:not(.logo), body.side-mini .nav-i span { display: none; }
body.side-mini .side-pin { margin: 0 0 6px; }
body.side-mini .side-pin .ico { transform: rotate(180deg); }
body.side-mini .nav-i { justify-content: center; padding: 11px 0; position: relative; }
body.side-mini .nav-n { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; font-size: 11px; padding: 0 4px; }
.mtop { display: none; }
.side-overlay { display: none; }
.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.3; }
.page-head p { margin: 6px 0 0; color: var(--ink-soft); max-width: 860px; }
.next-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.tile:hover { transform: translateY(-3px); border-color: var(--gold-600); }
.tile .t-ic { font-size: 28px; line-height: 1; }
.tile b { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 17px; }
.tile p { margin: 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; }
.tile-hl { background: linear-gradient(135deg, var(--violet-600), var(--navy-700)); border-color: transparent; color: #fff; }
.tile-hl p { color: rgba(255,255,255,.8); }
.how-l { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.how-l h3 { margin: 0 0 8px; font-size: 18px; color: var(--violet-700); }
.how-l ol { margin: 0; padding-left: 20px; color: var(--ink-soft); }
.how-l li { margin-bottom: 6px; }
.progress { margin-bottom: 20px; font-family: "Prompt", sans-serif; }
.progress .track { height: 10px; background: #f1eee6; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress .fill { height: 100%; background: linear-gradient(90deg, var(--ok), #34d399); border-radius: 999px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(900px 420px at 85% 0%, rgba(124,58,237,.45), transparent 70%),
    radial-gradient(700px 380px at 0% 100%, rgba(243,201,105,.18), transparent 70%),
    linear-gradient(160deg, var(--navy-800), var(--navy-900) 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.hero-inner { position: relative; z-index: 1; padding: 64px 16px 56px; }
.eyebrow {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  border: 1px solid rgba(243,201,105,.45); background: rgba(243,201,105,.1);
  color: var(--gold-300); font-family: "Prompt", sans-serif; font-size: 13.5px;
}
.hero h1 { margin: 18px 0 14px; font-size: clamp(34px, 5.4vw, 60px); line-height: 1.15; font-weight: 700; }
.hero h1 span {
  background: linear-gradient(90deg, var(--gold-300), var(--gold-400) 40%, #fff3cf);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { max-width: 760px; margin: 0; font-size: clamp(16px, 1.6vw, 18.5px); color: rgba(255,255,255,.82); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 34px; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 900px; }
.stats li {
  padding: 14px 16px; border-radius: 16px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
}
.stats b { display: block; font-family: "Prompt", sans-serif; font-size: 28px; font-weight: 600; color: var(--gold-400); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stats span { font-size: 13.5px; color: rgba(255,255,255,.72); }

/* ---------- Section ---------- */
.sec { padding: 64px 0; }
.sec-alt { background: var(--bg-alt); }
.sec-dark { background: linear-gradient(160deg, var(--navy-800), var(--violet-700)); color: #fff; }
.sec-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 28px; }
.sec-no {
  flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  font-family: "Prompt", sans-serif; font-weight: 600; font-size: 18px;
  background: linear-gradient(135deg, var(--violet-600), var(--navy-700)); color: var(--gold-300);
  box-shadow: var(--shadow-sm);
}
.sec-head h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.3; }
.sec-head p { margin: 4px 0 0; color: var(--ink-soft); max-width: 820px; }
.sec-head.light p { color: rgba(255,255,255,.75); }
.sub-title { margin: 40px 0 16px; font-size: 21px; }

.grid-2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
.stack { display: grid; gap: 20px; align-content: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 10px; font-size: 19px; display: flex; align-items: center; gap: 10px; }
.card p { margin: 0 0 12px; color: var(--ink-soft); }
.card p:last-child { margin-bottom: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold-400); box-shadow: 0 0 0 4px rgba(243,201,105,.25); display: inline-block; }
.num { margin: 0; padding-left: 22px; color: var(--ink-soft); }
.num li { margin-bottom: 6px; }
.goal { display: grid; gap: 14px; }
.goal p, .goal ul { margin: 6px 0 0; color: var(--ink-soft); }
.goal ul { padding-left: 20px; }
.goal b { color: var(--ink); }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-family: "Prompt", sans-serif; font-size: 13px;
  background: var(--violet-100); color: var(--violet-700);
}
.tag-gold { background: #fdf3d8; color: #8a5a10; }

.terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.term { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; border-top: 3px solid var(--violet-600); }
.term b { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 16.5px; }
.term p { margin: 6px 0 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; }

.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.role { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.role b { display: block; font-family: "Prompt", sans-serif; font-weight: 600; color: var(--violet-700); line-height: 1.4; }
.role p { margin: 8px 0 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; }

/* ---------- ชิป/แท็บ ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; color: var(--ink-soft); cursor: pointer; transition: all .15s ease;
}
.chip:hover { border-color: var(--gold-600); color: var(--ink); }
.chip.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.chip .n { opacity: .65; margin-left: 4px; font-size: 12.5px; }
.chip[data-subj].on { background: var(--c, var(--navy-800)); border-color: var(--c, var(--navy-800)); }
.tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button {
  padding: 8px 20px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font-family: "Prompt", sans-serif; font-size: 15px; color: var(--ink-soft);
}
.tabs button.on { background: linear-gradient(135deg, var(--violet-600), var(--navy-700)); color: #fff; }
.tabs button small { opacity: .7; margin-left: 4px; }

/* ---------- ตารางกลุ่ม ---------- */
#groupFilter { margin-bottom: 14px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.tbl { width: 100%; border-collapse: collapse; min-width: 520px; }
.tbl th { background: var(--navy-800); color: #fff; font-family: "Prompt", sans-serif; font-weight: 500; text-align: left; padding: 12px 16px; font-size: 15px; }
.tbl td { padding: 10px 16px; border-top: 1px solid var(--line); }
.tbl tr.dim td { opacity: .35; }
.tbl .no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy-800); color: #fff; font-size: 13px; font-family: "Prompt", sans-serif; }
.subj {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; border: 0; cursor: pointer;
  font-family: "Sarabun", sans-serif; font-size: 15px; font-weight: 600;
  background: color-mix(in srgb, var(--c) 12%, white); color: var(--c);
}
.subj, .bank-n { text-decoration: none; }
.subj:hover { background: color-mix(in srgb, var(--c) 22%, white); }
.note { margin: 12px 0 0; color: var(--ink-soft); font-size: 14.5px; }

/* ---------- ไทม์ไลน์ ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl { position: relative; display: grid; grid-template-columns: 40px 190px 1fr; gap: 16px; padding: 10px 0; }
.tl-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); z-index: 1; font-family: "Prompt", sans-serif; font-size: 13px; color: var(--ink-mute); }
.tl.done .tl-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl.now .tl-dot { background: var(--gold-400); border-color: var(--gold-600); color: var(--navy-900); box-shadow: 0 0 0 6px rgba(243,201,105,.3); }
.tl-date { font-family: "Prompt", sans-serif; font-weight: 600; color: var(--violet-700); padding-top: 7px; line-height: 1.4; }
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.tl.now .tl-card { border-color: var(--gold-600); box-shadow: var(--shadow-md); }
.tl-card b { display: block; }
.tl-card .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.tl-card .meta span::before { content: attr(data-l) " "; color: var(--ink-mute); }
.badge-now { display: inline-block; margin-left: 8px; padding: 1px 10px; border-radius: 999px; background: #fdf3d8; color: #8a5a10; font-size: 12.5px; font-family: "Prompt", sans-serif; font-weight: 500; vertical-align: 2px; }

/* ---------- ผังข้อสอบ (รูปแบบเดียวกับหน้าผังการสร้างข้อสอบใน DSMS) ---------- */
.loading, .empty { padding: 40px; text-align: center; color: var(--ink-mute); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.bp-body { min-height: 200px; --acc: var(--violet-600); --acc-2: var(--violet-700); --acc-soft: var(--violet-100); }
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex: none; }

.bp-sel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; margin-bottom: 22px; }
.sel-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.sel-row + .sel-row { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sel-label { min-width: 100px; font-family: "Prompt", sans-serif; font-size: 13.5px; font-weight: 500; color: var(--ink-mute); display: inline-flex; align-items: center; gap: 6px; }
.sel-label .ico { color: var(--violet-600); }
.bchip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  font-family: "Prompt", sans-serif; font-size: 14.5px; transition: all .15s ease;
}
.bchip:hover { border-color: var(--c, var(--violet-600)); color: var(--ink); transform: translateY(-1px); }
.bchip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--violet-600)); }
.bchip small { opacity: .7; font-size: 12.5px; }
.bchip.on { background: var(--c, linear-gradient(135deg, var(--violet-600), var(--navy-700))); border-color: transparent; color: #fff; box-shadow: 0 8px 16px -10px var(--c, var(--violet-600)); }
.bchip.on .dot { background: #fff; }
.bchip.exam.on { background: linear-gradient(135deg, var(--violet-600), var(--navy-700)); }

.bsec { margin-bottom: 24px; }
.bsec-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.bsec-head .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; font-size: 18px; color: var(--acc); background: var(--acc-soft); }
.bsec-head h3 { margin: 0; font-size: 19px; line-height: 1.35; }
.bsec-head small { display: block; color: var(--ink-mute); font-size: 14px; }
.bsec-head .act { margin-left: auto; }

.hero-bp {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; margin-bottom: 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--acc), var(--acc-2)); color: #fff; box-shadow: var(--shadow-md);
}
.hero-bp .ic { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; background: rgba(255,255,255,.18); font-size: 26px; flex: none; }
.hero-bp h3 { margin: 0; font-size: 22px; line-height: 1.3; }
.hero-bp p { margin: 2px 0 0; opacity: .85; }
.hero-bp .act { margin-left: auto; }
.hero-bp .btn { background: #fff; color: var(--acc-2); }

.bkpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.bkpi { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.bkpi::after { content: ""; position: absolute; right: -14px; top: -14px; width: 56px; height: 56px; border-radius: 50%; background: var(--acc-soft); opacity: .8; }
.bkpi .k-ic { color: var(--acc); font-size: 17px; position: relative; z-index: 1; }
.bkpi .k-val { font-family: "Prompt", sans-serif; font-size: 26px; font-weight: 600; line-height: 1.2; margin-top: 4px; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.bkpi .k-val small { font-size: 14px; font-weight: 500; color: var(--ink-soft); margin-left: 4px; }
.bkpi .k-lbl { font-size: 13.5px; color: var(--ink-mute); position: relative; z-index: 1; }

.bfmts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.bfmt { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.bfmt .f-no { display: inline-block; font-family: "Prompt", sans-serif; font-size: 12.5px; color: var(--acc-2); background: var(--acc-soft); padding: 1px 10px; border-radius: 999px; }
.bfmt .f-name { font-family: "Prompt", sans-serif; font-weight: 500; font-size: 16px; margin: 8px 0 10px; line-height: 1.4; }
.bfmt .f-stats { display: flex; gap: 8px; }
.bfmt .f-stat { flex: 1; text-align: center; background: #f8f6f1; border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px; }
.bfmt .f-stat b { display: block; font-family: "Prompt", sans-serif; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bfmt .f-stat span { font-size: 12px; color: var(--ink-mute); }
.bfmt .f-scale { margin-top: 8px; font-size: 13px; color: var(--ink-soft); }

.bpanel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.dist-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; font-size: 14px; }
.dist-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; }
.dist-bar { display: flex; height: 28px; border-radius: 9px; overflow: hidden; }
.dist-bar div { display: flex; align-items: center; justify-content: center; color: #fff; font-family: "Prompt", sans-serif; font-size: 13px; min-width: 0; overflow: hidden; white-space: nowrap; }
.dist-rows { margin-top: 14px; display: grid; gap: 8px; }
.dist-row { display: grid; grid-template-columns: minmax(150px, 230px) 1fr auto; align-items: center; gap: 12px; font-size: 14.5px; }
.dist-row .name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dist-row .track { height: 12px; background: #f1eee6; border-radius: 999px; overflow: hidden; }
.dist-row .fill { height: 100%; border-radius: 999px; }
.dist-row .val { font-size: 13.5px; color: var(--ink-mute); white-space: nowrap; font-variant-numeric: tabular-nums; }

.bstrand { margin-bottom: 18px; }
.bstrand-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; margin-bottom: 10px;
  background: linear-gradient(90deg, var(--str-soft), transparent 130%); border: 1px solid var(--line);
}
.bstrand-head .num { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--str); font-family: "Prompt", sans-serif; font-weight: 600; flex: none; }
.bstrand-head .title { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 17px; }
.bstrand-head .meta { margin-left: auto; font-size: 13.5px; color: var(--ink-mute); white-space: nowrap; }
.bstd { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); margin-bottom: 12px; overflow: hidden; }
.bstd-top { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; }
.bstd-code { flex: none; font-family: "Prompt", sans-serif; font-weight: 600; font-size: 14px; color: #fff; background: var(--str); padding: 4px 11px; border-radius: 9px; white-space: nowrap; }
.bstd-desc { flex: 1; font-size: 15.5px; line-height: 1.55; }
.bstd-badges { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex: none; }
.bbadge { font-family: "Prompt", sans-serif; font-size: 12.5px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.bbadge.score { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.bbadge.ind { background: var(--acc-soft); color: var(--acc-2); border: 1px solid var(--line); }
.bstd-body { padding: 0 16px 16px; }
.fmt-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); background: #f8f6f1; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.fmt-line b { color: var(--ink); font-weight: 600; }
.fmt-line .bank-n { margin-left: auto; }
.grid-ind { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; }
.bsub { font-family: "Prompt", sans-serif; font-size: 13px; font-weight: 500; color: var(--ink-mute); margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.bsub .ico { color: var(--acc); }
.bind { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed #ece8de; }
.bind:last-child { border-bottom: 0; }
.bind .code { flex: none; min-width: 58px; text-align: center; font-family: "Prompt", sans-serif; font-size: 13px; font-weight: 600; color: var(--str); background: var(--str-soft); padding: 2px 8px; border-radius: 7px; }
.bind .detail { flex: 1; font-size: 14.5px; line-height: 1.5; }
.bcore { display: grid; gap: 8px; font-size: 14.5px; }
.bcore b { font-weight: 600; }
.bcore ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 14px; }
.bqual { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf8; }
.bqual summary { cursor: pointer; list-style: none; padding: 9px 14px; font-family: "Prompt", sans-serif; font-size: 14px; color: var(--ink-soft); }
.bqual summary::-webkit-details-marker { display: none; }
.bqual summary::after { content: " ▾"; color: var(--ink-mute); }
.bqual .q-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 14px 12px; }
.bqual h4 { margin: 0 0 4px; font-family: "Prompt", sans-serif; font-size: 13.5px; font-weight: 500; color: var(--acc-2); }
.bqual p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }

.bank-n {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-family: "Prompt", sans-serif; font-size: 12.5px; cursor: pointer; color: var(--ink-mute); white-space: nowrap; flex: none;
}
.bank-n.has { border-color: color-mix(in srgb, var(--acc) 45%, white); color: var(--acc-2); background: var(--acc-soft); }
.bank-n.has:hover { background: var(--acc); color: #fff; border-color: var(--acc); }
.bank-n[disabled] { cursor: default; }

.btable-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.btable { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 760px; }
.btable th { background: var(--acc-2); color: #fff; font-family: "Prompt", sans-serif; font-weight: 500; padding: 9px 10px; border: 1px solid rgba(255,255,255,.2); text-align: center; line-height: 1.35; }
.btable td { padding: 8px 10px; border: 1px solid #ece8de; vertical-align: top; }
.btable .left { text-align: left; }
.btable td.num { text-align: center; font-variant-numeric: tabular-nums; width: 76px; }
.btable td.zero { color: #cfc8b8; }
.btable tr.r-strand td { background: var(--acc-soft); color: var(--acc-2); font-family: "Prompt", sans-serif; font-weight: 600; }
.btable tr.r-std td { background: #f8f6f1; font-weight: 600; }
.btable tr.r-total td { background: #f4f1ea; font-family: "Prompt", sans-serif; font-weight: 500; }
.btable .ic-code { display: inline-block; min-width: 54px; margin-right: 8px; padding: 1px 7px; border-radius: 6px; text-align: center; font-family: "Prompt", sans-serif; font-size: 12.5px; color: var(--acc-2); background: var(--acc-soft); }
.btable td.bank { width: 120px; text-align: center; }

.bnote { display: flex; gap: 10px; padding: 12px 16px; border-radius: 14px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 14.5px; line-height: 1.6; }
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.insights .card { padding: 18px; }
.insights h4 { margin: 0 0 6px; font-family: "Prompt", sans-serif; font-size: 16px; font-weight: 600; }
.insights ul { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--ink-soft); }
.insights .lv { font-size: 12.5px; padding: 1px 9px; border-radius: 999px; margin-left: 6px; font-weight: 500; }
.insights .lv-major { background: #fee2e2; color: #b91c1c; }
.insights .lv-minor { background: #fef3c7; color: #92400e; }
.insights .lv-same { background: #dcfce7; color: #166534; }
.rt-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.rt-groups .card ul { margin: 6px 0 0; padding-left: 18px; font-size: 14.5px; color: var(--ink-soft); }
@media (max-width: 900px) {
  .grid-ind, .bqual .q-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sel-label { min-width: 100%; }
  .bstd-top { flex-wrap: wrap; }
  .bstd-badges { flex-direction: row; }
  .dist-row { grid-template-columns: 1fr; gap: 4px; }
  .hero-bp .act { margin-left: 0; }
}

/* ---------- คลังข้อสอบ ---------- */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.filters .tabs { background: #f4f1ea; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.select { display: inline-flex; align-items: center; gap: 8px; font-family: "Prompt", sans-serif; font-size: 14px; color: var(--ink-soft); }
.select select { font: inherit; padding: 6px 30px 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.select select { max-width: 340px; }
#bankInd { max-width: 460px; }
.search { font: 15px "Sarabun", sans-serif; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-width: 200px; }
.year-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 8px 0 -4px; font-family: "Prompt", sans-serif; font-weight: 600; font-size: 17px; color: var(--violet-700); }
.year-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.year-head small { font-family: "Sarabun", sans-serif; font-weight: 400; font-size: 14px; color: var(--ink-mute); }
.item-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.active-filter { margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--violet-100); color: var(--violet-700); font-size: 14.5px; }
.active-filter button { border: 0; background: var(--violet-700); color: #fff; border-radius: 999px; padding: 2px 12px; cursor: pointer; font-family: "Prompt", sans-serif; font-size: 13px; }
.bank-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.item {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease;
}
.item.sel { border-color: var(--gold-600); box-shadow: 0 0 0 3px rgba(243,201,105,.45); }
.item-img { aspect-ratio: 4 / 3; background: #f4f1ea; display: block; width: 100%; border: 0; padding: 0; cursor: zoom-in; overflow: hidden; }
.item-img img { width: 100%; height: 100%; object-fit: contain; object-position: top center; background: #fff; display: block; }
.item-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; border-top: 1px solid var(--line); }
.item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.item-top b { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 15px; }
.item-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.item-tags span { font-size: 12.5px; padding: 1px 8px; border-radius: 999px; background: #f4f1ea; color: var(--ink-soft); }
.item-tags span.ty { background: var(--violet-100); color: var(--violet-700); }
.item-foot { margin-top: auto; display: flex; gap: 8px; }
.item-foot .btn { flex: 1; }
.pick.on { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.more { text-align: center; margin-top: 18px; }

/* ---------- วิธีใช้ ---------- */
.how { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius); padding: 22px 24px; }
.how h3 { margin: 0 0 8px; color: var(--gold-300); font-size: 19px; }
.how ol { margin: 0; padding-left: 20px; color: rgba(255,255,255,.85); }
.how li { margin-bottom: 6px; }
.how b { color: #fff; }

.foot { padding: 28px 16px 120px; text-align: center; font-size: 14px; line-height: 1.8; color: var(--ink-soft); background: var(--bg-alt); border-top: 1px solid var(--line); }
.foot strong { color: var(--ink); font-weight: 600; }

/* ---------- ตะกร้า ---------- */
.basket {
  position: fixed; left: var(--side-w); right: 0; bottom: 0; z-index: 60;
  background: rgba(7,21,40,.96); color: #fff; border-top: 1px solid rgba(243,201,105,.4);
  box-shadow: 0 -10px 30px rgba(0,0,0,.25);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.basket-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.basket-count { background: transparent; border: 0; color: #fff; font-family: "Prompt", sans-serif; font-size: 15px; cursor: pointer; padding: 6px 0; text-align: left; }
.basket-count b { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 999px; background: var(--gold-400); color: var(--navy-900); margin-right: 6px; }
.basket-count .muted { color: rgba(255,255,255,.6); font-size: 13.5px; }
.basket-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.basket-actions .btn-text { color: rgba(255,255,255,.75); }
.basket-list { max-height: 40vh; overflow: auto; padding-bottom: 12px; display: grid; gap: 6px; }
.b-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.06); font-size: 14.5px; }
.b-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-row button { border: 0; background: transparent; color: rgba(255,255,255,.7); cursor: pointer; font-size: 18px; }
.b-row .mv { font-size: 14px; padding: 0 4px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(7,21,40,.7); display: grid; place-items: center; padding: 16px; }
.modal-box { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-md); overflow: hidden; }
.modal-wide { max-width: 920px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head b { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 17px; }
.modal-body { padding: 16px 20px; overflow: auto; color: var(--ink-soft); }
.modal-body ol { padding-left: 20px; margin: 8px 0; }
.modal-body .warn { padding: 10px 14px; border-radius: 12px; background: #fdf3d8; color: #6b4a10; margin: 10px 0; font-size: 14.5px; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }
.x { border: 0; background: #f4f1ea; width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-soft); flex: none; }
.seg { display: inline-flex; margin: 12px 20px 0; padding: 3px; border-radius: 999px; background: #f4f1ea; gap: 3px; align-self: flex-start; }
.seg button { border: 0; background: transparent; padding: 5px 16px; border-radius: 999px; cursor: pointer; font-family: "Prompt", sans-serif; font-size: 14px; color: var(--ink-soft); }
.seg button.on { background: var(--navy-800); color: #fff; }
.seg button[disabled] { opacity: .4; cursor: not-allowed; }
.viewer-img { padding: 12px 20px; overflow: auto; flex: 1; text-align: center; }
.viewer-img img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- มือถือ ---------- */
@media (max-width: 960px) {
  .layout, body.side-mini .layout { grid-template-columns: 1fr; }
  .side-pin { display: none; }
  body.side-mini .side-brand > span:not(.logo), body.side-mini .nav-i span { display: initial; }
  body.side-mini .nav-i { justify-content: flex-start; padding: 10px 12px; }
  body.side-mini .side-top { flex-direction: row; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 84vw); height: auto; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 10px 0 40px rgba(0,0,0,.3); }
  body.side-open .side { transform: none; }
  .side-overlay { position: fixed; inset: 0; z-index: 65; background: rgba(7,21,40,.55); }
  body.side-open .side-overlay { display: block; }
  .mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 50; height: 56px; padding: 0 12px; background: rgba(7,21,40,.95); color: #fff; }
  .hamb { width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: transparent; color: #fff; font-size: 22px; display: grid; place-items: center; cursor: pointer; }
  .mtop-title { font-family: "Prompt", sans-serif; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .basket, body.side-mini .basket { left: 0; }
  body.side-mini .side { padding: 18px 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .tl { grid-template-columns: 40px 1fr; }
  .tl-date { grid-column: 2; padding-top: 0; }
  .tl-card { grid-column: 2; }
  .tl-dot { grid-row: 1 / span 2; }
}
@media (max-width: 640px) {
  .hero-inner { padding: 40px 16px 36px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats b { font-size: 24px; }
  .sec { padding: 44px 0; }
  .sec-head { gap: 12px; }
  .sec-no { width: 42px; height: 42px; font-size: 15px; border-radius: 12px; }
  .card { padding: 18px; }
  .bp-top { grid-template-columns: 1fr; }
  .ind { grid-template-columns: 1fr auto; }
  .ind-code { grid-column: 1 / -1; }
  .items { grid-template-columns: 1fr; }
  .basket-actions { width: 100%; }
  .basket-actions .btn { flex: 1; }
  .tabs button { padding: 7px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* =====================================================================
   หน้าเนื้อหา (แนวทาง · กลุ่มเป้าหมาย · ปฏิทิน) — แบนเนอร์เต็มความกว้าง + ส่วนเนื้อหาแบบ section
   ===================================================================== */
.phero {
  position: relative; overflow: hidden; color: #fff; padding: clamp(36px, 5vw, 64px) 0 clamp(30px, 4vw, 52px);
  background:
    radial-gradient(800px 380px at 90% -10%, rgba(124,58,237,.55), transparent 70%),
    radial-gradient(600px 320px at -5% 110%, rgba(243,201,105,.22), transparent 70%),
    linear-gradient(150deg, var(--navy-800), var(--navy-900) 75%);
}
.phero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent 90%); }
.phero .wrap { position: relative; z-index: 1; }
.phero h1 { margin: 16px 0 10px; font-size: clamp(30px, 4.4vw, 54px); line-height: 1.15; font-weight: 700; }
.phero h1 span { background: linear-gradient(90deg, var(--gold-300), var(--gold-400) 40%, #fff3cf); -webkit-background-clip: text; background-clip: text; color: transparent; }
.phero.sm h1 { font-size: clamp(26px, 3.4vw, 42px); }
.phero .lead b { color: var(--gold-300); }
.pmetrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 26px; }
.pmetrics > div { padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.pmetrics b { display: block; font-family: "Prompt", sans-serif; font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; color: var(--gold-400); line-height: 1.15; font-variant-numeric: tabular-nums; }
.pmetrics b small { font-size: .55em; margin-left: 2px; color: var(--gold-300); }
.pmetrics b.mc { color: var(--mc); filter: brightness(1.45); }
.pmetrics span { font-size: 13.5px; color: rgba(255,255,255,.75); }
.pbody { padding-top: clamp(28px, 4vw, 52px); padding-bottom: 40px; }
.psec { margin-bottom: clamp(36px, 5vw, 64px); }
.psec-head { margin-bottom: 20px; max-width: 980px; }
.psec-head.row { max-width: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
.psec-head h2 { margin: 4px 0 0; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.3; }
.psec-head p { margin: 6px 0 0; color: var(--ink-soft); }
.kicker { font-family: "Prompt", sans-serif; font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--violet-600); text-transform: uppercase; }

/* กระบวนการ 5 ขั้น */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; counter-reset: none; }
.step {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 18px 18px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-top: 5px solid var(--c);
  transition: transform .2s ease, box-shadow .2s ease;
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.step:not(:last-child)::after {
  content: "→"; position: absolute; right: -16px; top: 46px; z-index: 2; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--c); color: #fff; font-size: 14px; box-shadow: 0 0 0 4px var(--bg);
}
.s-no { position: absolute; top: 14px; right: 16px; font-family: "Prompt", sans-serif; font-size: 40px; font-weight: 700; line-height: 1; color: var(--c); opacity: .14; }
.s-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: color-mix(in srgb, var(--c) 12%, white); }
.step h3 { margin: 4px 0 0; font-size: 18px; line-height: 1.35; }
.step p { margin: 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; flex: 1; }
.s-out { font-family: "Prompt", sans-serif; font-size: 13px; color: var(--c); background: color-mix(in srgb, var(--c) 9%, white); border-radius: 10px; padding: 6px 10px; line-height: 1.45; }
.s-act { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.s-act a { font-family: "Prompt", sans-serif; font-size: 13.5px; color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--c); }
.s-act a:hover { color: var(--c); }

/* ปัญหา → แนวทาง */
.why { display: grid; grid-template-columns: 1fr auto 1.2fr; gap: 18px; align-items: stretch; }
.why-card { border-radius: 22px; padding: clamp(20px, 2.4vw, 32px); }
.why-card h3 { margin: 6px 0 10px; font-size: clamp(19px, 1.8vw, 24px); line-height: 1.35; }
.why-card p { margin: 0; line-height: 1.75; }
.why-prob { background: #fff1f2; border: 1px solid #fecdd3; }
.why-prob .kicker { color: #be123c; }
.why-sol { background: linear-gradient(140deg, var(--violet-600), var(--navy-700)); color: #fff; }
.why-sol .kicker { color: var(--gold-300); }
.why-sol p { color: rgba(255,255,255,.88); }
.why-arrow { display: grid; place-items: center; font-size: 30px; color: var(--violet-600); }
.ticks { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 28px; color: var(--ink-soft); }
.ticks li::before { content: "!"; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #e11d48; color: #fff; font-size: 12px; font-weight: 700; }

/* วัตถุประสงค์ + เป้าหมาย */
.obj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.obj { display: flex; gap: 14px; align-items: flex-start; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.o-no { font-family: "Prompt", sans-serif; font-weight: 700; font-size: 28px; line-height: 1; background: linear-gradient(135deg, var(--violet-600), var(--gold-600)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.obj p { margin: 0; color: var(--ink-soft); line-height: 1.65; }
.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.ring-card { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.ring-card h4 { margin: 6px 0 2px; font-family: "Prompt", sans-serif; font-size: 17px; }
.ring-card p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.ring {
  flex: none; width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center; position: relative;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #ece8de 0);
}
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.ring b, .ring small { position: relative; font-family: "Prompt", sans-serif; line-height: 1; }
.ring b { font-size: 26px; font-weight: 700; color: var(--c); }
.ring small { font-size: 12.5px; color: var(--ink-mute); margin-top: 2px; }

/* เมทริกซ์ใครทำอะไร */
.raci-wrap { overflow-x: auto; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.raci { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; }
.raci th, .raci td { padding: 12px 12px; border-bottom: 1px solid #eee9de; text-align: center; vertical-align: middle; }
.raci thead th { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 14.5px; background: #faf8f3; border-bottom: 3px solid var(--c, var(--line)); line-height: 1.35; }
.raci thead th span { display: block; width: 26px; height: 26px; margin: 0 auto 4px; border-radius: 50%; background: var(--c); color: #fff; line-height: 26px; font-size: 13px; }
.raci th.who { text-align: left; font-family: "Prompt", sans-serif; font-weight: 500; font-size: 15px; background: #fcfbf8; min-width: 230px; position: sticky; left: 0; z-index: 1; }
.raci thead th.who { z-index: 2; }
.raci td i { display: inline-block; font-style: normal; font-size: 13.5px; line-height: 1.4; padding: 6px 10px; border-radius: 10px; background: var(--violet-100); color: var(--violet-700); }
.raci td.span { text-align: left; color: var(--ink-soft); background: repeating-linear-gradient(135deg, #faf8f3 0 10px, #f4f1ea 10px 20px); font-family: "Prompt", sans-serif; font-size: 14px; }
.raci tr.hl th.who { background: #fdf3d8; }
.raci tr.hl td i { background: linear-gradient(135deg, var(--gold-400), #fbe3a6); color: #5b3c06; }
.raci tbody tr:last-child th, .raci tbody tr:last-child td { border-bottom: 0; }

/* นิยามศัพท์ */
.gloss { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.g { padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .2s ease; }
.g:hover { transform: translateY(-3px); }
.g-ic { font-size: 28px; display: block; margin-bottom: 8px; }
.g b { font-family: "Prompt", sans-serif; font-size: 17px; font-weight: 600; }
.g p { margin: 6px 0 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.65; }

.cta-band { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; padding: clamp(22px, 3vw, 36px); border-radius: 24px; color: #fff; background: linear-gradient(120deg, var(--navy-800), var(--violet-700)); box-shadow: var(--shadow-md); }
.cta-band h2 { margin: 0; font-size: clamp(20px, 2.2vw, 28px); }
.cta-band p { margin: 4px 0 0; color: rgba(255,255,255,.8); }
.cta-acts { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- กลุ่มเป้าหมาย ---------- */
.gtool { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; margin-bottom: 14px; border-radius: 18px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.gsearch { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); flex: 1 1 240px; max-width: 360px; }
.gsearch input { border: 0; outline: 0; font: 15px "Sarabun", sans-serif; width: 100%; background: transparent; color: var(--ink); }
.seg-view { display: inline-flex; margin-left: auto; padding: 3px; border-radius: 999px; background: #f4f1ea; gap: 3px; }
.seg-view button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-family: "Prompt", sans-serif; font-size: 14px; color: var(--ink-soft); }
.seg-view button.on { background: var(--navy-800); color: #fff; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.gcard { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.gcard header { display: flex; align-items: center; gap: 12px; }
.gcard header b { display: block; font-family: "Prompt", sans-serif; font-weight: 600; font-size: 18px; line-height: 1.3; }
.gcard header small { color: var(--ink-mute); font-size: 13px; }
.g-no { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-family: "Prompt", sans-serif; font-weight: 600; color: var(--gold-300); background: linear-gradient(135deg, var(--navy-700), var(--violet-600)); }
.g-no.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 12.5px; }
.mission { padding: 10px 12px; border-radius: 14px; background: var(--soft, #f8f6f1); border: 1px solid color-mix(in srgb, var(--c, #ccc) 25%, white); }
.mission.dim { opacity: .4; }
.mission.empty-m { display: flex; gap: 10px; align-items: center; background: #f8f6f1; border-style: dashed; font-size: 14px; }
.m-top { display: flex; align-items: center; gap: 10px; }
.lv { flex: none; font-family: "Prompt", sans-serif; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--navy-800); color: #fff; }
.m-subj { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 17px; color: var(--c); display: inline-flex; align-items: center; gap: 6px; }
.m-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.m-links a { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-family: "Prompt", sans-serif; font-size: 13px; text-decoration: none; background: #fff; color: var(--c, var(--ink)); border: 1px solid color-mix(in srgb, var(--c, #ccc) 30%, white); }
.m-links a:hover { background: var(--c, var(--navy-800)); color: #fff; }
.gnet { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.net { border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.net header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, black)); color: #fff; font-size: 20px; }
.net header b { font-family: "Prompt", sans-serif; font-size: 19px; }
.net header span { margin-left: auto; font-family: "Prompt", sans-serif; font-size: 13.5px; opacity: .85; }
.net-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.net-lv { padding: 14px 16px; border-right: 1px solid var(--line); }
.net-lv:last-child { border-right: 0; }
.net-lv-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: "Prompt", sans-serif; }
.net-lv ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.net-lv li { display: flex; align-items: center; gap: 8px; font-size: 15px; }

/* ---------- ปฏิทิน ---------- */
.tl-hero { display: grid; grid-template-columns: 1fr minmax(260px, 360px); gap: 24px; align-items: center; }
.tl-hero h1 span { display: block; font-size: .72em; margin-top: 6px; }
.countdown { padding: 20px; border-radius: 22px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(8px); }
.cd-main { text-align: center; padding-bottom: 14px; }
.cd-main b { display: block; font-family: "Prompt", sans-serif; font-size: clamp(56px, 7vw, 84px); font-weight: 700; line-height: 1; color: var(--gold-400); font-variant-numeric: tabular-nums; }
.cd-main span { color: rgba(255,255,255,.8); font-family: "Prompt", sans-serif; }
.cd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 1px solid rgba(255,255,255,.14); padding-top: 14px; text-align: center; }
.cd-row b { display: block; font-family: "Prompt", sans-serif; font-size: 24px; font-weight: 600; color: #fff; }
.cd-row span { font-size: 13px; color: rgba(255,255,255,.7); }
.tl-progress { min-width: 240px; font-family: "Prompt", sans-serif; font-size: 14px; color: var(--ink-soft); }
.tl-progress .track { height: 10px; background: #ece8de; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.tl-progress .fill { height: 100%; background: linear-gradient(90deg, var(--ok), #34d399); border-radius: 999px; }

.gantt-wrap { overflow-x: auto; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.gantt { position: relative; min-width: 900px; padding: 8px 18px 14px; --lw: 320px; }
.g-row { display: grid; grid-template-columns: var(--lw) 1fr; align-items: center; min-height: 52px; border-bottom: 1px dashed #eee9de; }
.g-row:last-of-type { border-bottom: 0; }
.g-axis { min-height: 40px; border-bottom: 1px solid var(--line); }
.g-label { display: flex; align-items: center; gap: 10px; padding-right: 14px; font-size: 14.5px; line-height: 1.4; }
.g-label span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.g-ic { font-size: 20px; flex: none; }
.g-row.done .g-label { color: var(--ink-mute); }
.g-track { position: relative; height: 100%; min-height: inherit; }
.g-axis .g-track span { position: absolute; top: 50%; transform: translateY(-50%); text-align: center; font-family: "Prompt", sans-serif; font-size: 13px; color: var(--ink-mute); border-left: 1px solid var(--line); }
.g-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: #f1eee6; }
.g-bar {
  position: absolute; top: 50%; transform: translateY(-50%); height: 28px; border-radius: 9px; text-decoration: none;
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 70%, white)); box-shadow: 0 6px 14px -8px var(--c);
  display: flex; align-items: center; overflow: hidden; transition: transform .15s ease;
}
.g-bar:hover { transform: translateY(-50%) scale(1.04); }
.g-bar em { font-style: normal; font-family: "Prompt", sans-serif; font-size: 12.5px; color: #fff; padding: 0 10px; white-space: nowrap; }
.g-bar.ms { width: 22px !important; height: 22px; border-radius: 6px; transform: translate(-30%, -50%) rotate(45deg); }
.g-bar.ms:hover { transform: translate(-30%, -50%) rotate(45deg) scale(1.15); }
.g-row.done .g-bar { filter: grayscale(.6); opacity: .55; }
.g-today { position: absolute; top: 8px; bottom: 14px; left: calc(18px + var(--lw) + (100% - 36px - var(--lw)) * var(--x) / 100); width: 2px; background: #e11d48; z-index: 3; pointer-events: none; }
.g-today span { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px; background: #e11d48; color: #fff; font-family: "Prompt", sans-serif; font-size: 12px; white-space: nowrap; }

.tl2 { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.ev { display: grid; grid-template-columns: 64px 1fr; gap: 14px; scroll-margin-top: 20px; }
.ev-rail { position: relative; display: flex; justify-content: center; }
.ev-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--c), color-mix(in srgb, var(--c) 30%, white)); border-radius: 3px; }
.ev:first-child .ev-rail::before { top: 26px; }
.ev:last-child .ev-rail::before { bottom: calc(100% - 26px); }
.ev-dot { position: relative; z-index: 1; width: 52px; height: 52px; margin-top: 4px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; background: var(--surface); border: 3px solid var(--c); box-shadow: 0 0 0 5px var(--bg); }
.ev.done .ev-dot { background: var(--ok); border-color: var(--ok); color: #fff; font-size: 22px; font-weight: 700; }
.ev.next .ev-dot { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 5px var(--bg), 0 0 0 9px color-mix(in srgb, var(--c) 30%, transparent); } 50% { box-shadow: 0 0 0 5px var(--bg), 0 0 0 16px transparent; } }
.ev-card { margin-bottom: 18px; padding: 18px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c); box-shadow: var(--shadow-sm); }
.ev.next .ev-card { box-shadow: var(--shadow-md); border-color: var(--c); }
.ev.done .ev-card { opacity: .7; }
.ev-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ev-date { font-family: "Prompt", sans-serif; font-weight: 600; color: var(--c); font-size: 15.5px; }
.ev-st, .ev-rel, .ev-dl { font-family: "Prompt", sans-serif; font-size: 12.5px; padding: 2px 10px; border-radius: 999px; }
.st-done { background: #dcfce7; color: #166534; }
.st-now { background: #fef3c7; color: #92400e; }
.st-todo { background: #eef2ff; color: #3730a3; }
.ev-rel { background: #f4f1ea; color: var(--ink-soft); }
.ev-dl { background: #fee2e2; color: #b91c1c; }
.ev-card h3 { margin: 8px 0 12px; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.45; }
.ev-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ev-meta > div { padding: 10px 12px; border-radius: 12px; background: #f8f6f1; }
.ev-meta small { display: block; font-size: 12.5px; color: var(--ink-mute); }
.ev-meta b { font-weight: 600; font-size: 15px; }
.ev-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

@media (max-width: 1280px) {
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step:nth-child(3)::after { display: none; }
}
@media (max-width: 960px) {
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step::after { display: none; }
  .why { grid-template-columns: 1fr; }
  .why-arrow { transform: rotate(90deg); }
  .obj-grid { grid-template-columns: 1fr; }
  .tl-hero { grid-template-columns: 1fr; }
  .seg-view { margin-left: 0; }
}
@media (max-width: 640px) {
  .flow { grid-template-columns: 1fr; }
  .ev { grid-template-columns: 44px 1fr; gap: 10px; }
  .ev-dot { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }
  .ev-card { padding: 14px 16px; }
  .gtool { position: static; }
}
@media (prefers-reduced-motion: reduce) { .ev.next .ev-dot { animation: none; } }

/* ---------- คลังคลิปพิชิตข้อยาก (clips.html) ---------- */
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.clip { display: flex; flex-direction: column; text-align: left; padding: 0; font: inherit; color: inherit; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .15s ease; }
.clip:hover { transform: translateY(-3px); }
.clip-img { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--c), var(--navy-800)) center / cover; display: grid; place-items: center; }
.clip-play { width: 52px; height: 52px; border-radius: 50%; background: rgba(7,21,40,.7); color: #fff; display: grid; place-items: center; font-size: 20px; padding-left: 4px; }
.clip-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.clip-body b { font-family: "Prompt", sans-serif; font-weight: 600; font-size: 16px; line-height: 1.4; }
.clip-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.clip-hard { font-size: 13.5px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip-video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.clip-info dt { font-weight: 600; color: var(--ink); margin-top: 10px; font-size: 14px; }
.clip-info dd { margin: 2px 0 0; white-space: pre-line; }
