@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Jost:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Manrope:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: clamp(15px, 0.4vw + 14px, 16.5px);
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.18; margin: 0 0 0.6em; color: var(--ink); letter-spacing: var(--head-track, normal); }
h1 { font-size: clamp(2rem, 3.4vw + 1rem, 3.4rem); }
h2 { font-size: clamp(1.5rem, 1.8vw + 0.9rem, 2.2rem); }
h3 { font-size: clamp(1.12rem, 0.7vw + 0.9rem, 1.35rem); }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: min(1120px, calc(100% - 2.5rem)); margin-inline: auto; }
.section { padding-block: clamp(3rem, 6vw, 5.5rem); }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin-bottom: clamp(1.8rem, 3vw, 2.8rem); }
.section-kicker {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--primary); background: var(--primary-light);
  padding: 0.35em 0.95em; border-radius: var(--radius-pill); margin-bottom: 0.9rem;
}
.section-sub { color: var(--ink-soft); margin: 0; }
.section-head-center { margin-inline: auto; text-align: center; }

/* ------------------------------- header ---------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-head); font-weight: 700; font-size: 1.18rem; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand img { width: 38px; height: 38px; object-fit: contain; border-radius: 10px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--hero-gradient); color: var(--on-primary); font-size: 1.05rem;
}
.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 0.55rem 0.85rem; border-radius: var(--radius);
  color: var(--ink-soft); font-weight: 500; font-size: 0.95rem;
}
.nav-link:hover { color: var(--primary); background: var(--soft); }
.nav-link[aria-current="page"] { color: var(--primary); background: var(--primary-light); }
.nav-cta { margin-left: 0.75rem; white-space: nowrap; }
.nav-toggle {
  display: none; place-items: center; width: 44px; height: 44px;
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--ink); cursor: pointer;
}

/* -------------------------------- buttons -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.72em 1.45em; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.95rem; line-height: 1.2; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); color: var(--on-primary); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); color: var(--primary-dark); }
.btn-ghost { background: var(--soft); color: var(--ink); }
.btn-ghost:hover { background: var(--border); color: var(--ink); }
.btn-sm { padding: 0.45em 1em; font-size: 0.86rem; }
.btn-block { width: 100%; }

.badge {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--accent-light); color: var(--ink-soft);
  border-radius: var(--radius-pill); padding: 0.3em 0.8em;
}
.tag {
  display: inline-block; font-size: 0.78rem; font-weight: 500;
  color: var(--primary); background: var(--primary-light);
  padding: 0.22em 0.7em; border-radius: var(--radius-pill);
}

/* --------------------------------- hero ---------------------------------- */
.hero { position: relative; overflow: hidden; background: var(--hero-gradient); color: var(--hero-text); }
.hero-inner {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 4vw, 4rem);
  align-items: center; padding-block: clamp(3.5rem, 7vw, 6.5rem);
}
.hero h1 { color: var(--hero-text); }
.hero-copy p { color: var(--hero-text); opacity: 0.92; font-size: 1.06rem; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
.hero-media { position: relative; }
.hero-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.hero-badge {
  position: absolute; left: -14px; bottom: 22px;
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 0.7rem 1rem; font-size: 0.85rem; display: flex; gap: 0.55rem; align-items: center;
}
.hero-badge .icon { color: var(--primary); }

.hero-carousel { position: relative; }
.hero-slide { display: none; }
.hero-slide.on { display: block; animation: heroFade .6s ease; }
@keyframes heroFade { from { opacity: 0; } to { opacity: 1; } }
.hero-dots { position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.45rem; z-index: 3; }
.hero-dot { width: 26px; height: 5px; border-radius: 99px; border: 0; cursor: pointer; background: rgba(255,255,255,.35); padding: 0; }
.hero-dot.on { background: #fff; }

/* -------------------------------- sections/cards -------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 1.4rem; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 1.15rem 1.25rem 1.3rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.card-title { font-size: 1.08rem; margin: 0; }
.card-title a { color: var(--ink); }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-meta { color: var(--ink-faint); font-size: 0.85rem; }
.card-summary { color: var(--ink-soft); font-size: 0.93rem; margin: 0; }
.card-foot { margin-top: auto; padding-top: 0.8rem; display: flex; align-items: center; justify-content: space-between; }
.price-tag { font-weight: 700; color: var(--primary); font-size: 1.02rem; white-space: nowrap; }
.price-tag small { font-weight: 500; color: var(--ink-faint); font-size: 0.74rem; }
.card-link-label { font-size: 0.88rem; font-weight: 600; color: var(--primary); }

.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 1.6rem; }
.chip {
  padding: 0.48em 1.15em; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-soft); font-size: 0.9rem; font-weight: 500;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ------------------------------ stats band ------------------------------- */
.stat-band { background: var(--bg-alt); border-block: 1px solid var(--border); }
.stat-band-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; padding-block: 2.2rem; text-align: center; }
.stat-item strong { display: block; font-family: var(--font-head); font-size: clamp(1.7rem, 2.5vw, 2.4rem); color: var(--primary); }
.stat-item span { color: var(--ink-soft); font-size: 0.88rem; }

/* ------------------------------ doctor cards ----------------------------- */
.doctor-card { text-align: center; }
.doctor-card .card-media { aspect-ratio: 1; border-radius: 50% !important; width: min(170px, 60%); margin: 1.4rem auto 0; border: 3px solid var(--primary-light); }
.doctor-portrait-fallback { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-size: 2rem; color: var(--primary); background: var(--primary-light); }
.doctor-exp { color: var(--primary); font-size: 0.84rem; font-weight: 600; }

/* --------------------------- before/after slider ------------------------- */
.ba-wrap { position: relative; overflow: hidden; border-radius: var(--radius); user-select: none; touch-action: pan-y; background: var(--soft); }
.ba-wrap img { width: 100%; display: block; pointer-events: none; }
.ba-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--ba-pos, 50%)); }
.ba-after img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.ba-divider { position: absolute; top: 0; bottom: 0; left: var(--ba-pos, 50%); width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.18); cursor: ew-resize; }
.ba-handle {
  position: absolute; top: 50%; left: var(--ba-pos, 50%);
  transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; color: var(--ink); border: 0; cursor: ew-resize;
  display: grid; place-items: center; box-shadow: var(--shadow-md);
  font-size: 13px; letter-spacing: -2px;
}
.ba-label { position: absolute; top: 10px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; background: rgba(0,0,0,.55); color: #fff; border-radius: var(--radius-pill); padding: 0.25em 0.75em; pointer-events: none; }
.ba-label-before { left: 10px; }
.ba-label-after { right: 10px; }
.ba-placeholder { aspect-ratio: 4/3; display: grid; place-items: center; color: var(--ink-faint); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.ba-placeholder.before { background: repeating-linear-gradient(135deg, var(--soft) 0 12px, var(--border) 12px 24px); }
.ba-placeholder.after { background: linear-gradient(135deg, var(--primary-light), var(--accent-light)); color: var(--primary-dark, var(--primary)); }
.case-card figcaption { padding: 1rem 1.2rem 1.2rem; }
.case-concern { font-size: 0.8rem; color: var(--primary); font-weight: 600; }

/* ------------------------------ detail pages ------------------------------ */
.detail-hero { display: grid; grid-template-columns: 1fr 0.85fr; gap: clamp(1.6rem, 3.5vw, 3.4rem); align-items: start; }
.detail-cover { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); background: var(--soft); }
.spec-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 1.2rem 0; }
.spec-table th, .spec-table td { text-align: left; padding: 0.65rem 1rem; font-size: 0.92rem; border-top: 1px solid var(--border); }
.spec-table tr:first-child th, .spec-table tr:first-child td { border-top: 0; }
.spec-table th { color: var(--ink-faint); font-weight: 500; width: 42%; }
.rich-body { color: var(--ink-soft); }
.rich-body h2 { color: var(--ink); margin-top: 1.6em; }
.rich-body ul, .rich-body ol { padding-left: 1.3em; }
.rich-body li { margin-bottom: 0.4em; }
.rich-body blockquote {
  margin: 1.4em 0; padding: 0.9em 1.3em;
  border-left: 3px solid var(--primary); background: var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink);
}

