.spend-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.spend-header h1 { margin: 0 0 8px; color: var(--text-primary); font-size: clamp(28px, 3vw, 36px); letter-spacing: -.8px; }
.spend-header p { max-width: 70ch; }
.spend-planner-layout { display: grid; grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr); gap: 16px; align-items: start; }
.spend-form, .spend-results, .spend-saved { padding: clamp(17px, 2.4vw, 24px); }
.spend-form { display: grid; gap: 14px; }
.spend-form > label:first-of-type input, .spend-form > label:nth-of-type(2) input { min-height: 48px; font-size: 17px; }
.spend-form input:focus-visible, .spend-form select:focus-visible, .spend-more-details summary:focus-visible { outline: 3px solid #226452; outline-offset: 2px; }
.spend-more-details { padding-top: 12px; border-top: 1px solid var(--border); }
.spend-more-details > summary { cursor: pointer; color: #185b48; font-size: 14px; font-weight: 700; }
.spend-more-fields { display: grid; gap: 14px; padding-top: 14px; }
.spend-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.spend-section-heading h2 { margin: 0; color: var(--text-primary); font-size: 19px; }
#spend-result-content { display: grid; gap: 14px; margin-top: 14px; }
#spend-result-content > * { margin: 0; }
#spend-result-content > p { color: #3e5061; font-size: 13px; line-height: 1.6; }
.spend-form > label, .spend-installment-fields > label { display: grid; gap: 6px; color: var(--text-primary); font-size: 13px; font-weight: 650; }
.spend-form input, .spend-form select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-primary, #fff); color: var(--text-primary); font: inherit; }
.spend-form small, .spend-form-note, .spend-installment-fields > small { color: var(--text-secondary); font-size: 12px; font-weight: 400; line-height: 1.5; }
.spend-installment-fields { display: grid; gap: 12px; padding: 14px; border: 1px solid #d6e5dc; border-radius: 12px; background: #f5faf6; }
.spend-installment-fields > p { margin: 0; color: #355a4e; font-size: 12px; line-height: 1.5; }
.spend-form-note { margin: 0; }
.spend-results { min-width: 0; }
.spend-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 14px; }
.spend-result-card { display: grid; align-content: start; gap: 7px; min-width: 0; padding: 14px; border: 1px solid #cfe2d7; border-radius: 12px; background: #f3faf5; }
.spend-result-card.is-unknown { border-color: #dfe5e1; background: #f8faf8; }
.spend-result-card h3 { margin: 0; color: #355a4e; font-size: 13px; }
.spend-result-card strong { color: #1d5e49; font-size: clamp(24px, 3vw, 32px); font-variant-numeric: tabular-nums; }
.spend-result-card p, .spend-result-card small { margin: 0; color: #52637a; font-size: 12px; line-height: 1.5; }
.spend-saved { display: grid; gap: 14px; margin-top: 16px; }
.spend-saved > div:first-child p:not(.eyebrow) { max-width: 70ch; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.spend-saved ul { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.spend-saved li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.spend-saved-load { display: grid; gap: 3px; min-width: 0; padding: 0; border: 0; background: none; color: var(--text-primary); text-align: left; cursor: pointer; }
.spend-saved-load strong { overflow-wrap: anywhere; }
.spend-saved-load span, .spend-empty { color: var(--text-secondary); font-size: 12px; }
.spend-remove { flex: none; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-secondary); cursor: pointer; }
.spend-saved-load:focus-visible, .spend-remove:focus-visible { outline: 3px solid #226452; outline-offset: 3px; }
.spend-loading, .spend-error { padding: 24px; }
.spend-error h2 { margin-top: 0; }

@media (max-width: 850px) {
  .spend-planner-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .spend-header { flex-direction: column; }
  .spend-header > .btn { width: 100%; }
  .spend-result-grid { grid-template-columns: minmax(0, 1fr); }
}
.spend-verdict { padding: 20px; margin: 0; border: 1px solid #d8dfe4; border-radius: 14px; background: #f4f6f8; }
.spend-verdict h3 { margin: 0 0 8px; font-size: 24px; line-height: 1.25; }
.spend-verdict p { margin: 0; font-size: 14px; line-height: 1.6; }
.spend-verdict p + p { margin-top: 8px; }
.spend-verdict.is-go { background: #edf8f1; border-color: #b6d9c4; color: #185b48; }
.spend-verdict.is-wait, .spend-verdict.is-conditional { background: #fff8ec; border-color: #e7d2ac; color: #77511d; }
.spend-verdict.is-no { background: #fff0ef; border-color: #e4b9b6; color: #962e36; }
.spend-deal { padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.spend-deal label { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; }
.spend-form .spend-checkbox { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.spend-checkbox input { width: 18px; min-height: 18px; flex: none; }
.spend-deal summary { cursor: pointer; font-size: 13px; font-weight: 650; }

.purchase-check { grid-template-columns: minmax(0, .8fr) minmax(0, 1.45fr); }
.purchase-check .spend-form { gap: 20px; min-width: 0; }
.purchase-check fieldset { display: grid; gap: 9px; min-width: 0; padding: 0; margin: 0; border: 0; }
.purchase-check legend { margin-bottom: 8px; padding: 0; color: var(--text-primary); font-size: 15px; font-weight: 750; }
.purchase-check label:not(.spend-checkbox) { display: grid; min-width: 0; gap: 5px; font-size: 13px; font-weight: 650; }
.purchase-check [hidden] { display: none !important; }
.check-price-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; }
.check-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.purchase-check .check-choices label { display: flex; align-items: center; gap: 5px; padding: 8px 10px; min-height: 38px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.purchase-check .check-choices label:has(:checked) { color: #185b48; background: #edf8f1; border-color: #9dc8b2; }
.purchase-check input[type="radio"] { width: auto; min-height: 0; padding: 0; accent-color: #226452; }
#check-status { margin-top: 8px; }
.check-hours { margin-top: 8px !important; font-size: 1.22rem; }
.check-section { border-top: 1px solid var(--border); padding-top: 14px; min-width: 0; color: var(--text-primary); }
.check-section h3 { margin: 0; font-size: 16px; }
.check-section p, .check-options li, .check-notes li { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.check-section p { margin: 6px 0; color: var(--text-secondary); }
.check-dates { display: flex; gap: 8px; overflow-x: auto; padding: 4px 3px 8px; }
.check-date { flex: 0 0 auto; display: grid; justify-items: start; align-content: start; gap: 5px; min-height: 61px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-primary, #fff); color: var(--text-primary); text-align: left; cursor: pointer; }
.check-date[aria-pressed="true"] { border-color: #226452; box-shadow: inset 0 0 0 1px #226452; }
.check-tag { display: inline-block; border-radius: 8px; padding: 2px 6px; font-size: 11px; font-weight: 700; background: #edf0f3; color: #374557; }
.check-safe { background: #e6f4ea; color: #185b48; }
.check-runs_short { background: #ffeee1; color: #873e13; }
.check-blocked { background: #ffe8e9; color: #962e36; }
.check-no_worse { background: #edf0f3; color: #374557; }
.check-uses_goal_money { background: #f0eafa; color: #56357b; }
.check-best { color: #185b48; font-size: 11px; font-weight: 700; }
.check-chart svg { display: block; width: 100%; height: clamp(130px, 22vw, 190px); background: #f7faf9; border-radius: 8px; }
.check-chart svg :is(line, polyline, circle) { vector-effect: non-scaling-stroke; }
.check-without, .check-with { fill: none; stroke-width: 2; }
.check-without { stroke: #476d9f; }
.check-with { stroke: #187058; }
.check-spendable-without, .check-spendable-with { fill: none; stroke-width: 1.5; stroke-dasharray: 4 3; }
.check-spendable-without { stroke: #8a67a5; }
.check-spendable-with { stroke: #b05b37; }
.check-zero { stroke: #78878e; }
.check-marker { stroke: #7154a4; stroke-dasharray: 3 2; }
.check-cursor { stroke: #182b36; opacity: .4; }
.check-payday { fill: #476d9f; }
.check-red { fill: #f7d9de; }
.check-axis, .check-legend { display: flex; gap: 6px 12px; color: var(--text-secondary); font-size: 11px; }
.check-axis { justify-content: space-between; margin-top: 3px; }
.check-legend { flex-wrap: wrap; list-style: none; padding: 0; }
.check-legend li::before { content: ''; display: inline-block; width: 12px; margin-right: 4px; vertical-align: middle; border-top: 2px solid; }
.check-legend .legend-without::before { border-color: #476d9f; }
.check-legend .legend-with::before { border-color: #187058; }
.check-legend .legend-spendable-without::before { border-color: #8a67a5; border-style: dashed; }
.check-legend .legend-spendable-with::before { border-color: #b05b37; border-style: dashed; }
.check-legend .legend-red::before { border: 0; height: 7px; background: #f7d9de; }
.check-legend .legend-payday::before { border: 0; width: 6px; height: 6px; border-radius: 50%; background: #476d9f; }
.check-legend .legend-marker::before { border-color: #7154a4; }
.check-inspector { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 12px; }
.check-inspector input { flex: 1; min-width: 0; accent-color: #226452; }
.check-tooltip { display: grid; gap: 12px; margin: 16px 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-secondary); }
.check-tooltip > strong { font-size: 14px; }
.check-tooltip > ul { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.6; }
.check-tooltip .check-numbers { margin: 0; }
.check-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; margin: 16px 0; }
.check-numbers > div, .check-options > li { padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-primary, #fff); }
.check-numbers > div { display: grid; align-content: start; gap: 12px; min-width: 0; padding: 16px; }
.check-numbers dt { margin: 0; font-size: 13px; font-weight: 750; line-height: 1.5; }
.check-numbers dd { display: grid; gap: 10px; margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.check-comparison { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: baseline; gap: 12px; }
.check-comparison > span { color: var(--text-secondary); font-size: 12px; }
.check-comparison > b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.check-comparison.is-with > b { font-weight: 750; }
.check-options, .check-notes { display: grid; gap: 8px; }
.check-options { list-style: none; padding: 0; }
.check-options ul, .check-notes { padding-inline-start: 18px; }
.check-options ul { margin-top: 6px; }
.check-options button[aria-pressed="true"] { border-color: #226452; color: #185b48; }
.check-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.check-actions a { font-size: 13px; font-weight: 700; }
@media (max-width: 940px) { .purchase-check { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .purchase-check .spend-verdict { padding: 14px; } }
