/* =========================================================
   ДентаКвіз — дизайн-система «Porcelain & Ink»
   1. Токени (незмінні: шрифти, шкала, відступи, радіуси, рух, шари)
   2. Колірні теми: світла / темна + локальні області .scope-light / .scope-dark
   3. База → компоненти → секції → демо → адаптив
   ========================================================= */

/* ===== 1. Токени ===== */
:root {
  /* Шрифти */
  --font-sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* Типографічна шкала (1.25, з fluid-заголовками) */
  --fs-2xs: .6875rem;  /* 11 */
  --fs-xs: .75rem;     /* 12 */
  --fs-sm: .875rem;    /* 14 */
  --fs-base: 1rem;     /* 16 */
  --fs-md: 1.125rem;   /* 18 */
  --fs-lg: 1.25rem;    /* 20 */
  --fs-xl: 1.5rem;     /* 24 */
  --fs-2xl: 2rem;      /* 32 */
  --fs-3xl: clamp(2rem, 1.35rem + 2.4vw, 3.25rem);
  --fs-4xl: clamp(2.5rem, 1.5rem + 3.6vw, 4.25rem);
  --fs-display: clamp(4.5rem, 2rem + 9vw, 8.5rem);
  --lh-tight: 1.04;
  --lh-snug: 1.25;
  --lh-base: 1.6;
  --tracking-display: -.045em;
  --tracking-tight: -.03em;
  --tracking-snug: -.015em;
  --tracking-caps: .08em;

  /* Відступи — сітка 4/8 */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px; --s-32: 128px;

  /* Радіуси */
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-full: 999px;

  /* Рух */
  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 360ms; --dur-slower: 640ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);

  /* Шари */
  --z-base: 1; --z-raised: 10; --z-sticky: 50; --z-overlay: 100; --z-modal: 150; --z-toast: 200;

  /* Розміри */
  --header-h: 64px;
  --container: 1200px;

  /* Брендові кольори (незалежні від теми) */
  --ink: #0e0f0c;
  --porcelain: #f6f5f1;
  --lime: #c9f24a;
  --lime-strong: #b6e21f;
  --c-telegram: #2a9fd8;
  --c-viber: #7360f2;
  --c-whatsapp: #25a35a;
  --c-sms: #64748b;
  --c-email: #c2410c;

  /* Колір віджета клініки (змінюється з адмінки через JS) */
  --w-accent: #0f9488;
}

/* ===== 2. Колірні теми ===== */
:root, .scope-light {
  color-scheme: light;
  --bg: #f6f5f1;
  --bg-elevated: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f2ed;
  --surface-3: #e9e8e2;
  --border: rgba(14, 15, 12, .09);
  --border-strong: rgba(14, 15, 12, .16);
  --text: #0e0f0c;
  --text-2: #45473f;
  --text-3: #686a62;
  --accent: var(--lime);
  --accent-hover: var(--lime-strong);
  --on-accent: var(--ink);
  --accent-text: #3f5c00;
  --accent-soft: rgba(201, 242, 74, .32);
  --primary-bg: var(--ink);
  --primary-bg-hover: #262822;
  --primary-fg: var(--porcelain);
  --focus: #4a6b00;
  --success: #166534;
  --success-soft: #e2f4e6;
  --warning: #9a5b00;
  --warning-soft: #fbf0d9;
  --danger: #c2361d;
  --danger-soft: #fde8e3;
  --overlay: rgba(14, 15, 12, .42);
  --glass: rgba(246, 245, 241, .72);
  --noise-opacity: .05;
  --noise-invert: 0;
  --shadow-xs: 0 1px 2px rgba(14, 15, 12, .06);
  --shadow-sm: 0 1px 2px rgba(14, 15, 12, .05), 0 2px 6px -2px rgba(14, 15, 12, .08);
  --shadow-md: 0 1px 2px rgba(14, 15, 12, .04), 0 4px 10px -2px rgba(14, 15, 12, .06), 0 16px 32px -12px rgba(14, 15, 12, .12);
  --shadow-lg: 0 1px 2px rgba(14, 15, 12, .04), 0 8px 18px -6px rgba(14, 15, 12, .08), 0 36px 72px -24px rgba(14, 15, 12, .22);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .7);
  --logo-tooth: var(--ink);
  --logo-dot: var(--lime);
  --hl-h: .36em;
  --hl-bottom: .04em;
  --hl-fg: inherit;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0c0a;
    --bg-elevated: #10110e;
    --surface: #141511;
    --surface-2: #1b1c18;
    --surface-3: #25261f;
    --border: rgba(246, 245, 241, .08);
    --border-strong: rgba(246, 245, 241, .15);
    --text: #f3f2ed;
    --text-2: #c0c1b8;
    --text-3: #92948a;
    --accent: var(--lime);
    --accent-hover: #d6f86c;
    --on-accent: var(--ink);
    --accent-text: #d4f565;
    --accent-soft: rgba(201, 242, 74, .14);
    --primary-bg: var(--lime);
    --primary-bg-hover: #d6f86c;
    --primary-fg: var(--ink);
    --focus: var(--lime);
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, .12);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, .12);
    --danger: #ff7a5c;
    --danger-soft: rgba(255, 122, 92, .12);
    --overlay: rgba(0, 0, 0, .6);
    --glass: rgba(11, 12, 10, .7);
    --noise-opacity: .04;
    --noise-invert: 1;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px -2px rgba(0, 0, 0, .4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -6px rgba(0, 0, 0, .5);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -8px rgba(0, 0, 0, .55), 0 40px 80px -24px rgba(0, 0, 0, .7);
    --highlight: inset 0 1px 0 rgba(255, 255, 255, .05);
    --logo-tooth: var(--porcelain);
    --logo-dot: var(--lime);
    --hl-h: 0em;
    --hl-bottom: -.06em;
    --hl-fg: var(--lime);
  }
}

:root[data-theme="dark"], .scope-dark {
  color-scheme: dark;
  --bg: #0b0c0a;
  --bg-elevated: #10110e;
  --surface: #141511;
  --surface-2: #1b1c18;
  --surface-3: #25261f;
  --border: rgba(246, 245, 241, .08);
  --border-strong: rgba(246, 245, 241, .15);
  --text: #f3f2ed;
  --text-2: #c0c1b8;
  --text-3: #92948a;
  --accent: var(--lime);
  --accent-hover: #d6f86c;
  --on-accent: var(--ink);
  --accent-text: #d4f565;
  --accent-soft: rgba(201, 242, 74, .14);
  --primary-bg: var(--lime);
  --primary-bg-hover: #d6f86c;
  --primary-fg: var(--ink);
  --focus: var(--lime);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, .12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, .12);
  --danger: #ff7a5c;
  --danger-soft: rgba(255, 122, 92, .12);
  --overlay: rgba(0, 0, 0, .6);
  --glass: rgba(11, 12, 10, .7);
  --noise-opacity: .04;
  --noise-invert: 1;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px -2px rgba(0, 0, 0, .4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -6px rgba(0, 0, 0, .5);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -8px rgba(0, 0, 0, .55), 0 40px 80px -24px rgba(0, 0, 0, .7);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .05);
  --logo-tooth: var(--porcelain);
  --logo-dot: var(--lime);
  --hl-h: 0em;
  --hl-bottom: -.06em;
  --hl-fg: var(--lime);
}

/* Віджет — це вставка на сайт клініки, тож він завжди світлий */
.scope-light, .scope-dark { color: var(--text); }

/* ===== 3. База ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--s-4)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
  transition: background-color var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out);
}
/* Шум поверх фону — ледь помітна «фактура паперу» */
body::before {
  content: ""; position: fixed; inset: 0; z-index: var(--z-overlay); pointer-events: none;
  opacity: var(--noise-opacity); filter: invert(var(--noise-invert));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; text-wrap: balance; }
h1 { font-size: var(--fs-4xl); line-height: var(--lh-tight); letter-spacing: var(--tracking-display); }
h2 { font-size: var(--fs-3xl); line-height: 1.08; letter-spacing: var(--tracking-display); }
h3 { font-size: var(--fs-md); line-height: var(--lh-snug); letter-spacing: var(--tracking-snug); }
h4 { font-size: var(--fs-base); line-height: var(--lh-snug); }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
code { font-family: var(--font-mono); font-size: .9em; padding: .1em .35em; border-radius: var(--r-xs); background: var(--surface-2); border: 1px solid var(--border); }
::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-xs); }
[hidden] { display: none !important; }
section[id] { scroll-margin-top: var(--header-h); }

.icon { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s-4); top: -64px; z-index: var(--z-toast); background: var(--primary-bg); color: var(--primary-fg); padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); font-weight: 500; text-decoration: none; transition: top var(--dur-base) var(--ease-out); }
.skip-link:focus { top: var(--s-3); }
.muted { color: var(--text-3); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-6); }
.section { position: relative; padding: var(--s-32) 0 0; }
.section:last-of-type { padding-bottom: var(--s-32); }

