/* ==========================================================================
   Winterhoff Design Language — core
   Structure, components, sections and motion. No colors, radii or fonts live
   here: every visual decision comes from a theme file (theme.css), so the same
   markup renders as Soft Glass or Warm Minimal.
   ========================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* the hidden attribute must always win over component display rules */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; }
.wh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Theme switch: one whole-page crossfade (View Transitions API), so text and
   surfaces change together. Browsers without the API switch instantly. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; animation-timing-function: ease; }

/* ---------- Layout ---------- */
.wh-wrap { max-width: 1200px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 720px) { .wh-wrap { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); } }
.wh-section { padding-block: clamp(72px, 10vw, 120px); }
.wh-stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.wh-row { display: flex; flex-wrap: wrap; gap: var(--gap, 12px); align-items: center; }
.wh-grid { display: grid; gap: var(--gap, 16px); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 280px)), 1fr)); }
.wh-grid > * { min-width: 0; }

/* ---------- Type ---------- */
.wh-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--accent-text); }
.wh-eyebrow--pill { padding: 6px 14px; border-radius: var(--r-pill); background: var(--chip); }
.wh-h1 { font-size: clamp(42px, 6.6vw, 84px); line-height: 1.02; }
.wh-h2 { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.07; }
.wh-h3 { font-size: 20px; line-height: 1.3; letter-spacing: -.015em; }
.wh-lead { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.6; color: var(--muted); max-width: 56ch; }
.wh-body { color: var(--muted); max-width: 62ch; }
.wh-small { font-size: 13px; color: var(--muted); }
.wh-head { display: flex; flex-direction: column; gap: 14px; max-width: 700px; }
.wh-head--center { align-items: center; text-align: center; margin-inline: auto; }
.wh-gradient-text { background: var(--text-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
@supports not (background-clip: text) { .wh-gradient-text { color: var(--accent-text); background: none; } }
.wh-num { font-variant-numeric: tabular-nums; }

/* ---------- Surfaces ---------- */
.wh-card {
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: var(--r-lg);
  box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.wh-card--pad { padding: clamp(20px, 3vw, 28px); }
.wh-card--hover { transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }
.wh-card--hover:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }

/* ---------- Navigation ---------- */
.wh-nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; padding-block: 12px; }
.wh-nav__bar {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: var(--r-nav);
  background: var(--nav-bg); border: 1px solid var(--nav-line); box-shadow: var(--nav-shadow);
  -webkit-backdrop-filter: var(--nav-blur); backdrop-filter: var(--nav-blur);
}
.wh-logo { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.wh-logo__mark { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--brand-fill); color: var(--on-brand); display: grid; place-items: center; font-weight: 800; font-size: 15px; box-shadow: var(--brand-shadow); }
.wh-nav__links { display: flex; gap: 2px; margin-inline: auto; }
.wh-nav__links a { padding: 8px 14px; border-radius: var(--r-btn); color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s, background-color .2s; }
.wh-nav__links a:hover { color: var(--fg); background: var(--hover); }
.wh-nav__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.wh-nav .wh-nav__menu { display: none; }
@media (min-width: 821px) { .wh-nav__actions { margin-left: 0; } }
@media (max-width: 820px) {
  .wh-nav .wh-nav__links { display: none; }
  .wh-nav .wh-nav__menu { display: inline-flex; }
  .wh-nav .wh-nav__signin { display: none; }
}

/* ---------- Mobile menu (full-screen sheet, web) ----------
   <dialog class="wh-mmenu"> opened by [data-mmenu-open="id"]. Uses showModal()
   so focus is trapped and Esc closes. Links stagger in; closing animates out. */
.wh-mmenu {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--menu-bg); color: var(--fg); overflow: hidden;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.wh-mmenu::backdrop { background: transparent; }
.wh-mmenu[open] { animation: wh-mmenu-in .4s var(--ease); }
.wh-mmenu.is-closing { animation: wh-mmenu-out .28s var(--ease) forwards; }
.wh-mmenu__panel {
  height: 100%; display: flex; flex-direction: column; gap: 24px; overflow-y: auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: radial-gradient(80% 40% at 0% 0%, var(--aurora-1), transparent 70%), radial-gradient(70% 40% at 100% 100%, var(--aurora-2), transparent 70%);
}
.wh-mmenu__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 4px 4px; }
.wh-mmenu__links { display: flex; flex-direction: column; }
.wh-mmenu__links a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 4px;
  border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none;
  font-family: var(--font-display); font-size: clamp(26px, 8vw, 34px); font-weight: 800; letter-spacing: -.03em;
}
.wh-mmenu__links a svg { width: 22px; height: 22px; color: var(--accent-text); transition: transform .25s var(--ease); }
.wh-mmenu__links a:active svg, .wh-mmenu__links a:hover svg { transform: translateX(4px); }
.wh-mmenu[open] .wh-mmenu__links a, .wh-mmenu[open] .wh-mmenu__foot { animation: wh-fade-up .5s var(--ease) both; animation-delay: calc(80ms + var(--i, 0) * 50ms); }
.wh-mmenu__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; --i: 6; }
.wh-mmenu__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); background: var(--card-bg); border: 1px solid var(--card-line); font-weight: 600; }

