/* ============================================================
   โยธาไทย เทรนนิ่ง — Stylesheet (ปรับโฉม 18 พ.ย. 2569)
   ธีม: ส้มโยธาไทย + น้ำเงินเข้ม | รองรับ light/dark, มือถือก่อน
   ⚠️ หน้า register/check/admin/account ใช้ไฟล์นี้ร่วม — ห้ามลบ/เปลี่ยนความหมาย class เดิม (เพิ่มได้)
   ============================================================ */
:root {
  --orange: #e8630a;          /* สีแบรนด์ — ใช้กับพื้น/เส้น/ไอคอน */
  --orange-dark: #c8540a;
  --orange-cta: #c75000;      /* พื้นปุ่มหลัก ตัวอักษรขาว ผ่าน WCAG AA (≈4.6:1) */
  --orange-cta-hover: #a94400;
  --orange-ink: #b34a05;      /* ตัวอักษรสีส้มบนพื้นสว่าง (≈5:1) */
  --orange-soft: #fff1e6;
  --navy: #1b2a41;
  --navy-2: #24405e;
  --bg: #f5f3ef;
  --card: #ffffff;
  --surface-2: #faf8f5;
  --line: #e4e0d8;
  --text: #262626;
  --heading: #1b2a41;
  --link: #1f4f86;
  --muted: #69695f;
  --ok: #1e8449;
  --warn: #9a6200;
  --danger: #c0392b;
  --radius: 14px;
  --radius-sm: 10px;
  --ring: 0 0 0 3px rgba(232,99,10,.35);
  --shadow: 0 1px 2px rgba(27,42,65,.06), 0 4px 14px rgba(27,42,65,.06);
  --shadow-lg: 0 10px 34px rgba(27,42,65,.14);
  --header-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151a; --card: #1c2129; --surface-2: #181c23; --line: #2e3540;
    --text: #e6e6e3; --muted: #a2a8b0; --heading: #eef1f5; --link: #9ec1ee; --navy: #0f1621; --navy-2: #1b2a3d;
    --orange-ink: #ff9a52; --orange-soft: #2c1d12;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
    --shadow-lg: 0 10px 34px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151a; --card: #1c2129; --surface-2: #181c23; --line: #2e3540;
  --text: #e6e6e3; --muted: #a2a8b0; --heading: #eef1f5; --link: #9ec1ee; --navy: #0f1621; --navy-2: #1b2a3d;
  --orange-ink: #ff9a52; --orange-soft: #2c1d12;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 34px rgba(0,0,0,.5);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f3ef; --card: #ffffff; --surface-2: #faf8f5; --line: #e4e0d8;
  --text: #262626; --muted: #69695f; --heading: #1b2a41; --link: #1f4f86;
  --navy: #1b2a41; --navy-2: #24405e; --orange-ink: #b34a05; --orange-soft: #fff1e6;
  --shadow: 0 1px 2px rgba(27,42,65,.06), 0 4px 14px rgba(27,42,65,.06);
  --shadow-lg: 0 10px 34px rgba(27,42,65,.14);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; } }
body {
  margin: 0;
  font-family: 'Sarabun', system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.7;
  color: var(--text); background: var(--bg);
  display: flex; flex-direction: column; min-height: 100vh;
  overflow-wrap: break-word;
}
h1,h2,h3,h4,.brand-text strong { font-family: 'Prompt','Sarabun',sans-serif; font-weight: 600; line-height: 1.4; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--orange-ink); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
main { flex: 1; }
img { max-width: 100%; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; width: 100%; }
main.container { padding-top: 24px; padding-bottom: 56px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--card); color: var(--heading); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); }
.skip-link:focus { top: 10px; }

/* ---------- topbar ---------- */
#app-header { position: sticky; top: 0; z-index: 50; } /* ค้างหัวเว็บ (topbar อยู่ใน div นี้) */
.topbar {
  background: var(--navy);
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%);
  border-bottom: 3px solid var(--orange);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner { display: flex; align-items: center; gap: 8px 16px; padding: 8px 16px; flex-wrap: wrap; max-width: 1120px; margin: 0 auto; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; min-height: 44px; }
