/* =============================================================
   Dra. Rubí Tello — styles.css
   Archetype: Editorial Light Cream (adaptado) — crema/arena + burdeos + oro
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #faf6f0;
  --bg-2:      #f1e7d8;
  --paper:     #ffffff;
  --ink:       #241b16;
  --ink-soft:  #3a2c24;
  --ink-mute:  #8a7a6c;
  --accent:    #7a1629;   /* burdeos oscuro */
  --accent-2:  #9c3b4c;   /* burdeos suave, hovers */
  --gold:      #b5893e;   /* dorado apagado */
  --gold-soft: #e3cc98;
  --line:      rgba(36,26,22,.12);
  --shadow-sm: 0 10px 30px -18px rgba(36,26,22,.35);
  --shadow-lg: 0 40px 80px -35px rgba(36,26,22,.4);

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.01em; font-family: var(--serif); font-weight: 500; }
em { font-style: italic; color: var(--accent); font-weight: 500; }
::selection { background: var(--gold-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
ul, ol { list-style: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 500;
  transition: top .25s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: min(1160px, 92%); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.kicker {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
  display: inline-block;
}
.section-title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  margin-bottom: 1.1rem;
  max-width: 18ch;
}
.section-sub {
  color: var(--ink-mute);
  font-size: 1.05rem;
  max-width: 56ch;
  line-height: 1.7;
}
.section-head { margin-bottom: 3rem; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal[data-split] { opacity: 1; transform: none; } /* gotcha A.4.5 defensive */

.section { padding-block: clamp(4rem, 9vw, 7.5rem); position: relative; }

/* =============================================================
   4. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .01em;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background .35s var(--ease-out), color .35s var(--ease-out);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 30px -14px rgba(122,22,41,.55);
}
.btn-primary:hover { background: var(--accent-2); transform: translateY(-2px); box-shadow: 0 18px 36px -14px rgba(122,22,41,.6); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-nav-cta { display: none; }
@media (min-width: 960px) { .btn-nav-cta { display: inline-flex; } }

/* =============================================================
   5. Nav
   ============================================================= */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,246,240,0);
  transition: background .4s var(--ease-out), box-shadow .4s var(--ease-out), backdrop-filter .4s var(--ease-out);
}
.site-nav.is-solid {
  background: rgba(250,246,240,.92);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1.1rem;
  gap: 1.5rem;
}
.nav-brand { display: flex; flex-direction: column; line-height: 1; }
.nav-brand-name { font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--ink); }
.nav-brand-tag { font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-mute); margin-top: 2px; }
.nav-links { display: none; gap: 1.9rem; font-size: .92rem; }
.nav-links a { position: relative; padding-block: .3rem; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--accent); transition: right .35s var(--ease-out);
}
.nav-links a:hover::after { right: 0; }
@media (min-width: 1060px) { .nav-links { display: flex; } }

.nav-burger {
  display: flex; flex-direction: column; gap: 5px; width: 26px; padding: 4px;
}
.nav-burger span { display: block; height: 1.5px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease-out), opacity .3s var(--ease-out); }
@media (min-width: 1060px) { .nav-burger { display: none; } }
.nav-burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
  display: flex; flex-direction: column; gap: 0;
  max-height: 0; overflow: hidden;
  background: var(--paper);
  transition: max-height .4s var(--ease-out);
}
.nav-mobile.is-open { max-height: 480px; }
.nav-mobile a, .nav-mobile .btn {
  padding: 1rem var(--gutter, 4%);
  border-bottom: 1px solid var(--line);
  width: 100%;
}
.nav-mobile .btn { margin: 1rem 4%; width: 92%; border-bottom: none; }
@media (min-width: 1060px) { .nav-mobile { display: none; } }

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 5rem) clamp(4rem, 8vw, 6rem);
  overflow: clip;
}
.hero-halo {
  position: absolute; inset: -30% -10% -10% -10%;
  background: radial-gradient(45% 40% at 25% 20%, rgba(181,137,62,.16), transparent 70%),
              radial-gradient(50% 45% at 85% 60%, rgba(122,22,41,.09), transparent 72%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; gap: 3rem;
  align-items: center;
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 4vw; }
}
.hero-title { font-size: clamp(2.3rem, 5.2vw, 3.6rem); max-width: 16ch; margin-bottom: 1.4rem; }
.hero-sub { color: var(--ink-mute); font-size: 1.1rem; max-width: 46ch; margin-bottom: 2rem; line-height: 1.7; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 2.2rem; }
.hero-trust {
  display: flex; flex-wrap: wrap; gap: .5rem;
  font-size: .84rem; color: var(--ink-mute);
}
.hero-trust-sep { opacity: .5; }

