/* ==========================================================================
   Денталія — AI-візуалізатор усмішки. Дизайн v3.
   Світла сторінка з чіткою ієрархією: Lora для заголовків (курсивний акцент), Inter для тексту,
   білі картки з тонкою лінією, фото й результати — на ТЕМНІЙ сцені. Один фіолетовий бренд-колір + м'які статусні.
   Шапка й підвал — спільні для всього сайту (збираються з booking-сторінок, див. build/).
   Структура: токени → hero → каркас → кроки → 1 фото → 2 аналіз → 3 вибір → 4–5 створення → 6 результат → лайтбокс → адаптивність.
   ========================================================================== */

.viz,
.vh,
.viz-lightbox {
  --accent: var(--violet-600);
  --accent-dark: var(--violet-700);
  --accent-soft: var(--violet-100);
  --accent-ink: var(--violet-900);
  --ink: var(--ink-900);
  --ink-soft: var(--ink-700);
  --body: var(--ink-700);
  --muted: var(--ink-500);
  --line: #e6e0f2;
  --line-soft: #efeaf8;
  --bg-soft: var(--violet-50);
  --white: #ffffff;
  --scene: #1b1330;
  --scene-2: #2a1f48;
  --viz-ok: #17844a;
  --viz-ok-soft: #e5f6ec;
  --viz-ok-ink: #0f5132;
  --viz-warn: #9a5f10;
  --viz-warn-soft: #fff3d6;
  --viz-warn-ink: #6b4306;
  --viz-bad: #b3342a;
  --viz-bad-soft: #fdebe9;
  --viz-bad-ink: #7a1f18;
  --viz-shadow: 0 1px 2px rgba(27, 19, 48, 0.06), 0 18px 40px -22px rgba(46, 16, 101, 0.28);
  --viz-shadow-sm: 0 1px 2px rgba(27, 19, 48, 0.05), 0 10px 24px -16px rgba(46, 16, 101, 0.25);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.75rem;
  --space-8: 3.5rem;
}

/* ---------- Hero (v5): чисто біле тло, портрет без рамки (волосся розчиняється внизу), текст по кутах ----------
   Композиція за референсом Simoura: бейдж + великий заголовок згори ліворуч, тонка «голка», підзаголовок і абзац знизу ліворуч,
   «усього за три прості кроки» + кнопка знизу праворуч, по центру — портрет із чотирикутною сіткою обличчя.
   Геометрія портрета (рот, межі сканування) — build/hero_mesh.json; якщо замінити фото smile-before/after, перегенерувати
   сітку (python build/make_hero_mesh.py …) і оновити змінні --mx/--my/--scan-top/--scan-bot/--fl/--fr нижче.
   Стани анімації — класи на .vh__stage (їх ставить js/visualizer/hero.js): is-in → is-scan → is-reveal → is-done (і по колу). */
