:root {
  --bg-body: #f4f7f9;
  --bg-card: #ffffff;
  --bg-dark: #062c21;
  --bg-slate: #0f172a;
  --accent-emerald: #059669;
  --accent-emerald-hover: #047857;
  --accent-emerald-light: #ecfdf5;
  --accent-amber: #d97706;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-line: #cbd5e1;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 20px;
}

.b2b-header {
  background: var(--bg-slate);
  color: #ffffff;
  padding: 14px 0;
  border-bottom: 3px solid var(--accent-emerald);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #047857);
  color: #ffffff;
  font-weight: 900;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-title {
  font-size: 19px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-2026 {
  font-size: 11px;
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 8px;
  border-radius: 99px;
}

.logo-sub {
  font-size: 12.5px;
  color: #94a3b8;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-pill {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.15s;
}

.nav-pill:hover {
  background: rgba(255, 255, 255, 0.16);
}

.nav-pill-accent {
  background: var(--accent-emerald);
  color: #ffffff;
}

.nav-pill-accent:hover {
  background: var(--accent-emerald-hover);
}

/* Основная сетка */
.main-grid {
  display: grid;
  grid-template-columns: 520px 1fr;
  gap: 24px;
  margin-top: 24px;
  margin-bottom: 28px;
  align-items: start;
}

.calc-card,
.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card-head h1 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.card-head p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.amount-input-wrap {
  position: relative;
  margin-bottom: 16px;
}

#nds-amount {
  width: 100%;
  padding: 13px 40px 13px 14px;
  font-size: 22px;
  font-weight: 800;
  border: 2px solid #94a3b8;
  border-radius: 10px;
  color: var(--text-primary);
}

#nds-amount:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.btn-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: #e2e8f0;
  color: #475569;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.mode-btn {
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-line);
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.mode-btn strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.mode-btn small {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.mode-btn.active {
  background: var(--bg-slate);
  color: #ffffff;
  border-color: var(--bg-slate);
}

.mode-btn.active small {
  color: #cbd5e1;
}

.rates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.rate-chip {
  padding: 10px;
  border-radius: 9px;
  border: 1px solid var(--border-line);
  background: #ffffff;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.rate-chip strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
}

.rate-chip span {
  font-size: 11px;
  color: var(--text-secondary);
}

.rate-chip.active {
  background: var(--accent-emerald);
  color: #ffffff;
  border-color: var(--accent-emerald);
}

.rate-chip.active span {
  color: #d1fae5;
}

.purpose-inputs input {
  width: 100%;
  padding: 10px 12px;
  font-size: 13.5px;
  border: 1px solid var(--border-line);
  border-radius: 8px;
}

/* Правая карточка результатов */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.btn-print-card {
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--border-line);
  background: #f8fafc;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}

.kpi-stack {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-row-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, transform 0.1s;
}

.kpi-row-item:hover {
  border-color: var(--accent-emerald);
}

.kpi-accent {
  background: #fffbeb;
  border-color: #fde68a;
}

.kpi-total {
  background: var(--accent-emerald-light);
  border-color: #6ee7b7;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.kpi-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.copy-hint {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--accent-emerald);
  font-weight: 700;
}

.copy-box {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}

.copy-box-head {
  background: #f8fafc;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12.5px;
}

.btn-mini-copy {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-mini-copy:hover {
  background: var(--accent-emerald);
  color: #ffffff;
  border-color: var(--accent-emerald);
}

.copy-box-body {
  padding: 12px 14px;
  font-size: 14px;
  background: #ffffff;
}

.code-font {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  background: #fcfcfd;
}

/* Секция сравнения 5%/7% vs 20% */
.compare-section {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}

.section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--accent-emerald-light);
  color: var(--accent-emerald-hover);
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 6px;
}

.compare-head h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.compare-head p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.compare-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: center;
}

.compare-inputs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
  padding: 18px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.compare-inputs input[type="number"] {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid var(--border-line);
  border-radius: 8px;
}

.compare-inputs input[type="range"] {
  width: 100%;
  margin: 8px 0;
}

.range-val-display {
  font-size: 13.5px;
}

.cmp-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cmp-option-card {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  background: #ffffff;
}

.cmp-option-card.winner {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-light);
}

.cmp-option-card h4 {
  font-size: 15px;
  margin-bottom: 8px;
}

.cmp-big-num {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 6px;
}

/* CPA B2B Витрина */
.cpa-b2b-section {
  background: linear-gradient(145deg, #0f172a 0%, #064e3b 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 40px;
}

.cpa-b2b-head h2 {
  font-size: 21px;
  margin-bottom: 6px;
}

.cpa-b2b-head p {
  font-size: 13.5px;
  color: #cbd5e1;
  margin-bottom: 20px;
}

.offers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.offer-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.offer-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  padding: 3px 9px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.offer-card h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.offer-card ul {
  margin-left: 18px;
  font-size: 13px;
  color: #e2e8f0;
  margin-bottom: 16px;
}

.offer-card li {
  margin-bottom: 6px;
}

.btn-offer {
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 8px;
  background: #10b981;
  color: #062c21;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn-offer:hover {
  filter: brightness(1.08);
}

.offer-feedback {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid #10b981;
  font-size: 13.5px;
}

.b2b-footer {
  background: var(--bg-slate);
  color: #94a3b8;
  font-size: 12.5px;
  padding: 20px 0;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 1040px) {
  .main-grid,
  .compare-grid,
  .offers-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .kpi-stack,
  .cmp-cards-row,
  .rates-grid,
  .mode-switch {
    grid-template-columns: 1fr;
  }
}

@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #ffffff !important;
  }
  .main-grid {
    display: block !important;
  }
}
