/* ============================================================
   SafeLane — "Work Zone, Zero Friction" Identity
   นวัตกรรมซ่อมบำรุงผิวจราจรแบบไม่ปิดช่องทางเดินรถ (ASTRA Bridge)
   Design system: safety-orange + hi-vis + tech-cyan
   ============================================================ */

:root {
  /* Brand identity — safety orange */
  --brand:        #ea580c;       /* safety orange */
  --brand-dark:   #9a3412;
  --brand-accent: #0891b2;       /* tech cyan — data/IoT */

  /* Work-zone palette */
  --hivis:        #facc15;       /* hi-vis yellow */
  --safety-green: #16a34a;
  --barrier:      #f97316;
  --asphalt:      #1f2937;
  --steel:        #0ea5e9;

  /* Section identities — each slide gets its own accent */
  --section-cover:    #ea580c;
  --section-exec:     #0891b2;
  --section-problem:  #dc2626;   /* ปัญหา · red */
  --section-future:   #8b5cf6;   /* อนาคต/SWOT · purple */
  --section-solution: #0ea5e9;   /* แนวทาง · sky */
  --section-roadmap:  #16a34a;   /* Roadmap · green */
  --section-howit:    #ea580c;   /* วิธีทำงาน · orange */
  --section-tech:     #f59e0b;   /* เทคโนโลยี · amber */
  --section-impl:     #64748b;   /* Implementation · slate */
  --section-budget:   #ca8a04;   /* ราคากลาง · gold */
  --section-kpi:      #0891b2;   /* KPI · cyan */
  --section-risk:     #dc2626;   /* ระเบียบ/Risk · red */
  --section-summary:  #ea580c;   /* สรุป · brand */

  /* Neutrals */
  --ink:        #111827;
  --ink-2:      #1e293b;
  --ink-3:      #334155;
  --muted:      #64748b;
  --line:       rgba(17, 24, 39, .08);
  --line-2:     rgba(17, 24, 39, .14);
  --paper:      #ffffff;
  --paper-2:    #f8fafc;
  --paper-3:    #eef2f7;
  --paper-warm: #fff7ed;

  /* Status */
  --success: #10b981;
  --warn:    #f59e0b;
  --danger:  #ef4444;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(17, 24, 39, .06);
  --shadow-md: 0 12px 32px rgba(17, 24, 39, .08);
  --shadow-lg: 0 28px 70px rgba(17, 24, 39, .14);
  --shadow-xl: 0 45px 110px rgba(17, 24, 39, .22);

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Prompt', 'IBM Plex Sans Thai', system-ui, -apple-system, Segoe UI, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(234, 88, 12, .08), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(8, 145, 178, .06), transparent 60%),
    #fafbfd;
  color: var(--ink);
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Hazard-stripe decorative divider */
.line-divider {
  height: 8px;
  background: repeating-linear-gradient(45deg, var(--asphalt) 0 14px, var(--hivis) 14px 28px);
  border-radius: 999px;
  margin: 14px 0 18px;
  position: relative;
}

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: sticky; top: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.brand-logo {
  width: 48px; height: 48px;
  position: relative;
  display: grid; place-items: center;
  background: transparent;
  border-radius: 14px;
  filter: drop-shadow(0 4px 14px rgba(234, 88, 12, 0.32));
  transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1), filter .3s;
}
.brand:hover .brand-logo {
  transform: translateY(-2px) scale(1.06);
  filter: drop-shadow(0 8px 22px rgba(250, 204, 21, 0.5));
}
.brand-logo svg { display: block; }
.brand-title {
  font-weight: 800; font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--ink);
  line-height: 1;
}
.brand-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: .2px;
}

.topnav { display: flex; gap: 3px; flex-wrap: wrap; max-width: 72%; justify-content: flex-end; align-items: center; }
.navbtn {
  border: 0; background: transparent;
  font-family: inherit;
  font-size: 12.5px; font-weight: 500;
  padding: 8px 13px;
  border-radius: var(--r-pill);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s ease;
}
.navbtn:hover { background: var(--paper-3); color: var(--ink); }
.navbtn.active {
  background: var(--ink);
  color: white;
  font-weight: 600;
}