.vh {
  --vh-ink: #101012;
  --vh-body: #34343b;
  --vh-mute: #8b8b94;
  --vh-accent: var(--violet-600);
  --vh-font: 'Onest', var(--font-body);
  --vh-h: clamp(2.1rem, 3.2vw, 3.6rem);
  position: relative;
  padding: 112px 0 0;
  background: transparent;   /* суцільне зі сторінкою: м'які плями фону (page-ambient) продовжуються під Hero без різкого краю */
  color: var(--vh-ink);
  overflow-x: clip;
}
/* ≤899 px шапка сайту стоїть у потоці (липкий рядок), тож великий відступ зверху не потрібен */
@media (max-width: 899px) { .vh { padding-top: 22px; } }
#viz-start, #viz-how { scroll-margin-top: 92px; }
@media (max-width: 899px) { #viz-start, #viz-how { scroll-margin-top: 64px; } }

/* хлібні крихти лишаємо для скрінрідерів, на екрані їх у цьому макеті немає */
.vh__crumb { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.vh__wrap {
  position: relative;
  width: min(1680px, calc(100% - clamp(32px, 7vw, 132px)));
  margin: 0 auto;
  height: clamp(640px, calc(100vh - 112px), 900px);
  height: clamp(640px, calc(100svh - 112px), 900px);
}

/* --- портрет --- */
.vh__stage {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 0;
  height: min(118%, 62vw);
  aspect-ratio: 1000 / 1094;
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
.vh__frame {
  --mx: 52.18%;
  --my: 53.53%;
  --scan-top: 22%;
  --scan-bot: 67%;
  --fl: 29%;
  --fr: 73%;
  position: absolute;
  inset: 0;
  isolation: isolate;
}
.vh__stack, .vh__img { position: absolute; inset: 0; width: 100%; height: 100%; }
.vh__img { display: block; object-fit: cover; filter: brightness(1.016); }   /* фон фото 253 → чисто білий, без «рамки» */
/* волосся й плечі м'яко розчиняються у білому: знизу, по боках і трохи зверху */
.vh__stack {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2.5%, #000 54%, transparent 88%), linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 2.5%, #000 54%, transparent 88%), linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-composite: intersect;
}

/* --- текстові блоки --- */
.vh__top { position: absolute; z-index: 3; left: 0; top: 4%; }
.vh__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 4px;
  background: linear-gradient(120deg, var(--violet-500) 0%, var(--violet-700) 100%);
  box-shadow: 0 6px 14px -8px rgba(91, 33, 182, 0.7);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.vh__badge svg { width: 11px; height: 11px; fill: #fff; }
.vh .vh__top h1 {
  margin: clamp(10px, 1.8vh, 18px) 0 0;
  font-family: var(--vh-font);
  font-weight: 300;
  font-size: var(--vh-h);
  line-height: 1.06;
  letter-spacing: -0.032em;
  color: var(--vh-ink);
}
.vh__top h1 em { display: block; font-style: normal; font-weight: inherit; color: inherit; }
/* «Голка» під заголовком — анімована підказка прокрутки: світла крапля стікає вниз, шеврон «дихає», підпис веде до завантаження фото */
.vh__needle {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: clamp(30px, 7vh, 72px) 0 0 38px;   /* відступ праворуч від бокової вкладки «AI помічник» */
  color: var(--violet-700);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.vh__needle-track { position: relative; display: block; width: 2px; height: clamp(54px, 9vh, 92px); overflow: hidden; border-radius: 2px; background: linear-gradient(to bottom, rgba(124, 58, 237, 0), rgba(124, 58, 237, 0.22)); }
.vh__needle-track i {
  position: absolute;
  left: 0;
  top: -45%;
  width: 100%;
  height: 45%;
  border-radius: 2px;
  background: linear-gradient(to bottom, rgba(124, 58, 237, 0), var(--violet-600));
  animation: vh-drip 2s cubic-bezier(0.55, 0.05, 0.4, 1) infinite;
}
.vh__needle-chev { margin-left: -8px; width: 18px; height: 18px; fill: none; stroke: var(--violet-600); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; animation: vh-bob 2s ease-in-out infinite; }
.vh__needle-label { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--violet-700); opacity: 0.8; white-space: nowrap; transition: opacity 0.2s; }
.vh__needle:hover .vh__needle-label,
.vh__needle:focus-visible .vh__needle-label { opacity: 1; }
.vh__needle:focus-visible { outline: 3px solid rgba(124, 58, 237, 0.45); outline-offset: 6px; border-radius: 6px; }
@keyframes vh-drip { 0% { top: -45%; } 70%, 100% { top: 100%; } }
@keyframes vh-bob { 0%, 100% { transform: translateY(-2px); opacity: 0.55; } 50% { transform: translateY(4px); opacity: 1; } }

.vh__left { position: absolute; z-index: 3; left: 0; top: 58%; width: min(23%, 340px); }
.vh__sub {
  margin: 0;
  font-family: var(--vh-font);
  font-size: calc(var(--vh-h) * 0.62);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.028em;
  color: var(--vh-ink);
}
.vh__lead { margin: clamp(10px, 1.8vh, 18px) 0 0; font-size: clamp(0.86rem, 0.95vw, 1.02rem); font-weight: 500; line-height: 1.5; letter-spacing: -0.005em; color: var(--vh-body); }

.vh__right { position: absolute; z-index: 3; right: 0; top: 58%; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.vh__steps {
  margin: 0;
  font-family: var(--vh-font);
  font-size: calc(var(--vh-h) * 0.78);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.032em;
  color: var(--vh-ink);
}
.vh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: clamp(20px, 3.4vh, 34px);
  padding: 0.78rem 1.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #e6e0f7 0%, #cdbcf7 55%, var(--violet-500) 100%) border-box;
  color: var(--vh-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 10px 24px -16px rgba(124, 58, 237, 0.55);
  transition: transform 0.2s var(--ease-out, ease), box-shadow 0.2s, background 0.2s;
}
.vh-btn:hover { transform: translateY(-1px); background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #d9d0f3 0%, #b79cf5 50%, var(--violet-600) 100%) border-box; box-shadow: 0 14px 28px -14px rgba(124, 58, 237, 0.7); }
.vh-btn:focus-visible { outline: 3px solid rgba(124, 58, 237, 0.45); outline-offset: 3px; }

.vh__note { position: absolute; z-index: 3; left: 0; right: 0; bottom: 4px; margin: 0; text-align: center; font-size: 0.78rem; color: var(--vh-mute); pointer-events: none; }

/* підказки довіри — спокійним рядком під Hero */
.vh .viz-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 2rem; max-width: none; margin: 14px auto 0; padding: 0 0 34px; }
.vh .viz-trust li { font-size: 0.84rem; font-weight: 500; color: var(--vh-body); }
.vh .viz-trust li { display: flex; align-items: center; gap: 0.6rem; }
.vh .viz-trust svg { flex: none; box-sizing: border-box; width: 26px; height: 26px; padding: 5px; border: 1px solid #e7e7ea; border-radius: 50%; background: #fff; fill: none; stroke: var(--vh-ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* --- сітка сканування: біла чотирикутна, по щелепі — блакитний контур --- */
.vh-mesh { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 0.9s ease; }
.vh-mesh__lines {
  fill: none;
  stroke: #fff;
  stroke-opacity: 0.94;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 1px rgba(60, 80, 120, 0.5));
}
.vh-mesh__jaw {
  fill: none;
  stroke: #8cc3f5;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 3px rgba(110, 170, 240, 0.85));
}

/* лінія сканування: прозора «висота = кадр», тому translateY у % рухає лінію по всьому обличчю */
.vh__scan { position: absolute; z-index: 3; inset: 0; pointer-events: none; opacity: 0; transform: translateY(var(--scan-top)); }
.vh__scan::before {
  content: "";
  position: absolute;
  left: var(--fl);
  right: calc(100% - var(--fr));
  top: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 20%, #fff 80%, rgba(255, 255, 255, 0));
  box-shadow: 0 0 14px 3px rgba(110, 170, 255, 0.55);
}
.vh__scan::after {
  content: "";
  position: absolute;
  left: var(--fl);
  right: calc(100% - var(--fr));
  top: -64px;
  height: 64px;
  background: linear-gradient(to top, rgba(150, 195, 255, 0.22), rgba(150, 195, 255, 0));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

/* сяйво й іскри в момент появи нової усмішки */
.vh__glow {
  position: absolute;
  z-index: 3;
  left: var(--mx);
  top: var(--my);
  width: 54%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 62%);
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 0;
  pointer-events: none;
}
.vh__spark {
  position: absolute;
  z-index: 3;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  opacity: 0;
  pointer-events: none;
  background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.9));
}
.vh__spark--1 { left: 41%; top: 49%; }
.vh__spark--2 { left: 61%; top: 50.5%; width: 12px; height: 12px; }
.vh__spark--3 { left: 53%; top: 57.5%; width: 10px; height: 10px; }

/* статус на портреті (внизу, у зоні, де волосся вже розчинилось) */
.vh__status { position: absolute; z-index: 4; left: 12px; right: 12px; bottom: 25%; display: grid; justify-items: center; pointer-events: none; }
.vh__status > span {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  justify-self: center;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 26px -14px rgba(40, 30, 20, 0.45), 0 0 0 1px rgba(16, 16, 18, 0.05);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--vh-ink);
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.vh__status-done svg { flex: none; width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: var(--viz-ok); fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.vh__dots { display: inline-flex; gap: 3px; }
.vh__dots b { width: 5px; height: 5px; border-radius: 50%; background: var(--vh-accent); animation: vh-blink 1.1s ease-in-out infinite; }
.vh__dots b:nth-child(2) { animation-delay: 0.18s; }
.vh__dots b:nth-child(3) { animation-delay: 0.36s; }
@keyframes vh-blink { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

/* ---------- стани (працюють лише коли JS увімкнув анімацію: .vh-js) ---------- */
.vh__img--after { opacity: 1; }                       /* без JS одразу видно результат */
.vh-mesh__lines, .vh-mesh__jaw { stroke-dashoffset: 0; }   /* без JS сітка вже намальована */
.vh-mesh { opacity: 1; }
.vh-js .vh__frame { opacity: 0; transform: scale(0.97); }
.vh-js.is-in .vh__frame { opacity: 1; transform: none; transition: opacity 1s ease, transform 1.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.vh-js .vh-mesh { opacity: 0; }
.vh-js .vh-mesh__lines, .vh-js .vh-mesh__jaw { stroke-dashoffset: 1; }
.vh-js .vh__img--after {
  --r: 0%;
  opacity: 0;
  -webkit-mask-image: radial-gradient(circle at var(--mx) var(--my), #000 calc(var(--r) - 12%), transparent var(--r));
  mask-image: radial-gradient(circle at var(--mx) var(--my), #000 calc(var(--r) - 12%), transparent var(--r));
}
.vh-js.is-reveal .vh__img--after,
.vh-js.is-done .vh__img--after { opacity: 1; }
.vh-js.is-leaving .vh__img--after { transition: opacity 0.9s ease; }   /* плавне повернення до «до» */

/* сітка з'являється під час сканування й лишається на обличчі, як у макеті; зникає лише при поверненні */
.vh-js.is-scan .vh-mesh { opacity: 1; transition: opacity 0.4s ease; }
.vh-js.is-scan .vh-mesh__lines { animation: vh-draw 2.9s cubic-bezier(0.45, 0.05, 0.4, 1) forwards; }
.vh-js.is-scan .vh-mesh__jaw { animation: vh-draw 1.7s cubic-bezier(0.45, 0.05, 0.4, 1) 1.2s forwards; }
.vh-js.is-scan .vh__scan { animation: vh-scan 2.9s cubic-bezier(0.45, 0.05, 0.4, 1) forwards; }
.vh-js.is-scan:not(.is-reveal) .vh__status-scan { opacity: 1; transform: none; }
.vh-js.is-leaving .vh-mesh { opacity: 0; }
.vh-js.is-leaving .vh-mesh__lines, .vh-js.is-leaving .vh-mesh__jaw { stroke-dashoffset: 0; }
.vh-js.is-reveal .vh__glow { animation: vh-glow 1.7s ease-out forwards; }
.vh-js.is-reveal .vh__spark--1 { animation: vh-spark 1.3s ease-out 0.35s forwards; }
.vh-js.is-reveal .vh__spark--2 { animation: vh-spark 1.3s ease-out 0.6s forwards; }
.vh-js.is-reveal .vh__spark--3 { animation: vh-spark 1.3s ease-out 0.85s forwards; }
.vh-js.is-done .vh__status-done { opacity: 1; transform: none; }
.vh-js.is-leaving .vh__status > span { opacity: 0; transform: translateY(6px); }

@keyframes vh-draw { to { stroke-dashoffset: 0; } }
@keyframes vh-scan {
  0% { opacity: 0; transform: translateY(var(--scan-top)); }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { opacity: 0; transform: translateY(var(--scan-bot)); }
}
@keyframes vh-glow { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); } 35% { opacity: 0.85; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); } }
@keyframes vh-spark { 0% { opacity: 0; transform: scale(0.2) rotate(0deg); } 30% { opacity: 1; transform: scale(1) rotate(20deg); } 100% { opacity: 0; transform: scale(0.5) rotate(60deg); } }

/* вимкнені анімації: показуємо готовий результат без руху */
.vh.is-static .vh__frame { opacity: 1; transform: none; }
.vh.is-static .vh__img--after { opacity: 1; -webkit-mask-image: none; mask-image: none; }
.vh.is-static .vh-mesh { opacity: 1; }
.vh.is-static .vh-mesh__lines, .vh.is-static .vh-mesh__jaw { stroke-dashoffset: 0; }
.vh.is-static .vh__status-done { opacity: 1; transform: none; }

/* ---------- адаптивність ---------- */
@media (max-width: 1023px) {
  /* планшет і телефон: заголовок → портрет (головний ефект на першому екрані) → текст → кроки й кнопка */
  .vh__wrap { height: auto; display: flex; flex-direction: column; padding-bottom: 6px; }
  .vh__top { position: static; order: 1; }
  .vh .vh__top h1 { font-size: clamp(2rem, 8.4vw, 3rem); }
  .vh__needle { display: none; }
  .vh__stage { position: relative; order: 2; left: auto; top: auto; transform: none; width: min(100%, 560px); height: auto; margin: 0.4rem auto 0; }
  .vh__left { position: static; order: 3; width: auto; max-width: 28rem; margin: -9% 0 0; }
  .vh__sub { font-size: clamp(1.5rem, 6.4vw, 2rem); }
  .vh__lead { font-size: 0.97rem; }
  .vh__right { position: static; order: 4; align-items: flex-start; text-align: left; margin-top: 1.5rem; }
  .vh__steps { font-size: clamp(1.7rem, 7.4vw, 2.3rem); }
  .vh__note { position: static; order: 5; margin-top: 1.1rem; text-align: left; }
  .vh__status { bottom: 12%; }
  .vh__status > span { font-size: 0.76rem; padding: 0.45rem 0.85rem; }
  .vh .viz-trust { justify-content: flex-start; margin-top: 4px; padding-bottom: 28px; }
}

/* ---------- Каркас ---------- */
.viz { padding: 8px 0 clamp(48px, 7vw, 96px); background: none; }
.viz-shell { max-width: 1120px; margin: 0 auto; }
.viz-screen[hidden],
.viz [hidden] { display: none !important; }
.viz-screen { animation: viz-enter 0.5s var(--ease-out) both; }
@keyframes viz-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.viz-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--viz-shadow); padding: clamp(1.25rem, 3vw, 2rem); }
.viz-notice { text-align: center; }
.viz h2,
.viz h3 { font-family: var(--font-display); }
.viz-h { margin: 0 0 var(--space-3); font-weight: 700; font-size: clamp(1.45rem, 2.4vw, 1.85rem); line-height: 1.2; letter-spacing: -0.01em; color: var(--ink-900); }
.viz-lead { margin: 0 0 var(--space-4); color: var(--ink-700); line-height: 1.6; }
.viz :focus-visible { outline: 3px solid var(--violet-500); outline-offset: 3px; }

/* Кнопки: один основний колір скрізь */
.viz .btn { font-family: var(--font-body); border-radius: 999px; font-weight: 700; }
.viz .btn-primary { background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%); color: #fff; border: 0; box-shadow: 0 16px 30px -16px rgba(91, 33, 182, 0.75); }
.viz .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 22px 36px -16px rgba(91, 33, 182, 0.8); }
.btn-lg { padding: 18px 34px; font-size: 16px; }
.btn-outline { background: #fff; color: var(--violet-700); border: 1.5px solid #b9a4f5; box-shadow: none; }
.btn-outline:hover { background: var(--violet-50); border-color: var(--violet-500); transform: translateY(-2px); }
.viz .btn[disabled] { opacity: 0.5; pointer-events: none; }
.viz-actions { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; margin-top: var(--space-5); }
.viz-actions--start { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
.viz-hint { margin: 0; font-size: 0.9rem; color: var(--ink-500); }
.viz-chip { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.55rem 1.05rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--violet-700); font-size: 0.9rem; font-weight: 600; transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease-out); }
.viz-chip svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.viz-chip:hover { background: var(--violet-50); border-color: #cdbcfb; transform: translateY(-1px); }
.viz-chip--danger:hover { border-color: #f0b8b2; color: var(--viz-bad); background: var(--viz-bad-soft); }
.viz-error { margin: var(--space-3) 0 0; padding: 0.8rem 1.1rem; border-radius: 14px; background: var(--viz-bad-soft); color: var(--viz-bad-ink); font-size: 0.92rem; font-weight: 600; }

/* ---------- Індикатор кроків: одна рівна лінія ---------- */
/* Етапи (v6): біла картка, лінії-прогрес, що «заповнюються», пульс активного кроку, послідовна поява при прокручуванні */
.viz-steps { position: relative; display: flex; margin: 0 0 var(--space-6); padding: 22px 8px 18px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--viz-shadow-sm); }
.viz-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; color: #8f86a3; transition: color 0.4s var(--ease-out); }
.viz-step:nth-child(1) { --i: 0; } .viz-step:nth-child(2) { --i: 1; } .viz-step:nth-child(3) { --i: 2; }
.viz-step:nth-child(4) { --i: 3; } .viz-step:nth-child(5) { --i: 4; } .viz-step:nth-child(6) { --i: 5; }
.viz-step:not(:last-child)::after,
.viz-step:not(:last-child)::before { content: ""; position: absolute; top: 17px; left: calc(50% + 26px); right: calc(-50% + 26px); height: 2px; border-radius: 2px; }
.viz-step:not(:last-child)::after { background: #e6e0f2; transform-origin: left center; }
.viz-step:not(:last-child)::before { z-index: 1; background: linear-gradient(90deg, var(--violet-500), var(--violet-600)); transform: scaleX(0); transform-origin: left center; transition: transform 0.7s var(--ease-out); }
.viz-step.is-done:not(:last-child)::before { transform: scaleX(1); }
.viz-step__dot { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #8f86a3; font-weight: 700; font-size: 0.9rem; box-shadow: inset 0 0 0 2px #e0d8f1; transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out); }
.viz-step__dot svg { position: absolute; width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.6); transition: opacity 0.3s, transform 0.4s var(--ease-out); }
.viz-step.is-active { color: var(--ink-900); }
.viz-step.is-active .viz-step__label { font-weight: 800; }
.viz-step.is-active .viz-step__dot { color: #fff; background: linear-gradient(135deg, var(--violet-500), var(--violet-700)); box-shadow: 0 8px 18px -8px rgba(91, 33, 182, 0.8); animation: viz-pulse 2.2s ease-out infinite; }
.viz-step.is-active.is-busy .viz-step__dot::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--violet-600); animation: viz-spin 1.1s linear infinite; }
.viz-step.is-done { color: var(--ink-700); }
.viz-step.is-done .viz-step__dot { background: var(--violet-600); box-shadow: none; animation: viz-pop 0.55s var(--ease-out); }
.viz-step.is-done .viz-step__num { opacity: 0; }
.viz-step.is-done .viz-step__dot svg { opacity: 1; transform: none; }
.viz-step__label { font-size: 0.86rem; font-weight: 600; line-height: 1.25; max-width: 9rem; }
.viz-step__short { display: none; }
@keyframes viz-pulse { 0% { box-shadow: 0 8px 18px -8px rgba(91, 33, 182, 0.8), 0 0 0 0 rgba(124, 58, 237, 0.4); } 70%, 100% { box-shadow: 0 8px 18px -8px rgba(91, 33, 182, 0.8), 0 0 0 12px rgba(124, 58, 237, 0); } }
@keyframes viz-pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.14); } 100% { transform: none; } }
/* поява при першому показі (клас is-armed ставить js/visualizer/motion.js, без JS етапи видно одразу) */
.viz-steps.is-armed .viz-step__dot,
.viz-steps.is-armed .viz-step__label { opacity: 0; transform: translateY(10px) scale(0.85); }
.viz-steps.is-armed .viz-step:not(:last-child)::after { transform: scaleX(0); }
.viz-steps.is-armed.is-in .viz-step__dot { opacity: 1; transform: none; transition: opacity 0.5s var(--ease-out) calc(var(--i) * 110ms), transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.3) calc(var(--i) * 110ms), background 0.4s var(--ease-out), color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out); }
.viz-steps.is-armed.is-in .viz-step__label { opacity: 1; transform: none; transition: opacity 0.5s var(--ease-out) calc(var(--i) * 110ms + 140ms), transform 0.5s var(--ease-out) calc(var(--i) * 110ms + 140ms); }
.viz-steps.is-armed.is-in .viz-step:not(:last-child)::after { transform: scaleX(1); transition: transform 0.5s var(--ease-out) calc(var(--i) * 110ms + 120ms); }
@keyframes viz-spin { to { transform: rotate(360deg); } }