.hero-figure { position: relative; justify-self: center; max-width: 380px; width: 100%; }
.hero-figure-frame {
  border-radius: 28px; overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 2 / 3;
  position: relative;
}
.hero-figure-frame::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
  pointer-events: none;
}
.hero-figure-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-figure-badge {
  position: absolute; left: -6%; bottom: -8%;
  background: var(--paper);
  border-radius: 18px;
  padding: 1rem 1.3rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
  max-width: 220px;
}
.hero-figure-badge-name { font-family: var(--serif); font-style: italic; font-size: 1.15rem; }
.hero-figure-badge-role { font-size: .72rem; color: var(--ink-mute); letter-spacing: .02em; }

/* =============================================================
   7. Sobre la doctora
   ============================================================= */
.section-doctora { background: var(--paper); }
.about-grid {
  display: grid; gap: 3rem;
  align-items: start;
}
@media (min-width: 900px) {
  .about-grid { grid-template-columns: .8fr 1.2fr; gap: 5vw; align-items: center; }
}
.about-figure { position: relative; justify-self: center; max-width: 340px; width: 100%; }
.about-figure-frame {
  border-radius: 50% / 42%;
  overflow: hidden;
  aspect-ratio: 1;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
}
.about-figure-frame img { width: 100%; height: 100%; object-fit: cover; }
.about-figure-ring {
  position: absolute; inset: -14px;
  border-radius: 50% / 44%;
  border: 1.5px solid var(--gold-soft);
  z-index: 0;
}
.about-lede { font-size: 1.08rem; color: var(--ink-soft); margin-bottom: 1.8rem; line-height: 1.75; }
.about-creds { display: grid; gap: .9rem; margin-bottom: 2rem; }
.about-creds li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-bottom: .9rem; border-bottom: 1px solid var(--line);
  font-size: .92rem; flex-wrap: wrap;
}
.about-creds-label { color: var(--ink-mute); }
.about-creds-value { font-weight: 600; text-align: right; }
.about-quote {
  font-family: var(--serif); font-style: italic; color: var(--accent);
  font-size: 1.3rem; line-height: 1.5; border-left: 2px solid var(--gold);
  padding-left: 1.3rem;
}

/* =============================================================
   8. Procedimientos
   ============================================================= */
.procedure-groups { display: grid; gap: 2rem; }
@media (min-width: 900px) { .procedure-groups { grid-template-columns: repeat(3, 1fr); gap: 1.6rem; } }

.procedure-group {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 2.1rem 1.8rem;
  position: relative;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), border-color .45s var(--ease-out);
}
.procedure-group:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold-soft);
}
.procedure-group-title { font-size: 1.4rem; margin-bottom: .5rem; }
.procedure-group-desc { color: var(--ink-mute); font-size: .92rem; margin-bottom: 1.4rem; line-height: 1.6; }
.procedure-items { display: grid; gap: 1rem; }
.procedure-item {
  padding-block: .9rem;
  border-top: 1px solid var(--line);
}
.procedure-item:first-child { border-top: none; padding-top: 0; }
.procedure-item-name { font-weight: 600; font-size: .96rem; margin-bottom: .25rem; display: flex; align-items: center; gap: .5rem; }
.procedure-item-name::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); flex-shrink: 0;
}
.procedure-item-desc { color: var(--ink-mute); font-size: .85rem; line-height: 1.55; padding-left: 1rem; }

