/* ==========================================================================
   Cardinal Star Healing: motion, sound and touch layer (2.10)
   Loaded on the public site, the client portal and the admin, after their own
   styles. Everything here is decoration: assets/js/fx.js adds html.fx-on when
   motion is allowed (the visitor's own switch, the theme's data-motion and the
   device's "reduce motion" setting all have a say), and almost every rule
   below is scoped to it. Without the script the pages look as they did.
   Class prefix: fx-.
   ========================================================================== */
:root {
  --fx-gold: #E2B866;
  --fx-gold-rgb: 226, 184, 102;
  --fx-gold-deep: #B9892F;
  --fx-surface: var(--surface, var(--a-surface, #FFFFFF));
  --fx-ink: var(--ink, var(--a-ink, #1D1E20));
  --fx-muted: var(--muted, var(--a-muted, #6B6468));
  --fx-line: var(--line, var(--a-line, #E8E0E2));
  --fx-primary: var(--primary, var(--a-primary, #B76969));
  --fx-dark: var(--dark, var(--a-dark, #3A2C2C));
  --fx-ease: cubic-bezier(.2, .7, .2, 1);
  --fx-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* --------------------------------------------------------------------------
   1. Pages flow into each other (browsers with cross-page view transitions;
      fx.js skips the transition when motion is off). Others get a soft rise.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: fx-page-out .2s ease-in both; }
  ::view-transition-new(root) { animation: fx-page-in .42s var(--fx-ease) both; }
  html.fx-on.fx-novt main, html.fx-on.fx-novt .a-main { animation: fx-page-in .5s var(--fx-ease) both; }
}
@keyframes fx-page-out { to { opacity: 0; transform: translate3d(0, -8px, 0); } }
@keyframes fx-page-in { from { opacity: 0; transform: translate3d(0, 14px, 0); } }

/* The gold thread across the top while a page is on its way, with a star at its head. */
.fx-trace { position: fixed; z-index: 2147483600; top: 0; left: 0; width: 100%; height: 2px; pointer-events: none;
  transform-origin: 0 50%; transform: scaleX(0); opacity: 0;
  background: linear-gradient(90deg, rgba(var(--fx-gold-rgb), 0), var(--fx-gold) 70%, #FFF3D0);
  box-shadow: 0 0 10px rgba(var(--fx-gold-rgb), .7); }
.fx-trace.is-going { opacity: 1; animation: fx-trace-go 2.4s cubic-bezier(.1, .7, .2, 1) forwards; }
.fx-trace.is-landing { opacity: 1; animation: fx-trace-land .7s ease-out forwards; }
@keyframes fx-trace-go { from { transform: scaleX(0); } to { transform: scaleX(.82); } }
@keyframes fx-trace-land { from { transform: scaleX(.5); opacity: 1; } 70% { transform: scaleX(1); opacity: 1; } to { transform: scaleX(1); opacity: 0; } }

/* --------------------------------------------------------------------------
   2. The overlay that holds ripples, sparkles and celebration stars
   -------------------------------------------------------------------------- */
.fx-layer { position: fixed; inset: 0; z-index: 2147483500; pointer-events: none; overflow: hidden; contain: strict; }
.fx-ripple { position: absolute; overflow: hidden; }
.fx-ripple > i { position: absolute; border-radius: 50%; transform: translate(-50%, -50%) scale(0); opacity: .55;
  background: radial-gradient(circle, rgba(var(--fx-gold-rgb), .55) 0%, rgba(var(--fx-gold-rgb), .22) 55%, rgba(var(--fx-gold-rgb), 0) 70%);
  animation: fx-ripple .6s ease-out forwards; }
@keyframes fx-ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

.fx-star { position: absolute; left: 0; top: 0; width: var(--s, 12px); height: var(--s, 12px); background: var(--c, var(--fx-gold));
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  transform: translate(var(--x), var(--y)) scale(0); opacity: 0;
  animation: fx-burst var(--d, .9s) cubic-bezier(.15, .7, .3, 1) var(--w, 0s) forwards; }
@keyframes fx-burst {
  0% { transform: translate(var(--x), var(--y)) scale(0) rotate(0deg); opacity: 0; }
  18% { opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translate(calc(var(--x) + var(--dx)), calc(var(--y) + var(--dy))) scale(1) rotate(var(--r, 90deg)); opacity: 0; }
}
.fx-halo { position: absolute; left: 0; top: 0; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  border: 2px solid rgba(var(--fx-gold-rgb), .8); transform: translate(var(--x), var(--y)) scale(.2); opacity: 0;
  animation: fx-halo 1s ease-out forwards; }
@keyframes fx-halo { 10% { opacity: .9; } 100% { transform: translate(var(--x), var(--y)) scale(11); opacity: 0; } }

/* --------------------------------------------------------------------------
   3. Things that answer the hand: buttons, cards, the logo
   -------------------------------------------------------------------------- */
html.fx-on :is(.btn, .a-btn):not([disabled]):not([aria-disabled="true"]) { transition: transform .22s var(--fx-spring), box-shadow .25s var(--fx-ease), background-color .2s var(--fx-ease), border-color .2s var(--fx-ease), color .2s var(--fx-ease); }
html.fx-on :is(.btn, .a-btn):not([disabled]):not([aria-disabled="true"]):hover { transform: translateY(-2px); }
html.fx-on :is(.btn, .a-btn):not([disabled]):not([aria-disabled="true"]):active { transform: translateY(0) scale(.965); transition-duration: .06s; }
html.fx-on :is(.btn-primary, .a-btn-primary):not([disabled]):hover { box-shadow: 0 10px 26px rgba(var(--fx-gold-rgb), .34), 0 0 0 1px rgba(var(--fx-gold-rgb), .55); }
/* A slow gold sheen across the main buttons (solid buttons only, so themed gradients are left alone). */
html.fx-on[data-buttons="solid"] .btn-primary, html.fx-on .a-btn-primary {
  background-image: linear-gradient(110deg, rgba(255, 255, 255, 0) 42%, rgba(255, 240, 200, .28) 50%, rgba(255, 255, 255, 0) 58%);
  background-size: 260% 100%; background-position: 130% 0; background-repeat: no-repeat;
  animation: fx-sheen 9s ease-in-out infinite; }
@keyframes fx-sheen { 0%, 72% { background-position: 130% 0; } 100% { background-position: -40% 0; } }

/* Cards lean toward the pointer (fx.js sets --fx-rx / --fx-ry while hovering). */
html.fx-on .fx-tilt { transition: transform .5s var(--fx-ease), box-shadow .35s var(--fx-ease), border-color .35s var(--fx-ease); }
html.fx-on .fx-tilt.fx-tilting { transition-duration: .09s, .35s, .35s;
  transform: perspective(900px) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) translate3d(0, -5px, 0);
  box-shadow: 0 20px 44px rgba(var(--dark-rgb, 58, 44, 44), .16), 0 0 0 1px rgba(var(--fx-gold-rgb), .55), 0 0 26px rgba(var(--fx-gold-rgb), .22); }

/* The cardinal tilts its head when greeted. */
html.fx-on :is(.brand, .a-top-brand, .a-side-brand):hover img, html.fx-on .brand.fx-hello img { animation: fx-head-tilt 1s var(--fx-ease); transform-origin: 50% 80%; }
@keyframes fx-head-tilt { 0%, 100% { transform: none; } 22% { transform: rotate(-9deg) translateY(-1px); } 48% { transform: rotate(6deg); } 72% { transform: rotate(-3deg); } }

/* Menu links: a gold spark slides under the one being pointed at. */
html.fx-on :is(.pt-nav-link, .a-side-nav a) { transition: background-color .2s var(--fx-ease), color .2s var(--fx-ease), transform .25s var(--fx-spring), box-shadow .25s var(--fx-ease); }
html.fx-on :is(.pt-nav-link, .a-side-nav a):hover { transform: translateX(3px); }
html.fx-on :is(.pt-nav-link.is-active, .a-side-nav a[aria-current="page"]) { box-shadow: 0 0 0 1px rgba(var(--fx-gold-rgb), .45), 0 6px 18px rgba(var(--fx-gold-rgb), .18); }
html.fx-on :is(.pt-nav-badge, .a-badge, .portal-dot, .nav-toggle-dot) { animation: fx-breathe 3.2s ease-in-out infinite; }
@keyframes fx-breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--fx-gold-rgb), .0); } 50% { box-shadow: 0 0 0 5px rgba(var(--fx-gold-rgb), .28); } }

/* Icons inside the things being pointed at give a small nod. */
html.fx-on :is(.btn, .a-btn, .pt-nav-link, .a-side-nav a, .tile, .service-link):hover .icon { animation: fx-nod .5s var(--fx-spring); }
@keyframes fx-nod { 40% { transform: translateY(-2px) rotate(-8deg); } 70% { transform: translateY(0) rotate(4deg); } }

/* Fields glow softly while being filled in (the site's own focus ring stays). */
html.fx-on :is(.input, .a-input, textarea, select):focus { transition: box-shadow .3s var(--fx-ease), border-color .2s var(--fx-ease); }

/* --------------------------------------------------------------------------
   4. Things that arrive: portal and admin panels rise in, one after another
   -------------------------------------------------------------------------- */
html.fx-on .fx-rise { opacity: 0; transform: translate3d(0, 16px, 0) scale(.985); }
html.fx-on .fx-rise.fx-in { opacity: 1; transform: none; transition: opacity .6s var(--fx-ease), transform .7s var(--fx-ease); transition-delay: calc(var(--fx-i, 0) * 70ms); }
html.fx-on .fx-rise.fx-done { transition: none; }

/* Success messages land with a small bounce. */
html.fx-on :is(.a-flash:not(.is-error), .pt-done-note, .notice-ok) { animation: fx-pop .55s var(--fx-spring) both; }
@keyframes fx-pop { from { opacity: 0; transform: translateY(-8px) scale(.97); } }

/* --------------------------------------------------------------------------
   5. Sky: the star canvas, the slow dusk-to-dawn wash, swirls
   -------------------------------------------------------------------------- */
.fx-sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.4s ease; }
.fx-sky.is-lit { opacity: 1; }
.fx-sky-host { isolation: isolate; }
.fx-sky-host.fx-rel { position: relative; }
.fx-sky-host > .fx-sky.fx-under { z-index: -1; }
.fx-dawn { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; mix-blend-mode: soft-light;
  background: linear-gradient(180deg, rgba(40, 52, 96, .85) 0%, rgba(96, 40, 78, .6) 34%, rgba(170, 60, 60, .5) 62%, rgba(var(--fx-gold-rgb), .85) 100%);
  background-size: 100% 320%; background-position: 0 0; }
html.fx-on .fx-dawn { opacity: .55; animation: fx-dawn 70s ease-in-out infinite alternate; transition: opacity 2s ease; }
@keyframes fx-dawn { from { background-position: 0 0; } to { background-position: 0 100%; } }

.fx-swirl { position: absolute; z-index: -1; pointer-events: none; width: min(22rem, 46vw); height: auto; color: var(--fx-gold); opacity: 0; overflow: visible; }
.fx-swirl path { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
html.fx-on .fx-swirl.is-drawn { opacity: var(--fx-swirl-o, .5); transition: opacity 1.2s ease; animation: fx-drift 16s ease-in-out infinite alternate; }
html.fx-on .fx-swirl.is-drawn path { animation: fx-draw 3.2s var(--fx-ease) forwards; }
html.fx-on .fx-swirl.is-drawn path:nth-child(2) { animation-delay: .9s; }
html.fx-on .fx-swirl.is-drawn path:nth-child(3) { animation-delay: 1.5s; }
@keyframes fx-draw { to { stroke-dashoffset: 0; } }
@keyframes fx-drift { from { transform: var(--fx-swirl-t, none) translate3d(0, 0, 0); } to { transform: var(--fx-swirl-t, none) translate3d(10px, -8px, 0) rotate(1.5deg); } }
.fx-swirl-a { right: -2rem; top: -.5rem; }
body.admin .fx-swirl { width: min(15rem, 40vw); right: auto; left: 38%; top: -.25rem; --fx-swirl-o: .28; }
.fx-swirl-b { left: -2.5rem; bottom: -1rem; --fx-swirl-t: scale(-1, -1); }
.fx-on-light.fx-swirl, .fx-on-light .fx-swirl { color: var(--fx-gold-deep); --fx-swirl-o: .34; }

/* --------------------------------------------------------------------------
   6. The moon that fills as the page is read (and takes you back to the top)
   -------------------------------------------------------------------------- */
.fx-moon { position: fixed; z-index: 60; right: max(1rem, env(safe-area-inset-right, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid rgba(var(--fx-gold-rgb), .55); border-radius: 50%; cursor: pointer;
  background: var(--fx-dark); color: var(--fx-gold); box-shadow: 0 8px 22px rgba(0, 0, 0, .22), 0 0 0 0 rgba(var(--fx-gold-rgb), 0);
  opacity: 0; transform: translateY(12px) scale(.8); pointer-events: none;
  transition: opacity .35s var(--fx-ease), transform .45s var(--fx-spring), box-shadow .3s var(--fx-ease); }
.fx-moon.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.fx-moon:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, .22), 0 0 0 5px rgba(var(--fx-gold-rgb), .22), 0 0 22px rgba(var(--fx-gold-rgb), .5); }
.fx-moon:focus-visible { outline: 2px solid var(--fx-gold); outline-offset: 3px; }
.fx-moon svg { display: block; width: 1.5rem; height: 1.5rem; margin: auto; }
.fx-moon .fx-moon-shade { transition: transform .25s linear; }
body.admin .fx-moon { display: none; }
@media print { .fx-moon, .fx-layer, .fx-trace, .fx-invite, .fx-sky, .fx-dawn, .fx-swirl { display: none !important; } }
/* 2.11: a panel that has not risen in yet (it was never scrolled to) must still print: Billing printed blank below the first screen. */
@media print { html.fx-on .fx-rise, .fx-rise { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; } }
/* 2.11: in an open conversation on a phone the moon button sat on the corner of the reply box. */
@media (max-width: 719px) { .is-portal-thread .fx-moon { display: none !important; } }

/* --------------------------------------------------------------------------
   6b. 2.14: the sun and moon bubble: sound on (sun, awake) or off (moon, asleep).
       Bottom left, on the public site and the portal. The sun's rays turn and it
       glows; each sound sends a ring of light out of it. Muting sets the sun and
       raises a crescent moon with twinkling stars and drifting z's.
   -------------------------------------------------------------------------- */
.fx-sun { position: fixed; z-index: 60; left: max(1rem, env(safe-area-inset-left, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  width: 3rem; height: 3rem; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2), 0 0 0 1px rgba(var(--fx-gold-rgb), .7), 0 0 20px rgba(var(--fx-gold-rgb), .55);
  opacity: 0; transform: translateY(14px) scale(.7); pointer-events: none;
  transition: opacity .4s var(--fx-ease), transform .6s var(--fx-spring), box-shadow .6s var(--fx-ease); }
.fx-sun.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.fx-sun.is-off { box-shadow: 0 8px 22px rgba(0, 0, 0, .28), 0 0 0 1px rgba(var(--fx-gold-rgb), .45), 0 0 14px rgba(150, 160, 220, .28); }
.fx-sun:hover { transform: scale(1.07); }
.fx-sun:active { transform: scale(.94); }
.fx-sun:focus-visible { outline: 2px solid var(--fx-gold-deep); outline-offset: 4px; }
.fx-sun-face { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; isolation: isolate; background: radial-gradient(circle at 35% 28%, #4B2D3A, #241416 75%); }
/* The day sky lies over the night sky and fades away when the sun sets. */
.fx-sun-face::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 35% 28%, #FFFDF3, #FBE7B4 60%, #F3CE7C); transition: opacity .6s var(--fx-ease); }
.fx-sun.is-off .fx-sun-face::before { opacity: 0; }
.fx-sun svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fx-sun-day { color: #D4861F; filter: drop-shadow(0 0 3px rgba(255, 190, 80, .9)); }
.fx-sun-night { color: #F6E7BF; filter: drop-shadow(0 0 3px rgba(246, 231, 191, .6)); }
.fx-sun-star { fill: var(--fx-gold); }
.fx-sun.is-off .fx-sun-day, .fx-sun:not(.is-off) .fx-sun-night { opacity: 0; }
html.fx-on .fx-sun-day, html.fx-on .fx-sun-night { transition: transform .75s var(--fx-spring), opacity .45s var(--fx-ease); }
html.fx-on .fx-sun.is-off .fx-sun-day { transform: translateY(105%) rotate(140deg); }           /* the sun sets */
html.fx-on .fx-sun:not(.is-off) .fx-sun-night { transform: translateY(-105%) rotate(-140deg); }  /* the moon waits above */
.fx-sun-rays, .fx-sun-star { transform-box: view-box; transform-origin: 24px 24px; }
html.fx-on .fx-sun:not(.is-off) .fx-sun-rays { animation: fx-sun-turn 28s linear infinite; }
html.fx-on .fx-sun:not(.is-off) { animation: fx-sun-glow 4.5s ease-in-out infinite; }
html.fx-on .fx-sun.is-off .fx-sun-star { transform-box: fill-box; transform-origin: center; animation: fx-sun-twinkle 2.8s ease-in-out infinite; }
html.fx-on .fx-sun.is-off .fx-sun-star:nth-of-type(2) { animation-delay: -1s; }
html.fx-on .fx-sun.is-off .fx-sun-star:nth-of-type(3) { animation-delay: -1.9s; }
.fx-sun-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(var(--fx-gold-rgb), .9); box-shadow: 0 0 12px rgba(var(--fx-gold-rgb), .6); pointer-events: none; animation: fx-sun-ring 1s var(--fx-ease) both; }
.fx-sun-z { position: absolute; left: 62%; bottom: 78%; width: 2rem; height: 2.6rem; pointer-events: none; display: none; }
html.fx-on .fx-sun.is-off .fx-sun-z { display: block; }
.fx-sun-z i { position: absolute; left: 0; bottom: 0; font: italic 700 .8rem/1 Georgia, 'Times New Roman', serif; color: var(--fx-gold-deep); text-shadow: 0 0 6px rgba(255, 255, 255, .9), 0 0 2px rgba(255, 255, 255, .9); opacity: 0; animation: fx-sun-z 4.2s ease-in-out infinite; }
.fx-sun-z i:nth-child(2) { animation-delay: 1.4s; }
.fx-sun-z i:nth-child(3) { animation-delay: 2.8s; }
@keyframes fx-sun-turn { to { transform: rotate(360deg); } }
@keyframes fx-sun-glow {
  0%, 100% { box-shadow: 0 8px 22px rgba(0, 0, 0, .2), 0 0 0 1px rgba(var(--fx-gold-rgb), .7), 0 0 16px rgba(var(--fx-gold-rgb), .45); }
  50% { box-shadow: 0 8px 22px rgba(0, 0, 0, .2), 0 0 0 4px rgba(var(--fx-gold-rgb), .28), 0 0 30px rgba(var(--fx-gold-rgb), .85); }
}
@keyframes fx-sun-twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.6); } }
@keyframes fx-sun-ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.5); } }
@keyframes fx-sun-z {
  0% { opacity: 0; transform: translate(0, 0) scale(.6) rotate(-8deg); }
  20% { opacity: 1; }
  70% { opacity: .8; }
  100% { opacity: 0; transform: translate(.9rem, -2rem) scale(1.25) rotate(10deg); }
}
@media print { .fx-sun { display: none !important; } }
/* In an open conversation on a phone the reply box owns the bottom of the page. */
@media (max-width: 719px) { .is-portal-thread .fx-sun { display: none !important; } }

/* --------------------------------------------------------------------------
   7. Sound and motion: the invitation, the buttons that open the panel, the panel
   -------------------------------------------------------------------------- */
.fx-invite { position: fixed; z-index: 70; left: max(1rem, env(safe-area-inset-left, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: .35rem; max-width: calc(100vw - 5.5rem); padding: .35rem .4rem .35rem .85rem;
  border-radius: 999px; border: 1px solid rgba(var(--fx-gold-rgb), .6); background: var(--fx-dark); color: #FFF7E6;
  font: 500 .92rem/1.2 var(--font-body, var(--a-font-body, system-ui, sans-serif)); box-shadow: 0 12px 30px rgba(0, 0, 0, .28), 0 0 24px rgba(var(--fx-gold-rgb), .22);
  opacity: 0; transform: translateY(14px); transition: opacity .5s var(--fx-ease), transform .6s var(--fx-spring); }
.fx-invite.is-shown { opacity: 1; transform: none; }
.fx-invite-note { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.fx-invite-note svg { flex: none; width: 1.1rem; height: 1.1rem; color: var(--fx-gold); }
.fx-invite button { font: inherit; cursor: pointer; border: 0; border-radius: 999px; min-height: 2.25rem; }
.fx-invite-yes { padding: .3rem .85rem; background: var(--fx-gold); color: #2A1B16; font-weight: 600; }
.fx-invite-yes:hover { background: #F0CC85; }
.fx-invite-no { width: 2.25rem; padding: 0; background: transparent; color: inherit; opacity: .75; }
.fx-invite-no:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.fx-invite button:focus-visible { outline: 2px solid #FFF3D0; outline-offset: 2px; }
body.admin .fx-invite { bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { body.admin .fx-invite { bottom: 1rem; left: auto; right: 1rem; } }

/* 2.12: no menu carries it any more; clients find it in the portal's Settings, Amy in the admin's Settings (Sound & motion). */
[data-fx-open][hidden] { display: none !important; }
html.fx-sound .a-top-fx { color: var(--fx-gold); }
.a-side-nav a[data-fx-open] svg, .a-top-fx svg { width: 20px; height: 20px; flex: none; }
.a-side-nav a[data-fx-open] svg { opacity: .8; }

.fx-open { display: inline-flex; align-items: center; gap: .45rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; text-decoration-color: rgba(var(--fx-gold-rgb), .6); }
.fx-open:hover { text-decoration-color: currentColor; }
.fx-open svg { width: 1.05em; height: 1.05em; flex: none; }
.fx-open:focus-visible { outline: 2px solid var(--fx-gold); outline-offset: 3px; border-radius: 4px; }
.a-side-foot .fx-open { text-decoration: none; padding: .4rem 0; opacity: .85; font-size: .9rem; }
.a-side-foot .fx-open:hover { opacity: 1; }

.fx-panel { width: min(26rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid rgba(var(--fx-gold-rgb), .5); border-radius: 18px;
  background: var(--fx-surface); color: var(--fx-ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35), 0 0 40px rgba(var(--fx-gold-rgb), .18);
  font: 400 1rem/1.5 var(--font-body, var(--a-font-body, system-ui, sans-serif)); overflow: auto; }
.fx-panel::backdrop { background: rgba(20, 12, 14, .5); backdrop-filter: blur(3px); }
.fx-panel[open] { animation: fx-panel-in .4s var(--fx-spring); }
@keyframes fx-panel-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .fx-panel[open] { animation: none; } }
.fx-panel-in { padding: 1.25rem 1.35rem 1.35rem; display: grid; gap: 1rem; }
.fx-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.fx-panel-title { margin: 0; font: 500 1.25rem/1.2 var(--font-display, var(--a-font-display, Georgia, serif)); color: var(--fx-ink); }
.fx-panel-close { flex: none; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; background: transparent; color: var(--fx-muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.fx-panel-close:hover { background: rgba(var(--fx-gold-rgb), .2); color: var(--fx-ink); }
.fx-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .25rem 1rem; padding: .85rem 0 0; border-top: 1px solid var(--fx-line); }
.fx-row-label { font-weight: 600; color: var(--fx-ink); }
.fx-row-hint { grid-column: 1 / -1; margin: 0; font-size: .9rem; color: var(--fx-muted); }
.fx-switch { position: relative; flex: none; width: 3.1rem; height: 1.8rem; padding: 0; border: 1px solid var(--fx-line); border-radius: 999px; background: rgba(120, 110, 110, .22); cursor: pointer; transition: background-color .25s var(--fx-ease), border-color .25s var(--fx-ease); }
.fx-switch::after { content: ""; position: absolute; top: 50%; left: .18rem; width: 1.35rem; height: 1.35rem; margin-top: -.675rem; border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .3s var(--fx-spring); }
.fx-switch[aria-checked="true"] { background: var(--fx-primary); border-color: var(--fx-primary); }
.fx-switch[aria-checked="true"]::after { transform: translateX(1.28rem); }
.fx-switch[disabled] { opacity: .5; cursor: default; }
.fx-switch:focus-visible, .fx-panel-close:focus-visible, .fx-try:focus-visible { outline: 2px solid var(--fx-primary); outline-offset: 3px; }
.fx-vol { grid-column: 1 / -1; display: flex; align-items: center; gap: .75rem; }
.fx-vol input[type="range"] { flex: 1; min-width: 0; height: 2rem; accent-color: var(--fx-primary); }
.fx-vol[hidden] { display: none; }
.fx-voices { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; }
.fx-voices[hidden] { display: none; }
.fx-voice { padding: .35rem .8rem; min-height: 2.25rem; border: 1px solid var(--fx-line); border-radius: 999px; background: transparent; color: var(--fx-ink); font: inherit; font-size: .92rem; cursor: pointer; transition: background-color .2s var(--fx-ease), border-color .2s var(--fx-ease), color .2s var(--fx-ease), box-shadow .2s var(--fx-ease); }
.fx-voice:hover { border-color: var(--fx-primary); }
.fx-voice[aria-checked="true"] { background: var(--fx-primary); border-color: var(--fx-primary); color: #FFFFFF; box-shadow: 0 0 0 3px rgba(var(--fx-gold-rgb), .35); }
.fx-voice:focus-visible { outline: 2px solid var(--fx-primary); outline-offset: 3px; }
.fx-try { flex: none; padding: .35rem .9rem; min-height: 2.25rem; border: 1px solid var(--fx-primary); border-radius: 999px; background: transparent; color: var(--fx-primary); font: inherit; font-weight: 600; cursor: pointer; }
.fx-try:hover { background: var(--fx-primary); color: #FFFFFF; }
.fx-panel-foot { margin: 0; padding-top: .85rem; border-top: 1px solid var(--fx-line); font-size: .88rem; color: var(--fx-muted); }

/* The speaker button's waves show only while sound is on. */
html:not(.fx-sound) .fx-wave { display: none; }
html.fx-sound .fx-mute { display: none; }

/* 2.12: the same switches inside a card (the portal's Settings page), no dialog around them. */
.pt-fx-controls { display: grid; gap: 1rem; margin-top: .5rem; }
.pt-fx-controls .fx-row-label { font-size: 1.02rem; }