/* ============================================================
   Deck + Slide system
   ============================================================ */
.deck {
  position: relative;
  padding: 36px 28px 140px;
  max-width: 1280px;
  margin: 0 auto;
}
.slide {
  display: none;
  animation: slideIn .55s cubic-bezier(.16, 1, .3, 1);
  min-height: 78vh;
}
.slide.active { display: block; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Slide header — "work-zone marker" style */
.slide-header { margin-bottom: 32px; position: relative; padding-left: 64px; }
.slide-header::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: white;
  border: 5px solid var(--section-color, var(--brand));
  box-shadow: 0 4px 14px rgba(17, 24, 40, .1);
  transform: rotate(45deg);
}
.slide-header::after {
  content: '';
  position: absolute;
  left: 23px; top: 52px; bottom: -20px;
  width: 3px;
  background: var(--section-color, var(--brand));
  opacity: .25;
  border-radius: 2px;
}
.slide-num {
  position: absolute;
  left: 14px; top: 13px;
  font-size: 16px; font-weight: 800;
  color: var(--section-color, var(--brand));
  width: 22px; text-align: center;
  z-index: 1;
}
.slide h2 {
  font-size: clamp(28px, 4.2vw, 44px);
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--ink);
  line-height: 1.12;
  margin-bottom: 10px;
}
.slide-lead {
  font-size: 16px;
  color: var(--ink-3);
  max-width: 940px;
  line-height: 1.65;
}
.slide-lead b { color: var(--ink); font-weight: 600; }

