@font-face {
  font-family: Poppins;
  src: url(/fonts/poppins-400.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Poppins;
  src: url(/fonts/poppins-600.woff2) format("woff2");
  font-weight: 600 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #22182e;
  --muted: #574d61;
  --brand: #5416a4;
  --deep: #240749;
  --line: #dcd7e3;
  --soft: #f4f0fa;
  --bg: #fbfafc;
  --orange: #ffd19b;
  --green: #006454;
  --bad: #9b2427;
  font-family: Poppins, Arial, sans-serif;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #7d4bac;
  outline-offset: 3px;
}
.wrap {
  max-width: 1160px;
  margin: auto;
  padding: 0 clamp(16px, 4vw, 48px);
}
header {
  border-bottom: 1px solid var(--line);
  background: white;
}
.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 77px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 17px;
  font-size: 0.86rem;
  color: var(--muted);
}
.logo {
  display: flex;
  align-items: center;
  color: var(--deep);
}
.logo img {
  width: 93px;
  height: auto;
}
.brand span {
  border-left: 1px solid var(--line);
  padding-left: 17px;
}
.actions {
  display: flex;
  gap: 0.7em;
  align-items: center;
}
.quiet {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.52rem 0.9rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.86rem;
}
.hero {
  padding: 42px 0 23px;
}
#example { margin-top: 1rem; }
#scenario-note:empty { display: none; }
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 4rem);
  line-height: 1.12;
  letter-spacing: -0.047em;
  margin: 0;
  color: var(--deep);
}
.hero p {
  max-width: 730px;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 1.03rem;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: #ece8f0;
  border-radius: 10px;
  width: fit-content;
  margin: 0 0 25px;
}
.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.55rem 0.95rem;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
}
.tabs [aria-selected="true"] {
  background: white;
  color: var(--brand);
  box-shadow: 0 1px 5px #27103c18;
}
.panel[hidden] {
  display: none;
}
.result {
  padding: clamp(19px, 3vw, 31px);
  color: white;
  background: linear-gradient(112deg, #27103f, #3e126d);
  border-radius: 16px;
  margin-bottom: 20px;
}
.result h2 {
  color: white;
  font-size: clamp(1.25rem, 2.4vw, 1.9rem);
  margin: 0;
  line-height: 1.3;
}
.result p {
  margin: 0.65rem 0 0;
  color: #e5d7f0;
  font-size: 0.88rem;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.metric + .metric {
  border-left: 1px solid #ffffff3b;
  padding-left: 22px;
}
.metric .lbl {
  font-size: 0.82rem;
  color: #ede0f8;
}
.metric strong {
  display: block;
  font-size: clamp(1.25rem, 2.7vw, 2.2rem);
  line-height: 1.35;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.metric:last-child strong {
  color: var(--orange);
}
.metric small {
  display: block;
  color: #ede0f8;
  font-size: 0.77rem;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.block {
  border: 1px solid var(--line);
  background: white;
  border-radius: 14px;
  padding: clamp(15px, 2.4vw, 25px);
  margin-bottom: 18px;
  min-width: 0;
}
.grid2 .block {
  margin-bottom: 0;
}
.grid2 {
  margin-bottom: 18px;
}
.block h3,
.block h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  letter-spacing: -0.025em;
  color: var(--deep);
}
.block h4 {
  margin: 1.2rem 0 0.2rem;
  color: var(--brand);
  font-size: 0.85rem;
}
.block p,
.foot {
  font-size: 0.87rem;
  color: var(--muted);
  margin: 0.35rem 0 0.8rem;
}
.block p:last-child {
  margin-bottom: 0;
}
.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, 125px);
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #eeebf1;
}
.field:last-child {
  border: 0;
}
.field label {
  font-size: 0.86rem;
}
.field label small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}
input[type="text"] {
  min-width: 0;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #bcb2c8;
  border-radius: 6px;
  color: var(--ink);
  background: white;
  text-align: right;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}
