:root {
  --bg: #f4f6fb; --card: #fff; --ink: #0f172a; --muted: #5b6477; --line: #e3e7ef; --soft: #eef2ff;
  --accent: #2b59ff; --accent-ink: #fff; --accent-soft: #e8eeff; --pos: #0f9d58; --neg: #e23d4b; --warn: #b45309;
  --warn-bg: #fff7e6; --radius: 16px; --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --c1: #94a3b8; --c2: #2b59ff; --c3: #7c3aed; --c4: #f59e0b; --c5: #ec4899; --c6: #64748b; --c7: #0f9d58;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --card: #121a2e; --ink: #e7ecf7; --muted: #9aa4ba; --line: #24304a; --soft: #182241;
    --accent: #5b7fff; --accent-soft: #1b2650; --warn-bg: #2a2010; --warn: #f2b45a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
h1, h2 { line-height: 1.2; letter-spacing: -.01em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; white-space: nowrap; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); background: var(--card); }
.nav .nav-bot { color: var(--accent-ink); background: var(--accent); }
.nav .nav-bot:hover { color: var(--accent-ink); background: var(--accent); filter: brightness(1.08); }

.hero { padding-top: 40px; padding-bottom: 8px; }
.hero h1 { font-size: clamp(28px, 4.2vw, 44px); margin: 0 0 12px; max-width: 900px; }
.lead { font-size: clamp(16px, 1.8vw, 19px); color: var(--muted); max-width: 820px; margin: 0 0 20px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 0 0 16px; }
fieldset.card { min-width: 0; }
legend { font-weight: 700; font-size: 17px; padding: 0; float: left; width: 100%; margin-bottom: 14px; }
legend + * { clear: both; }

.calc { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; padding-top: 12px; }
.result { position: sticky; top: 76px; }
@media (max-width: 960px) {
  .calc { grid-template-columns: 1fr; }
  .result { position: static; }
}

.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 16px; box-shadow: var(--shadow); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; text-align: center; padding: 10px 6px; border-radius: 10px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.row2, .row3 { display: grid; gap: 12px; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) { .row3 { grid-template-columns: 1fr 1fr; } .row2.keep { grid-template-columns: 1fr 1fr; } }
@media (max-width: 400px) { .row2 { grid-template-columns: 1fr; } }
.f { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.f > span { font-size: 14px; color: var(--muted); font-weight: 500; }
.f small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.f.narrow { max-width: 220px; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input, select { height: 44px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[inputmode="decimal"] { font-variant-numeric: tabular-nums; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; margin: 4px 0 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.mode { display: flex; gap: 18px; margin: 4px 0 12px; font-size: 14.5px; flex-wrap: wrap; }
.mode label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.mode input { width: auto; height: auto; accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -2px 0 10px; font-size: 13px; color: var(--muted); }
.chips button { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-variant-numeric: tabular-nums; }
.chips button:hover { border-color: var(--accent); }

.search { position: relative; margin-bottom: 4px; }
.suggest { list-style: none; margin: 0 0 12px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); max-height: 300px; overflow: auto; }
.suggest li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.suggest li small { color: var(--muted); display: block; font-size: 12px; }
.suggest li b { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; color: var(--accent); }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--accent-soft); }
.picked { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin: 0 0 10px; }

details.lg-pick { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
details.lg-pick summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--accent); }
details.lg-pick[open] summary { margin-bottom: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 12px; padding: 11px 18px; cursor: pointer; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 7px 14px; font-size: 14px; border-radius: 10px; }

