﻿:root {
  --ink: #142033;
  --muted: #657287;
  --line: #d8e0ec;
  --soft: #f3f6fb;
  --surface: #ffffff;
  --green: #168f72;
  --blue: #2e69d1;
  --amber: #c78117;
  --red: #d64c4c;
  --shadow: 0 18px 48px rgba(20, 32, 51, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

* {
  min-width: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fbfcff;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(216, 224, 236, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-size: 13px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(22px, 5vw, 56px);
  align-items: center;
  padding: clamp(38px, 6vw, 72px) clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(46, 105, 209, 0.11), rgba(22, 143, 114, 0.1) 50%, rgba(199, 129, 23, 0.1)),
    #ffffff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 38px);
  line-height: 1.08;
}

h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.hero p {
  max-width: 760px;
  color: #46566f;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.55;
}

.panel,
.result-card,
.content-section article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(20, 32, 51, 0.06);
}

.result-card p,
.content-section p,
.disclaimer {
  color: var(--muted);
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 30px clamp(16px, 5vw, 72px) 54px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.input-column {
  display: grid;
  gap: 18px;
}

.input-column {
  max-width: 1440px;
  width: 100%;
  justify-self: center;
}

.panel,
.result-card {
  padding: 18px;
}

.panel h2,
.result-card h2 {
  font-size: 24px;
  line-height: 1.15;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two,
.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: #3b485c;
  font-size: 14px;
  font-weight: 740;
}

input,
select {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

input:disabled {
  background: #edf2f7;
  color: var(--muted);
  cursor: not-allowed;
}

.button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 780;
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.button.secondary {
  background: #f8fafc;
}

.table-like {
  display: grid;
  gap: 12px;
}

.bundle-list {
  display: grid;
  gap: 14px;
}

.comparison-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #fbfcff;
}

.comparison-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 260px) minmax(160px, 1fr) 38px;
  gap: 12px;
  align-items: end;
  justify-content: start;
  max-width: 920px;
  width: 100%;
  margin: 0;
}

.comparison-toolbar .remove-row {
  position: static;
  width: 38px;
  min-height: 44px;
}

.compare-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.compare-pair.single-bundle {
  grid-template-columns: minmax(0, 1fr);
}

.compare-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  align-content: start;
}

.compare-box h3 {
  margin: 0;
  font-size: 18px;
}

.type-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.direct-box {
  border: 1px solid #dbe5f3;
  background: #f8fbff;
}

.bundle-box {
  border: 1px solid #cfebdf;
  background: #f5fbf8;
}

.box-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.box-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-field {
  grid-column: 1 / -1;
}

.bundle-item-row .wide-field {
  grid-column: 1 / -2;
}

.bundle-items {
  display: grid;
  gap: 10px;
}

.bundle-item-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) repeat(2, minmax(120px, 0.8fr)) 38px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #dce8df;
  border-radius: 8px;
  background: #ffffff;
}

.random-item-row {
  grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 0.7fr) minmax(130px, 0.7fr) 38px;
}

.random-item-row .wide-field {
  grid-column: auto;
}

.tier-row {
  grid-template-columns: minmax(170px, 1.1fr) repeat(3, minmax(120px, 0.8fr)) 38px;
}

.choice-item-row {
  grid-template-columns: 86px minmax(220px, 1.3fr) minmax(130px, 0.7fr) minmax(130px, 0.75fr) minmax(110px, 0.6fr) 38px;
}

.choice-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 0;
}

.choice-check input {
  width: 18px;
  min-height: 18px;
}

.bundle-item-row .remove-row {
  position: static;
  width: 38px;
  min-height: 44px;
  grid-column: -2 / -1;
}

.group-result {
  display: grid;
  grid-template-columns: minmax(96px, 0.5fr) minmax(90px, 0.35fr) minmax(260px, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #ffffff;
}

.group-result span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
}

.group-result strong {
  color: var(--ink);
  font-size: 26px;
}