/* ---------- Bottom sheet / action sheet ----------
   <dialog class="wh-sheet"> opened by [data-sheet-open="id"]. Slides up from the
   bottom on phones (drag the grabber down to dismiss); becomes a centered card
   from 721px up. */
.wh-sheet {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: 560px; max-height: 88vh; margin: 0 auto; padding: 0;
  border: 1px solid var(--card-line); border-bottom: 0; border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--menu-bg); color: var(--fg); box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); overflow: hidden; touch-action: none;
}
.wh-sheet[open] { display: flex; flex-direction: column; animation: wh-sheet-in .42s var(--ease); }
.wh-sheet.is-closing { animation: wh-sheet-out .28s var(--ease) forwards; }
.wh-sheet.is-dragging { animation: none; transition: none; }
.wh-sheet::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: wh-fade .25s ease; }
.wh-sheet__grab { display: grid; place-items: center; padding: 10px 0 4px; cursor: grab; }
.wh-sheet__grab::before { content: ""; width: 40px; height: 5px; border-radius: 999px; background: var(--line-strong); }
.wh-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 20px 12px; }
.wh-sheet__head h2, .wh-sheet__head h3 { font-size: 18px; letter-spacing: -.02em; }
.wh-sheet__body { overflow-y: auto; padding: 0 12px calc(16px + env(safe-area-inset-bottom, 0px)); touch-action: pan-y; }
.wh-sheet__item {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 12px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--fg); font-size: 16px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color .15s;
}
.wh-sheet__item:hover, .wh-sheet__item:focus-visible { background: var(--hover); outline: none; }
.wh-sheet__item > svg { width: 22px; height: 22px; color: var(--muted); flex-shrink: 0; }
.wh-sheet__item .wh-sheet__icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--r-md); display: grid; place-items: center; background: var(--chip); color: var(--accent-text); }
.wh-sheet__item .wh-sheet__icon svg { width: 20px; height: 20px; }
.wh-sheet__item small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.wh-sheet__item.is-danger, .wh-sheet__item.is-danger > svg { color: var(--error); }
.wh-sheet__item .wh-switch, .wh-sheet__item kbd { margin-left: auto; }
.wh-sheet__sep { height: 1px; margin: 6px 12px; background: var(--line); }
.wh-sheet__cancel { margin: 8px 12px 0; }
@media (min-width: 721px) {
  .wh-sheet { inset: 0; margin: auto; width: min(440px, calc(100% - 32px)); height: fit-content; border-radius: var(--r-lg); border-bottom: 1px solid var(--card-line); }
  .wh-sheet[open] { animation: wh-dialog-in .35s var(--spring); }
  .wh-sheet.is-closing { animation: wh-fade .2s ease reverse forwards; }
  .wh-sheet__grab { display: none; }
  .wh-sheet__head { padding-top: 20px; }
}

/* Menu alignment helper */