/* =============================================================
   9. Proceso
   ============================================================= */
.section-proceso { background: var(--bg-2); }
.process-list {
  display: grid; gap: 1.4rem;
  counter-reset: none;
}
@media (min-width: 860px) { .process-list { grid-template-columns: repeat(4, 1fr); gap: 1.2rem; } }
.process-item {
  background: var(--paper);
  border-radius: 22px;
  padding: 2rem 1.6rem;
  position: relative;
  border: 1px solid var(--line);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.process-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-sm); }
.process-step {
  font-family: var(--serif); font-style: italic; color: var(--gold);
  font-size: 2.4rem; line-height: 1; margin-bottom: .8rem; display: block;
}
.process-title { font-size: 1.2rem; margin-bottom: .2rem; }
.process-subtitle { color: var(--accent); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .8rem; display: block; }
.process-desc { color: var(--ink-mute); font-size: .88rem; line-height: 1.6; }
.process-item:not(:last-child)::after {
  content: "";
  display: none;
}
@media (min-width: 860px) {
  .process-item:not(:last-child)::after {
    content: "";
    position: absolute; top: 2.6rem; right: -1.1rem;
    width: 1rem; height: 1px; background: var(--line);
    display: block;
  }
}

/* =============================================================
   10. Test de orientación (IA)
   ============================================================= */
.section-orientacion { background: var(--paper); }
.orientacion-grid { display: grid; gap: 3rem; align-items: start; }
@media (min-width: 960px) { .orientacion-grid { grid-template-columns: .85fr 1.15fr; gap: 4vw; } }
.orientacion-disclaimer {
  background: var(--bg-2);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  border-radius: 0 14px 14px 0;
  font-size: .88rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.orientacion-widget {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  min-height: 380px;
  position: relative;
}
.quiz-progress { display: flex; gap: .4rem; margin-bottom: 1.6rem; }
.quiz-progress span { height: 3px; flex: 1; background: var(--line); border-radius: 3px; overflow: hidden; }
.quiz-progress span i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s var(--ease-out); }
.quiz-progress span.is-done i, .quiz-progress span.is-active i { width: 100%; }

.quiz-step-title { font-size: 1.3rem; margin-bottom: 1.4rem; font-family: var(--serif); }
.quiz-options { display: grid; gap: .7rem; margin-bottom: 1.6rem; }
.quiz-option {
  display: block; width: 100%; text-align: left;
  padding: .95rem 1.2rem; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--paper);
  font-size: .95rem; transition: border-color .3s var(--ease-out), background .3s var(--ease-out), transform .3s var(--ease-out);
}
.quiz-option:hover { border-color: var(--gold); transform: translateX(3px); }
.quiz-option.is-selected { border-color: var(--accent); background: rgba(122,22,41,.06); color: var(--accent); font-weight: 600; }

.quiz-field { margin-bottom: 1rem; }
.quiz-field label { display: block; font-size: .85rem; color: var(--ink-mute); margin-bottom: .4rem; }
.quiz-field input {
  width: 100%; padding: .85rem 1rem; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--paper);
}
.quiz-field input:focus { border-color: var(--accent); outline: none; }

.quiz-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.quiz-back { color: var(--ink-mute); font-size: .88rem; }
.quiz-back:hover { color: var(--accent); }
.quiz-back[hidden] { visibility: hidden; }

.quiz-loading { text-align: center; padding: 2.4rem 0; color: var(--ink-mute); }
.quiz-loading-dots span {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); margin: 0 3px; animation: quizDot 1.1s infinite ease-in-out;
}
.quiz-loading-dots span:nth-child(2) { animation-delay: .15s; }
.quiz-loading-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes quizDot { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

.quiz-result-title { font-size: 1.5rem; margin-bottom: 1rem; }
.quiz-result-block { margin-bottom: 1.3rem; }
.quiz-result-block h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: .6rem; }
.quiz-result-block ul { display: grid; gap: .5rem; }
.quiz-result-block li {
  font-size: .92rem; padding: .7rem .9rem; background: var(--paper);
  border-radius: 10px; border: 1px solid var(--line); line-height: 1.5;
}
.quiz-result-disclaimer {
  font-size: .8rem; color: var(--ink-mute); margin-top: 1.2rem;
  border-top: 1px solid var(--line); padding-top: 1rem;
}