/* Заголовок секції: редакційна сітка — мітка й заголовок ліворуч, опис праворуч */
.section-head {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); column-gap: var(--s-16); align-items: end;
  margin-bottom: var(--s-16); padding-bottom: var(--s-8); border-bottom: 1px solid var(--border);
}
.section-head .eyebrow { grid-column: 1 / -1; }
.section-head h2 { margin: 0; }
.section-head > p:last-child { margin: 0; color: var(--text-2); font-size: var(--fs-md); max-width: 44ch; justify-self: end; }
.section-head-stack { display: block; border: 0; padding: 0; }
.section-head-stack > p:last-child { justify-self: auto; margin-top: var(--s-4); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-3); margin: 0 0 var(--s-5);
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-3);
}
.eyebrow span { color: var(--accent-text); }
.eyebrow span::after { content: ""; display: inline-block; width: 24px; height: 1px; margin-left: var(--s-3); vertical-align: middle; background: var(--border-strong); }
.lead { font-size: var(--fs-md); color: var(--text-2); line-height: 1.55; }

/* ===== Кнопки ===== */
.btn {
  --btn-h: 44px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--btn-h); padding: 0 var(--s-5); border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 500; font-size: var(--fs-base); letter-spacing: -.01em; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:focus-visible { outline-offset: 3px; border-radius: var(--r-sm); }
.btn-sm { --btn-h: 36px; padding: 0 var(--s-3); font-size: var(--fs-sm); gap: 6px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { --btn-h: 52px; padding: 0 var(--s-6); font-size: var(--fs-base); }
.btn-block { width: 100%; }
.btn-arrow { width: 18px; height: 18px; transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* Основна кнопка (клас .btn-accent лишився для сумісності зі script.js) */
.btn-accent {
  background: var(--primary-bg); color: var(--primary-fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(14, 15, 12, .2), 0 6px 16px -6px rgba(14, 15, 12, .35);
}
.btn-accent:hover { background: var(--primary-bg-hover); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.is-loading, .btn.is-loading:disabled { color: transparent; pointer-events: none; opacity: 1; cursor: progress; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--primary-fg); border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: transparent; color: var(--text-2);
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn .icon { width: 18px; height: 18px; }

/* Бейдж */
.badge {
  display: inline-flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-6); padding: 6px var(--s-3) 6px var(--s-2);
  border: 1px solid var(--border); border-radius: var(--r-full); background: var(--glass); backdrop-filter: blur(8px);
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-2);
}
.badge-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px var(--accent-soft); }
.badge-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--lime); animation: ping 2s var(--ease-out) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

/* Іконка-плитка */
.tile-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-xs), var(--highlight);
}
.tile-icon .icon { width: 20px; height: 20px; }

/* Скелетон */
.skeleton {
  display: block; border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Поява при скролі (лише якщо JS увімкнено) */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--dur-slower) var(--ease-out), transform var(--dur-slower) var(--ease-out); transition-delay: var(--reveal-delay, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ===== Логотип ===== */
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; border-radius: var(--r-xs); }
.logo-mark { width: 28px; height: 28px; flex: none; transition: transform var(--dur-slow) var(--ease-spring); }
.logo-word { width: 114px; height: 20px; }
.logo:hover .logo-mark { transform: translateY(-1px) rotate(-4deg); }
.logo:hover .lm-dot { transform: scale(1.18); }
.lm-tooth { fill: var(--logo-tooth); transition: fill var(--dur-slow) var(--ease-out); }
.lm-dot { fill: var(--logo-dot); transform-origin: 28px 4px; transition: fill var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-spring); }
.lw-text { fill: currentColor; }

/* ===== Хедер ===== */
.site-header {
  position: sticky; top: 0; z-index: var(--z-sticky); height: var(--header-h);
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color var(--dur-slow) var(--ease-out), border-color var(--dur-slow) var(--ease-out), backdrop-filter var(--dur-slow);
}
.site-header.is-scrolled, .site-header:has(.main-nav.is-open) {
  background: var(--glass); border-bottom-color: var(--border);
  backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px);
}
.header-inner { display: flex; align-items: center; gap: var(--s-6); height: 100%; }
.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: block; padding: 6px var(--s-3); border-radius: var(--r-xs); color: var(--text-2); text-decoration: none;
  font-size: var(--fs-sm); font-weight: 500; transition: color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: var(--s-2); }
.logo + .header-actions { margin-left: auto; } /* сторінки без меню */
.menu-toggle { display: none; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ===== Hero ===== */
.hero { position: relative; isolation: isolate; padding: var(--s-20) 0 var(--s-8); margin-top: calc(var(--header-h) * -1); padding-top: calc(var(--header-h) + var(--s-20)); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px; background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 0%, transparent 75%);
}
.hero-bg::after {
  content: ""; position: absolute; width: 760px; height: 560px; top: 8%; right: -8%;
  background: radial-gradient(closest-side, rgba(201, 242, 74, .42), transparent 70%), radial-gradient(closest-side at 70% 70%, rgba(201, 242, 74, .18), transparent);
  filter: blur(40px); opacity: .9;
}
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: var(--s-16); align-items: center; }
.hero h1 { margin-bottom: var(--s-6); max-width: 16ch; }
/* Маркер під словами: фон-градієнт коректно переноситься на кілька рядків */
.hl {
  color: var(--hl-fg); padding: 0 .04em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(var(--lime), var(--lime)) no-repeat left calc(100% - var(--hl-bottom)) / 100% var(--hl-h);
  animation: hlIn 1s var(--ease-out) .5s both;
}
@keyframes hlIn { from { background-size: 0% var(--hl-h); } }
.hero .lead { max-width: 54ch; margin-bottom: var(--s-8); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: 0 0 var(--s-8); }
.hero-trust { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); list-style: none; padding: 0; margin: 0; color: var(--text-3); font-size: var(--fs-sm); }
.hero-trust li { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust .icon { width: 16px; height: 16px; color: var(--accent-text); stroke-width: 2.25; }

/* Анімоване превʼю віджета */
.hero-visual { position: relative; display: flex; justify-content: center; }
.preview { position: relative; width: 100%; max-width: 380px; padding: var(--s-8) 0 var(--s-16); }
.pv-card {
  position: relative; z-index: var(--z-base); padding: var(--s-5); border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg), var(--highlight);
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg); transition: transform var(--dur-slower) var(--ease-out);
}
.hero-visual:hover .pv-card { transform: none; }
.pv-head { display: flex; align-items: center; gap: var(--s-3); font-weight: 600; font-size: var(--fs-sm); letter-spacing: var(--tracking-snug); }
.pv-logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--w-accent); color: #fff; }
.pv-logo .icon { width: 18px; height: 18px; }
.pv-clinic { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-step { font-size: var(--fs-xs); color: var(--text-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.pv-progress { height: 4px; background: var(--surface-2); border-radius: var(--r-full); margin: var(--s-4) 0 var(--s-5); overflow: hidden; }
.pv-progress span { display: block; height: 100%; width: 14%; background: var(--w-accent); border-radius: inherit; transition: width var(--dur-slower) var(--ease-out); }
.pv-body { position: relative; min-height: 236px; }
.pv-phase { position: absolute; inset: 0; opacity: 0; transform: translateY(8px); filter: blur(4px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out), filter var(--dur-slow) var(--ease-out); pointer-events: none; }
.preview[data-phase="0"] [data-p="0"], .preview[data-phase="1"] [data-p="1"], .preview[data-phase="2"] [data-p="2"],
.preview[data-phase="3"] [data-p="3"], .preview[data-phase="4"] [data-p="4"], .preview[data-phase="5"] [data-p="5"] { opacity: 1; transform: none; filter: none; }
.pv-q { font-weight: 600; font-size: var(--fs-md); letter-spacing: var(--tracking-snug); margin: 0 0 var(--s-3); }
.pv-small { font-size: var(--fs-sm); color: var(--text-3); margin: 0 0 var(--s-1); }
.pv-opt { padding: 10px var(--s-3); border: 1px solid var(--border-strong); border-radius: var(--r-sm); margin-bottom: var(--s-2); font-size: var(--fs-sm); font-weight: 500; }
.pv-pick { animation: pvPick 2.4s var(--ease-out) forwards; }
@keyframes pvPick { 0%, 35% { } 50%, 100% { border-color: var(--w-accent); background: color-mix(in srgb, var(--w-accent) 10%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--w-accent) 16%, transparent); } }
.pv-ai { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: var(--s-5); }
.pv-ai-orb, .w-ai-orb {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: #fff; margin-bottom: var(--s-4);
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--w-accent) 40%, #fff), var(--w-accent) 60%);
  animation: orb 1.6s var(--ease-in-out) infinite;
}
.pv-ai-orb .icon { width: 26px; height: 26px; }
@keyframes orb { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--w-accent) 35%, transparent); } 50% { transform: scale(1.05); box-shadow: 0 0 0 14px transparent; } }
.pv-line { width: 80%; height: 10px; margin: 6px 0; }
.pv-line.short { width: 55%; }
.pv-price { font-size: 1.75rem; font-weight: 600; letter-spacing: var(--tracking-tight); color: var(--text); margin: 0 0 var(--s-3); font-variant-numeric: tabular-nums; }
.pv-row { display: flex; justify-content: space-between; font-size: var(--fs-sm); padding: var(--s-2) 0; border-bottom: 1px solid var(--border); color: var(--text-2); font-variant-numeric: tabular-nums; }
.pv-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.pv-slots span { text-align: center; padding: 10px 0; border-radius: var(--r-sm); border: 1px solid var(--border-strong); font-family: var(--font-mono); font-size: var(--fs-sm); }
.pv-slots .busy { color: var(--text-3); background: var(--surface-2); border-color: transparent; text-decoration: line-through; }
.pv-done { text-align: center; padding-top: var(--s-6); }
.pv-done-ic { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--success-soft); color: var(--success); margin-bottom: var(--s-3); }
.pv-done-ic .icon { width: 28px; height: 28px; stroke-width: 2.5; }
.pv-toast {
  position: absolute; right: -40px; bottom: var(--s-4); z-index: var(--z-raised); display: flex; gap: var(--s-3); align-items: flex-start;
  background: var(--glass); backdrop-filter: blur(16px) saturate(1.6); -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); line-height: 1.45; max-width: 280px; color: var(--text-2);
  opacity: 0; transform: translateY(14px) scale(.96); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-spring);
}
.pv-toast b { color: var(--text); font-weight: 600; }
.pv-toast-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--c-telegram); color: #fff; flex: none; }
.pv-toast-ic .icon { width: 15px; height: 15px; }
.preview[data-phase="5"] .pv-toast { opacity: 1; transform: none; transition-delay: .5s; }
.pv-chip {
  position: absolute; left: -36px; top: 38%; z-index: var(--z-raised); display: inline-flex; align-items: center; gap: 6px;
  padding: 6px var(--s-3); border-radius: var(--r-full); background: var(--ink); color: var(--porcelain);
  font-family: var(--font-mono); font-size: var(--fs-xs); box-shadow: var(--shadow-md);
  opacity: 0; transform: translateX(-8px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.pv-chip .icon { width: 14px; height: 14px; color: var(--lime); }
.preview[data-phase="2"] .pv-chip, .preview[data-phase="3"] .pv-chip { opacity: 1; transform: none; }

/* ===== «Леджер» — сітка з тонкими лініями замість окремих карток ===== */
.ledger {
  display: grid; gap: 1px; list-style: none; margin: 0; padding: 0;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
}
.ledger-4 { grid-template-columns: repeat(4, 1fr); }
.ledger-3 { grid-template-columns: repeat(3, 1fr); }
.ledger-cell { position: relative; background: var(--bg-elevated); padding: var(--s-8) var(--s-6); transition: background-color var(--dur-base) var(--ease-out); }
.ledger-cell:hover { background: var(--surface); }
.ledger-cell h3 { margin: var(--s-6) 0 var(--s-2); }
.ledger-cell p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }

/* Кроки */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-6); position: relative; }
.steps::before { content: ""; position: absolute; left: 0; right: 0; top: 20px; height: 1px; background: linear-gradient(90deg, var(--border-strong), var(--border-strong) 85%, transparent); }
.step { position: relative; padding-right: var(--s-4); }
.step-top { position: relative; display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-8); }
.step-num {
  display: inline-grid; place-items: center; height: 40px; padding: 0 var(--s-3); border-radius: var(--r-full);
  background: var(--bg); border: 1px solid var(--border-strong); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-2);
}
.step:first-child .step-num { background: var(--lime); color: var(--ink); border-color: transparent; }
.step-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bg); color: var(--text-3); }
.step-icon .icon { width: 20px; height: 20px; }
.step h3 { font-size: var(--fs-lg); margin-bottom: var(--s-2); }
.step p { color: var(--text-2); margin: 0; font-size: var(--fs-sm); }