.wh-menu__head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.wh-menu__head .wh-avatar { margin: 0; border-color: transparent; }
.wh-menu [role="menuitem"] > svg { width: 18px; height: 18px; color: var(--muted); }
.wh-menu [role="menuitem"] > span { flex: 1; }

/* ---------- Buttons ---------- */
.wh-btn {
  --h: 46px;
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: var(--r-btn); border: 1px solid transparent;
  font-size: 15px; font-weight: var(--btn-weight); line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background-color .2s, border-color .2s, color .2s, filter .2s;
}
.wh-btn:active { transform: scale(.97); }
.wh-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.wh-btn--primary { background: var(--brand-fill); color: var(--on-brand); box-shadow: var(--brand-shadow); }
.wh-btn--primary:hover { filter: brightness(1.1); box-shadow: var(--brand-shadow-hover); }
.wh-btn--secondary { background: var(--surface); color: var(--fg); border-color: var(--line); box-shadow: var(--shadow-sm); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.wh-btn--secondary:hover { border-color: var(--line-strong); }
.wh-btn--secondary[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.wh-btn--ghost { background: transparent; color: var(--accent-text); }
.wh-btn--ghost:hover { background: var(--chip); }
.wh-btn--danger { background: var(--error-bg); color: var(--error); }
.wh-btn--danger-solid { background: var(--error-solid); color: var(--on-error); }
.wh-btn--invert { background: var(--fg); color: var(--bg); }
.wh-btn--sm { --h: 36px; padding: 0 14px; font-size: 13px; border-radius: max(calc(var(--r-btn) - 3px), 6px); }
.wh-btn--lg { --h: 54px; padding: 0 28px; font-size: 16px; }
.wh-btn--icon { width: var(--h); padding: 0; }
.wh-btn--block { width: 100%; }
.wh-btn:disabled, .wh-btn[aria-disabled="true"] { background: var(--disabled-bg); color: var(--disabled-fg); border-color: transparent; box-shadow: none; filter: none; transform: none; cursor: not-allowed; }
.wh-btn.is-loading { color: transparent !important; pointer-events: none; }
.wh-btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--on-brand); border-right-color: transparent; animation: wh-spin .7s linear infinite;
}
.wh-ripple { position: absolute; z-index: -1; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); pointer-events: none; animation: wh-ripple .6s var(--ease) forwards; }
.wh-btn .wh-arrow { transition: transform .25s var(--ease); }
.wh-btn:hover .wh-arrow { transform: translateX(3px); }

/* ---------- Form fields ---------- */
.wh-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wh-label { font-size: 13px; font-weight: 600; }
.wh-input, .wh-select, .wh-textarea {
  width: 100%; min-height: 46px; padding: 0 16px; border-radius: var(--r-field);
  border: 1px solid var(--field-line); background: var(--field-bg); color: var(--fg); font-size: 15px;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.wh-textarea { min-height: 104px; padding: 12px 16px; resize: vertical; line-height: 1.5; }
.wh-input::placeholder, .wh-textarea::placeholder { color: var(--faint); }
.wh-input:hover, .wh-select:hover, .wh-textarea:hover { border-color: var(--line-strong); }
.wh-input:focus, .wh-select:focus, .wh-textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.wh-input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 4px var(--error-bg); animation: wh-shake .35s var(--ease); }
.wh-input:disabled { background: var(--disabled-bg); color: var(--disabled-fg); border-style: dashed; cursor: not-allowed; }
.wh-help { font-size: 12px; color: var(--muted); }
.wh-error { font-size: 12px; font-weight: 600; color: var(--error); }
.wh-affix { position: relative; }
.wh-affix > svg { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.wh-affix > .wh-input { padding-left: 44px; }
.wh-affix--select > svg { left: auto; right: 14px; }
.wh-select { appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer; }
.wh-check { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.wh-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.wh-switch {
  position: relative; flex-shrink: 0; width: 48px; height: 28px; padding: 0; border: 0; border-radius: 999px;
  background: var(--track); cursor: pointer; transition: background-color .25s var(--ease);
}
.wh-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transition: transform .35s var(--spring); }
.wh-switch[aria-checked="true"] { background: var(--brand); }
.wh-switch[aria-checked="true"]::after { transform: translateX(20px); }
.wh-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 10px 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand) 0 var(--val, 50%), var(--track) var(--val, 50%)); cursor: pointer; }
.wh-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--knob); border: 2px solid var(--brand); box-shadow: var(--shadow-sm); transition: transform .15s var(--ease); }
.wh-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--knob); border: 2px solid var(--brand); }
.wh-range:active::-webkit-slider-thumb { transform: scale(1.18); }

