/* AI-візуалізатор гірлянд */
:root {
  --bg: #0b1020;
  --panel: #131a30;
  --line: #26304f;
  --text: #eef1fa;
  --muted: #a9b2cc;
  --gold: #f2c14e;
  --gold-d: #c9982b;
  --green-1: #88de00;
  --green-2: #498d00;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2, p, ol, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
a { color: inherit; }
button, input { font: inherit; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.top { border-bottom: 1px solid var(--line); background: #0d1326; }
.top__in { width: min(1240px, 100% - 32px); margin-inline: auto; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.top__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px 3px rgba(242, 193, 78, .6); }
.top__phone { color: var(--gold); font-weight: 700; text-decoration: none; white-space: nowrap; }

.app { width: min(1240px, 100% - 32px); margin-inline: auto; padding: 28px 0 48px; }
.intro h1 { font-size: clamp(24px, 3.4vw, 36px); line-height: 1.2; }
.intro p { margin-top: 10px; max-width: 820px; color: var(--muted); }

.work { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.stage-wrap { min-width: 0; }

/* зона завантаження */
.drop { border: 2px dashed #3a4672; border-radius: 16px; background: var(--panel); padding: 34px 20px; text-align: center; }
.drop.is-over { border-color: var(--gold); background: #182243; }
.drop__title { font-size: 20px; font-weight: 700; }
.drop__or { margin: 8px 0; color: var(--muted); }
.drop__hint { margin: 16px auto 0; max-width: 520px; font-size: 14px; color: var(--muted); }
.samples { margin-top: 22px; font-size: 14px; color: var(--muted); }
.samples__row { margin-top: 10px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.sample { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: none; cursor: pointer; }
.sample img { display: block; width: 150px; height: 96px; object-fit: cover; }
.sample:hover { border-color: var(--gold); }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 22px; border: 1px solid transparent; border-radius: 40px; font-weight: 700; text-decoration: none; text-align: center; cursor: pointer; color: var(--text); background: #26304f; }
.btn:hover { filter: brightness(1.12); }
.btn--gold { background: linear-gradient(180deg, var(--gold), var(--gold-d)); color: #1b1503; }
.btn--green { background: linear-gradient(180deg, var(--green-1), var(--green-2)); color: #fff; border-bottom: 3px solid #3f7404; }
.btn--ghost { background: transparent; border-color: #3a4672; }
.btn--sm { min-height: 38px; padding: 6px 14px; font-size: 14px; font-weight: 600; }
.btn[aria-pressed="true"] { background: var(--gold); color: #1b1503; }

/* полотно */
.stage { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #000; touch-action: pan-y; user-select: none; }
.stage__cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage__svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.stage__svg.is-tool { cursor: crosshair; }
.ov-line { fill: none; stroke: #ffe14d; stroke-width: 2.2; stroke-linejoin: round; pointer-events: none; }
.ov-line--new { stroke: #6cf0ff; stroke-dasharray: 6 5; }
.ov-hit { fill: none; stroke: transparent; cursor: copy; pointer-events: stroke; }
.ov-pt { fill: #fff; stroke: #10131f; stroke-width: 1.6; cursor: grab; }
.ov-pt--new { fill: #6cf0ff; pointer-events: none; }
.ov-del { cursor: pointer; }
.ov-del circle { fill: #d93025; stroke: #fff; stroke-width: 1.2; }
.ov-del text { fill: #fff; text-anchor: middle; dominant-baseline: central; font-weight: 700; pointer-events: none; }

.split { position: absolute; inset: 0; }
.split__line { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 8px rgba(0, 0, 0, .6); pointer-events: none; }
.split__knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #10131f; font-weight: 700; display: flex; align-items: center; justify-content: center; letter-spacing: 2px; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.split__label { position: absolute; top: 12px; padding: 3px 10px; border-radius: 20px; background: rgba(0, 0, 0, .55); font-size: 13px; font-weight: 700; pointer-events: none; }
.split__label--l { left: 12px; }
.split__label--r { right: 12px; }
.split__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }

.busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 11, 22, .72); }
.busy__box { width: min(340px, 86%); padding: 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.busy__spin { width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 50%; border: 4px solid #3a4672; border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { margin-top: 12px; height: 8px; border-radius: 8px; background: #26304f; overflow: hidden; }
.bar__fill { height: 100%; width: 5%; background: var(--gold); transition: width .25s; }
.status { min-height: 24px; margin-top: 12px; color: var(--muted); font-size: 15px; }
.status.is-error { color: #ff9c8f; }

/* панель керування */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 18px; }
.group legend, .row { font-weight: 700; font-size: 14px; }
.row { display: flex; justify-content: space-between; margin-top: 12px; }
.row:first-child { margin-top: 0; }
.group input[type="range"] { width: 100%; accent-color: var(--gold); }
.chips { margin-top: 10px; display: grid; gap: 8px; }
.chip { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid #3a4672; border-radius: 10px; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--gold); background: #1b2444; }
.chip input { accent-color: var(--gold); }
.chip__dot { width: 16px; height: 16px; border-radius: 50%; }
.chip__dot--warm { background: #ffe9c0; box-shadow: 0 0 8px 2px #ffbe60; }
.chip__dot--cold { background: #f0f8ff; box-shadow: 0 0 8px 2px #96c8ff; }
.chip__dot--gold { background: #ffe296; box-shadow: 0 0 8px 2px #ff9628; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.tools { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.tools__hint { font-size: 13px; color: var(--muted); }
.tools__row { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.group--actions { display: grid; gap: 10px; }
.cta { padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.cta p { margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.cta .btn { width: 100%; }

.how { margin-top: 44px; padding: 24px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.how h2 { font-size: 22px; }
.how ol { margin-top: 12px; padding-left: 22px; display: grid; gap: 8px; color: var(--muted); }
.how b { color: var(--text); }
.how__note { margin-top: 14px; font-size: 14px; color: var(--muted); }
.foot { border-top: 1px solid var(--line); padding: 20px 16px 28px; text-align: center; color: var(--muted); font-size: 14px; }

/* версія для iframe на лендінгу (/embed): без відступів і власного фону */
body.embed { background: transparent; }
.embed .app { width: 100%; padding: 0; }
.embed .work { margin-top: 0; }
.embed .work:has(.drop:not([hidden])) { grid-template-columns: 1fr; } /* до завантаження фото — зона на всю ширину */
.embed__note { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.cta__tel { display: block; margin-top: 10px; font-size: 14px; color: var(--gold); text-decoration: none; }

@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; }
  .chips { grid-template-columns: 1fr 1fr 1fr; }
  .chip { flex-direction: column; text-align: center; font-size: 13px; padding: 9px 6px; gap: 6px; }
  .chip input { display: none; }
}
@media (max-width: 520px) {
  .app { padding-top: 18px; }
  .drop { padding: 24px 12px; }
  .sample img { width: 96px; height: 66px; }
  .top__brand { font-size: 15px; }
  .top__phone { font-size: 14px; }
  .split__knob { width: 38px; height: 38px; }
}
