[hidden] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-padding-top: 48px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #14241e;
  background: #e7eeea;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid #0c6b52;
  outline-offset: 2px;
}

.site-header {
  height: 48px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  background: #10241c;
  color: #f3faf6;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  min-width: 0;
}

.mark {
  display: block;
  flex: none;
}

.lang-menu {
  position: relative;
  flex: none;
}

.lang-menu summary {
  list-style: none;
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu:not([open]) > ul {
  display: none;
}

.lang-menu[open] > ul {
  display: block;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  min-width: 148px;
  background: #ffffff;
  color: #14241e;
  border: 1px solid #d5e2dc;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(16, 36, 28, 0.14);
}

.lang-menu a {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}

.lang-menu a[aria-current="page"] {
  background: #e5f5ef;
  font-weight: 700;
}

.lang-menu a:hover {
  background: #f3f7f5;
}

.first-screen {
  display: grid;
  align-content: start;
  grid-template-rows: 28px minmax(0, 1fr);
  height: calc(100vh - 48px);
  padding: 8px 14px 10px;
  gap: 6px;
}

h1 {
  margin: 0;
  height: 28px;
  font-size: 21px;
  line-height: 28px;
  font-weight: 720;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: #10241c;
}

.studio {
  display: grid;
  grid-template-columns: minmax(460px, 520px) minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  height: 100%;
}

.pane {
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #ffffff;
  border: 1px solid #d5e2dc;
  border-radius: 12px;
}

.pane-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 10px;
  overflow: auto;
}

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

.pane h2,
.compare-title {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4d625a;
  font-weight: 700;
}

#reset-sample,
.pill,
.remove-debt,
#add-debt {
  border: 1px solid #d5e2dc;
  background: #f7fbf9;
  border-radius: 7px;
}

#reset-sample,
.pill {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

#reset-sample:hover,
.pill:hover,
.remove-debt:hover,
#add-debt:hover {
  border-color: #0c6b52;
}

.debt-columns,
.debt-row {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) 74px 58px 74px 28px;
  gap: 4px 6px;
  align-items: center;
}

.debt-columns {
  font-size: 11px;
  line-height: 1.2;
  color: #4d625a;
}

.debt-scroll {
  min-height: 0;
}

.debt-row + .debt-row {
  margin-top: 6px;
}

input[type="text"],
select {
  width: 100%;
  height: 28px;
  border: 1px solid #c9d8d1;
  border-radius: 6px;
  padding: 0 6px;
  background: #ffffff;
  font-size: 13px;
}

input[type="text"]:focus,
select:focus {
  border-color: #0c6b52;
  outline: none;
}

input.is-invalid {
  border-color: #9a3412;
  background: #fff8f4;
}

.remove-debt {
  width: 28px;
  height: 28px;
  padding: 0;
  line-height: 1;
}

#add-debt {
  height: 30px;
  border-style: dashed;
  color: #0c6b52;
  font-weight: 700;
}

#add-debt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.extra-block,
.currency-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.extra-label,
.currency-line > span,
.field-hint,
.privacy-note,
.export-hint {
  margin: 0;
  color: #4d625a;
  font-size: 12px;
  line-height: 1.35;
}

.extra-label {
  font-weight: 700;
  color: #14241e;
}

