/* =========================================================
   System Evolution — ศูนย์รวมข้อมูลโปรแกรม
   โทนสีและฟอนต์อ้างอิงจาก sysevo.co.th/homepage_v2
   ========================================================= */

:root {
  --primary: #0249c0;
  --primary-600: #013a9a;
  --primary-50: #eaf1fd;
  --primary-100: #d4e2fa;
  --sky: #9cc3ff;
  --ink: #172033;
  --ink-800: #10224a;
  --ink-900: #0a1730;
  --body: #3d4757;
  --muted: #6a7486;
  --line: #e2e8f1;
  --soft: #f4f7fc;
  --white: #fff;
  --danger: #c2410c;
  --danger-50: #fff1ea;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(2, 40, 110, .14);

  --font-head: "Prompt", "IBM Plex Sans Thai", sans-serif;
  --font-body: "IBM Plex Sans Thai", "Prompt", sans-serif;

  --container: 1200px;
  --header-h: 76px;
  --subnav-h: 54px;
}

/* ---------- พื้นฐาน ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.no-scroll { overflow: hidden; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.35; margin: 0; font-weight: 600; }
p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.ic { width: 1.15em; height: 1.15em; stroke-width: 2; flex: none; }
#main { min-height: 60vh; }

/* ---------- แถบบน + ส่วนหัว ---------- */
.topbar { background: var(--primary); color: #fff; font-size: 13px; }
.topbar-in { display: flex; gap: 24px; height: 36px; align-items: center; }
.topbar a { display: inline-flex; align-items: center; gap: 6px; opacity: .92; }
.topbar a:hover { opacity: 1; }

.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: var(--font-head); color: var(--ink); font-size: 17px; font-weight: 600; }
.brand-text small { color: var(--muted); font-size: 12.5px; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-head); font-size: 15px; font-weight: 500; color: var(--ink);
  padding: 10px 14px; border-radius: 999px; border: 0; background: none; cursor: pointer;
}
.nav-link:hover { color: var(--primary); background: var(--primary-50); }
.nav-link.is-active, .nav-drop.is-active > .nav-link { color: var(--primary); }
.nav-link .chev { width: 16px; height: 16px; transition: transform .2s; }

.nav-drop { position: relative; }
.mega {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: min(860px, 92vw);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s ease;
}
.nav-drop:hover .mega, .nav-drop:focus-within .mega, .nav-drop.open .mega { opacity: 1; visibility: visible; transform: none; }
.nav-drop:hover .chev, .nav-drop.open .chev { transform: rotate(180deg); }
.mega::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.mega-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 6px 10px 8px;
}
.mega-col a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm); font-size: 14.5px; color: var(--ink); line-height: 1.4;
}
.mega-col a .ic { color: var(--primary); }
.mega-col a:hover { background: var(--primary-50); color: var(--primary); }

.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle .ic { width: 22px; height: 22px; }