/* ---------- Segmented control & tabs (moving ink) ---------- */
.wh-seg { position: relative; display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r-seg); background: var(--track); max-width: 100%; overflow-x: auto; }
.wh-seg button { position: relative; z-index: 1; height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-seg-in); background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: color .25s; }
.wh-seg button[aria-pressed="true"] { color: var(--fg); }
.wh-seg__ink { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: var(--r-seg-in); background: var(--seg-ink); box-shadow: var(--shadow-sm); transition: transform .4s var(--spring), width .4s var(--spring); }
.wh-tabs { position: relative; display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.wh-tabs button { padding: 12px 14px; border: 0; background: transparent; color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: color .2s; }
.wh-tabs button[aria-selected="true"] { color: var(--fg); }
.wh-tabs__ink { position: absolute; bottom: -1px; left: 0; height: 2px; width: 0; border-radius: 2px; background: var(--brand); transition: transform .4s var(--spring), width .4s var(--spring); }
.wh-panel { animation: wh-fade-up .45s var(--ease); }

/* ---------- Status, feedback ---------- */
.wh-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.wh-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.wh-chip--ok { background: var(--chip); color: var(--accent-text); }
.wh-chip--warn { background: var(--warn-bg); color: var(--warn); }
.wh-chip--err { background: var(--error-bg); color: var(--error); }
.wh-chip--neutral { background: var(--track); color: var(--muted); }
.wh-chip--live::before { animation: wh-pulse 1.6s ease-out infinite; }
.wh-chip--info { background: var(--info-bg); color: var(--info); } /* in progress (running, queued) */
.wh-chip--icon::before { content: none; } /* leading inline SVG replaces the dot */
.wh-chip--icon > svg { width: 13px; height: 13px; flex-shrink: 0; }
.wh-tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--r-pill); background: var(--brand-fill); color: var(--on-brand); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.wh-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-size: 14px; border: 1px solid var(--card-line); background: var(--card-bg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.wh-alert__icon { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.wh-alert--success .wh-alert__icon { background: var(--brand-fill); color: var(--on-brand); }
.wh-alert--error { background: var(--error-bg); border-color: transparent; color: var(--error); }
.wh-alert--error .wh-alert__icon { background: var(--error-solid); color: var(--on-error); }
.wh-progress { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; }
.wh-progress > span { display: block; height: 100%; width: var(--p, 50%); border-radius: inherit; background: var(--progress-fill); transform-origin: left; }
.wh-skel { position: relative; overflow: hidden; border-radius: var(--r-xs); background: var(--track); }
.wh-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--shimmer), transparent); animation: wh-shimmer 1.4s ease-in-out infinite; }
.wh-avatars { display: flex; }
.wh-avatar { width: 36px; height: 36px; margin-left: -10px; border-radius: 50%; border: 2px solid var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 700; transition: transform .25s var(--spring); }
.wh-avatar:first-child { margin-left: 0; }
.wh-avatars:hover .wh-avatar { transform: translateX(calc(var(--i, 0) * 4px)); }
.wh-avatar--1 { background: var(--avatar-1); color: var(--on-brand); }
.wh-avatar--2 { background: var(--avatar-2); color: var(--on-brand); }
.wh-avatar--3 { background: var(--avatar-3); color: var(--on-brand); }
.wh-avatar--more { background: var(--chip); color: var(--accent-text); }
.wh-badge-wrap { position: relative; display: inline-flex; }
.wh-badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--error-solid); color: var(--on-error); font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); animation: wh-pop .4s var(--spring); }