/* ===== Демо ===== */
.demo-banner {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); margin-bottom: var(--s-8); border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); font-size: var(--fs-sm); color: var(--text-2);
}
.demo-banner b { color: var(--text); font-weight: 600; }
.demo-banner > .icon { color: var(--accent-text); width: 18px; height: 18px; }
.demo-banner span { flex: 1; min-width: 200px; }
.demo-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: var(--s-8); align-items: start; }
.demo-label { display: flex; align-items: center; gap: var(--s-2); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: var(--tracking-caps); margin: 0 0 var(--s-3); }
.demo-label .icon { width: 15px; height: 15px; }
.demo-col { min-width: 0; }

/* --- Віджет --- */
.widget {
  --wa: var(--w-accent);
  /* Темніший відтінок для заливок із білим текстом — контраст AA для будь-якого кольору з палітри */
  --wa-fill: color-mix(in oklab, var(--wa) 88%, #000);
  background: var(--surface); border-radius: var(--r-xl); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), var(--highlight); overflow: hidden;
}
.w-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); background: var(--wa-fill); color: #fff; transition: background-color var(--dur-slow) var(--ease-out); }
.w-logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.w-logo .icon { width: 22px; height: 22px; }
.w-head-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.w-clinic { font-weight: 600; letter-spacing: var(--tracking-snug); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-sub { font-size: var(--fs-xs); opacity: .85; }
.w-progress { padding: var(--s-3) var(--s-5) 0; }
.w-progress-top { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.w-back { display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; padding: var(--s-1) var(--s-2) var(--s-1) 0; color: var(--text-3); font-weight: 500; font-size: var(--fs-sm); border-radius: var(--r-xs); transition: color var(--dur-base) var(--ease-out); }
.w-back:hover { color: var(--text); }
.w-back .icon { width: 18px; height: 18px; }
.w-back[hidden] { display: inline-flex !important; visibility: hidden; }
.w-step-label { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.w-bar { height: 4px; background: var(--surface-2); border-radius: var(--r-full); margin-top: var(--s-2); overflow: hidden; }
.w-bar span { display: block; height: 100%; width: 0; background: var(--wa); border-radius: inherit; transition: width var(--dur-slow) var(--ease-out), background-color var(--dur-slow); }
.w-body { padding: var(--s-5); min-height: 420px; }
.w-foot { text-align: center; font-size: var(--fs-xs); color: var(--text-3); padding: var(--s-3); border-top: 1px solid var(--border); }

.w-step { animation: stepIn var(--dur-slow) var(--ease-out) both; }
.w-step.back { animation-name: stepInBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(20px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-20px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
.w-title { font-size: var(--fs-lg); font-weight: 600; letter-spacing: var(--tracking-tight); margin: 0 0 var(--s-1); outline: none; }
.w-hint { color: var(--text-3); font-size: var(--fs-sm); margin: 0 0 var(--s-4); }
.w-options { display: grid; gap: var(--s-2); }
.w-opt {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left;
  padding: var(--s-3) var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface);
  font-weight: 500; font-size: var(--fs-sm);
  transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.w-opt:hover { border-color: color-mix(in srgb, var(--wa) 55%, var(--border-strong)); background: var(--surface-2); }
.w-opt:active { transform: scale(.99); }
.w-opt[aria-pressed="true"] { border-color: var(--wa); background: color-mix(in srgb, var(--wa) 8%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wa) 14%, transparent); }
.w-opt-emoji { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 1rem; flex: none; }
.w-opt small { display: block; color: var(--text-3); font-weight: 400; font-size: var(--fs-xs); }
.w-group { margin-bottom: var(--s-5); }
.w-group-title { font-weight: 600; font-size: var(--fs-sm); margin: 0 0 var(--s-2); padding: 0; }
.w-check { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--r-md); cursor: pointer; margin-bottom: var(--s-2); font-weight: 500; font-size: var(--fs-sm); transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out); }
.w-check:hover { background: var(--surface-2); }
.w-check:has(input:checked) { border-color: var(--wa); background: color-mix(in srgb, var(--wa) 8%, var(--surface)); }
.w-check input, .w-radio input { width: 18px; height: 18px; accent-color: var(--wa-fill); margin: 0; flex: none; }
.w-budget { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.w-radio { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: var(--s-3) 6px; border: 1px solid var(--border-strong); border-radius: var(--r-md); cursor: pointer; font-weight: 600; font-size: var(--fs-sm); transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.w-radio:hover { background: var(--surface-2); }
.w-radio input { position: absolute; opacity: 0; pointer-events: none; }
.w-radio small { font-weight: 400; color: var(--text-3); font-size: var(--fs-2xs); line-height: 1.3; }
.w-radio:has(input:checked) { border-color: var(--wa); background: color-mix(in srgb, var(--wa) 8%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wa) 14%, transparent); }
.w-radio:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.w-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); width: 100%; height: 48px;
  padding: 0 var(--s-5); border: 0; border-radius: var(--r-md); background: var(--wa-fill); color: #fff; font-weight: 600; font-size: var(--fs-base); letter-spacing: -.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(0, 0, 0, .12), 0 6px 14px -6px color-mix(in srgb, var(--wa) 70%, transparent);
  transition: filter var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out), opacity var(--dur-base); margin-top: var(--s-2);
}
.w-btn .icon { width: 18px; height: 18px; }
.w-btn:hover { filter: brightness(1.08); }
.w-btn:active:not(:disabled) { transform: scale(.985); }
.w-btn:disabled { opacity: .4; cursor: not-allowed; filter: none; box-shadow: none; }
.w-btn-outline { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-xs); font-size: var(--fs-sm); }
.w-btn-outline:hover { filter: none; background: var(--surface-2); }
.w-btn-outline .icon { color: var(--wa-fill); }
.w-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.w-btn-row .w-btn { height: auto; min-height: 44px; padding: var(--s-2) var(--s-3); line-height: 1.25; }

