/* ==========================================================================
   วิทยาลัยจุลมณีศรีสะเกษ — Main stylesheet
   แนวทาง: Modern Vocational College (ม่วง + ชมพู + ขาว — ธีม Orchid Bloom)
   หมายเหตุสำคัญ: ค่าสีทั้งหมดประกาศที่ :root เท่านั้น — ห้ามใส่ hex ที่อื่น
   ========================================================================== */

/* ------------------------------------------------------------------
   1. Tokens
------------------------------------------------------------------ */
:root {
  /* แบรนด์ — ม่วงหลัก + ชมพูเน้น + พื้นขาว */
  --brand:        #6D28D9;   /* ม่วง — สีหลัก */
  --brand-deep:   #4C1D95;   /* ม่วงเข้ม — พื้นเข้ม/ฟุตเตอร์ */
  --brand-ink:    #2E1065;   /* ม่วงเกือบดำ — โทนหัวข้อ */
  --brand-soft:   #F5F0FF;   /* ลาเวนเดอร์อ่อน — พื้นอ่อน */
  --gold:         #DB2777;   /* ชมพู — ปุ่ม CTA / จุดเน้น */
  --gold-deep:    #BE185D;   /* ชมพูเข้ม — hover */
  --gold-soft:    #FCE7F3;
  --gold-ink:     #9D174D;   /* ตัวอักษรบนพื้นชมพูอ่อน */
  --gold-on-dark: #FBCFE8;   /* ชมพูอ่อนสำหรับพื้นม่วงเข้ม (ผ่าน AA) */
  --green:        #1E7A4E;   /* สำเร็จ */
  --line-green:   #06C755;   /* LINE */
  --danger:       #BE123C;
  --green-solid:  #1E7A4E;
  --on-gold:      #FFFFFF;
  --brand-hover:  #5B21B6;
  color-scheme: light;

  /* พื้นผิว / ตัวอักษร */
  --bg:           #FFFFFF;
  --surface:      #FFFFFF;
  --surface-2:    #FAF6FF;
  --ink:          #2B2438;
  --muted:        #6B6478;
  --border:       #EDE6F7;
  --border-strong:#D9CCEC;

  /* ค่าอนุพันธ์ */
  --tint-4:  color-mix(in oklab, var(--brand) 4%, var(--surface));
  --tint-8:  color-mix(in oklab, var(--brand) 8%, var(--surface));
  --tint-14: color-mix(in oklab, var(--brand) 14%, var(--surface));
  --on-dark:       color-mix(in oklab, white 92%, transparent);
  --on-dark-muted: color-mix(in oklab, white 66%, transparent);
  --on-dark-line:  color-mix(in oklab, white 22%, transparent);
  --shadow-sm: 0 1px 2px color-mix(in oklab, var(--brand-ink) 10%, transparent);
  --shadow-md: 0 14px 34px -18px color-mix(in oklab, var(--brand-ink) 45%, transparent);
  --focus-ring: 0 0 0 3px color-mix(in oklab, var(--brand) 26%, transparent);

  /* ฟอนต์ (ฝังในเครื่อง — assets/fonts) */
  --font-display: 'Kanit', 'Noto Sans Thai', 'Leelawadee UI', Tahoma, sans-serif;
  --font-body:    'Sarabun', 'Noto Sans Thai', 'Leelawadee UI', Tahoma, sans-serif;
  --font-mono:    ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Consolas, 'Sarabun', monospace;

  /* ขนาดตัวอักษร */
  --fs-h1:   clamp(2.125rem, 4.4vw, 3.375rem);
  --fs-h2:   clamp(1.625rem, 3.2vw, 2.375rem);
  --fs-h3:   clamp(1.1875rem, 2vw, 1.375rem);
  --fs-h4:   1.0625rem;
  --fs-lead: clamp(1.0625rem, 1.7vw, 1.1875rem);
  --fs-body: 1rem;
  --fs-sm:   0.875rem;
  --fs-meta: 0.8125rem;
  --fs-cap:  0.75rem;

  /* ระยะห่าง */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;
  --container: 1140px;
  --gutter: clamp(20px, 4vw, 32px);
  --section-y: clamp(56px, 8vw, 96px);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* การเคลื่อนไหว */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 130ms;
  --dur: 200ms;
}

/* ------------------------------------------------------------------
   2. Reset & base
------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
svg { flex: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; }
p { text-wrap: pretty; margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--gold-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.on-dark :focus-visible, .pagefoot :focus-visible, .cta-band :focus-visible { outline-color: var(--gold-on-dark); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--surface);
  padding: 10px 18px; border-radius: 0 0 var(--radius) 0; font-size: 0.875rem;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------
   3. Layout primitives
------------------------------------------------------------------ */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--sky { background: linear-gradient(180deg, var(--brand-soft) 0%, color-mix(in oklab, var(--brand-soft) 55%, var(--surface)) 100%); }
.section--tight { padding-block: clamp(36px, 5vw, 56px); }
.section--flush { padding-top: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 1.8fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--sp-5); }
.row { display: flex; align-items: center; gap: var(--sp-4); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }

@media (max-width: 1000px) {
  .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .grid-4-sm-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-4-sm-2 { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------
   4. Typography
------------------------------------------------------------------ */
h1, .h1 { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; color: var(--brand-ink); }
h2, .h2 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; color: var(--brand-ink); }
h3, .h3 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; line-height: 1.42; color: var(--brand-ink); }
h4, .h4 { font-family: var(--font-display); font-size: var(--fs-h4); font-weight: 600; line-height: 1.5; color: var(--brand-ink); }
.lead { font-size: var(--fs-lead); line-height: 1.7; color: var(--muted); max-width: 62ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--fs-cap); font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--brand);
}
.eyebrow::before { content: ''; width: 18px; height: 2px; background: var(--gold); }
.meta { font-size: var(--fs-meta); color: var(--muted); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.text-link { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.text-link:hover { color: var(--brand-hover); }

/* ------------------------------------------------------------------
   5. Buttons
------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600;
  line-height: 1.4; text-align: center; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform 60ms var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-gold { background-color: var(--gold); background-image: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%); border-color: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background-color: var(--gold-deep); background-image: linear-gradient(135deg, var(--gold-deep) 0%, var(--gold-deep) 100%); border-color: var(--gold-deep); }
.btn-navy { background-color: var(--brand); background-image: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%); border-color: var(--brand); color: var(--on-dark); }
.btn-navy:hover { background-color: var(--brand-deep); background-image: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-deep) 100%); border-color: var(--brand-deep); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-line { background: var(--line-green); border-color: var(--line-green); color: var(--on-dark); }
.btn-line:hover { background: color-mix(in oklab, var(--line-green) 88%, var(--brand-ink)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); padding-inline: 6px; min-height: 36px; }
.btn-ghost:hover { color: var(--brand-hover); }
.btn-ghost::after { content: '→'; transition: transform var(--dur) var(--ease); }
.btn-ghost:hover::after { transform: translateX(3px); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: 0.875rem; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 13px 26px; font-size: 1rem; }
.btn-block { width: 100%; white-space: normal; }
.btn-on-dark { background: transparent; border-color: var(--on-dark-line); color: var(--on-dark); }
.btn-on-dark:hover { border-color: var(--gold-on-dark); color: var(--gold-on-dark); }

/* ------------------------------------------------------------------
   6. Chips / tags
------------------------------------------------------------------ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid transparent; white-space: nowrap;
}
.chip--v { background: var(--brand-soft); color: var(--brand); }
.chip--h { background: var(--gold-soft); color: var(--gold-ink); }
.chip--ghost { background: transparent; border-color: var(--border-strong); color: var(--muted); font-weight: 500; }
.chip--soon { background: var(--surface-2); color: var(--muted); }

/* ------------------------------------------------------------------
   7. Header: announce bar + sticky nav
------------------------------------------------------------------ */
.announce {
  background-color: var(--brand-deep);
  background-image: linear-gradient(90deg, var(--brand-deep) 0%, color-mix(in oklab, var(--brand) 62%, var(--brand-deep)) 58%, var(--brand-deep) 100%);
  color: var(--on-dark);
  font-size: 0.8438rem; line-height: 1.5;
}
.announce .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 9px; flex-wrap: wrap; }
.announce-msg { display: flex; align-items: center; gap: 10px; }
.announce-msg::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-on-dark); flex: none; }
.announce a { color: var(--gold-on-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.topnav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--surface) 93%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner { display: flex; align-items: center; gap: var(--sp-6); min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; line-height: 1.3; color: var(--brand-ink); }
.brand-name small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.7188rem; color: var(--muted); letter-spacing: 0.02em; }
.brand-logo { width: 44px; height: 44px; flex: none; object-fit: contain; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  font-size: 0.8438rem; font-weight: 500; color: var(--ink);
  padding: 8px 9px; border-bottom: 2px solid transparent; line-height: 1.4;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.nav a:hover { color: var(--brand); }
.nav a[aria-current="page"] { color: var(--brand); font-weight: 600; border-bottom-color: var(--gold); }
.nav-cta { margin-left: 10px; }

.nav-toggle {
  display: none; width: 44px; height: 44px; flex: none;
  align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--brand-ink);
}
.nav-toggle:hover { border-color: var(--brand); }
.nav-toggle svg { width: 22px; height: 22px; }