/* =============================================================
   11. Testimonios
   ============================================================= */
.section-testimonios { background: var(--bg-2); }
.testimonios-demo-note {
  background: rgba(181,137,62,.14);
  border: 1px solid var(--gold-soft);
  padding: .9rem 1.1rem;
  border-radius: 12px;
  color: var(--ink-soft) !important;
  max-width: 100% !important;
  font-size: .88rem !important;
}
.testimonial-track {
  display: grid; gap: 1.6rem; margin-top: 2.5rem;
}
@media (min-width: 860px) { .testimonial-track { grid-template-columns: repeat(3, 1fr); } }
.testimonial-card {
  background: var(--paper);
  border-radius: 22px;
  padding: 2rem;
  border: 1px solid var(--line);
  position: relative;
  overflow: visible;
}
.testimonial-badge {
  position: absolute; top: -12px; left: 1.6rem;
  background: var(--gold); color: #fff;
  font-size: .66rem; font-weight: 700; letter-spacing: .04em;
  padding: .3rem .7rem; border-radius: 999px; text-transform: uppercase;
}
.testimonial-quote { font-family: var(--serif); font-style: italic; font-size: 1.15rem; line-height: 1.55; margin-block: .8rem 1.4rem; color: var(--ink-soft); }
.testimonial-name { font-weight: 700; font-size: .92rem; }
.testimonial-role { font-size: .78rem; color: var(--ink-mute); }

/* =============================================================
   12. FAQ
   ============================================================= */
.section-faq { background: var(--paper); }
.faq-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .faq-grid { grid-template-columns: .7fr 1.3fr; } }
.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-question {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding-block: 1.3rem; text-align: left; font-weight: 600; font-size: 1.02rem;
}
.faq-question-icon { flex-shrink: 0; font-family: var(--serif); font-size: 1.3rem; color: var(--gold); transition: transform .35s var(--ease-out); }
.faq-item.is-open .faq-question-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height .4s var(--ease-out);
  color: var(--ink-mute); font-size: .94rem; line-height: 1.7;
}
.faq-answer-inner { padding-bottom: 1.4rem; max-width: 62ch; }
.faq-item.is-open .faq-answer { max-height: 240px; }

/* =============================================================
   13. Contacto
   ============================================================= */
.section-contacto { background: var(--bg-2); }
.contacto-grid { display: grid; gap: 3rem; }
@media (min-width: 960px) { .contacto-grid { grid-template-columns: .9fr 1.1fr; gap: 4vw; } }
.contacto-list { margin-block: 1.8rem 1.6rem; display: grid; gap: 1rem; }
.contacto-list li { display: flex; flex-direction: column; gap: .15rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.contacto-list-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute); }
.contacto-list-value { font-weight: 600; font-size: 1rem; }
a.contacto-list-value:hover { color: var(--accent); }
.contacto-social { display: flex; gap: 1.2rem; }
.contacto-social a { font-weight: 600; border-bottom: 1px solid var(--gold); padding-bottom: 2px; }
.contacto-social a:hover { color: var(--accent); border-color: var(--accent); }

