/* «Полярная ночь»: тёмно-синий фон, северное сияние бирюзой и сиреневым. */
:root {
  --bg: #07111F;
  --panel: #0B1A2E;
  --surface: #0F1E33;
  --border: #1C2E47;
  --outline: #2A3F5C;
  --horizon: #16304F;
  --text: #EAF2FB;
  --muted: #A3B6CB;
  --teal: #3FE0C5;
  --teal-ink: #06201C;
  --teal-soft: #2B4A49;
  --violet: #9C8CFF;
  --lilac: #C9B8FF;
  --warn: #F2B35A;
  --danger: #FF8A8A;
  --radius: 16px;
  --head: "Unbounded", "Golos Text", system-ui, sans-serif;
  --body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--body); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
a { color: var(--teal); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--head); margin: 0; }
h1 { font-size: 25px; line-height: 1.22; font-weight: 700; }
h2 { font-size: 16px; font-weight: 500; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.lilac { color: var(--lilac); }
.teal { color: var(--teal); }

#app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.screen { display: flex; flex-direction: column; flex: 1; animation: in .18s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pad { padding: 0 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 8px; }
.stack.loose { gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section { padding: 0 20px 26px; display: flex; flex-direction: column; gap: 12px; }

/* --- шапки --- */
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 8px; }
.brand .name { font-family: var(--head); font-weight: 500; font-size: 14px; letter-spacing: .02em; flex: 1; }
.top { display: flex; align-items: center; gap: 6px; padding: 12px 12px 4px; position: sticky; top: 0; background: linear-gradient(var(--bg) 70%, rgba(7, 17, 31, 0)); z-index: 5; }
.top h1 { font-size: 20px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 0; background: transparent; color: var(--text); text-decoration: none; position: relative; }
.icon-btn:active { background: var(--surface); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--violet); border: 2px solid var(--bg); }

/* --- кнопки --- */
.btn { display: flex; width: 100%; min-height: 52px; padding: 0 18px; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; border: 1px solid transparent; font-weight: 600; font-size: 16px; text-decoration: none; text-align: center; transition: transform .08s, opacity .15s; }
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--teal); color: var(--teal-ink); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--outline); min-height: 48px; font-size: 15px; }
.btn.quiet { background: transparent; color: var(--muted); min-height: 44px; font-size: 14px; font-weight: 500; }
.btn.danger { background: transparent; color: var(--danger); border-color: #4A2A34; min-height: 46px; font-size: 15px; }
.btn.small { min-height: 40px; font-size: 14px; border-radius: 12px; width: auto; }
.link-btn { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600; font-size: 14px; text-decoration: none; }

/* --- карточки --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; }
a.card:active, button.card:active { border-color: var(--outline); }
button.card { text-align: left; width: 100%; }
.card.attn { border-color: #3B3570; box-shadow: inset 3px 0 0 var(--violet); }
.card .title { font-size: 16px; font-weight: 600; }
.price { font-family: var(--head); font-size: 17px; font-weight: 700; color: var(--teal); white-space: nowrap; }
.price.big { font-size: 28px; }
.strike { text-decoration: line-through; color: var(--muted); font-size: 14px; }
.term { font-size: 12px; font-weight: 500; color: var(--lilac); display: flex; gap: 6px; align-items: center; }
.banner { background: var(--surface); border: 1px solid var(--teal-soft); color: var(--teal); border-radius: 12px; padding: 11px 14px; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.banner.violet { border-color: #3B3570; color: var(--lilac); }
.banner.warn { border-color: #4D3B1E; color: var(--warn); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); }

.hero { height: 136px; border-radius: 20px; background: var(--panel); border: 1px solid var(--border); position: relative; overflow: hidden; }
.hero svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.examples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.example { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px; text-decoration: none; color: var(--text); position: relative; }
.example .pic { height: 60px; border-radius: 10px; background: var(--panel); display: flex; align-items: center; justify-content: center; }
.example .t { font-size: 13px; font-weight: 600; line-height: 1.25; }
.example .k { font-size: 11px; color: var(--muted); }
.example.soon { opacity: .72; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #1A2340; color: var(--lilac); white-space: nowrap; }
.badge.teal { background: #0E2E2C; color: var(--teal); }
.badge.muted { background: #142238; color: var(--muted); }
.badge.danger { background: #2E1820; color: var(--danger); }
.example .badge { position: absolute; top: 8px; right: 8px; }

.steps-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.steps-list li { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.num { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--teal); color: var(--teal); font-family: var(--head); font-weight: 500; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.num.fill { background: var(--teal); color: var(--teal-ink); }
.steps-list .t { font-size: 15px; font-weight: 600; }
.steps-list .d { font-size: 13px; color: var(--muted); }

.checklist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.checklist svg { flex: none; margin-top: 2px; }

/* --- нижняя панель с главной кнопкой --- */
.dock { position: sticky; bottom: 0; margin-top: auto; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(7, 17, 31, 0), var(--bg) 26%); display: flex; flex-direction: column; gap: 8px; z-index: 5; }