.nav-panel { display: none; border-top: 1px solid var(--border); background: var(--surface); }
.nav-panel.is-open { display: block; animation: panel-in var(--dur) var(--ease); }
.nav-panel-inner { padding-block: var(--sp-4); }
.nav-panel a.nav-link {
  display: block; padding: 13px 2px; font-size: 0.9688rem; font-weight: 500; color: var(--ink);
  border-bottom: 1px solid var(--border);
}
.nav-panel a.nav-link[aria-current="page"] { color: var(--brand); font-weight: 600; }
.nav-panel .nav-panel-cta { margin-top: var(--sp-4); display: grid; gap: 10px; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

@media (max-width: 1159px) {
  .nav, .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (min-width: 1160px) { .nav-panel { display: none !important; } }

/* ------------------------------------------------------------------
   8. Hero
------------------------------------------------------------------ */
.hero {
  padding-block: clamp(44px, 6.5vw, 84px) clamp(40px, 6vw, 76px);
  background:
    radial-gradient(900px 440px at 88% -12%, color-mix(in oklab, var(--gold) 11%, transparent), transparent 68%),
    radial-gradient(760px 420px at -6% 8%, color-mix(in oklab, var(--brand) 9%, transparent), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-copy > * + * { margin-top: var(--sp-5); }
.hero-tagline {
  font-family: var(--font-display); font-size: clamp(1.1875rem, 2vw, 1.4375rem); font-weight: 600;
  line-height: 1.6; color: var(--brand); max-width: 30ch;
}
.hero-cta { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.hero-note { font-size: var(--fs-sm); color: var(--muted); }
.hero-visual { position: relative; }
.hero-photo { aspect-ratio: 4 / 3; min-height: 300px; }
.hero-img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.float-card {
  position: absolute; left: -22px; bottom: -22px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 18px; box-shadow: var(--shadow-md);
}
.float-card .fc-icon {
  width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft);
  display: grid; place-items: center; color: var(--brand);
}
.float-card strong { display: block; font-size: 0.9062rem; line-height: 1.4; color: var(--brand-ink); }
.float-card span { font-size: 0.7812rem; color: var(--muted); }
@media (max-width: 1000px) { .hero-grid { grid-template-columns: 1fr; } .hero-photo { min-height: 240px; } }
@media (max-width: 720px) { .float-card { left: 12px; bottom: 12px; padding: 12px 14px; } }

/* ------------------------------------------------------------------
   9. Section heads
------------------------------------------------------------------ */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-6); flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 44px); }
.sec-head .sec-title { max-width: 34ch; }
.sec-head .sec-title > * + * { margin-top: var(--sp-3); }

/* ------------------------------------------------------------------
   10. Photo placeholder (ใช้จนกว่าจะได้ภาพจริงจากวิทยาลัย)
------------------------------------------------------------------ */
.photo-ph {
  position: relative; overflow: hidden;
  display: grid; place-items: center; gap: 10px; text-align: center;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background-color: var(--brand-soft);
  background-image: repeating-linear-gradient(45deg,
    transparent 0 16px,
    color-mix(in oklab, var(--brand) 5%, transparent) 16px 17px);
  color: var(--brand);
  padding: var(--sp-6);
}
.photo-ph svg { width: 30px; height: 30px; opacity: 0.75; }
.photo-ph span { font-size: 0.7812rem; letter-spacing: 0.02em; color: color-mix(in oklab, var(--brand) 78%, var(--surface)); }
.photo-ph--dark { background-color: var(--brand-deep); border-color: var(--brand-deep); color: var(--gold-on-dark); }
.photo-ph--dark span { color: var(--on-dark-muted); }
.ph-mark {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--brand) 10%, var(--surface));
  color: var(--brand);
  font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; line-height: 1;
  border: 1px solid color-mix(in oklab, var(--brand) 24%, transparent);
}
.photo-ph--dark .ph-mark {
  background: transparent;
  border-color: color-mix(in oklab, var(--gold-on-dark) 55%, transparent);
  color: var(--gold-on-dark);
}
.gal .ph-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 0.875rem; }

/* ------------------------------------------------------------------
   11. "Why us" asymmetric list
------------------------------------------------------------------ */
.why-list { border-top: 1px solid var(--border-strong); }
.why-item { display: grid; grid-template-columns: 56px 1fr; gap: var(--sp-5); padding: 26px 0; border-bottom: 1px solid var(--border); }
.why-num { font-family: var(--font-display); font-size: 1.3125rem; font-weight: 600; color: var(--gold-ink); line-height: 1.3; }
.why-item h3 { font-size: 1.1875rem; margin-bottom: 6px; }
.why-item p { color: var(--muted); font-size: 0.9375rem; max-width: 64ch; }

/* ------------------------------------------------------------------
   12. Program cards
------------------------------------------------------------------ */
.prog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.prog-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.prog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.prog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prog-duration { font-size: 0.7812rem; color: var(--muted); }
.prog-card h3 { font-size: 1.1875rem; }
.prog-desc { color: var(--muted); font-size: 0.9062rem; line-height: 1.68; flex: 1; }
.prog-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.prog-card--featured { background: var(--brand-deep); border-color: var(--brand-deep); box-shadow: none; }
.prog-card--featured h3 { color: var(--on-dark); }
.prog-card--featured .prog-desc { color: var(--on-dark-muted); }
.prog-card--featured .prog-duration { color: var(--on-dark-muted); }
.prog-card--featured:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.prog-card--featured .btn-outline { background: transparent; border-color: var(--on-dark-line); color: var(--on-dark); }
.prog-card--featured .btn-outline:hover { border-color: var(--gold); color: var(--gold); }
@media (max-width: 1000px) { .prog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .prog-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------
   13. Stepper (ขั้นตอนสมัครเรียน)
------------------------------------------------------------------ */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-8); }
.step { position: relative; padding-top: var(--sp-5); border-top: 2px solid var(--border); }
.step::before { content: ''; position: absolute; top: -2px; left: 0; width: 34px; height: 2px; background: var(--gold); }
.step-num {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 14px;
  background: var(--brand-soft); color: var(--brand);
  font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem;
}
.step h3 { font-size: 1.125rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 0.9062rem; }
@media (max-width: 1000px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .steps { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------
   14. News
------------------------------------------------------------------ */
.news-feature {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 44px); align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  padding: clamp(20px, 3vw, 30px);
}
.news-feature .photo-ph { aspect-ratio: 16 / 10; }
.news-feature h3 { font-size: clamp(1.25rem, 2.2vw, 1.5rem); margin-block: 10px 12px; }
.news-feature p { color: var(--muted); font-size: 0.9375rem; }
.news-list { margin-top: var(--sp-4); border-top: 1px solid var(--border-strong); }
.news-row {
  position: relative; display: grid; grid-template-columns: 118px 1fr auto; gap: var(--sp-6);
  align-items: baseline; padding: 22px 0; border-bottom: 1px solid var(--border);
}
.news-row time { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.news-row h3 { font-size: 1.125rem; }
.news-row h3 a::after { content: ''; position: absolute; inset: 0; }
.news-row:hover h3 { color: var(--brand); }
.news-row p { margin-top: 4px; color: var(--muted); font-size: 0.875rem; }
@media (max-width: 820px) {
  .news-feature { grid-template-columns: 1fr; }
  .news-row { grid-template-columns: 1fr auto; gap: 6px 14px; }
  .news-row time { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------
   15. Gallery
------------------------------------------------------------------ */
.gal { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(120px, 16vw, 168px); gap: 12px; }
.gal .photo-ph { border-radius: var(--radius); padding: var(--sp-4); }
.gal .sp2x2 { grid-column: span 2; grid-row: span 2; }
.gal .sp2x1 { grid-column: span 2; }
@media (max-width: 760px) {
  .gal { grid-template-columns: repeat(2, 1fr); }
  .gal .sp2x2 { grid-column: span 2; grid-row: span 1; }
}

/* ------------------------------------------------------------------
   16. CTA band (เข้ม) + channels
------------------------------------------------------------------ */
.cta-band {
  position: relative; overflow: hidden;
  background-color: var(--brand-deep); color: var(--on-dark);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 56px);
  background-image:
    radial-gradient(520px 240px at 92% 0%, color-mix(in oklab, var(--gold) 42%, transparent), transparent 72%),
    repeating-linear-gradient(135deg,
      transparent 0 22px,
      color-mix(in oklab, var(--surface) 4%, transparent) 22px 23px),
    linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 58%, var(--gold-deep) 130%);
}
.cta-band h2 { color: var(--on-dark); }
.cta-band p { color: var(--on-dark-muted); max-width: 56ch; }
.cta-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-5); }

.chan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
.chan {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.chan:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.chan-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 4px; }
.chan strong { font-size: 0.9375rem; color: var(--brand-ink); }
.chan span { font-size: 0.8438rem; color: var(--muted); line-height: 1.6; }
.chan a.text-link { font-size: 0.8438rem; margin-top: auto; }
@media (max-width: 1000px) { .chan-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .chan-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------
   17. Footer
------------------------------------------------------------------ */
.pagefoot {
  background-color: var(--brand-deep);
  background-image: linear-gradient(180deg, color-mix(in oklab, var(--brand) 30%, var(--brand-deep)) 0%, var(--brand-deep) 52%, var(--brand-deep) 100%);
  color: var(--on-dark);
  padding: clamp(44px, 6vw, 64px) 0 26px;
}
.footer-grid { display: grid; grid-template-columns: 1.7fr 1fr 1.1fr 1.3fr; gap: clamp(28px, 4vw, 48px); }
.footer-brand .brand-name { color: var(--on-dark); }
.footer-brand .brand-name small { color: var(--on-dark-muted); }
.footer-about { margin-top: 14px; font-size: 0.8438rem; line-height: 1.75; color: var(--on-dark-muted); max-width: 34ch; }
.pagefoot h4 { color: var(--on-dark); font-size: 0.9062rem; margin-bottom: 14px; }
.footer-links { display: grid; gap: 9px; font-size: 0.8438rem; }
.footer-links a { color: var(--on-dark-muted); }
.footer-links a:hover { color: var(--gold-on-dark); }
.footer-contact { display: grid; gap: 10px; font-size: 0.8438rem; color: var(--on-dark-muted); line-height: 1.65; }
.footer-contact a:hover { color: var(--gold-on-dark); text-decoration: underline; text-underline-offset: 3px; }
.social-row { display: flex; gap: 10px; margin-top: 14px; }
.social-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--on-dark-line);
  display: grid; place-items: center; color: var(--on-dark);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.social-btn:hover { border-color: var(--gold-on-dark); color: var(--gold-on-dark); }
