/* =============================================================================
   Lakeview Multispeciality Clinic · patient website design system (ClinicPro demo, wave 2)
   Four time-aware parts share one system, set on <html data-part="…">:
     morning  fresh mint paper, navy ink, brass        (05:00 – 12:30)
     break    calm sea-glass, softer contrast          (12:30 – 17:00)
     evening  warm amber light, apricot paper          (17:00 – 21:00)
     night    deep navy, starfield, brass glow         (closed)
   --brass is replaced by ?color= (rebrand). Fonts: Instrument Serif (display),
   Inter Tight (UI), IBM Plex Mono (tokens, clocks).
   ============================================================================= */
:root {
  --brass: #b98a2f;
  --navy: #0b1830;
  --serif: 'Instrument Serif', 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Inter Tight', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --ok: #17905f; --warn: #c27c0e; --bad: #d23f3f; --wa: #1faa59; --sos: #d33a3a;
  --r-xl: 34px; --r-lg: 26px; --r: 18px; --r-sm: 12px;
  --ease: cubic-bezier(.2, .75, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --hdr-h: 72px;
}
:root, html[data-part="morning"] {
  color-scheme: light;
  --bg: #f3f8f6; --bg2: #e6f0ec; --card: #ffffff; --card2: #f7fbf9; --field: #ffffff;
  --ink: #0b1830; --mut: #4b5a6c; --line: rgba(11, 24, 48, .09); --line2: rgba(11, 24, 48, .18);
  --teal: #0f8079; --teal-soft: rgba(15, 128, 121, .1);
  --brass-text: color-mix(in srgb, var(--brass) 62%, #2a1b00);
  --brass-soft: color-mix(in srgb, var(--brass) 14%, transparent);
  --glass: rgba(255, 255, 255, .76);
  --shadow: 0 30px 60px -34px rgba(11, 24, 48, .32);
  --shadow-sm: 0 10px 26px -18px rgba(11, 24, 48, .35);
  --sky-a: #dff1ec; --sky-b: #f3f8f6; --sky-glow: rgba(255, 214, 140, .55); --stars: 0;
  --logo-bg: #0b1830; --logo-ink: #ffffff;
  --grid: rgba(15, 128, 121, .075); --trace-glow: 0;
  --st-in: #0f8079; --st-wait: #b8740b; --st-free: #17905f; --st-off: #7b8796;
  --au1: rgba(79, 209, 197, .30); --au2: rgba(214, 170, 80, .20); --au3: rgba(120, 170, 255, .18);
  --spot: rgba(255, 255, 255, .55); --edge-a: color-mix(in srgb, var(--brass) 65%, transparent); --edge-b: color-mix(in srgb, var(--teal) 55%, transparent);
  --holo: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .55) 45%, rgba(160, 255, 240, .35) 50%, rgba(255, 220, 160, .3) 55%, transparent 70%);
}
html[data-part="break"] {
  color-scheme: light;
  --bg: #edf1f1; --bg2: #e1e8e8; --card: #fbfcfc; --card2: #f3f6f6; --field: #ffffff;
  --ink: #15253c; --mut: #56657a; --line: rgba(21, 37, 60, .085); --line2: rgba(21, 37, 60, .17);
  --teal: #2f7d84; --teal-soft: rgba(47, 125, 132, .1);
  --glass: rgba(251, 252, 252, .78);
  --sky-a: #e3e9f1; --sky-b: #edf1f1; --sky-glow: rgba(190, 210, 235, .55); --stars: 0;
  --grid: rgba(47, 125, 132, .07);
  --st-in: #2f7d84;
  --au1: rgba(150, 185, 230, .30); --au2: rgba(47, 125, 132, .16); --au3: rgba(210, 196, 170, .22);
}
html[data-part="evening"] {
  color-scheme: light;
  --bg: #fbf1e3; --bg2: #f5e4cc; --card: #fffaf2; --card2: #fdf4e7; --field: #fffdf9;
  --ink: #1c1a2c; --mut: #66584b; --line: rgba(60, 38, 14, .1); --line2: rgba(60, 38, 14, .2);
  --teal: #0e766f; --teal-soft: rgba(14, 118, 111, .1);
  --brass-text: color-mix(in srgb, var(--brass) 58%, #3a1a00);
  --glass: rgba(255, 250, 242, .8);
  --shadow: 0 30px 60px -34px rgba(90, 50, 10, .35);
  --sky-a: #f9d9ae; --sky-b: #fbf1e3; --sky-glow: rgba(255, 170, 90, .55); --stars: 0;
  --logo-bg: #1c1a2c;
  --grid: rgba(160, 90, 20, .08);
  --st-wait: #b0610b;
  --au1: rgba(255, 158, 84, .30); --au2: rgba(225, 29, 116, .12); --au3: rgba(214, 170, 80, .26);
}
html[data-part="night"] {
  color-scheme: dark;
  --bg: #081224; --bg2: #0c1a31; --card: #0f1d36; --card2: #0c182e; --field: #0a162b;
  --ink: #edf1f7; --mut: #9eabc0; --line: rgba(237, 241, 247, .085); --line2: rgba(237, 241, 247, .17);
  --teal: #4fd1c5; --teal-soft: rgba(79, 209, 197, .12);
  --brass-text: color-mix(in srgb, var(--brass) 82%, #fff);
  --brass-soft: color-mix(in srgb, var(--brass) 16%, transparent);
  --glass: rgba(9, 19, 38, .74);
  --shadow: 0 34px 70px -34px rgba(0, 0, 0, .85);
  --shadow-sm: 0 10px 26px -16px rgba(0, 0, 0, .7);
  --sky-a: #0b1a33; --sky-b: #081224; --sky-glow: rgba(120, 150, 255, .16); --stars: 1;
  --logo-bg: #0f1d36; --logo-ink: #f3e3bd;
  --grid: rgba(79, 209, 197, .06); --trace-glow: 1;
  --st-in: #4fd1c5; --st-wait: #f0b54a; --st-free: #4ade80; --st-off: #8090a8;
  --ok: #3ccf8e; --bad: #ff7a7a;
  --au1: rgba(79, 209, 197, .16); --au2: rgba(120, 110, 255, .18); --au3: rgba(214, 170, 80, .10);
  --spot: rgba(120, 230, 220, .12); --edge-a: color-mix(in srgb, var(--brass) 70%, transparent); --edge-b: color-mix(in srgb, var(--teal) 60%, transparent);
  --holo: linear-gradient(115deg, transparent 30%, rgba(120, 240, 230, .16) 45%, rgba(160, 140, 255, .14) 52%, rgba(241, 223, 179, .14) 58%, transparent 72%);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100vh; }
html.cw-theming body, html.cw-theming .card, html.cw-theming .cw-hdr { transition: background-color .8s ease, color .8s ease, border-color .8s ease; }
[hidden] { display: none !important; }
#cwTop, #cwFoot { display: contents; }
main { display: block; position: relative; z-index: 1; }
section[id] { scroll-margin-top: calc(var(--hdr-h) + 16px); }
a { color: inherit; }
img, svg { max-width: 100%; }
img { display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.04; letter-spacing: -.012em; }
h1, h2 { font-family: var(--serif); }
h1 { font-size: clamp(2.7rem, 6.6vw, 5.6rem); line-height: .98; }
h2 { font-size: clamp(2.2rem, 4.8vw, 3.9rem); margin-top: 14px; }
h3 { font-family: var(--sans); font-weight: 650; font-size: 1.12rem; letter-spacing: -.01em; line-height: 1.25; }
h1 em, h2 em, .serif em { font-style: italic; color: var(--brass-text); }
p { margin: 0; }
.serif { font-family: var(--serif); font-weight: 400; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 1; }
.muted, .mut { color: var(--mut); }
.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
@media (min-width: 768px) { .wrap { width: min(1240px, 100% - 64px); } }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kick { display: inline-flex; align-items: center; gap: 10px; font-size: .72rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--brass-text); }
.kick::before { content: ''; width: 26px; height: 1px; background: currentColor; flex: none; }
.kick.plain::before { display: none; }
.lede { font-size: clamp(1.03rem, 1.4vw, 1.18rem); line-height: 1.68; color: var(--mut); max-width: 590px; }
.fine { font-size: .8rem; color: var(--mut); line-height: 1.55; }
.fine a { color: var(--brass-text); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: .74rem; font-weight: 600; background: var(--teal-soft); color: var(--teal); }
.sec { padding: clamp(72px, 9vw, 124px) 0; position: relative; }
.sec.tight { padding: clamp(48px, 6vw, 80px) 0; }
.sec.alt { background: linear-gradient(180deg, transparent, var(--bg2) 14%, var(--bg2) 86%, transparent); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px 56px; align-items: end; margin-bottom: clamp(30px, 4.4vw, 56px); }
.sec-head p { color: var(--mut); font-size: 1.04rem; line-height: 1.65; }
@media (max-width: 860px) { .sec-head { grid-template-columns: 1fr; } }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; flex: none; box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); animation: cwLive 2s ease-out infinite; }
.live-dot.off { background: var(--st-off); animation: none; }
@keyframes cwLive { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------------------------------------------------------------- sky (behind everything) */
.cw-sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, var(--sky-a), var(--sky-b) 62%); transition: background .9s ease; }
.cw-sky .sky-glow { position: absolute; width: 70vmax; height: 70vmax; right: -18vmax; top: -34vmax; border-radius: 50%; background: radial-gradient(circle, var(--sky-glow), transparent 62%); transition: background .9s ease; }
html[data-part="evening"] .cw-sky .sky-glow { right: auto; left: -20vmax; top: -30vmax; }
.cw-sky .sky-au { position: absolute; border-radius: 50%; will-change: transform; transition: background .9s ease; }
.cw-sky .a1 { width: 62vmax; height: 46vmax; left: -16vmax; top: -12vmax; background: radial-gradient(closest-side, var(--au1), transparent); animation: cwAu1 26s ease-in-out infinite alternate; }
.cw-sky .a2 { width: 56vmax; height: 40vmax; right: -14vmax; top: 18vh; background: radial-gradient(closest-side, var(--au2), transparent); animation: cwAu2 32s ease-in-out infinite alternate; }
.cw-sky .a3 { width: 70vmax; height: 38vmax; left: 18vw; bottom: -18vmax; background: radial-gradient(closest-side, var(--au3), transparent); animation: cwAu3 38s ease-in-out infinite alternate; }
@keyframes cwAu1 { to { transform: translate3d(14vw, 8vh, 0) scale(1.15) rotate(8deg); } }
@keyframes cwAu2 { to { transform: translate3d(-12vw, 10vh, 0) scale(.9) rotate(-10deg); } }
@keyframes cwAu3 { to { transform: translate3d(-10vw, -12vh, 0) scale(1.1); } }
.cw-sky .sky-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000, transparent 75%); mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, #000, transparent 75%); opacity: .8; }
.cw-sky .sky-stars { position: absolute; inset: 0; opacity: calc(var(--stars) * .9); transition: opacity 1.2s ease;
  background-image: radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 28% 8%, #fff 50%, transparent 52%), radial-gradient(1.4px 1.4px at 44% 22%, #f3e3bd 50%, transparent 52%),
    radial-gradient(1px 1px at 63% 12%, #fff 50%, transparent 52%), radial-gradient(1.3px 1.3px at 78% 26%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 91% 9%, #f3e3bd 50%, transparent 52%),
    radial-gradient(1px 1px at 8% 44%, #fff 50%, transparent 52%), radial-gradient(1.2px 1.2px at 35% 38%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 70% 41%, #fff 50%, transparent 52%), radial-gradient(1.1px 1.1px at 86% 52%, #fff 50%, transparent 52%); }
.cw-sky .sky-stars.s2 { background-size: 340px 300px; opacity: calc(var(--stars) * .5); animation: cwTwinkle 6s ease-in-out infinite alternate;
  background-image: radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 70% 60%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 45% 85%, #f3e3bd 50%, transparent 52%); }
@keyframes cwTwinkle { to { opacity: calc(var(--stars) * .15); } }

/* ---------------------------------------------------------------- buttons */
.btn { --b-bg: var(--card); --b-ink: var(--ink); --b-line: var(--line2);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 20px; border-radius: 99px;
  border: 1px solid var(--b-line); background: var(--b-bg); color: var(--b-ink); font-weight: 650; font-size: .95rem; text-decoration: none; line-height: 1.1;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s ease, border-color .25s ease, color .25s ease; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(.98); }
.btn i { font-size: 1.05em; }
.btn.brass { --b-bg: var(--brass); --b-ink: #14100a; --b-line: transparent; box-shadow: 0 12px 30px -16px color-mix(in srgb, var(--brass) 80%, transparent); }
.btn.brass:hover { --b-bg: color-mix(in srgb, var(--brass) 88%, #fff); }
.btn.navy { --b-bg: var(--ink); --b-ink: var(--bg); --b-line: transparent; }
.btn.ghost { --b-bg: transparent; }
.btn.ghost:hover { --b-bg: var(--card); }
.btn.soft { --b-bg: var(--teal-soft); --b-ink: var(--teal); --b-line: transparent; }
.btn.wa { --b-bg: var(--wa); --b-ink: #fff; --b-line: transparent; }
.btn.sos { --b-bg: var(--sos); --b-ink: #fff; --b-line: transparent; }
.btn.sos.ghost { --b-bg: transparent; --b-ink: var(--sos); --b-line: color-mix(in srgb, var(--sos) 45%, transparent); }
html[data-part="night"] .btn.sos.ghost { --b-ink: #ff9b9b; }
.btn.sm { min-height: 38px; padding: 0 15px; font-size: .86rem; }
.btn.lg { min-height: 56px; padding: 0 28px; font-size: 1.02rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--brass-text); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------------------------------------------------------------- cards, chips, pills, segmented */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 2.6vw, 30px); box-shadow: var(--shadow-sm); }
.cw-card-glass { background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 15px; border-radius: 99px; border: 1px solid var(--line2); background: var(--card);
  font-size: .9rem; font-weight: 550; cursor: pointer; transition: all .22s var(--ease); text-decoration: none; color: var(--ink); }
.chip:hover { border-color: var(--teal); transform: translateY(-1px); }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"]::before { content: '\F26E'; font-family: 'bootstrap-icons'; font-size: .95em; }
.chip.flag[aria-pressed="true"] { background: var(--sos); border-color: var(--sos); color: #fff; }
.chip.flag::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--sos); flex: none; }
.chip.flag[aria-pressed="true"]::after { background: #fff; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px; border-radius: 99px; font-size: .78rem; font-weight: 650; line-height: 1.2;
  background: color-mix(in srgb, var(--pc, var(--st-off)) 13%, transparent); color: var(--pc, var(--st-off)); }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.in { --pc: var(--st-in); } .pill.wait, .pill.waiting { --pc: var(--st-wait); } .pill.free, .pill.available { --pc: var(--st-free); } .pill.off, .pill.closed { --pc: var(--st-off); }
.pill.in::before, .pill.free::before, .pill.available::before { animation: cwLive 2s ease-out infinite; box-shadow: 0 0 0 0 currentColor; }
.seg { display: inline-flex; padding: 4px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); gap: 2px; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 99px; font-weight: 600; font-size: .88rem; color: var(--mut); transition: all .25s var(--ease); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 10px -4px rgba(0, 0, 0, .25); }
html[data-part="night"] .seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------------------------------------------------------------- form fields */
.field { display: grid; gap: 7px; min-width: 0; }
.field > label, .field > .lbl { font-size: .8rem; font-weight: 650; letter-spacing: .02em; color: var(--mut); }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 12px 15px; border-radius: 14px; border: 1px solid var(--line2); background: var(--field);
  font-size: 1rem; transition: border-color .2s ease, box-shadow .2s ease; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.field input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 14%, transparent); }
.field .err { font-size: .8rem; color: var(--bad); font-weight: 600; min-height: 0; }
.field .err:empty { display: none; }
.field .hint { font-size: .78rem; color: var(--mut); }
.input-pre { display: flex; align-items: stretch; border: 1px solid var(--line2); border-radius: 14px; background: var(--field); overflow: hidden; transition: border-color .2s ease, box-shadow .2s ease; }
.input-pre:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.input-pre > span { display: grid; place-items: center; padding: 0 12px 0 15px; font-weight: 650; color: var(--mut); border-right: 1px solid var(--line); font-family: var(--mono); font-size: .92rem; }
.input-pre input { border: 0 !important; box-shadow: none !important; border-radius: 0; min-width: 0; }
.input-pre.bad { border-color: var(--bad); }

/* ---------------------------------------------------------------- reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }

/* ---------------------------------------------------------------- demo bar + header */
.cw-skip { position: absolute; left: 12px; top: -80px; z-index: 300; background: var(--brass); color: #14100a; padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.cw-skip:focus { top: 12px; }
.cw-demo { position: relative; z-index: 60; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 18px; padding: 8px 48px 8px 16px;
  background: var(--navy); color: #e8ecf4; font-size: .8rem; text-align: center; }
html[data-part="night"] .cw-demo { background: #050c19; border-bottom: 1px solid var(--line); }
.cw-demo b { color: #f1dfb3; font-weight: 650; }
.cw-demo i { color: var(--brass); }
.cw-demo a { color: #f1dfb3; text-decoration: none; font-weight: 600; border-bottom: 1px solid rgba(241, 223, 179, .35); }
.cw-demo-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #cfd6e4; }
.cw-demo-x:hover { background: rgba(255, 255, 255, .08); }
.cw-hdr { position: sticky; top: 0; z-index: 50; transition: background-color .35s ease, box-shadow .35s ease, border-color .35s ease; border-bottom: 1px solid transparent; }
.cw-hdr.scrolled { background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); border-bottom-color: var(--line); box-shadow: 0 10px 30px -24px rgba(0, 0, 0, .4); }
.cw-hdr-in { display: flex; align-items: center; gap: 18px; min-height: var(--hdr-h); }
.cw-logo { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; flex: none; }
.cw-mark { flex: none; display: block; }
.cw-logo-txt { display: grid; line-height: 1; }
.cw-logo-txt b { font-family: var(--serif); font-weight: 400; font-size: 1.62rem; letter-spacing: -.01em; }
.cw-logo-txt small { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--mut); font-weight: 650; margin-top: 3px; }
.cw-nav { display: flex; align-items: center; gap: 0; margin-left: auto; }
.cw-nav > a, .cw-more-btn { position: relative; padding: 9px 11px; border-radius: 99px; text-decoration: none; font-weight: 600; font-size: .9rem; color: var(--mut); transition: color .2s ease, background-color .2s ease; white-space: nowrap; }
.cw-nav > a:hover, .cw-more-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.cw-nav > a[aria-current="page"], .cw-more-btn[data-cur="1"] { color: var(--ink); }
.cw-nav > a[aria-current="page"]::after, .cw-more-btn[data-cur="1"]::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 2px; border-radius: 2px; background: var(--brass); transform: translateX(-50%); box-shadow: 0 0 10px var(--brass); }
.cw-more { position: relative; }
.cw-more-btn { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 5px; }
.cw-more-btn i { font-size: .7rem; transition: transform .25s var(--ease); }
.cw-more-btn[aria-expanded="true"] i { transform: rotate(180deg); }
.cw-more-pop { position: absolute; right: 0; top: calc(100% + 10px); width: 320px; padding: 12px; border-radius: 22px; background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); display: grid; gap: 2px; animation: cwPop .28s var(--ease); z-index: 70; }
.cw-more-pop .hud { padding: 4px 10px 8px; }
.cw-more-pop a, .cw-more-pop button { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; border: 0; background: transparent; text-decoration: none; text-align: left; width: 100%; color: var(--ink); }
.cw-more-pop a:hover, .cw-more-pop button:hover, .cw-more-pop a:focus-visible, .cw-more-pop button:focus-visible { background: var(--bg2); }
.cw-more-pop i { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--teal-soft); color: var(--teal); font-size: 1.05rem; }
.cw-more-pop span { display: grid; line-height: 1.25; }
.cw-more-pop b { font-size: .9rem; font-weight: 650; }
.cw-more-pop small { font-size: .76rem; color: var(--mut); }
.cw-more-pop a[aria-current="page"] i { background: var(--brass); color: #14100a; }
.cw-more-pop .cw-more-crm { margin-top: 4px; border-top: 1px dashed var(--line2); border-radius: 0 0 14px 14px; padding-top: 12px; }
.cw-more-pop .cw-more-crm i { background: var(--bg2); color: var(--mut); }
.cw-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.cw-find { display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 8px 0 15px; border-radius: 99px; border: 1px solid var(--line2); background: var(--card); color: var(--mut); font-weight: 600; font-size: .88rem; transition: border-color .2s ease, color .2s ease, box-shadow .2s ease; }
.cw-find:hover { border-color: var(--teal); color: var(--ink); box-shadow: 0 0 0 4px var(--teal-soft); }
.cw-find i { font-size: 1rem; color: var(--ink); }
kbd { font-family: var(--mono); font-size: .68rem; font-weight: 600; padding: 3px 7px; border-radius: 7px; border: 1px solid var(--line2); border-bottom-width: 2px; background: var(--bg2); color: var(--mut); line-height: 1.2; white-space: nowrap; }
.cw-dial { display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 14px 0 6px; border-radius: 99px; border: 1px solid var(--line2); background: var(--card); text-align: left; transition: border-color .2s ease, transform .2s var(--ease); }
.cw-dial:hover { border-color: var(--brass); }
.cw-dial-ico { display: grid; place-items: center; width: 34px; height: 34px; color: var(--ink); }
.cw-dial-txt { display: grid; line-height: 1.15; }
.cw-dial-txt b { font-size: .78rem; font-weight: 700; white-space: nowrap; }
.cw-dial-txt small { font-size: .72rem; color: var(--mut); font-weight: 550; white-space: nowrap; }
.cw-dial[data-open="1"] .cw-dial-txt small { color: var(--ok); }
.cw-ask { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 99px; border: 0; background: var(--ink); color: var(--bg); font-weight: 650; font-size: .92rem; transition: transform .2s var(--ease); }
.cw-ask:hover { transform: translateY(-2px); }
.cw-ask i { color: var(--brass); font-size: 1.05rem; }
.cw-burger { display: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line2); background: var(--card); position: relative; flex: none; }
.cw-burger span, .cw-burger span::before, .cw-burger span::after { position: absolute; left: 50%; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transform: translateX(-50%); transition: transform .3s var(--ease), opacity .2s ease; }
.cw-burger span { top: 50%; margin-top: -1px; }
.cw-burger span::before, .cw-burger span::after { content: ''; left: 0; transform: none; }
.cw-burger span::before { top: -6px; } .cw-burger span::after { top: 6px; }
body.cw-nav-open .cw-burger span { background: transparent; }
body.cw-nav-open .cw-burger span::before { transform: translateY(6px) rotate(45deg); }
body.cw-nav-open .cw-burger span::after { transform: translateY(-6px) rotate(-45deg); }
/* ECG scroll progress under the nav */
.cw-ecgbar { position: absolute; left: 0; right: 0; bottom: -11px; height: 22px; pointer-events: none; --sp: 0; opacity: 0; transition: opacity .35s ease; }
.cw-hdr.scrolled .cw-ecgbar { opacity: 1; }
.cw-ecgbar svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cw-ecgbar path { fill: none; stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.cw-ecgbar .b { stroke: var(--line2); opacity: .55; }
.cw-ecgbar .l { stroke: var(--brass); clip-path: inset(0 calc(100% - var(--sp) * 100%) 0 0); filter: drop-shadow(0 0 3px color-mix(in srgb, var(--brass) 70%, transparent)); }
.cw-ecgdot { position: absolute; top: 50%; left: calc(var(--sp) * 100%); width: 7px; height: 7px; margin: 1px 0 0 -3.5px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 25%, transparent), 0 0 12px var(--brass); }
.cw-dialpop { position: absolute; right: max(16px, calc((100vw - 1240px) / 2)); top: calc(100% - 6px); width: min(360px, calc(100vw - 32px)); padding: 16px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); animation: cwPop .3s var(--ease); z-index: 70; }
@keyframes cwPop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.cw-dialpop-head { padding: 4px 6px 12px; }
.cw-dialpop-head p { font-size: .86rem; color: var(--mut); margin-top: 6px; }
.cw-po-list { display: grid; gap: 4px; }
.cw-po { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid transparent; border-radius: 14px; background: transparent; text-align: left; width: 100%; }
.cw-po:hover { background: var(--bg2); }
.cw-po i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--bg2); color: var(--brass-text); font-size: 1.05rem; flex: none; }
.cw-po span { display: grid; line-height: 1.25; }
.cw-po b { font-size: .9rem; font-weight: 650; }
.cw-po small { font-size: .76rem; color: var(--mut); }
.cw-po[aria-pressed="true"] { border-color: var(--brass); background: var(--brass-soft); }
.cw-po[aria-pressed="true"] i { background: var(--brass); color: #14100a; }
.cw-po.auto { margin-top: 6px; border-top: 1px dashed var(--line2); border-radius: 0 0 14px 14px; padding-top: 14px; }
.cw-po.auto[aria-pressed="true"] { border-radius: 14px; border-top-style: solid; }
/* mobile drawer */
.cw-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 90vw); z-index: 80; background: var(--card); border-left: 1px solid var(--line); padding: calc(var(--hdr-h) + 8px) 18px 20px;
  display: flex; flex-direction: column; gap: 16px; transform: translateX(105%); visibility: hidden; transition: transform .45s var(--ease), visibility 0s linear .45s; overflow-y: auto; overscroll-behavior: contain; }