.contacto-form {
  background: var(--paper);
  border-radius: 24px;
  padding: 2.2rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.contacto-form-title { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 1.4rem; }
.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-size: .82rem; color: var(--ink-mute); margin-bottom: .4rem; }
.form-row input, .form-row textarea {
  width: 100%; padding: .8rem 1rem; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); resize: vertical;
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); }
.form-consent { display: flex; align-items: flex-start; gap: .6rem; font-size: .8rem; color: var(--ink-mute); margin-bottom: 1.3rem; }
.form-consent input { margin-top: 3px; }
.form-status { margin-top: 1rem; font-size: .88rem; min-height: 1.2em; }
.form-status.is-ok { color: #2f6b3f; }
.form-status.is-err { color: var(--accent); }

/* =============================================================
   14. Footer
   ============================================================= */
.site-footer { background: var(--ink); color: var(--bg); padding-block: 3.5rem 2rem; }
.footer-grid { display: grid; gap: 2rem; padding-bottom: 2.4rem; border-bottom: 1px solid rgba(250,246,240,.14); }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-brand .nav-brand-name { color: var(--bg); font-size: 1.7rem; }
.footer-brand .nav-brand-tag { color: rgba(250,246,240,.55); }
.footer-note { margin-top: .8rem; font-size: .85rem; color: rgba(250,246,240,.6); }
.footer-links, .footer-social { display: flex; flex-direction: column; gap: .7rem; font-size: .92rem; }
.footer-links a:hover, .footer-social a:hover { color: var(--gold-soft); }
.footer-legal { padding-top: 1.6rem; display: grid; gap: .6rem; font-size: .78rem; color: rgba(250,246,240,.55); line-height: 1.6; }

/* =============================================================
   15. Chat widget
   ============================================================= */
.chat-widget { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 200; }
.chat-bubble {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: transform .35s var(--ease-bounce);
}
.chat-bubble:hover { transform: scale(1.08); }
.chat-panel {
  position: absolute; right: 0; bottom: 76px;
  width: min(360px, 86vw); max-height: min(560px, 72vh);
  background: var(--paper); border-radius: 22px; border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  transform-origin: bottom right;
  animation: chatIn .3s var(--ease-out);
}
@keyframes chatIn { from { opacity: 0; transform: scale(.92) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.chat-panel[hidden] { display: none; }
.chat-panel-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 1.1rem 1.2rem .8rem; }
.chat-panel-title { font-family: var(--serif); font-size: 1.15rem; }
.chat-panel-sub { font-size: .74rem; color: var(--ink-mute); }
.chat-panel-close { font-size: 1rem; color: var(--ink-mute); padding: .2rem; }
.chat-panel-disclaimer {
  font-size: .68rem; color: var(--ink-mute); background: var(--bg-2);
  padding: .5rem 1.2rem; line-height: 1.4;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .7rem; min-height: 180px; }
.chat-msg { max-width: 86%; padding: .65rem .9rem; border-radius: 14px; font-size: .88rem; line-height: 1.5; }
.chat-msg.from-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.from-bot { align-self: flex-start; background: var(--bg-2); border-bottom-left-radius: 4px; }
.chat-msg.is-typing { display: flex; gap: 4px; align-items: center; padding-block: .9rem; }
.chat-msg.is-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-mute); animation: quizDot 1.1s infinite ease-in-out; }
.chat-msg.is-typing span:nth-child(2) { animation-delay: .15s; }
.chat-msg.is-typing span:nth-child(3) { animation-delay: .3s; }
.chat-suggestions { display: flex; gap: .5rem; flex-wrap: wrap; padding: 0 1.2rem .8rem; }
.chat-suggestion { font-size: .76rem; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-mute); }
.chat-suggestion:hover { border-color: var(--accent); color: var(--accent); }
.chat-form { display: flex; gap: .6rem; padding: .9rem 1rem; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; padding: .7rem .9rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); }
.chat-form input:focus { outline: none; border-color: var(--accent); }
.chat-form button { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; flex-shrink: 0; }

/* =============================================================
   16. Responsive niceties
   ============================================================= */
@media (max-width: 539px) {
  .hero-figure-badge { left: 4%; bottom: -6%; padding: .8rem 1rem; }
  .about-figure-frame, .about-figure-ring { border-radius: 40% / 36%; }
}

/* =============================================================
   17. Reduced motion — only intrusive
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .chat-bubble, .procedure-group, .process-item { transition: none; }
}