.footer-bottom {
  margin-top: clamp(32px, 4vw, 48px); padding-top: 20px;
  border-top: 1px solid var(--on-dark-line);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  font-size: 0.7812rem; color: var(--on-dark-muted);
}
.footer-legal { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-legal a { color: var(--on-dark-muted); }
.footer-legal a:hover { color: var(--gold-on-dark); }
@media (max-width: 1000px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------
   18. Forms
------------------------------------------------------------------ */
.form { display: grid; gap: var(--sp-8); }
.form-section { border: 0; padding: 0; margin: 0; display: grid; gap: var(--sp-4); }
.form-legend { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; color: var(--brand-ink); padding: 0; margin-bottom: 2px; display: flex; align-items: center; gap: 10px; }
.form-legend::before { content: ''; width: 14px; height: 2px; background: var(--gold); }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.field-row--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 680px) { .field-row, .field-row--3 { grid-template-columns: 1fr; } }
.field label { font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.req::after { content: ' *'; color: var(--danger); font-weight: 700; }
.hint { font-size: 0.7812rem; color: var(--muted); line-height: 1.55; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 0.9375rem; line-height: 1.5;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.select { appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235B6B7C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.textarea { min-height: 110px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: color-mix(in oklab, var(--muted) 72%, var(--surface)); }
.input[readonly] { background: var(--surface-2); }

.field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea, .field.is-invalid .file-drop {
  border-color: var(--danger); background: color-mix(in oklab, var(--danger) 3%, var(--surface));
}
.field.is-invalid .input:focus-visible { box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 22%, transparent); }
.err-msg { display: none; align-items: flex-start; gap: 6px; font-size: 0.8125rem; color: var(--danger); line-height: 1.55; }
.err-msg::before { content: '!'; flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; background: var(--danger); color: var(--surface); font-size: 0.6875rem; font-weight: 700; display: grid; place-items: center; }
.field.is-invalid .err-msg { display: flex; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9062rem; line-height: 1.6; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }

.file-drop {
  display: grid; gap: 4px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: 10px;
  background: var(--surface-2); font-size: 0.875rem; color: var(--muted);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.file-drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.file-drop strong { color: var(--ink); font-size: 0.9062rem; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.file-wrap { position: relative; }
.file-name { font-size: 0.8125rem; color: var(--brand); font-weight: 600; }

.error-summary {
  display: none; border: 1px solid color-mix(in oklab, var(--danger) 55%, var(--surface));
  background: color-mix(in oklab, var(--danger) 5%, var(--surface));
  border-radius: var(--radius); padding: 18px 20px;
}
.error-summary.is-visible { display: block; }
.error-summary h2 { font-size: 1rem; color: var(--danger); margin-bottom: 8px; }
.error-summary ul { padding-left: 20px; display: grid; gap: 4px; font-size: 0.875rem; }
.error-summary a { color: var(--danger); text-decoration: underline; text-underline-offset: 3px; }

.submit-row { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.form-status { font-size: 0.875rem; color: var(--muted); }
.form-status.is-error { color: var(--danger); }
.form-status.is-ok { color: var(--green); }

.success-panel {
  display: none; border: 1px solid color-mix(in oklab, var(--green) 42%, var(--surface));
  background: color-mix(in oklab, var(--green) 6%, var(--surface));
  border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 36px);
}
.success-panel.is-visible { display: block; }
.success-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--green-solid); color: var(--on-dark); display: grid; place-items: center; margin-bottom: 16px; }
.success-panel h3 { margin-bottom: 10px; }
.success-panel p { color: var(--ink); font-size: 0.9375rem; }
.ref-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 10px 16px; font-family: var(--font-mono); font-size: 0.875rem; color: var(--brand-ink);
}
.success-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-6); }

.demo-note {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid color-mix(in oklab, var(--gold) 45%, var(--surface));
  background: var(--gold-soft); color: var(--gold-ink);
  border-radius: var(--radius); padding: 13px 16px; font-size: 0.8438rem; line-height: 1.65;
}
.demo-note strong { color: var(--gold-ink); }
.demo-note svg { width: 18px; height: 18px; margin-top: 2px; flex: none; }

/* ------------------------------------------------------------------
   19. FAQ
------------------------------------------------------------------ */
.faq { border-top: 1px solid var(--border-strong); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: 18px 2px; font-size: 0.9688rem; font-weight: 600; color: var(--brand-ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; flex: none; width: 10px; height: 10px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform var(--dur) var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq .faq-body { padding: 0 2px 20px; color: var(--muted); font-size: 0.9062rem; max-width: 72ch; }

/* ------------------------------------------------------------------
   20. Breadcrumbs / prose / article
------------------------------------------------------------------ */
.crumbs { margin-bottom: var(--sp-5); font-size: 0.8125rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.crumbs li + li::before { content: '›'; margin-right: 6px; color: var(--border-strong); }
.crumbs a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

.prose { max-width: 72ch; }
.prose > * + * { margin-top: var(--sp-5); }
.prose h2 { margin-top: var(--sp-10); font-size: clamp(1.375rem, 2.4vw, 1.6875rem); }
.prose h3 { margin-top: var(--sp-8); font-size: 1.1875rem; }
.prose p { color: var(--ink); }
.prose ul, .prose ol { padding-left: 24px; display: grid; gap: 8px; color: var(--ink); }
.prose li::marker { color: var(--gold-ink); }

.article-head { max-width: 78ch; }
.article-head h1 { margin-block: 14px 12px; }
.article-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 0.8438rem; color: var(--muted); }
.article-cover { aspect-ratio: 21 / 9; margin-block: var(--sp-8); }
.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: var(--sp-8); padding-top: var(--sp-5); border-top: 1px solid var(--border); }
.share-row .label { font-size: 0.8438rem; color: var(--muted); margin-right: 4px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 14px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  font-size: 0.8438rem; font-weight: 600; color: var(--ink);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.share-btn:hover { border-color: var(--brand); color: var(--brand); }
.share-btn svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------------
   21. Program detail / downloads
------------------------------------------------------------------ */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }
.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-1) var(--sp-8); }
@media (max-width: 900px) { .dl-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .dl-grid { grid-template-columns: 1fr; } }
.dl-grid dt { font-size: 0.7812rem; color: var(--muted); letter-spacing: 0.02em; margin-top: 18px; }
.dl-grid dd { margin: 4px 0 0; font-size: 0.9375rem; font-weight: 500; color: var(--ink); }

.apply-card {
  position: sticky; top: 92px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  padding: 26px; display: grid; gap: var(--sp-4); box-shadow: var(--shadow-sm);
}
.apply-card .price-note { font-size: 0.875rem; color: var(--muted); }
.apply-card .doc-list { display: grid; gap: 8px; font-size: 0.875rem; color: var(--ink); padding-left: 20px; }
.apply-card .doc-list li::marker { color: var(--gold-ink); }
.apply-card hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
@media (max-width: 1000px) { .apply-card { position: static; } }

.doc-row {
  display: grid; grid-template-columns: 46px 1fr auto auto; gap: var(--sp-5);
  align-items: center; padding: 18px 0; border-bottom: 1px solid var(--border);
}
.doc-row:first-child { border-top: 1px solid var(--border-strong); }
.doc-ic {
  width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.6562rem; font-weight: 700; letter-spacing: 0.04em;
}
.doc-info h3 { font-size: 1.0312rem; }
.doc-info p { font-size: 0.8125rem; color: var(--muted); margin-top: 2px; }
.doc-meta { font-size: 0.7812rem; color: var(--muted); text-align: right; line-height: 1.6; }
@media (max-width: 760px) {
  .doc-row { grid-template-columns: 46px 1fr; }
  .doc-meta { grid-column: 2; text-align: left; }
  .doc-row .btn { grid-column: 2; justify-self: start; }
}

/* ------------------------------------------------------------------
   22. Empty / not-found states
------------------------------------------------------------------ */
.empty-state {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: clamp(32px, 6vw, 56px); text-align: center; color: var(--muted);
  display: grid; gap: 8px; justify-items: center;
}
.empty-state strong { color: var(--brand-ink); font-size: 1.0625rem; }

/* ------------------------------------------------------------------
   23. Sticky mobile CTA
------------------------------------------------------------------ */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: none; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border-strong);
  border-top: 1px solid var(--border-strong);
  padding-bottom: env(safe-area-inset-bottom);
}
.sticky-cta a {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 56px; background: var(--surface); font-size: 0.8438rem; font-weight: 600; color: var(--ink);
}
.sticky-cta a svg { width: 18px; height: 18px; }
.sticky-cta a.sc-gold { background: var(--gold); color: var(--on-gold); }
.sticky-cta a.sc-line { background: var(--line-green); color: var(--on-dark); }
@media (max-width: 767px) { .sticky-cta { display: grid; } body { padding-bottom: 68px; } }

/* ------------------------------------------------------------------
   24. Motion
------------------------------------------------------------------ */
.fx { opacity: 0; transform: translateY(16px); animation: fx-in 620ms var(--ease) forwards; }
.fx-1 { animation-delay: 60ms; }
.fx-2 { animation-delay: 150ms; }
.fx-3 { animation-delay: 240ms; }
@keyframes fx-in { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fx { opacity: 1; transform: none; animation: none; }
}

/* ------------------------------------------------------------------
   24b. Additions (filters / page-head / forms / maps / actions)
------------------------------------------------------------------ */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: var(--sp-6); }
.filter-btn {
  min-height: 40px; padding: 8px 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 0.875rem; font-weight: 500; color: var(--ink);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--surface); font-weight: 600; }
.filter-count { font-size: 0.8438rem; color: var(--muted); margin-left: auto; }