/* Аналіз ШІ */
.w-ai { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--s-10) 0; }
.w-ai-orb { width: 72px; height: 72px; margin-bottom: var(--s-5); }
.w-ai-orb .icon { width: 32px; height: 32px; }
.w-ai-steps { list-style: none; padding: 0; margin: var(--s-4) 0 0; text-align: left; font-size: var(--fs-sm); color: var(--text-2); }
.w-ai-steps li { display: flex; gap: var(--s-2); align-items: center; opacity: 0; animation: fadeUp var(--dur-slow) var(--ease-out) forwards; padding: 3px 0; }
.w-ai-steps li:nth-child(2) { animation-delay: .5s; }
.w-ai-steps li:nth-child(3) { animation-delay: 1s; }
.w-ai-steps .icon { color: var(--wa-fill); width: 16px; height: 16px; stroke-width: 2.25; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Результат */
.w-result-type { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-3); margin-bottom: var(--s-2); }
.w-result-type .icon { width: 14px; height: 14px; color: var(--wa-fill); }
.w-price { font-size: 2rem; font-weight: 600; color: var(--text); letter-spacing: var(--tracking-tight); margin: var(--s-2) 0 var(--s-3); line-height: 1.1; font-variant-numeric: tabular-nums; }
.w-items { list-style: none; padding: 0; margin: 0 0 var(--s-4); font-size: var(--fs-sm); }
.w-items li { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) 0; border-bottom: 1px solid var(--border); color: var(--text-2); }
.w-items li span:last-child { font-weight: 500; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.w-ai-msg { display: flex; gap: var(--s-3); background: var(--surface-2); border-radius: var(--r-md); padding: var(--s-3); font-size: var(--fs-sm); margin-bottom: var(--s-3); color: var(--text-2); }
.w-ai-msg .w-ai-ava { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--wa-fill); color: #fff; flex: none; }
.w-ai-msg .w-ai-ava .icon { width: 15px; height: 15px; }
.w-ai-msg p { margin: 0 0 6px; }
.w-ai-msg p:last-child { margin: 0; }
.w-ai-name { display: block; font-weight: 600; font-size: var(--fs-xs); color: var(--text); margin-bottom: 2px; }
.w-disclaimer { font-size: var(--fs-xs); color: var(--text-3); margin: 0 0 6px; }

/* Календар */
.w-urgent { background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 22%, transparent); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); font-size: var(--fs-sm); }
.w-urgent b { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.w-urgent .icon { color: var(--warning); width: 16px; height: 16px; }
.w-urgent .w-btn { margin-top: var(--s-3); height: 40px; font-size: var(--fs-sm); }
.w-urgent .w-btn .icon { color: #fff; }
.w-days { display: flex; gap: 6px; overflow-x: auto; padding: 3px 3px var(--s-2); margin: 0 -3px 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.w-day {
  flex: 0 0 56px; display: flex; flex-direction: column; align-items: center; gap: 0; padding: var(--s-2) var(--s-1);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); scroll-snap-align: start; line-height: 1.25;
  transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}
.w-day:hover:not(:disabled) { background: var(--surface-2); }
.w-day b { font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; }
.w-day span { font-size: var(--fs-2xs); color: var(--text-3); }
.w-day .w-day-free { font-size: .625rem; color: var(--success); font-weight: 500; margin-top: 2px; }
.w-day[aria-pressed="true"] { border-color: var(--wa-fill); background: var(--wa-fill); color: #fff; }
.w-day[aria-pressed="true"] span { color: rgba(255, 255, 255, .88); }
.w-day:disabled { opacity: .4; cursor: not-allowed; }
.w-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: var(--s-3); }
.w-slot { height: 38px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); font-family: var(--font-mono); font-size: var(--fs-sm); transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out); }
.w-slot:hover:not(:disabled) { border-color: var(--wa); background: color-mix(in srgb, var(--wa) 6%, var(--surface)); }
.w-slot:disabled { color: var(--text-3); text-decoration: line-through; cursor: not-allowed; background: var(--surface-2); border-color: transparent; }
.w-slot[aria-pressed="true"] { background: var(--wa-fill); color: #fff; border-color: var(--wa-fill); }
.w-slot.is-nearest:not([aria-pressed="true"]) { border-color: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.w-legend { display: flex; gap: var(--s-4); font-size: var(--fs-xs); color: var(--text-3); margin-bottom: var(--s-1); flex-wrap: wrap; }
.w-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--border-strong); margin-right: 6px; vertical-align: -1px; }
.w-legend .lg-busy { background: var(--surface-3); border-color: transparent; }
.w-legend .lg-sel { background: var(--wa-fill); border-color: var(--wa-fill); }
.w-empty { text-align: center; color: var(--text-3); padding: var(--s-6) 0; font-size: var(--fs-sm); border: 1px dashed var(--border-strong); border-radius: var(--r-md); margin: 0 0 var(--s-3); }

/* ===== Поля форм ===== */
.field { margin: 0 0 var(--s-4); border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 500; font-size: var(--fs-sm); margin-bottom: 6px; padding: 0; color: var(--text); }
.field input[type="text"], .field input[type="tel"], .field input[type="time"], .field input[type="number"], .field select, .input {
  width: 100%; height: 44px; padding: 0 var(--s-3); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background-color var(--dur-base);
}
.field select, .crm-sync select, .hours-row select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23888a82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.field input::placeholder, .input::placeholder { color: var(--text-3); opacity: .8; }
.field input:hover, .input:hover, .field select:hover { border-color: color-mix(in srgb, var(--text) 28%, transparent); }
.field input:focus, .input:focus, .field select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.widget .field input:focus { border-color: var(--wa-fill); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wa) 20%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-error { display: flex; align-items: center; gap: 6px; color: var(--danger); font-size: var(--fs-xs); margin: 6px 0 0; font-weight: 500; }
.field-error::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--r-full);
  font-weight: 500; font-size: var(--fs-sm); background: var(--surface);
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.chip:hover span { background: var(--surface-2); }
.chip input:checked + span { border-color: var(--text); background: var(--text); color: var(--bg); }
.widget .chip input:checked + span { border-color: var(--wa-fill); background: var(--wa-fill); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.consent { display: flex; gap: var(--s-3); align-items: flex-start; font-size: var(--fs-xs); line-height: 1.5; color: var(--text-3); cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 0; accent-color: var(--wa-fill, var(--text)); flex: none; }
.consent a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); border-radius: var(--r-xs); transition: text-decoration-color var(--dur-base); }
.consent a:hover { text-decoration-color: currentColor; }
/* Згода у формі заявки: власний чекбокс, вирівняний по першому рядку тексту */
.field-consent { margin: var(--s-5) 0 var(--s-4); }
.field > .consent {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: var(--s-3); align-items: start;
  margin: 0; font-size: var(--fs-sm); font-weight: 400; line-height: 20px; color: var(--text-2); text-wrap: pretty;
}
.field > .consent a { white-space: nowrap; }
.field > .consent > span { padding-top: 1px; } /* оптичний центр рядка = центр чекбокса */
.field > .consent input {
  appearance: none; -webkit-appearance: none; display: grid; place-items: center;
  width: 20px; height: 20px; margin: 0; border: 1px solid var(--border-strong); border-radius: var(--r-xs);
  background: var(--surface); box-shadow: var(--shadow-xs); cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.field > .consent input::after {
  content: ""; width: 12px; height: 12px; background: var(--bg); transform: scale(.4); opacity: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--dur-base) var(--ease-spring), opacity var(--dur-fast);
}
.field > .consent:hover input { border-color: color-mix(in srgb, var(--text) 35%, transparent); }
.field > .consent input:checked { background: var(--text); border-color: var(--text); }
.field > .consent input:checked::after { transform: none; opacity: 1; }
.field > .consent input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.field > .consent input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-consent .field-error { margin-top: var(--s-2); padding-left: 32px; }