.group-result em {
  color: var(--muted);
  font-style: normal;
}

.result-warning {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.45;
}

.group-result.has-warning {
  border-color: rgba(214, 76, 76, 0.45);
  background: #fffafa;
}

.tier-breakdown {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.tier-result-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) repeat(4, minmax(100px, 0.8fr));
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e0e7f1;
  border-radius: 8px;
  background: #fbfcff;
  color: var(--muted);
  font-size: 13px;
}

.tier-result-row strong {
  color: var(--ink);
  font-size: 14px;
}

.tier-result-row.best {
  border-color: rgba(22, 143, 114, 0.35);
  background: #f2fbf7;
}

.bundle-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #fbfcff;
}

.type-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.bundle-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.compare-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef3fa;
  color: #334155;
  font-size: 14px;
}

.comparison-list {
  display: grid;
  gap: 10px;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid #e3eaf4;
  border-radius: 8px;
  background: #fff;
}

.comparison-title {
  grid-column: 1 / -1;
}

.comparison-title .item-name {
  max-width: 420px;
}

.compare-side {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
}

.reference-side {
  border: 1px solid #dbe5f3;
  background: #f8fbff;
}

.bundle-side {
  position: relative;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #cfebdf;
  background: #f5fbf8;
}

.side-title {
  grid-column: 1 / -1;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.bundle-actions {
  display: flex;
  justify-content: flex-start;
}

.ranking-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e3eaf4;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.ranking-list {
  display: grid;
  gap: 10px;
}

.ranking-item.best {
  border-color: rgba(22, 143, 114, 0.35);
  background: #f2fbf7;
}

.ranking-item strong {
  color: var(--ink);
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  padding: 14px 54px 14px 14px;
  border: 1px solid #e3eaf4;
  border-radius: 8px;
  background: #fbfcff;
}

.reward-row {
  grid-template-columns: 1fr;
  padding: 14px;
}

.reward-card-head {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(220px, 300px) 38px;
  align-items: end;
  gap: 10px;
}

.reward-card-head strong {
  align-self: center;
  color: var(--ink);
  font-size: 15px;
}

.inline-select {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  align-items: center;
  gap: 8px;
}

.inline-select span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.inline-select select {
  min-height: 38px;
  padding-block: 8px;
}

.reward-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(120px, 0.7fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: end;
}

.reward-fields .field-name {
  grid-column: auto;
}

.goal-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.random-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.remove-row {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 820;
}

.reward-card-head .remove-row {
  position: static;
  width: 38px;
  min-height: 38px;
  align-self: end;
}

.row label:first-child {
  grid-column: 1 / -1;
}

.reward-row label:first-child {
  grid-column: auto;
}

.nested-outcomes {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  margin-top: 2px;
  padding: 12px;
  border: 1px dashed #c9d4e4;
  border-radius: 8px;
  background: #f7faff;
}

.nested-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nested-head strong {
  font-size: 14px;
}

.nested-head .button {
  min-height: 36px;
  padding: 8px 12px;
}

.outcome-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(86px, 0.65fr) minmax(86px, 0.65fr) minmax(150px, 1fr) 34px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid #e4eaf3;
  border-radius: 8px;
  background: #fff;
}

.outcome-row .remove-row {
  position: static;
  width: 34px;
  min-height: 38px;
}

.form-error {
  min-height: 22px;
  margin: 0;
  color: var(--red);
  font-weight: 740;
}

.metric {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #e4eaf3;
  border-radius: 8px;
  background: #fbfcff;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 24px;
}

.metric.muted {
  align-content: center;
}

.coverage-list {
  display: grid;
  gap: 10px;
}

.coverage-item {
  border-left: 4px solid var(--green);
  padding: 10px 12px;
  background: #f5fbf8;
}

.coverage-item.short {
  border-left-color: var(--amber);
  background: #fff9ee;
}

.coverage-item strong {
  display: block;
  margin-bottom: 4px;
}

.empty {
  margin: 0;
}