/* Section color theming */
.slide[data-slide="0"] { --section-color: var(--section-cover); }
.slide[data-slide="1"] { --section-color: var(--section-exec); }
.slide[data-slide="2"] { --section-color: var(--section-problem); }
.slide[data-slide="3"] { --section-color: var(--section-future); }
.slide[data-slide="4"] { --section-color: var(--section-solution); }
.slide[data-slide="5"] { --section-color: var(--section-roadmap); }
.slide[data-slide="6"] { --section-color: var(--section-howit); }
.slide[data-slide="7"] { --section-color: var(--section-tech); }
.slide[data-slide="8"] { --section-color: var(--section-impl); }
.slide[data-slide="9"] { --section-color: var(--section-budget); }
.slide[data-slide="10"] { --section-color: #0d9488; }
.slide[data-slide="11"] { --section-color: var(--section-kpi); }
.slide[data-slide="12"] { --section-color: var(--section-risk); }
.slide[data-slide="13"] { --section-color: var(--section-summary); }

/* ============================================================
   COVER
   ============================================================ */
.cover {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 50px;
  align-items: center;
  min-height: 78vh;
  padding-top: 10px;
  position: relative;
}
.slide[data-slide="0"] .slide-header { display: none; }
@media (max-width: 980px) { .cover { grid-template-columns: 1fr; } }

.cover-left { display: flex; flex-direction: column; gap: 20px; position: relative; }

.cover-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.cover-title {
  font-size: clamp(38px, 7vw, 84px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -2px;
  color: var(--ink);
}
.cover-title .grad-text {
  background: linear-gradient(135deg, var(--brand) 0%, var(--hivis) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cover-title .thai-title {
  display: block;
  margin-top: 14px;
  font-size: clamp(19px, 2.6vw, 30px);
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.3px;
  line-height: 1.3;
}
.cover-sub {
  font-size: 15.5px;
  color: var(--ink-3);
  line-height: 1.75;
  max-width: 580px;
}
.cover-sub b { color: var(--ink); font-weight: 600; }

.cover-badge {
  display:inline-flex; align-items:center; gap:8px;
  background: linear-gradient(135deg, var(--brand), var(--barrier));
  color: white;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  width: fit-content;
  box-shadow: 0 4px 14px rgba(234,88,12,.28);
}

.cover-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.pillar-card {
  background: white;
  padding: 16px 10px;
  border-radius: var(--r-md);
  text-align: center;
  border: 1px solid var(--line);
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}
.pillar-card::before {
  content: '';
  position: absolute;
  top: 0; left: 12px; right: 12px;
  height: 3px;
  background: var(--pillar-c, var(--brand));
  border-radius: 0 0 3px 3px;
}
.pillar-card:nth-child(1) { --pillar-c: var(--brand); }
.pillar-card:nth-child(2) { --pillar-c: var(--safety-green); }
.pillar-card:nth-child(3) { --pillar-c: var(--steel); }
.pillar-card:nth-child(4) { --pillar-c: var(--hivis); }
.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--pillar-c);
}
.pillar-ico { font-size: 26px; margin-bottom: 6px; line-height: 1; }
.pillar-label { font-size: 12.5px; font-weight: 700; color: var(--ink); }

.team-block {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.team-block h3 { font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 10px; letter-spacing:.4px; }
.team-list { display: flex; flex-wrap: wrap; gap: 8px; }
.team-list .member {
  font-size: 12.5px; color: var(--ink-3);
  background: var(--paper-3);
  padding: 6px 12px; border-radius: 999px;
}

.cover-cta {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 4px;
}
.cta-btn {
  background: var(--ink);
  color: white;
  border: 0;
  padding: 14px 26px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-weight: 700; font-size: 15px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .2s ease;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(17, 24, 40, .25);
}
.cta-btn:hover {
  background: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(234, 88, 12, .4);
}
.cta-btn.alt {
  background: white;
  color: var(--ink);
  border: 1.5px solid var(--line-2);
  box-shadow: var(--shadow-sm);
}
.cta-btn.alt:hover {
  background: var(--paper-2);
  border-color: var(--brand);
  color: var(--brand);
}
.cta-btn.flagship {
  background: linear-gradient(135deg, var(--brand) 0%, var(--barrier) 100%);
  box-shadow: 0 8px 24px rgba(234, 88, 12, .4);
}
.cta-btn.flagship:hover { filter: brightness(1.08); }
.cover-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ============================================================
   Cover right — ASTRA Bridge cross-section visualization
   ============================================================ */
.cover-right {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 560px;
  padding: 20px 10px;
}
.bridge-viz {
  width: 100%;
  max-width: 600px;
  filter: drop-shadow(0 12px 32px rgba(234, 88, 12, 0.14));
}
.bridge-viz svg { width: 100%; height: auto; display: block; }
@media (max-width: 980px) {
  .cover-right { min-height: 420px; }
  .bridge-viz { max-width: 460px; }
}

/* Moving car animation on the bridge */
@keyframes drive {
  0%   { transform: translateX(0); }
  100% { transform: translateX(360px); }
}
.viz-car { animation: drive 4.5s linear infinite; }
@keyframes spark {
  0%,100% { opacity: .35; }
  50%     { opacity: 1; }
}
.viz-spark { animation: spark 1.1s ease-in-out infinite; transform-origin: center; }

/* ============================================================
   Generic components
   ============================================================ */
.callout {
  background: white;
  padding: 18px 22px;
  border-radius: var(--r-md);
  border-left: 4px solid var(--section-color, var(--brand));
  box-shadow: var(--shadow-sm);
  display: flex; gap: 14px; align-items: flex-start;
  margin: 16px 0;
}
.callout-ico {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--section-color, var(--brand)) 12%, transparent);
  color: var(--section-color, var(--brand));
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.callout > div:last-child { flex: 1; font-size: 14.5px; color: var(--ink-2); line-height: 1.7; }
.callout b { color: var(--ink); font-weight: 700; }

/* Exec grid / cards */
.exec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 14px;
}
.exec-card {
  background: white;
  padding: 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}
.exec-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--section-color, var(--brand));
}
.exec-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.exec-ico {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 26px;
  background: color-mix(in srgb, var(--section-color, var(--brand)) 10%, transparent);
  margin-bottom: 14px;
}
.exec-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.exec-card p {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.7;
}
.exec-card b { color: var(--ink-2); font-weight: 600; }