/* ---------- 1. Завантаження ---------- */
.viz-grid { display: grid; gap: var(--space-5); }
.viz-grid--upload { grid-template-columns: 1.25fr 1fr; align-items: stretch; margin-bottom: var(--space-5); }
.viz-upload { display: flex; flex-direction: column; }
.viz-drop { position: relative; flex: 1; min-height: 340px; display: grid; place-items: center; border-radius: 16px; border: 2px solid transparent; background: radial-gradient(120% 90% at 50% 0%, #f7f2ff 0%, #fcfbff 62%); cursor: pointer; overflow: hidden; transition: background 0.25s, box-shadow 0.25s; animation: viz-drop-glow 3.2s ease-in-out infinite; }
.viz-drop:hover,
.viz-drop.is-over { background: #f3ecff; animation: none; }
.viz-drop.is-over { box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.16); }
.viz-drop.has-photo { border-color: var(--scene); background: var(--scene); cursor: default; animation: none; }
/* бігучий пунктир по краю: одразу видно, що сюди треба «покласти» файл */
.viz-drop__ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.viz-drop__ring rect { x: 1px; y: 1px; width: calc(100% - 2px); height: calc(100% - 2px); rx: 15px; ry: 15px; fill: none; stroke: #b9a3f5; stroke-width: 2; stroke-dasharray: 8 8; animation: viz-march 1.4s linear infinite; transition: stroke 0.25s; }
.viz-drop:hover .viz-drop__ring rect,
.viz-drop.is-over .viz-drop__ring rect { stroke: var(--violet-500); stroke-width: 2.4; animation-duration: 0.7s; }
.viz-drop.has-photo .viz-drop__ring { display: none; }
.viz-drop__empty { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.7rem; padding: 2rem 1.25rem; text-align: center; color: var(--ink-700); width: 100%; }
.viz-drop__empty strong { color: var(--ink-900); font-size: 1.18rem; font-weight: 700; }
.viz-drop__empty small { color: var(--ink-500); font-size: 0.88rem; }
.viz-drop__or { display: flex; align-items: center; gap: 0.8rem; width: min(260px, 80%); color: var(--ink-500); font-size: 0.9rem; }
.viz-drop__or::before,
.viz-drop__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* ілюстрація «фото-рамка»: видошукач, силует, лінія сканування, значок «завантажити» */
.viz-drop__icon { position: relative; display: block; width: 132px; height: 138px; margin-bottom: 0.1rem; transition: transform 0.35s var(--ease-out); }
.viz-drop:hover .viz-drop__icon { transform: translateY(-3px) scale(1.04); }
.viz-drop__icon svg { display: block; width: 100%; height: 100%; overflow: visible; }
.viz-drop__icon .vg-corners path { fill: none; stroke: var(--violet-500); stroke-width: 3.4; stroke-linecap: round; animation: vg-breathe 2.4s ease-in-out infinite; }
.viz-drop__icon .vg-person circle,
.viz-drop__icon .vg-person path { fill: #efe8ff; stroke: #c4b3f4; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.viz-drop__icon .vg-person .vg-smile { fill: none; stroke: var(--violet-500); stroke-width: 2.4; }
.viz-drop__icon .vg-scan { fill: var(--violet-400); opacity: 0.75; filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.7)); animation: vg-scan 2.8s ease-in-out infinite; }
.viz-drop__icon .vg-badge circle { fill: var(--violet-600); }
.viz-drop__icon .vg-badge path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.viz-drop__icon .vg-badge { animation: vg-bob 1.7s ease-in-out infinite; }
.viz-drop__icon .vg-ripple { fill: none; stroke: var(--violet-500); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: vg-ripple 2.1s ease-out infinite; }
.viz-drop__empty [data-pick] { animation: viz-btn-pulse 2.4s ease-out infinite; }
.viz-drop:hover [data-pick] { animation: none; transform: translateY(-1px); }
@keyframes viz-drop-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); } 50% { box-shadow: 0 0 0 8px rgba(124, 58, 237, 0.09); } }
@keyframes viz-march { to { stroke-dashoffset: -32; } }
@keyframes vg-breathe { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes vg-scan { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: 0.8; } 88% { opacity: 0.8; } 100% { transform: translateY(104px); opacity: 0; } }
@keyframes vg-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes vg-ripple { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(2); opacity: 0; } }
@keyframes viz-btn-pulse { 0% { box-shadow: 0 16px 30px -16px rgba(91, 33, 182, 0.75), 0 0 0 0 rgba(124, 58, 237, 0.4); } 70%, 100% { box-shadow: 0 16px 30px -16px rgba(91, 33, 182, 0.75), 0 0 0 12px rgba(124, 58, 237, 0); } }
.viz-drop__preview { position: absolute; inset: 0; display: grid; place-items: center; }
.viz-drop__preview img { width: 100%; height: 100%; object-fit: contain; }
.viz-drop__actions { position: absolute; left: 0.8rem; right: 0.8rem; bottom: 0.8rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.viz-drop__actions .viz-chip { background: rgba(255, 255, 255, 0.95); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.6); }