.page-head { padding-block: clamp(36px, 5.5vw, 64px) clamp(24px, 4vw, 40px); }
.page-head .lead { margin-top: var(--sp-4); }
.page-head .crumbs { margin-bottom: var(--sp-4); }

.actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }

.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow-sm);
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 4px; }
.mb-8 { margin-bottom: var(--sp-8); }
.brand-logo .lg-bg { fill: var(--brand); }

.news-feature { position: relative; }
.news-feature h3 a::after { content: ''; position: absolute; inset: 0; }
.news-feature:hover h3 { color: var(--brand); }

.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 5vw, 56px); align-items: start; }
@media (max-width: 1000px) { .contact-grid { grid-template-columns: 1fr; } }

.map-embed { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.map-embed iframe { display: block; width: 100%; height: clamp(240px, 32vw, 320px); border: 0; }

.group-head { margin-bottom: var(--sp-4); }
.group-head h2 { font-size: clamp(1.25rem, 2.2vw, 1.5rem); }
.group-head p { color: var(--muted); font-size: 0.875rem; margin-top: 4px; }

.statement { font-family: var(--font-display); font-size: clamp(1.25rem, 2.4vw, 1.625rem); font-weight: 600; line-height: 1.55; color: var(--brand); max-width: 34ch; }
.link-list { display: grid; gap: 10px; font-size: 0.9375rem; }
.link-list a { color: var(--brand); }
.link-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.plain-list { list-style: none; display: grid; gap: 12px; font-size: 0.875rem; }
.plain-list .k { display: block; font-size: 0.7812rem; color: var(--muted); margin-bottom: 2px; }

/* ------------------------------------------------------------------
   24c. User tools: dark mode, text size, utilities, cookie bar, EN dialog
------------------------------------------------------------------ */
.util-btn .util-text { white-space: nowrap; }
.util-btn--icon { padding: 4px 9px; }
.util-btn--cycle { padding: 4px 11px; }
.util-cycle {
  display: inline-block; font-family: var(--font-display); font-weight: 700;
  font-size: 13px; line-height: 1;
}
html[data-font="lg"] .util-cycle { font-size: 15px; }
html[data-font="xl"] .util-cycle { font-size: 17px; }
.announce-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.utility { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.util-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--radius-pill);
  border: 1px solid var(--on-dark-line); background: transparent; color: var(--on-dark);
  font-size: 0.7812rem; font-weight: 500; line-height: 1.7; cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.util-btn:hover { border-color: var(--gold); color: var(--gold); }
.announce .util-btn:hover { border-color: var(--gold-on-dark); color: var(--gold-on-dark); }
.util-btn svg { width: 14px; height: 14px; }
.util-btn .util-a { font-family: var(--font-display); font-weight: 600; font-size: 0.875rem; line-height: 1; }
.ic-sun { display: none; }
html[data-theme="dark"] .ic-moon { display: none; }
html[data-theme="dark"] .ic-sun { display: block; }

.util-panel { display: grid; gap: 10px; margin-top: var(--sp-4); }
.util-btn--light { border-color: var(--border-strong); color: var(--ink); justify-content: flex-start; width: 100%; }
.util-btn--light:hover { border-color: var(--brand); color: var(--brand); }

.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: color-mix(in oklab, var(--surface) 97%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  transition: transform 240ms var(--ease), opacity 240ms var(--ease);
}
.cookie-bar.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
.cookie-inner { display: flex; align-items: center; gap: var(--sp-5); padding-block: 12px; flex-wrap: wrap; }
.cookie-text { flex: 1 1 340px; font-size: 0.8438rem; line-height: 1.7; color: var(--ink); }
.cookie-actions { display: flex; gap: 10px; flex: none; }
@media (max-width: 767px) {
  .cookie-bar { bottom: 68px; }
  .cookie-inner { gap: 10px; padding-block: 11px; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
}

.en-dialog {
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink);
  max-width: 680px; width: calc(100vw - 40px); max-height: min(86vh, 760px); overflow: auto;
  padding: 0; box-shadow: var(--shadow-md);
}
.en-dialog::backdrop { background: color-mix(in oklab, black 55%, transparent); }
.en-dialog-body { padding: clamp(22px, 4vw, 34px); }
.en-dialog h2 { font-size: clamp(1.25rem, 3vw, 1.625rem); margin-bottom: var(--sp-4); }
.en-dialog-text { display: grid; gap: var(--sp-4); font-size: 0.9375rem; line-height: 1.8; }
.en-dialog-text .en-contact { padding-top: var(--sp-4); border-top: 1px solid var(--border); color: var(--muted); font-size: 0.875rem; }
.en-dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: var(--sp-6); }

html[data-font="lg"] { font-size: 109.375%; }
html[data-font="xl"] { font-size: 118.75%; }

/* ---- dark theme tokens ---- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #120A1F;
  --surface: #1B1029;
  --surface-2: #241534;
  --ink: #F4ECFF;
  --muted: #B9A8CF;
  --border: #35234B;
  --border-strong: #4A3563;
  --brand: #C4A5FF;
  --brand-hover: #DCC8FF;
  --brand-deep: #2A1545;
  --brand-ink: #F5EDFF;
  --brand-soft: #241534;
  --gold: #F472B6;
  --gold-deep: #EC4899;
  --gold-soft: #3B1A2D;
  --gold-ink: #F9A8D4;
  --green: #5BCA97;
  --danger: #FB7185;
  --tint-4:  color-mix(in oklab, var(--brand) 6%, var(--surface));
  --tint-8:  color-mix(in oklab, var(--brand) 10%, var(--surface));
  --tint-14: color-mix(in oklab, var(--brand) 16%, var(--surface));
  --shadow-sm: 0 1px 3px color-mix(in oklab, black 50%, transparent);
  --shadow-md: 0 18px 44px -20px color-mix(in oklab, black 80%, transparent);
}
html[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23C4B5D9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
}

/* ------------------------------------------------------------------
   25. Utilities & print
------------------------------------------------------------------ */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); } .mt-12 { margin-top: var(--sp-12); }
.mb-4 { margin-bottom: var(--sp-4); } .mb-6 { margin-bottom: var(--sp-6); }
.w-full { width: 100%; }

@media print {
  .announce, .topnav, .nav-panel, .sticky-cta, .cta-band, .hero-cta, .btn { display: none !important; }
  body { background: white; padding-bottom: 0 !important; }
  .photo-ph { border: 1px solid var(--border); }
}

/* ============================================================================
   ส่วนเสริมสำหรับเวอร์ชัน PHP (ระบบสมาชิก-คลาสใหม่ + ระบบผู้ดูแล)
   ============================================================================ */
[hidden] { display: none !important; }
.mt-3 { margin-top: var(--sp-3); }
.h2-sm { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; line-height: 1.4; color: var(--brand-ink); }
.u-text-inherit { color: inherit; }
.u-on-dark-muted { color: var(--on-dark-muted); }
.u-gold-link { color: var(--surface); text-decoration-color: var(--gold-on-dark); text-underline-offset: 3px; }
.u-inline-icon { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.bullet-list { padding-left: 24px; display: grid; gap: 8px; color: var(--ink); }
.bullet-list li::marker { color: var(--gold-ink); }
.photo-ph--square { aspect-ratio: 1 / 1; }
.photo-ph--wide { aspect-ratio: 4 / 3; }
.news-list--flush { border-top: 0; }
.map-embed iframe { border: 0; }

.alert { padding: 13px 16px; border-radius: var(--radius); font-size: 0.875rem; line-height: 1.65; border: 1px solid var(--border); }
.alert + .form, .alert + .error-summary { margin-top: var(--sp-4); }
.alert--ok { border-color: color-mix(in oklab, var(--green) 40%, var(--surface)); background: color-mix(in oklab, var(--green) 7%, var(--surface)); color: var(--green); }
.alert--err { border-color: color-mix(in oklab, var(--danger) 55%, var(--surface)); background: color-mix(in oklab, var(--danger) 5%, var(--surface)); color: var(--danger); }

/* ------------------------------- ระบบผู้ดูแล ------------------------------- */
body.admin { background: var(--bg); }
.admin-topbar {
  background-color: var(--brand-deep);
  background-image: linear-gradient(90deg, var(--brand-deep) 0%, color-mix(in oklab, var(--brand) 64%, var(--brand-deep)) 65%, var(--brand-deep) 100%);
  color: var(--on-dark);
}
.admin-topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 66px; flex-wrap: wrap; padding-block: 10px; }
.admin-topbar .brand-name { color: var(--on-dark); }
.admin-topbar .brand-name small { color: var(--on-dark-muted); }
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-nav a { color: var(--on-dark-muted); font-size: 0.875rem; padding: 8px 11px; border-radius: 8px; }
.admin-nav a:hover { color: var(--gold-on-dark); }
.admin-nav a[aria-current="page"] { color: var(--gold-on-dark); font-weight: 600; }
.admin-logout { margin-left: auto; }
.admin-main { padding-block: var(--sp-8) var(--sp-16); }
.admin-login { max-width: 460px; margin: 8vh auto 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: var(--sp-6); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 780px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th { background: var(--surface-2); font-weight: 600; color: var(--brand-ink); white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: 0; }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-pill--new { background: var(--gold-soft); color: var(--gold-ink); }
.status-pill--contacted, .status-pill--read { background: var(--brand-soft); color: var(--brand); }
.status-pill--enrolled, .status-pill--done { background: color-mix(in oklab, var(--green) 12%, var(--surface)); color: var(--green); }
.status-pill--cancelled { background: var(--surface-2); color: var(--muted); }
.status-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.select--sm { min-height: 36px; padding: 4px 30px 4px 10px; font-size: 0.8125rem; width: auto; }
.admin-note { margin-top: 6px; font-size: 0.8125rem; color: var(--muted); }
.admin-note summary { cursor: pointer; color: var(--brand); }
.admin-note p { margin-top: 6px; line-height: 1.7; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-4); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: grid; gap: 6px; }
.stat-card--gold { border-color: color-mix(in oklab, var(--gold) 55%, var(--surface)); background: var(--gold-soft); }
.stat-card--gold .stat-num { color: var(--gold-ink); }
.stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--brand-ink); }
.stat-label { font-size: 0.8125rem; color: var(--muted); }
.pagination { display: flex; align-items: center; gap: 12px; margin-top: var(--sp-6); }
.filterbar a.filter-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
@media print { .admin-topbar, .pagination { display: none !important; } }