.content-section {
  padding: 54px clamp(16px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.info-grid,
.faq-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.content-section article {
  padding: 18px;
}

.disclaimer {
  margin: 32px clamp(16px, 5vw, 72px);
  border: 1px solid #ead59a;
  border-radius: 8px;
  padding: 16px;
  background: #fff9e8;
  color: #5d4919;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 26px clamp(16px, 5vw, 72px);
  color: var(--muted);
}

.floating-calculator {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.calculator-toggle {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 9px 14px;
  background:
    linear-gradient(135deg, rgba(46, 105, 209, 0.95), rgba(22, 143, 114, 0.95)),
    var(--ink);
  color: #fff;
  box-shadow: 0 18px 42px rgba(24, 77, 137, 0.28);
  cursor: pointer;
  font-weight: 850;
}

.calculator-toggle span {
  display: grid;
  width: 34px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.calculator-toggle strong {
  font-size: 14px;
}

.calculator-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 314px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(28, 39, 59, 0.96), rgba(15, 24, 38, 0.98)),
    #142033;
  box-shadow: 0 24px 70px rgba(12, 19, 31, 0.32);
}

.calculator-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: #fff;
}

.calculator-head div {
  display: grid;
  gap: 2px;
}

.calculator-head span {
  color: #8fb6ff;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.08em;
}

.calculator-head strong {
  font-size: 16px;
}

.calculator-close {
  width: 34px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
}

.calculator-display {
  display: grid;
  gap: 4px;
  min-height: 86px;
  margin-bottom: 12px;
  border: 1px solid rgba(143, 182, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(11, 18, 31, 0.72), rgba(22, 143, 114, 0.12)),
    #101827;
  text-align: right;
}

.calculator-display span {
  min-height: 18px;
  color: #9fb0c8;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.calculator-display strong {
  color: #f8fbff;
  font-size: 32px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.calculator-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.calculator-keys button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  color: #eef5ff;
  cursor: pointer;
  font-weight: 820;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.calculator-keys button:hover {
  border-color: rgba(143, 182, 255, 0.38);
  background: rgba(255, 255, 255, 0.15);
}

.calculator-keys .utility {
  background: rgba(199, 129, 23, 0.18);
  color: #ffd79a;
}

.calculator-keys .operator {
  background: rgba(46, 105, 209, 0.28);
  color: #dbe8ff;
}

.calculator-keys .equals {
  grid-row: span 2;
  border-color: rgba(37, 211, 156, 0.38);
  background: linear-gradient(180deg, #20a77d, #15775f);
  color: #fff;
  font-size: 20px;
}

.calculator-keys .zero {
  grid-column: span 2;
}

@media (max-width: 980px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .info-grid,
  .faq-list {
    grid-template-columns: 1fr;
  }

  .bundle-meta,
  .comparison-toolbar,
  .compare-pair,
  .box-grid,
  .box-grid.compact,
  .bundle-item-row,
  .choice-item-row,
  .random-item-row,
  .tier-row,
  .group-result,
  .tier-result-row,
  .comparison-row,
  .compare-head {
    grid-template-columns: 1fr;
  }

  .compare-side,
  .bundle-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid.two,
  .result-grid,
  .row,
  .outcome-row,
  .random-row,
  .goal-row {
    grid-template-columns: 1fr;
  }

  .row {
    padding-right: 14px;
    padding-top: 58px;
  }

  .reward-row {
    padding-top: 14px;
  }

  .reward-card-head,
  .reward-fields {
    grid-template-columns: 1fr;
  }

  .inline-select {
    grid-template-columns: 1fr;
  }

  .reward-card-head .remove-row {
    justify-self: start;
  }

  .remove-row {
    left: 14px;
    right: auto;
  }

  .outcome-row .remove-row {
    position: static;
  }

  .floating-calculator {
    right: 14px;
    bottom: 14px;
    left: auto;
  }

  .calculator-panel {
    width: min(314px, calc(100vw - 28px));
  }
}



