/* Budget planner (tools/budget-planner.html). Frame: tool-frame.css + tools/kit.css. */

.bp-figure { font-size: clamp(64px, 8vw, 112px); letter-spacing: -0.04em; margin-top: 14px; }
.bp-summary { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.bp-summary .tf-subs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .bp-figure { font-size: clamp(56px, 18vw, 96px); } }

/* The ribbon: one stacked bar of the whole month (hero visual, on the stage) */
.bp-ribbon { margin: clamp(48px, 6vw, 72px) 0 0; padding: clamp(24px, 3vw, 40px); background: var(--stage-2); border: 1px solid var(--hair-stage); border-radius: var(--r-panel); }
.bp-ribbon-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; }
.bp-ribbon-title { font: 400 clamp(22px, 2vw, 28px)/1.2 var(--font-display); letter-spacing: -0.015em; color: var(--parchment); }
.bp-ribbon-title span { font-variant-numeric: tabular-nums; }
.bp-view button { min-height: 44px; }

.bp-bar-wrap { position: relative; padding-top: 26px; }
.bp-bar { display: flex; gap: 2px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--stage-3); }
.bp-seg { --a: .6; position: relative; flex: 0 1 auto; min-width: 0; height: 100%; background: rgba(236, 230, 216, var(--a)); overflow: hidden; display: flex; align-items: flex-end; }
.bp-seg--hatch { background: repeating-linear-gradient(135deg, rgba(236, 230, 216, .72) 0 2px, rgba(236, 230, 216, .12) 2px 6px); }
.bp-seg--outline { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(236, 230, 216, .7); }
.bp-seg--left { background: var(--kesef); }
.bp-seg-l { display: block; padding: 0 10px 10px; font: 500 12.5px/1.15 var(--font-sans); color: var(--stage); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-seg-l b { display: block; font: 400 18px/1.1 var(--font-sans); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.bp-seg--outline .bp-seg-l, .bp-seg--hatch .bp-seg-l { color: var(--parchment); }
.bp-seg--hatch .bp-seg-l { background: var(--stage-2); border-radius: 4px; margin: 0 6px 6px; padding: 4px 6px; }
.bp-seg--dim .bp-seg-l { color: var(--parchment); }
.bp-marks { position: absolute; inset: 0; pointer-events: none; }
.bp-mark { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed rgba(236, 230, 216, .7); }
.bp-mark i { position: absolute; top: 0; left: 6px; font: 400 12px/1 var(--font-mono); font-style: normal; color: var(--parchment-2); white-space: nowrap; }
.bp-mark--left { border-left: 0; }
.bp-mark--left i { left: auto; right: 0; top: 2px; color: var(--kesef); font: 500 13px/1 var(--font-sans); }
.bp-mark--income { border-left: 2px solid var(--parchment); }
.bp-mark--income i { left: auto; right: 8px; color: var(--parchment); }
.bp-over { position: absolute; top: 26px; bottom: 0; border-radius: 0 10px 10px 0; background: repeating-linear-gradient(135deg, rgba(204, 82, 58, .95) 0 3px, rgba(23, 22, 18, .8) 3px 8px); }

.bp-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--hair-stage); }
.bp-big { min-width: 0; }
.bp-big-n { margin: 0; font: 300 clamp(48px, 5vw, 72px)/1 var(--font-sans); letter-spacing: -0.04em; color: var(--parchment); font-variant-numeric: tabular-nums; }
.bp-big-n span { font-size: .5em; letter-spacing: 0; margin-left: 2px; color: var(--parchment-2); }
.bp-big-l { margin: 12px 0 0; font: 400 clamp(18px, 1.6vw, 22px)/1.25 var(--font-display); color: var(--parchment); }
.bp-big-l span { display: block; margin-top: 6px; font: 400 13.5px/1.4 var(--font-sans); color: var(--parchment-2); }

