.st-wrap {
  color: var(--ink);
  display: grid;
  gap: 20px;
  font-variant-numeric: tabular-nums;
}
.st-wrap [hidden] { display: none !important; }
.st-wrap h2, .st-wrap h3, .st-wrap p, .st-wrap dl, .st-wrap dd { margin: 0; }
.st-wrap h2, .st-wrap h3 { color: var(--ink); font-family: inherit; font-weight: 600; }
.st-wrap h2 { font-size: clamp(1.45rem, 2.2vw, 2rem); line-height: 1.15; letter-spacing: -.045em; }
.st-wrap h3 { font-size: 1.15rem; line-height: 1.25; letter-spacing: -.025em; }
.st-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.st-event, .st-section { border: 1px solid var(--line); background: var(--card); border-radius: 18px; }
.st-event { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); overflow: hidden; }
.st-event-form, .st-allocation, .st-section { padding: clamp(20px, 2.6vw, 36px); }
.st-allocation { background: #eaf3ea; color: var(--ink); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.st-event-form h2 { margin-bottom: 20px; }
.st-event:not(.st-recurring):has(.st-allocation[hidden]) { grid-template-columns: minmax(0, 1fr); }
.st-event:not(.st-recurring):has(.st-allocation[hidden]) .st-event-form { width: 100%; max-width: 760px; }
.st-event.st-recurring {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(12px, 1.55vw, 22px);
  align-items: start;
  background: transparent;
  border: 0;
  overflow: visible;
}
.st-recurring > .st-event-form, .st-recurring > .st-allocation, .st-allocation-empty {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.st-recurring > .st-event-form { background: var(--card); }
.st-recurring > .st-allocation, .st-allocation-empty {
  justify-content: flex-start;
  background: #eaf3ea;
  border-color: #d3e2d5;
}
.st-recurring .st-section-label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.st-recurring #st-allocation-title { color: var(--forest); font-weight: 600; }
.st-recurring #st-allocation-date { font-size: .86rem; color: #4a6654; white-space: nowrap; }
.st-recurring .st-amount { color: var(--forest); }
.st-allocation-empty { padding: clamp(20px, 2.6vw, 36px); }
.st-allocation-empty .st-quiet { margin-top: 8px; max-width: 45ch; }
@media (min-width:760px) and (min-height:640px) {
  .st-recurring > .st-allocation, .st-allocation-empty { position: sticky; top: 16px; }
}
@media (max-width:759px) {
  .st-event.st-recurring { grid-template-columns: minmax(0, 1fr); }
  .st-recurring > .st-event-form, .st-recurring > .st-allocation, .st-allocation-empty { border-radius: 13px; }
}
@media (max-width:420px) {
  .st-kind { display: flex; width: 100%; }
  .st-choices.st-kind span { white-space: normal; padding-inline: 5px; text-align: center; }
}
.st-section-label { font-size: .95rem; }
.st-amount { display: block; font-size: clamp(2.1rem, 3.8vw, 3.6rem); font-weight: 550; line-height: 1.1; letter-spacing: -.055em; padding: 8px 0 17px; }
.st-split { display: flex; overflow: hidden; background: #d3e2d4; height: 11px; border-radius: 3px; margin-bottom: 14px; }
.st-split i, .st-peach { background: var(--apricot); }
.st-split b, .st-emerald { background: var(--green); }
.st-breakdown { display: grid; gap: 7px; }
.st-closing-debits { padding-bottom: 15px; }
.st-breakdown > div, .st-breakdown dt { display: flex; align-items: baseline; gap: 8px; }
.st-breakdown > div { justify-content: space-between; font-size: .95rem; }
.st-breakdown dt { align-items: center; }
.st-breakdown dd { flex: 0 0 auto; font-weight: 600; }
.st-breakdown .st-remaining { border-top: 1px solid #cbdccc; padding-top: 8px; margin-top: 3px; }
.st-dot { display: inline-block; flex: 0 0 9px; height: 9px; border-radius: 2px; }
.st-wrap .st-quiet { font-size: .875rem; line-height: 1.5; color: var(--muted); }
.st-daily-impact { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 16px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #cbdccc; }
.st-daily-impact > span { flex: 1 1 100%; color: var(--ink); font-size: .9rem; font-weight: 550; }
.st-daily-impact div { display: flex; align-items: baseline; gap: 5px; font-size: .84rem; }
.st-daily-impact div span { color: var(--muted); }
.st-daily-impact strong { font-weight: 600; white-space: nowrap; }
.st-daily-impact + p, .st-fields + p { padding-top: 14px; }
.st-wrap .st-error { color: #983f24; font-size: .95rem; padding-top: 10px; }
.st-choices { padding: 3px; margin: 0; border: 1px solid var(--line); background: var(--paper); border-radius: 9px; display: inline-flex; min-width: 0; align-self: flex-start; }
.st-choices label { display: flex; position: relative; flex: 1 1 auto; margin: 0; cursor: pointer; }
.st-choices input { position: absolute; opacity: 0; height: 1px; width: 1px; }
.st-choices span { display: grid; place-items: center; flex: 1; padding: 7px 12px; min-height: 32px; border-radius: 6px; font-size: .875rem; line-height: 1.2; white-space: nowrap; font-weight: 500; color: var(--muted); }
.st-choices label:hover span { color: var(--ink); }
.st-choices input:checked + span { background: var(--green); color: #fff; }
.st-choices input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; z-index: 1; }
.st-fields, .st-income-inputs { display: grid; gap: 14px; }
.st-fields { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); margin-top: 22px; }
.st-field { display: flex; flex-flow: column; gap: 8px; color: var(--muted); font-weight: 550; font-size: .875rem; line-height: 1.35; min-width: 0; }
.st-input { display: flex; align-items: center; gap: 8px; color: var(--muted); background: var(--card); border: 1px solid #becdc3; border-radius: 8px; min-height: 44px; padding: 0 12px; }
.st-input:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.st-input input { min-width: 0; width: 100%; max-width: 100%; min-height: 0; padding: 8px 0; margin: 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: transparent; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 550; line-height: 1.4; }
.st-input input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.st-input input::-webkit-outer-spin-button, .st-input input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.st-input input[type=date] { appearance: none; }
.st-input input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
#st-results { display: grid; gap: 20px; min-width: 0; }
.st-section { min-width: 0; }
.st-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.st-section-head > div { flex: 1 1 280px; }
.st-section-head p { margin: 9px 0 0; color: var(--muted); line-height: 1.55; font-size: 1rem; max-width: 66ch; }
.st-table-wrap { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .95rem; }
.st-table th, .st-table td { border: 0; padding: 13px 15px; text-align: right; vertical-align: middle; font-weight: 500; overflow-wrap: anywhere; }
.st-table th:first-child { width: 40%; text-align: left; }
.st-table thead th { background: var(--paper); color: var(--ink); font-weight: 600; }
.st-table thead th:first-child { border-radius: 7px 0 0 7px; color: var(--muted); }
.st-table thead th:last-child { border-radius: 0 7px 7px 0; }
.st-table tbody th { color: var(--muted); font-weight: 400; }
.st-table tbody tr + tr > * { border-top: 1px solid var(--line); }
.st-observation { display: flex; align-items: flex-start; gap: 12px; border-radius: 9px; padding: 13px 15px; margin-top: 15px; background: #edf4ed; }
.st-equals { font-size: 1.3rem; line-height: 1.15; font-weight: 600; color: var(--green); flex: 0 0 18px; }
.st-observation p { font-size: .95rem; line-height: 1.45; }
.st-debt-figure { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.st-debt-head, .st-debt-legend { display: flex; align-items: center; flex-wrap: wrap; }
.st-debt-head { justify-content: space-between; gap: 8px 18px; }
.st-debt-legend { gap: 6px 16px; }
.st-debt-legend span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .82rem; }
.st-debt-key { display: inline-block; flex: 0 0 20px; width: 20px; border-top: 3px solid var(--green); }
.st-debt-key.st-debt-alt { border-color: #9c5d28; border-top-style: dashed; }
#st-debt-plot { width: 100%; margin-top: 8px; }
#st-debt-plot svg { display: block; }
#st-debt-plot text { font-size: 12px; fill: var(--muted); }
.st-debt-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.st-debt-marker { stroke: #63796d; stroke-width: 1.25; stroke-dasharray: 2 3; }
.st-debt-line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linejoin: round; }
.st-debt-secondary { stroke: #9c5d28; stroke-dasharray: 6 4; stroke-width: 2.5; }
.st-debt-figure figcaption { margin-top: 6px; }
.st-econ-grid { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(0, 2fr); gap: clamp(20px, 3.5vw, 56px); }
.st-econ-settings { max-width: 310px; }
.st-econ-settings p { margin-top: 10px; }
.st-chart-head { align-items: center; margin-bottom: 16px; gap: 12px; }
.st-small span { font-size: .82rem; padding: 5px 8px; min-height: 27px; }
.st-bars { display: grid; gap: 14px; }
.st-bar-row > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .94rem; }
.st-bar-row strong { text-align: right; font-weight: 600; }
.st-track { margin-top: 6px; height: 9px; border-radius: 2px; overflow: hidden; background: #edf2eb; }
.st-track i { display: block; height: 100%; background: var(--green); }
.st-track .st-secondary-bar { background: #8fae99; }
.st-cost .st-quiet { margin-top: 12px; }
.st-income { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.st-income-inputs { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.15fr); align-items: end; }
.st-month-field { display: grid; grid-template-columns: auto 1fr; align-items: baseline; }
.st-month-field output { font-weight: 600; color: var(--ink); font-size: .84rem; text-align: right; overflow-wrap: anywhere; }
#st-month { width: 100%; grid-column: 1/-1; display: block; padding: 0; margin: 0; min-height: 44px; accent-color: var(--green); cursor: pointer; }
.st-income-facts { margin: 20px 0 12px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; border-radius: 9px; padding: 16px; background: var(--paper); }
.st-income-facts div { min-width: 0; display: grid; gap: 5px; align-content: start; }
.st-income-facts span, .st-income-facts small { color: var(--muted); font-size: .85rem; }
.st-income-facts strong { font-size: clamp(1.1rem, 2vw, 1.65rem); font-weight: 550; letter-spacing: -.03em; overflow-wrap: anywhere; }
.st-method { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }
.st-method summary { cursor: pointer; color: var(--green); font-size: .92rem; font-weight: 550; width: fit-content; }
.st-method p { font-size: .9rem; line-height: 1.55; margin: 10px 0 0; max-width: 85ch; }
.st-method a { color: var(--green); text-underline-offset: 2px; }
@media (max-width: 800px) {
  .st-econ-grid { grid-template-columns: 1fr 1.65fr; gap: 20px; }
  .st-income-inputs { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .st-month-field { grid-column: 1/-1; }
}
@media (max-width: 690px) {
  .st-event, .st-econ-grid { grid-template-columns: 1fr; }
  .st-event, .st-section { border-radius: 13px; }
  .st-event-form, .st-allocation, .st-section { padding: 18px; }
  .st-section-head { margin-bottom: 17px; gap: 14px; }
  .st-econ-settings { max-width: none; }
  .st-income-facts { padding: 12px; gap: 8px; }
  .st-income-facts span, .st-income-facts small { font-size: .8rem; }
  .st-table th, .st-table td { padding: 10px 6px; font-size: .85rem; }
  .st-table th:first-child { width: 38%; }
  .st-income { margin-top: 22px; padding-top: 20px; }
}
@media (max-width: 360px) {
  .st-choices span { padding-inline: 8px; white-space: normal; }
  .st-income-inputs, .st-income-facts { grid-template-columns: 1fr; }
}