/* Підтвердження */
.w-done { text-align: center; }
.w-done-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--success-soft); color: var(--success); margin: var(--s-1) 0 var(--s-3); animation: pop var(--dur-slower) var(--ease-spring) both; box-shadow: 0 0 0 8px color-mix(in srgb, var(--success-soft) 50%, transparent); }
.w-done-ic .icon { width: 30px; height: 30px; stroke-width: 2.5; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.w-summary { text-align: left; background: var(--surface-2); border-radius: var(--r-md); padding: var(--s-1) var(--s-4); margin: var(--s-4) 0; font-size: var(--fs-sm); }
.w-summary div { display: flex; gap: var(--s-3); padding: 10px 0; border-bottom: 1px solid var(--border); }
.w-summary div:last-child { border-bottom: 0; }
.w-summary .icon { color: var(--wa-fill); width: 18px; height: 18px; margin-top: 1px; }
.w-summary b { font-weight: 600; }
.w-peek { font-size: var(--fs-sm); color: var(--text-3); margin: var(--s-3) 0 0; }
.w-peek .m { display: none; }
.w-link { background: none; border: 0; color: var(--text-3); text-decoration: underline; text-underline-offset: .2em; font-size: var(--fs-sm); margin-top: var(--s-2); padding: var(--s-1); border-radius: var(--r-xs); }
.w-link:hover { color: var(--text); }

/* --- Панель клініки --- */
.panel { background: var(--surface); border-radius: var(--r-xl); border: 1px solid var(--border); box-shadow: var(--shadow-md), var(--highlight); overflow: hidden; }
.panel-bar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.panel-dots { display: flex; gap: 6px; }
.panel-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); }
.panel-url { flex: 1; text-align: center; font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); margin-right: 46px; }
.panel-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); }
.stat { padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: 2px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-label { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: var(--fs-xl); font-weight: 600; letter-spacing: var(--tracking-tight); font-variant-numeric: tabular-nums; transition: color var(--dur-slow); }
.stat-value.bump { animation: bump var(--dur-slower) var(--ease-out); }
@keyframes bump { 40% { transform: translateY(-3px); color: var(--accent-text); } }
.panel-tabs { display: flex; gap: 2px; margin: var(--s-3) var(--s-3) 0; padding: 3px; border-radius: var(--r-md); background: var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.panel-tabs::-webkit-scrollbar { display: none; }
.panel-tabs [role="tab"] {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 var(--s-3); border: 0; background: none;
  font-weight: 500; font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; border-radius: var(--r-sm); flex: 1 0 auto; justify-content: center;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.panel-tabs [role="tab"]:hover { color: var(--text); }
.panel-tabs [role="tab"][aria-selected="true"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-tabs .icon { width: 16px; height: 16px; }
.tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 3px var(--accent-text); }
.panel-pane { padding: var(--s-5); min-height: 460px; }
.panel-pane:focus-visible { outline-offset: -3px; border-radius: 0; }
.pane-hint { font-size: var(--fs-xs); color: var(--text-3); margin: 0 0 var(--s-3); }

/* Канали */
.channel-toggles { border: 0; padding: 0; margin: 0 0 var(--s-5); }
.channel-toggles legend { font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: var(--s-2); padding: 0; }
#channel-list { display: flex; flex-wrap: wrap; gap: 6px; }
.switch-chip { display: inline-flex; align-items: center; gap: var(--s-2); height: 32px; padding: 0 var(--s-3) 0 6px; border: 1px solid var(--border); border-radius: var(--r-full); cursor: pointer; font-weight: 500; font-size: var(--fs-xs); user-select: none; background: var(--surface); transition: background-color var(--dur-base) var(--ease-out); }
.switch-chip:hover { background: var(--surface-2); }
.switch { position: relative; display: inline-block; width: 32px; height: 18px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: var(--r-full); box-shadow: inset 0 0 0 1px var(--border); transition: background-color var(--dur-base) var(--ease-out); }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 0 0 .5px rgba(0, 0, 0, .06); transition: transform var(--dur-base) var(--ease-spring); }
.switch input:checked + span { background: var(--text); }
.switch input:checked + span::after { transform: translateX(14px); background: var(--bg); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Стрічка сповіщень */
.notify-feed { display: grid; gap: var(--s-3); }
.notify-empty { display: grid; justify-items: center; text-align: center; color: var(--text-3); padding: var(--s-12) var(--s-6); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); font-size: var(--fs-sm); background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--surface-2) 60%, transparent) 10px 11px); }
.notify-empty .icon { width: 22px; height: 22px; margin-bottom: var(--s-3); color: var(--text-2); padding: 10px; box-sizing: content-box; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.notify-empty p { margin: 0 0 var(--s-1); max-width: 34ch; }
.notify-empty b { color: var(--text); font-weight: 600; font-size: var(--fs-base); }
.nt { border-radius: var(--r-md); border: 1px solid var(--border); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-xs); }
.nt.is-entering { animation: notifyIn var(--dur-slower) var(--ease-spring) both; }
@keyframes notifyIn { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
.nt-head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); font-size: var(--fs-xs); font-weight: 500; color: var(--text-2); border-bottom: 1px solid var(--border); }
.nt-head .nt-ch { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; }
.nt-head .nt-ch .icon { width: 12px; height: 12px; }
.nt-head time { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); }
.nt-body { padding: var(--s-3); font-size: var(--fs-sm); }
.nt-bubble { display: inline-block; max-width: 92%; padding: 10px var(--s-3); border-radius: 14px 14px 14px 4px; line-height: 1.5; white-space: pre-line; position: relative; color: var(--text); }
.nt-bubble .nt-meta { display: block; text-align: right; font-size: var(--fs-2xs); opacity: .6; margin-top: 2px; font-family: var(--font-mono); }
.nt-tg .nt-ch { background: var(--c-telegram); }
.nt-tg .nt-body { background: color-mix(in srgb, var(--c-telegram) 7%, var(--surface)); }
.nt-tg .nt-bubble { background: var(--surface); box-shadow: var(--shadow-xs); }
.nt-kbd { display: flex; gap: 6px; margin-top: 6px; max-width: 92%; }
.nt-kbd span { flex: 1; text-align: center; font-size: var(--fs-xs); font-weight: 500; padding: 7px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--c-telegram) 14%, var(--surface)); }
.nt-vb .nt-ch { background: var(--c-viber); }
.nt-vb .nt-bubble { background: color-mix(in srgb, var(--c-viber) 12%, var(--surface)); }
.nt-wa .nt-ch { background: var(--c-whatsapp); }
.nt-wa .nt-body { background: color-mix(in srgb, var(--c-whatsapp) 5%, var(--surface)); }
.nt-wa .nt-bubble { background: color-mix(in srgb, var(--c-whatsapp) 15%, var(--surface)); }
.nt-sms .nt-ch { background: var(--c-sms); }
.nt-sms .nt-bubble { background: var(--surface-2); }
.nt-em .nt-ch { background: var(--c-email); }
.nt-email-meta { font-size: var(--fs-xs); color: var(--text-3); border-bottom: 1px solid var(--border); padding-bottom: var(--s-2); margin-bottom: var(--s-2); }
.nt-email-meta div b { color: var(--text); font-weight: 500; }
.nt-email-subj { font-weight: 600; color: var(--text); font-size: var(--fs-sm); margin-bottom: var(--s-1); }
.nt-email-table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); margin-top: 6px; }
.nt-email-table th { text-align: left; font-weight: 400; color: var(--text-3); padding: var(--s-1) var(--s-2) var(--s-1) 0; width: 38%; vertical-align: top; }
.nt-email-table td { padding: var(--s-1) 0; }

/* CRM */
.crm-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.crm-sync { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 500; font-size: var(--fs-sm); color: var(--text-2); }
.crm-sync select, .hours-row select { height: 34px; padding-left: 10px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background-color: var(--surface); font-weight: 500; font-size: var(--fs-sm); color: var(--text); }
.sync-status { display: inline-flex; align-items: center; height: 26px; font-size: var(--fs-xs); font-weight: 500; color: var(--success); background: var(--success-soft); padding: 0 var(--s-3); border-radius: var(--r-full); }
.sync-status.is-syncing { color: var(--warning); background: var(--warning-soft); }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: var(--s-2); overflow-x: auto; padding-bottom: 6px; }
.kb-col { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s-2); min-height: 340px; transition: background-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.kb-col.is-over { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-text); }
.kb-col h4 { display: flex; justify-content: space-between; align-items: center; gap: var(--s-1); font-family: var(--font-mono); font-weight: 400; font-size: var(--fs-2xs); margin: var(--s-1) var(--s-1) var(--s-3); text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.kb-col h4 span { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-full); padding: 0 7px; color: var(--text-2); }
.kb-list { display: grid; gap: 6px; }
.kb-card {
  background: var(--surface); border-radius: var(--r-sm); padding: 10px; border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  cursor: grab; font-size: var(--fs-xs); line-height: 1.45; text-align: left; width: 100%;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base);
}
.kb-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--border-strong); }
.kb-card:active { cursor: grabbing; }
.kb-card.is-dragging { opacity: .45; transform: rotate(-1.5deg); }
.kb-card b { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 2px; }
.kb-card .kb-meta { color: var(--text-3); }
.kb-card .kb-price { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text); background: var(--surface-2); padding: 1px 6px; border-radius: var(--r-xs); display: inline-block; margin-top: 4px; }
.kb-card.is-new { border-color: color-mix(in srgb, var(--accent-text) 50%, transparent); animation: glow 1.6s var(--ease-in-out) 3; }
.kb-new { display: inline-block; background: var(--lime); color: var(--ink); font-family: var(--font-mono); font-size: .625rem; padding: 1px 6px; border-radius: var(--r-xs); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-sm); } }