/* Two-column lists */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }
.col-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-list li {
  background: white;
  padding: 14px 18px 14px 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  position: relative;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.55;
  transition: all .2s ease;
}
.check-list li:hover { border-color: var(--line-2); transform: translateX(2px); }
.check-list li::before {
  content: '⚠';
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--warn);
  font-weight: 800;
  font-size: 15px;
}
.check-list.pos li::before { content: '✓'; color: var(--success); }
.check-list b { color: var(--ink); font-weight: 600; }

/* Impact 3-dimensions strip */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 820px) { .impact-grid { grid-template-columns: 1fr; } }
.impact-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--c, var(--brand));
}
.impact-card .ic-ico { font-size: 30px; margin-bottom: 10px; }
.impact-card h4 { font-size: 16px; color: var(--ink); margin-bottom: 8px; }
.impact-card p { font-size: 13px; color: var(--ink-3); line-height: 1.65; }

/* SWOT */
.swot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 880px) { .swot { grid-template-columns: 1fr; } }
.swot-quad {
  background: white;
  padding: 20px;
  border-radius: var(--r-md);
  border-top: 4px solid var(--brand);
  box-shadow: var(--shadow-sm);
}
.swot-quad.sw-s { border-top-color: var(--success); }
.swot-quad.sw-w { border-top-color: var(--warn); }
.swot-quad.sw-o { border-top-color: var(--brand); }
.swot-quad.sw-t { border-top-color: var(--danger); }
.swot-h {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.swot-quad ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.swot-quad li {
  font-size: 13.5px;
  color: var(--ink-3);
  padding-left: 16px;
  position: relative;
  line-height: 1.55;
}
.swot-quad li::before {
  content: '•';
  position: absolute; left: 4px;
  color: var(--muted);
}

/* PESTEL */
.pestel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.pestel-item {
  background: white;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
}
.pestel-item b {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand); color: white;
  font-size: 14px; font-weight: 800;
  flex-shrink: 0;
}
.pestel-item span { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }

/* Tables */
.budget-table, .risk-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 16px;
  background: white;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.budget-table th, .risk-table th {
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 14px 18px;
  letter-spacing: .3px;
}
.budget-table td, .risk-table td {
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  line-height: 1.6;
  vertical-align: top;
}
.budget-table tbody tr:hover, .risk-table tbody tr:hover { background: var(--paper-2); }
.budget-table b, .risk-table b { color: var(--ink); font-weight: 700; }
.tag-hi { color: var(--danger); font-weight: 700; }
.tag-mid { color: var(--warn); font-weight: 700; }
.tag-lo { color: var(--success); font-weight: 700; }

/* Phase header */
.phase-h {
  font-size: 17px; font-weight: 700;
  color: var(--ink);
  margin: 26px 0 14px;
  display: flex; align-items: center; gap: 12px;
  letter-spacing: -0.3px;
}
.budget-phase {
  background: white;
  padding: 14px 20px;
  border-left: 5px solid var(--section-color, var(--brand));
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  box-shadow: var(--shadow-sm);
}