/* ==== ระบบคำร้องออนไลน์ (petitions) ==== */
.timeline { list-style: none; display: grid; gap: 0; margin-top: var(--sp-4); }
.timeline li { position: relative; padding: 0 0 22px 34px; border-left: 2px solid var(--border-strong); margin-left: 9px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: -9px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-soft); box-shadow: 0 0 0 2px var(--border-strong); }
.timeline li.tl-last::before { background: var(--gold); box-shadow: 0 0 0 2px color-mix(in oklab, var(--gold) 55%, var(--surface)); }
.timeline .tl-status { font-weight: 600; color: var(--brand-ink); font-size: 0.9375rem; }
.timeline .tl-date { font-size: 0.78125rem; color: var(--muted); margin-top: 2px; }
.timeline .tl-note { font-size: 0.875rem; color: var(--muted); margin-top: 5px; line-height: 1.65; }
.track-result { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: clamp(20px, 3vw, 28px); box-shadow: var(--shadow-sm); }
.track-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: var(--sp-3); }
.ticket-mono { font-family: var(--font-mono); font-size: 1.0625rem; letter-spacing: 0.02em; }
.ref-badge--big { font-size: 1.25rem; padding: 14px 22px; }
.admin-reply { border: 1px solid color-mix(in oklab, var(--gold) 45%, var(--surface)); background: var(--gold-soft); color: var(--gold-ink); border-radius: var(--radius); padding: 14px 16px; font-size: 0.90625rem; line-height: 1.75; margin-top: var(--sp-4); }
.status-pill--progress { background: var(--brand-soft); color: var(--brand); }
.status-pill--resolved { background: color-mix(in oklab, var(--green) 12%, var(--surface)); color: var(--green); }
.status-pill--rejected { background: color-mix(in oklab, var(--danger) 10%, var(--surface)); color: var(--danger); }