.extra-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.money-prefix {
  width: 1.2em;
  font-weight: 700;
  text-align: center;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.currency-line {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.currency-line select {
  width: 72px;
  flex: none;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 12px;
  color: #24352e;
}

.privacy-note {
  margin-top: auto;
}

.pane-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px 10px 10px;
  overflow: hidden;
  background: transparent;
  border: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.strategy-card {
  min-width: 0;
  border: 1px solid #d5e2dc;
  border-radius: 10px;
  background: #ffffff;
  padding: 7px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.strategy-card.is-best {
  background: #e7f6f0;
  border-color: #0c6b52;
}

.strategy-card.is-selected {
  box-shadow: inset 0 0 0 2px #10241c;
}

.select-strategy {
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.card-kicker {
  display: block;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
}

.strategy-card[data-strategy="avalanche"] .card-kicker {
  color: #0f766e;
}

.strategy-card[data-strategy="snowball"] .card-kicker {
  color: #c2410c;
}

.strategy-card[data-strategy="minimum"] .card-kicker {
  color: #3f525b;
}

.card-rule,
.card-static .card-rule {
  display: block;
  font-size: 11px;
  line-height: 1.25;
  color: #4d625a;
  font-weight: 500;
}

.best-badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ffffff;
  color: #0c6b52;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stat,
.first-win {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.stat-label {
  color: #4d625a;
  min-width: 0;
}

.stat strong,
.first-win strong {
  flex: none;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
  text-align: right;
  white-space: nowrap;
}

.stat-interest {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.baseline-note {
  color: #4d625a;
}

.notice,
.banner,
.status-bar,
.row-warning {
  grid-column: 1 / -1;
}

.notice,
.row-warning {
  margin: 0;
  padding: 5px 7px;
  border-radius: 6px;
  background: #fff4ec;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.35;
}

.chart-panel {
  min-height: 0;
  height: 100%;
  background: #ffffff;
  border: 1px solid #d5e2dc;
  border-radius: 12px;
  overflow: hidden;
}

#debt-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.export-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.export-hint {
  min-width: 0;
}

#export-csv {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #0c6b52;
  color: #ffffff;
  font-weight: 700;
}

#export-csv:hover {
  background: #0a5a45;
}

.below {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px 4px;
}

.below h2 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: #10241c;
}

.lede,
.method p,
.faq-list p,
.partner-card p,
.partners-intro {
  margin: 0 0 8px;
  color: #24352e;
}

.panel-card {
  background: #ffffff;
  border: 1px solid #d5e2dc;
  border-radius: 12px;
  padding: 12px;
}

.strategy-switch {
  display: inline-flex;
  margin: 8px 0;
  border: 1px solid #d5e2dc;
  border-radius: 8px;
  overflow: hidden;
}

.strategy-switch button {
  appearance: none;
  border: 0;
  background: #ffffff;
  padding: 6px 12px;
}

.strategy-switch button[aria-pressed="true"] {
  background: #10241c;
  color: #ffffff;
}

.order-list {
  margin: 8px 0 12px;
  padding: 0 0 0 18px;
}

.order-list li {
  margin: 4px 0;
}

.schedule-fold {
  background: #ffffff;
  border: 1px solid #d5e2dc;
  border-radius: 10px;
  padding: 8px 10px 10px;
}

.schedule-fold summary {
  cursor: pointer;
  font-weight: 700;
}

.table-scroll {
  overflow: auto;
  max-width: 100%;
  max-height: 460px;
  margin-top: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

caption {
  text-align: left;
  font-weight: 700;
  padding: 4px 8px 8px;
}

th,
td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #e6eeea;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: #f7faf8;
  color: #4d625a;
  font-size: 11px;
  font-weight: 700;
}

tr.is-payoff td {
  background: #f3faf6;
}

.steps {
  margin: 0 0 8px;
  padding-left: 18px;
}

.steps li {
  margin: 4px 0;
}

.faq-list details {
  background: #ffffff;
  border: 1px solid #d5e2dc;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 0;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

.partner-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.partner-card {
  background: #ffffff;
  border: 1px solid #d5e2dc;
  border-radius: 10px;
  padding: 10px 12px;
}

.partner-card a {
  color: #0c6b52;
  font-weight: 750;
}

.disclosure {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ead7a1;
  background: #fff6df;
  color: #3f3420;
  font-size: 14px;
  line-height: 1.45;
}

.missing {
  max-width: 720px;
  margin: 48px auto;
  padding: 8px 16px 32px;
}

.missing h1 {
  height: auto;
  white-space: normal;
  font-size: 28px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.missing a {
  color: #0c6b52;
  font-weight: 700;
}

.site-footer {
  padding: 8px 14px 12px;
  color: #4d625a;
  font-size: 12px;
  line-height: 18px;
}

.site-footer p {
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
}

.visually-hidden {
  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: 1100px) {
  .first-screen {
    height: auto;
  }

  .studio {
    grid-template-columns: 1fr;
    height: auto;
  }

  .pane-inputs,
  .pane-results {
    height: auto;
    overflow: visible;
  }

  .chart-panel {
    height: 300px;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .first-screen {
    grid-template-rows: auto minmax(0, 1fr);
    padding: 10px 10px 16px;
  }

  h1 {
    height: auto;
    white-space: normal;
    font-size: 22px;
    line-height: 1.25;
  }

  .partner-list {
    grid-template-columns: 1fr;
  }

  .currency-line {
    flex-wrap: wrap;
  }

  .check-line {
    margin-left: 0;
  }

  input[type="text"],
  select,
  #add-debt,
  #export-csv,
  .pill,
  #reset-sample {
    font-size: 16px;
  }

  .export-row {
    align-items: stretch;
    flex-direction: column;
  }
}

input[type="checkbox"] {
  width: auto;
}
