@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/onest-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/onest-lat.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193;
}

:root {
  --bg: #f6f5f0;
  --card: #ffffff;
  --ink: #14181f;
  --muted: #5a6270;
  --accent: #0d9488;
  --accent-dark: #0f766e;
  --accent-soft: #e6f7f5;
  --line: #e4e2d8;
  --gauge: #14181f;
  --mint: #34d399;
  --warn-bg: #fff4ed;
  --warn-ink: #b93815;
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
}

.screen {
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.tag-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.tag-pill.paid {
  background: #dcfce7;
  color: #166534;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 12px;
  cursor: pointer;
}
.ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.gauge-card {
  background: var(--gauge);
  color: #f8fafc;
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: 0 10px 24px rgba(20, 24, 31, 0.14);
}
.gauge-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
}
.gauge-numbers {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.gauge-flow {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.was-size {
  font-size: 15px;
  color: #94a3b8;
  text-decoration: line-through;
}
.arrow-sep {
  color: #64748b;
  font-weight: 700;
}
.now-size {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}
.saved-pill {
  background: rgba(52, 211, 153, 0.18);
  color: var(--mint);
  border: 1px solid rgba(52, 211, 153, 0.35);
  font-weight: 800;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.gauge-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  margin-top: 10px;
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #14b8a6, #34d399);
}
.gauge-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.gauge-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
}
.gauge-chip.ok {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
}

.hero-copy h1 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.hero-copy p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.mode-btn {
  border: 1.5px solid var(--line);
  background: #faf9f5;
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.mode-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.pro-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 5px;
  background: #14181f;
  color: #fff;
}
.mode-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.target-box {
  background: #faf9f5;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kb-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 4px 9px;
}
.kb-input-wrap input {
  width: 64px;
  border: 0;
  outline: none;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  text-align: right;
  color: var(--ink);
  background: transparent;
}
.kb-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.chip-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 9px;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.chip-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.fmt-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.fmt-btn {
  border: 1px solid var(--line);
  background: #faf9f5;
  color: var(--ink);
  border-radius: 10px;
  padding: 7px 4px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.fmt-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.cta-btn {
  width: 100%;
  border: 0;
  border-radius: 15px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  padding: 15px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.28);
  text-decoration: none;
}
.cta-btn:active { transform: translateY(1px); background: var(--accent-dark); }
.cta-btn:disabled { opacity: 0.6; cursor: default; }

.sub-hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: -4px 0 0;
}

.alert-banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 1px solid #fed7aa;
  border-radius: 13px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast-paid {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  border-radius: 13px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}
.preview-name {
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compare-toggle {
  display: inline-flex;
  background: #f1f0ea;
  border-radius: 9px;
  padding: 2px;
}
.compare-toggle button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
}
.compare-toggle button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.preview-stage {
  background: repeating-conic-gradient(#ecebe4 0% 25%, #f7f6f1 0% 50%) 50% / 16px 16px;
  height: 224px;
  display: grid;
  place-items: center;
  padding: 8px;
}
.preview-stage img {
  max-width: 100%;
  max-height: 208px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.upsell-card {
  background: #fff;
  border: 1.5px solid #99f6e4;
  border-radius: var(--radius);
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.upsell-card h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
}
.upsell-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}
.upsell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.upsell-pill {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 10px;
  padding: 7px 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf9f5;
  cursor: pointer;
}
.queue-item.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.queue-meta {
  min-width: 0;
  flex: 1;
}
.queue-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-sub {
  font-size: 12px;
  color: var(--muted);
}
.mini-dl {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 9px;
  white-space: nowrap;
}

.busy-box {
  margin: auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3.5px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Модальное окно пейволла */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.sheet {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 92dvh;
  overflow-y: auto;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.sheet-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.18;
  font-weight: 800;
}
.close-x {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: #f1f5f9;
  color: #475569;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.discount-pill {
  align-self: flex-start;
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
}
.pw-bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.pw-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
}
.pw-bullets .ico { color: var(--accent); margin-top: 2px; }

.plans {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-card {
  border: 2px solid var(--line);
  background: #faf9f5;
  border-radius: 15px;
  padding: 12px 13px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
}
.plan-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.plan-badge {
  position: absolute;
  top: -9px;
  right: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}
.plan-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
}
.plan-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.plan-price-col {
  text-align: right;
  white-space: nowrap;
}
.old-price {
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
  display: block;
}
.cur-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}
.legal-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-top: 8px; padding-top: 4px; }
.foot-link { appearance: none; background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 12.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sub-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.sub-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; background: #f1f0ea; color: var(--muted); }
.sub-badge[data-status="active"] { background: #dcfce7; color: #166534; }
.sub-badge[data-status="canceled"] { background: #fef3c7; color: #92400e; }
.sub-rows { margin: 0; display: grid; gap: 9px; }
.sub-row { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.sub-row:last-child { border-bottom: 0; padding-bottom: 0; }
.sub-row dt { color: var(--muted); }
.sub-row dd { margin: 0; font-weight: 700; text-align: right; }
.sub-multi { border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 6px; }
.sub-multi-title { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.sub-multi-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13.5px; }
.sub-multi-list li { display: flex; justify-content: space-between; gap: 10px; }
.sub-note { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.cta-btn.danger-outline { background: transparent; color: #b91c1c; border: 1.5px solid rgb(185 28 28 / .35); box-shadow: none; }
.cta-btn.danger { background: #dc2626; color: #fff; box-shadow: none; }
.cta-btn.ghost { background: #f1f0ea; color: var(--ink); box-shadow: none; }