/* Tooltip */
.wh-tip { position: relative; display: inline-flex; }
.wh-tip__bubble {
  position: absolute; bottom: calc(100% + 10px); left: 50%; translate: -50% 4px; padding: 7px 12px; border-radius: var(--r-sm);
  background: var(--fg); color: var(--bg); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .2s, translate .25s var(--ease);
}
.wh-tip__bubble::after { content: ""; position: absolute; top: 100%; left: 50%; translate: -50% 0; border: 5px solid transparent; border-top-color: var(--fg); }
.wh-tip:hover .wh-tip__bubble, .wh-tip:focus-within .wh-tip__bubble { opacity: 1; translate: -50% 0; }

/* Menu */
.wh-menu-wrap { position: relative; display: inline-block; }
.wh-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: 220px; padding: 6px;
  border-radius: var(--r-md); background: var(--menu-bg); border: 1px solid var(--card-line); box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transform-origin: top left;
}
.wh-menu:not([hidden]) { animation: wh-pop .2s var(--ease); }
.wh-menu.wh-menu--right, .wh-menu.is-flip-x { left: auto; right: 0; transform-origin: top right; }
.wh-menu.wh-menu--up, .wh-menu.is-flip-y { top: auto; bottom: calc(100% + 8px); transform-origin: bottom left; }
.wh-menu { max-width: calc(100vw - 32px); }
.wh-menu [role="menuitem"] { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px; height: 38px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg); font-size: 14px; text-align: left; cursor: pointer; }
.wh-menu [role="menuitem"]:hover, .wh-menu [role="menuitem"]:focus-visible { background: var(--hover); outline: none; }
.wh-menu kbd { font-family: inherit; font-size: 12px; color: var(--muted); }
.wh-menu hr { margin: 6px; border: 0; border-top: 1px solid var(--line); }
.wh-menu .is-danger { color: var(--error); }

/* Dialog */
.wh-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 1px solid var(--card-line); border-radius: var(--r-lg); background: var(--menu-bg); color: var(--fg); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.wh-dialog[open] { animation: wh-dialog-in .35s var(--spring); }
.wh-dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: wh-fade .25s ease; }
.wh-dialog__body { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.wh-dialog__icon { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--error-bg); color: var(--error); display: grid; place-items: center; }
.wh-dialog__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* Toasts */
.wh-toasts { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.wh-toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--toast-bg); color: var(--toast-fg); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; animation: wh-toast-in .45s var(--spring); }
.wh-toast.is-leaving { animation: wh-toast-out .3s var(--ease) forwards; }
.wh-toast__dot { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--brand-fill); color: var(--on-brand); font-size: 12px; font-weight: 800; }
.wh-toast--error .wh-toast__dot { background: var(--error-solid); color: var(--on-error); }

/* Table */
.wh-table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.wh-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
.wh-table th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--table-head); }
.wh-table td { padding: 14px 16px; border-top: 1px solid var(--line); }
.wh-table tbody tr { transition: background-color .2s; }
.wh-table tbody tr:hover { background: var(--hover); }
.wh-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.wh-table__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* Calendar */
.wh-cal { display: flex; flex-direction: column; gap: 12px; }
.wh-cal__head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.wh-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 4px; text-align: center; font-size: 13px; }
.wh-cal__dow { font-size: 11px; font-weight: 600; color: var(--muted); padding-bottom: 6px; }
.wh-cal__cell { position: relative; height: 38px; display: grid; place-items: center; }
.wh-cal__cell.is-band { background: var(--chip); }
.wh-cal__cell.is-start { background: linear-gradient(90deg, transparent 50%, var(--chip) 50%); }
.wh-cal__cell.is-end { background: linear-gradient(90deg, var(--chip) 50%, transparent 50%); }
.wh-cal__cell.is-start.is-end { background: none; }
.wh-cal__day { width: 36px; height: 36px; border: 0; border-radius: var(--r-cal); background: transparent; color: var(--fg); font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color .2s, transform .2s var(--spring); }
.wh-cal__day:hover { background: var(--hover); }
.wh-cal__day.is-out { color: var(--faint); }
.wh-cal__day.is-today { box-shadow: inset 0 0 0 1.5px var(--brand); font-weight: 700; }
.wh-cal__day.is-sel { background: var(--brand-fill); color: var(--on-brand); font-weight: 700; transform: scale(1.04); }