/* Діалоги */
.dialog {
  border: 1px solid var(--border); border-radius: var(--r-xl); padding: 0; width: min(520px, calc(100% - 32px)); max-height: calc(100% - 48px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dialog[open] { animation: dialogIn var(--dur-slow) var(--ease-out) both; }
.dialog[open]::backdrop { animation: fadeIn var(--dur-slow) var(--ease-out) both; }
@keyframes dialogIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes fadeIn { from { opacity: 0; } }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-4) var(--s-4) var(--s-6); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: var(--z-raised); background: var(--glass); backdrop-filter: blur(12px); }
.dialog-head h3 { margin: 0; font-size: var(--fs-lg); letter-spacing: var(--tracking-tight); }
#crm-dialog-body { padding: var(--s-5) var(--s-6) var(--s-6); }
.dl { display: grid; grid-template-columns: 40% 1fr; gap: var(--s-2) var(--s-3); font-size: var(--fs-sm); margin: 0 0 var(--s-5); }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; font-weight: 500; }
.dialog-sec { font-family: var(--font-mono); font-weight: 400; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-3); margin: var(--s-6) 0 var(--s-2); padding-top: var(--s-4); border-top: 1px solid var(--border); }
.src-badge { display: inline-flex; align-items: center; gap: var(--s-1); background: var(--surface-2); border: 1px solid var(--border); padding: 1px var(--s-2); border-radius: var(--r-full); font-size: var(--fs-xs); }
.src-badge .icon { width: 13px; height: 13px; }

/* Розклад */
.sch-day { margin-bottom: var(--s-5); }
.sch-day h4 { font-family: var(--font-mono); font-weight: 400; font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 var(--s-2); color: var(--text-3); }
.sch-day.is-past { opacity: .55; }
.sch-item { position: relative; display: grid; grid-template-columns: 56px 1fr auto; gap: var(--s-3); align-items: center; padding: 10px var(--s-3) 10px var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 6px; font-size: var(--fs-sm); overflow: hidden; }
.sch-item::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--surface-3); }
.sch-item time { font-family: var(--font-mono); font-size: var(--fs-sm); }
.sch-item .sch-who b { display: block; font-weight: 600; }
.sch-item .sch-who span { color: var(--text-3); font-size: var(--fs-xs); }
.sch-item.is-new { border-color: color-mix(in srgb, var(--accent-text) 45%, transparent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); animation: glow 1.6s var(--ease-in-out) 3; }
.sch-item.is-new::before { background: var(--lime); }
.status-pill { font-size: var(--fs-2xs); font-weight: 500; padding: 2px var(--s-2); border-radius: var(--r-full); background: var(--surface-2); color: var(--text-2); white-space: nowrap; border: 1px solid var(--border); }
.status-pill.st-new { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.status-pill.st-confirmed { color: var(--text); }
.status-pill.st-done { color: var(--success); background: var(--success-soft); border-color: transparent; }
.sch-summary { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-5); font-size: var(--fs-xs); color: var(--text-3); }
.sch-summary b { color: var(--text); font-weight: 600; }

/* Налаштування */
.set-sec { margin-bottom: var(--s-8); }
.set-sec > h4 { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-base); font-weight: 600; margin: 0 0 var(--s-3); }
.set-sec > h4 .icon { width: 18px; height: 18px; color: var(--text-3); }
.svc-head, .svc-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 96px 96px 34px; gap: var(--s-2); align-items: center; }
.svc-head { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 0 0 6px; }
.svc-row { padding: 6px 0; border-bottom: 1px solid var(--border); }
.svc-row.is-off .input:not([type="checkbox"]) { opacity: .45; }
.svc-row .input { height: 36px; padding: 0 10px; font-size: var(--fs-sm); border-radius: var(--r-sm); box-shadow: none; }
.svc-row input[type="number"] { -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
.svc-row.is-added { animation: fadeUp var(--dur-slow) var(--ease-out); }
.del-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); border: 0; background: none; color: var(--text-3); transition: background-color var(--dur-base), color var(--dur-base); }
.del-btn:hover { background: var(--danger-soft); color: var(--danger); }
.del-btn .icon { width: 17px; height: 17px; }
.add-btn { margin-top: var(--s-3); background: none; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); height: 40px; width: 100%; font-weight: 500; font-size: var(--fs-sm); color: var(--text-2); transition: background-color var(--dur-base), color var(--dur-base), border-color var(--dur-base); }
.add-btn:hover { border-color: var(--text-3); background: var(--surface-2); color: var(--text); }
.hours-row { display: grid; grid-template-columns: 110px 40px 1fr; gap: var(--s-3); align-items: center; padding: 5px 0; font-size: var(--fs-sm); }
.hours-row .hours-times { display: flex; gap: 6px; align-items: center; color: var(--text-3); }
.hours-row .off-label { color: var(--text-3); font-size: var(--fs-xs); font-family: var(--font-mono); }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.set-grid .field { margin: 0; }
.palette { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.swatch { position: relative; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base); color: #fff; }
.swatch:hover span { transform: scale(1.06); }
.swatch span .icon { width: 16px; height: 16px; stroke-width: 3; opacity: 0; transform: scale(.6); transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-spring); }
.swatch input:checked + span { transform: scale(1.06); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.swatch input:checked + span .icon { opacity: 1; transform: none; }
.swatch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 6px; }
.save-bar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--surface) 35%); padding: var(--s-5) 0 2px; display: flex; gap: var(--s-3); align-items: center; }
.save-bar p { margin: 0; font-size: var(--fs-xs); color: var(--text-3); }
.save-bar .btn .icon { width: 16px; height: 16px; }