.gallery-main { border-radius: var(--radius-lg); overflow: hidden; background: var(--soft); margin-bottom: 0.7rem; }
.gallery-main img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.gallery-thumb { width: 76px; height: 60px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--soft); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.on { border-color: var(--primary); }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 1.2rem; }
.breadcrumb a { color: var(--ink-faint); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: 0.6; }

/* ------------------------------- testimonials ---------------------------- */
.quote-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem 1.6rem; }
.quote-card .icon-quote { position: absolute; top: 1.1rem; right: 1.3rem; color: var(--primary-light); width: 34px; height: 34px; }
.quote-card blockquote { margin: 0 0 1rem; color: var(--ink); font-style: italic; }
.stars { color: var(--accent); letter-spacing: 2px; font-size: 0.9rem; display: inline-flex; gap: 1px; }
.quote-by { display: flex; align-items: center; gap: 0.7rem; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; }
.quote-name { font-weight: 600; font-size: 0.94rem; }
.quote-city { color: var(--ink-faint); font-size: 0.82rem; }

/* ---------------------------------- faq ---------------------------------- */
.faq-list { display: grid; gap: 0.8rem; max-width: 800px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1rem 1.3rem;
  font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { transition: transform .2s ease; color: var(--primary); }
.faq-item[open] summary .chev { transform: rotate(180deg); }
.faq-answer { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); }
.faq-answer p:last-child { margin-bottom: 0; }