.cw-drawer nav { display: grid; }
.cw-drawer nav a { display: flex; align-items: center; gap: 14px; padding: 11px 6px; font-family: var(--serif); font-size: 1.55rem; line-height: 1.1; text-decoration: none; border-bottom: 1px solid var(--line); }
.cw-drawer nav a i { font-size: 1.05rem; width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--bg2); color: var(--teal); }
.cw-drawer nav a[aria-current="page"] { color: var(--brass-text); font-style: italic; }
.cw-drawer nav a[aria-current="page"] i { background: var(--brass); color: #14100a; }
.cw-drawer-more { display: grid; gap: 8px; }
.cw-drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cw-drawer-grid a, .cw-drawer-grid button { display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); text-decoration: none; font-size: .84rem; font-weight: 650; line-height: 1.2; text-align: left; color: var(--ink); min-width: 0; }
.cw-drawer-grid i { color: var(--teal); font-size: 1.05rem; flex: none; }
.cw-drawer-grid a[aria-current="page"] { border-color: var(--brass); background: var(--brass-soft); }
.cw-drawer-foot { display: grid; gap: 10px; margin-top: auto; }
.cw-drawer-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cw-scrim { position: fixed; inset: 0; z-index: 75; background: rgba(5, 10, 20, .45); opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s linear .35s; }
body.cw-nav-open .cw-drawer { transform: none; visibility: visible; transition: transform .45s var(--ease); box-shadow: var(--shadow); }
body.cw-nav-open .cw-scrim { opacity: 1; visibility: visible; transition: opacity .35s ease; }
body.cw-nav-open .cw-hdr { z-index: 90; background: var(--card); border-bottom-color: var(--line); }
@media (max-width: 1559px) { .cw-dial-txt { display: none; } .cw-dial { padding: 0 6px; } }
@media (max-width: 1260px) { .cw-find-txt, .cw-find kbd, .cw-ask span { display: none; } .cw-find { width: 46px; padding: 0; justify-content: center; } .cw-ask { width: 46px; padding: 0; justify-content: center; } .cw-nav > a, .cw-more-btn { padding: 9px 9px; } }
@media (max-width: 1100px) {
  .cw-nav { display: none; }
  .cw-burger { display: inline-block; }
  .cw-tools { margin-left: auto; }
}
@media (max-width: 560px) {
  :root { --hdr-h: 64px; }
  .cw-logo-txt b { font-size: 1.42rem; }
  .cw-logo-txt small { font-size: .58rem; letter-spacing: .12em; }
  .cw-mark { width: 34px; height: 34px; }
  .cw-tools { gap: 6px; }
  .cw-ask, .cw-burger, .cw-find { width: 42px; height: 42px; }
  .cw-dial { height: 42px; }
  .cw-hdr-in { gap: 10px; }
}
@media (max-width: 430px) { .cw-ask { display: none; } .cw-logo-txt small { display: none; } }