/* result */
.r-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 20px; }
.r-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; font-weight: 500; }
.r-rate { font-variant-numeric: tabular-nums; }
.r-profit { font-size: 44px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 2px 0 10px; }
.r-profit.pos { color: var(--pos); } .r-profit.neg { color: var(--neg); }
.r-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.r-kpis div { background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.r-kpis span { display: block; font-size: 12px; color: var(--muted); }
.r-kpis b { font-size: 17px; font-variant-numeric: tabular-nums; }
.bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--bg); margin-bottom: 12px; }
.bar i { display: block; height: 100%; }
.r-lines { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.r-lines td { padding: 4px 0; border-bottom: 1px solid var(--line); }
.r-lines td:last-child { text-align: right; white-space: nowrap; }
.r-lines .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
.r-lines .pct { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.r-block { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.r-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.r-row b { font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-win { color: var(--muted); font-size: 13px; margin-top: 2px; }
.warn { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin-top: 12px; }
.r-actions { margin-top: 14px; display: flex; gap: 8px; }
.r-actions .btn { width: 100%; }
.promo { display: block; margin-top: 14px; text-decoration: none; color: var(--ink); background: linear-gradient(135deg, var(--accent-soft), var(--soft)); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font-size: 14px; }
.promo b { display: block; margin-bottom: 4px; }
.promo span { color: var(--muted); }
.promo b.inl { display: inline; margin: 0; color: var(--ink); }

.mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: none; align-items: center; gap: 16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15,23,42,.08); }
.mbar div { display: flex; flex-direction: column; }
.mbar span { font-size: 11.5px; color: var(--muted); }
.mbar b { font-variant-numeric: tabular-nums; font-size: 18px; }
.mbar .btn { margin-left: auto; }
@media (max-width: 960px) { .mbar.on { display: flex; } body.has-mbar { padding-bottom: 72px; } }

.content { padding-top: 24px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.text h2 { font-size: 21px; margin: 0 0 10px; }
.text p, .text li { color: var(--muted); }
.text ul { padding-left: 20px; }
.text b { color: var(--ink); }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; }

/* services */
.services { padding-top: 12px; }
.service { padding: 24px; }
.svc-head h2 { margin: 0 0 6px; font-size: 24px; }
.svc-head p { margin: 0 0 14px; color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.ticks li { position: relative; padding-left: 26px; font-size: 15px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-5' stroke='%232b59ff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
@media (max-width: 700px) { .ticks { grid-template-columns: 1fr; } }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 820px) { .plans { grid-template-columns: 1fr; } }
.plan { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; background: var(--bg); }
.plan-mid { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--card); }
.plan-name { font-weight: 700; }
.plan-price { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.plan-days { color: var(--muted); font-size: 13px; }
.plan p { color: var(--muted); font-size: 14.5px; flex: 1; }
.plan .btn { align-self: flex-start; }
.svc-extra { font-size: 14.5px; margin: 0 0 8px; }
.svc-note { font-size: 14px; background: var(--soft); border-radius: 12px; padding: 10px 14px; margin: 0 0 6px; }

.lead-card { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; padding: 24px; }
@media (max-width: 820px) { .lead-card { grid-template-columns: 1fr; } }
.lead-text h2 { margin-top: 0; }
.lead-text p { color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { min-height: 1.5em; margin: 10px 0 0; font-weight: 600; }
.form-msg.ok, .ok-msg { color: var(--pos); }
.form-msg.err { color: var(--neg); }
.ok-msg { grid-column: 1 / -1; margin: 0; font-weight: 600; }
.narrow-page { max-width: 800px; padding-top: 32px; }

.foot { margin-top: 40px; border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.foot-in { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; }
.foot-links { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 700px) { .foot-in { grid-template-columns: 1fr; } }

/* marketplace-dependent visibility */
.form[data-mp="wb"] .oz, .form[data-mp="wb"] .fbs-only, .form[data-mp="ozon_fbo"] .fbs-only { display: none !important; }
.form:not([data-mp="wb"]) .wbo { display: none; }
.form[data-cmode="tiers"]:not([data-mp="wb"]) .flat { display: none; }
.form[data-cmode="flat"] .tiers, .form[data-mp="wb"] .tiers { display: none !important; }
@media (max-width: 560px) {
  .hero { padding-top: 24px; }
  .card { padding: 16px; }
  .nav a { padding: 8px 8px; }
  .logo span { display: none; }
  .r-profit { font-size: 38px; }
}
#result, #zayavka, .service { scroll-margin-top: 76px; }