/* Budget / price tiers */
.budget-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.budget-tier {
  background: white;
  padding: 26px 20px;
  border-radius: var(--r-md);
  text-align: center;
  border-top: 4px solid var(--muted);
  box-shadow: var(--shadow-sm);
  transition: all .2s ease;
}
.budget-tier:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.budget-tier.conservative { border-top-color: var(--success); }
.budget-tier.medium {
  border-top-color: var(--warn);
  background: linear-gradient(180deg, #fffbeb 0%, white 100%);
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}
.budget-tier.aggressive { border-top-color: var(--danger); }
.bt-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.budget-tier.medium .bt-label { color: var(--warn); }
.bt-amount {
  font-size: 30px; font-weight: 800;
  color: var(--ink);
  letter-spacing: -1.2px;
  margin-bottom: 6px;
}
.bt-sub { font-size: 12.5px; color: var(--muted); }
.budget-context {
  font-size: 13.5px;
  color: var(--ink-3);
  background: white;
  padding: 16px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  line-height: 1.75;
  margin-bottom: 20px;
}

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.kpi {
  background: white;
  padding: 22px 20px;
  border-radius: var(--r-md);
  border-top: 4px solid var(--brand);
  box-shadow: var(--shadow-sm);
  transition: all .2s ease;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi-cat {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--brand);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.kpi-n {
  font-size: 34px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -1.2px;
  line-height: 1;
  margin-bottom: 8px;
}
.kpi-l { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; line-height: 1.4; }
.kpi-d { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* ============================================================
   How-it-works (ASTRA Bridge flow)
   ============================================================ */
.howit {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) { .howit { grid-template-columns: 1fr; } }
.howit-viz {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.howit-viz svg { width: 100%; height: auto; display: block; }
.flow-steps {
  list-style: none;
  counter-reset: step;
  display: flex; flex-direction: column; gap: 12px;
}
.flow-steps li {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px 16px 60px;
  position: relative;
  box-shadow: var(--shadow-sm);
  counter-increment: step;
  transition: all .2s ease;
}
.flow-steps li:hover { transform: translateX(3px); border-color: var(--brand); }
.flow-steps li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 16px;
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--brand), var(--barrier));
  color: white;
  border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
}
.flow-steps h4 { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.flow-steps p { font-size: 13px; color: var(--ink-3); line-height: 1.6; }

/* Spec badges */
.spec-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.spec {
  background: var(--asphalt);
  color: white;
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.spec::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: repeating-linear-gradient(45deg, var(--asphalt) 0 8px, var(--hivis) 8px 16px);
}
.spec .sp-n { font-size: 24px; font-weight: 800; color: var(--hivis); letter-spacing: -.5px; }
.spec .sp-l { font-size: 12px; color: #cbd5e1; margin-top: 4px; }

/* Tech grid (reuses exec-card look but tinted) */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.tech-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all .2s ease;
  position: relative;
}
.tech-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--section-color); }
.tech-card .t-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px;
  background: color-mix(in srgb, var(--section-color, var(--brand)) 12%, transparent);
  margin-bottom: 12px;
}
.tech-card h4 { font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.tech-card p { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.tech-card .t-tag {
  display:inline-block; margin-top:10px;
  font-size: 11px; font-weight: 700;
  color: var(--section-color, var(--brand));
  background: color-mix(in srgb, var(--section-color, var(--brand)) 10%, transparent);
  padding: 3px 10px; border-radius: 999px;
}

/* Closing */
.last-call {
  background: linear-gradient(135deg, var(--asphalt) 0%, var(--brand-dark) 100%);
  color: white;
  padding: 32px;
  border-radius: var(--r-lg);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.last-call::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(250, 204, 21, .15), transparent 70%);
  pointer-events: none;
}
.last-call::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  background: repeating-linear-gradient(45deg, var(--asphalt) 0 14px, var(--hivis) 14px 28px);
  opacity: .85;
}
.last-call h3 { font-size: 22px; margin-bottom: 18px; color: white; position: relative; }
.recos {
  list-style: none;
  counter-reset: rec;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
.recos li {
  background: rgba(255, 255, 255, .08);
  padding: 14px 18px 14px 56px;
  border-radius: var(--r-sm);
  font-size: 14px;
  position: relative;
  line-height: 1.6;
  counter-increment: rec;
}
.recos li::before {
  content: counter(rec);
  position: absolute; left: 16px; top: 14px;
  background: var(--hivis);
  color: var(--asphalt);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 13px;
}
.recos b { color: var(--hivis); }

.closing-quote {
  background: white;
  padding: 26px 30px 26px 70px;
  border-radius: var(--r-md);
  border-left: 6px solid var(--brand);
  position: relative;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ink-3);
  box-shadow: var(--shadow-sm);
}
.closing-quote .big-q {
  position: absolute; left: 20px; top: 8px;
  font-size: 78px; font-weight: 900;
  color: var(--brand);
  font-family: Georgia, serif;
  line-height: 1;
  opacity: .22;
}
.closing-quote b { color: var(--ink); font-weight: 700; }