/* ===== Адмінка (секція) ===== */
.admin-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-20); align-items: center; }
.admin-inner h2 { margin-bottom: var(--s-4); }
.feature-list { list-style: none; padding: 0; margin: var(--s-10) 0; display: grid; gap: 0; border-top: 1px solid var(--border); }
.feature-list li { display: flex; gap: var(--s-4); align-items: flex-start; padding: var(--s-4) 0; border-bottom: 1px solid var(--border); }
.feature-list h3 { margin: 0 0 2px; font-size: var(--fs-base); font-weight: 600; }
.feature-list p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }
.admin-visual { position: relative; padding: var(--s-10); border-radius: var(--r-xl); background: radial-gradient(120% 80% at 100% 0%, var(--accent-soft), transparent 60%), var(--surface-2); border: 1px solid var(--border); }
.av-card { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--shadow-lg), var(--highlight); border: 1px solid var(--border); }
.av-card-small { position: absolute; right: calc(var(--s-6) * -1); bottom: calc(var(--s-8) * -1); width: 220px; padding: var(--s-4); }
.av-title { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--s-3); }
.av-title span { font-family: var(--font-mono); font-weight: 400; font-size: var(--fs-2xs); color: var(--accent-text); background: var(--accent-soft); padding: 2px var(--s-2); border-radius: var(--r-full); }
.av-row { display: grid; grid-template-columns: 36px 1fr auto; gap: var(--s-3); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 500; }
.av-row b { font-family: var(--font-mono); font-weight: 400; font-size: var(--fs-xs); color: var(--text-2); }
.av-sw { width: 30px; height: 18px; border-radius: var(--r-full); background: var(--surface-3); position: relative; }
.av-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.av-sw.on { background: var(--text); }
.av-sw.on::after { left: 14px; background: var(--bg); }
.av-add { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: var(--s-3); border: 1px dashed var(--border-strong); border-radius: var(--r-sm); height: 36px; color: var(--text-3); font-weight: 500; font-size: var(--fs-sm); }
.av-add .icon { width: 15px; height: 15px; }
.av-colors { display: flex; gap: var(--s-2); }
.av-colors i { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.av-colors i:first-child { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }

/* Інтеграції */
.int-card { display: flex; gap: var(--s-4); align-items: flex-start; padding: var(--s-6); }
.int-card h3 { margin: var(--s-1) 0 var(--s-1); font-size: var(--fs-base); font-weight: 600; }
.int-card .tile-icon { transition: transform var(--dur-slow) var(--ease-spring), background-color var(--dur-base), color var(--dur-base); }
.int-card:hover .tile-icon { transform: translateY(-2px); background: var(--lime); color: var(--ink); border-color: transparent; }

/* Встановлення */
.install-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s-16); align-items: center; }
.install-steps { list-style: none; counter-reset: st; padding: 0; margin: var(--s-6) 0; display: grid; gap: var(--s-3); }
.install-steps li { counter-increment: st; display: flex; gap: var(--s-3); align-items: baseline; color: var(--text-2); }
.install-steps li::before { content: counter(st, decimal-leading-zero); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent-text); flex: none; }
.code-card { position: relative; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg), var(--highlight); border: 1px solid var(--border-strong); }
.code-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 80% at 100% 0%, rgba(201, 242, 74, .12), transparent 70%); }
.code-top { position: relative; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); border-bottom: 1px solid var(--border); }
.code-dots { display: flex; gap: 6px; }
.code-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.code-file { color: var(--text-3); font-size: var(--fs-xs); font-family: var(--font-mono); flex: 1; }
.btn-code { background: var(--surface-2); }
.code-card pre { position: relative; margin: 0; padding: var(--s-6) var(--s-5); overflow-x: auto; color: var(--text-2); font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-card pre code { padding: 0; background: none; border: 0; color: var(--accent-text); }

/* Метрики */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); }
.metric { padding: var(--s-10) var(--s-8) var(--s-8) 0; display: flex; flex-direction: column; gap: var(--s-3); }
.metric + .metric { padding-left: var(--s-8); border-left: 1px solid var(--border); }
.metric-value { font-size: var(--fs-display); font-weight: 500; letter-spacing: -.06em; line-height: .9; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: .3em; letter-spacing: -.02em; margin-left: .15em; color: var(--text-3); font-weight: 500; }
.metric:first-child .metric-value { background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 55%, transparent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.metric-label { color: var(--text-2); max-width: 26ch; }
.metrics-note { font-size: var(--fs-xs); color: var(--text-3); margin: var(--s-6) 0 0; }

/* Пропозиція */
.offer {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-12); align-items: center;
  padding: var(--s-16); border-radius: var(--r-xl); background: var(--bg); border: 1px solid var(--border-strong);
  box-shadow: 0 40px 80px -30px rgba(14, 15, 12, .45);
}
.offer::before { content: ""; position: absolute; z-index: -1; width: 640px; height: 480px; left: -200px; top: -260px; background: radial-gradient(closest-side, rgba(201, 242, 74, .28), transparent); filter: blur(20px); }
.offer::after {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask-image: linear-gradient(120deg, #000, transparent 55%); mask-image: linear-gradient(120deg, #000, transparent 55%);
}
.offer .eyebrow { margin-bottom: var(--s-6); text-transform: none; letter-spacing: 0; font-family: var(--font-sans); font-size: var(--fs-sm); }
.offer .eyebrow span { font-family: var(--font-mono); font-size: var(--fs-xs); }
.offer .eyebrow span::after { display: none; }
.plan-switch { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: var(--s-8); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.plan-opt { position: relative; }
.plan-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.plan-opt span { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 var(--s-4); border-radius: var(--r-sm); font-weight: 500; font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap; transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out); }
.plan-opt:hover span { color: var(--text); }
.plan-opt em { font-style: normal; font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--accent-text); }
.plan-opt input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: var(--highlight), 0 1px 2px rgba(0, 0, 0, .3); }
.plan-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.offer-price { font-size: var(--fs-display); line-height: .9; margin: 0 0 var(--s-4); letter-spacing: -.06em; font-weight: 500; font-variant-numeric: tabular-nums; }
.offer-price small { font-size: .22em; font-weight: 400; letter-spacing: -.01em; color: var(--text-3); margin-left: var(--s-2); }
.offer-sub { font-size: var(--fs-md); color: var(--text-2); margin-bottom: var(--s-8); min-height: 1.6em; }
.offer-note { margin: var(--s-4) 0 0; color: var(--text-3); font-size: var(--fs-sm); }
.offer-list { list-style: none; padding: var(--s-2) var(--s-6); margin: 0; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--r-lg); display: grid; box-shadow: var(--highlight); }
.offer-list li { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-4) 0; color: var(--text); border-bottom: 1px solid var(--border); }
.offer-list li:last-child { border-bottom: 0; }
.offer-list .icon { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--lime); color: var(--ink); stroke-width: 3; }

/* FAQ */
.faq-inner { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--s-16); align-items: start; }
.faq-inner .section-head { position: sticky; top: calc(var(--header-h) + var(--s-8)); margin: 0; }
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none; cursor: pointer; padding: var(--s-5) var(--s-12) var(--s-5) 0; font-weight: 500; font-size: var(--fs-md); letter-spacing: var(--tracking-snug);
  position: relative; border-radius: var(--r-xs); transition: color var(--dur-base);
}
.faq summary:hover { color: var(--text-2); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after { content: ""; position: absolute; right: var(--s-2); top: 50%; width: 14px; height: 1.5px; background: currentColor; border-radius: 1px; transition: transform var(--dur-slow) var(--ease-out); }
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0); }
.faq details p { padding: 0 var(--s-12) var(--s-6) 0; margin: 0; color: var(--text-2); max-width: 64ch; }
.faq details[open] p { animation: fadeUp var(--dur-slow) var(--ease-out); }

/* Форма заявки */
.lead-card {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); overflow: hidden;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg), var(--highlight); border: 1px solid var(--border);
}
.lead-aside {
  position: relative; display: flex; flex-direction: column; padding: var(--s-12); color: var(--porcelain); background: var(--ink); overflow: hidden;
  --logo-tooth: var(--porcelain); --logo-dot: var(--lime);
}
.lead-aside::after { content: ""; position: absolute; width: 420px; height: 420px; right: -180px; bottom: -200px; border-radius: 50%; background: radial-gradient(closest-side, rgba(201, 242, 74, .3), transparent); }
.lead-mark { width: 48px; height: 48px; margin-bottom: auto; }
.lead-aside-title { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: var(--tracking-tight); line-height: 1.1; margin: var(--s-16) 0 var(--s-6); max-width: 12ch; }
.lead-points { position: relative; z-index: var(--z-base); list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); color: rgba(246, 245, 241, .75); font-size: var(--fs-sm); }
.lead-points li { display: flex; gap: var(--s-2); align-items: center; }
.lead-points .icon { width: 16px; height: 16px; color: var(--lime); stroke-width: 2.25; }
.lead-main { padding: var(--s-12); }
.lead-main h2 { font-size: var(--fs-2xl); letter-spacing: var(--tracking-tight); margin-bottom: var(--s-2); }
.lead-caption { color: var(--text-2); margin-bottom: var(--s-8); }
.lead-main .btn-block { margin-top: var(--s-2); }
.form-note { font-size: var(--fs-xs); color: var(--text-3); margin: var(--s-3) 0 0; text-align: center; }
.form-error {
  display: flex; gap: var(--s-2); align-items: flex-start; margin: 0 0 var(--s-3); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-size: var(--fs-sm); font-weight: 500;
}
/* Пастка для ботів — поза екраном, але не display:none (деякі боти це перевіряють) */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Модалка «Дякуємо» */
.thanks-dialog { width: min(440px, calc(100% - 32px)); overflow: hidden; }
.thanks-dialog::before { content: ""; position: absolute; inset: 0 0 auto; height: 160px; pointer-events: none; background: radial-gradient(60% 100% at 50% 0%, var(--accent-soft), transparent 70%); }
.thanks-close { position: absolute; top: var(--s-3); right: var(--s-3); z-index: var(--z-raised); }
.thanks-body { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--s-12) var(--s-8) var(--s-8); }
.thanks-body h3 { font-size: var(--fs-xl); letter-spacing: var(--tracking-tight); margin: 0 0 var(--s-2); }
.thanks-body p { color: var(--text-2); margin: 0 0 var(--s-8); max-width: 34ch; }
.thanks-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--lime); color: var(--ink); margin-bottom: var(--s-6); box-shadow: 0 0 0 8px var(--accent-soft); }
.thanks-dialog[open] .thanks-ic { animation: pop var(--dur-slower) var(--ease-spring) .1s both; }
.thanks-ic .icon { width: 30px; height: 30px; stroke-width: 2.5; }
.thanks-ic .icon path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.thanks-dialog[open] .thanks-ic .icon path { animation: draw var(--dur-slower) var(--ease-out) .35s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .thanks-ic .icon path { stroke-dashoffset: 0; } }

/* Футер */
.site-footer { position: relative; overflow: hidden; border-top: 1px solid var(--border); padding: var(--s-16) 0 var(--s-8); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-8) var(--s-16); }
.footer-brand .logo { margin-bottom: var(--s-4); }
.footer-brand p { max-width: 38ch; font-size: var(--fs-sm); margin: 0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, auto); gap: var(--s-3) var(--s-10); }
.footer-links a { color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); transition: color var(--dur-base); border-radius: var(--r-xs); }
.footer-links a:hover { color: var(--text); }
.footer-word { width: 100%; height: auto; aspect-ratio: 188.72 / 33.00; margin: var(--s-16) 0 var(--s-8); color: var(--text); opacity: .06; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-2) var(--s-6); padding-top: var(--s-6); border-top: 1px solid var(--border); }
.footer-copy { font-size: var(--fs-xs); margin: 0; }
.footer-legal { font-size: var(--fs-xs); color: var(--text-3); text-decoration: none; border-radius: var(--r-xs); transition: color var(--dur-base); }
.footer-legal:hover { color: var(--text); text-decoration: underline; }

