:root {
  --brand: #00796e;
  --brand-dark: #005a52;
  --brand-bright: #00d0b4;
  --brand-tint: #e8f7f5;
  --line-green: #06c755;
  --ink: #1d2b2a;
  --muted: #55625f;
  --border: #d9e6e3;
  --bg: #ffffff;
  --bg-alt: #f4faf9;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 6px 20px rgb(0 60 55 / 0.07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Noto Sans Thai', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.35; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
svg { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; z-index: 50; }

/* ---------- หัวเว็บ ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgb(255 255 255 / 0.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(6px); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 84px; padding-top: 10px; padding-bottom: 10px; }
/* โลโก้ห้ามหดเมื่อเมนูยาว */
.brand { flex: none; display: block; line-height: 0; }
.brand img { width: 128px; height: auto; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.header-call { flex: none; white-space: nowrap; }
.nav a:hover, .nav a[aria-current] { color: var(--brand); }
.header-call { padding: 8px 16px; }

.mobile-menu { display: none; margin-left: auto; position: relative; }
.mobile-menu summary { list-style: none; cursor: pointer; padding: 10px; display: grid; gap: 5px; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary span { display: block; width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }
.mobile-menu ul { position: absolute; right: 0; top: 100%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); list-style: none; margin: 4px 0 0; padding: 8px; min-width: 220px; }
.mobile-menu a { display: block; padding: 10px 12px; color: var(--ink); text-decoration: none; font-weight: 600; border-radius: 8px; }
.mobile-menu a:hover { background: var(--brand-tint); }

/* ---------- ปุ่ม ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 700; text-decoration: none; font-size: 1rem; line-height: 1.2; border: 2px solid transparent; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-line { background: var(--line-green); color: #fff; }
.btn-line:hover { filter: brightness(0.93); }
.btn-outline { border-color: var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand-tint); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 20px; }
.text-link { font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- หน้าแรก ---------- */
.hero { background: linear-gradient(180deg, var(--brand-tint), #fff); padding: 48px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.nw { white-space: nowrap; }
.hero h1 .sub { display: block; color: var(--brand); font-size: 0.72em; margin-top: 6px; }
.lead { font-size: 1.1rem; color: var(--muted); }
.hero-img img { border-radius: 20px; box-shadow: var(--shadow); }
.facts { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.facts li { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; font-size: 0.85rem; color: var(--muted); line-height: 1.4; }
.facts strong { display: block; color: var(--brand); font-size: 1.35rem; }

.section { padding: 56px 0; scroll-margin-top: 70px; }
.section.alt { background: var(--bg-alt); }
.section-lead { color: var(--muted); max-width: 680px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.two-col.top { align-items: start; }
.rounded { border-radius: 18px; box-shadow: var(--shadow); }

/* การ์ดเลือกสาขาในหน้าแรก */
.branch-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0 20px; }
.pick { background: #fff; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pick-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pick h3 { margin: 0; font-size: 1.2rem; }
.pick h3 a { color: var(--ink); text-decoration: none; }
.pick-note { display: flex; gap: 6px; align-items: flex-start; color: var(--muted); margin: 0; font-size: 0.95rem; }
.pick-note svg { margin-top: 4px; color: var(--brand); }
.pick-hours { margin: 0; font-weight: 600; color: var(--brand-dark); font-size: 0.95rem; }
.pick-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }
.pick-actions .btn { padding: 10px 18px; }
.hours-line { display: flex; gap: 6px; align-items: flex-start; color: var(--brand-dark); font-weight: 600; }
.hours-line svg { margin-top: 5px; }
.checks.two-up { grid-template-columns: 1fr 1fr; gap: 18px 32px; }
.gallery { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gallery img { border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

.service-grid { list-style: none; padding: 0; margin: 24px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.service-card { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s; }
.service-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.service-name { font-weight: 700; font-size: 1.15rem; color: var(--brand-dark); }
.service-summary { color: var(--muted); font-size: 0.93rem; flex: 1; }
.service-price { font-weight: 700; color: var(--brand); }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checks li { padding-left: 34px; position: relative; }
.checks li::before { content: ''; position: absolute; left: 0; top: 5px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z' fill='%2300796e'/%3E%3C/svg%3E") center/16px no-repeat; }
.checks strong { display: block; }

.doctor-grid { list-style: none; padding: 0; margin: 24px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.doctor img { border-radius: var(--radius); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; background: var(--bg-alt); margin-bottom: 10px; }
.doctor p { margin: 0; line-height: 1.45; }
.doctor-name { font-weight: 700; }
.doctor-field { color: var(--brand-dark); font-size: 0.92rem; }
.doctor-license { color: var(--muted); font-size: 0.85rem; }
.doctor-edu { list-style: none; padding: 0; margin: 4px 0; font-size: 0.85rem; line-height: 1.45; color: var(--ink); }
.doctor-edu li { padding-left: 12px; position: relative; margin-bottom: 2px; }
.doctor-edu li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-bright); }
.doctor { scroll-margin-top: 80px; }
.doctor-name a { color: inherit; text-decoration: none; }
.doctor-name a:hover { color: var(--brand); }
.text-link.small { font-size: 0.85rem; }

/* หน้าโปรไฟล์ทันตแพทย์ */
.expertise { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.expertise a, .expertise span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-weight: 600; color: var(--brand-dark); text-decoration: none; }
.expertise a::after { content: '→'; color: var(--brand); }
.expertise a:hover { border-color: var(--brand); }
.profile-grid { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }
.profile-photo { border-radius: 18px; box-shadow: var(--shadow); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
.profile-role { font-size: 1.15rem; font-weight: 700; color: var(--brand); margin-top: -0.4em; }
.profile-quote { margin: 0 0 20px; padding: 12px 18px; border-left: 4px solid var(--brand-bright); background: #fff; border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; }
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; gap: 20px; }
  .profile-photo { max-width: 240px; }
}
.verify-link { display: inline-block; margin-top: 2px; font-size: 0.78rem; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.verify-link:hover { color: var(--brand); }

.branch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.branch { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.branch p { margin-bottom: 0.5em; }

.cta-block { background: var(--brand); color: #fff; padding: 48px 0; text-align: center; }
.cta-block p { opacity: 0.92; }
.cta-block .cta-row { justify-content: center; }
.cta-block .btn-primary { background: #fff; color: var(--brand-dark); }

/* ---------- หน้าย่อย ---------- */
.page-head { padding-top: 28px; padding-bottom: 12px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; font-size: 0.88rem; color: var(--muted); }
.crumbs li + li::before { content: '›'; margin-right: 6px; }
.crumbs a { color: var(--muted); }

.prices { width: 100%; border-collapse: collapse; margin: 8px 0 18px; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.prices th, .prices td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prices th { background: var(--brand-tint); font-size: 0.9rem; }
.prices td:last-child, .prices th:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.prices tr:last-child td { border-bottom: 0; }
.note { color: var(--muted); font-size: 0.9rem; }
.verify-box { background: var(--brand-tint); border-radius: var(--radius); padding: 18px 20px; margin: 8px 0 16px; }
.verify-box p { margin: 0 0 0.4em; }
.verify-box p:last-child { margin: 0; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 0.9rem; }

.faq { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 18px; margin-bottom: 10px; background: #fff; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style-position: inside; }
.faq p { margin: 0 0 14px; color: var(--muted); }

.chip-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chip-list a { display: inline-block; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; font-weight: 600; background: #fff; }
.chip-list a:hover { border-color: var(--brand); }

.info { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 20px; }
.info dt { font-weight: 700; color: var(--muted); }
.info dd { margin: 0; }
.map { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--bg-alt); }
.prose h2 { margin-top: 1.4em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.35em; }
.prose table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--brand-tint); }
.article-body { font-size: 1.05rem; }
.article-cat { display: inline-block; font-size: 0.8rem; font-weight: 700; color: var(--brand); background: var(--brand-tint); padding: 2px 10px; border-radius: 999px; margin-bottom: 6px; }
.service-card .article-cat { align-self: flex-start; margin-bottom: 0; }
.byline { color: var(--muted); font-size: 0.9rem; }

/* ---------- ท้ายเว็บ ---------- */
.site-footer { background: #10302d; color: #cfe3df; padding: 44px 0 90px; font-size: 0.93rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; }
.footer-brand, .footer-title { color: #fff; font-weight: 700; font-size: 1.05rem; }
.copyright { margin-top: 24px; opacity: 0.7; font-size: 0.85rem; }

.action-bar { display: none; }

/* ---------- มือถือ ---------- */
/* เมนูเต็มต้องการพื้นที่ประมาณ 1,060px — แคบกว่านั้นใช้ปุ่มเมนูแทน */
@media (max-width: 1080px) {
  .nav { display: none; }
  .mobile-menu { display: block; margin-left: 0; }
  .header-call { margin-left: auto; }
}
@media (max-width: 900px) {
  .nav, .header-call { display: none; }
  .mobile-menu { display: block; margin-left: auto; }
  .header-row { min-height: 72px; padding-top: 8px; padding-bottom: 8px; }
  .brand img { width: 112px; }
  .hero { padding-top: 28px; }
  .hero-grid, .two-col, .branch-grid, .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-img { order: -1; }
  .service-grid { grid-template-columns: 1fr 1fr; }
  .doctor-grid { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 40px 0; }
  .action-bar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgb(0 0 0 / 0.06); padding-bottom: env(safe-area-inset-bottom); }
  .action-bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; text-decoration: none; font-weight: 700; font-size: 0.85rem; color: var(--brand-dark); }
  .action-bar.four { grid-template-columns: repeat(4, 1fr); }
  .action-bar a.line { color: var(--line-green); }
  .branch-pick, .checks.two-up { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .action-bar svg { width: 22px; height: 22px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .service-grid { grid-template-columns: 1fr; }
  .doctor-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .facts { grid-template-columns: 1fr 1fr; gap: 8px; }
  .facts li { padding: 10px 8px; font-size: 0.78rem; }
  .facts strong { font-size: 1.1rem; }
  .cta-row .btn { flex: 1 1 100%; justify-content: center; }
}
.profile-grid + * .doctor-edu, .section .two-col .doctor-edu { font-size: 1rem; }
