/* Під стиль інсти міняти тільки цей блок */
:root {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #e9e6df;
  --ink: #121212;
  --ink-2: #6b6862;
  --line: #dcd7cd;
  --accent: #ff4f1a;
  --accent-ink: #ffffff;
  --ok: #1d8a4c;
  --err: #d6342a;
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: 'Unbounded', 'Manrope', sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 500 15px/1.45 var(--font-body); min-height: 100vh; overscroll-behavior: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-top) + 8px) 16px calc(110px + var(--safe-bottom)); }

/* splash */
.splash {
  position: fixed; inset: 0; z-index: 100; background: var(--ink); color: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: opacity .45s ease, visibility .45s;
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash-mark { font: 800 40px/0.95 var(--font-display); text-align: center; letter-spacing: -.02em; animation: rise .6s ease both; }
.splash-sub { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; opacity: .6; animation: rise .6s .1s ease both; }
.splash-forge { position: absolute; bottom: calc(28px + var(--safe-bottom)); display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: .55; letter-spacing: .04em; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 6px 0 10px; margin: 0 -16px 6px; padding-inline: 16px; }
.top-row { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; height: 40px; }
.brand { grid-column: 2; text-align: center; font: 800 15px/1 var(--font-display); letter-spacing: .02em; }
.step-count { grid-column: 3; justify-self: end; font-size: 12px; color: var(--ink-2); font-weight: 700; }
.icon-btn { grid-column: 1; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.progress { display: grid; grid-auto-flow: column; gap: 5px; margin-top: 8px; }
.progress span { height: 4px; border-radius: 4px; background: var(--line); transition: background .3s; }
.progress span.done { background: var(--ink); }
.progress span.now { background: var(--accent); }

/* typography */
h1 { font: 800 26px/1.08 var(--font-display); letter-spacing: -.02em; margin: 10px 0 6px; }
h2 { font: 700 15px/1.2 var(--font-display); margin: 22px 0 10px; letter-spacing: -.01em; }
.lead { color: var(--ink-2); margin: 0 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

.screen.enter > * { animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* product cards */
.products { display: grid; gap: 10px; }
.product {
  display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; text-align: left;
  border: 2px solid transparent; background: var(--surface); border-radius: var(--radius); padding: 10px 14px 10px 8px;
  transition: transform .15s, border-color .15s;
}
.product:active { transform: scale(.98); }
.product.sel { border-color: var(--ink); }
.product-img { background: var(--surface-2); border-radius: 14px; aspect-ratio: 1; display: grid; place-items: center; padding: 6px; }
.product-img svg { width: 100%; height: 100%; }
.product-name { font: 700 18px/1.1 var(--font-display); }
.product-desc { color: var(--ink-2); font-size: 13px; margin: 4px 0 8px; }
.product-price { font-weight: 800; }
.product-price b { color: var(--accent); }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.how div { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 10px; font-size: 12px; line-height: 1.3; color: var(--ink-2); }
.how b { display: block; font: 800 20px/1 var(--font-display); color: var(--ink); margin-bottom: 6px; }

/* mockup */
.mock { position: relative; background: var(--surface); border-radius: var(--radius); padding: 10px 10px 8px; }
.mock-stage { display: grid; place-items: center; height: min(52vw, 260px); }
.mock-stage svg { height: 100%; width: auto; max-width: 100%; }
.mock.sticky { position: sticky; top: calc(var(--safe-top) + 68px); z-index: 5; box-shadow: 0 8px 18px -12px rgba(0,0,0,.35); }
.mock.sticky .mock-stage { height: min(40vw, 190px); }
.mock-meta { position: absolute; left: 14px; top: 12px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.views { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px;
  font-weight: 700; font-size: 13px; transition: all .15s; white-space: nowrap;
}
.chip.sel { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:disabled { opacity: .4; }
.zone-active { animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -22; } }

/* swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatch.sel::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2.5px solid var(--ink); }
.swatch-name { margin-top: 8px; font-size: 13px; color: var(--ink-2); }

/* sizes */
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.size { background: var(--surface); border-radius: var(--radius-sm); padding: 8px; display: grid; gap: 6px; border: 2px solid transparent; transition: border-color .15s; }
.size.has { border-color: var(--ink); }
.size-head { display: flex; justify-content: space-between; align-items: baseline; }
.size-name { font: 700 15px/1 var(--font-display); }
.size-extra { font-size: 11px; color: var(--ink-2); font-weight: 700; }
.stepper { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; }
.stepper button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-2); font-weight: 800; font-size: 17px; line-height: 1; }
.stepper input { width: 100%; text-align: center; border: 0; background: none; font-weight: 800; font-size: 16px; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.size.wide { grid-column: 1 / -1; grid-template-columns: 1fr 140px; align-items: center; }

.tiers { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.tier { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tier.on { background: var(--accent); color: var(--accent-ink); }

/* placements */
.places { display: grid; gap: 10px; }
.place { background: var(--surface); border-radius: var(--radius); border: 2px solid transparent; transition: border-color .15s; overflow: hidden; }
.place.on { border-color: var(--ink); }
.place-head { width: 100%; display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 14px; border: 0; background: none; text-align: left; }
.check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; transition: all .15s; }
.place.on .check { background: var(--ink); border-color: var(--ink); }
.check svg { opacity: 0; }
.place.on .check svg { opacity: 1; }
.place-name { font-weight: 800; }
.place-sub { font-size: 12px; color: var(--ink-2); }
.place-price { font-weight: 800; white-space: nowrap; }
.place-body { padding: 0 14px 14px; display: grid; gap: 12px; }
.field-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-bottom: 6px; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 8px 6px; font-weight: 700; font-size: 13px; }
.seg button.sel { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip small { font-weight: 600; opacity: .7; margin-left: 4px; }
.method-note { font-size: 12px; color: var(--ink-2); margin-top: 6px; }

.upload { display: flex; align-items: center; gap: 12px; border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 12px; position: relative; }
.upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; overflow: hidden; font-size: 11px; font-weight: 800; }
.upload-icon img { width: 100%; height: 100%; object-fit: contain; }
.upload-text { font-size: 13px; line-height: 1.3; min-width: 0; }
.upload-text b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload.has { border-style: solid; border-color: var(--ink); }
.upload-remove { margin-left: auto; position: relative; z-index: 2; border: 0; background: var(--surface-2); border-radius: 50%; width: 32px; height: 32px; flex: none; font-weight: 800; }

/* forms */
.input, .textarea {
  width: 100%; border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  padding: 12px 14px; outline: none; transition: border-color .15s; font-weight: 600;
}
.input:focus, .textarea:focus { border-color: var(--ink); }
.input.bad { border-color: var(--err); }
.textarea { resize: vertical; min-height: 84px; }
.form { display: grid; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.with-btn { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.btn-ghost { border: 2px solid var(--ink); background: none; border-radius: var(--radius-sm); padding: 0 12px; font-weight: 800; font-size: 13px; }
.hint { font-size: 12px; color: var(--ink-2); margin-top: 6px; }

/* review */
.review-mocks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.review-mocks .mock-stage { height: 170px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-top: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-head h3 { font: 700 14px/1 var(--font-display); margin: 0; }
.link { border: 0; background: none; color: var(--accent); font-weight: 800; font-size: 13px; padding: 4px; }
.lines { display: grid; gap: 6px; }
.line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.line span:first-child { color: var(--ink-2); }
.line span:last-child { font-weight: 700; text-align: right; }
.line.total { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; font-size: 18px; }
.line.total span { color: var(--ink) !important; font: 800 18px/1.1 var(--font-display); }
.line.minus span:last-child { color: var(--ok); }
.errors { background: #fdecea; color: var(--err); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; font-weight: 700; margin-top: 10px; }

/* success */
.success { text-align: center; padding-top: 30px; }
.success-mark { width: 84px; height: 84px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; margin: 0 auto 18px; animation: pop .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.order-id { display: inline-block; font: 800 20px/1 var(--font-display); background: var(--surface); padding: 12px 18px; border-radius: 14px; margin: 8px 0 14px; letter-spacing: .02em; }
.tg-chat { text-align: left; background: #c9d8c4 linear-gradient(160deg, #d6e2cf, #b9cdb8); border-radius: var(--radius); padding: 0 10px 12px; margin-top: 10px; overflow: hidden; font: 400 14px/1.4 -apple-system, 'Segoe UI', Roboto, sans-serif; }
.tg-head { display: flex; gap: 10px; align-items: center; background: #fff; margin: 0 -10px 12px; padding: 10px 14px; font-size: 14px; line-height: 1.2; }
.tg-head small { color: #8a8f94; }
.tg-ava { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font: 800 13px/1 var(--font-display); flex: none; }
.tg-bubble { position: relative; background: #fff; border-radius: 14px 14px 14px 4px; padding: 8px 12px 20px; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,.12); word-break: break-word; }
.tg-bubble + .tg-bubble { margin-top: 6px; }
.tg-bubble code { font-family: ui-monospace, Consolas, monospace; background: #eef1f3; border-radius: 4px; padding: 0 3px; }
.tg-bubble a { color: #2a7ab0; text-decoration: none; }
.tg-time { position: absolute; right: 10px; bottom: 4px; font-size: 11px; color: #9aa0a6; }
.tg-files { display: grid; gap: 8px; }
.tg-doc { display: flex; gap: 10px; align-items: center; font-size: 13px; line-height: 1.3; }
.tg-doc b { font-weight: 600; }
.tg-doc-icon { width: 42px; height: 42px; border-radius: 50%; background: #3f9be0; color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; }
.demo-note { background: #fff4d6; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin: 14px 0; text-align: left; }

/* forge logic */
.forge { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 28px auto 0; border: 0; background: none; color: var(--ink-2); font-size: 12px; font-weight: 600; padding: 8px; }
.forge img { width: 20px; height: 20px; }
.forge b { color: var(--ink); font-weight: 800; }

/* bottom bar */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.bar > * { max-width: 560px; }
.bar-total { font: 800 21px/1 var(--font-display); letter-spacing: -.01em; transition: color .2s; }
.bar-total.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.06); color: var(--accent); } }
.bar-note { font-size: 12px; color: var(--ink-2); margin-top: 4px; font-weight: 600; }
.btn { border: 0; border-radius: 14px; padding: 15px 22px; font-weight: 800; font-size: 15px; transition: transform .12s, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn-main { background: var(--ink); color: var(--bg); min-width: 150px; }
.btn-main.accent { background: var(--accent); color: var(--accent-ink); }
.btn-main:disabled { opacity: .35; }
.btn-main.loading { pointer-events: none; opacity: .7; }
.btn-wide { width: 100%; }
.btn-light { background: var(--surface); color: var(--ink); }

/* sheet + toast */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; animation: fadeIn .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 20px 20px calc(24px + var(--safe-bottom)); max-width: 560px; margin: 0 auto; animation: up .28s ease;
}
.sheet-logo { width: 64px; height: 64px; margin: 4px auto 10px; display: block; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translate(-50%, 20px); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: all .25s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--err); }

@media (min-width: 600px) {
  .bar { padding-inline: calc((100vw - 560px) / 2 + 16px); }
}