.brand:hover { color: #fff; }
.brand-logo { font-size: 30px; }
.brand-chip {
  background: #fff; border-radius: 9px; padding: 5px 7px; height: 42px;
  display: inline-flex; align-items: center; flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.brand-chip img { height: 100%; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 18px; color: #fff; }
.brand-text small { color: #cfd8e3; font-size: 11.5px; }
.nav { display: flex; align-items: center; gap: 4px 6px; margin-left: auto; flex-wrap: wrap; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.navlink { color: #e3eaf2; font-size: 14.5px; font-family: 'Prompt',sans-serif; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 8px; white-space: nowrap; }
.navlink:hover { color: #fff; background: rgba(255,255,255,.10); }
.navlink.is-active { color: #fff; box-shadow: inset 0 -3px 0 var(--orange); border-radius: 8px 8px 0 0; }
.userchip { display: inline-flex; align-items: center; gap: 8px; color: #fff; }
.icon-btn { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; font-size: 17px; flex-shrink: 0; }
.icon-btn:hover { background: rgba(255,255,255,.22); }
#user-nav .linkbtn { min-height: 44px; }
@media (max-width: 760px) {
  :root { --header-h: 108px; }
  .topbar-inner { padding: 6px 12px 0; gap: 0 8px; }
  .brand-text strong { font-size: 16px; }
  .brand-chip { height: 38px; }
  .nav { display: contents; }
  .nav .icon-btn { margin-left: auto; }
  .nav-links { order: 10; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; margin: 2px -12px 0; padding: 0 6px; gap: 0; -webkit-overflow-scrolling: touch; }
  .nav-links::-webkit-scrollbar { display: none; }
  #user-nav { gap: 8px !important; }
  #user-nav .userchip span { max-width: 90px !important; }
}
@media (max-width: 400px) { #user-nav .userchip span { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card); color: var(--heading); font-family: 'Prompt',sans-serif; font-size: 15px; font-weight: 500; line-height: 1.35;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s; text-align: center;
  text-decoration: none;
}
.btn:hover { border-color: var(--orange); color: var(--orange-ink); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: var(--ring); }
.btn-primary { background: var(--orange-cta); border-color: var(--orange-cta); color: #fff !important; box-shadow: 0 2px 8px rgba(199,80,0,.25); }
.btn-primary:hover { background: var(--orange-cta-hover); border-color: var(--orange-cta-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; }
.btn-light { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); color: #fff; }
.btn-light:hover { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.5); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff !important; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 50px; padding: 12px 24px; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 6px 13px; font-size: 13.5px; }
.linkbtn { border: 0; background: none; color: var(--link); cursor: pointer; font: inherit; font-size: 14px; padding: 0; }
.linkbtn:hover { color: var(--orange-ink); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; padding: 56px 16px; text-align: center; position: relative; overflow: hidden;
}
.hero h1 { font-size: 34px; margin: 0 0 12px; color: #fff; }
.hero p { font-size: 17px; color: #cfd8e3; max-width: 640px; margin: 0 auto 24px; }
.hero .accent { color: #ff9a52; }

/* หน้าแรกแบบใหม่: ข้อความซ้าย + รุ่นถัดไปขวา */
.hero-v2 { text-align: left; padding: 44px 0 48px; }
.hero-v2::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 300px at 90% -10%, rgba(232,99,10,.28), transparent 70%),
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 32px 32px;
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: 'Prompt',sans-serif; font-size: 13.5px; color: #ffd2b0; background: rgba(232,99,10,.18); border: 1px solid rgba(232,99,10,.4); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.hero-v2 h1 { font-size: 40px; line-height: 1.25; margin: 0 0 12px; }
.hero-v2 p { margin: 0 0 22px; max-width: 520px; font-size: 17.5px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 20px 0 0; padding: 0; list-style: none; color: #cfd8e3; font-size: 14.5px; }
.hero-points li::before { content: "✓ "; color: #ff9a52; font-weight: 700; }
.hero-next { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 16px; backdrop-filter: blur(4px); }
.hero-next h2 { font-size: 15px; color: #ffd2b0; margin: 2px 4px 10px; font-weight: 500; }
.hero-next .muted { color: #cfd8e3; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-v2 { padding: 30px 0 32px; }
  .hero-v2 h1 { font-size: 30px; }
  .hero-v2 p { font-size: 16px; }
  .hero-actions .btn { flex: 1 1 100%; }
}

/* รายการรุ่นถัดไป (ใน hero) */
.next-list { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.next-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.07); color: #fff; min-height: 64px; transition: background-color .15s; }
.next-item:hover { background: rgba(255,255,255,.14); color: #fff; }
.next-item b { display: block; font-family: 'Prompt',sans-serif; font-weight: 500; font-size: 15px; line-height: 1.4; }
.next-item small { color: #cfd8e3; font-size: 13px; }
.next-go { font-family: 'Prompt',sans-serif; font-size: 13.5px; color: #ffd2b0; white-space: nowrap; }
@media (max-width: 520px) { .next-item { grid-template-columns: auto minmax(0,1fr); } .next-go { display: none; } }

/* ชิปวันที่ */
.date-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; padding: 6px 8px; border-radius: 12px; background: var(--card); color: var(--heading); line-height: 1.15; text-align: center; box-shadow: var(--shadow); font-family: 'Prompt',sans-serif; }
.date-chip .d { font-size: 18px; font-weight: 700; color: var(--orange-ink); white-space: nowrap; }
.date-chip .m { font-size: 12px; color: var(--muted); white-space: nowrap; }
.next-item .date-chip { background: #fff; color: var(--navy); }
.next-item .date-chip .d { color: #b34a05; }
.next-item .date-chip .m { color: #555; }

/* ---------- sections ---------- */
.home-section { margin-top: 44px; }
.home-section:first-child { margin-top: 8px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; margin: 0 0 18px; }
.section-head .section-title { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.section-kicker { display: block; font-family: 'Prompt',sans-serif; font-size: 13px; color: var(--orange-ink); letter-spacing: .02em; margin-bottom: 2px; }

/* ---------- cards / grid ---------- */
.section-title { font-size: 24px; color: var(--heading); margin: 8px 0 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-cover { height: 150px; background: linear-gradient(135deg,var(--navy-2),var(--orange)); display: flex; align-items: center; justify-content: center; font-size: 46px; color: #fff; }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { margin: 0; font-size: 18px; color: var(--heading); }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13.5px; color: var(--muted); }
.card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-family: 'Prompt',sans-serif; font-size: 20px; color: var(--orange-ink); font-weight: 600; }
.price small { font-size: 12px; color: var(--muted); font-weight: 400; }

/* การ์ดรุ่นอบรม (หน้าแรก) */
.batch-card { position: relative; }
.batch-card-media { position: relative; display: block; aspect-ratio: 870 / 450; background: linear-gradient(135deg,var(--navy),var(--navy-2)); overflow: hidden; }
.batch-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.batch-card-media .date-chip { position: absolute; left: 12px; top: 12px; }
.batch-card-cover { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; padding: 18px 18px 16px; color: #fff; }
.batch-card-cover .emoji { font-size: 40px; line-height: 1; }
.batch-card-cover b { font-family: 'Prompt',sans-serif; font-size: 20px; font-weight: 600; line-height: 1.35; }
.batch-card-cover small { color: #ffd2b0; font-size: 14px; }
.batch-card h3 { font-size: 17.5px; line-height: 1.5; }
.batch-card h3 a { color: inherit; }
.batch-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* ทั้งการ์ดกดได้ */
.batch-card .card-foot .btn, .batch-card .card-foot a { position: relative; z-index: 2; }
.facts { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14.5px; color: var(--text); }
.facts li { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 6px; align-items: start; }
.facts li > span:first-child { text-align: center; }
.batch-card .card-foot { flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--line); }
.batch-card .card-foot .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-family: 'Prompt',sans-serif; padding: 2px 10px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-ink); border: 1px solid color-mix(in srgb, var(--orange) 30%, transparent); }
.tag-navy { background: color-mix(in srgb, var(--navy-2) 12%, var(--card)); color: var(--heading); border-color: color-mix(in srgb, var(--navy-2) 25%, transparent); }

/* ---------- badges / pills ---------- */
.badge { font-size: 11.5px; padding: 3px 10px; border-radius: 20px; color: #fff; font-family: 'Prompt',sans-serif; display: inline-block; }
.badge-onsite { background: var(--orange-cta); }
.badge-online { background: var(--navy-2); }
.badge-admin { background: var(--orange-cta); }
.status { font-size: 12px; padding: 3px 11px; border-radius: 20px; font-family: 'Prompt',sans-serif; display: inline-block; }
.status-pending { background: #fef3e2; color: var(--warn); }
.status-confirmed { background: #e7f2ff; color: #1c6fc9; }
.status-paid { background: #e9f7ef; color: var(--ok); }
.status-completed { background: #eee; color: #555; }
.status-cancelled { background: #fdecea; color: var(--danger); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .status-pending{background:#3a2e18;color:#f0b75a;} :root:not([data-theme="light"]) .status-confirmed{background:#16304a;color:#8fc0f5;}
  :root:not([data-theme="light"]) .status-paid{background:#123626;color:#6fd39b;} :root:not([data-theme="light"]) .status-completed{background:#2a2f37;color:#c5c9cf;} :root:not([data-theme="light"]) .status-cancelled{background:#3a1f1c;color:#f09a90;}
}
:root[data-theme="dark"] .status-pending{background:#3a2e18;color:#f0b75a;} :root[data-theme="dark"] .status-confirmed{background:#16304a;color:#8fc0f5;}
:root[data-theme="dark"] .status-paid{background:#123626;color:#6fd39b;} :root[data-theme="dark"] .status-completed{background:#2a2f37;color:#c5c9cf;} :root[data-theme="dark"] .status-cancelled{background:#3a1f1c;color:#f09a90;}

/* ---------- panels / forms ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.panel-narrow { max-width: 440px; margin: 0 auto; }
.panel h2 { margin: 0 0 6px; font-size: 22px; color: var(--heading); }
.panel .sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14.5px; font-family: 'Prompt',sans-serif; color: var(--heading); margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 44px;
  font-family: inherit; font-size: 16px; background: var(--surface-2); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input[type=checkbox], input[type=radio] { min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,99,10,.18); }
textarea { resize: vertical; min-height: 90px; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; }
.checkbox input { width: auto; margin-top: 4px; }

/* ---------- OTP inputs ---------- */
.otp-row { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.otp-row input {
  width: 48px; height: 56px; text-align: center; font-size: 24px; font-family: 'Prompt',sans-serif;
  padding: 0; border-radius: 12px;
}

/* ---------- flash / alerts ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 18px; font-size: 14.5px; }
.flash-error { background: #fdecea; color: #a83224; border: 1px solid #f5c6c0; }
.flash-ok { background: #e9f7ef; color: #17693a; border: 1px solid #bfe8cf; }
.flash-info { background: #eaf1fb; color: #185ea8; border: 1px solid #cadffa; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .flash-error{background:#3a1f1c;border-color:#5a2c27;color:#f5a99f;} :root:not([data-theme="light"]) .flash-ok{background:#123626;border-color:#1d4f38;color:#7fdcaa;}
  :root:not([data-theme="light"]) .flash-info{background:#16304a;border-color:#234a6e;color:#9cc8f7;}
}
:root[data-theme="dark"] .flash-error{background:#3a1f1c;border-color:#5a2c27;color:#f5a99f;} :root[data-theme="dark"] .flash-ok{background:#123626;border-color:#1d4f38;color:#7fdcaa;}
:root[data-theme="dark"] .flash-info{background:#16304a;border-color:#234a6e;color:#9cc8f7;}

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--bg); font-family: 'Prompt',sans-serif; color: var(--heading); font-weight: 600; position: sticky; top: 0; }
tbody tr:hover { background: rgba(232,99,10,.05); }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.divider { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0; position: relative; }
.divider::before, .divider::after { content: ""; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--line); }
.divider::before { left: 0; } .divider::after { right: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 13.5px; padding: 6px 12px; min-height: 36px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font-family: 'Prompt',sans-serif; }
.chip.active { background: var(--orange-cta); color: #fff; border-color: var(--orange-cta); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.tile b { font-family: 'Prompt',sans-serif; font-size: 28px; color: var(--orange-ink); display: block; }
.tile small { color: var(--muted); font-size: 13px; }
.spinner { width: 20px; height: 20px; border: 3px solid rgba(232,99,10,.25); border-top-color: var(--orange); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.callout { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--orange); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--heading); }
.callout:hover { color: var(--heading); border-color: var(--orange); }
.callout .ic { font-size: 28px; flex-shrink: 0; }
.callout b { font-family: 'Prompt',sans-serif; font-weight: 600; }

/* ---------- footer ---------- */
.footer { background: var(--navy); color: #cfd8e3; padding: 36px 16px 24px; margin-top: 40px; font-size: 14.5px; }
.footer-inner { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.footer a { color: #dfe7f0; } .footer a:hover { color: #ffb27d; }
.footer-cols { display: grid; grid-template-columns: minmax(0,1.4fr) repeat(2, minmax(0,1fr)); gap: 28px; }
.footer-cols h2 { font-size: 15px; color: #fff; margin: 0 0 10px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 36px; }
.footer-bottom { max-width: 1120px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; color: #aab6c4; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }
@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr 1fr; } .footer-cols > :first-child { grid-column: 1 / -1; } }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,22,33,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 26px; }

@media (max-width: 640px) {
  .hero h1 { font-size: 26px; } .hero { padding: 40px 16px; }
  .brand-text small { display: none; }
  .otp-row input { width: 42px; height: 50px; font-size: 20px; }
  .panel { padding: 18px; }
  .section-title { font-size: 21px; }
}

/* ============================================================
   หน้ารุ่นอบรม / หน้าหลักสูตร (batch.js · course.js)
   ============================================================ */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.crumbs a { color: var(--muted); display: inline-flex; min-height: 32px; align-items: center; }
.crumbs a:hover { color: var(--orange-ink); }
.crumbs span[aria-hidden] { opacity: .6; }

.yt-batch-head { margin-top: 0; text-align: left; position: relative; overflow: hidden; border-top: 5px solid var(--orange); }
.yt-batch-head .tag { margin-bottom: 10px; }
.yt-batch-title { font-size: 25px; line-height: 1.45; margin: 0 0 8px; color: var(--heading); }
.yt-batch-sub { margin: 0; font-size: 16.5px; color: var(--orange-ink); font-weight: 600; }
.yt-organizer { margin: 10px 0 0; font-size: 14px; color: var(--muted); line-height: 1.6; }
.yt-keyfacts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.yt-keyfacts li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.yt-keyfacts .k { font-size: 12.5px; color: var(--muted); font-family: 'Prompt',sans-serif; }
.yt-keyfacts .v { font-family: 'Prompt',sans-serif; font-weight: 600; color: var(--heading); font-size: 15.5px; line-height: 1.45; }
.yt-keyfacts .v.price { color: var(--orange-ink); font-size: 18px; }
.yt-keyfacts .s { font-size: 13px; color: var(--muted); line-height: 1.5; }
@media (max-width: 640px) {
  .yt-keyfacts { grid-template-columns: 1fr 1fr; gap: 8px; }
  .yt-keyfacts li { padding: 9px 12px; }
  .yt-keyfacts li:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .yt-batch-title { font-size: 21px; }
}

.yt-banner { display: block; width: 100%; height: auto; border-radius: var(--radius); margin-top: 16px; box-shadow: var(--shadow); background: var(--line); }
.yt-btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 16px 0; }
.yt-btn-row .btn { flex: 1 1 240px; justify-content: center; text-align: center; }
.yt-info-box { margin-top: 16px; text-align: center; border-top: 5px solid var(--orange); }
.yt-info-box p { margin: 6px 0; }
.yt-note { font-size: 14px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0; line-height: 1.7; }

/* แถบเมนูในหน้า (ค้างด้านบนตอนเลื่อน) */
.yt-jump { display: flex; flex-wrap: nowrap; gap: 6px; justify-content: flex-start; margin: 18px 0; font-size: 14px; overflow-x: auto; scrollbar-width: none; position: sticky; top: calc(var(--header-h) + 3px); z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: 8px 2px; margin-left: -2px; margin-right: -2px; }
.yt-jump::-webkit-scrollbar { display: none; }
html:has(.yt-jump) { scroll-padding-top: calc(var(--header-h) + 72px); } /* ไม่ให้แถบเมนูในหน้าบังหัวข้อ */
.yt-jump a { font-weight: 500; font-family: 'Prompt',sans-serif; white-space: nowrap; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--heading); }
.yt-jump a:hover { border-color: var(--orange); color: var(--orange-ink); }
.yt-jump a.primary { background: var(--orange-cta); border-color: var(--orange-cta); color: #fff; }
.yt-jump span { white-space: nowrap; display: inline-flex; align-items: center; }

.yt-sec { margin-top: 18px; }
.yt-sec-head { margin: 0 0 14px; padding: 0 0 0 14px; border-left: 5px solid var(--orange); background: none; color: var(--heading); font-size: 20px; line-height: 1.4; }
.yt-prose { line-height: 1.9; max-width: 72ch; }
.yt-prose p { margin: 0 0 12px; }
.yt-prose h4 { margin: 18px 0 6px; color: var(--orange-ink); font-size: 16.5px; }
.yt-prose ul, .yt-prose ol { margin: 0 0 12px; padding-left: 24px; }
.yt-prose li { margin-bottom: 4px; }
.yt-em { font-weight: 600; color: var(--danger); }
:root[data-theme="dark"] .yt-em { color: #f5a99f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .yt-em { color: #f5a99f; } }
.yt-indent { margin: 4px 0 8px 4px; }
.yt-bank { font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 8px; }
.yt-receipt { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(30,132,73,.1); border-left: 4px solid var(--ok); }
.yt-speakers img { display: block; width: 100%; height: auto; margin-top: 18px; border-radius: var(--radius); background: var(--line); }
.yt-embed { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.yt-embed iframe { display: block; width: 100%; border: 0; }
.yt-embed-form iframe { height: 2600px; }
.yt-embed-sheet iframe { height: 620px; }
@media (max-width: 640px) {
  .yt-batch-title { font-size: 20px; }
  .yt-embed-form iframe { height: 3200px; }
  .yt-embed-sheet iframe { height: 520px; }
  .yt-sec-head { font-size: 18px; }
}

/* ขั้นตอนการสมัคร — วงกลมตัวเลข */
.yt-steps { list-style: none; counter-reset: step; padding-left: 0 !important; margin: 0 0 12px; }
.yt-steps > li { counter-increment: step; position: relative; padding: 0 0 16px 48px; margin: 0; }
.yt-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--orange-cta); color: #fff; font-family: 'Prompt',sans-serif; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.yt-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 2px; background: var(--line); }

/* ส่วนที่ยุบ/ขยายได้ (เนื้อหายาว) */
details.yt-collapse > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
details.yt-collapse > summary::-webkit-details-marker { display: none; }
details.yt-collapse > summary .yt-sec-head { margin: 0; }
details.yt-collapse > summary::after { content: "แสดง ▾"; flex-shrink: 0; font-family: 'Prompt',sans-serif; font-size: 13.5px; color: var(--link); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
details.yt-collapse[open] > summary::after { content: "ย่อ ▴"; }
details.yt-collapse[open] > summary { margin-bottom: 14px; }
details.yt-collapse > summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }

/* วิธีสมัคร (รุ่นที่สมัครผ่าน Google Form) */
.yt-apply-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.yt-apply-tools .btn { flex: 1 1 220px; }

/* ติดต่อ — ปุ่มโทร/ไลน์ */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.contact-btn { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--heading); }
.contact-btn:hover { border-color: var(--orange); color: var(--heading); }
.contact-btn .ic { font-size: 22px; width: 28px; text-align: center; flex-shrink: 0; }
.contact-btn b { display: block; font-family: 'Prompt',sans-serif; font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.contact-btn small { color: var(--muted); font-size: 13px; }

/* แถบสมัครค้างล่างจอ (มือถือ) */
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: none; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 96%, transparent); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.10); backdrop-filter: blur(6px); transition: transform .2s; }
.sticky-cta .info { flex: 1; min-width: 0; line-height: 1.3; }
.sticky-cta .info b { display: block; font-family: 'Prompt',sans-serif; font-size: 15px; color: var(--orange-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-cta .info small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-cta .btn { flex-shrink: 0; min-width: 120px; }
.sticky-cta.is-hidden { transform: translateY(110%); }
@media (max-width: 760px) {
  .sticky-cta { display: flex; }
  body.has-sticky-cta { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* หน้ารุ่นอื่น / รายการรุ่นในหน้าหลักสูตร */
.batch-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 14px; align-items: center; color: inherit; }
.batch-row:hover { color: inherit; border-color: var(--orange); }
.batch-row b { font-family: 'Prompt',sans-serif; font-weight: 600; }
.batch-row .go { font-family: 'Prompt',sans-serif; color: var(--orange-ink); white-space: nowrap; }
@media (max-width: 520px) { .batch-row { grid-template-columns: auto minmax(0,1fr); } .batch-row .go { grid-column: 1 / -1; } }

/* หน้าแรกแบบเดิม: รายการรุ่นที่เปิดรับ (คงไว้เผื่อหน้าอื่นใช้) */
.yt-home-list { display: grid; gap: 14px; }
.yt-home-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; align-items: center; }
.yt-home-item h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.5; }
.yt-home-item h3 a { color: var(--heading); }
.yt-home-meta { font-size: 15px; line-height: 1.8; }
.yt-home-item .btn { min-width: 110px; justify-content: center; }
@media (max-width: 640px) { .yt-home-item { grid-template-columns: 1fr; } }
.yt-banner-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.yt-banner-grid a img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }

/* กล่องแบนเนอร์ประชาสัมพันธ์ (ยุบได้) */
details.share-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
details.share-box > summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex; gap: 12px; align-items: center; min-height: 56px; }
details.share-box > summary::-webkit-details-marker { display: none; }
details.share-box > summary .t { flex: 1; }
details.share-box > summary b { font-family: 'Prompt',sans-serif; font-weight: 600; color: var(--heading); display: block; }
details.share-box > summary small { color: var(--muted); font-size: 14px; }
details.share-box > summary::after { content: "▾"; font-size: 18px; color: var(--muted); transition: transform .2s; }
details.share-box[open] > summary::after { transform: rotate(180deg); }
details.share-box > .share-body { padding: 0 18px 18px; }

/* ---------- หน้าแรก: ตารางรุ่น 3 กลุ่ม (ผู้จัด/สิทธิ์เบิก) ---------- */
#ad-hero { max-width: 860px; margin-left: auto; margin-right: auto; }
.trk-ic { font-size: 26px; width: 44px; text-align: center; }
.trk { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); margin: 0 0 22px; overflow: hidden; scroll-margin-top: 80px; }
.trk-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; color: #fff; background: linear-gradient(135deg, var(--navy), var(--navy-2)); flex-wrap: wrap; }
.trk-b .trk-head { background: linear-gradient(135deg, #a94400, #d4600c); }
.trk-c .trk-head { background: linear-gradient(135deg, #0f5b4c, #1a8068); }
.trk-emoji { font-size: 30px; }
.trk-ttl { flex: 1 1 260px; min-width: 0; }
.trk-ttl h3 { margin: 0; font-size: 19px; color: #fff; font-family: 'Prompt',sans-serif; font-weight: 600; }
.trk-ttl p { margin: 2px 0 0; font-size: 13.5px; color: rgba(255,255,255,.85); }
.trk-badge { background: #fff; color: var(--navy); font-family: 'Prompt',sans-serif; font-weight: 600; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; }
.trk-row { display: grid; grid-template-columns: auto 174px minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.trk-row:first-child { border-top: 0; }
.trk-row:hover { background: var(--surface-2); }
.trk-thumb { width: 174px; height: 90px; object-fit: cover; border-radius: 10px; background: var(--navy); display: block; }
.trk-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 34px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.trk-info h4 { margin: 0 0 4px; font-size: 16.5px; line-height: 1.4; font-family: 'Prompt',sans-serif; font-weight: 500; }
.trk-info h4 a { color: var(--heading); }
.trk-info h4 a:hover { color: var(--orange-ink); }
.trk-rn { color: var(--orange-ink); white-space: nowrap; }
.trk-info p { margin: 0; font-size: 14px; color: var(--muted); }
.trk-act { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.trk-act .price { font-family: 'Prompt',sans-serif; font-weight: 600; color: var(--heading); font-size: 15px; }
.trk-act .actions { display: flex; gap: 8px; }
.trk-empty { padding: 18px 20px; margin: 0; }
@media (max-width: 860px) {
  .trk-row { grid-template-columns: auto minmax(0,1fr); }
  .trk-thumb { display: none; }
  .trk-act { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; text-align: left; flex-wrap: wrap; }
  .trk-head { padding: 14px 16px; }
  .trk-row { padding: 14px 16px; }
}

/* หลังบ้าน: กล่องไฟล์ของรุ่น (ไฟล์เดิม + ไฟล์ใหม่) */
.bo-files-box { padding: 12px 16px; margin: 0 0 14px; }
.bo-files-box summary { cursor: pointer; font-family: 'Prompt',sans-serif; }
.bo-file-list { display: grid; gap: 8px; margin-top: 10px; }
.bo-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); flex-wrap: wrap; }
.bo-file .ic { font-size: 22px; }
.bo-file .t { flex: 1 1 260px; min-width: 0; }
.bo-file .t b { display: block; font-size: 15px; }
.bo-file .t small { color: var(--muted); font-size: 13px; }

.bo-tools { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.bo-tools-h { font-family: 'Prompt',sans-serif; font-size: 14px; margin: 0 0 8px; color: var(--heading); }
