:root {
  --bg: #f7f6f3;
  --bg-alt: #efede8;
  --surface: #ffffff;
  --ink: #1b1d21;
  --ink-2: #4a4f57;
  --ink-3: #7a8089;
  --line: #e1ded7;
  --accent: #0f6e63;
  --accent-ink: #ffffff;
  --accent-soft: #dcefeb;
  --up: #1d7a43;
  --down: #b4432f;
  --warn: #a36a00;
  --warn-soft: #fbefd6;
  --bad-soft: #f8e1dc;
  --ok-soft: #dff1e5;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 8px 24px rgba(20, 20, 20, .06);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131518;
    --bg-alt: #181b1f;
    --surface: #1e2226;
    --ink: #eceef0;
    --ink-2: #b4bac2;
    --ink-3: #868d96;
    --line: #2d3238;
    --accent: #4fc2b1;
    --accent-ink: #0b1e1b;
    --accent-soft: #163a35;
    --up: #5cc98a;
    --down: #f08a74;
    --warn: #e6b04a;
    --warn-soft: #3a2f17;
    --bad-soft: #3d221d;
    --ok-soft: #183323;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 68px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.hero h1 span { display: block; color: var(--accent); }
p { margin: 0; }
a { color: inherit; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.wrap--narrow { max-width: 820px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top__row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; }
.logo__mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 9px; background: var(--accent); fill: var(--accent-ink);
}
.logo__badge {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 2px 7px; border-radius: 999px; margin-left: 4px;
}
.nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.nav .nav__cta {
  color: var(--accent-ink); background: var(--accent);
  padding: 7px 14px; border-radius: 999px; font-weight: 600;
}
.nav .nav__cta:hover { color: var(--accent-ink); }
.lang-sw { display: inline-flex; gap: 2px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-btn { border: none; background: transparent; color: var(--ink-3); font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 999px; cursor: pointer; font-family: inherit; }
.lang-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
@media (max-width: 760px) {
  .nav { gap: 10px; font-size: 14px; }
  .nav a:not(.nav__cta):not([href="#pricing"]) { display: none; }
}
.logo > span:last-child { white-space: nowrap; }
/* Телефон: логотип в первой строке, меню + языки + Contact во второй,
   иначе шапка шире экрана и Contact обрезается. */
@media (max-width: 560px) {
  .top__row { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; row-gap: 8px; }
  .logo__badge { display: none; }
  .nav { width: 100%; justify-content: space-between; gap: 8px; }
  .lang-btn { padding: 4px 7px; }
  .nav .nav__cta { padding: 6px 12px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }

/* Hero */
.hero { padding: 56px 0 64px; }
.hero__grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 84px 0 92px; }
  .hero__grid { grid-template-columns: 1.15fr 1fr; gap: 56px; }
}
.eyebrow {
  color: var(--accent); font-weight: 600; font-size: 13.5px;
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: 16px;
}
.hero h1 { font-size: clamp(32px, 5.5vw, 50px); font-weight: 720; letter-spacing: -0.025em; }
.lead { margin-top: 20px; font-size: 18px; color: var(--ink-2); max-width: 58ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.hero__card {
  margin: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.mini-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 15px; }
.tag {
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  border: 1px dashed var(--line); padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.drop {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  padding: 10px 12px; border: 1.5px dashed var(--accent); border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-size: 13px;
}
.drop span { color: var(--ink-2); }
.drop b { color: var(--ink); }
.tabs { display: flex; gap: 4px; margin-top: 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-3); overflow: hidden; }
.tabs span { padding: 6px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs .tabs__on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 12px; }
.kpis > div { display: flex; flex-direction: column; gap: 2px; }
.kpi__label { font-size: 13px; color: var(--ink-3); }
.kpi__value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.delta { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.spark { width: 100%; height: 90px; display: block; }
.spark polyline { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark__line { stroke: var(--accent); }
.spark__prev { stroke: var(--ink-3); stroke-dasharray: 4 4; opacity: .6; }
.mini-foot { font-size: 13px; color: var(--ink-3); margin-top: 6px; }

/* Sections */
.section { padding: 64px 0; }
@media (min-width: 900px) { .section { padding: 84px 0; } }
.section--alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; letter-spacing: -0.02em; }
.section__lead { margin-top: 12px; color: var(--ink-2); font-size: 17px; max-width: 64ch; }

/* 3-Step Cards */
.cards { display: grid; gap: 18px; margin-top: 36px; }
@media (min-width: 760px) { .cards--three { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.card__num {
  display: inline-block; color: var(--accent); background: var(--accent-soft);
  font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 14px;
}
.card h3 { font-size: 19px; margin-bottom: 8px; }
.card p { color: var(--ink-2); font-size: 15px; }

/* Pills */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill--bad { background: var(--bad-soft); color: var(--down); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--ok { background: var(--ok-soft); color: var(--up); }

/* Live Sample Section & Interactive Workbench */
.sample-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px;
  margin-bottom: 28px;
}
.sample-head__badges { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sample-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.workbench {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 20px;
}
@media (min-width: 720px) { .workbench { padding: 26px; } }
.wb-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.wb-top strong { display: block; font-size: 17px; }
.wb-sub { font-size: 13px; color: var(--ink-3); }

.wb-drop {
  margin-top: 16px; border: 2px dashed var(--accent); border-radius: 12px;
  padding: 16px 18px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  cursor: pointer; text-align: left; transition: background .15s ease, transform .15s ease;
}
.wb-drop:hover, .wb-drop.over { transform: translateY(-1px); filter: brightness(0.98); }
.wb-drop b { display: block; color: var(--ink); font-size: 14.5px; }
.wb-drop small { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }

.wb-ai-bar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
  padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.wb-ai-input {
  flex: 1 1 280px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); border-radius: 8px; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
}
.wb-ai-key {
  flex: 0 1 180px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); border-radius: 8px; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
}
.wb-ai-btn { padding: 9px 16px; font-size: 13.5px; border-radius: 8px; }
.wb-ai-summary {
  margin: 10px 0; padding: 12px 15px; border-radius: 10px;
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  font-size: 13.5px; color: var(--ink);
}
.wb-ai-summary strong { color: var(--accent); display: block; margin-bottom: 3px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.wb-status { font-size: 13px; font-weight: 600; margin: 12px 0 6px; min-height: 20px; color: var(--ink-2); }
.wb-status.err { color: var(--down) !important; }

.wb-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); margin: 10px 0 14px;
}
.wb-tab {
  padding: 9px 16px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.wb-tab:hover { color: var(--ink); }
.wb-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.wb-hide { display: none !important; }

.wb-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 12px 0 14px; }
.wb-controls label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em;
}
.wb-controls select, .wb-controls input[type="number"] {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit;
}
.wb-controls input[type="number"] { width: 84px; }
.wb-btn-sm {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.wb-btn-sm:hover { border-color: var(--accent); color: var(--accent); }

.wb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 10px 0; }
.wb-tile { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.wb-tile .lab { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; margin-bottom: 4px; }
.wb-tile .val { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wb-tile .val small { font-size: 12px; font-weight: 500; color: var(--ink-2); }

.wb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
@media (max-width: 860px) { .wb-grid { grid-template-columns: 1fr; } }
.wb-card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px; margin-top: 10px; min-width: 0; }
.wb-grid .wb-card { margin-top: 0; }
.wb-full { grid-column: 1 / -1; }
.wb-card h4 { font-size: 14.5px; margin-bottom: 3px; }
.wb-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.wb-note { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }

.workbench svg { display: block; width: 100%; overflow: visible; }
.wb-axislab { fill: var(--ink-3); font-size: 11px; }
.wb-rowlab { fill: var(--ink); font-size: 11.5px; }
.wb-vallab { fill: var(--ink); font-size: 11px; font-weight: 600; }
.wb-gridline { stroke: var(--line); stroke-width: 1; }
.wb-bar { cursor: pointer; }
.wb-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.wb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wb-sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.wb-table-wrap { overflow-x: auto; max-height: 360px; overflow-y: auto; }
.wb-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.wb-table th, .wb-table td { padding: 7px 9px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.wb-table th:first-child, .wb-table td:first-child { text-align: left; }
.wb-table th {
  position: sticky; top: 0; background: var(--bg);
  color: var(--ink-3); font-weight: 600; font-size: 11px; text-transform: uppercase; cursor: pointer;
}
.wb-table tbody tr:hover { background: var(--surface); }
.wb-foot { font-size: 12px; color: var(--ink-3); margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

.wb-tt {
  position: fixed; pointer-events: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow);
  opacity: 0; transition: opacity .08s; z-index: 60; max-width: 260px;
}
.wb-tt b { display: block; margin-bottom: 2px; }

/* Pricing */
.pricing { display: grid; gap: 20px; margin-top: 36px; }
/* Пять тарифов: 2+2+1 на планшете (последняя на всю ширину),
   3+2 на десктопе со вторым рядом по центру — без пустой ячейки. */
@media (min-width: 620px) {
  .pricing { grid-template-columns: repeat(2, 1fr); }
  .pricing > .price-card:nth-child(5) { grid-column: 1 / -1; }
}
@media (min-width: 820px) {
  .pricing { grid-template-columns: repeat(6, 1fr); }
  .pricing > .price-card { grid-column: span 2; }
  .pricing > .price-card:nth-child(4) { grid-column: 2 / span 2; }
  .pricing > .price-card:nth-child(5) { grid-column: 4 / span 2; }
}

.price-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
}
.price-card--featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}
.price-card__badge-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.price-card__tier {
  display: block; color: var(--accent); font-weight: 700; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px;
}
.price-card__badge-row .price-card__tier { margin-bottom: 0; }
.price-card h3 { font-size: 19px; margin-bottom: 10px; }
.price-card__amount {
  font-size: 34px; font-weight: 750; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; margin-bottom: 12px;
}
.price-card__period { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.price-card__desc { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.price-card__list {
  margin: 0; padding: 16px 0 0; list-style: none;
  border-top: 1px solid var(--line); display: grid; gap: 10px;
}
.price-card__list li {
  position: relative; padding-left: 20px; font-size: 14px; color: var(--ink-2); line-height: 1.45;
}
.price-card__list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 700;
}
.price-card__btn { width: 100%; margin-top: auto; }
.pricing__note { margin-top: 20px; font-size: 14px; color: var(--ink-3); text-align: center; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 18px 0; }
details:first-of-type { margin-top: 28px; border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 22px; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { margin-top: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }

/* Legal */
.legal__grid { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 900px) { .legal__grid { grid-template-columns: repeat(3, 1fr); } }
.legal__card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 12px;
}
.legal__card h3 { font-size: 18px; color: var(--ink); }
.legal__card p { font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.legal__card code { font-size: 13px; background: var(--bg-alt); padding: 2px 5px; border-radius: 4px; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 40px 0 28px; font-size: 14px; color: var(--ink-2); background: var(--bg-alt); }
.foot__seller {
  display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between;
  padding-bottom: 24px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
}
.foot__title { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.foot__seller p { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.foot__links { display: flex; flex-wrap: wrap; gap: 12px 20px; align-content: flex-start; }
.foot__links a { text-decoration: none; color: var(--ink-2); font-weight: 500; }
.foot__links a:hover { color: var(--ink); text-decoration: underline; }
.foot__tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3);
}
.foot__tools strong { color: var(--ink); }
.foot__tools a { text-decoration: none; color: var(--ink-2); font-weight: 500; }
.foot__tools a:hover { color: var(--accent); text-decoration: underline; }
.foot__row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--ink-3); font-size: 13px; }

/* Checkout Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 18, 22, .55); backdrop-filter: blur(4px);
  display: none; place-items: center; padding: 16px;
}
.modal-backdrop.is-open { display: grid; }
.modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
  max-width: 480px; width: 100%; padding: 28px;
}
.modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal__close {
  background: none; border: none; color: var(--ink-3);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.modal__close:hover { color: var(--ink); }
.modal h3 { font-size: 22px; margin-bottom: 6px; }
.modal__price { font-size: 30px; font-weight: 750; color: var(--accent); margin-bottom: 16px; }
.modal__price small { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.modal__box {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px;
}
.modal__box strong { display: block; margin-bottom: 4px; color: var(--ink); }
.modal__box p { color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.modal__note { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 20px; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.modal__actions .btn { flex: 1 1 auto; }