.bp-legend { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 28px; }
.bp-legend[hidden] { display: none; }
.bp-legend li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hair-stage); font: 400 14px/1.3 var(--font-sans); color: var(--parchment-2); }
.bp-legend li b { margin-left: auto; font-weight: 400; color: var(--parchment); font-variant-numeric: tabular-nums; }
.bp-sw { --a: .6; width: 12px; height: 12px; flex: none; border-radius: 3px; background: rgba(236, 230, 216, var(--a)); }
.bp-sw--hatch { background: repeating-linear-gradient(135deg, rgba(236, 230, 216, .8) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px rgba(236, 230, 216, .5); }
.bp-sw--outline { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(236, 230, 216, .7); }
.bp-ribbon-note { margin: 20px 0 0; font: 400 13.5px/1.5 var(--font-sans); color: var(--parchment-2); max-width: 60em; }

@media (prefers-reduced-motion: no-preference) {
  .bp-seg { transition: width .5s var(--ease); }
  .bp-mark, .bp-over { transition: left .5s var(--ease), width .5s var(--ease); }
}
@media (max-width: 760px) {
  .bp-ribbon { padding: 20px; }
  .bp-bar { height: 52px; }
  .bp-seg-l { padding: 0 6px 7px; font-size: 11px; }
  .bp-seg-l b { font-size: 14px; }
  .bp-top { grid-template-columns: 1fr; gap: 20px; }
  .bp-big { display: grid; grid-template-columns: 96px 1fr; align-items: baseline; gap: 12px; }
  .bp-big-n { font-size: 48px; }
  .bp-big-l { margin: 0; }
  .bp-legend { display: none; }
  .bp-big-n { font-size: 40px; }
}

/* Work area */
.bp-step { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; min-height: 48px; border: 1px solid var(--hair-strong); border-radius: var(--r-chip); background: var(--paper-2); overflow: hidden; }
.bp-step:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--kesef-soft); }
.tf-work .bp-step input:not([type="checkbox"]) { min-height: 46px; border: 0; border-radius: 0; text-align: center; font-size: 18px; background: transparent; width: 100%; padding: 0; box-shadow: none; }
.tf-work .bp-step input:focus { box-shadow: none; }
.bp-step-btn { border: 0; background: var(--paper); color: var(--ink); font: 300 22px/1 var(--font-sans); cursor: pointer; min-height: 46px; }
.bp-step-btn:hover { background: var(--paper-3); }
.bp-step-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.bp-hint { margin-top: 18px; }
#bp-income-note a, .bp-sources a { color: var(--ink); text-underline-offset: 3px; }
.bp-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; padding-top: 8px; }
.bp-cats .tk-field { margin-top: 0; }
@media (max-width: 520px) { .bp-cats { grid-template-columns: 1fr; } }
.bp-saved-field { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--hair); }
.bp-cats-note { margin-top: 18px; line-height: 1.6; }
.bp-cats-note .tk-reset { padding: 0; }

/* Per paycheck view (v3.2) */
.bp-per { margin-top: 24px; }
.bp-per-l { margin: 0 0 10px; font: 500 13px/1.3 var(--font-sans); color: var(--ink-2); }
.bp-per-seg { display: flex; flex-wrap: wrap; width: 100%; border-radius: 18px; }
.bp-per-seg button { flex: 1 1 auto; min-height: 44px; padding: 0 12px; font-size: 13.5px; }
.bp-per-note { margin-top: 10px; line-height: 1.55; }
.bp-rows > div { padding: 10px 0; }
.bp-rows dd { white-space: nowrap; }
.bp-pc { display: inline-block; min-width: 3.2em; margin-left: 8px; font-size: 13px; color: var(--ink-2); text-align: right; }
.bp-rows .bp-rows-sum dt { color: var(--ink); font-weight: 500; }
.bp-status:empty { display: none; }
.bp-status { margin-top: 12px; }
.tf-down.tf-result { color: var(--down); }
[hidden] { display: none !important; }

@media print {
  #site-header, footer, .tf-related, .tk-guide, .tf-actions, .ks-reassure, .tk-actions, #bp-form, .bp-view, .kc-verdict__save, .kc-verdict__next { display: none !important; }
  .tf-hero { padding: 24px 0 !important; }
  .tf-work { padding: 0 !important; }
  .tk-grid { display: block !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