/* ==== ระบบตารางเรียน (schedule) ==== */
.alert--warn { border-color: color-mix(in oklab, var(--gold) 55%, var(--surface)); background: var(--gold-soft); color: var(--gold-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: color-mix(in oklab, var(--danger) 82%, #000); }
.sched-head-card { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.sched-wrap { overflow-x: auto; }
.sched-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; background: var(--surface); }
.sched-table th, .sched-table td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 10px 12px; vertical-align: top; font-size: 0.84375rem; text-align: left; }
.sched-table tr:last-child th, .sched-table tr:last-child td { border-bottom: 0; }
.sched-table th:last-child, .sched-table td:last-child { border-right: 0; }
.sched-table thead th { background: var(--brand); color: #fff; font-weight: 600; font-size: 0.875rem; text-align: center; padding: 12px 10px; }
.sched-table thead th:first-child { width: 120px; }
.sched-table tbody th { background: var(--brand-soft); color: var(--brand-ink); width: 120px; text-align: center; font-weight: 600; }
.sched-time { display: block; font-weight: 600; }
.sched-table tbody th small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; font-size: 0.75rem; }
.se-subject { font-weight: 600; color: var(--brand-ink); line-height: 1.45; }
.se-meta { color: var(--muted); font-size: 0.78125rem; margin-top: 3px; }
.se-empty { color: var(--border-strong); }
.sched-break th, .sched-break td { background: var(--gold-soft); color: var(--gold-ink); text-align: center; font-weight: 600; }
@media print {
  .site-header, .site-footer, .cookie-bar, .no-print, .to-top, .skip-link { display: none !important; }
  body { background: #fff; }
  .section, .container { padding-left: 0 !important; padding-right: 0 !important; }
  .sched-wrap { border: 0; border-radius: 0; }
  .sched-table { min-width: 0; }
  .sched-table th, .sched-table td { padding: 5px 6px; font-size: 10.5px; }
  .sched-table thead th { color: #000; background: #ececec; }
  .sched-table tbody th { background: #f4f4f4; color: #000; }
  .sched-break th, .sched-break td { background: #F8F2FF; color: #000; }
}

/* ==== ระบบตารางสอบ (exams) ==== */
.alert--info { border-color: color-mix(in oklab, var(--brand) 35%, var(--surface)); background: var(--brand-soft); color: var(--brand-ink); }
.exam-table { min-width: 760px; }
.exam-table td { font-size: 0.875rem; }
.exam-date { font-weight: 600; color: var(--brand-ink); }
.exam-time { white-space: nowrap; }
.exam-note { color: var(--muted); font-size: 0.8125rem; }
@media print { .exam-table { min-width: 0; } }

/* ==== ระบบผลการเรียน (grades) ==== */
.grade-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.grade-summary > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
.grade-summary .gs-label { font-size: 0.78125rem; color: var(--muted); }
.grade-summary .gs-value { font-size: 1.5rem; font-weight: 700; color: var(--brand); margin-top: 4px; }
@media (max-width: 680px) { .grade-summary { grid-template-columns: 1fr; } }
.grade-badge { display: inline-block; min-width: 44px; text-align: center; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 0.8125rem; }
.grade-badge--good { background: color-mix(in oklab, var(--green) 12%, var(--surface)); color: var(--green); }
.grade-badge--mid { background: var(--brand-soft); color: var(--brand); }
.grade-badge--low { background: color-mix(in oklab, var(--danger) 10%, var(--surface)); color: var(--danger); }
.grade-badge--special { background: var(--surface-2); color: var(--muted); }
.term-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.term-gpa { font-weight: 700; color: var(--brand-ink); font-size: 0.9375rem; }
.grade-table { min-width: 0; }
.grade-table .grade-col-c, .sched-table .grade-col-c { text-align: center; width: 110px; }
@media print { .grade-table { min-width: 0; } }

/* ==== จัดการเนื้อหา (admin content) ==== */
.admin-nav { flex-wrap: wrap; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-actions form { display: inline; }
.faq-admin-item { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 14px 16px; }
.faq-admin-item + .faq-admin-item { margin-top: var(--sp-3); }
.faq-admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.faq-admin-head strong { line-height: 1.55; }
.faq-admin-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.faq-edit { margin-top: 10px; }
.faq-edit summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 0.875rem; }
.faq-edit form { margin-top: var(--sp-3); }
.settings-group { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: clamp(16px, 2.5vw, 24px); }
.settings-group > h3 { margin-bottom: var(--sp-4); }
.current-file { font-size: 0.8125rem; color: var(--muted); margin-top: 6px; }
.chk-spaced { margin-top: 30px; }

/* ==== ชุดอัปเดตใหญ่: ประกาศ / เมนูย่อย / ผลงาน / แบนเนอร์ / ป๊อปอัป / บุคลากร ==== */
.noticebar { background: var(--brand); color: #fff; }
.noticebar + .noticebar { border-top: 1px solid rgba(255,255,255,.2); }
.noticebar-inner { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: 0.875rem; flex-wrap: wrap; }
.noticebar-inner strong { color: var(--gold-on-dark); }
.noticebar-msg { flex: 1 1 auto; min-width: 200px; }
.noticebar-close { margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.noticebar-close:hover { color: var(--gold-on-dark); }
.nav-drop-wrap { position: relative; display: inline-flex; align-items: center; }
.nav-caret { margin-left: 3px; vertical-align: -1px; }
/* แผงเมนูย่อย — นิ่งอยู่กับที่: มีสะพานรับเมาส์กันพลาดช่องว่าง + ปิดหน่วงเวลา ไม่หายแวบ */
.nav-drop-wrap::after { content: ""; position: absolute; left: -8px; right: -8px; top: 100%; height: 18px; }
.nav-drop { position: absolute; top: calc(100% + 8px); left: 0; min-width: 300px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 18px 44px rgba(46, 16, 101, 0.16); padding: 10px; z-index: 80;
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.35s;
}
.nav-drop-wrap:hover .nav-drop,
.nav-drop-wrap:focus-within .nav-drop,
.nav-drop-wrap.is-open .nav-drop {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s;
}
.nav-drop .subnav-list a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 0.875rem; color: var(--ink); }
.nav-drop .subnav-list a:hover { background: var(--brand-soft); color: var(--brand); }
.subnav-list { list-style: none; margin: 0; padding: 0; }
.subnav-card .subnav-list { margin-top: 10px; }
.subnav-card .subnav-list a { display: block; padding: 7px 0; font-size: 0.875rem; color: var(--ink); border-bottom: 1px dashed var(--border); }
.subnav-card .subnav-list li:last-child a { border-bottom: 0; }
.subnav-card .subnav-list a:hover { color: var(--brand); }
.nav-panel-sub { margin: 2px 0 10px 14px; border-left: 2px solid var(--border); padding-left: 12px; }
.nav-panel-sub .subnav-list a { display: block; padding: 6px 0; font-size: 0.875rem; color: var(--muted); }
.nav-panel-sub .subnav-list a:hover { color: var(--brand); }
.works-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
@media (max-width: 780px) { .works-grid { grid-template-columns: 1fr; } }
.work-card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.work-ph { min-height: 160px; position: relative; }
.work-ph .chip { position: absolute; top: 10px; left: 10px; }
.chip--gold { background: var(--gold); color: var(--on-gold); }
.work-body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.banner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 900px) { .banner-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .banner-grid { grid-template-columns: 1fr; } }
.banner-tile { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.banner-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(46, 16, 101, 0.12); border-color: var(--brand); }
.banner-tile .bt-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.banner-tile strong { color: var(--brand-ink); }
.banner-tile span { color: var(--muted); font-size: 0.8125rem; }
body.popup-open { overflow: hidden; }
.popup-overlay { position: fixed; inset: 0; background: rgba(30, 10, 50, 0.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 200; }
.popup-box { position: relative; width: min(560px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(28, 10, 42, 0.4); }
.popup-img { width: 100%; display: block; }
.popup-body { padding: 20px 22px 22px; }
.popup-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 1.25rem; cursor: pointer; line-height: 1; }
.popup-close:hover { background: var(--danger); }
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 900px) { .people-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .people-grid { grid-template-columns: 1fr; } }
.person-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 16px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.person-card img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brand-soft); }
.person-ph { width: 96px; height: 96px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; }
.check-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.check-list li { position: relative; padding-left: 26px; line-height: 1.7; }
.check-list li::before { content: '\2713'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.prose { max-width: 74ch; }
.prose p { line-height: 1.85; }
.person-admin-line { display: flex; align-items: center; gap: 12px; }
.person-admin-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--brand-soft); }
.person-admin-thumb--ph { display: flex; align-items: center; justify-content: center; color: var(--brand); font-weight: 700; font-size: 1.125rem; }
.person-admin-thumb--wide { width: 64px; height: 44px; border-radius: 8px; }

/* ==== แบนเนอร์ภาพทางลัด (หน้าแรก) ==== */
.banner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 900px) { .banner-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .banner-grid { grid-template-columns: 1fr; } }
.banner-tile { position: relative; display: block; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; min-height: 172px; background: var(--brand-soft); transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.banner-tile .bt-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-tile .bt-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; padding: 14px 16px; background: linear-gradient(to top, rgba(30, 10, 50, 0.9) 0%, rgba(30, 10, 50, 0.6) 42%, rgba(30, 10, 50, 0.1) 78%, rgba(30, 10, 50, 0) 100%); }
.banner-tile .bt-overlay strong { color: #fff; font-size: 1.03125rem; line-height: 1.4; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.banner-tile .bt-overlay span { color: rgba(255, 255, 255, 0.88); font-size: 0.8125rem; line-height: 1.5; }
.banner-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(46, 16, 101, 0.18); border-color: var(--brand); }

/* ==== ระบบผู้ช่วยแอดมิน / นำเข้าผลการเรียน / สำรองข้อมูล (อัปเดตรอบ 8) ==== */
.admin-head-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-userbox { display: flex; align-items: center; gap: 8px; margin-right: 2px; flex-shrink: 0; }
.admin-userbox-name { font-size: 0.8125rem; color: var(--muted); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.role-pill--owner { background: var(--gold-soft); color: var(--gold-ink); }
.role-pill--admin { background: var(--brand-soft); color: var(--brand); }
.role-pill--editor { background: var(--surface-2); color: var(--muted); }
.user-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.perm-grid .check span { font-size: 0.8125rem; }

.import-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 1100px) { .import-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .import-stats { grid-template-columns: repeat(2, 1fr); } }
.import-stat { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.import-stat b { display: block; font-size: 1.35rem; line-height: 1.3; }
.import-stat span { font-size: 0.75rem; color: var(--muted); }
.import-stat--ok b { color: var(--green); }
.import-stat--clean b { color: var(--gold-ink); }
.import-stat--dup b { color: #9A6700; }
.import-stat--err b { color: var(--danger); }
.import-tips { padding-left: 18px; }
.import-tips li { margin: 6px 0; line-height: 1.55; }
.import-table td { vertical-align: top; }
.import-note { font-size: 0.75rem; color: var(--muted); line-height: 1.55; }
.import-note .ip-err-text { color: var(--danger); }
.status-pill.ip-ok { background: color-mix(in oklab, var(--green) 12%, var(--surface)); color: var(--green); }
.status-pill.ip-clean { background: var(--gold-soft); color: var(--gold-ink); }
.status-pill.ip-dup { background: #FEF0C7; color: #9A6700; }
.status-pill.ip-err { background: color-mix(in oklab, var(--danger) 10%, var(--surface)); color: var(--danger); }

.mono-block { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8125rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; word-break: break-all; line-height: 1.5; }
.backup-meta { display: flex; gap: 28px; flex-wrap: wrap; }
.backup-meta b { font-size: 1.05rem; }

.cf-turnstile { margin: 4px 0 14px; }

/* ==== อัปเดตรอบ 9: จัดเมนูแถวเดียว + สถิติผู้เข้าชม + 2FA ==== */

/* 1) เมนูหลัก — ให้ทุกเมนูอยู่ระดับแถวเดียวกัน (แก้ caret ตกบรรทัด / ข้อความเหลื่อม) */
.nav a { white-space: nowrap; }
.nav > a { flex: 0 0 auto; }
.nav-drop-wrap { display: flex; align-items: center; flex: 0 0 auto; }
.nav-drop-wrap > a { display: inline-flex; align-items: center; }
.nav-caret { margin-left: 3px; flex: none; }

/* 2) สถิติผู้เข้าชม */
.visit-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
@media (max-width: 900px) { .visit-cards { grid-template-columns: repeat(2, 1fr); } }
.visit-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.visit-card b { display: block; font-size: 1.75rem; line-height: 1.2; color: var(--brand); margin: 4px 0 2px; }
.visit-card:first-child { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%); border-color: var(--brand-deep); }
.visit-card:first-child b { color: #fff; }
.visit-card:first-child .vc-label, .visit-card:first-child .vc-sub { color: var(--on-dark-muted); }
.vc-label { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.vc-sub { font-size: 0.75rem; color: var(--muted); }
.year-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.vbar-cell { width: 36%; }
.vbar { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--brand), var(--gold)); min-width: 2px; width: 2%; }
.recent-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 0.875rem; }
.recent-row:last-child { border-bottom: 0; }

/* 3) 2FA */
.input--code { letter-spacing: 0.45em; font-size: 1.25rem; text-align: center; max-width: 230px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.twofa-setup { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: start; }
@media (max-width: 720px) { .twofa-setup { grid-template-columns: 1fr; } }
.qr-box { width: 210px; height: 210px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 8px; display: flex; align-items: center; justify-content: center; }
.qr-box svg { width: 100%; height: 100%; }
.admin-userbox-name { color: var(--muted); text-decoration: none; }
.admin-userbox-name:hover { color: var(--brand); text-decoration: underline; }

/* ==== อัปเดตรอบ 10: สถิตินักศึกษา (หน้าเว็บ + กราฟ) ==== */
.page-lead { color: var(--muted); margin-top: 6px; font-size: 0.98rem; }
.ta-r { text-align: right; }

.ss-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 760px) { .ss-cards { grid-template-columns: 1fr; } }
.ss-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 18px; }
.ss-card b { display: block; font-size: 1.9rem; line-height: 1.25; color: var(--brand); margin: 4px 0 2px; }
.ss-card--main { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%); border-color: var(--brand-deep); }
.ss-card--main b { color: #fff; }
.ss-card--main .ss-label, .ss-card--main .ss-sub { color: var(--on-dark-muted); }
.ss-label { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.ss-sub { font-size: 0.75rem; color: var(--muted); }

.ss-ratio { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ratio-svg { width: 100%; height: auto; display: block; margin: 8px 0; }
.ratio-svg text { font-size: 12px; font-weight: 600; }
.ratio-svg .rt-on-dark { fill: #fff; }
.ratio-svg .rt-on-gold { fill: #FFFFFF; }

.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { fill: var(--ink); font-size: 12px; }
.chart-svg .ch-grid { stroke: var(--border); stroke-width: 1; }
.chart-svg .ch-ylab { fill: var(--muted); font-size: 11px; }
.chart-svg .ch-val { fill: var(--muted); font-size: 11.5px; }
.chart-svg .ch-xlab { font-size: 12.5px; font-weight: 600; }
.chart-svg .bar-m { fill: var(--brand); }
.chart-svg .bar-f { fill: var(--gold); }
.chart-svg .ch-hl { fill: color-mix(in oklab, var(--gold) 20%, transparent); stroke: var(--gold); stroke-width: 1.5; }
.chart-svg a { cursor: pointer; }
.chart-svg a:hover { opacity: 0.82; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.8125rem; color: var(--muted); margin-top: 8px; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend-note { font-style: italic; }
.lg-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.lg-dot--m { background: var(--brand); }
.lg-dot--f { background: var(--gold); }
.chart-note { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

.ss-table { width: 100%; border-collapse: collapse; }
.ss-table th, .ss-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.ss-table thead th { font-size: 0.8125rem; color: var(--muted); text-align: left; border-bottom: 2px solid var(--border-strong); }
.ss-table tfoot .ss-total td { font-weight: 700; border-top: 2px solid var(--border-strong); border-bottom: 0; background: var(--tint-4); }
.ss-table tbody tr:hover td { background: var(--tint-4); }

.ss-num { max-width: 110px; }
.ss-add-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ss-add-label { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.ss-edit-table td { vertical-align: middle; }

/* ==== อัปเดตรอบ 11: ปฏิทินการศึกษา + ค้นหา + ตรวจสอบสถานะใบสมัคร + หลักสูตร ==== */

/* ปุ่มค้นหาในเฮดเดอร์ */
.nav-search-btn { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink); border: 1px solid transparent; flex: 0 0 auto; }
@media (min-width: 1320px) { .nav-search-btn { display: inline-flex; } }
.nav-search-btn:hover { background: var(--surface-2); border-color: var(--border); }
.nav-search-btn svg { width: 19px; height: 19px; }
.nav-search-form { display: flex; gap: 8px; margin: 12px 0 2px; }
.nav-search-form .input { flex: 1; min-width: 0; }

/* ฟิลด์ฟอร์มเสริม */
.field-row--2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.field-row--4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
@media (max-width: 760px) { .field-row--2, .field-row--4 { grid-template-columns: 1fr; } }
.input--tiny { max-width: 110px; }

/* ปฏิทินการศึกษา (หน้าเว็บ) */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cal-month { margin-top: 4px; }
.cal-month-title { font-size: 1.05rem; color: var(--brand); border-bottom: 2px solid var(--gold); display: inline-block; padding-bottom: 4px; margin-bottom: 10px; }
.cal-list { display: grid; gap: 10px; }
.cal-item { display: grid; grid-template-columns: 58px 1fr auto; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 12px; padding: 12px 14px; }
.cal-item--exam { border-left-color: var(--danger); }
.cal-item--holiday { border-left-color: var(--green); }
.cal-item--activity { border-left-color: var(--gold); }
.cal-date { text-align: center; background: var(--surface-2); border-radius: 10px; padding: 6px 4px; }
.cal-date b { display: block; font-size: 1.35rem; line-height: 1.15; color: var(--brand); }
.cal-date span { font-size: 0.75rem; color: var(--muted); }
.cal-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-title { font-size: 1rem; }
.cal-meta { font-size: 0.8125rem; color: var(--muted); margin-top: 3px; }
.cal-detail { margin-top: 5px; }
.cal-cat { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.cal-cat--semester { background: var(--brand-soft); color: var(--brand); }
.cal-cat--exam { background: #FDE7E5; color: var(--danger); }
.cal-cat--holiday { background: #E4F4EC; color: var(--green); }
.cal-cat--activity { background: var(--gold-soft); color: var(--gold-ink); }
.cal-ics { align-self: center; white-space: nowrap; }
@media (max-width: 640px) { .cal-item { grid-template-columns: 48px 1fr; } .cal-ics { grid-column: 2; justify-self: start; } }
.cal-past summary { cursor: pointer; font-weight: 600; }
.cal-past-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.cal-past-list li:last-child { border-bottom: 0; }
.step-list { padding-left: 0; list-style: none; counter-reset: sl; }
.step-list li { counter-increment: sl; position: relative; padding-left: 30px; margin: 10px 0; line-height: 1.6; }
.step-list li::before { content: counter(sl); position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 0.72rem; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* ค้นหาในเว็บ */
.search-hero { max-width: 680px; }
.search-hero-row { display: flex; gap: 10px; }
.search-hero-input { flex: 1; min-width: 0; font-size: 1.05rem; }
.sr-summary { font-size: 1.02rem; }
.sr-suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link { display: inline-flex; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font-size: 0.8438rem; }
.chip-link:hover { border-color: var(--brand); color: var(--brand); }
.sr-group { margin-top: 26px; }
.sr-group-head { font-size: 1.05rem; padding-bottom: 6px; border-bottom: 2px solid var(--border); margin-bottom: 10px; }
.sr-list { display: grid; gap: 10px; }
.sr-item { display: flex; justify-content: space-between; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.sr-item:hover { border-color: var(--brand); box-shadow: 0 8px 18px rgba(46, 16, 101, 0.08); }
.sr-item-title { color: var(--brand); font-size: 0.95rem; }
.sr-item-snippet { margin-top: 4px; color: var(--muted); font-size: 0.8438rem; line-height: 1.65; }
.sr-item-meta { font-size: 0.75rem; color: var(--muted); white-space: nowrap; align-self: flex-start; padding-top: 2px; }
.sr-mark { background: var(--gold-soft); color: inherit; padding: 0 2px; border-radius: 3px; }
@media (max-width: 640px) { .sr-item { flex-direction: column; } .search-hero-row { flex-direction: column; } }

/* ตรวจสอบสถานะใบสมัคร */
.status-steps { list-style: none; padding: 0; margin: 0; }
.status-step { position: relative; padding: 0 0 20px 34px; }
.status-step::before { content: ''; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.status-step:last-child::before { display: none; }
.status-step-dot { position: absolute; left: 3px; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); }
.status-step.is-done .status-step-dot { background: var(--green); border-color: var(--green); }
.status-step.is-current .status-step-dot { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.status-step strong { display: block; font-size: 0.9375rem; }
.status-pill--app-new { background: var(--gold-soft); color: var(--gold-ink); }
.status-pill--app-contacted { background: var(--brand-soft); color: var(--brand); }
.status-pill--app-enrolled { background: #E4F4EC; color: var(--green); }
.status-pill--app-cancelled { background: var(--surface-2); color: var(--muted); }

/* หลังบ้าน: หลักสูตร + ปฏิทิน */
.prog-admin-head, .cal-admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.prog-admin-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prog-admin-info p { flex-basis: 100%; margin-top: 2px; }
.sched-head-card .no-print { display: flex; gap: 8px; flex-wrap: wrap; }

/* ==== อัปเดตรอบ 12: แกลเลอรี / งาน-ฝึกงาน / ถังขยะ / ตัวกรอง log / 2FA recovery / โหมดปิดปรับปรุง ==== */

/* แกลเลอรี (สาธารณะ) */
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 900px) { .album-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .album-grid { grid-template-columns: 1fr; } }
.album-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: block; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.album-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(46, 16, 101, 0.14); border-color: var(--brand); }
.album-cover { position: relative; aspect-ratio: 3 / 2; background: var(--surface-2); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-cover-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--brand); font-weight: 700; font-size: 1.4rem; }
.album-count { position: absolute; right: 10px; bottom: 10px; background: rgba(30, 10, 50, 0.82); color: #fff; font-size: 0.75rem; padding: 3px 10px; border-radius: 999px; }
.album-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 900px) { .photo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .photo-grid { grid-template-columns: 1fr; } }
.photo-item { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.photo-item a { display: block; aspect-ratio: 3 / 2; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item figcaption { padding: 8px 12px; font-size: 0.8125rem; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 1200; background: rgba(24, 10, 38, 0.92); display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1100px, 94vw); max-height: 90vh; display: flex; flex-direction: column; gap: 10px; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 10px; }
.lightbox figcaption { color: rgba(255, 255, 255, 0.85); font-size: 0.875rem; text-align: center; }
.lightbox-close { position: absolute; top: 14px; right: 18px; background: rgba(255, 255, 255, 0.12); color: #fff; border: 0; width: 42px; height: 42px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }
.no-scroll { overflow: hidden; }

/* งาน/ฝึกงาน (สาธารณะ) */
.job-card { border-left: 4px solid var(--brand); }
.job-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.job-title { display: block; font-size: 1.02rem; margin-top: 4px; }
.job-meta { text-align: right; display: flex; flex-direction: column; gap: 3px; }
.job-salary { font-weight: 700; color: var(--brand); }
.job-desc { margin-top: 10px; color: var(--ink); font-size: 0.9rem; line-height: 1.7; }
.job-contact { margin-top: 8px; font-size: 0.8438rem; color: var(--muted); }
.job-type { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.job-type--work { background: var(--brand-soft); color: var(--brand); }
.job-type--internship { background: #E4F4EC; color: var(--green); }
.job-type--parttime { background: var(--gold-soft); color: var(--gold-ink); }

/* หลังบ้าน: แกลเลอรี / log filter / recovery */
.gallery-admin-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.gallery-admin-thumb { width: 110px; height: 74px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.gallery-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb-ph { font-size: 0.75rem; color: var(--muted); }
.gallery-admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 900px) { .gallery-admin-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery-admin-grid { grid-template-columns: 1fr; } }
.gallery-admin-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.gallery-admin-item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.gallery-admin-item-body { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lg-filter-actions { display: flex; gap: 8px; align-items: flex-end; padding-bottom: 2px; }
.rc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 900px) { .rc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rc-code { text-align: center; padding: 8px 6px; font-size: 0.95rem; letter-spacing: 0.04em; background: var(--gold-soft); border: 1px dashed var(--gold); border-radius: 8px; }
.rc-card { border: 2px solid var(--gold); }
.rc-info h4 { font-size: 0.95rem; }

/* โหมดปิดปรับปรุง */
.maintenance-panel { max-width: 620px; margin: 6vh auto; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px 32px; }
.maintenance-icon { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); display: flex; align-items: center; justify-content: center; }
.maintenance-panel h1 { font-size: 1.6rem; }
.maintenance-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

/* ==== อัปเดตรอบ 13: ระบบบัญชีนักศึกษา (Student Portal) ==== */
.stu-login-card { max-width: 560px; }
.chan--highlight { border: 2px solid var(--gold); background: linear-gradient(180deg, var(--gold-soft) 0%, var(--surface) 70%); }
.stu-gpa-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 700px) { .stu-gpa-row { grid-template-columns: 1fr; } }
.stu-gpa-row .gs-box { margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stu-gpa-row .gs-label { font-size: 0.8125rem; color: var(--muted); }
.stu-gpa-row .gs-value { font-size: 1.6rem; font-weight: 700; color: var(--brand); margin-top: 2px; }
.stu-petition { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.stu-petition-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.field-error { display: block; font-size: 0.7812rem; color: var(--danger); margin-top: 4px; }

/* ============================================================================
   อัปเดตรอบ 14 (2026-10-30): โปรไฟล์ผู้ดูแล + Dashboard ฉบับอ่านง่าย
   ============================================================================ */

/* ---- โปรไฟล์บนแถบผู้ดูแล ---- */
.admin-userbox-name {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.25;
  text-decoration: none;
}
.admin-userbox-name strong {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--on-dark);
  font-size: 0.8125rem;
  font-weight: 600;
}
.admin-userbox-name small {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--on-dark-muted);
  font-size: 0.7rem;
}
.admin-userbox-name:hover strong { color: var(--gold-on-dark); }
.admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--brand) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 12px color-mix(in oklab, var(--brand-ink) 28%, transparent);
}
.admin-avatar:hover { filter: brightness(1.08); }

/* ---- Dashboard: hero ---- */
.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(520px 240px at 100% 0%, color-mix(in oklab, var(--gold) 15%, transparent), transparent 72%),
    linear-gradient(135deg, var(--brand-soft) 0%, var(--surface) 74%);
  margin-bottom: 20px;
}
.dash-hero-copy { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.dash-hero-text { min-width: 0; }
.dash-hero-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--gold) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.dash-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-cap);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}
.dash-eyebrow::before { content: ''; width: 16px; height: 2px; background: var(--gold); }
.dash-hero h1 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin-top: 6px; }
.dash-hero p { margin-top: 8px; color: var(--muted); max-width: 58ch; font-size: 0.9375rem; }
.dash-hero p strong { color: var(--brand); }
.dash-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.dash-date { font-size: 0.8125rem; color: var(--muted); }
.dash-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---- Dashboard: KPI ---- */
.dash-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dash-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.dash-kpi:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-md); }
.dash-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex: none;
}
.dash-kpi-icon svg { width: 22px; height: 22px; }
.dash-kpi--pink .dash-kpi-icon { background: var(--gold-soft); color: var(--gold-ink); }
.dash-kpi--purple .dash-kpi-icon { background: var(--brand-soft); color: var(--brand); }
.dash-kpi--soft .dash-kpi-icon { background: color-mix(in oklab, var(--brand-soft) 55%, var(--gold-soft)); color: var(--brand); }
.dash-kpi-body { display: flex; flex-direction: column; min-width: 0; }
.dash-kpi-label { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.dash-kpi-num { font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; line-height: 1.1; color: var(--brand-ink); margin-top: 1px; }
.dash-kpi-note { font-size: 0.75rem; color: var(--muted); }
.dash-kpi-arrow { margin-left: auto; color: var(--brand); font-size: 1.1rem; opacity: .55; }
.dash-kpi:hover .dash-kpi-arrow { opacity: 1; }

.dash-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.dash-mini-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.8125rem;
  color: var(--muted);
}
.dash-mini-item b { font-family: var(--font-display); font-size: 1.15rem; color: var(--brand-ink); }

/* ---- Dashboard: cards + compact lists ---- */
.dash-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; margin-top: 22px; }
.dash-card { padding: 20px; }
.dash-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.dash-card-head h2 { margin: 0 0 2px; }
.dash-card-head p { margin: 0; }
.dash-card-head .text-link { white-space: nowrap; font-size: 0.8125rem; }
.dash-list { display: grid; }
.dash-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  margin-inline: -10px;
  border-radius: 10px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease);
}
.dash-row:last-child { border-bottom: 0; }
.dash-row:hover { background: var(--surface-2); }
.dash-row-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.dash-row-main strong { font-size: 0.9062rem; color: var(--brand-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row-meta { font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row-sub { font-size: 0.75rem; color: var(--muted); }
.dash-row-date { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.dash-row--contact { grid-template-columns: minmax(0, 1fr) auto auto; }
.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
  color: var(--muted);
  font-size: 0.8125rem;
}
.dash-empty strong { color: var(--ink); font-size: 0.9062rem; }
.dash-empty-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 4px; }
.dash-empty-icon svg { width: 20px; height: 20px; }

/* ---- Profile ---- */
.profile-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.profile-identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--gold) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}
.profile-identity h1 { margin-top: 2px; }
.profile-identity p { margin-top: 3px; }
.profile-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
.profile-card, .profile-side { padding: 20px; }
.profile-card .form { gap: var(--sp-5); }
.profile-card .field-row { align-items: start; }
.profile-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.profile-card-head h2 { margin-bottom: 2px; }
.profile-card-head p { margin: 0; }
.profile-facts { display: grid; gap: 0; margin-top: 12px; }
.profile-facts > div { display: grid; grid-template-columns: 118px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: center; }
.profile-facts > div:last-child { border-bottom: 0; }
.profile-facts dt { font-size: 0.78rem; color: var(--muted); }
.profile-facts dd { margin: 0; font-size: 0.8438rem; color: var(--ink); overflow-wrap: anywhere; }
.profile-security { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

@media (max-width: 1050px) {
  .dash-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dash-kpis { grid-template-columns: 1fr 1fr; }
  .dash-kpi:last-child { grid-column: 1 / -1; }
  .dash-mini { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .dash-hero { align-items: flex-start; flex-direction: column; }
  .dash-hero-side { align-items: flex-start; }
  .dash-hero-actions { justify-content: flex-start; }
  .dash-row--contact { grid-template-columns: minmax(0, 1fr) auto; }
  .dash-row--contact .dash-row-date { display: none; }
}
@media (max-width: 560px) {
  .dash-kpis { grid-template-columns: 1fr; }
  .dash-kpi:last-child { grid-column: auto; }
  .dash-mini { grid-template-columns: 1fr; }
  .profile-facts > div { grid-template-columns: 96px 1fr; }
  .profile-card .field-row { grid-template-columns: 1fr; }
}

/* ============================================================================
   อัปเดตรอบ 15 (2026-10-30): เมนูผู้ดูแลแบบ Sidebar + Topbar ใหม่
   ============================================================================ */

body.admin { background: var(--surface-2); }
.admin-shell { display: flex; align-items: stretch; min-height: 100vh; }
.admin-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* ---- Sidebar ---- */
.admin-sidebar {
  width: 264px;
  flex: 0 0 264px;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  overflow: hidden auto;
  background-color: var(--brand-deep);
  background-image:
    radial-gradient(360px 240px at 20% 0%, color-mix(in oklab, var(--gold) 18%, transparent), transparent 70%),
    linear-gradient(180deg, var(--brand-deep) 0%, color-mix(in oklab, var(--brand-deep) 82%, var(--brand)) 100%);
  color: var(--on-dark);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--on-dark-muted) 45%, transparent) transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 8px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: color-mix(in oklab, var(--on-dark-muted) 40%, transparent); border-radius: 4px; }
.admin-sidebar-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--on-dark-line);
  background: color-mix(in oklab, var(--brand-deep) 86%, transparent);
  backdrop-filter: blur(10px);
}
.admin-sidebar-brand { min-width: 0; margin-right: auto; }
.admin-sidebar .brand-logo { width: 38px; height: 38px; }
.admin-sidebar .brand-name {
  color: var(--on-dark);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}
.admin-sidebar .brand-name small {
  display: block;
  color: var(--on-dark-muted);
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.admin-sidebar-close {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--on-dark-line);
  border-radius: 9px;
  background: transparent;
  color: var(--on-dark);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.admin-sidebar-close:hover { background: color-mix(in oklab, white 10%, transparent); }
.admin-sidenav { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px 12px; flex: 1 1 auto; }
.admin-nav-group { margin-top: 5px; }
.admin-nav-group:first-child { margin-top: 2px; }
.admin-nav-label {
  display: block;
  padding: 0 12px 2px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  opacity: 0.72;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 11px;
  border-radius: 8px;
  color: var(--on-dark-muted);
  font-size: 0.82rem;
  line-height: 1.35;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.admin-nav-link:hover { background: color-mix(in oklab, white 9%, transparent); color: var(--on-dark); }
.admin-nav-link[aria-current="page"] {
  background: color-mix(in oklab, var(--gold) 22%, transparent);
  color: var(--on-dark);
  font-weight: 600;
}
.admin-nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
  opacity: 0.45;
}
.admin-nav-link[aria-current="page"] .admin-nav-dot {
  background: var(--gold-on-dark);
  opacity: 1;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--gold) 20%, transparent);
}