.viz-tips { display: flex; flex-direction: column; background: #f7f3ff; border-color: #ece4fb; box-shadow: none; }
.viz-tips__list { display: grid; gap: 1.1rem; margin-top: var(--space-2); }
.viz-tips__list li { display: flex; gap: 1rem; align-items: flex-start; color: var(--ink-700); font-size: 0.95rem; line-height: 1.45; }
.viz-tips__list strong { display: block; color: var(--ink-900); margin-bottom: 0.15rem; font-size: 1rem; }
.viz-tip-ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px #e6dcfb; }
.viz-tip-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--violet-700); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.viz-consent { display: grid; gap: 0.95rem; }
.viz-check { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: start; cursor: pointer; font-size: 0.95rem; line-height: 1.5; color: var(--ink-700); }
.viz-check input { position: absolute; top: 0; left: 0; opacity: 0; width: 26px; height: 26px; margin: 0; cursor: pointer; }
.viz-check__box { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid #c9bde6; background: #fff; display: grid; place-items: center; transition: background 0.2s, border-color 0.2s, box-shadow 0.2s; }
.viz-check__box::after { content: ""; width: 6px; height: 11px; margin-top: -2px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); transition: transform 0.25s var(--ease-out); }
.viz-check input:checked + .viz-check__box { background: var(--violet-600); border-color: var(--violet-600); }
.viz-check input:checked + .viz-check__box::after { transform: rotate(45deg) scale(1); }
.viz-check input:focus-visible + .viz-check__box { box-shadow: 0 0 0 4px var(--violet-100); outline: 2px solid var(--violet-500); outline-offset: 2px; }
.viz-details { font-size: 0.92rem; color: var(--ink-700); }
.viz-details summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.55rem 1.1rem; border-radius: 999px; border: 1.5px solid #b9a4f5; background: #fff; color: var(--violet-700); font-weight: 600; transition: background 0.2s, border-color 0.2s; }
.viz-details summary:hover { background: var(--violet-50); border-color: var(--violet-500); }
.viz-details summary::-webkit-details-marker { display: none; }
.viz-details summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform 0.25s var(--ease-out); }
.viz-details[open] summary::after { transform: rotate(225deg) translate(-1px, -1px); }
.viz-details ul { list-style: disc; padding: 0.9rem 1rem 0.2rem 1.4rem; display: grid; gap: 0.45rem; line-height: 1.55; }
.viz-details a { color: var(--violet-700); text-decoration: underline; }
.viz-consent .viz-actions { flex-direction: row; justify-content: space-between; align-items: center; gap: 1rem 1.5rem; margin-top: 0.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line-soft); }
.viz-consent .viz-actions .viz-hint { order: -1; text-align: left; flex: 1; }
.viz [data-analyze] { min-width: 15rem; }
/* Неактивна кнопка: явно «вимкнена», із замком; курсор «заборонено» дає js/cursor.js */
.viz .btn[data-analyze][disabled] { opacity: 1; pointer-events: auto; cursor: not-allowed; background: #efeaf8; color: #8f84a8; box-shadow: inset 0 0 0 1.5px #d9cff0; filter: none; transform: none; }
.viz .btn[data-analyze][disabled]::before { content: ""; display: inline-block; width: 1.05em; height: 1.05em; margin-right: 0.55rem; vertical-align: -0.16em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239583b4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2.5'/%3E%3Cpath d='M8 11V8a4 4 0 018 0v3'/%3E%3C/svg%3E") center / contain no-repeat; }
.viz-actions:has([data-analyze][disabled]:hover) .viz-hint { color: var(--violet-700); font-weight: 700; animation: viz-nudge 0.45s var(--ease-out); }
@keyframes viz-nudge { 0%, 100% { transform: none; } 30% { transform: translateX(-4px); } 65% { transform: translateX(4px); } }
.cursor--disabled .cursor__ring { width: 42px; height: 42px; opacity: 0.85; }
.cursor--disabled .cursor__ring::after { content: ""; position: absolute; left: 50%; top: 50%; width: 72%; height: 2px; background: rgba(255, 255, 255, 0.75); transform: translate(-50%, -50%) rotate(-45deg); }
.cursor--disabled .cursor__dot { opacity: 0.4; }

/* ---------- 2. Аналіз: фото на темній сцені ---------- */
.viz-grid--analysis { grid-template-columns: minmax(260px, 0.62fr) 1fr; align-items: start; margin-bottom: var(--space-5); }
.viz-photo-card { padding: 0.8rem; position: sticky; top: 96px; background: var(--scene); border-color: var(--scene); box-shadow: 0 40px 60px -40px rgba(27, 19, 48, 0.8); }
.viz-photo { position: relative; border-radius: 14px; overflow: hidden; background: var(--scene-2); aspect-ratio: var(--ar, 4 / 5); }
.viz-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viz-scan { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: linear-gradient(180deg, transparent 0, rgba(124, 58, 237, 0) 40%, rgba(167, 139, 250, 0.6) 50%, rgba(124, 58, 237, 0) 60%, transparent 100%); background-size: 100% 60%; background-repeat: no-repeat; }
/* рамка-видошукач навколо усмішки з'являється разом зі скануванням */
.viz-scan::before {
  content: "";
  position: absolute;
  inset: 22% 12% 16%;
  --c: rgba(255, 255, 255, 0.95);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 28px 3px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 0 / 3px 28px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 28px 3px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 3px 28px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 28px 3px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 3px 28px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 28px 3px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 3px 28px no-repeat;
  filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.8));
}
.viz-scan.is-on { opacity: 1; animation: viz-scan 2.4s ease-in-out infinite; }
@keyframes viz-scan { from { background-position: 0 -40%; } to { background-position: 0 140%; } }
.viz-photo-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.viz-photo-actions .viz-chip { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.viz-photo-actions .viz-chip:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.viz-photo-actions .viz-chip--danger:hover { background: rgba(179, 52, 42, 0.35); border-color: rgba(255, 170, 160, 0.6); color: #fff; }

.viz-report [data-report-loading] h2 { font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.7rem; }
.viz-checking { display: grid; gap: 0.75rem; margin: var(--space-4) 0 var(--space-5); }
.viz-checking li { position: relative; padding-left: 2.1rem; color: var(--ink-900); font-weight: 500; }
.viz-checking li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--violet-600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
  opacity: 0.35;
  animation: viz-blink 1.6s ease-in-out infinite;
}
.viz-checking li:nth-child(2)::before { animation-delay: 0.25s; }
.viz-checking li:nth-child(3)::before { animation-delay: 0.5s; }
.viz-checking li:nth-child(4)::before { animation-delay: 0.75s; }
@keyframes viz-blink { 0%, 100% { opacity: 0.3; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.04); } }
.viz-indeterminate { position: relative; height: 6px; border-radius: 6px; background: var(--violet-100); overflow: hidden; }
.viz-indeterminate::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 38%; border-radius: 6px; background: var(--violet-600); animation: viz-slide 1.5s ease-in-out infinite; }
@keyframes viz-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(290%); } }

