/* SONIAH — стилі. Дві теми: світла (головна, переваги, підтримка) і темна (конфігуратори, «Як це працює»). */
*,
*::before,
*::after { box-sizing: border-box; }
:root {
  --gold: #f7b500;
  --gold-soft: #ffc861;
  --radius: 26px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --head-h: 76px;
}
body[data-theme='light'] {
  --bg: #f3f4fb;
  --text: #1d2130;
  --muted: #555b6e;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --line: rgba(255, 255, 255, 0.95);
  --hair: rgba(29, 33, 48, 0.12);
  --shadow: 0 18px 50px rgba(108, 118, 160, 0.18);
  --accent-ink: #b47d00;
  --field: rgba(255, 255, 255, 0.8);
  background: linear-gradient(180deg, #e9ecfb 0%, #f4f5fc 38%, #f6f6fb 100%) fixed;
}
body[data-theme='dark'] {
  --bg: #0a1022;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.74);
  --glass: rgba(160, 175, 215, 0.13);
  --glass-strong: rgba(22, 30, 54, 0.82);
  --line: rgba(255, 255, 255, 0.24);
  --hair: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --accent-ink: #ffc861;
  --field: rgba(255, 255, 255, 0.07);
  background: #0a1022;
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 4.2vw, 3.4rem); line-height: 1.08; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-weight: 500; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.ico { width: 1.5em; height: 1.5em; flex: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

.glass {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.eyebrow {
  display: flex; align-items: center; gap: 16px; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase; margin-bottom: 18px;
}
.eyebrow::after { content: ''; width: 42px; height: 2px; background: var(--gold); border-radius: 2px; }
.lead { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.2rem); margin-top: 16px; max-width: 30em; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; white-space: nowrap;
  padding: 0 24px; height: 46px; border-radius: 999px; border: 1px solid var(--hair); background: transparent;
  font-weight: 500; font-size: 0.95rem; transition: transform 0.2s, box-shadow 0.25s, background 0.25s, border-color 0.25s;
}
.btn .ico { width: 1.15em; height: 1.15em; transition: transform 0.25s; }
.btn:hover .ico { transform: translateX(4px); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-cta { border-color: var(--text); }
body[data-theme='light'] .btn-cta:hover { background: var(--text); color: #fff; }
body[data-theme='dark'] .btn-cta { border-color: rgba(255, 255, 255, 0.7); }
body[data-theme='dark'] .btn-cta:hover { border-color: var(--gold-soft); box-shadow: 0 0 24px rgba(255, 180, 70, 0.45); }
.btn-glow {
  height: 58px; padding: 0 34px; font-size: 1.02rem; border: 1.5px solid var(--gold-soft);
  box-shadow: 0 0 22px rgba(255, 176, 60, 0.42), inset 0 0 18px rgba(255, 176, 60, 0.16);
}
.btn-glow:hover { box-shadow: 0 0 34px rgba(255, 176, 60, 0.7), inset 0 0 22px rgba(255, 176, 60, 0.28); transform: translateY(-1px); }
body[data-theme='light'] .btn-glow { background: #1d2130; color: #fff; border-color: #1d2130; box-shadow: 0 12px 30px rgba(247, 181, 0, 0.35); }
.btn-wide { width: 100%; }

/* ---------- шапка ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 20; height: var(--head-h);
  display: flex; align-items: center; gap: 24px; padding: 0 clamp(16px, 4.5vw, 64px);
}
.logo { display: flex; color: var(--text); }
.logo-svg { height: 44px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: clamp(18px, 3.2vw, 46px); margin: 0 auto; font-size: 0.95rem; }
.nav a { position: relative; padding: 10px 0; opacity: 0.92; white-space: nowrap; }
.nav a::after {
  content: ''; position: absolute; left: 50%; bottom: 0; width: 0; height: 2px; border-radius: 2px;
  background: var(--gold); box-shadow: 0 0 12px var(--gold); transition: width 0.25s, left 0.25s;
}
.nav a:hover::after, .nav a.active::after { width: 100%; left: 0; }
.nav-cta, .burger { display: none; }
.burger { background: none; border: 0; padding: 8px; margin-left: auto; }
@media (max-width: 1099px) {
  .head-cta { display: none; }
  .burger { display: flex; }
  .nav {
    position: absolute; top: calc(var(--head-h) - 6px); left: 12px; right: 12px; flex-direction: column; align-items: stretch;
    gap: 0; padding: 12px 22px 22px; border-radius: 22px; background: var(--glass-strong); border: 1px solid var(--line);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .site-header.open .nav { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--hair); }
  .nav a::after { display: none; }
  .nav a.active { color: var(--accent-ink); }
  .nav-cta { display: inline-flex; margin-top: 18px; }
}

/* ---------- світлі сторінки ---------- */
.page { position: relative; max-width: 1280px; margin: 0 auto; padding: calc(var(--head-h) + 28px) clamp(16px, 4.5vw, 64px) 72px; }
.sun-arc { position: absolute; top: 0; right: 0; width: min(62vw, 820px); pointer-events: none; z-index: 0; }
.page > * { position: relative; z-index: 1; }
.page > .sun-arc { position: absolute; z-index: 0; }
.cards { display: grid; gap: 14px; margin-top: 44px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1020px) { .cards-3, .cards-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cards-3, .cards-4 { grid-template-columns: 1fr; } }
.card {
  padding: 28px; display: flex; gap: 22px; align-items: flex-start; text-align: left; width: 100%;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s; color: inherit;
}
.card h3 { font-size: 1.2rem; font-weight: 600; line-height: 1.2; margin-bottom: 10px; text-wrap: balance; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card-ico {
  flex: none; width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; color: #b98a1c;
  background: radial-gradient(circle at 50% 60%, #fff3d6, #fff 70%); border: 1px solid #fff;
  box-shadow: 0 0 26px rgba(255, 196, 80, 0.5), inset 0 0 14px rgba(255, 208, 120, 0.35);
}
.card-ico .ico { width: 38px; height: 38px; stroke-width: 1.2; }
.card:hover, .card.active, button.card:focus-visible {
  transform: translateY(-6px); background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 26px 60px rgba(108, 118, 160, 0.24), 0 14px 40px -12px rgba(255, 190, 70, 0.55);
}
.card-col { flex-direction: column; gap: 18px; }
.card-more { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; font-size: 0.9rem; color: var(--accent-ink); }
.card-more .ico { width: 1.1em; height: 1.1em; }
.page-cta { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; padding: 26px 32px; }
.page-cta h2 { font-size: clamp(1.25rem, 2.4vw, 1.7rem); }
.page-cta p { color: var(--muted); margin-top: 6px; }

/* лінія етапів на сторінці підтримки */
.track { position: relative; height: 34px; margin: 0 2%; }
.track svg { width: 100%; height: 100%; overflow: visible; display: block; }
.track .rail { stroke: rgba(247, 181, 0, 0.35); stroke-width: 2; fill: none; }
.track .run { stroke: var(--gold); stroke-width: 3; fill: none; stroke-linecap: round; filter: drop-shadow(0 0 6px #ffc24a); stroke-dasharray: 8 100; animation: run 5s linear infinite; }
@keyframes run { to { stroke-dashoffset: -108; } }
.track-dots { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.track-dots i { justify-self: center; align-self: center; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--gold-soft); box-shadow: 0 0 12px rgba(255, 196, 80, 0.7); transition: transform 0.3s, background 0.3s, box-shadow 0.3s; }
.track-dots i.active { transform: scale(1.5); background: var(--gold); box-shadow: 0 0 22px 6px rgba(255, 190, 60, 0.75); }
@media (max-width: 1020px) { .track { display: none; } }

/* ---------- головна: герой ---------- */
.hero-stage { position: relative; height: clamp(520px, 52vw, 720px); margin: 8px calc(-1 * clamp(16px, 4.5vw, 64px)) 0; }
.hero-stage canvas, .stage-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.hero-stage canvas:active, .stage-canvas canvas:active { cursor: grabbing; }
.hero-stage canvas {
  -webkit-mask-image: linear-gradient(transparent, #000 20%, #000 86%, transparent), linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(transparent, #000 20%, #000 86%, transparent), linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.links path { fill: none; stroke: #ffc24a; stroke-width: 1.6; opacity: 0.75; transition: stroke-width 0.25s, opacity 0.25s; filter: drop-shadow(0 0 4px #ffcf70); }
.links circle { fill: #fff; stroke: #ffb52e; stroke-width: 2; transition: r 0.25s; filter: drop-shadow(0 0 6px #ffb52e); }
.links .on path { stroke-width: 3; opacity: 1; }
.links .on circle { r: 9px; }
.hcard {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 16px; padding: 16px 22px; border-radius: 20px;
  max-width: 290px; transition: transform 0.3s, background 0.3s, box-shadow 0.3s; cursor: default;
}
.hcard .ico { width: 40px; height: 40px; color: var(--gold); stroke-width: 1.3; }
.hcard b { display: block; font-size: 1.05rem; font-weight: 600; line-height: 1.2; }
.hcard span { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 4px; line-height: 1.3; }
.hcard:hover, .hcard:focus-visible { transform: translateY(-4px); background: rgba(255, 255, 255, 0.92); box-shadow: 0 20px 50px rgba(108, 118, 160, 0.25), 0 0 34px rgba(255, 196, 80, 0.55); }
.hc1 { left: 4%; top: 15%; } .hc2 { left: 2.5%; top: 37%; } .hc3 { left: 50%; top: 2%; translate: -50% 0; }
.hc4 { right: 4%; top: 15%; } .hc5 { right: 2.5%; top: 37%; }
@media (max-width: 900px) {
  .hero-stage { height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; margin-top: 20px; }
  .hero-stage canvas { position: relative; grid-column: 1 / -1; height: 320px; border-radius: 22px; }
  .hero-stage .links { display: none; }
  .hero-stage canvas { -webkit-mask-image: none; mask-image: none; }
  .hcard { position: static; translate: none; max-width: none; padding: 14px; gap: 12px; }
  .hcard .ico { width: 30px; height: 30px; }
  .hc3 { grid-column: 1 / -1; }
}
@media (max-width: 520px) { .hero-stage { grid-template-columns: 1fr; } }
.section-title { font-size: clamp(1.8rem, 3.6vw, 2.9rem); font-weight: 500; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 30px; }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; } }
.duo-card { position: relative; overflow: hidden; min-height: 250px; padding: 30px; display: flex; flex-direction: column; align-items: flex-start; transition: transform 0.3s, box-shadow 0.3s; }
.duo-card:hover { transform: translateY(-6px); box-shadow: 0 30px 70px rgba(108, 118, 160, 0.28), 0 14px 40px -12px rgba(255, 190, 70, 0.6); }
.duo-card > .ico { width: 34px; height: 34px; stroke-width: 1.3; }
.duo-card h3 { font-size: 1.7rem; font-weight: 600; margin: 14px 0 8px; }
.duo-card p { color: var(--muted); max-width: 15em; }
.duo-go { margin-top: auto; width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(108, 118, 160, 0.25); transition: transform 0.3s, background 0.3s; }
.duo-card:hover .duo-go { background: var(--gold); transform: translateX(6px); }
.duo-art { position: absolute; right: -2%; bottom: 0; width: 58%; max-height: 92%; pointer-events: none; }

/* ---------- темні сторінки зі сценою ---------- */
.stage { position: relative; min-height: max(100svh, 700px); overflow: hidden; background: linear-gradient(#0a1230, #3b3f72 55%, #b98271); }
.stage-canvas { position: absolute; inset: 0; }
.stage-canvas::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(8, 12, 30, 0.42), transparent 34%), linear-gradient(0deg, rgba(8, 12, 30, 0.4), transparent 26%); }
.stage-ui {
  position: relative; z-index: 3; min-height: max(100svh, 700px); pointer-events: none;
  display: grid; grid-template-columns: minmax(0, 440px) 1fr 372px; grid-template-rows: auto 1fr auto; gap: 18px 24px;
  padding: calc(var(--head-h) + 14px) clamp(16px, 4.5vw, 64px) 26px;
}
.stage-ui > * { pointer-events: auto; }
.cfg-intro { grid-column: 1; grid-row: 1; pointer-events: none; }
.cfg-intro h1 { font-weight: 400; font-size: clamp(2rem, 3.4vw, 3rem); }
.cfg-intro .lead { font-size: 1.02rem; max-width: 24em; }
.cfg-steps { grid-column: 1; grid-row: 2; align-self: center; justify-self: start; display: flex; flex-direction: column; gap: 6px; list-style: none; padding: 0; margin: 0; }
.cfg-steps button {
  display: flex; align-items: center; gap: 16px; background: none; border: 0; padding: 5px 18px 5px 0; border-radius: 999px;
  color: rgba(255, 255, 255, 0.72); font-size: 0.95rem; transition: color 0.2s;
}
.cfg-steps .n {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 0.85rem; transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s; background: rgba(10, 16, 34, 0.35);
}
.cfg-steps .n .ico { width: 20px; height: 20px; }
.cfg-steps button:hover { color: #fff; }
.cfg-steps .active button { color: #fff; font-weight: 500; }
.cfg-steps .active .n { border-color: var(--gold-soft); box-shadow: 0 0 18px rgba(255, 176, 60, 0.75), inset 0 0 10px rgba(255, 176, 60, 0.35); transform: scale(1.12); }
.cfg-panel { grid-column: 3; grid-row: 1 / 3; align-self: start; padding: 8px 24px; max-height: calc(100svh - var(--head-h) - 170px); min-height: 300px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.3) transparent; }
.cfg-sec { padding: 18px 0; border-bottom: 1px solid var(--hair); transition: background 0.4s; }
.cfg-sec:last-child { border-bottom: 0; }
.cfg-sec.flash { animation: flash 1s; }
@keyframes flash { 30% { box-shadow: inset 0 0 0 100px rgba(255, 190, 80, 0.09); } }
.cfg-sec h2 { font-size: 1.05rem; font-weight: 400; margin-bottom: 14px; }
.opts { display: grid; gap: 10px; grid-auto-flow: column; grid-auto-columns: 1fr; }
.opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 6px;
  border-radius: 16px; border: 1px solid var(--hair); background: var(--field); font-size: 0.9rem; line-height: 1.15; text-align: center;
  position: relative; transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.opt .ico { width: 30px; height: 30px; stroke-width: 1.2; }
.opt.big { min-height: 86px; }
.opt.row { flex-direction: row; justify-content: flex-start; padding: 10px 14px; text-align: left; gap: 12px; }
.opt.row small { display: block; font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.opt:hover { border-color: rgba(255, 255, 255, 0.5); }
.opt[aria-pressed='true'] { border-color: var(--gold-soft); background: rgba(255, 190, 90, 0.1); box-shadow: 0 0 18px rgba(255, 176, 60, 0.5), inset 0 0 14px rgba(255, 176, 60, 0.14); }
.opt.big[aria-pressed='true']::after {
  content: ''; position: absolute; top: 8px; right: 8px; width: 16px; height: 16px; border-radius: 50%; background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c98a00' stroke-width='3.500' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.500 4 4 8-9'/%3E%3C/svg%3E") center/12px no-repeat;
}
.power-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.power-val { font-size: 2.3rem; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.power-val small { font-size: 1.15rem; margin-left: 6px; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--field); border: 1px solid var(--hair); font-size: 0.85rem; white-space: nowrap; }
.range-ends { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 14px 0 0; background: none; cursor: pointer; --p: 50%; }
input[type='range']::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold-soft) var(--p), rgba(255, 255, 255, 0.25) var(--p)); }
input[type='range']::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); }
input[type='range']::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--gold-soft); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(255, 190, 90, 0.35), 0 0 18px rgba(255, 176, 60, 0.9); }
input[type='range']::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(255, 190, 90, 0.35), 0 0 18px rgba(255, 176, 60, 0.9); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; color: var(--muted); min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field input, .field select {
  height: 44px; border-radius: 12px; border: 1px solid var(--hair); background: var(--field); color: var(--text);
  font: inherit; font-size: 0.95rem; padding: 0 12px; width: 100%; min-width: 0;
}
.field select option { color: #1d2130; }
.field input:focus, .field select:focus { outline: none; border-color: var(--gold-soft); box-shadow: 0 0 14px rgba(255, 176, 60, 0.4); }
.cfg-bar { grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; gap: 8px 0; padding: 18px 26px; flex-wrap: wrap; }
.cfg-bar.flash { animation: flash 1s; }
.metric { flex: 1 1 150px; padding: 4px 22px; border-right: 1px solid var(--hair); min-width: 0; }
.metric:first-child { padding-left: 6px; }
.metric-l { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.metric-l .ico { width: 24px; height: 24px; color: #fff; stroke-width: 1.3; }
.metric-v { font-size: 1.55rem; margin-top: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 34px; }
.metric-v small { font-size: 0.9rem; margin-left: 4px; }
.cfg-bar .btn-glow { margin-left: 26px; flex: none; }
.cfg-note { grid-column: 1 / -1; font-size: 0.72rem; color: rgba(255, 255, 255, 0.55); margin-top: -8px; pointer-events: none; }

/* підписи на сцені */
.tag {
  position: absolute; left: 0; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 16px;
  font-size: 0.8rem; line-height: 1.25; white-space: nowrap; pointer-events: none; will-change: transform; background: rgba(18, 25, 50, 0.62);
  transition: opacity 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.tag .ico { width: 26px; height: 26px; stroke-width: 1.2; }
.tag b { display: block; font-weight: 500; font-size: 0.88rem; }
.tag span { color: var(--muted); }
.tag.off { opacity: 0; }
.tag.dim { opacity: 0.55; }
.tag.hot { border-color: var(--gold-soft); box-shadow: 0 0 24px rgba(255, 176, 60, 0.55); }
.stage .links path { stroke: rgba(255, 255, 255, 0.75); stroke-width: 1; filter: none; }
.stage .links circle { r: 4px; fill: #fff; stroke: #ffc861; filter: drop-shadow(0 0 6px #ffb347); }
.stage .links g.off { opacity: 0; }

/* «Як це працює» */
.how-status { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; color: var(--muted); line-height: 1.4; }
.how-status .ico { color: var(--gold-soft); width: 20px; height: 20px; margin-top: 1px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; background: none; border: 0; padding: 0; text-align: left; }
.switch small { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 2px; }
.switch i { flex: none; width: 46px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); border: 1px solid var(--hair); position: relative; transition: background 0.25s; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.25s; }
.switch[aria-pressed='true'] i { background: #e2574c; }
.switch[aria-pressed='true'] i::after { transform: translateX(20px); }
.how-bar h2 { font-size: clamp(1.2rem, 2.2vw, 1.75rem); font-weight: 500; }
.how-bar p { color: var(--muted); margin-top: 6px; font-size: 0.95rem; }
.how-bar > div { flex: 1 1 320px; padding-left: 10px; }

@media (max-width: 1099px) {
  .stage { display: flex; flex-direction: column; min-height: 0; overflow: visible; background: #0a1022; }
  .stage-ui { display: contents; }
  .stage > .stage-canvas { position: relative; inset: auto; order: 2; height: min(56svh, 520px); min-height: 330px; }
  .stage-canvas::after { background: linear-gradient(0deg, #0a1022, transparent 22%), linear-gradient(180deg, #0a1022, transparent 14%); }
  .cfg-intro { order: 1; padding: calc(var(--head-h) + 8px) 18px 8px; }
  .cfg-steps { display: none; }
  .cfg-panel { order: 3; margin: -22px 14px 0; max-height: none; position: relative; z-index: 3; }
  .cfg-bar { order: 4; margin: 14px; padding: 16px; position: relative; z-index: 3; }
  .cfg-note { order: 5; margin: 0 18px 28px; }
  .metric { flex: 1 1 42%; border-right: 0; padding: 8px 6px; }
  .metric-v { font-size: 1.3rem; }
  .cfg-bar .btn-glow { margin: 10px 0 0; width: 100%; }
  .tag { font-size: 0.72rem; padding: 7px 11px; gap: 8px; }
  .tag .ico { width: 20px; height: 20px; }
  .how-steps-m { display: flex !important; }
}
.how-steps-m { display: none; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.how-steps-m .opt { flex: none; flex-direction: row; padding: 8px 14px; min-height: 42px; }
.how-steps-m .opt .ico { width: 20px; height: 20px; }

/* ---------- модальне вікно ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(8, 12, 28, 0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); overflow-y: auto; animation: fade 0.25s; }
.modal-back[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: min(100%, 500px); padding: 34px; border-radius: 28px; background: var(--glass-strong); border: 1px solid var(--line); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4); animation: pop 0.3s; }
@keyframes pop { from { transform: translateY(14px) scale(0.98); opacity: 0; } }
.modal h2 { font-size: 1.6rem; padding-right: 36px; }
.modal-sub { color: var(--muted); margin-top: 8px; font-size: 0.95rem; }
.modal-x { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hair); background: none; display: grid; place-items: center; }
.modal-x .ico { width: 18px; height: 18px; }
.modal form { display: grid; gap: 14px; margin-top: 20px; }
.modal label { display: grid; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.modal .optional { font-size: 0.75rem; opacity: 0.7; }
.modal input, .modal textarea { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--hair); border-radius: 14px; padding: 12px 14px; width: 100%; resize: vertical; }
.modal input:focus, .modal textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(247, 181, 0, 0.22); }
.form-err { color: #ff8f80; font-size: 0.88rem; }
body[data-theme='light'] .form-err { color: #c23a2b; }
.form-note { font-size: 0.72rem; color: var(--muted); text-align: center; }
.lead-config { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--field); border: 1px solid var(--hair); }
.lead-config-t { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 8px; font-weight: 600; }
.lead-config dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 0.85rem; }
.lead-config dt { color: var(--muted); }
.lead-config dd { margin: 0; text-align: right; font-weight: 500; }
.modal-done { text-align: center; padding: 16px 0 4px; }
.modal-done p { color: var(--muted); margin: 10px 0 24px; }
.done-ico { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; color: #1d2130; background: var(--gold); box-shadow: 0 0 34px rgba(247, 181, 0, 0.6); }
.done-ico .ico { width: 34px; height: 34px; stroke-width: 2.200; }
.banks { display: grid; gap: 10px; margin-top: 20px; }
.bank { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--field); border: 1px solid var(--hair); transition: border-color 0.25s, transform 0.25s; }
.bank:hover { border-color: var(--gold); transform: translateX(4px); }
.bank b { font-weight: 600; }
.bank span { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 2px; }

.site-footer { max-width: 1280px; margin: 0 auto; padding: 22px clamp(16px, 4.5vw, 64px) 34px; display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; font-size: 0.85rem; color: var(--muted); }
.site-footer a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =====================================================================
   Мобільні, планшети, складані пристрої
   ===================================================================== */
.lead-config-note { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hair); font-size: 0.74rem; line-height: 1.4; color: var(--muted); }

/* безпечні зони (чубчик, заокруглення, жестова панель) */
.site-header { padding-left: max(clamp(16px, 4.5vw, 64px), env(safe-area-inset-left)); padding-right: max(clamp(16px, 4.5vw, 64px), env(safe-area-inset-right)); }
.site-footer { padding-bottom: max(34px, env(safe-area-inset-bottom)); }

/* модальне вікно: безпечне центрування, щоб верх не обрізався на низьких екранах */
.modal-back { display: flex; align-items: flex-start; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.modal-back[hidden] { display: none; }
.modal { margin: auto; }

/* дотик: без «залиплого» наведення, більші зони натискання */
@media (hover: none) {
  .card:hover:not(.active), .duo-card:hover, .hcard:hover { transform: none; }
  .btn:hover .ico { transform: none; }
}
@media (pointer: coarse) {
  input[type='range'] { height: 34px; }
  input[type='range']::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -12px; }
  input[type='range']::-moz-range-thumb { width: 28px; height: 28px; }
  .opt { min-height: 54px; }
  .nav a { padding-block: 16px; }
  .field input, .field select, .modal input, .modal textarea { font-size: 16px; } /* iOS не масштабує сторінку при фокусі */
}

/* ---------- планшети та телефони: сцена прилипає зверху, параметри гортаються під нею ---------- */
@media (max-width: 1099px) {
  .stage > .stage-canvas { position: sticky; top: 0; z-index: 5; height: 44svh; min-height: 250px; max-height: 480px; box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.7); }
  .stage-canvas::after { background: linear-gradient(0deg, #0a1022, transparent 18%); }
  .cfg-intro { padding: calc(var(--head-h) + 4px) max(18px, env(safe-area-inset-left)) 14px; }
  .cfg-intro h1 { font-size: clamp(1.55rem, 6.4vw, 2.4rem); }
  .cfg-intro .lead { font-size: 0.95rem; margin-top: 10px; }
  .cfg-panel { margin: 14px 14px 0; padding: 4px 18px; z-index: 3; }
  .cfg-bar { margin: 14px; z-index: 3; }
  .cfg-note { margin: 0 18px max(28px, env(safe-area-inset-bottom)); }
  .cfg-panel, .cfg-bar, .cfg-note { width: auto; }
  .tag b { font-size: 0.78rem; }
  .how-bar > div { padding-left: 0; flex-basis: 100%; }
  .how-bar .btn-glow { margin-left: 0; }
  .page { padding-top: calc(var(--head-h) + 12px); padding-bottom: 48px; }
  .page-cta { padding: 22px; }
  .page-cta .btn { flex: 1 1 auto; }
}
/* планшети й розкладені «фолди»: вміст по центру, показники в один ряд */
@media (min-width: 700px) and (max-width: 1099px) {
  .stage > .stage-canvas { height: 50svh; max-height: 560px; }
  .cfg-intro, .cfg-panel, .cfg-bar, .cfg-note { width: min(100% - 40px, 780px); margin-left: auto; margin-right: auto; }
  .cfg-intro { padding-left: 0; padding-right: 0; }
  .cfg-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; padding: 6px 24px; }
  .cfg-sec:nth-last-child(2) { border-bottom: 0; }
  .metric { flex: 1 1 22%; }
  .cfg-bar .btn-glow { width: auto; margin: 12px auto 0; }
  .hero-stage canvas { height: 420px; }
}
/* телефон у горизонталі: сцена не прилипає, інакше не лишається місця для параметрів */
@media (max-width: 1099px) and (max-height: 540px) {
  .stage > .stage-canvas { position: relative; height: 82svh; max-height: none; }
  .modal { padding: 22px; }
}
/* телефони */
@media (max-width: 560px) {
  :root { --head-h: 64px; --radius: 22px; }
  .logo-svg { height: 38px; }
  .eyebrow { letter-spacing: 0.22em; font-size: 0.66rem; gap: 12px; margin-bottom: 12px; }
  .eyebrow::after { width: 30px; }
  h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .lead { font-size: 1rem; margin-top: 12px; }
  .cards { margin-top: 26px; gap: 12px; }
  .card { padding: 20px; gap: 16px; }
  .card-ico { width: 60px; height: 60px; border-radius: 18px; }
  .card-ico .ico { width: 30px; height: 30px; }
  .card-col { flex-direction: row; }
  .duo-card { min-height: 210px; padding: 22px; }
  .duo-card h3 { font-size: 1.4rem; }
  .section-title { font-size: 1.7rem; }
  .hero-stage canvas { height: 280px; }
  .modal { padding: 24px 18px; border-radius: 22px; }
  .modal h2 { font-size: 1.3rem; }
  .lead-config dl { font-size: 0.8rem; gap: 3px 10px; }
  .btn-glow { height: 54px; padding: 0 22px; font-size: 0.98rem; }
  .cfg-bar { padding: 14px; }
  .metric-l { font-size: 0.76rem; gap: 6px; white-space: normal; }
  .metric-l .ico { width: 20px; height: 20px; }
  .metric-v { padding-left: 26px; font-size: 1.2rem; }
  .power-val { font-size: 2rem; }
  .site-footer { flex-direction: column; }
}
/* вузькі екрани: Galaxy Fold у складеному стані, малі телефони */
@media (max-width: 380px) {
  .site-header { gap: 10px; }
  .logo-svg { height: 32px; }
  .cfg-panel { margin-inline: 8px; padding-inline: 12px; }
  .cfg-bar { margin-inline: 8px; }
  .opts { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .opts .opt.big:only-child, .opts .opt.big:nth-child(3):last-child { grid-column: 1 / -1; }
  .fields { grid-template-columns: 1fr; }
  .metric { flex: 1 1 100%; }
  .metric-v { font-size: 1.15rem; }
  .power-row { flex-wrap: wrap; }
  .hcard { padding: 12px; }
  .tag span { display: none; }
  .tag { padding: 6px 9px; }
  .page, .page-cta { padding-inline: 12px; }
  .card { flex-direction: column; }
  .card-col { flex-direction: column; }
  .btn { padding: 0 16px; white-space: normal; text-align: center; height: auto; min-height: 46px; }
  .lead-config dl { grid-template-columns: 1fr; }
  .lead-config dd { text-align: left; margin-bottom: 4px; }
}
/* двоекранні пристрої (Surface Duo та ін.): не кладемо вміст на шарнір */
@media (horizontal-viewport-segments: 2) {
  .page, .cfg-intro, .cfg-panel, .cfg-bar, .cfg-note { max-width: env(viewport-segment-width 0 0); margin-left: 0; }
  .modal { max-width: calc(env(viewport-segment-width 0 0) - 24px); margin-left: 12px; }
}