/* ===== Юридичні сторінки ===== */
.legal { padding: var(--s-16) 0 var(--s-24); }
.legal-inner { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: var(--s-16); max-width: 1040px; }
.legal-head { grid-column: 1 / -1; max-width: 760px; margin-bottom: var(--s-12); padding-bottom: var(--s-10); border-bottom: 1px solid var(--border); }
.legal-head .eyebrow { flex-wrap: wrap; row-gap: var(--s-1); }
.legal-head h1 { margin-bottom: var(--s-5); }
.legal-head .lead { margin: 0; }
.legal-toc { position: sticky; top: calc(var(--header-h) + var(--s-6)); align-self: start; }
.legal-toc-title { font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-3); margin: 0 0 var(--s-3); }
.legal-toc ol { list-style: none; counter-reset: toc; margin: 0; padding: 0; display: grid; gap: 2px; }
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex; gap: var(--s-3); padding: 6px var(--s-2); margin-left: calc(var(--s-2) * -1); border-radius: var(--r-xs);
  color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); line-height: 1.4; transition: color var(--dur-base), background-color var(--dur-base);
}
.legal-toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); padding-top: 1px; }
.legal-toc a:hover { color: var(--text); background: var(--surface-2); }
.prose { max-width: 680px; color: var(--text-2); }
.prose section { padding-bottom: var(--s-10); margin-bottom: var(--s-10); border-bottom: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + var(--s-6)); }
.prose section:last-child { border-bottom: 0; margin-bottom: 0; }
.prose h2 { display: flex; align-items: baseline; gap: var(--s-3); font-size: var(--fs-xl); letter-spacing: var(--tracking-tight); color: var(--text); margin: 0 0 var(--s-5); }
.prose h2 span { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 400; letter-spacing: 0; color: var(--accent-text); }
.prose p { margin: 0 0 var(--s-4); }
.prose b { color: var(--text); font-weight: 600; }
.prose ul { margin: 0 0 var(--s-5); padding: 0; list-style: none; display: grid; gap: var(--s-2); }
.prose li { position: relative; padding-left: var(--s-6); }
.prose li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 20%, transparent); }
.prose a { color: var(--text); text-decoration-color: var(--border-strong); }
.prose a:hover { text-decoration-color: currentColor; }
.site-footer-compact { padding: var(--s-6) 0; }
.site-footer-compact .footer-bottom { border-top: 0; padding-top: 0; }
@media (max-width: 960px) {
  .legal { padding-top: var(--s-10); }
  .legal-inner { grid-template-columns: 1fr; }
  .legal-toc { position: static; margin-bottom: var(--s-10); padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
  .legal-toc a { margin-left: 0; }
}

/* Тости */
.toast-region { position: fixed; left: 50%; bottom: var(--s-6); transform: translateX(-50%); z-index: var(--z-toast); display: grid; gap: var(--s-2); justify-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4) var(--s-3) var(--s-3); border-radius: var(--r-md);
  background: color-mix(in srgb, var(--ink) 92%, transparent); color: var(--porcelain); backdrop-filter: blur(12px);
  border: 1px solid rgba(246, 245, 241, .1); box-shadow: var(--shadow-lg); font-weight: 500; font-size: var(--fs-sm);
  animation: toastIn var(--dur-slow) var(--ease-spring) both;
}
.toast .icon { width: 18px; height: 18px; padding: 4px; box-sizing: content-box; border-radius: 50%; background: var(--lime); color: var(--ink); stroke-width: 2.25; }
.toast.is-leaving { animation: toastOut var(--dur-base) var(--ease-out) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ===== Адаптив ===== */
@media (max-width: 1100px) {
  .ledger-4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: var(--s-12); }
  .steps::before { display: none; }
  .demo-grid { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: var(--s-5); }
  .pv-toast { right: -8px; }
  .pv-chip { left: -12px; }
  .admin-inner { gap: var(--s-12); }
  .offer { padding: var(--s-12); }
}
@media (max-width: 960px) {
  .section { padding-top: var(--s-24); }
  .section:last-of-type { padding-bottom: var(--s-24); }
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; padding: var(--s-2) var(--s-4) var(--s-4);
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
    opacity: 0; transform: translateY(-8px); visibility: hidden; transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility var(--dur-base);
  }
  .main-nav.is-open { opacity: 1; transform: none; visibility: visible; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { padding: var(--s-3); font-size: var(--fs-base); color: var(--text); }
  .menu-toggle { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .section-head { grid-template-columns: 1fr; row-gap: var(--s-4); }
  .section-head > p:last-child { justify-self: start; }
  .hero-inner, .admin-inner, .install-inner, .faq-inner { grid-template-columns: 1fr; gap: var(--s-12); }
  .hero { padding-top: calc(var(--header-h) + var(--s-12)); }
  .hero h1 { max-width: 18ch; }
  .hero-bg::after { top: auto; bottom: 0; right: 50%; transform: translateX(50%); width: 560px; height: 420px; }
  .pv-card { transform: none; }
  .faq-inner .section-head { position: static; }
  .demo-grid { grid-template-columns: 1fr; }
  .widget { max-width: 520px; margin: 0 auto; }
  .demo-col:first-child .demo-label { max-width: 520px; margin-left: auto; margin-right: auto; }
  .w-peek .d { display: none; }
  .w-peek .m { display: inline; }
  .ledger-3 { grid-template-columns: repeat(2, 1fr); }
  .offer { grid-template-columns: 1fr; padding: var(--s-10) var(--s-8); }
  .admin-visual { max-width: 520px; margin-bottom: var(--s-8); }
  .metrics { grid-template-columns: 1fr; }
  .metric, .metric + .metric { padding: var(--s-8) 0; border-left: 0; border-bottom: 1px solid var(--border); flex-direction: row; align-items: baseline; justify-content: space-between; gap: var(--s-6); }
  .metric-value { font-size: clamp(3.5rem, 12vw, 6rem); }
  .metric-label { text-align: right; }
  .lead-card { grid-template-columns: 1fr; }
  .lead-aside { padding: var(--s-8); }
  .lead-aside-title { margin-top: var(--s-8); }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .container { padding: 0 var(--s-4); }
  .section { padding-top: var(--s-20); }
  .section:last-of-type { padding-bottom: var(--s-20); }
  .section-head { margin-bottom: var(--s-10); padding-bottom: var(--s-6); }
  .header-cta { display: none; }
  .ledger-4, .ledger-3, .steps { grid-template-columns: 1fr; }
  .steps { row-gap: var(--s-8); }
  .step-top { margin-bottom: var(--s-4); }
  .ledger-cell { padding: var(--s-6) var(--s-5); }
  .hero-actions .btn { flex: 1 1 100%; }
  .preview { padding-bottom: var(--s-20); }
  .pv-toast { right: 0; left: var(--s-6); bottom: var(--s-2); }
  .pv-chip { left: 0; top: 0; }
  .panel-url { display: none; }
  .panel-stats .stat { padding: var(--s-3); }
  .stat-value { font-size: var(--fs-md); white-space: nowrap; }
  .stat-label { font-size: .5625rem; }
  .panel-pane { padding: var(--s-4); }
  .panel-tabs [role="tab"] { flex: 0 0 auto; }
  .kanban { grid-template-columns: repeat(4, 200px); }
  .svc-head { display: none; }
  .svc-row { grid-template-columns: 40px 1fr 1fr 34px; grid-template-areas: "sw name name del" "sw from to del"; row-gap: 6px; }
  .svc-row > :nth-child(1) { grid-area: sw; }
  .svc-row > :nth-child(2) { grid-area: name; }
  .svc-row > :nth-child(3) { grid-area: from; }
  .svc-row > :nth-child(4) { grid-area: to; }
  .svc-row > :nth-child(5) { grid-area: del; }
  .hours-row { grid-template-columns: 90px 40px 1fr; }
  .set-grid { grid-template-columns: 1fr; }
  .admin-visual { padding: var(--s-5); margin-bottom: 0; }
  .av-card-small { position: relative; right: auto; bottom: auto; margin-top: var(--s-3); width: auto; }
  .plan-switch { display: flex; width: 100%; }
  .plan-opt { flex: 1; }
  .plan-opt span { justify-content: center; padding: 0 var(--s-2); }
  .offer { padding: var(--s-8) var(--s-5); border-radius: var(--r-lg); }
  .offer-list { padding: var(--s-1) var(--s-4); }
  .offer-main .btn { width: 100%; }
  .metric, .metric + .metric { flex-direction: column; gap: var(--s-2); }
  .metric-label { text-align: left; }
  .faq summary { font-size: var(--fs-base); padding-right: var(--s-10); }
  .faq details p { padding-right: 0; }
  .lead-main { padding: var(--s-8) var(--s-5); }
  .lead-aside { padding: var(--s-6) var(--s-5); }
  .lead-aside-title { font-size: var(--fs-xl); margin: var(--s-6) 0 var(--s-4); }
  .footer-links { grid-template-columns: repeat(2, auto); justify-content: start; }
  .w-body { padding: var(--s-4); }
  .field > .consent a { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .pv-card { transform: none; }
}