/* ---- Topbar ---- */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}
.admin-topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px clamp(16px, 3vw, 28px);
  flex-wrap: nowrap;
}
.admin-topbar-title { display: flex; flex-direction: column; min-width: 0; }
.admin-topbar-title strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-topbar-title small {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-topbar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; flex: none; }
.admin-icon-link {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.admin-icon-link:hover { border-color: var(--brand); color: var(--brand); }
.admin-icon-link svg { width: 17px; height: 17px; }
.admin-topbar .admin-userbox-name strong { color: var(--ink); }
.admin-topbar .admin-userbox-name small { color: var(--muted); }
.admin-topbar .admin-userbox-name:hover strong { color: var(--brand); }
.admin-logout { margin-left: 0; }
.admin-nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--brand);
  cursor: pointer;
}
.admin-nav-toggle svg { width: 20px; height: 20px; }
.admin-nav-toggle:hover { border-color: var(--brand); }
.admin-backdrop { display: none; position: fixed; inset: 0; z-index: 65; background: rgba(24, 8, 38, 0.48); }

/* ---- Auth (login) ใช้ topbar แบบเดิม ---- */
.admin-topbar.admin-topbar--auth {
  background-color: var(--brand-deep);
  background-image: linear-gradient(90deg, var(--brand-deep) 0%, color-mix(in oklab, var(--brand) 64%, var(--brand-deep)) 65%, var(--brand-deep) 100%);
  border-bottom: 0;
  color: var(--on-dark);
}
.admin-topbar--auth .admin-topbar-inner { min-height: 72px; }
.admin-topbar--auth .brand-name { color: var(--on-dark); }
.admin-topbar--auth .brand-name small { color: var(--on-dark-muted); }
.admin-shell--auth .admin-body { min-height: 100vh; }

@media (max-width: 1050px) {
  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(288px, 86vw);
    flex-basis: auto;
    transform: translateX(-102%);
    transition: transform 240ms var(--ease);
    box-shadow: 18px 0 46px rgba(24, 8, 38, 0.28);
  }
  body.admin-nav-open .admin-sidebar { transform: none; }
  body.admin-nav-open .admin-backdrop { display: block; }
  body.admin-nav-open { overflow: hidden; }
  .admin-sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  .admin-nav-toggle { display: inline-flex; }
  .admin-nav-link { padding: 8px 11px; }
  .admin-nav-group { margin-top: 8px; }
}
@media (max-width: 640px) {
  .admin-topbar-inner { gap: 10px; padding-inline: 14px; }
  .admin-topbar-title small { display: none; }
  .admin-userbox-name { display: none; }
  .admin-topbar-right { gap: 8px; }
  .admin-topbar-right .admin-logout .btn { padding-inline: 10px; font-size: 0.78rem; }
}