.notice-banner { background: var(--accent-light); border: 1px dashed var(--accent); border-radius: var(--radius); padding: 0.8rem 1.2rem; font-size: 0.92rem; color: var(--ink-soft); display: flex; gap: 0.6rem; align-items: baseline; }
.notice-banner strong { color: var(--ink); }

/* --------------------------------- forms ---------------------------------- */
.form { display: grid; gap: 1.05rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.05rem; }
.form-field { display: grid; gap: 0.35rem; }
.form-label { font-weight: 600; font-size: 0.9rem; }
.form-label .req { color: var(--primary); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.7em 0.95em;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 0.95rem;
}
.form-textarea { resize: vertical; min-height: 110px; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--primary); }
.form-hint { color: var(--ink-faint); font-size: 0.82rem; }
.form-check { display: flex; gap: 0.6rem; align-items: flex-start; }
.form-check input[type="checkbox"] { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--primary); flex: none; }
.consent-note { font-size: 0.82rem; color: var(--ink-faint); }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.flash-ok { background: var(--accent-light); border: 1px solid var(--accent); color: var(--ink); border-radius: var(--radius); padding: 0.85rem 1.1rem; }
.flash-err { background: var(--danger-light, #fbeaea); border: 1px solid var(--danger, #c0392b); color: var(--danger, #b03024); border-radius: var(--radius); padding: 0.85rem 1.1rem; }

/* ---------------------------------- cta ----------------------------------- */
.cta-band { background: var(--hero-gradient); color: var(--hero-text); border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3.5rem); display: flex; flex-wrap: wrap; gap: 1.6rem; align-items: center; justify-content: space-between; }
.cta-band h2 { color: var(--hero-text); margin-bottom: 0.3rem; }
.cta-band p { margin: 0; opacity: 0.9; }
.cta-band .btn-primary { background: #fff; color: var(--ink); }

/* -------------------------------- footer ---------------------------------- */
.site-footer { background: var(--footer-bg, var(--ink)); color: var(--footer-ink, rgba(255,255,255,.82)); margin-top: clamp(3rem, 6vw, 5rem); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 2.4rem; padding-block: clamp(2.5rem, 5vw, 4rem); }
.footer-col h3 { color: inherit; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-col a { color: inherit; opacity: 0.85; }
.footer-col a:hover { opacity: 1; color: #fff; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-head); font-size: 1.2rem; color: #fff; margin-bottom: 0.9rem; }
.footer-tagline { font-size: 0.92rem; opacity: 0.8; max-width: 36ch; }
.social-row { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.social-row a {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.25); color: inherit;
}
.social-row a:hover { background: rgba(255,255,255,.12); color: #fff; }
.contact-line { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.92rem; margin-bottom: 0.6rem; opacity: .9; }
.contact-line .icon { flex: none; margin-top: 3px; opacity: .8; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-block: 1.1rem; font-size: 0.84rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; opacity: 0.75; }
.powered-by{opacity:.8}
.powered-by a{color:inherit;text-decoration:none}
.powered-by a:hover{text-decoration:underline;opacity:1}

.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 70;
  width: 54px; height: 54px; border-radius: 50%;
  background: #25d366; color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-md);
}
.wa-float:hover { transform: scale(1.06); color: #fff; }

/* -------------------------------- misc ------------------------------------ */
.pager { display: flex; gap: 0.5rem; justify-content: center; margin-top: 2.4rem; }
.page-btn { min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft); font-weight: 600; font-size: 0.92rem; padding-inline: 0.7em; }
.page-btn.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.page-btn:disabled { opacity: 0.4; cursor: default; }

.empty {
  text-align: center; padding: 3.5rem 1.5rem;
  border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--ink-faint);
  background: var(--surface);
}
.empty .icon { width: 40px; height: 40px; margin-inline: auto; display: block; margin-bottom: 0.8rem; color: var(--primary); }

.prose-page { max-width: 780px; }
.article-card .card-meta { display: flex; gap: 0.8rem; align-items: center; }

@media (max-width: 900px) {
  .nav-toggle { display: grid; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0.8rem 1.2rem 1.2rem; box-shadow: var(--shadow-lg);
  }
  .nav.open { display: flex; }
  .nav-link { padding: 0.8rem 0.6rem; font-size: 1rem; }
  .nav-cta { margin: 0.8rem 0 0; }
  .hero-inner { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.8rem; }
  .form-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto; }
}

/* ===================== Theme palettes (from templates.ts) ===================== */
:root {
  --primary: #a34f66;
  --primary-dark: #823a50;
  --primary-light: #f7e6ea;
  --accent: #c98a5e;
  --accent-light: #f9ede2;
  --bg: #fdf8f5;
  --bg-alt: #f8efe9;
  --surface: #ffffff;
  --soft: #f4ebe4;
  --border: #eadbd2;
  --ink: #2d1d23;
  --ink-soft: #6b5560;
  --ink-faint: #9c8791;
  --on-primary: #fff8f6;
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Jost', 'Segoe UI', system-ui, sans-serif;
  --radius: 12px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --hero-gradient: linear-gradient(135deg, #3a2129 0%, #7c3f52 52%, #c98a94 100%);
  --hero-overlay: rgba(58, 33, 41, 0.45);
  --hero-text: #fff7f4;
  --shadow-sm: 0 1px 3px rgba(61, 32, 43, 0.08);
  --shadow-md: 0 6px 20px rgba(61, 32, 43, 0.11);
  --shadow-lg: 0 16px 44px rgba(61, 32, 43, 0.16);
  --footer-bg: #2d1d23;
  --footer-ink: rgba(255, 247, 244, 0.82);
  --head-track: 0.01em;
}
html[data-theme="lumen"] {
  --primary: #a34f66;
  --primary-dark: #823a50;
  --primary-light: #f7e6ea;
  --accent: #c98a5e;
  --accent-light: #f9ede2;
  --bg: #fdf8f5;
  --bg-alt: #f8efe9;
  --surface: #ffffff;
  --soft: #f4ebe4;
  --border: #eadbd2;
  --ink: #2d1d23;
  --ink-soft: #6b5560;
  --ink-faint: #9c8791;
  --on-primary: #fff8f6;
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Jost', 'Segoe UI', system-ui, sans-serif;
  --radius: 12px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --hero-gradient: linear-gradient(135deg, #3a2129 0%, #7c3f52 52%, #c98a94 100%);
  --hero-overlay: rgba(58, 33, 41, 0.45);
  --hero-text: #fff7f4;
  --shadow-sm: 0 1px 3px rgba(61, 32, 43, 0.08);
  --shadow-md: 0 6px 20px rgba(61, 32, 43, 0.11);
  --shadow-lg: 0 16px 44px rgba(61, 32, 43, 0.16);
  --footer-bg: #2d1d23;
  --footer-ink: rgba(255, 247, 244, 0.82);
  --head-track: 0.01em;
}
html[data-theme="eira"] {
  --primary: #1f7a72;
  --primary-dark: #145f59;
  --primary-light: #ddf0ed;
  --accent: #4f8fc0;
  --accent-light: #e3eef7;
  --bg: #fbfdfd;
  --bg-alt: #f0f6f6;
  --surface: #ffffff;
  --soft: #eaf2f1;
  --border: #d8e5e3;
  --ink: #17272b;
  --ink-soft: #48606a;
  --ink-faint: #7e959d;
  --on-primary: #ffffff;
  --font-head: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --radius: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --hero-gradient: linear-gradient(140deg, #10282c 0%, #17454b 55%, #2c7d76 100%);
  --hero-overlay: rgba(16, 40, 44, 0.42);
  --hero-text: #f2faf9;
  --shadow-sm: 0 1px 3px rgba(18, 46, 51, 0.09);
  --shadow-md: 0 6px 20px rgba(18, 46, 51, 0.12);
  --shadow-lg: 0 18px 48px rgba(18, 46, 51, 0.17);
  --footer-bg: #10282c;
  --footer-ink: rgba(242, 250, 249, 0.82);
  --head-track: -0.01em;
}
html[data-theme="noir"] {
  --primary: #d3ab6c;
  --primary-dark: #b98f4f;
  --primary-light: #3a3327;
  --accent: #9db4a0;
  --accent-light: #27302b;
  --bg: #141317;
  --bg-alt: #1b191f;
  --surface: #201d25;
  --soft: #292530;
  --border: #37323e;
  --ink: #f1ebe0;
  --ink-soft: #bdb4a8;
  --ink-faint: #8d857b;
  --on-primary: #17130c;
  --font-head: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --radius: 10px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --hero-gradient: radial-gradient(120% 120% at 80% 0%, #3d2f1c 0%, #241d15 45%, #141317 100%);
  --hero-overlay: rgba(20, 19, 23, 0.5);
  --hero-text: #f6efe2;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 52px rgba(0, 0, 0, 0.55);
  --footer-bg: #100f13;
  --footer-ink: rgba(246, 239, 226, 0.75);
  --head-track: normal;
}

/* ===================== Template tweak CSS (scoped per theme) ===================== */
/* Lumen — default look (unscoped so pages without data-theme render as Lumen) */
.section-kicker { font-family: var(--font-body); }
h1 em, .section-title em { font-style: italic; color: var(--primary); }
.card { border-radius: var(--radius-lg); }
.btn { letter-spacing: 0.02em; }
.hero-copy h1 { font-weight: 600; }
.doctor-card .card-media { border-color: var(--accent-light); }
.quote-card { background: linear-gradient(160deg, var(--surface), var(--primary-light)); }
.cta-band { border-radius: var(--radius-lg) var(--radius-lg) 0 var(--radius-lg); }

html[data-theme="lumen"] .section-kicker { font-family: var(--font-body); }
html[data-theme="lumen"] h1 em, html[data-theme="lumen"] .section-title em { font-style: italic; color: var(--primary); }
html[data-theme="lumen"] .card { border-radius: var(--radius-lg); }
html[data-theme="lumen"] .btn { letter-spacing: 0.02em; }
html[data-theme="lumen"] .hero-copy h1 { font-weight: 600; }
html[data-theme="lumen"] .doctor-card .card-media { border-color: var(--accent-light); }
html[data-theme="lumen"] .quote-card { background: linear-gradient(160deg, var(--surface), var(--primary-light)); }
html[data-theme="lumen"] .cta-band { border-radius: var(--radius-lg) var(--radius-lg) 0 var(--radius-lg); }

html[data-theme="eira"] h1, html[data-theme="eira"] h2, html[data-theme="eira"] h3 { font-weight: 800; }
html[data-theme="eira"] .section-kicker { letter-spacing: 0.18em; }
html[data-theme="eira"] .card { border-width: 1px; }
html[data-theme="eira"] .card:hover { border-color: var(--primary); box-shadow: 0 10px 28px rgba(31,122,114,.14); }
html[data-theme="eira"] .spec-table th { text-transform: uppercase; font-size: .78rem; letter-spacing: .08em; }
html[data-theme="eira"] .stat-item strong { font-weight: 800; }
html[data-theme="eira"] .badge { background: var(--soft); color: var(--primary-dark); }
html[data-theme="eira"] .notice-banner { background: var(--accent-light); border-color: var(--accent); }

html[data-theme="noir"] .site-header { background: color-mix(in srgb, var(--surface) 84%, transparent); border-bottom-color: var(--border); }
html[data-theme="noir"] .card { background: var(--surface); border-color: var(--border); }
html[data-theme="noir"] .card:hover { box-shadow: 0 14px 34px rgba(0,0,0,.5); border-color: var(--primary-dark); }
html[data-theme="noir"] .btn-primary { box-shadow: 0 4px 18px rgba(211, 171, 108, .25); }
html[data-theme="noir"] .rich-body blockquote { border-left-color: var(--primary); background: var(--primary-light); color: var(--ink); }
html[data-theme="noir"] .quote-card { background: linear-gradient(150deg, var(--surface), var(--primary-light)); border-color: var(--border); }
html[data-theme="noir"] .stars { color: var(--primary); }
html[data-theme="noir"] .avatar { background: var(--primary-light); color: var(--primary); }
html[data-theme="noir"] .wa-float { box-shadow: 0 8px 26px rgba(0,0,0,.6); }
html[data-theme="noir"] .flash-ok { background: var(--accent-light); border-color: var(--accent); color: var(--ink); }
html[data-theme="noir"] .flash-err { background: #3a2226; border-color: #b0525f; color: #f2c7cd; }
html[data-theme="noir"] .form-input, html[data-theme="noir"] .form-select, html[data-theme="noir"] .form-textarea { background: var(--soft); border-color: var(--border); }

/* ===================== Demo extras ===================== */
.note { font-size: 0.9rem; color: var(--ink-soft); font-style: italic; }
.icon { flex: none; }
.success-box { text-align: center; padding: 1.3rem 1.5rem; }
.success-box a { font-weight: 600; }

/* ===================== Theme switcher ===================== */
.theme-btn {
  position: fixed; bottom: 82px; right: 18px; z-index: 90;
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); transition: background .15s, transform .15s;
}
.theme-btn:hover { background: var(--primary-dark); transform: translateY(-2px); }
.theme-btn svg { width: 24px; height: 24px; }
.theme-panel {
  position: fixed; bottom: 146px; right: 18px; z-index: 95;
  width: 280px; max-width: calc(100vw - 36px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 16px;
  display: none; text-align: left;
}
.theme-panel.open { display: block; }
.theme-panel h3 { font-family: var(--font-head); font-size: 1rem; margin-bottom: 4px; }
.theme-sub { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 12px; }
.theme-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--soft); border: 2px solid transparent; border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
  font-family: var(--font-body); color: var(--ink); transition: border-color .15s, background .15s;
}
.theme-card:hover { background: color-mix(in srgb, var(--soft) 60%, var(--primary-light)); }
.theme-card.active { border-color: var(--primary); background: var(--primary-light); }
.theme-swatches { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.theme-swatches .sw { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.12); }
.theme-card .t-name { font-weight: 700; font-size: 0.9rem; }
.theme-card .t-desc { font-size: 0.75rem; color: var(--ink-soft); line-height: 1.35; }
.theme-note { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 0.72rem; color: var(--ink-faint); line-height: 1.4; }

@media (max-width: 640px) {
  .theme-panel { right: 14px; bottom: 140px; }
  .theme-btn { right: 14px; bottom: 80px; }
}