/* =========================================================================
   Fix My Hair shared components (2026-11-24), new-site look, every page.
   Values come from assets/ds/tokens.css only. Stamped after the tokens by
   tools/apply-theme.mjs (fmh-ds block). ASCII only (gate D1).
   Buttons still live in assets/theme/fmh-dark.css (old pages) and
   assets/home/home.css (.hm-btn) until the templates move over.
   ========================================================================= */

/* ---- footer (markup: _shared/footer.html, stamped by tools/apply-footer.mjs) */
html:root body footer.foot{box-sizing:border-box;width:min(1440px,100%);margin:0 auto;padding:var(--sp-7) var(--gutter) calc(var(--sp-8) + env(safe-area-inset-bottom));
  background:transparent;border:0;border-top:1px solid var(--c-line);border-radius:0;box-shadow:none;color:var(--c-dim);font:400 var(--fs-sm)/1.55 var(--font-body);text-align:left}
footer.foot .foot-logo{display:inline-flex;gap:.15em;margin-bottom:var(--sp-4);font:800 1.35rem/1 var(--font-display);letter-spacing:-.03em;text-decoration:none}
footer.foot .foot-logo b{color:var(--c-text);font-weight:inherit}
footer.foot .foot-logo i{color:var(--c-accent);font-style:normal}
footer.foot .foot-tag{max-width:62ch;margin:0 0 var(--sp-5);color:var(--c-muted)}
footer.foot nav{display:flex;flex-wrap:wrap;gap:var(--sp-2) var(--sp-5);margin:0 0 var(--sp-4)}
footer.foot .foot-links{font-size:var(--fs-base)}
footer.foot .foot-loc span{color:var(--c-dim)}
footer.foot :is(a,button){color:var(--c-muted);background:none;border:0;padding:0 0 2px;font:inherit;cursor:pointer;text-decoration:none;
  background-image:linear-gradient(var(--c-accent),var(--c-accent));background-size:0 1px;background-position:0 100%;background-repeat:no-repeat;
  transition:background-size var(--dur-fast) var(--ease),color var(--dur-fast) var(--ease)}
footer.foot :is(a,button):is(:hover,:focus-visible){color:var(--c-accent);background-size:100% 1px}
footer.foot :is(a,button):focus-visible{outline:2px solid var(--c-accent);outline-offset:3px}
footer.foot .small{margin:var(--sp-2) 0 0;font-size:var(--fs-sm);font-style:normal;color:var(--c-dim)}
footer.foot .small a{text-decoration:underline;text-underline-offset:.2em;background-image:none}
@media (prefers-reduced-motion:reduce){footer.foot :is(a,button){transition:none}}