/* ---------------------------------------------------------------- emergency block */
.cw-sos { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px 18px; align-items: center; padding: 16px 18px; border-radius: var(--r);
  background: color-mix(in srgb, var(--sos) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--sos) 28%, transparent); }
.cw-sos-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--sos); color: #fff; font-size: 1.2rem; position: relative; }
.cw-sos-ico::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--sos); opacity: .35; animation: cwSos 2.2s ease-out infinite; }
@keyframes cwSos { to { transform: scale(1.35); opacity: 0; } }
.cw-sos-txt { display: grid; gap: 3px; font-size: .86rem; color: var(--mut); line-height: 1.5; }
.cw-sos-txt b { color: var(--ink); font-size: .98rem; }
.cw-sos-act { display: flex; gap: 8px; flex-wrap: wrap; }
.cw-sos.compact { grid-template-columns: auto minmax(0, 1fr); }
.cw-sos.compact .cw-sos-act { grid-column: 1 / -1; }
@media (max-width: 720px) { .cw-sos { grid-template-columns: auto minmax(0, 1fr); } .cw-sos-act { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------- portraits */
.cw-portrait { display: inline-block; flex: none; border-radius: 50%; filter: drop-shadow(0 12px 18px color-mix(in srgb, var(--doc) 30%, transparent)); }
.cw-portrait svg { display: block; }

/* ---------------------------------------------------------------- footer */
.cw-foot { position: relative; z-index: 1; margin-top: 40px; padding: 30px 0 28px; background: var(--navy); color: #d9dfea; overflow: hidden; }
html[data-part="night"] .cw-foot { background: #050c19; border-top: 1px solid var(--line); }
.cw-foot::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 80% at 85% 0%, color-mix(in srgb, var(--brass) 18%, transparent), transparent 60%); pointer-events: none; }
.cw-foot .wrap { position: relative; }
.cw-foot-word { font-family: var(--serif); font-size: clamp(3rem, 11vw, 9.5rem); line-height: .95; letter-spacing: -.02em; color: #f4f1ea; padding: 40px 0 34px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.cw-foot-word em { color: var(--brass); }
.cw-foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 34px; padding: 40px 0; }
.cw-foot h3 { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: #f1dfb3; margin-bottom: 14px; font-weight: 700; }
.cw-foot p { font-size: .92rem; line-height: 1.6; color: #c2cad8; }
.cw-foot .fine { color: #97a3b8; margin-top: 8px; }
.cw-foot .cw-logo { color: #fff; margin-bottom: 14px; }
.cw-foot .cw-logo-txt small { color: #97a3b8; }
.cw-foot .cw-mark { --logo-bg: #0f1d36; --logo-ink: #f3e3bd; }
.cw-foot-brand p { margin-bottom: 16px; max-width: 320px; }
.cw-foot-link { display: inline-flex; gap: 8px; align-items: center; margin-top: 12px; color: #f1dfb3; font-weight: 600; font-size: .9rem; text-decoration: none; }
.cw-foot-link:hover { text-decoration: underline; }
.cw-times { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.cw-times li { display: flex; justify-content: space-between; gap: 10px; color: #c2cad8; }
.cw-times b { color: #fff; font-weight: 600; }
.cw-live { display: flex; align-items: center; gap: 8px; margin-top: 14px !important; font-size: .84rem !important; font-weight: 600; }
.cw-live .dot { width: 8px; height: 8px; border-radius: 50%; background: #8090a8; flex: none; }
.cw-live.open { color: #7ee2b0 !important; } .cw-live.open .dot { background: #3ccf8e; animation: cwLive 2s infinite; }
.cw-foot-sos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cw-foot .btn.sos.ghost { --b-ink: #ff9b9b; }
.cw-foot-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 18px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.cw-foot-nav a { color: #c2cad8; text-decoration: none; font-size: .9rem; font-weight: 550; }
.cw-foot-nav a:hover { color: #fff; }
.cw-foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .78rem; color: #8f9bb0; }
.cw-foot-base b { color: #f1dfb3; font-weight: 650; }
@media (max-width: 980px) { .cw-foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .cw-foot-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------------------------------------------------------------- toast */
.cw-toast { position: fixed; left: 50%; bottom: 22px; z-index: 400; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px);
  padding: 13px 20px; border-radius: 16px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: .92rem; box-shadow: var(--shadow); transition: opacity .3s ease, transform .4s var(--spring); }
.cw-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 640px) { .cw-toast { bottom: 92px; } }

/* ---------------------------------------------------------------- shared page hero (inner pages) */
.page-hero { position: relative; padding: clamp(44px, 7vw, 92px) 0 clamp(28px, 4vw, 48px); }
.page-hero h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); margin-top: 16px; }
.page-hero .lede { margin-top: 18px; }


/* ================================================================ FUTURISTIC LAYER (wave 2)
   calm medical sci-fi: glass + hairline gradient edges, pointer spotlight, holo sheen,
   HUD micro-labels, scan lines, tilt, tickers. All motion off under reduced motion. */
.cw-portrait { position: relative; }
.cw-portrait-badge { position: absolute; right: -2%; bottom: -2%; width: 36%; height: 36%; min-width: 18px; min-height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); color: var(--h, var(--teal)); border: 1.5px solid var(--h, var(--teal)); font-size: calc(var(--bs, 1) * .8em); font-style: normal; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .35); }
.glass { position: relative; background: radial-gradient(520px circle at var(--mx, -600px) var(--my, -600px), var(--spot), transparent 42%), var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); border-radius: var(--r-xl); box-shadow: var(--shadow); isolation: isolate; }
.glass::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: linear-gradient(140deg, var(--edge-a), transparent 32%, transparent 62%, var(--edge-b));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.cw-card-glass { background: radial-gradient(520px circle at var(--mx, -600px) var(--my, -600px), var(--spot), transparent 42%), var(--glass); }
.fx-glow { background-image: radial-gradient(420px circle at var(--mx, -600px) var(--my, -600px), var(--spot), transparent 45%); }
.fx-holo { position: relative; overflow: hidden; }
.fx-holo::before { content: ''; position: absolute; inset: -40% -60%; background: var(--holo); transform: translateX(-60%) rotate(8deg); opacity: 0; pointer-events: none; transition: transform 1s var(--ease), opacity .4s ease; z-index: 1; mix-blend-mode: soft-light; }
html[data-part="night"] .fx-holo::before { mix-blend-mode: screen; }
.fx-holo:hover::before, .fx-holo:focus-visible::before { transform: translateX(40%) rotate(8deg); opacity: 1; }
[data-tilt] { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease); transform-style: preserve-3d; }
[data-tilt].tilting { transition: transform .12s linear; }
.hud { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--mut); line-height: 1.3; }
.hud b { color: var(--brass-text); font-weight: 600; }
.hud.teal { color: var(--teal); }
.hud.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: cwBlink 1.6s steps(2, start) infinite; flex: none; }
@keyframes cwBlink { 50% { opacity: .25; } }
.hud-frame { position: relative; }
.hud-frame::before { content: ''; position: absolute; inset: 8px; pointer-events: none; z-index: 1; --c: color-mix(in srgb, var(--teal) 60%, transparent); --s: 14px;
  background: linear-gradient(var(--c), var(--c)) top left / var(--s) 1px no-repeat, linear-gradient(var(--c), var(--c)) top left / 1px var(--s) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--s) 1px no-repeat, linear-gradient(var(--c), var(--c)) top right / 1px var(--s) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--s) 1px no-repeat, linear-gradient(var(--c), var(--c)) bottom left / 1px var(--s) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--s) 1px no-repeat, linear-gradient(var(--c), var(--c)) bottom right / 1px var(--s) no-repeat; }
.scanline { position: relative; overflow: hidden; }
.scanline::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 38%; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--teal) 9%, transparent) 70%, color-mix(in srgb, var(--teal) 30%, transparent) 99%, transparent);
  animation: cwScan 6s linear infinite; transform: translateY(-100%); }
@keyframes cwScan { to { transform: translateY(300%); } }
.reveal.blur { filter: blur(10px); transform: translateY(18px) scale(.985); transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease); }
.reveal.blur.in { filter: none; transform: none; }
.reveal.scale { transform: scale(.94); }
.reveal.left { transform: translateX(-28px); }
.reveal.scale.in, .reveal.left.in { transform: none; }
.reveal[style*="--i"] { transition-delay: calc(var(--i) * 55ms); }
[data-count] { font-variant-numeric: tabular-nums; }
/* page enter: cross-document view transitions where supported, a soft fade elsewhere */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: .28s var(--ease) both cwVtOut; }
  ::view-transition-new(root) { animation: .42s var(--ease) both cwVtIn; }
  html.cw-novt main { animation: cwEnter .6s var(--ease) both; }
}
@keyframes cwVtOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes cwVtIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes cwEnter { from { opacity: 0; transform: translateY(12px); } }
html.cw-hidden *, html.cw-hidden *::before, html.cw-hidden *::after { animation-play-state: paused !important; }

