/* Home page — M2 "Light aurora glass" with illustrated scene and scroll motion */
:root {
  --ink: #0B1F3F; --navy: #12305F; --blue: #1A4FBF; --blue-2: #6A8CFF; --tint: #EAF1FD;
  --gold: #C9932B; --gold-soft: #F2C76A; --ground: #F6F8FD; --line: #E4EAF2; --line-strong: #D5DEEA;
  --muted: #4A5A72; --text-2: #2B3B57; --out-bg: #FFF4DC; --out-ink: #6B4000; --in-bg: #E6F6EE; --in-ink: #1E6B44;
  --focus: #F2B33D; --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow: 0 12px 34px rgba(11,31,63,.08); --shadow-lg: 0 24px 60px rgba(11,31,63,.16);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; font-family: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, sans-serif; font-size: 16px; line-height: 1.65; color: var(--ink); background: var(--ground); overflow-x: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: var(--blue); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: #fff; color: var(--navy); padding: 10px 16px; border-radius: 8px; font-weight: 600; z-index: 100; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }

/* scroll progress */
.progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 60; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--blue), var(--blue-2), var(--gold-soft)); }

/* header: glass pill that firms up on scroll */
.site-header { position: fixed; left: 0; right: 0; top: 16px; z-index: 50; padding: 0 24px; transition: top .4s var(--ease); }
.site-header .bar { max-width: 1240px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 12px 10px 18px; border-radius: 999px; background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 8px 30px rgba(11,31,63,.06); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background-color .4s ease, box-shadow .4s ease, padding .4s var(--ease); }
.site-header.scrolled { top: 8px; }
.site-header.scrolled .bar { background: rgba(255,255,255,.9); box-shadow: 0 14px 40px rgba(11,31,63,.12); padding-top: 6px; padding-bottom: 6px; }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); }
.brand img { height: 42px; width: auto; display: block; }
.brand b { font-weight: 600; border-left: 1px solid #B8C5D8; padding-left: 12px; line-height: 1.3; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-weight: 500; }
.nav a { color: var(--ink); text-decoration: none; padding: 9px 14px; border-radius: 999px; transition: background-color .2s ease, color .2s ease; }
.nav a:hover { background: var(--tint); color: var(--ink); }
.nav a.on { background: var(--ink); color: #fff; }
.nav a.cta { background: var(--blue); color: #fff; font-weight: 600; margin-left: 6px; }
.nav a.cta:hover { background: var(--ink); color: #fff; }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--tint); color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }

/* hero with illustrated scene */
.hero { position: relative; min-height: min(100vh, 900px); min-height: min(100svh, 900px); overflow: hidden; display: flex; align-items: center; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene g[data-depth] { will-change: transform; }
.cloud { animation: cloud 26s ease-in-out infinite; }
.ship { animation: ship 70s linear infinite; }
.sun { transform-box: fill-box; transform-origin: center; animation: sun 7s ease-in-out infinite; }
@keyframes cloud { 50% { transform: translateX(70px); } }
@keyframes ship { from { transform: translateX(-260px); } to { transform: translateX(1700px); } }
@keyframes sun { 50% { opacity: 1; transform: scale(1.06); } }
.hero-inner { position: relative; width: 100%; max-width: 1240px; margin: 0 auto; padding: 120px 24px 140px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; }
.pill { display: inline-flex; padding: 6px 16px; border-radius: 999px; background: rgba(255,255,255,.82); border: 1px solid var(--line-strong); font-size: 14px; font-weight: 600; color: var(--navy); }
.hero h1 { margin-top: 20px; font-size: clamp(34px, 4.6vw, 62px); line-height: 1.2; font-weight: 700; letter-spacing: -.5px; }
.grad { background: linear-gradient(90deg, var(--blue), var(--blue-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { margin-top: 16px; font-size: 18px; color: var(--text-2); max-width: 620px; }
.searchbox { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border-radius: 18px; background: rgba(255,255,255,.94); border: 1px solid #fff; box-shadow: var(--shadow-lg); max-width: 680px; transition: box-shadow .3s ease, transform .3s var(--ease); }
.searchbox:focus-within { box-shadow: 0 26px 70px rgba(26,79,191,.24); transform: translateY(-2px); }
.searchbox input { flex: 1 1 240px; min-width: 0; height: 52px; border: 0; padding: 0 16px; font: inherit; font-size: 17px; color: var(--ink); background: transparent; outline: none; }
.searchbox select { flex: 0 1 150px; height: 52px; border: 0; border-left: 1px solid var(--line-strong); padding: 0 12px; font: inherit; color: var(--ink); background: transparent; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border: 0; border-radius: 12px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .2s ease, transform .2s var(--ease), box-shadow .2s ease; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--ink); color: #fff; transform: translateY(-1px); }
.popular { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 14px; color: var(--text-2); align-items: center; }
.popular a { padding: 3px 14px; border-radius: 999px; background: rgba(255,255,255,.85); border: 1px solid var(--line-strong); color: var(--ink); text-decoration: none; transition: background-color .2s ease, border-color .2s ease; }
.popular a:hover { background: #fff; border-color: var(--blue); }
.float-stack { position: relative; height: 380px; }
.fcard { position: absolute; border-radius: 22px; padding: 22px; box-shadow: var(--shadow-lg); animation: bob 6s ease-in-out infinite; text-decoration: none; }
.fcard.light { left: 0; top: 0; width: 360px; background: rgba(255,255,255,.86); border: 1px solid #fff; color: var(--ink); }
.fcard.dark { left: 80px; top: 200px; width: 340px; background: rgba(11,31,63,.92); color: #fff; animation-delay: -3s; }
.fcard.dark p { margin-top: 10px; color: #D5DEEA; font-size: 15px; }
.fcard .eyebrow { font-size: 12px; letter-spacing: 2px; color: var(--blue); font-weight: 700; }
.fcard b.t { display: block; font-size: 19px; margin-top: 6px; line-height: 1.45; }
.chips { display: flex; gap: 8px; margin-top: 12px; }
.chip { padding: 2px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; background: var(--tint); color: var(--navy); }
.chip.in { background: var(--in-bg); color: var(--in-ink); }
.chip.out { background: var(--out-bg); color: var(--out-ink); }
.ai-ic { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--gold-soft), var(--gold)); display: flex; align-items: center; justify-content: center; flex: none; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.scroll-cue { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(11,31,63,.35); border-radius: 14px; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--ink); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
.load { opacity: 0; transform: translateY(22px); animation: load .9s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 110ms + 100ms); }
@keyframes load { to { opacity: 1; transform: none; } }

/* scroll reveal */
.js .reveal { opacity: 0; transform: translateY(36px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.left { transform: translateX(-40px); }
.js .reveal.zoom { transform: scale(.94); }
.js .reveal.in { opacity: 1; transform: none; }
.sec { padding: 96px 0 0; }
.sec-head { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; }
.kicker { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; letter-spacing: 2px; font-weight: 700; color: var(--blue); }
.kicker::before { content: ""; width: 0; height: 2px; background: linear-gradient(90deg, var(--blue), var(--gold-soft)); transition: width 1s var(--ease) .2s; }
.in .kicker::before, .no-motion .kicker::before { width: 40px; }
.sec h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.3; margin-top: 6px; }
.more { font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; padding: 6px 0; }
.more:hover { gap: 10px; }
.more { transition: gap .25s var(--ease); }

/* measures */
.mgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.mcard { position: relative; padding: 26px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; transition: transform .4s var(--ease), box-shadow .4s ease, opacity .9s var(--ease); overflow: hidden; }
.mcard::after { content: ""; position: absolute; inset: auto -40% -60% auto; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, var(--c2), transparent 70%); opacity: .0; transition: opacity .4s ease; }
.mcard:hover { transform: translateY(-8px); box-shadow: 0 26px 50px rgba(26,79,191,.16); }
.mcard:hover::after { opacity: .25; }
.mcode { width: 54px; height: 54px; border-radius: 16px; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.mcard h3 { font-size: 20px; line-height: 1.4; margin-top: 8px; }
.mcard p { color: var(--muted); font-size: 15px; flex: 1; }
.mlinks { display: flex; gap: 18px; font-weight: 600; position: relative; z-index: 1; }
.mlinks a { text-decoration: none; padding: 8px 0; }
.mlinks a:hover { text-decoration: underline; }

/* services */
.sgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.svc { padding: 22px 24px; border-radius: 20px; background: #fff; border: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); transition: transform .35s var(--ease), box-shadow .35s ease, border-color .35s ease, opacity .9s var(--ease); }
.svc small { display: block; font-size: 12px; letter-spacing: 1.5px; color: var(--blue); font-weight: 700; }
.svc b { display: block; font-size: 18px; }
.svc span.d { display: block; font-size: 14px; color: var(--muted); }
.svc .go { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--tint); color: var(--blue); display: flex; align-items: center; justify-content: center; transition: background-color .3s ease, color .3s ease, transform .3s var(--ease); }
.svc:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); color: var(--ink); }
.svc:hover .go { background: var(--blue); color: #fff; transform: translateX(4px); }

/* notices */
.two-col { display: flex; flex-wrap: wrap; gap: 24px 32px; align-items: flex-start; }
.notice-col { flex: 999 1 520px; min-width: 0; }
.ntabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: #fff; border: 1px solid var(--line); margin-bottom: 16px; }
.ntab { min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; transition: background-color .25s ease, color .25s ease; }
.ntab:hover { background: var(--tint); }
.ntab[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }
.nlist { display: flex; flex-direction: column; gap: 12px; }
.nitem { display: flex; gap: 18px; align-items: center; padding: 16px 20px; border-radius: 18px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .35s var(--ease), box-shadow .35s ease, opacity .5s ease; }
.nitem:hover { transform: translateX(6px); box-shadow: var(--shadow); color: var(--ink); }
.nitem[hidden] { display: none; }
.nitem .date { flex: none; width: 62px; text-align: center; border-radius: 12px; background: var(--tint); padding: 6px 0; line-height: 1.25; }
.nitem .date b { display: block; font-size: 22px; }
.nitem .date span { font-size: 12px; color: var(--muted); }
.nitem .body { flex: 1; min-width: 0; }
.nitem .body b { display: block; font-weight: 600; }
.nitem .body span { font-size: 14px; color: var(--muted); }
.shortcuts { flex: 1 1 300px; display: flex; flex-direction: column; gap: 16px; }
.panel { border-radius: 22px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.panel h3 { font-size: 18px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: background-color .2s ease; }
.panel a:last-child { border-bottom: 0; }
.panel a:hover { background: var(--ground); color: var(--ink); }
.panel a small { display: block; font-size: 14px; color: var(--muted); }
.help { border-radius: 22px; padding: 22px; background: linear-gradient(140deg, var(--ink), var(--navy) 60%, #2B4FA3); color: #fff; }
.help p { color: #D5DEEA; margin-top: 4px; }
.help .num { display: block; font-size: 26px; font-weight: 700; margin-top: 10px; color: #fff; text-decoration: none; }
.help .num:hover { color: var(--gold-soft); }

/* news */
.news { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.ncard { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; border-radius: 20px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .35s var(--ease), box-shadow .35s ease, opacity .9s var(--ease); }
.ncard:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: var(--ink); }
.ncard.lead { background: linear-gradient(160deg, #fff, var(--tint)); border-color: var(--line-strong); padding: 30px; justify-content: flex-end; min-height: 100%; }
.ncard.lead b { font-size: 23px; line-height: 1.45; }
.ncard b { font-weight: 600; line-height: 1.5; }
.ncard .desc { color: var(--text-2); }
.ncard .meta { display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--muted); }
.ncol { display: flex; flex-direction: column; gap: 14px; }

/* feeds */
.band { margin-top: 96px; padding: 80px 0; background: linear-gradient(180deg, #fff, var(--tint)); }
.band .sec { padding-top: 0; }
.feeds { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.feed { padding: 22px; border-radius: 22px; background: rgba(255,255,255,.85); border: 1px solid #fff; box-shadow: var(--shadow); }
.feed header { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.feed .src { flex: none; width: 50px; height: 46px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.feed header b { display: block; }
.feed header small { font-size: 13px; color: var(--muted); }
.feed ul { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }

/* newsletter */
.newsletter { margin: 96px 0; position: relative; overflow: hidden; border-radius: 28px; padding: 40px; background: linear-gradient(130deg, var(--ink), var(--navy) 55%, #2B4FA3); color: #fff; display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; }
.newsletter::before { content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(242,199,106,.35), transparent 65%); }
.nl-text { position: relative; flex: 1 1 320px; }
.newsletter h2 { font-size: clamp(24px, 2.4vw, 30px); }
.newsletter p { color: #D5DEEA; margin-top: 6px; }
.newsletter form { position: relative; flex: 1 1 440px; display: flex; flex-direction: column; gap: 12px; }
.newsletter form[hidden], .nl-done[hidden] { display: none; }
.topics { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.topics legend { float: left; margin-right: 6px; font-size: 14px; font-weight: 600; line-height: 36px; color: #D5DEEA; }
.topics label { position: relative; cursor: pointer; }
.topics input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.topics span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.35); font-size: 14px; font-weight: 600; transition: background-color .2s ease, color .2s ease; }
.topics input:checked + span { background: var(--gold-soft); border-color: var(--gold-soft); color: var(--ink); }
.topics input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.nl-field { display: flex; gap: 6px; padding: 6px; border-radius: 14px; background: #fff; }
.nl-field input { flex: 1; min-width: 0; height: 46px; border: 0; padding: 0 12px; font: inherit; color: var(--ink); outline: none; background: transparent; }
.nl-done { position: relative; flex: 1 1 440px; display: flex; gap: 10px; align-items: center; font-weight: 600; }

/* footer */
.site-footer { background: var(--ink); color: #D5DEEA; font-size: 15px; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 28px 64px; padding-top: 56px; padding-bottom: 32px; }
.site-footer .col { flex: 1 1 180px; display: flex; flex-direction: column; gap: 6px; }
.site-footer .col.wide { flex: 2 1 320px; }
.site-footer b { color: #fff; }
.site-footer a { color: #D5DEEA; text-decoration: none; }
.site-footer a:hover { color: var(--gold-soft); }
.site-footer .legal { border-top: 1px solid #22385F; padding-top: 16px; padding-bottom: 28px; font-size: 14px; }

/* floating AI search */
.ai-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 70; display: flex; align-items: center; gap: 14px; }
.ai-bubble { padding: 12px 16px; border-radius: 16px 16px 4px 16px; background: #fff; border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); font-size: 15px; line-height: 1.45; opacity: 0; transform: translateX(14px); pointer-events: none; transition: opacity .5s ease, transform .5s var(--ease); max-width: 240px; }
.ai-bubble.show { opacity: 1; transform: none; pointer-events: auto; }
.ai-bubble b { display: block; }
.ai-bubble span { color: var(--muted); font-size: 14px; }
.ai-fab { position: relative; flex: none; width: 68px; height: 68px; border: 0; border-radius: 50%; padding: 0; cursor: pointer; background: linear-gradient(135deg, var(--blue), var(--ink)); box-shadow: 0 16px 36px rgba(26,79,191,.45); display: flex; align-items: center; justify-content: center; animation: fabbob 3.2s ease-in-out infinite; transition: transform .3s var(--ease); }
.ai-fab:hover { transform: scale(1.06); }
.ai-fab .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--blue-2); animation: ring 2.4s ease-out infinite; }
.ai-fab .ring.g { border-color: var(--gold-soft); animation-delay: 1.2s; }
.ai-fab .halo { position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, var(--gold-soft), transparent, var(--blue-2), transparent); animation: spin 9s linear infinite; }
.ai-fab .core { position: absolute; inset: 3px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--ink)); }
.ai-fab svg { position: relative; transition: transform .35s var(--ease), opacity .2s ease; }
.ai-fab .x { position: absolute; opacity: 0; transform: rotate(-90deg); }
.ai-fab .tag { position: absolute; top: 0; right: 0; padding: 0 6px; border-radius: 999px; background: var(--gold-soft); color: var(--ink); font-size: 11px; font-weight: 700; line-height: 18px; }
.ai-fab[aria-expanded="true"] { animation: none; }
.ai-fab[aria-expanded="true"] .ring, .ai-fab[aria-expanded="true"] .tag { display: none; }
.ai-fab[aria-expanded="true"] .s { opacity: 0; transform: rotate(90deg); }
.ai-fab[aria-expanded="true"] .x { opacity: 1; transform: none; }
@keyframes ring { from { transform: scale(1); opacity: .55; } to { transform: scale(1.9); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fabbob { 50% { transform: translateY(-6px); } }
.ai-panel { position: fixed; right: 24px; bottom: 108px; z-index: 69; width: min(400px, calc(100vw - 32px)); max-height: min(600px, calc(100vh - 140px)); border-radius: 24px; background: #fff; box-shadow: 0 30px 70px rgba(11,31,63,.25); overflow: hidden; display: flex; flex-direction: column; transform-origin: bottom right; opacity: 0; transform: translateY(20px) scale(.96); pointer-events: none; visibility: hidden; transition: opacity .35s ease, transform .45s var(--ease), visibility 0s linear .45s; }
.ai-panel.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .35s ease, transform .45s var(--ease), visibility 0s; }
.ai-head { padding: 16px 18px; background: linear-gradient(135deg, var(--ink), var(--blue)); color: #fff; display: flex; align-items: center; gap: 12px; }
.ai-head span.t { flex: 1; line-height: 1.35; }
.ai-head small { display: block; font-size: 13px; color: #C3CEE2; }
.ai-close { width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ai-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--ground); }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 16px 16px 16px 4px; background: #fff; border: 1px solid var(--line); }
.msg.me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--blue); color: #fff; border: 0; }
.ai-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-sugg button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.ai-sugg button:hover { border-color: var(--blue); background: var(--tint); }
.ai-form { padding: 12px 14px; border-top: 1px solid var(--line); background: #fff; }
.ai-field { display: flex; gap: 8px; padding: 5px; border-radius: 14px; border: 1.5px solid var(--line-strong); transition: border-color .2s ease; }
.ai-field:focus-within { border-color: var(--blue); }
.ai-field input { flex: 1; min-width: 0; height: 42px; border: 0; padding: 0 10px; font: inherit; outline: none; color: var(--ink); }
.ai-field button { width: 42px; height: 42px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ai-note { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.typing { display: inline-flex; gap: 5px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); animation: dot 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

@media (max-width: 1100px) {
  .menu-btn { display: flex; }
  .site-header .bar { border-radius: 24px; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding: 6px 0 4px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
  .nav a.cta { margin: 6px 0 0; text-align: center; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .float-stack { display: none; }
}
@media (max-width: 800px) { .news { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .site-header { padding: 0 12px; top: 10px; }
  .brand img { height: 36px; }
  .brand b { font-size: 14px; }
  .hero-inner { padding: 110px 16px 120px; }
  .hero p.lead { font-size: 16px; }
  .searchbox select { flex: 1 1 100%; border-left: 0; border-top: 1px solid var(--line-strong); }
  .searchbox .btn { flex: 1 1 100%; }
  .sec { padding-top: 64px; }
  .nitem { padding: 14px; gap: 12px; }
  .newsletter { padding: 28px 22px; margin: 64px 0; }
  .ai-bubble { display: none; }
  .ai-wrap { right: 16px; bottom: 16px; }
  .ai-panel { right: 16px; bottom: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* น้องปกป้อง mascot */
.mascot { display: block; overflow: visible; }
.mascot .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
.mascot .wave { transform-box: view-box; transform-origin: 50px 32px; animation: wave 3.2s ease-in-out infinite; }
@keyframes blink { 0%, 90%, 100% { transform: scaleY(1); } 93% { transform: scaleY(.1); } }
@keyframes wave { 0%, 55%, 100% { transform: rotate(0); } 65% { transform: rotate(-22deg); } 75% { transform: rotate(10deg); } 85% { transform: rotate(-16deg); } }
.mascot-ic { background: #fff !important; overflow: visible; }
.mascot-ic .mascot { width: 36px; height: 36px; }
.ai-fab .core { background: radial-gradient(circle at 35% 30%, #FFFFFF, #EAF1FD 70%); }
.ai-fab { box-shadow: 0 16px 36px rgba(26,79,191,.38); }
.ai-fab .mascot.s { position: relative; transition: transform .35s var(--ease), opacity .2s ease; }
.ai-fab:hover .mascot.s { transform: scale(1.08) rotate(-4deg); }
.ai-fab[aria-expanded="true"] .mascot.s { opacity: 0; transform: scale(.6); }
.ai-fab { width: 78px; height: 78px; }
.ai-fab .tag { top: -2px; right: auto; left: -4px; }
.ai-panel { bottom: 118px; }
.hello { display: flex; gap: 12px; align-items: center; }
.hello span { display: flex; flex-direction: column; line-height: 1.4; }
.hello small { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .ai-fab { width: 68px; height: 68px; } .ai-fab .mascot.s { width: 50px; height: 50px; } .ai-panel { bottom: 100px; } }
.loaded .load { opacity: 1; transform: none; animation: none; }
@media (max-width: 640px) {
  .nitem { flex-wrap: wrap; align-items: flex-start; }
  .nitem .body { flex: 1 1 calc(100% - 80px); }
  .nitem > .chip { margin-left: 74px; }
}

/* news thumbnails */
.thumb { position: relative; display: block; overflow: hidden; flex: none; background: var(--tint); }
.thumb svg { display: block; width: 100%; height: 100%; transition: transform .7s var(--ease); }
.ncard:hover .thumb svg { transform: scale(1.06); }
.ncard.lead { padding: 0; overflow: hidden; justify-content: flex-start; }
.thumb.lg { aspect-ratio: 16 / 8; }
.thumb-tag { position: absolute; left: 16px; top: 16px; padding: 4px 12px; border-radius: 999px; background: rgba(11,31,63,.82); color: #fff; font-size: 13px; font-weight: 600; }
.ncard.lead .nbody { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 8px; }
.ncard.row { flex-direction: row; align-items: center; gap: 18px; padding: 14px; }
.thumb.sm { width: 104px; height: 104px; border-radius: 14px; }
.ncard.row .nbody { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
@media (max-width: 640px) { .thumb.sm { width: 80px; height: 80px; } .ncard.row { gap: 14px; } }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.ncard:hover .thumb img { transform: scale(1.06); }
.thumb.lg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,31,63,.25), transparent 40%); pointer-events: none; }

/* ===================== inner pages (search, login) ===================== */
.page-hero { position: relative; overflow: hidden; min-height: 380px; display: flex; align-items: flex-end; }
.page-hero .scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.page-hero .inner { position: relative; width: 100%; max-width: 1240px; margin: 0 auto; padding: 130px 24px 96px; }
.crumbs { font-size: 14px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.crumbs a { color: var(--blue); text-decoration: none; font-weight: 600; }
.page-hero h1 { margin-top: 8px; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.25; }
.page-hero p { margin-top: 8px; color: var(--text-2); font-size: 17px; max-width: 640px; }
.search-dock { position: relative; z-index: 2; max-width: 1200px; margin: -52px auto 0; padding: 0 24px; }
.search-dock .searchbox { max-width: none; }
.search-dock .searchbox select + select { border-left: 1px solid var(--line-strong); }
.results { padding: 40px 0 96px; }
.notice-bar { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: 12px; background: var(--out-bg); color: var(--out-ink); border: 1px solid #EBD39B; font-size: 14px; margin-bottom: 24px; }
.res-head { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.res-head h2 { font-size: clamp(24px, 2.4vw, 30px); }
.rlist { display: flex; flex-direction: column; gap: 12px; }
.rlist[hidden], .empty[hidden] { display: none; }
.ritem { display: flex; gap: 18px; align-items: center; padding: 18px 20px; border-radius: 18px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .35s var(--ease), box-shadow .35s ease, opacity .6s var(--ease); }
.ritem:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.ritem .mcode { flex: none; width: 56px; height: 56px; border-radius: 16px; font-size: 15px; }
.ritem .rbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ritem .rbody b { font-size: 17px; font-weight: 600; }
.ritem .rbody small { font-size: 14px; color: var(--muted); }
.ritem .rmeta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ritem .rmeta small { font-size: 13px; color: var(--muted); }
.js .ritem.pre { opacity: 0; transform: translateY(18px); }
.empty { padding: 40px 24px; border-radius: 22px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.empty .mascot { width: 84px; height: 84px; }
.empty .btn { margin-top: 6px; }
.mini-footer { background: var(--ink); color: #D5DEEA; font-size: 14px; padding: 24px 0; }
.mini-footer a { color: var(--gold-soft); text-decoration: none; }
@media (max-width: 640px) {
  .page-hero .inner { padding: 110px 16px 84px; }
  .search-dock { padding: 0 16px; }
  .search-dock .searchbox select + select { border-left: 0; }
  .ritem { flex-wrap: wrap; padding: 14px; gap: 12px; }
  .ritem .mcode { width: 46px; height: 46px; border-radius: 12px; font-size: 13px; }
  .ritem .rbody { flex: 1 1 calc(100% - 60px); }
  .ritem .rmeta { flex-direction: row; align-items: center; margin-left: 58px; }
}

/* login */
.login-page { min-height: 100vh; min-height: 100svh; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.login-page > .scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; }
.login-top { position: relative; display: flex; justify-content: space-between; align-items: center; max-width: 1240px; width: 100%; margin: 16px auto 0; padding: 10px 18px; border-radius: 999px; background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.85); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.login-top .back { font-weight: 600; text-decoration: none; padding: 8px 14px; border-radius: 999px; transition: background-color .2s ease; }
.login-top .back:hover { background: var(--tint); }
.login-main { flex: 1; display: flex; align-items: center; padding: 40px 24px 72px; }
.login-grid { width: 100%; max-width: 1140px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 40px 64px; align-items: center; justify-content: space-between; }
.login-pitch { flex: 1 1 380px; }
.login-pitch h1 { margin-top: 16px; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.25; }
.login-pitch ul { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 17px; color: var(--text-2); }
.login-pitch li { display: flex; gap: 12px; align-items: center; }
.login-pitch li span.ck { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--blue); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(11,31,63,.08); }
.login-card { flex: 0 1 430px; width: 100%; padding: 32px; border-radius: 26px; background: rgba(255,255,255,.88); border: 1px solid #fff; box-shadow: var(--shadow-lg); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); display: flex; flex-direction: column; gap: 16px; }
.login-card .hello { margin-bottom: 4px; }
.login-card h2 { font-size: 26px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.field input { width: 100%; height: 50px; border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 0 14px; font: inherit; color: var(--ink); background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(26,79,191,.12); }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 54px; }
.pass-toggle { position: absolute; right: 3px; top: 3px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pass-toggle[aria-pressed="true"] { color: var(--blue); }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.login-card .btn { width: 100%; min-height: 52px; font-size: 17px; }
.login-note { font-size: 14px; color: var(--muted); text-align: center; }
@media (max-width: 640px) {
  .login-top { margin: 10px 12px 0; width: auto; }
  .login-main { padding: 24px 16px 48px; align-items: flex-start; }
  .login-pitch ul { display: none; }
  .login-card { padding: 24px 20px; }
}
.page-hero .scene { z-index: 0; }
.page-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(246,248,253,.9), rgba(246,248,253,.55) 45%, rgba(246,248,253,0) 75%); pointer-events: none; }
.page-hero .inner { z-index: 2; }
.login-page::after { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(246,248,253,.88), rgba(246,248,253,.45) 50%, rgba(246,248,253,0) 80%); pointer-events: none; }
.login-pitch h1 { font-size: clamp(28px, 3vw, 42px); }
.login-pitch h1 .grad { display: inline-block; }
@media (max-width: 640px) { .page-hero::after, .login-page::after { background: rgba(246,248,253,.6); } }

@media (max-width: 640px) { .login-top .brand b { display: none; } .login-top { border-radius: 18px; } }