/* Stepper */
.wh-steps { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 600; }
.wh-steps__line { flex: 1; height: 2px; border-radius: 2px; background: var(--track); overflow: hidden; }
.wh-steps__line > span { display: block; height: 100%; width: var(--p, 0%); background: var(--brand); transition: width .6s var(--ease); }
.wh-step { display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.wh-step__dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--track); transition: background-color .3s, color .3s, box-shadow .3s; }
.wh-step.is-done { color: var(--fg); }
.wh-step.is-done .wh-step__dot { background: var(--brand-fill); color: var(--on-brand); }
.wh-step.is-current { color: var(--fg); }
.wh-step.is-current .wh-step__dot { background: transparent; box-shadow: inset 0 0 0 2px var(--brand); color: var(--accent-text); }
@media (max-width: 480px) { .wh-step__label { display: none; } .wh-step.is-current .wh-step__label { display: inline; } }

/* Dropzone & empty state */
.wh-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; text-align: center; border: 2px dashed var(--dash); border-radius: var(--r-lg); background: var(--card-bg); cursor: pointer; transition: border-color .2s, background-color .2s, transform .25s var(--spring); }
.wh-drop:hover, .wh-drop.is-drag { border-color: var(--brand); background: var(--chip); }
.wh-drop.is-drag { transform: scale(1.02); }
.wh-drop__icon, .wh-empty__icon { width: 46px; height: 46px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--chip); color: var(--accent-text); }
.wh-drop__files { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.wh-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 16px; text-align: center; }

/* Accordion */
.wh-faq { display: flex; flex-direction: column; gap: var(--faq-gap); }
.wh-faq details { border-radius: var(--r-faq); background: var(--faq-bg); border: 1px solid var(--faq-line); border-width: var(--faq-border); overflow: hidden; }
.wh-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px var(--faq-pad); font-size: 17px; font-weight: 600; cursor: pointer; list-style: none; }
.wh-faq summary::-webkit-details-marker { display: none; }
.wh-faq__plus { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--accent-text); transition: transform .35s var(--spring); }
.wh-faq details[open] .wh-faq__plus { transform: rotate(45deg); }
.wh-faq__a { padding: 0 var(--faq-pad) 20px; color: var(--muted); max-width: 70ch; }