input[aria-invalid="true"] {
  border: 2px solid var(--bad);
  background: #fff5f4;
}
.error {
  grid-column: 1/-1;
  font-size: 0.78rem;
  color: var(--bad);
  margin: 0;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand);
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}
.choose {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.87rem;
}
.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.line {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
legend {
  font-weight: 600;
  margin-bottom: 8px;
}
.pill {
  display: inline-block;
  background: var(--soft);
  border: 0;
  color: #592a86;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  table-layout: fixed;
}
td,
th {
  text-align: right;
  border-bottom: 1px solid #e8e4ed;
  padding: 8px 5px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
td:first-child,
th:first-child {
  text-align: left;
  width: 42%;
}
th {
  font-size: 0.8rem;
}
tbody th {
  font-weight: 400;
}
.total {
  font-weight: 600;
  background: var(--soft);
}
.total th {
  font-weight: 600;
}
.supp {
  color: var(--muted);
  font-size: 0.85rem;
}
.positive {
  color: var(--green);
}
.gapstate {
  color: var(--bad);
  font-size: 0.84rem;
  font-weight: 600;
}
.foot {
  padding: 4px 0 36px;
}
details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
}
details p {
  max-width: 85ch;
}
.printsection {
  display: none;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 720px) {
  .hero {
    padding-top: 27px;
  }
  .mast {
    min-height: 65px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .metric + .metric {
    padding-left: 12px;
  }
  .metric:last-child {
    border: 0;
    padding: 10px 0 0;
    grid-column: 1/-1;
    border-top: 1px solid #ffffff3b;
  }
  .grid2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .result,
  .block {
    border-radius: 10px;
  }
  .brand {
    gap: 9px;
  }
  .brand span {
    padding-left: 9px;
  }
  .actions {
    gap: 4px;
  }
  .quiet {
    padding: 0.45rem 0.6rem;
  }
  td,
  th {
    padding: 8px 3px;
  }
}
@media (max-width: 460px) {
  .brand span {
    display: none;
  }
  .hero p {
    font-size: 0.92rem;
  }
  .logo img {
    width: 82px;
  }
  .tabs button {
    font-size: 0.8rem;
    padding: 0.5rem 0.65rem;
  }
  .field {
    grid-template-columns: minmax(0, 1fr) 91px;
  }
  .wrap {
    padding: 0 12px;
  }
  .block {
    padding: 14px;
  }
  .result {
    padding: 16px;
  }
  .metric .lbl {
    font-size: 0.76rem;
  }
  table {
    font-size: 0.77rem;
  }
}
@media print {
  #example, #scenario-note { display: none; }
  @page {
    size: A4;
    margin: 14mm;
  }
  html,
  body {
    background: white;
  }
  .wrap {
    max-width: none;
    padding: 0;
  }
  .actions,
  .tabs,
  .pill,
  .foot,
  .hero p {
    display: none;
  }
  .hero {
    padding: 12px 0;
  }
  .hero h1 {
    font-size: 21pt;
  }
  .mast {
    min-height: 30px;
  }
  .panel[hidden] {
    display: block !important;
  }
  .result {
    background: #eee9f4 !important;
    color: #22182e;
    padding: 12px;
    border: 1px solid #ccc;
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .result h2,
  .metric strong,
  .metric:last-child strong,
  .metric .lbl,
  .metric small,
  .result p {
    color: #22182e;
  }
  .cards {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 8px;
  }
  .metric:last-child {
    grid-column: auto;
    border: 0;
    padding: 0;
  }
  .grid2 {
    display: block;
  }
  .block {
    break-inside: avoid;
    margin-bottom: 8px !important;
    padding: 10px;
  }
  .field {
    grid-template-columns: 1fr 100px;
    padding: 2px 0;
  }
  .field label,
  .field small,
  table {
    font-size: 9pt;
  }
  .panel + .panel {
    break-before: page;
  }
  input[type="text"] {
    font-size: 9pt;
    padding: 2px;
  }
  .printsection {
    display: block;
  }
}
.logo:focus-visible {
  outline: 3px solid #6638a4;
}