/* ---- cookie banner and preferences: dark card, accept and reject equal weight (moved from fmh-dark.css) */
html:root body #cookie-banner{background:var(--c-surface)!important;color:var(--c-text);border-color:var(--c-line)!important;box-shadow:0 18px 50px -20px rgba(0,0,0,.7)}
html:root body #cookie-banner p{color:var(--c-text)}
html:root body :is(#cookie-banner,#cookie-preferences) a{color:var(--c-accent)}
/* Accept and Reject: same geometry, both full pills */
html:root body #cookie-buttons :is(#cookie-accept-all,#cookie-reject-all){min-height:40px;padding:0 16px;font-size:13px!important;flex:0 1 auto;white-space:nowrap;border:1.5px solid var(--c-accent)!important;background:var(--c-accent)!important;color:var(--c-on-accent)!important;border-radius:var(--r-pill)!important;font-family:var(--font-body)!important;font-weight:700!important}
@media (pointer:coarse){html:root body #cookie-buttons :is(#cookie-accept-all,#cookie-reject-all){min-height:44px}}
html:root body #cookie-manage{color:var(--c-muted)}
html:root body #cookie-preferences{background:var(--c-surface)!important;color:var(--c-text);border-color:var(--c-line)!important}
html:root body #cookie-preferences :is(h3,.cookie-cat-header,.cookie-cat-header label){color:var(--c-text)}
html:root body #cookie-preferences .cookie-category{border-bottom-color:var(--c-line)}
html:root body #cookie-preferences .cookie-category p{color:var(--c-muted)}
html:root body #cookie-preferences .cookie-cat-header input[type=checkbox]{background:var(--c-line-strong)!important;border:0!important}
html:root body #cookie-preferences .cookie-cat-header input[type=checkbox]:checked{background:var(--c-accent)!important}
html:root body #cookie-preferences .cookie-cat-header input[type=checkbox]::after{background:var(--c-text)}
html:root body #cookie-preferences .cookie-cat-header input[type=checkbox]:checked::after{background:var(--c-on-accent)}
html:root body #cookie-save-prefs{width:100%}
/* compact card size (was homepage only) */
html:root body #cookie-banner{max-width:360px;margin:12px;padding:12px 14px calc(12px + env(safe-area-inset-bottom));gap:8px 12px;font-size:12px;border-radius:var(--r-sm)}
html:root body #cookie-banner p{flex:1 1 100%;min-width:0;line-height:1.45}
@media (max-width:480px){html:root body #cookie-banner{max-width:none;left:0;right:0;margin:8px}}

/* ---- quiz overlay (moved from fmh-dark.css; now on the homepage too) ------------------------------------------------------ */
html:root body #quizOverlay{background:var(--c-bg)!important;color:var(--c-text)}
html:root body #quizOverlay :is(.quiz-q,.res-h,.quiz-opt-t,.quiz-glbl){color:var(--c-text)!important}
html:root body #quizOverlay :is(.quiz-sub,.quiz-opt-s,.res-sub,.quiz-rail-tag){color:var(--c-muted)!important}
html:root body #quizOverlay :is(.quiz-opt,.quiz-gopt,.quiz-scale-btn,.res-why,.res-line,.res-promise,.res-badge){background:var(--c-surface)!important;box-shadow:inset 0 0 0 1px var(--c-line)!important}
html:root body #quizOverlay :is(.quiz-opt,.quiz-gopt,.quiz-scale-btn):hover{box-shadow:inset 0 0 0 1px var(--c-accent)!important}
html:root body #quizOverlay :is(.quiz-opt,.quiz-gopt,.quiz-scale-btn).sel{background:var(--c-accent)!important;box-shadow:0 10px 30px -14px rgba(255,237,0,.55)!important}
html:root body #quizOverlay :is(.quiz-opt,.quiz-gopt,.quiz-scale-btn).sel :is(.quiz-opt-t,.quiz-glbl,.quiz-opt-s){color:var(--c-on-accent)!important}
html:root body #quizOverlay :is(.quiz-back,.quiz-progwrap){background:var(--c-surface)!important;color:var(--c-text)!important;box-shadow:inset 0 0 0 1px var(--c-line)!important}
html:root body #quizOverlay .quiz-close{background:var(--c-surface)!important;box-shadow:inset 0 0 0 1px var(--c-line)!important}
html:root body #quizOverlay .quiz-next:disabled{background:var(--c-surface)!important;color:var(--c-dim)!important;opacity:1!important}
html:root body #quizOverlay,html:root body #quizOverlay *{box-sizing:border-box}
html:root body #quizOverlay :is(.quiz-next,.res-cta){display:inline-flex;align-items:center;justify-content:center;min-height:50px;border:0;border-radius:var(--r-pill)!important;background:var(--c-accent)!important;color:var(--c-on-accent)!important;font:700 1rem var(--font-body)!important;cursor:pointer}
html:root body #quizOverlay .qgate-input{background:var(--c-surface)!important;border:1px solid var(--c-line)!important;border-radius:var(--r-md);color:var(--c-text)!important;font-family:var(--font-body)!important}
html:root body #quizOverlay .qgate-input::placeholder{color:var(--c-dim)}
html:root body #quizOverlay .qgate-input:focus{border-color:var(--c-accent)!important;box-shadow:0 0 0 3px var(--c-accent-soft)}
html:root body #quizOverlay :is(.qgate-lbl,.qgate-check){color:var(--c-text)}
html:root body #quizOverlay :is(.qgate-privacy,.qgate-sign,.qgate-link){color:var(--c-muted)}
html:root body #quizOverlay .qgate-check input{accent-color:var(--c-accent)}

/* ---- phones: readable labels (2026-11-25 mobile pass). Standalone links already meet WCAG 2.5.8 (24px or spaced). */
@media (max-width:720px){
  /* chips, tags and table sub-labels were 7.5 to 10px; 11px is the floor */
  html:root body :is(.hcard-pill,.jcard-cat,.lab-med,.lab-chip,.fue-phase-tag,.fue-cov-lbl,.smp-cov-lbl,.fba-lbl,.look-tag,.ba-tag,.wf-tag,.cmpx-hide,.label-before,.label-after,.card-tag,.hm-chips li,th .sub):not(#_){font-size:11px!important}
}

/* ---- keyboard: skip link (in _shared/nav.html) and one focus ring everywhere ---- */
.fmh-skip{position:fixed;left:12px;top:-80px;z-index:400;padding:.65rem 1.1rem;border-radius:var(--r-pill);background:var(--c-accent);color:var(--c-on-accent);font:700 var(--fs-sm)/1 var(--font-body);text-decoration:none;transition:top var(--dur-fast) var(--ease)}
.fmh-skip:focus{top:12px;outline:2px solid var(--c-text);outline-offset:2px}
#fmh-content{display:block;height:0;overflow:hidden}
#fmh-content:focus{outline:0}
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid var(--c-accent);outline-offset:3px}

/* ---- page to page: a short cross-fade between pages (browsers without support just navigate) ---- */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:var(--dur-fast);animation-timing-function:var(--ease)}
@media (prefers-reduced-motion:reduce){@view-transition{navigation:none}}

/* ---- buttons: Apple continuous corners (owner, 2026-11-25) ------------------
   Every text button is a rounded rectangle whose corners ramp into the curve
   (G2, curvature continuous, the iOS squircle) instead of CSS's straight-line-
   then-circle (G1 kink). --sq is the corner's circular part; the corner starts
   1.6 x --sq from the edge (Figma's 60% corner smoothing).
   Chrome/Edge/Android: native corner-shape. Safari/iOS (no corner-shape yet): the
   same curve as a clip-path on filled buttons; outline buttons keep the plain
   rounded corner there, since a clip would cut their border. Round icon buttons
   (menu, dock icons, arrows) stay circles. */
html:root body :is(.btn,.btn-gold,.btn-line,.btn-ghost,.btn-wa,.btn-sm,.fnav-cta,.hm-btn,.loc-btn,.jrnl-all,.dock-cta,.dock-wa,.cn-submit,.cn-pill,.sticky-btn,.path-seq-go,.fpill,.filter-pill,.zpill,a.cta,.fmh-skip,.quiz-next,.quiz-back,.qgate-btn,#cookie-banner button,#cookie-preferences button,.foot-free-go):not(#_){--sq:12px;border-radius:var(--sq)!important}
html:root body :is(.fnav-cta,.fpill,.filter-pill,.zpill,.sticky-btn,.fmh-skip,.cn-pill,#cookie-banner button,#cookie-preferences button):not(#_){--sq:9px}
@supports (corner-shape:squircle){
  html:root body :is(.btn,.btn-gold,.btn-line,.btn-ghost,.btn-wa,.btn-sm,.fnav-cta,.hm-btn,.loc-btn,.jrnl-all,.dock-cta,.dock-wa,.cn-submit,.cn-pill,.sticky-btn,.path-seq-go,.fpill,.filter-pill,.zpill,a.cta,.fmh-skip,.quiz-next,.quiz-back,.qgate-btn,#cookie-banner button,#cookie-preferences button,.foot-free-go):not(#_){border-radius:calc(var(--sq) * 1.6)!important;corner-shape:squircle}
}
@supports (clip-path:shape(from 0 0, line to 0 0)) and (not (corner-shape:squircle)){
  html:root body :is(.btn-gold,.btn-wa,.fnav-cta,.hm-btn,.loc-btn,.jrnl-all,.dock-cta,.dock-wa,.cn-submit,.sticky-btn,.quiz-next,#cookie-banner button,#cookie-preferences button,.foot-free-go):not(#_):not(:focus-visible):not(.art-cta *):not(.cn-final *){clip-path:shape(from calc(var(--sq) * 1.6) 0, hline to calc(100% - var(--sq) * 1.6), curve by calc(var(--sq) * 1.0539) calc(var(--sq) * 0.109) with calc(var(--sq) * 0.56) 0 / calc(var(--sq) * 0.84) 0, arc by calc(var(--sq) * 0.437) calc(var(--sq) * 0.437) of var(--sq) cw, curve by calc(var(--sq) * 0.109) calc(var(--sq) * 1.0539) with calc(var(--sq) * 0.109) calc(var(--sq) * 0.2139) / calc(var(--sq) * 0.109) calc(var(--sq) * 0.4939), vline to calc(100% - var(--sq) * 1.6), curve by calc(var(--sq) * -0.109) calc(var(--sq) * 1.0539) with 0 calc(var(--sq) * 0.56) / 0 calc(var(--sq) * 0.84), arc by calc(var(--sq) * -0.437) calc(var(--sq) * 0.437) of var(--sq) cw, curve by calc(var(--sq) * -1.0539) calc(var(--sq) * 0.109) with calc(var(--sq) * -0.2139) calc(var(--sq) * 0.109) / calc(var(--sq) * -0.4939) calc(var(--sq) * 0.109), hline to calc(var(--sq) * 1.6), curve by calc(var(--sq) * -1.0539) calc(var(--sq) * -0.109) with calc(var(--sq) * -0.56) 0 / calc(var(--sq) * -0.84) 0, arc by calc(var(--sq) * -0.437) calc(var(--sq) * -0.437) of var(--sq) cw, curve by calc(var(--sq) * -0.109) calc(var(--sq) * -1.0539) with calc(var(--sq) * -0.109) calc(var(--sq) * -0.2139) / calc(var(--sq) * -0.109) calc(var(--sq) * -0.4939), vline to calc(var(--sq) * 1.6), curve by calc(var(--sq) * 0.109) calc(var(--sq) * -1.0539) with 0 calc(var(--sq) * -0.56) / 0 calc(var(--sq) * -0.84), arc by calc(var(--sq) * 0.437) calc(var(--sq) * -0.437) of var(--sq) cw, curve by calc(var(--sq) * 1.0539) calc(var(--sq) * -0.109) with calc(var(--sq) * 0.2139) calc(var(--sq) * -0.109) / calc(var(--sq) * 0.4939) calc(var(--sq) * -0.109), close)}
}

/* ---- beige panel: the homepage's tan "Free" card, above the footer on every page
   (owner, 2026-11-25: the landing page colour combo of black, gold and tan everywhere).
   Stamped with the footer from _shared/footer.html. Hidden on the homepage, which
   already shows it next to the hero. Text on tan: 6.1:1. */
html:root body .foot-free:not(#_){box-sizing:border-box;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--sp-4) var(--sp-6);
  width:auto;max-width:1440px;margin:var(--sp-8) var(--gutter) var(--sp-7);padding:clamp(1.5rem,4vw,2.75rem) clamp(1.5rem,4vw,3rem);
  background:var(--c-tan);color:var(--c-on-accent);border-radius:calc(var(--r-lg) * 1.6);corner-shape:squircle}
@supports not (corner-shape:squircle){html:root body .foot-free:not(#_){border-radius:var(--r-lg)}}
@media (min-width:1600px){html:root body .foot-free:not(#_){margin-left:auto;margin-right:auto}}
html:root body .foot-free:not(#_) p{margin:0;color:var(--c-on-accent)}
html:root body .foot-free:not(#_) .foot-free-big{font:800 clamp(3.25rem,7vw,5.5rem)/.85 var(--font-display);letter-spacing:-.06em}
html:root body .foot-free:not(#_) .foot-free-t{max-width:24ch;font:600 clamp(1rem,1.4vw,1.2rem)/1.3 var(--font-body)}
html:root body .foot-free:not(#_) .foot-free-go{display:inline-flex;align-items:center;justify-content:center;min-height:50px;padding:0 var(--sp-5);
  background:var(--c-bg);color:var(--c-accent);font:700 .95rem/1 var(--font-body);text-decoration:none;white-space:nowrap;
  transition:translate var(--dur-fast) var(--ease),box-shadow var(--dur-fast) var(--ease)}
@media (hover:hover){html:root body .foot-free:not(#_) .foot-free-go:hover{translate:0 -2px;box-shadow:0 12px 28px -14px rgba(0,0,0,.7)}}
@media (max-width:720px){
  html:root body .foot-free:not(#_){grid-template-columns:1fr;margin-top:var(--sp-7)}
  html:root body .foot-free:not(#_) .foot-free-go{width:100%}
}
html:has(.hm-hero) .foot-free{display:none}
