body { -webkit-font-smoothing: antialiased; }
  /* Reveal-on-scroll: opt-IN only. Without the .anim flag (no JS, reduced motion)
     every .fx block renders normally. Content must never depend on the animation. */
  html.anim .fx { opacity:0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
  html.anim .fx.in { opacity:1; transform:none; }
  @media (prefers-reduced-motion: reduce) { html.anim .fx { opacity:1; transform:none; transition:none; } }
  .grain::before{
    content:''; position:absolute; inset:0; pointer-events:none; opacity:.5;
    background-image:radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
    background-size:22px 22px;
  }
  .rule { background:linear-gradient(90deg, transparent, rgba(98,35,90,.55), transparent); }
  .dark-sec .rule { background:linear-gradient(90deg, transparent, rgba(255,226,52,.85), transparent); }
  details[open] .chev { transform: rotate(180deg); }
  .chev { transition: transform .25s ease; }
  input:focus, select:focus, textarea:focus { outline:none; }
  /* ── Animated hero backdrop ──────────────────────────────────────────────
     Three blurred radial "blobs" drift on long, offset loops so the motion
     never visibly repeats, over a masked dot grid that breathes. Pure CSS,
     GPU-composited (transform/opacity only), no canvas and no JS.          */
  .hero-bg { position:absolute; inset:0; z-index:0; overflow:hidden; pointer-events:none; }

  .hero-bg .dots {
    position:absolute; inset:0;
    background-image:radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
    background-size:26px 26px;
    -webkit-mask-image:radial-gradient(85% 70% at 50% 28%, #000 8%, transparent 74%);
            mask-image:radial-gradient(85% 70% at 50% 28%, #000 8%, transparent 74%);
    will-change:transform, opacity;
    animation:hb-grid 12s ease-in-out infinite;
  }

  .hero-bg .g { position:absolute; border-radius:50%; filter:blur(58px); will-change:transform, opacity; }

  /* plum bloom, top centre */
  .hero-bg .g1 {
    width:820px; height:580px; top:-190px; left:50%; transform:translateX(-50%);
    background:radial-gradient(rgba(122,74,112,.62) 0%, rgba(98,35,90,.30) 40%, rgba(98,35,90,.08) 62%, transparent 78%);
    transform-origin:50% 35%;
    animation:hb-g1 23s ease-in-out infinite;
  }
  /* brand-gold warmth, right */
  .hero-bg .g2 {
    width:540px; height:540px; top:60px; right:-170px;
    background:radial-gradient(circle, rgba(255,226,52,.16) 0%, rgba(255,226,52,.05) 46%, transparent 70%);
    transform-origin:70% 40%;
    animation:hb-g2 27s ease-in-out infinite;
  }
  /* deep magenta, bottom left, keeps the lower third from going flat */
  .hero-bg .g3 {
    width:620px; height:460px; bottom:-200px; left:-140px;
    background:radial-gradient(circle, rgba(98,35,90,.5) 0%, rgba(47,1,42,.18) 52%, transparent 74%);
    animation:hb-g3 31s ease-in-out infinite;
  }

  /* fine film grain so the big gradients don't band on cheap panels */
  .hero-bg::after {
    content:""; position:absolute; inset:0; pointer-events:none;
    opacity:.05; mix-blend-mode:overlay;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  @keyframes hb-g1 {
    0%   { transform:translateX(-50%) translate(0,-10px)    scale(1.02); opacity:.70; }
    25%  { transform:translateX(-50%) translate(-155px,32px) scale(1.16); opacity:.90; }
    50%  { transform:translateX(-50%) translate(45px,62px)   scale(1.26); opacity:1;   }
    75%  { transform:translateX(-50%) translate(170px,24px)  scale(1.11); opacity:.85; }
    100% { transform:translateX(-50%) translate(0,-10px)     scale(1.02); opacity:.70; }
  }
  @keyframes hb-g2 {
    0%   { transform:translate(0,0)          scale(1);    opacity:.55; }
    30%  { transform:translate(-120px,105px) scale(1.20); opacity:.95; }
    55%  { transform:translate(-35px,200px)  scale(1.08); opacity:1;   }
    80%  { transform:translate(75px,65px)    scale(1.14); opacity:.80; }
    100% { transform:translate(0,0)          scale(1);    opacity:.55; }
  }
  @keyframes hb-g3 {
    0%   { transform:translate(0,0)         scale(1);    opacity:.55; }
    40%  { transform:translate(120px,-70px) scale(1.18); opacity:.85; }
    70%  { transform:translate(40px,-120px) scale(1.06); opacity:.70; }
    100% { transform:translate(0,0)         scale(1);    opacity:.55; }
  }
  @keyframes hb-grid {
    0%,100% { transform:scale(1);    opacity:.85; }
    50%     { transform:scale(1.05); opacity:1;   }
  }

  .hero-bg canvas { position:absolute; inset:0; width:100%; height:100%; }
  /* the canvas draws its own idle grid, so drop the CSS one so dots aren't doubled */
  html.dots-live .hero-bg .dots { display:none; }

  /* Booking step 2: the slot column only exists once a date is chosen, and the
     calendar gets the full width until then. */
  #bk-when-grid { display:grid; gap:1.75rem; }

  /* Day cells are aspect-square, so their height follows the column width. In a
     wide dialog that produced 120px cells and a calendar taller than the
     viewport, so the calendar column is capped at a sensible month-view width
     and the rest of the row goes to the times. */
  #bk-when-grid > div:first-child { max-width:340px; }

  /* ── Dialogs on phones ───────────────────────────────────────────────
     The close control lives in a sticky header, so it stays reachable no
     matter how far the dialog is scrolled. These two rules cover the rest
     of the touch behaviour. */
  #bkmodal, #vmodal { overscroll-behavior: contain; }   /* don't scroll the page behind */
  @media (max-width: 639px) {
    @supports (padding: max(0px)) {
      /* keep the sticky header clear of a notch and the card clear of the home bar */
      #bkmodal { padding-top: max(.75rem, env(safe-area-inset-top));
                 padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
      #vmodal  { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
    }
  }
  @media (min-width:1024px) { #bk-mini { display:none !important; } }
  #bk-slots-col { display:none; }
  /* The slot list fills the row rather than sitting at a fixed height: the calendar
     grows with the column width, so a hard max-height left dead space under one
     column or the other at every viewport except the one it was tuned for. */
  #bk-when-grid.has-slots #bk-slots-col { display:flex; flex-direction:column; min-height:0; }
  /* align-items:start keeps each column at its natural height, so the calendar's
     height can be measured without the slot list having already stretched it. */
  #bk-when-grid.has-slots { align-items:start; }
  #bk-slots { min-height:0; overflow-y:auto; max-height:320px; }
  /* Two columns of times once there is room: half the rows, so the step fits
     without scrolling. */
  @media (min-width:900px) {
    #bk-slots { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:.5rem; align-content:start; }
    /* space-y-2 on the container adds a top margin to every sibling, which grid
       gap already handles. The id selector outranks the utility, so no !important. */
    #bk-slots > * { margin-top:0; }
    #bk-slots > p { grid-column:1 / -1; }
  }
  @media (min-width:640px) {
    #bk-when-grid.has-slots { grid-template-columns:340px minmax(0, 1fr); }
  }

  /* Odd number of credentials would otherwise leave the last one orphaned in a
     two-column grid, so it spans the row instead. */
  @media (min-width:640px) { .creds > li:last-child:nth-child(odd) { grid-column:1 / -1; } }
  @media (min-width:1024px) and (max-width:1279px) { .creds > li:last-child:nth-child(odd) { grid-column:auto; } }

  /* The practice's own icons are dark line art; inverting them to white lets them
     sit on a plum chip instead of looking grey on a pale one. */
  .svc-icon { filter: brightness(0) invert(1); }

  /* Clinic chips: three options, so a dropdown hid two of them behind an interaction. */
  .clinic-chip { border-color:#DBD4D9; background:#F8F6F7; color:#4C2A42; }
  .clinic-chip .sub { color:rgba(48,44,47,.5); }
  .clinic-chip .tick { display:none; }
  .clinic-chip:hover { border-color:#614459; background:#EFE7ED; }
  .clinic-chip:focus-visible { outline:2px solid #614459; outline-offset:2px; }
  .clinic-chip[aria-checked="true"] { background:#4C2A42; border-color:#4C2A42; color:#fff; }
  .clinic-chip[aria-checked="true"] .sub { color:rgba(255,255,255,.6); }
  .clinic-chip[aria-checked="true"] .tick { display:block; color:#FFE234; }
  .clinic-chip[aria-checked="true"] .pin { display:none; }

  /* ── Booking: skeletons and transitions ────────────────────────────────
     Availability will come from a real calendar, so the loading state is a
     genuine async placeholder, not decoration. */
  @keyframes bk-shimmer { to { transform:translateX(100%); } }
  .sk { position:relative; overflow:hidden; background:#EFE7ED; border-radius:4px; }
  .sk::after {
    content:''; position:absolute; inset:0; transform:translateX(-100%);
    background:linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
    animation:bk-shimmer 1.3s ease-in-out infinite; animation-delay:var(--d, 0ms);
  }
  @keyframes bk-stepin { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
  .step-in { animation:bk-stepin .3s cubic-bezier(.16,1,.3,1) backwards; }
  @keyframes bk-itemin { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
  .item-in { animation:bk-itemin .3s cubic-bezier(.16,1,.3,1) backwards; animation-delay:var(--d, 0ms); }
  @keyframes bk-spin { to { transform:rotate(360deg); } }
  .bk-spin { animation:bk-spin .7s linear infinite; }
  @media (prefers-reduced-motion: reduce) {
    .sk::after, .bk-spin { animation:none; }
    .step-in, .item-in { animation:none; opacity:1; transform:none; }
  }

  /* Motion is decoration: hold a still frame when the visitor asks for less. */
  @media (prefers-reduced-motion: reduce) {
    .hero-bg .dots, .hero-bg .g { animation:none !important; }
  }

  /* Header scroll state, driven by one class so nothing fights Tailwind's base utilities */
  #hdr.solid { background: rgba(248,246,247,.96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 10px 34px -12px rgba(47,1,42,.14); }
  #hdr.solid #logo-dark  { display:none; }
  #hdr.solid #logo-light { display:block; }
  #hdr.solid #nav a      { color:rgba(48,44,47,.72); }
  #hdr.solid #nav a:hover,
  #hdr.solid .hdr-phone:hover { color:#62235A; }
  #hdr.solid .hdr-phone  { color:#302C2F; }
  #hdr.solid .hdr-mark   { background:#4C2A42; border-color:rgba(98,35,90,.55); }
  @media (max-width: 767px){ body { padding-bottom: 68px; } }