/* ---------- ปุ่ม/ป้าย/ชิป ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
}
.pill .ic { color: var(--sky); }
.chip-glass {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 13px; border-radius: 999px; font-size: 13.5px;
  color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
}
.chip-code {
  display: inline-flex; align-items: center;
  font-family: var(--font-head); font-size: 12px; font-weight: 600; letter-spacing: .04em;
  padding: 2px 9px; border-radius: 6px; background: var(--ink); color: #fff;
}
.chip-code-light { background: #fff; color: var(--primary); }
.ic-box {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--primary-50); color: var(--primary);
}
.ic-box-lg { width: 48px; height: 48px; border-radius: 13px; }
.ic-box-lg .ic { width: 22px; height: 22px; }

/* ---------- ส่วนหัวหน้า (พื้นน้ำเงินเข้ม) ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(2, 73, 192, .75), transparent 62%),
    radial-gradient(700px 480px at -8% 112%, rgba(2, 73, 192, .45), transparent 60%),
    linear-gradient(155deg, var(--ink-900) 0%, var(--ink-800) 55%, #0b3a8f 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 78%);
}
.hero > .container { position: relative; }
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding: 84px 24px 64px; }
.hero-in-single { grid-template-columns: 1fr; max-width: 900px; }
.hero h1 { color: #fff; font-size: clamp(32px, 4.4vw, 50px); line-height: 1.25; margin-top: 22px; }
.hero h1 .hl { display: block; color: var(--sky); }
.hero-text > p { color: rgba(255, 255, 255, .78); font-size: 17.5px; margin-top: 20px; max-width: 620px; }

.hero-entry { display: grid; gap: 16px; }
.entry {
  display: flex; align-items: center; gap: 18px; padding: 22px 24px;
  border-radius: 18px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
  transition: .2s ease;
}
.entry:hover { background: rgba(255, 255, 255, .13); transform: translateY(-2px); border-color: rgba(255, 255, 255, .3); }
.entry-ic { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 14px; background: var(--primary); flex: none; box-shadow: 0 8px 22px rgba(2, 73, 192, .45); }
.entry-ic .ic { width: 26px; height: 26px; }
.entry-text { display: flex; flex-direction: column; flex: 1; line-height: 1.45; }
.entry-text strong { font-family: var(--font-head); font-size: 20px; font-weight: 600; }
.entry-text span { color: rgba(255, 255, 255, .7); font-size: 14.5px; }
.entry-arrow { width: 22px; height: 22px; color: var(--sky); transition: transform .2s; }
.entry:hover .entry-arrow { transform: translateX(4px); }

.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255, 255, 255, .12); }
.stat { padding: 28px 24px 34px; }
.stat + .stat { border-left: 1px solid rgba(255, 255, 255, .12); }
.stat-val { font-family: var(--font-head); font-size: clamp(26px, 3vw, 36px); font-weight: 600; color: #fff; line-height: 1.2; }
.stat-val span { font-size: .5em; font-weight: 500; margin-left: 6px; color: rgba(255, 255, 255, .85); }
.stat-label { color: rgba(255, 255, 255, .65); font-size: 14.5px; margin-top: 4px; }

/* ---------- ส่วนเนื้อหา ---------- */
.section { padding: 88px 0; scroll-margin-top: var(--subnav-h); }
.section-alt { background: var(--soft); }
.sec-head { max-width: 780px; margin-bottom: 44px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head.center .eyebrow-row { justify-content: center; }
.eyebrow-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.eyebrow {
  display: inline-flex; align-items: center;
  font-family: var(--font-head); font-size: 13.5px; font-weight: 600;
  color: var(--primary); background: var(--primary-50); padding: 5px 14px; border-radius: 999px;
}
.sec-head h2 { font-size: clamp(26px, 3.2vw, 38px); margin-top: 14px; }
.sec-head h2:first-child { margin-top: 0; }
.lead { color: var(--muted); font-size: 17px; margin-top: 12px; }
.sub-head { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 72px 0 32px; }
.sub-head h3 { font-size: 24px; }

/* ---------- โหมดร่าง ---------- */
.draft-badge {
  display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600;
  color: #8a5300; background: #fff6dc; border: 1px dashed #e0a800; padding: 3px 11px; border-radius: 999px;
}
.ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px;
  padding: 36px 24px; border: 2px dashed #c3d0e6; border-radius: var(--radius);
  background: repeating-linear-gradient(-45deg, #f8fafe, #f8fafe 12px, #f3f6fc 12px, #f3f6fc 24px);
  color: var(--muted);
}
.ph > .ic { width: 30px; height: 30px; color: var(--primary); opacity: .55; margin-bottom: 4px; }
.ph strong { font-family: var(--font-head); font-weight: 600; color: var(--ink); font-size: 15.5px; }
.ph span { font-size: 13.5px; }
.ph + .ph { margin-top: 20px; }
.ph-dark { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .04); color: rgba(255, 255, 255, .7); }
.ph-dark > .ic { color: var(--sky); opacity: .9; }
.ph-dark strong { color: #fff; }
.ph-inline { flex-direction: row; flex-wrap: wrap; gap: 4px 10px; padding: 14px 18px; justify-content: flex-start; text-align: left; }
.ph-inline > .ic { width: 20px; height: 20px; margin: 0; }
.ph-inline strong { font-size: 14px; }
.ph-inline span { font-size: 13px; }
.hero-text .ph-inline { margin-top: 26px; }
.p-stats-ph { padding: 0 0 36px; }
.draft-ribbon {
  position: fixed; left: 16px; bottom: 16px; z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: #6b4300;
  background: #ffe9a8; border: 1px solid #f0c64a; border-radius: 999px; padding: 7px 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}
.note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; font-size: 14px; color: #8a5300; }

/* ---------- การ์ดโปรแกรม (หน้าแรก) ---------- */
.cat-block + .cat-block { margin-top: 64px; }
.cat-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.cat-head h3 { font-size: 22px; }
.cat-head small { color: var(--muted); font-size: 13.5px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.p-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.p-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-100); }
.p-card-img { aspect-ratio: 16 / 10; background: var(--soft); overflow: hidden; }
.p-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.p-card:hover .p-card-img img { transform: scale(1.04); }
.p-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.p-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.p-card h3 { font-size: 19px; }
.p-card .en { font-family: var(--font-head); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.p-card p { color: var(--muted); font-size: 14.5px; margin: 10px 0 18px; flex: 1; }
.more { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-size: 14.5px; font-weight: 600; color: var(--primary); }
.more .ic { transition: transform .2s; }
.p-card:hover .more .ic { transform: translateX(4px); }

/* ---------- หน้าโปรแกรม: ภาพรวม ---------- */
.p-hero .hero-in { padding-top: 40px; padding-bottom: 56px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: rgba(255, 255, 255, .6); }
.crumbs a:hover { color: #fff; }
.crumbs .ic { width: 14px; height: 14px; }
.crumbs span { color: rgba(255, 255, 255, .9); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.p-hero h1 { margin-top: 16px; }
.en-wrap, .hero .en { font-family: var(--font-head); font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--sky); margin-top: 8px; }
.p-sum { color: rgba(255, 255, 255, .8); font-size: 17.5px; margin-top: 18px; max-width: 560px; }
.audience { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 26px; }
.audience > span:first-child { font-size: 14px; color: rgba(255, 255, 255, .6); margin-right: 4px; }

.frame { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.frame-bar { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 14px; background: #eef2f8; border-bottom: 1px solid var(--line); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.frame-url { flex: 1; max-width: 280px; height: 22px; display: flex; align-items: center; padding: 0 10px; border-radius: 6px; background: #fff; font-size: 11.5px; color: var(--muted); }
.frame-hero { border: 1px solid rgba(255, 255, 255, .15); box-shadow: 0 30px 70px rgba(0, 0, 0, .45); }
.frame-hero > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.frame-hero .ph { aspect-ratio: 16 / 9; border-radius: 0; border: 0; background: linear-gradient(160deg, #13284f, #0d1d3c); }

/* เมนูลัด */
.subnav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); box-shadow: 0 4px 14px rgba(16, 24, 40, .04);
}
.subnav-in { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.subnav-in::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none; height: var(--subnav-h); display: inline-flex; align-items: center; padding: 0 16px;
  font-family: var(--font-head); font-size: 14.5px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.subnav a:hover { color: var(--ink); }
.subnav a.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- 2. ปัญหา → ทางออก ---------- */
.ps-head, .ps-row { display: grid; grid-template-columns: 1fr 56px 1fr; }
.ps-head { margin-bottom: 14px; font-family: var(--font-head); font-size: 15px; font-weight: 600; }
.ps-head span { display: inline-flex; align-items: center; gap: 8px; }
.ps-head span:first-child { color: var(--danger); }
.ps-head span:last-child { color: var(--primary); }
.ps-row + .ps-row { margin-top: 14px; }
.ps-card { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--line); }
.ps-card p { color: var(--ink); font-size: 16px; }
.ps-ic { width: 24px; height: 24px; margin-top: 2px; }
.ps-problem { background: #fff; }
.ps-problem .ps-ic { color: var(--danger); }
.ps-solution { background: var(--primary-50); border-color: var(--primary-100); }
.ps-solution .ps-ic { color: var(--primary); }
.ps-label { display: none; font-family: var(--font-head); font-size: 12.5px; font-weight: 600; }
.ps-problem .ps-label { color: var(--danger); }
.ps-solution .ps-label { color: var(--primary); }
.ps-arrow { display: flex; align-items: center; justify-content: center; color: var(--primary); }
.ps-arrow .ic { width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }

/* ---------- 3. ฟีเจอร์หลัก ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.f-card { display: flex; flex-direction: column; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: .2s ease; }
.f-card:hover { border-color: var(--primary-100); box-shadow: var(--shadow-lg); }
.f-top { display: flex; align-items: flex-start; justify-content: space-between; }
.f-no { font-family: var(--font-head); font-size: 30px; font-weight: 600; line-height: 1; color: var(--primary-100); }
.f-card h3 { font-size: 18px; margin-top: 18px; }
.f-card p { font-size: 14.5px; color: var(--muted); margin-top: 6px; }

/* ---------- 4. Flow: ฝังไฟล์ Flow ต้นฉบับ ---------- */
.flow-viewer { max-width: 1340px; margin: 0 auto; text-align: center; }
.flow-tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 5px; margin-bottom: 20px; background: #fff; border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); }
.flow-tab { padding: 9px 20px; border: 0; border-radius: 999px; background: none; cursor: pointer; font-family: var(--font-head); font-size: 14.5px; font-weight: 500; color: var(--muted); }
.flow-tab:hover { color: var(--ink); }
.flow-tab.is-active { background: var(--primary); color: #fff; }
.flow-frame { position: relative; height: 600px; overflow: hidden; text-align: left; background: #f0f4f8; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.flow-frame iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; }
/* เปิดจากไฟล์ในเครื่อง (file://) วัดขนาดไม่ได้: แสดงเต็มกรอบแล้วเลื่อนดู */
.flow-frame.is-fallback { height: 80vh; }
.flow-frame.is-fallback iframe { width: 100%; height: 100%; transform: none; }
.flow-actions { display: flex; justify-content: center; margin-top: 18px; }

/* ---------- 5/6. ตัวแสดงภาพ ---------- */
.viewer { max-width: 1040px; margin: 0 auto; outline: none; }
.viewer-stage { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #f1f4f9; cursor: zoom-in; }
.viewer-stage img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.zoom-hint {
  position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: #fff; background: rgba(10, 23, 48, .72); padding: 6px 12px; border-radius: 999px;
  opacity: 0; transition: opacity .2s;
}
.viewer-stage:hover .zoom-hint, .viewer-stage:focus-visible .zoom-hint { opacity: 1; }
.viewer-cap { text-align: center; margin-top: 22px; min-height: 58px; }
.cap-title { display: inline-flex; align-items: center; gap: 10px; }
.cap-title strong { font-family: var(--font-head); font-size: 19px; font-weight: 600; color: var(--ink); }
.cap-count { font-size: 13px; color: var(--muted); }
.viewer-cap p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.thumbs { display: flex; justify-content: center; gap: 12px; margin-top: 20px; padding: 4px; overflow-x: auto; scrollbar-width: thin; }
.thumb { flex: none; width: 156px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; opacity: .6; transition: .2s; box-shadow: var(--shadow); }
.thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.thumb:hover { opacity: 1; }
.thumb.is-active { opacity: 1; border-color: var(--primary); }

.viewer-slides .viewer-stage { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: #fff; }
.slide-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }
.ctrl {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); box-shadow: var(--shadow);
}
.ctrl:hover { border-color: var(--primary); color: var(--primary); }
.ctrl-wide { padding: 0 18px; font-family: var(--font-head); font-size: 14px; font-weight: 500; margin-left: 10px; }
.counter { font-family: var(--font-head); font-size: 15px; font-weight: 500; color: var(--ink); min-width: 64px; text-align: center; }
.slide-updated { margin-top: 12px; font-size: 13.5px; color: var(--muted); text-align: center; }

/* ---------- 7. บริการ ---------- */
.svc-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.svc-card { flex: 0 1 calc((100% - 54px) / 4); display: flex; gap: 14px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-align: left; }
.svc-card h3 { font-size: 16.5px; }
.svc-card p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.svc-detail { max-width: 1000px; margin: 28px auto 0; padding: 28px 32px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-align: left; }
.svc-detail h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 16px; }
.svc-detail h3 .ic { color: var(--primary); }
.svc-detail .check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 32px; font-size: 15px; }
.sub-lead { text-align: center; margin: -22px 0 32px; }
.steps { position: relative; display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); gap: 16px; }
.steps::before { content: ""; position: absolute; top: 25px; left: calc(100% / (2 * var(--n, 6))); right: calc(100% / (2 * var(--n, 6))); height: 2px; background: linear-gradient(90deg, var(--primary-100), var(--primary), var(--primary-100)); }
.steps li { position: relative; text-align: center; }
.step-num {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%; background: #fff; border: 2px solid var(--primary);
  color: var(--primary); font-family: var(--font-head); font-size: 18px; font-weight: 600; box-shadow: 0 0 0 6px var(--soft);
}
.steps h4 { font-size: 16px; margin-top: 14px; }
.steps p { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* ---------- 8. คลิป ---------- */
.video-wrap { max-width: 960px; margin: 0 auto; }
.video-wrap.has-list { max-width: none; display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.video-main video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.video-title { margin-top: 14px; font-family: var(--font-head); font-weight: 500; color: var(--ink); }
.video-list { display: grid; gap: 8px; }
.video-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.video-item .ic { color: var(--primary); }
.video-item small { color: var(--muted); }
.video-item.is-active { border-color: var(--primary); background: var(--primary-50); }

/* ---------- หน้าบริษัท (แสดงเฉพาะสไลด์) ---------- */
.company-slides { padding: 48px 0 72px; }
/* ให้สไลด์ + ปุ่มควบคุมอยู่ในหน้าจอเดียว (สไลด์ 16:9) */
.company-slides .viewer { max-width: min(1160px, max(320px, calc((100vh - 290px) * 16 / 9))); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.check-list li { display: flex; gap: 10px; }
.check-list .ic { color: var(--primary); margin-top: 5px; }

/* ---------- ส่วนท้าย ---------- */
.footer { background: var(--ink-900); color: rgba(255, 255, 255, .7); padding: 64px 0 28px; font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 48px; }
.footer .brand-text strong { color: #fff; font-size: 16px; }
.footer .brand-text small { color: rgba(255, 255, 255, .55); }
.footer .brand img { background: #fff; border-radius: 12px; padding: 4px; }
.footer-brand p { margin-top: 18px; max-width: 360px; }
.footer-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--sky); font-weight: 500; }
.footer h4 { color: #fff; font-size: 16px; margin-bottom: 14px; }
.footer-links { display: grid; gap: 6px; }
.footer-links a:hover, .footer-contact a:hover { color: #fff; }
.footer-contact { display: grid; gap: 12px; }
.footer-contact li { display: flex; gap: 10px; }
.footer-contact .ic { margin-top: 5px; color: var(--sky); }
.footer-qr { display: block; width: 120px; height: 120px; margin-top: 10px; padding: 6px; border-radius: 10px; background: #fff; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; color: rgba(255, 255, 255, .5); }

/* ---------- ดูภาพเต็มจอ ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 56px 72px;
  background: rgba(6, 12, 26, .94);
}
.lightbox.open { display: flex; }
.lb-fig { display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; }
.lb-fig img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 8px; background: #fff; }
.lb-fig figcaption { display: flex; gap: 14px; align-items: center; margin-top: 14px; color: rgba(255, 255, 255, .75); font-size: 14.5px; }
.lb-fig figcaption strong { color: #fff; font-family: var(--font-head); font-weight: 500; }
.lb-btn { position: absolute; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; }
.lb-btn:hover { background: rgba(255, 255, 255, .18); }
.lb-btn .ic { width: 24px; height: 24px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }

/* ---------- แอนิเมชันตอนเลื่อนถึง ---------- */
.anim .reveal { opacity: 0; transform: translateY(14px); }
.anim .reveal.in { opacity: 1; transform: none; transition: opacity .55s ease, transform .55s ease; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* =========================================================
   หน้าจอขนาดต่างๆ
   ========================================================= */
@media (max-width: 1080px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .svc-card { flex-basis: calc((100% - 18px) / 2); }
  .steps { grid-template-columns: repeat(3, 1fr); row-gap: 32px; }
  .steps::before { display: none; }
}

@media (max-width: 900px) {
  :root { --header-h: 66px; }
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 10px 16px 18px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    display: none;
  }
  .header.nav-open .nav { display: flex; }
  .nav-link { border-radius: 10px; padding: 12px 10px; justify-content: space-between; }
  .mega { position: static; width: auto; grid-template-columns: 1fr; padding: 0 0 6px 8px; box-shadow: none; border: 0; opacity: 1; visibility: visible; transform: none; display: none; }
  .nav-drop.open .mega { display: grid; }
  .nav-drop:hover .chev { transform: none; }
  .nav-drop.open .chev { transform: rotate(180deg); }

  .hero-in { grid-template-columns: 1fr; gap: 36px; padding-top: 56px; }
  .p-hero .hero-in { padding-top: 28px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid rgba(255, 255, 255, .12); }

  .ps-head { display: none; }
  .ps-row { grid-template-columns: 1fr; }
  .ps-row + .ps-row { margin-top: 26px; }
  .ps-label { display: block; }
  .ps-arrow { height: 40px; }
  .ps-arrow .ic { transform: rotate(90deg); }

  .video-wrap.has-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .container { padding: 0 16px; }
  .hero-in { padding-left: 16px; padding-right: 16px; }
  .topbar-in { gap: 16px; font-size: 12.5px; }
  .brand-text small { display: none; }
  .section { padding: 64px 0; }
  .sec-head { margin-bottom: 32px; }
  .card-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .svc-card { flex-basis: 100%; }
  .svc-detail { padding: 22px 20px; }
  .svc-detail .check-list { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; text-align: left; row-gap: 18px; }
  .steps li { display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; text-align: left; }
  .steps .step-num { grid-row: span 2; }
  .steps h4 { margin-top: 2px; }
  .stat { padding: 22px 16px 26px; }
  .thumb { width: 116px; }
  .thumbs { justify-content: flex-start; }
  .lightbox { padding: 64px 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
  .draft-ribbon { left: 8px; bottom: 8px; font-size: 12px; }
}