/* Change strategy */
.change-strat {
  background: white;
  padding: 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  margin-top: 18px;
}
.change-strat h3 {
  font-size: 17px;
  margin-bottom: 16px;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.adkar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.adkar-item {
  background: var(--paper-3);
  padding: 14px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}
.adkar-item b {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand); color: white;
  font-size: 12px; font-weight: 800;
  margin-right: 8px;
}

/* Strategic alignment chips */
.align-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.align-item {
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-accent);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.align-item b { display:block; color: var(--ink); font-size: 13.5px; margin-bottom: 4px; }
.align-item span { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }

/* ============================================================
   4 policy pillars (Smart & Safe Work Zone)
   ============================================================ */
.pillars4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 820px) { .pillars4 { grid-template-columns: 1fr; } }
.pillar-policy {
  background: white;
  border: 1px solid var(--line);
  border-left: 5px solid var(--pc, var(--brand));
  border-radius: var(--r-md);
  padding: 20px 20px 18px 70px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all .2s ease;
}
.pillar-policy:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.pillar-policy .pp-num {
  position: absolute; left: 16px; top: 20px;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--pc, var(--brand)); color: white;
  display: grid; place-items: center;
  font-weight: 800; font-size: 19px;
}
.pillar-policy h4 { font-size: 16px; color: var(--ink); margin-bottom: 3px; letter-spacing: -.2px; }
.pillar-policy .pp-sub { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; letter-spacing: .3px; }
.pillar-policy p { font-size: 13px; color: var(--ink-3); line-height: 1.6; margin-bottom: 10px; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-chip {
  font-size: 11.5px; background: var(--paper-3); color: var(--ink-3);
  padding: 4px 10px; border-radius: 999px;
}
.ex-chip.flag {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand-dark); font-weight: 700;
}

/* Flagship banner */
.flag-banner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.flag-banner .fb-badge {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--barrier));
  color: white; font-weight: 800; font-size: 12px;
  padding: 6px 12px; border-radius: 999px; letter-spacing: .5px;
}
.flag-banner span { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }
.flag-banner b { color: var(--ink); }

/* ============================================================
   Break-even calculator (interactive)
   ============================================================ */