/* ================================================================ COMMAND PALETTE */
.cw-pal { position: fixed; inset: 0; z-index: 500; display: grid; justify-items: center; align-items: start; padding: 11vh 12px 12px; }
.cw-pal-scrim { position: absolute; inset: 0; background: rgba(5, 10, 22, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: cwFade .2s ease both; }
@keyframes cwFade { from { opacity: 0; } }
.cw-pal-box { position: relative; width: min(700px, 100%); max-height: min(76vh, 680px); display: flex; flex-direction: column; border-radius: 26px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line2); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .55), 0 0 0 1px color-mix(in srgb, var(--brass) 20%, transparent); animation: cwPop .28s var(--ease) both; }
.cw-pal-box::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--teal), var(--brass), transparent); opacity: .8; }
.cw-pal-head { display: flex; justify-content: space-between; gap: 10px; padding: 14px 20px 0; }
.cw-pal-field { display: flex; align-items: center; gap: 12px; padding: 8px 14px 14px 20px; border-bottom: 1px solid var(--line); }
.cw-pal-field > i { font-size: 1.2rem; color: var(--teal); }
.cw-pal-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 1.15rem; padding: 10px 0; color: var(--ink); }
.cw-pal-field input::placeholder { color: var(--mut); opacity: .8; }
.cw-pal-x { border: 0; background: transparent; padding: 6px; border-radius: 10px; }
.cw-pal-list { list-style: none; margin: 0; padding: 6px 10px 10px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.cw-pal-g { padding: 12px 10px 6px; font-family: var(--mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--mut); font-weight: 600; }
.cw-pal-o { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 14px; cursor: pointer; position: relative; }
.cw-pal-o[aria-selected="true"] { background: var(--bg2); box-shadow: inset 3px 0 0 var(--brass); }
.cw-pal-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--h, var(--teal)) 13%, transparent); color: var(--h, var(--teal)); font-size: 1.1rem; overflow: visible; }
.cw-pal-ic .cw-portrait { filter: none; }
.cw-pal-tx { display: grid; min-width: 0; line-height: 1.3; }
.cw-pal-tx b { font-size: .95rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-pal-tx small { font-size: .78rem; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-pal-o .pill { font-size: .68rem; white-space: nowrap; }
.cw-pal-book { font-size: .76rem; font-weight: 700; text-decoration: none; padding: 6px 12px; border-radius: 99px; background: var(--brass); color: #14100a; }
.cw-pal-o.sos .cw-pal-ic { background: var(--sos); color: #fff; }
.cw-pal-o.sos b { color: var(--sos); }
html[data-part="night"] .cw-pal-o.sos b { color: #ff9b9b; }
.cw-pal-none { display: grid; gap: 6px; padding: 26px 12px; color: var(--mut); font-size: .9rem; }
.cw-pal-none b { color: var(--ink); }
.cw-pal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 20px; border-top: 1px solid var(--line); background: var(--card2); font-size: .74rem; color: var(--mut); }
.cw-pal-foot kbd { margin-right: 3px; }
.cw-pal-note { margin-left: auto; }
html.cw-pal-open { overflow: hidden; }
@media (max-width: 640px) {
  .cw-pal { padding: 8px; }
  .cw-pal-box { max-height: calc(100vh - 16px); border-radius: 22px; }
  .cw-pal-o { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; }
  .cw-pal-o .pill { display: none; }
  .cw-pal-ic { width: 36px; height: 36px; }
  .cw-pal-foot span:not(.cw-pal-note) { display: none; }
  .cw-pal-note { margin-left: 0; }
}

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal, .reveal.blur { opacity: 1; transform: none; filter: none; }
  .cw-sky .sky-au, .scanline::after { animation: none !important; }
  [data-tilt] { transform: none !important; }
}