/* Звіт: статус-плашка, дві картки, порада */
.viz-status { display: flex; gap: 0.8rem; align-items: center; padding: 0.7rem 1.2rem 0.7rem 0.8rem; border-radius: 16px; margin-bottom: var(--space-4); }
.viz-status__ico { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.viz-status__ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.viz-status h2 { margin: 0; font-family: var(--font-body); font-size: 1.02rem; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
.viz-status p { margin: 0.2rem 0 0; font-size: 0.92rem; font-weight: 500; }
.viz-status--ready { background: var(--viz-ok-soft); color: var(--viz-ok-ink); }
.viz-status--ready .viz-status__ico { background: var(--viz-ok); color: #fff; }
.viz-status--partial { background: var(--viz-warn-soft); color: var(--viz-warn-ink); }
.viz-status--partial .viz-status__ico { background: var(--viz-warn); color: #fff; }
.viz-status--rejected { background: var(--viz-bad-soft); color: var(--viz-bad-ink); }
.viz-status--rejected .viz-status__ico { background: var(--viz-bad); color: #fff; }

.viz-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: var(--space-4); }
.viz-report-grid--one { grid-template-columns: 1fr; }
.viz-subcard { padding: 1.2rem 1.3rem; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.viz-sub { margin: 0 0 0.85rem; font-size: 1.1rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink-900); }
.viz-quality { display: grid; gap: 0.7rem; margin: 0; border: 0; }
.viz-quality > div { display: grid; grid-template-columns: minmax(4.6rem, 0.55fr) 1.45fr; gap: 0.8rem; align-items: baseline; padding: 0; font-size: 0.97rem; }
.viz-quality dt { font-weight: 600; color: var(--ink-900); }
.viz-quality dd { margin: 0; position: relative; padding-left: 1.7rem; color: var(--ink-700); }
.viz-quality dd::before { content: "→"; position: absolute; left: 0; color: var(--violet-400); font-weight: 700; }
.viz-notes { margin: 0; padding: 0; color: var(--ink-700); line-height: 1.6; }
.viz-notes p { margin: 0 0 0.7rem; }
.viz-notes ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.viz-notes li { position: relative; padding-left: 1.9rem; }
.viz-notes li::before { content: ""; position: absolute; left: 0; top: 0.12em; width: 20px; height: 20px; border-radius: 50%; background: var(--viz-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat; }
.viz-retake { display: flex; gap: 0.8rem; align-items: center; margin-top: var(--space-4); padding: 0.9rem 1.15rem; border-radius: 16px; background: var(--viz-warn-soft); color: var(--viz-warn-ink); font-size: 0.97rem; font-weight: 500; }
.viz-retake__ico { flex: none; box-sizing: border-box; width: 38px; height: 38px; padding: 8px; border-radius: 50%; background: #fff; fill: none; stroke: #c27a0e; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.viz-report-actions { margin-top: var(--space-5); display: flex; gap: 0.7rem; flex-wrap: wrap; }

/* ---------- 3. Вибір процедури ---------- */
.viz-select .viz-h { margin-bottom: var(--space-2); }
.viz-select .viz-sub { margin-top: var(--space-5); }
.viz-proc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 1.4rem 1rem; margin-top: 1.2rem; }
.viz-proc { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.9rem; padding: 1.5rem 1.2rem 0; border-radius: 18px; border: 1.5px solid var(--line); background: #fff; color: var(--ink-700); overflow: visible; transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease-out), background 0.25s; }
.viz-proc:hover { transform: translateY(-3px); border-color: #cdbcfb; box-shadow: var(--viz-shadow); }
.viz-proc__ico { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: #f1ebff; flex: none; }
.viz-proc__ico svg { width: 36px; height: 36px; fill: none; stroke: var(--violet-700); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.viz-proc__ico svg .vi-t { fill: var(--violet-500); fill-opacity: 0.15; }
.viz-proc__ico svg .vi-f { fill: var(--violet-700); stroke: none; }
.viz-proc__main { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; min-width: 0; flex: 1; }
.viz-proc__tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 0.25rem 0.9rem; border-radius: 999px; background: var(--violet-600); color: #fff; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.viz-proc__title { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.2; color: var(--ink-900); }
.viz-proc__short { font-size: 0.93rem; line-height: 1.5; color: var(--ink-700); }
.viz-proc__why { align-self: stretch; margin: 0.4rem -1.2rem 0; display: flex; align-items: center; justify-content: center; gap: 0.55rem; padding: 0.85rem 1rem; border-radius: 0 0 16px 16px; background: var(--viz-ok-soft); color: var(--viz-ok-ink); font-size: 0.9rem; font-weight: 500; line-height: 1.35; text-align: left; }
.viz-proc__why svg { flex: none; box-sizing: border-box; width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--viz-ok); fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.viz-proc:not(:has(.viz-proc__why)) { padding-bottom: 1.4rem; }
.viz-proc__tick { position: absolute; right: 0.8rem; top: 0.8rem; width: 28px; height: 28px; border-radius: 50%; background: var(--violet-600); display: grid; place-items: center; opacity: 0; transform: scale(0.6); transition: opacity 0.2s, transform 0.3s var(--ease-out); }
.viz-proc__tick svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.viz-proc[aria-checked="true"] { border-color: var(--violet-600); background: #f9f6ff; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14), var(--viz-shadow); }
.viz-proc[aria-checked="true"] .viz-proc__tick { opacity: 1; transform: none; }
.viz-proc[disabled] { cursor: not-allowed; background: #faf8fe; border-style: dashed; box-shadow: none; padding-bottom: 1.3rem; }
.viz-proc[disabled]:hover { transform: none; border-color: var(--line); box-shadow: none; }
.viz-proc[disabled] .viz-proc__ico { background: #efeaf6; }
.viz-proc[disabled] .viz-proc__ico svg { stroke: #a79fb5; }
.viz-proc[disabled] .viz-proc__ico svg .vi-t { fill: #a79fb5; }
.viz-proc[disabled] .viz-proc__ico svg .vi-f { fill: #a79fb5; }
.viz-proc[disabled] .viz-proc__title { color: var(--ink-500); }
.viz-proc__lock { display: flex; align-items: flex-start; justify-content: center; gap: 0.45rem; font-size: 0.88rem; line-height: 1.4; color: var(--ink-500); }
.viz-proc__lock svg { flex: none; width: 16px; height: 16px; margin-top: 0.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.viz-more { margin-top: var(--space-4); border-radius: 16px; background: #fff; border: 1.5px solid var(--line); }
.viz-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.3rem; cursor: pointer; list-style: none; font-weight: 700; color: var(--ink-900); }
.viz-more > summary::-webkit-details-marker { display: none; }
.viz-more > summary::after { content: ""; flex: none; width: 9px; height: 9px; border: solid var(--violet-600); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-3px); transition: transform 0.25s var(--ease-out); }
.viz-more[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.viz-more > .viz-proc-grid { padding: 0.8rem 1rem 1rem; margin-top: 0; }
.viz-empty { padding: 1rem 1.2rem; border-radius: 14px; background: var(--violet-50); color: var(--ink-700); }
/* нижня панель: липка, щоб кнопка завжди була під рукою */
.viz-create-bar { position: sticky; bottom: 14px; z-index: 6; margin: var(--space-5) -0.4rem -0.4rem; padding: 0.7rem 0.7rem 0.7rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-radius: 18px; background: #fff; border: 1.5px solid var(--line); box-shadow: 0 24px 44px -24px rgba(46, 16, 101, 0.5); }
.viz-create-bar__info { display: flex; align-items: center; gap: 0.9rem; flex: 1; min-width: 14rem; color: var(--ink-700); font-size: 0.96rem; }
.viz-create-bar__info::before { content: ""; flex: none; width: 42px; height: 42px; border-radius: 50%; background: #f1ebff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b21b6' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5.6c-1.1-.9-2.1-1.6-3.5-1.6C6.1 4 4.5 5.8 4.5 8.2c0 2 .8 3.4 1.4 5.2.6 1.8.8 4.3 1.5 5.7.4.8 1.3.8 1.6 0 .6-1.4.9-3.4 1.6-3.4h.8c.7 0 1 2 1.6 3.4.3.8 1.2.8 1.6 0 .7-1.4.9-3.9 1.5-5.7.6-1.8 1.4-3.2 1.4-5.2C19.5 5.8 17.9 4 15.5 4c-1.4 0-2.4.7-3.5 1.6z'/%3E%3C/svg%3E") center / 22px no-repeat; }
.viz-create-bar__info strong { color: var(--ink-900); }

/* ---------- 4–5. Створення і перевірка: темна сцена ---------- */
.viz-gen { padding: clamp(1.25rem, 3vw, 2.25rem); background: linear-gradient(160deg, var(--scene) 0%, #2b1d50 100%); border-color: var(--scene); color: rgba(255, 255, 255, 0.86); box-shadow: 0 40px 70px -40px rgba(27, 19, 48, 0.85); }
.gen-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: var(--space-5); }
.gen-eyebrow { margin: 0 0 0.3rem; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #c4b5fd; }
.gen-title { margin: 0; font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.2rem); color: #fff; line-height: 1.15; letter-spacing: -0.01em; }
.gen-sub { margin: 0.45rem 0 0; color: rgba(255, 255, 255, 0.78); min-height: 1.5em; transition: opacity 0.3s; }
.gen-timer { display: inline-flex; align-items: center; gap: 0.55rem; white-space: nowrap; padding: 0.55rem 1.1rem; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.gen-timer::before { content: ""; width: 18px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat; }

.gen-slots { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: var(--space-5); margin-bottom: var(--space-5); }
.gen-slots[data-cols="2"] { max-width: 820px; margin-inline: auto; }
.gen-slot { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: var(--ar, 4 / 5); background: var(--scene-2); isolation: isolate; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 24px 40px -24px rgba(0, 0, 0, 0.7); }
.gen-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter 0.9s var(--ease-out), transform 1.2s var(--ease-out), opacity 0.6s; }
.gen-slot__fade { opacity: 0; }
.gen-slot__fade.is-in { opacity: 1; }
.gen-slot[data-state="pending"] img.gen-slot__base { filter: grayscale(0.6) blur(9px) brightness(0.8); transform: scale(1.08); }
.gen-slot[data-state="generate"] img.gen-slot__base { filter: blur(4px) saturate(1.1) brightness(0.9); transform: scale(1.03); }
.gen-slot[data-state="generate"]::before,
.gen-slot[data-state="check"]::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.gen-slot[data-state="generate"]::before { background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%); background-size: 250% 100%; animation: viz-sheen 1.9s ease-in-out infinite; mix-blend-mode: soft-light; }
.gen-slot[data-state="generate"]::after { content: ""; position: absolute; inset: 0; z-index: 1; box-shadow: inset 0 0 0 3px rgba(167, 139, 250, 0.9), inset 0 0 38px rgba(167, 139, 250, 0.55); animation: viz-glow 1.8s ease-in-out infinite; pointer-events: none; }
.gen-slot[data-state="check"]::before { background: linear-gradient(180deg, transparent 0, rgba(255, 255, 255, 0) 42%, rgba(196, 181, 253, 0.6) 50%, rgba(255, 255, 255, 0) 58%, transparent 100%); background-size: 100% 70%; background-repeat: no-repeat; animation: viz-scan 2.1s ease-in-out infinite; }
.gen-slot[data-state="check"]::after { content: ""; position: absolute; inset: 0; z-index: 1; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85); pointer-events: none; }
.gen-slot[data-state="failed"] img { filter: grayscale(1) brightness(0.7); }
@keyframes viz-sheen { from { background-position: 150% 0; } to { background-position: -150% 0; } }
@keyframes viz-glow { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
/* підпис кадра — біла пігулка внизу ліворуч; активний стан по центру кадра зі «спінером» */
.gen-slot__label { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.gen-slot__name { position: absolute; left: 12px; bottom: 12px; padding: 0.4rem 1rem; border-radius: 999px; background: #fff; color: var(--ink-900); font-weight: 700; font-size: 0.9rem; }
.gen-slot__state { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.8rem; border-radius: 999px; background: rgba(27, 19, 48, 0.7); color: #fff; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.gen-slot[data-state="generate"] .gen-slot__state,
.gen-slot[data-state="check"] .gen-slot__state { right: auto; bottom: auto; left: 50%; top: 50%; flex-direction: column; gap: 0.7rem; padding: 0; background: none; transform: translate(-50%, -50%); font-family: var(--font-display); font-size: 1.35rem; text-shadow: 0 2px 14px rgba(27, 19, 48, 0.8); }
.gen-slot[data-state="generate"] .gen-slot__state::before,
.gen-slot[data-state="check"] .gen-slot__state::before { content: ""; width: 54px; height: 54px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: viz-spin 1s linear infinite; }
.gen-slot[data-state="approved"] .gen-slot__state,
.gen-slot[data-state="done"] .gen-slot__state { background: var(--violet-600); }
.gen-slot[data-state="failed"] .gen-slot__state { background: var(--viz-bad); }
.gen-slot__state svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gen-slot__lock { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, 0.92); }
.gen-slot__lock svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 8px rgba(27, 19, 48, 0.6)); }
.gen-slot.just-approved { animation: viz-pop 0.9s var(--ease-out); }
@keyframes viz-pop { 0% { transform: scale(0.97); box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.7); } 55% { transform: scale(1.015); box-shadow: 0 0 0 14px rgba(167, 139, 250, 0); } 100% { transform: none; } }

.gen-steps { display: grid; gap: var(--space-4); margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.gen-steps > li,
.gen-step-list > li,
.gen-attempts > li { list-style: none; }
.gen-step-list { padding: 0; margin: 0; list-style: none; }
.gen-group { border-radius: 16px; padding: 1.1rem 1.3rem; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); transition: background 0.4s, border-color 0.4s, opacity 0.4s; }
.gen-group[data-state="pending"] { opacity: 0.6; }
.gen-group[data-state="active"] { background: rgba(255, 255, 255, 0.1); border-color: rgba(196, 181, 253, 0.5); }
.gen-group[data-state="approved"] { background: rgba(23, 132, 74, 0.2); border-color: rgba(120, 220, 160, 0.4); }
.gen-group__title { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin: 0 0 0.8rem; font-family: var(--font-body); font-size: 0.82rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); }
.gen-group__badge { text-transform: none; letter-spacing: 0; font-weight: 700; font-size: 0.8rem; color: #8ce6b4; }
.gen-step-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.6rem; }
.gen-step { display: grid; grid-template-columns: 32px 1fr; gap: 0.35rem 0.8rem; align-items: start; color: rgba(255, 255, 255, 0.6); transition: color 0.3s; }
.gen-step__ico { position: relative; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(255, 255, 255, 0.28); background: transparent; transition: background 0.3s, border-color 0.3s; }
.gen-step__ico svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.5); transition: opacity 0.25s, transform 0.35s var(--ease-out); }
.gen-step__title { font-weight: 700; color: inherit; line-height: 32px; }
.gen-step__hint { margin: 0; font-size: 0.9rem; line-height: 1.45; color: rgba(255, 255, 255, 0.78); grid-column: 2; }
.gen-step[data-state="active"] { color: #fff; }
.gen-step[data-state="active"] .gen-step__ico { border-color: #c4b5fd; }
.gen-step[data-state="active"] .gen-step__ico::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid transparent; border-top-color: #c4b5fd; border-right-color: rgba(196, 181, 253, 0.35); animation: viz-spin 1s linear infinite; }
.gen-step[data-state="done"] { color: rgba(255, 255, 255, 0.86); }
.gen-step[data-state="done"] .gen-step__ico { background: var(--violet-500); border-color: var(--violet-500); }
.gen-step[data-state="done"] .gen-step__ico svg { opacity: 1; transform: none; }
/* смужка під кожним кроком: порожня → біжить → повна */
.gen-step::after { content: ""; grid-column: 2; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.14); }
.gen-step[data-state="done"]::after { background: linear-gradient(90deg, var(--violet-500), #c4b5fd); }
.gen-step[data-state="active"]::after { display: none; }
.gen-step .viz-indeterminate { grid-column: 2; margin-top: 0.1rem; height: 6px; background: rgba(255, 255, 255, 0.14); }
.gen-step .viz-indeterminate::before { background: linear-gradient(90deg, var(--violet-500), #c4b5fd); }
.gen-step:not([data-state="active"]) .viz-indeterminate,
.gen-step:not([data-state="active"]) .gen-step__hint { display: none; }
.gen-callout { margin: 0.8rem 0 0; padding: 0.75rem 1rem; border-radius: 12px; background: rgba(255, 231, 170, 0.14); color: #ffe7aa; font-size: 0.92rem; line-height: 1.45; animation: viz-enter 0.4s var(--ease-out) both; }
.gen-callout--wait { background: rgba(196, 181, 253, 0.16); color: #e7defd; }
.gen-attempts { list-style: none; margin: 0.9rem 0 0; padding: 0.8rem 0 0; border-top: 1px dashed rgba(255, 255, 255, 0.2); display: grid; gap: 0.45rem; }
.gen-attempts[hidden] { display: none; }
.gen-attempt { position: relative; padding-left: 1.6rem; font-size: 0.92rem; line-height: 1.45; color: rgba(255, 255, 255, 0.82); animation: viz-enter 0.4s var(--ease-out) both; }
.gen-attempt::before { position: absolute; left: 0; top: 0.05em; width: 1.1rem; text-align: center; font-weight: 800; }
.gen-attempt[data-kind="ok"]::before { content: "✓"; color: #8ce6b4; }
.gen-attempt[data-kind="bad"]::before { content: "✕"; color: #ff9d92; }
.gen-attempt[data-kind="now"] { color: #fff; font-weight: 600; }
.gen-attempt[data-kind="now"]::before { content: ""; top: 0.35em; width: 0.7rem; height: 0.7rem; margin-left: 0.2rem; border-radius: 50%; border: 2px solid #c4b5fd; border-top-color: transparent; animation: viz-spin 1s linear infinite; }
.gen-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: var(--space-4); border-top: 1px solid rgba(255, 255, 255, 0.14); }
.gen-note { margin: 0; display: flex; align-items: center; gap: 0.6rem; font-size: 0.92rem; color: rgba(255, 255, 255, 0.7); }
.gen-note::before { content: ""; flex: none; width: 20px; height: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' opacity='.7'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.gen-foot .btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.gen-foot .btn-outline:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }

/* помилка: світла центрована картка на темній сцені */
.gen-error { position: relative; margin: 0 auto var(--space-5); padding: 6rem 1.5rem 1.6rem; max-width: 640px; text-align: center; color: var(--ink-700); background: #fff; border-radius: 20px; box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.6); }
.gen-error::before { content: ""; position: absolute; top: 1.4rem; left: 50%; width: 64px; height: 64px; margin-left: -32px; border-radius: 50%; background: #f1ebff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b21b6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.3h.01'/%3E%3C/svg%3E") center / 34px no-repeat; }
.gen-error h3 { margin: 0 0 0.5rem; font-weight: 700; font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.2; color: var(--ink-900); }
.gen-error p { margin: 0; line-height: 1.6; }
.gen-error__why { margin: 1rem auto 0; padding: 0.9rem 1.1rem; max-width: 30rem; text-align: left; border-radius: 14px; background: var(--viz-bad-soft); color: var(--viz-bad-ink); }
.gen-error__why p { font-weight: 700; margin-bottom: 0.3rem; }
.gen-error__why ul { margin: 0; padding-left: 1.2rem; }
.gen-error__why li { margin: 0.15rem 0; }
.gen-error .viz-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: var(--space-5); }

/* ---------- 6. Результат ---------- */
.viz-result { padding: clamp(1.25rem, 3vw, 2.25rem); }
.res-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: var(--space-5); }
.res-head h2 { margin: 0; font-weight: 700; font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.12; letter-spacing: -0.01em; color: var(--ink-900); }
.res-name { color: var(--violet-700); font-style: italic; }
.res-head p { margin: 0.45rem 0 0; color: var(--ink-700); }
.res-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1.05rem 0.5rem 0.6rem; border-radius: 999px; background: var(--viz-ok-soft); color: var(--viz-ok-ink); font-size: 0.9rem; font-weight: 700; white-space: nowrap; }
.res-badge svg { box-sizing: border-box; width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--viz-ok); fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.res-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(250px, 0.85fr); gap: var(--space-5) var(--space-6); align-items: start; }
.res-main { min-width: 0; }
.res-side { position: sticky; top: 96px; }
.res-disclaimer { margin: var(--space-4) 0 0; color: var(--ink-700); font-size: 0.95rem; line-height: 1.6; }
.res-actions { display: grid; gap: 0.75rem; }
.res-actions .btn { width: 100%; justify-content: center; text-align: center; }
.res-actions .btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.res-secondary { margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: 0.6rem; }
.res-privacy { margin: var(--space-4) 0 0; display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.88rem; line-height: 1.45; color: var(--ink-500); }
.res-privacy svg { flex: none; width: 17px; height: 17px; margin-top: 0.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Слайдер «До / Після» на темній сцені */
.ba { position: relative; --pos: 50%; padding: 0; border-radius: 20px; overflow: hidden; aspect-ratio: var(--ar, 4 / 5); max-height: 74vh; background: var(--scene); user-select: none; -webkit-user-select: none; touch-action: pan-y; box-shadow: 0 0 0 8px var(--scene), 0 40px 60px -34px rgba(27, 19, 48, 0.7); cursor: ew-resize; width: calc(100% - 16px); margin: 8px; }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.ba__before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 56px; margin-left: -28px; display: grid; place-items: center; background: none; border: 0; padding: 0; cursor: ew-resize; touch-action: none; z-index: 3; }
.ba__handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 14px rgba(0, 0, 0, 0.35); }
.ba__knob { position: relative; width: 54px; height: 54px; border-radius: 50%; background: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); display: grid; place-items: center; transition: transform 0.25s var(--ease-out); }
.ba__knob svg { width: 26px; height: 26px; fill: none; stroke: var(--violet-700); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ba__handle:hover .ba__knob,
.ba.is-drag .ba__knob { transform: scale(1.1); }
.ba__tag { position: absolute; bottom: 1rem; z-index: 2; padding: 0.45rem 1.15rem; border-radius: 999px; background: #fff; color: var(--ink-900); font-size: 0.92rem; font-weight: 700; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.5); transition: opacity 0.25s; }
.ba__tag--before { left: 1rem; }
.ba__tag--after { right: 1rem; }
.ba-expand { position: absolute; z-index: 4; right: 0.9rem; top: 0.9rem; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.95rem; border-radius: 999px; border: 0; background: rgba(255, 255, 255, 0.95); color: var(--ink-900); font-size: 0.86rem; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.5); }
.ba-expand svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ba-toggle { display: flex; width: max-content; margin: var(--space-5) auto 0; padding: 5px; gap: 4px; border-radius: 999px; background: #f1ebff; }
.ba-toggle button { padding: 0.55rem 1.7rem; border-radius: 999px; border: 0; background: transparent; font-weight: 700; color: var(--ink-500); transition: background 0.25s, color 0.25s, box-shadow 0.25s; }
.ba-toggle button.is-on { background: #fff; color: var(--violet-700); box-shadow: 0 8px 18px -8px rgba(91, 33, 182, 0.55); }

/* ---------- Лайтбокс ---------- */
.viz-lightbox { border: 0; padding: 0; width: min(96vw, 1080px); max-height: 94vh; border-radius: 22px; background: #14101f; color: #fff; overflow: hidden; }
.viz-lightbox::backdrop { background: rgba(27, 19, 48, 0.85); }
.viz-lightbox[open] { animation: viz-enter 0.3s var(--ease-out) both; }
.viz-lightbox__bar { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1rem 0.8rem 1.4rem; }
.viz-lightbox__title { font-weight: 700; }
.viz-lightbox__close,
.viz-lightbox__nav { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); color: #fff; transition: background 0.2s; }
.viz-lightbox__close:hover,
.viz-lightbox__nav:hover { background: rgba(255, 255, 255, 0.26); }
.viz-lightbox svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.viz-lightbox__stage { position: relative; display: grid; place-items: center; padding: 0 3.6rem 1.3rem; }
.viz-lightbox__stage img { max-width: 100%; max-height: calc(94vh - 110px); object-fit: contain; border-radius: 14px; }
.viz-lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.viz-lightbox__nav--prev { left: 0.8rem; }
.viz-lightbox__nav--next { right: 0.8rem; }
.viz-lightbox__nav[hidden] { display: none; }

/* Підказка про виконану дію (utils.toast) */
.viz-toast { position: fixed; left: 50%; bottom: 28px; z-index: 400; max-width: min(92vw, 420px); padding: 12px 22px; border-radius: 999px; background: var(--ink-900); color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 24px 50px -20px rgba(27, 19, 48, 0.7); opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out); }
.viz-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Адаптивність ---------- */
@media (max-width: 960px) {
  .res-layout { grid-template-columns: 1fr; }
  .res-side { position: static; }
}
@media (max-width: 900px) {
  .viz-grid--upload,
  .viz-grid--analysis { grid-template-columns: 1fr; }
  .viz-photo-card { position: static; }
  .viz-photo { max-height: 60vh; }
  .viz-drop { min-height: 300px; }
  .viz-drop__icon { width: 112px; height: 117px; }
  .viz-report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .viz-steps { margin-bottom: var(--space-5); padding: 16px 4px 12px; border-radius: 18px; }
  .viz-step__long { display: none; }
  .viz-step__short { display: inline; }
  .viz-step__label { font-size: 0.74rem; max-width: 4.8rem; opacity: 0; height: 0; overflow: hidden; }
  .viz-step.is-active .viz-step__label { opacity: 1; height: auto; }
  .viz-step__dot { width: 30px; height: 30px; font-size: 0.8rem; }
  .viz-step:not(:last-child)::after,
  .viz-step:not(:last-child)::before { top: 14px; left: calc(50% + 20px); right: calc(-50% + 20px); }
  .viz-consent .viz-actions { flex-direction: column; align-items: stretch; }
  .viz-consent .viz-actions .viz-hint { order: 2; text-align: center; }
  .viz-consent .viz-actions .btn { width: 100%; }
  .viz-quality > div { grid-template-columns: 1fr; gap: 0.1rem; }
  .gen-step-list { grid-template-columns: 1fr; }
  .gen-slots { gap: 0.7rem; }
  .gen-slot__name { left: 8px; bottom: 8px; font-size: 0.78rem; padding: 0.3rem 0.75rem; }
  .gen-slot__state { right: 8px; bottom: 8px; font-size: 0.68rem; padding: 0.2rem 0.55rem; }
  .gen-slot[data-state="generate"] .gen-slot__state,
  .gen-slot[data-state="check"] .gen-slot__state { font-size: 1.05rem; }
  .gen-slot[data-state="generate"] .gen-slot__state::before,
  .gen-slot[data-state="check"] .gen-slot__state::before { width: 40px; height: 40px; }
  .gen-slot__lock svg { width: 26px; height: 26px; }
  .gen-head { align-items: stretch; }
  .gen-timer { align-self: flex-start; }
  .viz-lightbox__stage { padding: 0 0.8rem 1rem; }
  .viz-lightbox__nav { top: auto; bottom: 1.4rem; transform: none; }
  .viz-lightbox__nav--prev { left: 1rem; }
  .viz-lightbox__nav--next { right: 1rem; }
  .viz-create-bar { margin-inline: 0; bottom: 10px; }
  .viz-create-bar .btn { width: 100%; }
  .ba { max-height: 70vh; width: 100%; margin: 0; box-shadow: 0 0 0 6px var(--scene), 0 30px 50px -30px rgba(27, 19, 48, 0.7); }
  .ba__knob { width: 46px; height: 46px; }
}
@media (max-width: 480px) {
  .viz > .container { padding-inline: 14px; }
  .viz .viz-card,
  .viz .viz-result,
  .viz .viz-gen { padding: 1rem; border-radius: 18px; }
  .viz-actions--start .btn { width: 100%; }
  .viz-proc-grid { grid-template-columns: 1fr; }
  .res-head .res-badge { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  .vh *,
  .vh *::before,
  .vh *::after,
  .viz-steps *,
  .viz-steps *::before,
  .viz-steps *::after,
  .viz-steps::before,
  .viz-steps::after,
  .viz-drop,
  .viz-drop *,
  .viz-drop *::before,
  .viz-drop *::after { animation: none !important; transition: none !important; }
  .viz-step.is-active .viz-step__dot { animation: none !important; }
  .viz-scan.is-on,
  .gen-slot[data-state="generate"]::before,
  .gen-slot[data-state="generate"]::after,
  .gen-slot[data-state="check"]::before,
  .viz-indeterminate::before,
  .viz-checking li::before,
  .gen-attempt[data-kind="now"]::before { animation: none !important; }
  .viz-indeterminate::before { width: 100%; opacity: 0.5; }
  .viz-actions:has([data-analyze][disabled]:hover) .viz-hint { animation: none; }
  .viz-toast { transition: none; }
}
