/* ============================================================
   ECUThai — ระบบดีไซน์
   Amber #FFB627 บนกราไฟต์ #0F1115 — ต่อยอดจากไฟเช็คเอนจิ้นในโลโก้เดิม
   อารมณ์: ห้องแล็บอิเล็กทรอนิกส์ / เครื่องมือวัด / แผงวงจร
   ============================================================ */

/* ---------- fonts (self-host, แยก subset ไทย/ละติน ตาม unicode-range)
   สร้างอัตโนมัติด้วย build/fetch_fonts.py — เบราว์เซอร์โหลดเฉพาะชุดที่ใช้จริง
   ---------- */
@font-face {
  font-family: 'Plex Thai';
  src: url('/assets/fonts/plex-thai-400-thai.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Plex Thai';
  src: url('/assets/fonts/plex-thai-400-latin.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plex Thai';
  src: url('/assets/fonts/plex-thai-600-thai.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Plex Thai';
  src: url('/assets/fonts/plex-thai-600-latin.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plex Thai';
  src: url('/assets/fonts/plex-thai-700-thai.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Plex Thai';
  src: url('/assets/fonts/plex-thai-700-latin.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/assets/fonts/plex-mono-500-latin.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */
:root {
  --bg:        #0F1115;
  --surface:   #171A21;
  --card:      #1E222B;
  --card-2:    #2A2E37;
  --text:      #FFFFFF;
  --muted:     #A8AEBA;
  --muted-dim: #767D8C;
  --accent:    #FFB627;
  --accent-lo: #C98A12;
  --accent-ink:#0F1115;
  --paper:     #F7F8FA;
  --paper-2:   #ECEEF2;
  --ink:       #14161A;
  --ink-muted: #5A616E;
  --line:      rgba(255,255,255,.10);
  --line-2:    rgba(255,255,255,.16);
  --line-ink:  rgba(20,22,26,.12);
  --trace:     rgba(255,182,39,.30);
  --ok:        #4ADE80;
  --warn:      #FFB627;

  --sans: 'Plex Thai', 'IBM Plex Sans Thai', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Plex Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  --wrap: 1140px;
  --wrap-narrow: 760px;
  --r: 14px;
  --r-sm: 9px;

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  /* ไทยต้องการขนาดใหญ่กว่าละตินนิดหน่อย และ line-height สูงเพราะมีสระบน-ล่าง */
  font-size: 17px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, picture { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.32; font-weight: 700; letter-spacing: -.005em; }
p, ul, ol { margin: 0; }
ul, ol { padding-left: 1.15em; }
button { font: inherit; }

/* โฟกัสต้องเห็นชัดเสมอ — เว็บเดิมบล็อกการซูมและไม่มี focus ring เลย */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: var(--wrap-narrow); }
.section { padding-block: var(--s9); }
.section-sm { padding-block: var(--s8); }
.paper { background: var(--paper); color: var(--ink); }
.paper .lead, .paper .muted { color: var(--ink-muted); }
.paper a { color: #9A6A00; }
.surface { background: var(--surface); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 12px 20px; font-weight: 700; border-radius: 0 0 var(--r-sm) 0;
}
.skip:focus { left: 0; }

/* ---------- typography ---------- */
.h-xl { font-size: clamp(2rem, 1.35rem + 2.7vw, 3.4rem); line-height: 1.24; }
.h-lg { font-size: clamp(1.65rem, 1.25rem + 1.6vw, 2.4rem); }
.h-md { font-size: clamp(1.3rem, 1.12rem + .7vw, 1.6rem); }
.h-sm { font-size: 1.14rem; }
.lead { font-size: 1.09rem; color: var(--muted); line-height: 1.8; }
.muted { color: var(--muted); }
.tiny { font-size: .87rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-weight: 500; }

/* ป้ายหมวดแบบเครื่องมือวัด — ตัวพิมพ์เล็ก mono มีขีดนำหน้า */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .78rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: ""; width: 26px; height: 2px; background: var(--accent); flex: none;
}
.paper .eyebrow { color: #9A6A00; }
.paper .eyebrow::before { background: #9A6A00; }

/* ---------- ชิปโค้ด DTC — ลายเซ็นของเว็บนี้ ---------- */
.dtc {
  display: inline-block;
  font-family: var(--mono); font-size: .82rem; font-weight: 500;
  color: var(--accent);
  background: rgba(255,182,39,.09);
  border: 1px solid rgba(255,182,39,.34);
  border-radius: 5px;
  padding: 2px 9px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.paper .dtc { color: #8A5D00; background: rgba(255,182,39,.16); border-color: rgba(154,106,0,.35); }
.dtc-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700; font-size: 1.02rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #FFC750; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.paper .btn-ghost { color: var(--ink); border-color: var(--line-ink); }
.paper .btn-ghost:hover { border-color: #9A6A00; color: #9A6A00; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }
.btn svg { width: 19px; height: 19px; flex: none; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,17,21,.90);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.hdr-in { display: flex; align-items: center; gap: var(--s5); min-height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.12; }
.brand-name { font-weight: 700; font-size: 1.16rem; letter-spacing: -.01em; }
.brand-sub {
  font-family: var(--mono); font-size: .63rem; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; color: var(--accent);
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
/* :not(.btn) สำคัญ — ถ้าไม่ใส่ กฎนี้ (0-1-1) จะชนะ .btn-primary (0-1-0)
   แล้วปุ่มโทรในเมนูจะกลายเป็นตัวอักษรสีเทาบนพื้นอำพัน อ่านแทบไม่ออก */
.nav a:not(.btn) {
  text-decoration: none; color: var(--muted);
  padding: 9px 13px; border-radius: var(--r-sm);
  font-size: .96rem; font-weight: 600;
  transition: color .15s, background .15s;
}
.nav a:not(.btn):hover { color: var(--text); background: rgba(255,255,255,.055); }
.nav a[aria-current="page"] { color: var(--accent); }
.hdr .btn { padding: 10px 19px; font-size: .95rem; }
.nav-toggle {
  display: none; margin-left: auto;
  background: transparent; border: 1px solid var(--line-2);
  color: var(--text); border-radius: var(--r-sm);
  padding: 9px 12px; cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 1000px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px 18px;
    max-height: calc(100vh - 70px); overflow-y: auto;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 1rem; }
  .nav .btn { margin-top: 8px; justify-content: center; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(56px, 8vw, 104px) var(--s9); }
/* แสงเรืองไฟเช็คเอนจิ้น — ล้อโลโก้เดิมที่เป็นไอคอนเครื่องยนต์สีเหลืองเรืองบนพื้นดำ */
.hero::before {
  content: ""; position: absolute; inset: -30% 0 auto 0; height: 620px;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(255,182,39,.15), transparent 68%);
  pointer-events: none;
}
/* ลายเส้นแผงวงจรจางๆ เป็นพื้นหลัง */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 72%);
}
.hero > * { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: var(--s8); align-items: center; }
.hero h1 { margin-block: var(--s4) var(--s5); }
.hero .lead { max-width: 54ch; }
.hero .btn-row { margin-top: var(--s6); }
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s7); }
}

/* ---------- แถบสถิติแบบหน้าปัดเครื่องมือวัด ---------- */
.gauges {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; margin-top: var(--s7);
}
.gauge { background: var(--bg); padding: 20px 18px; position: relative; }
/* ขีดสเกลเล็กๆ ด้านบนแต่ละช่อง เหมือนหน้าปัดวัด */
.gauge::before {
  content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 5px;
  background-image: repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 7px);
}
.gauge-n { font-family: var(--mono); font-size: 1.85rem; font-weight: 500; color: var(--accent); line-height: 1.1; }
.gauge-l { font-size: .84rem; color: var(--muted); margin-top: 5px; line-height: 1.45; }
@media (max-width: 720px) { .gauges { grid-template-columns: repeat(2, 1fr); } }

/* ---------- การ์ด + จุด node มุมแบบแผงวงจร ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s5);
}
.card-link { text-decoration: none; display: block; transition: border-color .18s, transform .18s, background .18s; }
.card-link:hover { border-color: var(--trace); transform: translateY(-3px); background: var(--card-2); }
/* node สองมุมทแยง — รายละเอียดเล็กๆ ที่ทำให้ดูเป็นแผงวงจร ไม่ใช่การ์ด bootstrap */
.card-node::before, .card-node::after {
  content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--trace);
}
.card-node::before { top: 11px; left: 11px; }
.card-node::after  { bottom: 11px; right: 11px; }

.card h3 { margin-bottom: var(--s2); font-size: 1.09rem; }
.card p { color: var(--muted); font-size: .96rem; line-height: 1.72; }
.paper .card { background: #fff; border-color: var(--line-ink); }
.paper .card p { color: var(--ink-muted); }
.paper .card-link:hover { border-color: #C98A12; background: #fff; }

.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 940px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* หัวข้อส่วน */
.sec-head { margin-bottom: var(--s6); }
.sec-head h2 { margin-block: var(--s3) var(--s3); }
.sec-head .lead { max-width: 62ch; }
.sec-head.center .lead { margin-inline: auto; }

/* ---------- กรอบตรวจสอบ (รูปงานจริง) ---------- */
.shot {
  position: relative; border-radius: var(--r); overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
}
.shot img { width: 100%; aspect-ratio: 840/464; object-fit: cover; }
/* วงเล็บมุมอำพัน เหมือนกรอบเล็งของเครื่องมือวัด */
.shot-frame { position: relative; }
.shot-frame::before, .shot-frame::after {
  content: ""; position: absolute; width: 26px; height: 26px; pointer-events: none; z-index: 2;
}
.shot-frame::before { top: 9px; left: 9px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.shot-frame::after { bottom: 9px; right: 9px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.shot-cap {
  padding: 13px 16px; font-size: .91rem; color: var(--muted);
  border-top: 1px solid var(--line); background: var(--surface);
}
.shot-cap strong { color: var(--text); font-weight: 600; }

/* ---------- รายการขั้นตอน (เลข mono + เส้นเชื่อม) ---------- */
.steps { list-style: none; padding: 0; display: grid; gap: var(--s4); counter-reset: st; }
.steps li {
  position: relative; padding-left: 62px; counter-increment: st;
}
.steps li::before {
  content: counter(st, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: .92rem; font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--trace);
  background: rgba(255,182,39,.07);
}
/* เส้นเชื่อมระหว่างขั้น — เหมือนเส้นวงจร */
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 21px; top: 46px; bottom: -20px;
  width: 1px; background: linear-gradient(var(--trace), transparent);
}
.steps h3 { font-size: 1.06rem; margin-bottom: 4px; }
.steps p { color: var(--muted); font-size: .96rem; }
.paper .steps li::before { color: #8A5D00; border-color: rgba(154,106,0,.4); background: rgba(255,182,39,.14); }
.paper .steps p { color: var(--ink-muted); }

/* ---------- เนื้อหาบทความ ---------- */
.prose > * + * { margin-top: var(--s4); }
.prose h2 { font-size: clamp(1.35rem, 1.15rem + .8vw, 1.75rem); margin-top: var(--s7); }
.prose h3 { font-size: 1.17rem; margin-top: var(--s6); }
.prose ul, .prose ol { display: grid; gap: 9px; }
.prose li { line-height: 1.75; }
.prose li::marker { color: var(--accent); }
.paper .prose li::marker { color: #9A6A00; }
.prose strong { font-weight: 600; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* กล่องเน้น */
.note {
  border-left: 3px solid var(--accent);
  background: rgba(255,182,39,.06);
  padding: var(--s4) var(--s5);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.paper .note { background: rgba(255,182,39,.13); }
.note p { margin: 0; }

/* ตารางเช็คลิสต์อาการ */
.symptoms { list-style: none; padding: 0; display: grid; gap: 10px; }
.symptoms li { position: relative; padding-left: 30px; line-height: 1.7; }
.symptoms li::before {
  content: ""; position: absolute; left: 4px; top: .66em;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(255,182,39,.16);
}

/* ---------- FAQ (details เนทีฟ ไม่ใช้ JS) ---------- */
.faq { display: grid; gap: var(--s3); }
.faq details {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); overflow: hidden;
}
.paper .faq details { background: #fff; border-color: var(--line-ink); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 18px var(--s5); padding-right: 54px;
  font-weight: 600; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%;
  width: 11px; height: 11px; margin-top: -6px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq summary:hover { color: var(--accent); }
.faq-a { padding: 0 var(--s5) var(--s5); color: var(--muted); }
.paper .faq-a { color: var(--ink-muted); }
.faq-a > * + * { margin-top: var(--s3); }

/* ---------- breadcrumb ---------- */
.crumb { padding-block: var(--s4); border-bottom: 1px solid var(--line); background: var(--surface); }
.crumb ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: .87rem; color: var(--muted-dim);
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.crumb li + li::before { content: "/"; margin-right: 8px; color: var(--muted-dim); opacity: .55; }
.crumb [aria-current] { color: var(--text); }

/* ---------- หัวหน้าเพจย่อย ---------- */
.phead { position: relative; padding-block: var(--s8) var(--s7); overflow: hidden; }
.phead::before {
  content: ""; position: absolute; inset: -60% 0 auto 0; height: 420px;
  background: radial-gradient(ellipse 50% 100% at 30% 0%, rgba(255,182,39,.11), transparent 70%);
  pointer-events: none;
}
.phead > * { position: relative; }
.phead h1 { margin-block: var(--s4) var(--s4); }
.phead .lead { max-width: 66ch; }

/* ---------- ชิปยี่ห้อรถ (แทนรูปโลโก้เดิม 582KB ที่ความละเอียดต่ำ) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex; align-items: center;
  padding: 9px 17px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card);
  font-size: .93rem; font-weight: 600; color: var(--muted);
  text-decoration: none; transition: all .16s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--card-2); }
.paper .chip { background: #fff; border-color: var(--line-ink); color: var(--ink-muted); }
.paper .chip:hover { border-color: #C98A12; color: #8A5D00; }

/* ---------- แถบ CTA ---------- */
.cta {
  position: relative; overflow: hidden;
  border: 1px solid var(--trace); border-radius: var(--r);
  background: linear-gradient(135deg, rgba(255,182,39,.10), rgba(255,182,39,.02));
  padding: var(--s7);
  text-align: center;
}
.cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image:
    linear-gradient(rgba(255,182,39,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,182,39,.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 60% 80% at 50% 50%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 50% 50%, #000, transparent 75%);
}
.cta > * { position: relative; }
.cta h2 { margin-bottom: var(--s3); }
.cta .lead { max-width: 52ch; margin-inline: auto; }
.cta .btn-row { justify-content: center; margin-top: var(--s5); }
.cta-phone {
  display: inline-block; margin-top: var(--s4);
  font-family: var(--mono); font-size: 1.5rem; font-weight: 500;
  color: var(--accent); text-decoration: none; letter-spacing: .01em;
}

/* ---------- ลิงก์ที่เกี่ยวข้อง (แกน SEO internal linking) ---------- */
.rel { display: grid; gap: var(--s3); }
.rel a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: 15px var(--s5);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); text-decoration: none;
  transition: all .16s;
}
.rel a:hover { border-color: var(--trace); background: var(--card-2); }
.rel-t { font-weight: 600; }
.rel-d { font-size: .89rem; color: var(--muted); margin-top: 2px; }
.rel-arrow { color: var(--accent); flex: none; font-family: var(--mono); }
.paper .rel a { background: #fff; border-color: var(--line-ink); }
.paper .rel-d { color: var(--ink-muted); }

/* ---------- footer ---------- */
.ftr { background: #0A0C0F; border-top: 1px solid var(--line); padding-block: var(--s8) var(--s6); }
.ftr-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: var(--s6); }
@media (max-width: 940px) { .ftr-grid { grid-template-columns: 1fr 1fr; gap: var(--s6); } }
@media (max-width: 560px) { .ftr-grid { grid-template-columns: 1fr; } }
.ftr h3 {
  font-family: var(--mono); font-size: .76rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--s4);
}
.ftr ul { list-style: none; padding: 0; display: grid; gap: 9px; }
.ftr a { color: var(--muted); text-decoration: none; font-size: .94rem; }
.ftr a:hover { color: var(--accent); }
.ftr p { color: var(--muted); font-size: .94rem; }
.ftr-bot {
  margin-top: var(--s7); padding-top: var(--s5);
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between;
  color: var(--muted-dim); font-size: .87rem;
}
.ftr-nap { font-style: normal; color: var(--muted); font-size: .94rem; line-height: 1.8; }
.ftr-nap a { color: var(--accent); }

/* ---------- แถบติดต่อล่างจอ (มือถือ) ---------- */
.dock {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(15,17,21,.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  gap: 10px;
}
.dock .btn { flex: 1; padding: 13px 12px; font-size: .97rem; }
@media (max-width: 780px) {
  .dock { display: flex; }
  body { padding-bottom: 78px; }
}

/* ---------- utilities ---------- */
.stack-4 > * + * { margin-top: var(--s4); }
.stack-5 > * + * { margin-top: var(--s5); }
.stack-6 > * + * { margin-top: var(--s6); }
.mt-5 { margin-top: var(--s5); }
.mt-6 { margin-top: var(--s6); }
.mt-7 { margin-top: var(--s7); }
.hr { height: 1px; background: var(--line); border: 0; margin-block: var(--s7); }
.paper .hr { background: var(--line-ink); }