.calc {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 26px;
}
@media (max-width: 880px) { .calc { grid-template-columns: 1fr; gap: 20px; } }
.calc-inputs { display: flex; flex-direction: column; gap: 16px; }
.calc-inputs label { display: flex; flex-direction: column; gap: 8px; }
.calc-inputs .lab-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.calc-inputs .lab-row b { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.calc-inputs output {
  font-size: 15px; font-weight: 800; color: #0d9488;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.calc-inputs input[type="range"] { width: 100%; accent-color: #0d9488; cursor: pointer; }
.calc-out { display: flex; flex-direction: column; gap: 14px; }
.calc-verdict {
  padding: 14px 18px; border-radius: var(--r-md);
  font-weight: 800; font-size: 18px; text-align: center;
  transition: all .2s ease;
}
.calc-verdict.go { background: rgba(16,185,129,.12); color: #047857; border: 1px solid rgba(16,185,129,.35); }
.calc-verdict.no { background: rgba(239,68,68,.10); color: #b91c1c; border: 1px solid rgba(239,68,68,.30); }
.calc-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.calc-metrics > div {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 14px;
}
.calc-metrics span {
  display: block; font-size: 19px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -.3px;
}
.calc-metrics small { font-size: 11.5px; color: var(--muted); }
#calc-chart svg { width: 100%; height: auto; display: block; border-radius: var(--r-sm); }

/* ============================================================
   Compare: ปิดเลนเดิม vs ASTRA
   ============================================================ */
.compare {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
}
@media (max-width: 900px) { .compare { grid-template-columns: 1fr; } }
.compare-chart {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.compare-chart svg { width: 100%; height: auto; max-width: 360px; display: block; margin: 0 auto; }
.compare-note { font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 8px; text-align: center; }

/* ============================================================
   Download FAB (PDF / PPTX)
   ============================================================ */
.dl-fab {
  position: fixed; right: 20px; bottom: 80px;
  z-index: 85;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.dl-toggle {
  background: linear-gradient(135deg, var(--brand), var(--barrier));
  color: white; border: 0;
  font-family: inherit; font-weight: 700; font-size: 13px;
  padding: 11px 16px; border-radius: 999px;
  cursor: pointer; box-shadow: var(--shadow-md);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .2s ease;
}
.dl-toggle:hover { filter: brightness(1.06); transform: translateY(-1px); }
.dl-menu {
  display: flex; flex-direction: column; gap: 6px;
  background: white; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 8px;
  box-shadow: var(--shadow-lg);
}
.dl-menu[hidden] { display: none; }
.dl-btn {
  background: white; border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-2); padding: 10px 14px;
  cursor: pointer; text-align: left; white-space: nowrap;
  transition: all .15s ease;
}
.dl-btn:hover { background: var(--paper-2); border-color: var(--brand); color: var(--brand); }
.dl-btn:disabled { opacity: .6; cursor: wait; }

/* ============================================================
   Floating controls
   ============================================================ */
.controls {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex; align-items: center; gap: 4px;
  background: rgba(17, 24, 40, .94);
  backdrop-filter: blur(20px);
  padding: 8px 12px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
}
.ctrl {
  width: 36px; height: 36px;
  border: 0; background: rgba(255, 255, 255, .1);
  color: white;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  transition: all .2s ease;
}
.ctrl:hover { background: var(--brand); }
.dots { display: flex; gap: 6px; padding: 0 8px; flex-wrap: wrap; max-width: 60vw; }
.dot-nav {
  width: 8px; height: 8px;
  border: 0; padding: 0;
  background: rgba(255, 255, 255, .35);
  border-radius: 50%;
  cursor: pointer;
  transition: all .2s ease;
}
.dot-nav:hover { background: rgba(255, 255, 255, .7); }
.dot-nav.active {
  background: var(--hivis);
  width: 22px;
  border-radius: var(--r-pill);
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: revealUp .55s cubic-bezier(.16, 1, .3, 1) forwards;
  animation-delay: var(--d, 0s);
}
.slide:not(.active) .reveal { animation: none; }
@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 960px) {
  .topbar { padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .topnav { max-width: 100%; }
  .deck { padding: 24px 16px 120px; }
  .cover { gap: 24px; min-height: auto; }
  .cover-pillars { grid-template-columns: repeat(2, 1fr); }
  .budget-tier-grid { grid-template-columns: 1fr; }
  .budget-tier.medium { transform: none; }
  .budget-table, .risk-table { display: block; overflow-x: auto; }
  .slide-header { padding-left: 56px; }
  .slide-header::before { width: 40px; height: 40px; }
  .slide-num { font-size: 14px; }
}

@media print {
  @page { margin: 8mm; }
  html, body { background: #fff !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; color: #111827; }

  /* hide screen-only chrome */
  .topbar, .controls, .footer, .dl-fab, .dl-menu,
  .cover-cta, .cover-hint { display: none !important; }

  .deck { padding: 0 !important; margin: 0 !important; max-width: none !important; }

  /* CONTINUOUS FLOW — NO forced page breaks. This prevents blank pages no matter
     what margin/orientation/header-footer the user picks. Sections are separated
     by a colored top rule instead of a forced page break. */
  .slide {
    display: block !important;
    min-height: 0 !important;
    margin: 12px 0 0 0 !important;
    padding: 12px 0 4px 0 !important;
    border-top: 3px solid var(--section-color, #ea580c) !important;
    page-break-before: auto !important;
    break-before: auto !important;
    page-break-after: auto !important;
    break-after: auto !important;
  }
  .slide[data-slide="0"] { border-top: 0 !important; margin-top: 0 !important; padding-top: 0 !important; }
  .slide-header { break-after: avoid !important; }

  .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
  .viz-car { animation: none !important; }
  *:hover { transform: none !important; box-shadow: none !important; }

  /* reset min/fixed heights that reserved empty space → caused blank pages */
  .cover, .cover-left, .cover-right, .bridge-viz,
  .howit, .howit-viz, .compare, .compare-chart { min-height: 0 !important; }
  .cover { display: grid !important; grid-template-columns: 1.25fr 1fr !important; gap: 14px !important; align-items: start !important; padding-top: 2mm !important; }
  .cover-right { max-height: 330px !important; padding: 0 !important; }
  .bridge-viz { max-width: 350px !important; margin: 0 auto !important; }
  .howit-viz svg, .compare-chart svg { max-height: 250px !important; }
  #calc-chart svg { max-height: 220px !important; }

  /* keep SMALL blocks intact; let big containers flow (avoids huge pre-block gaps) */
  .slide-header, .exec-card, .kpi, .pillar-policy, .tech-card, .budget-tier,
  .swot-quad, .impact-card, .callout, .flow-steps li, .closing-quote,
  .align-item, .pestel-item, .check-list li, .budget-context, tr {
    break-inside: avoid; page-break-inside: avoid;
  }

  /* compact typography & spacing for density */
  .slide h2 { font-size: 21px !important; }
  .slide-lead { font-size: 11px !important; }
  .slide-header { margin-bottom: 9px !important; padding-left: 50px !important; }
  .phase-h { margin: 8px 0 5px !important; font-size: 13.5px !important; padding: 8px 14px !important; }
  .exec-grid, .tech-grid, .kpi-grid, .pestel, .swot, .align-grid, .pillars4, .impact-grid, .spec-row { gap: 7px !important; }
  .exec-card, .tech-card, .pillar-policy, .impact-card, .swot-quad { padding: 11px !important; }
  .exec-card p, .tech-card p, .pillar-policy p, .kpi-d, .swot-quad li, .impact-card p { font-size: 10.5px !important; }
  .exec-ico, .t-ico { width: 38px !important; height: 38px !important; font-size: 20px !important; margin-bottom: 8px !important; }
  .budget-table td, .risk-table td, .budget-table th, .risk-table th { padding: 6px 9px !important; font-size: 10px !important; }
  .calc { grid-template-columns: 1fr 1fr !important; gap: 10px !important; padding: 10px !important; }
  .calc-inputs { gap: 9px !important; }
  .last-call, .change-strat { padding: 14px !important; }
  .callout { padding: 10px 14px !important; margin: 8px 0 !important; }
  .check-list { gap: 7px !important; }
  .check-list li { padding: 8px 12px 8px 36px !important; font-size: 10.5px !important; }
  .closing-quote { padding: 12px 16px 12px 52px !important; font-size: 11.5px !important; }
  .recos { gap: 7px !important; }
  .recos li { padding: 8px 14px 8px 44px !important; font-size: 10.5px !important; }
  .budget-tier-grid { margin-bottom: 9px !important; }
  .budget-tier { padding: 9px 12px !important; }
  .bt-amount { font-size: 20px !important; margin-bottom: 2px !important; }
  .bt-label { margin-bottom: 4px !important; }
  .budget-context { padding: 8px 12px !important; font-size: 10px !important; margin-bottom: 8px !important; }
  .kpi { padding: 13px 14px !important; }
  .kpi-n { font-size: 26px !important; }
  .flow-steps { gap: 8px !important; }
  .flow-steps li { padding: 9px 12px 9px 48px !important; }
  .spec { padding: 10px !important; }
  .team-block { padding: 10px 12px !important; }
  .cover-pillars { gap: 7px !important; }
  .pillar-card { padding: 10px 8px !important; }
}