/* --- формы --- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .label { font-size: 14px; font-weight: 600; }
.req { color: var(--teal); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 13px; color: var(--danger); display: none; }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid textarea { border-color: #6B3440; }
input[type="text"], input[type="tel"], textarea, select { width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 16px; color: var(--text); outline: none; transition: border-color .15s; }
textarea { min-height: 92px; resize: vertical; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #5F7690; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--outline); background: transparent; color: var(--text); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: #0E2E2C; border-color: var(--teal); color: var(--teal); }
.choice { display: flex; flex-direction: column; gap: 8px; }
.choice button { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; font-weight: 600; font-size: 15px; }
.choice button[aria-pressed="true"] { border-color: var(--teal); background: #0C2430; }
.choice .price { font-size: 14px; }

.progress { display: flex; gap: 6px; }
.progress span { flex: 1; height: 4px; border-radius: 4px; background: var(--border); }
.progress span.on { background: var(--teal); }

.files { display: flex; flex-direction: column; gap: 6px; }
.file { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 8px 8px 8px 12px; font-size: 14px; }
.file .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .s { color: var(--muted); font-size: 12px; flex: none; }
.file .n > div { white-space: normal; }
.file .bar { height: 3px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.file .bar i { display: block; height: 100%; background: var(--teal); width: 0; transition: width .2s; }
.file.bad { border-color: #6B3440; }
.drop { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border: 1.5px dashed var(--outline); border-radius: 14px; color: var(--teal); font-weight: 600; font-size: 15px; background: transparent; width: 100%; }

/* --- заказ --- */
.stepper { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.stepper .s { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); text-align: center; }
.stepper .s i { width: 100%; height: 4px; border-radius: 4px; background: var(--border); }
.stepper .s.done i { background: var(--teal); }
.stepper .s.now i { background: linear-gradient(90deg, var(--teal), var(--violet)); }
.stepper .s.now { color: var(--text); font-weight: 600; }
.stage { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.stage.attn { border-color: #3B3570; }
.stage h3 { font-size: 17px; font-weight: 700; line-height: 1.3; }
.quote { border-left: 3px solid var(--violet); padding: 2px 0 2px 12px; color: var(--text); font-size: 14px; white-space: pre-wrap; }
.linkbox { display: flex; gap: 8px; }
.linkbox .btn { flex: 1; }
.timeline { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding-bottom: 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--outline); background: var(--bg); margin-top: 3px; }
.timeline li.studio .dot { border-color: var(--teal); }
.timeline li.system .dot { border-color: var(--violet); }
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .what { font-size: 14px; }
.timeline .note { font-size: 13px; color: var(--muted); white-space: pre-wrap; margin-top: 2px; }
details.card summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.card summary::-webkit-details-marker { display: none; }
details.card[open] summary svg { transform: rotate(180deg); }
.kv { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-size: 14px; white-space: pre-wrap; word-break: break-word; }

/* --- сообщения --- */
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 40px 28px; }
.center h1 { font-size: 22px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: #1A2A42; color: var(--text); border: 1px solid var(--outline); border-radius: 12px; padding: 11px 16px; font-size: 14px; max-width: calc(100% - 32px); width: max-content; opacity: 0; transition: opacity .2s, transform .2s; z-index: 50; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { border-color: #6B3440; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--teal); animation: spin .8s linear infinite; }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.sheet-back { position: fixed; inset: 0; background: rgba(3, 8, 16, .66); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.dev { margin: 0 20px 8px; }
@media (prefers-reduced-motion: reduce) { .screen, .sheet { animation: none; } .btn { transition: none; } }

/* --- калькулятор --- */
.calc { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: center; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; color: var(--text); text-align: left; font: inherit; transition: border-color .15s, background .15s; }
.opt[aria-pressed="true"] { border-color: var(--teal); background: #0C2430; }
.opt .box { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 1.5px solid var(--outline); display: flex; align-items: center; justify-content: center; }
.opt .box svg { opacity: 0; }
.opt[aria-pressed="true"] .box { background: var(--teal); border-color: var(--teal); }
.opt[aria-pressed="true"] .box svg { opacity: 1; }
.opt .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opt .t { font-weight: 600; font-size: 15px; }
.opt .h { font-size: 12.5px; color: var(--muted); }
.opt .d { font-size: 12px; color: var(--lilac); font-weight: 500; }
.opt .p { font-family: var(--head); font-weight: 700; font-size: 14px; color: var(--teal); white-space: nowrap; }
.qty-ctl { display: flex; align-items: center; gap: 4px; flex: none; }
.qbtn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--outline); background: transparent; color: var(--text); font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.qbtn:active { background: var(--panel); }
input.qty { width: 46px; padding: 7px 4px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 10px; }
.calc-total { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.calc-total .line, .calc-lines .line { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--muted); }
.calc-total .line span:last-child, .calc-lines .line span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.calc-total .sum { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; margin: 4px 0 2px; padding-top: 8px; border-top: 1px solid var(--border); }
.calc-total .sum .price { font-size: 22px; }
.calc-lines { display: flex; flex-direction: column; gap: 2px; margin: 2px 0; }

/* --- демо-версия --- */
.demo-card { border: 1px dashed #3B3570; border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: rgba(156, 140, 255, 0.05); }
.demo-card .eyebrow { color: var(--lilac); }