/* ---------- Charts ---------- */
.wh-chart-line { fill: none; stroke: var(--chart-1); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wh-chart-line--2 { stroke: var(--chart-2); stroke-width: 2; stroke-dasharray: 3 7; opacity: .7; }
.wh-chart-area { fill: url(#wh-area); }
.wh-chart-grid { stroke: var(--line); stroke-dasharray: 2 6; }
.wh-chart-dot { fill: var(--chart-1); stroke: var(--surface-solid); stroke-width: 3; }
.wh-chart-pulse { fill: var(--chart-1); opacity: .35; transform-box: fill-box; transform-origin: center; animation: wh-ping 2s ease-out infinite; }
.wh-bars { display: flex; align-items: flex-end; gap: 8px; height: 96px; }
.wh-bars > span { flex: 1; height: var(--h); border-radius: var(--r-bar); background: var(--bar-idle); transform-origin: bottom; transition: background-color .2s; }
.wh-bars > span.is-hi { background: var(--bar-fill); }
.wh-bars > span:hover { background: var(--bar-fill); }
.wh-bars__labels { display: flex; gap: 8px; font-size: 11px; color: var(--muted); }
.wh-bars__labels > span { flex: 1; text-align: center; }
.wh-donut circle { fill: none; stroke-width: 12; }
.wh-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.wh-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ==========================================================================
   Marketing sections
   ========================================================================== */
.wh-hero { position: relative; isolation: isolate; overflow: clip; background: var(--hero-bg); }
.wh-aurora { position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1; opacity: var(--aurora-opacity); pointer-events: none; }
.wh-aurora span { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(60px); animation: wh-drift 18s ease-in-out infinite alternate; }
.wh-aurora span:nth-child(1) { background: var(--aurora-1); top: -10%; left: -8%; }
.wh-aurora span:nth-child(2) { background: var(--aurora-2); top: 5%; right: -12%; animation-duration: 22s; animation-delay: -6s; }
.wh-aurora span:nth-child(3) { background: var(--aurora-3); top: 45%; left: 30%; animation-duration: 26s; animation-delay: -12s; }
.wh-hero__inner { padding-block: clamp(56px, 9vw, 104px) clamp(64px, 9vw, 112px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; }
.wh-hero__badge { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--card-line); font-size: 13px; font-weight: 600; text-decoration: none; color: var(--fg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: transform .25s var(--ease); }
.wh-hero__badge:hover { transform: translateY(-2px); }
.wh-hero__title { max-width: 15ch; }
.wh-hero__ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.wh-preview { width: 100%; max-width: 1000px; margin-top: 32px; padding: 12px; border-radius: var(--r-xl); text-align: left; background: var(--preview-frame); border: 1px solid var(--card-line); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.wh-preview__inner { display: grid; gap: 12px; padding: 12px; border-radius: calc(var(--r-xl) - 10px); background: var(--preview-inner); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.wh-preview__inner > * { min-width: 0; }
.wh-preview__inner > .wh-card { border-radius: calc(var(--r-xl) - 18px); } /* nested radius = outer radius minus the gap */
.wh-kpi { display: flex; flex-direction: column; gap: 4px; padding: 18px; }
.wh-kpi__value { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.wh-preview__chart { grid-column: 1 / -1; padding: 18px; }
@media (min-width: 760px) { .wh-preview__inner { grid-template-columns: 1fr 1fr 2fr; } .wh-preview__chart { grid-column: auto; } }

.wh-logos { padding-block: 40px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.wh-logos__label { text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 20px; }
.wh-logos__track { display: flex; gap: 64px; width: max-content; animation: wh-marquee 28s linear infinite; }
.wh-logos__track span { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--muted); opacity: .6; white-space: nowrap; }
.wh-logos:hover .wh-logos__track { animation-play-state: paused; }

.wh-feature { display: flex; flex-direction: column; gap: 14px; }
.wh-feature__icon { width: 50px; height: 50px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--icon-tile); color: var(--icon-tile-fg); transition: transform .4s var(--spring); }
.wh-feature:hover .wh-feature__icon { transform: rotate(-6deg) scale(1.08); }
.wh-feature__icon svg { width: 22px; height: 22px; }

.wh-band { background: var(--band-bg); color: var(--band-fg); border-radius: var(--r-band); overflow: hidden; }
.wh-band__inner { padding: clamp(36px, 6vw, 72px); display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.wh-stat { display: flex; flex-direction: column; gap: 6px; }
.wh-stat__value { font-family: var(--font-display); font-size: clamp(44px, 5vw, 60px); font-weight: var(--display-weight); letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.wh-stat__label { font-size: 15px; color: var(--band-muted); }

.wh-split { display: grid; gap: clamp(32px, 6vw, 72px); align-items: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.wh-split > * { min-width: 0; }
.wh-checklist { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.wh-checklist li { display: flex; gap: 12px; align-items: flex-start; }
.wh-checklist li::before { content: "✓"; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--accent-text); font-size: 12px; font-weight: 800; }
.wh-shot { aspect-ratio: 4 / 3; max-width: 100%; border-radius: var(--r-xl); display: grid; place-items: center; background: var(--shot-bg); border: 1px solid var(--card-line); color: var(--muted); font-size: 14px; overflow: hidden; }

.wh-quote { display: grid; gap: 28px; padding: clamp(28px, 6vw, 72px); }
.wh-quote blockquote { margin: 0; font-family: var(--font-display); font-size: clamp(22px, 2.8vw, 32px); font-weight: var(--quote-weight); line-height: 1.35; letter-spacing: -.02em; }
.wh-quote figcaption { display: flex; align-items: center; gap: 14px; }
.wh-quote__avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-fill); }

.wh-price { display: flex; flex-direction: column; gap: 18px; padding: 30px; }
.wh-price.is-featured { border: 1.5px solid var(--brand); box-shadow: var(--featured-shadow); }
.wh-price__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wh-price__amount { display: flex; align-items: baseline; gap: 6px; }
.wh-price__amount strong { font-family: var(--font-display); font-size: 46px; font-weight: var(--display-weight); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.wh-price ul { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 18px 0 0; border-top: 1px solid var(--line); list-style: none; font-size: 15px; }
.wh-price li::before { content: "✓"; margin-right: 10px; color: var(--accent-text); font-weight: 800; }
.wh-price .wh-btn { margin-top: auto; }

.wh-cta { background: var(--cta-bg); color: var(--cta-fg); border-radius: var(--r-band); position: relative; overflow: hidden; isolation: isolate; }
.wh-cta__inner { padding: clamp(36px, 7vw, 88px) clamp(20px, 5vw, 64px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; }
.wh-cta p { color: var(--cta-muted); }
.wh-cta__form { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 320px; max-width: 480px; }
.wh-cta__form .wh-field { flex: 1 1 220px; }
.wh-cta__form .wh-input { background: var(--cta-field-bg); border-color: var(--cta-field-line); color: var(--cta-fg); }
.wh-cta__form .wh-input::placeholder { color: var(--cta-muted); }
.wh-cta__form .wh-error { color: var(--cta-fg); }
.wh-cta__glow { position: absolute; inset: auto -20% -60% auto; width: 60%; aspect-ratio: 1; border-radius: 50%; background: var(--cta-glow); filter: blur(60px); z-index: -1; animation: wh-drift 14s ease-in-out infinite alternate; }

.wh-footer { padding-block: 56px 32px; }
.wh-footer__grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); padding-bottom: 40px; }
.wh-footer__col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.wh-footer__col a { color: var(--muted); text-decoration: none; transition: color .2s; }
.wh-footer__col a:hover { color: var(--fg); }
.wh-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* Component library section */
.wh-lib { display: grid; gap: 16px; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.wh-lib > * { min-width: 0; }
.wh-demo { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.wh-demo--wide { grid-column: 1 / -1; }
.wh-demo__title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.wh-demo__title code { font-size: 11px; font-weight: 500; color: var(--faint); }
.wh-swatches { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.wh-swatch { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; font-size: 11px; color: var(--muted); }
.wh-swatch i { height: 52px; border-radius: var(--r-sm); border: 1px solid var(--line); transition: transform .25s var(--spring); }
.wh-swatch:hover i { transform: translateY(-3px); }
.wh-swatch b { color: var(--fg); font-weight: 600; }
.wh-type-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.wh-type-row:last-child { border-bottom: 0; }

/* ==========================================================================
   Motion
   ========================================================================== */
[data-reveal].is-pending { opacity: 0; transform: translateY(28px); }
[data-reveal].is-pending.is-in { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }

@keyframes wh-spin { to { transform: rotate(360deg); } }
@keyframes wh-ripple { to { transform: scale(2.6); opacity: 0; } }
@keyframes wh-pop { from { opacity: 0; transform: scale(.94) translateY(-4px); } }
@keyframes wh-fade { from { opacity: 0; } }
@keyframes wh-fade-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes wh-dialog-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes wh-toast-in { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes wh-toast-out { to { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes wh-shimmer { to { transform: translateX(100%); } }
@keyframes wh-pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes wh-ping { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes wh-shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes wh-marquee { to { transform: translateX(-50%); } }
@keyframes wh-mmenu-in { from { opacity: 0; transform: translateY(-12px); } }
@keyframes wh-mmenu-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes wh-sheet-in { from { transform: translateY(100%); } }
@keyframes wh-sheet-out { to { transform: translateY(100%); } }
@keyframes wh-drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6%, 4%) scale(1.08); } 100% { transform: translate(-4%, 8%) scale(.96); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal].is-pending { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
