/* Your Flow kit v1: the planner flow's wedding step (PLANNER-FLOW-05). Styles only .yf-budget-*
   classes, and the shared control classes only as children of its own (section 4.12 rule 2). Every
   colour is a token; the one new fixed token, the rose bloom, is declared here beside the kit's own
   botanical tokens. The one authored motion: a part of the scene that appears draws its strokes in
   (about 400 ms) and its fills follow. Motion off and reduced motion show it already drawn. */

:where(.yf) { --yf-budget-rose: #dbbaba; }

/* ---- the stage: the drawn wedding on dark linen ---- */
.yf-budget-stage { position: relative; display: flex; flex-direction: column; justify-content: flex-end; margin: 0 0 22px; padding: 14px 14px 12px; overflow: hidden; }
.yf-budget-stage--plain { min-height: 0; }
.yf-budget-scene { width: 100%; height: auto; aspect-ratio: 656 / 300; max-height: 300px; }
.yf-budget-caption { margin: 8px 2px 0; font-size: 12px; line-height: 1.4; color: var(--yf-on-stage-muted); }
.yf-budget-placard {
  position: absolute; top: 18px; right: 18px; max-width: 46%; padding: 10px 14px; border-radius: 4px;
  background: var(--yf-plate); color: var(--yf-ink); box-shadow: var(--yf-shadow-card);
}
.yf-budget-placard__names { margin: 0; font-size: 22px; color: var(--yf-ink); overflow-wrap: anywhere; }
.yf-stage .yf-budget-placard__names { color: var(--yf-ink); }
.yf-budget-placard__line { margin: 4px 0 0; font-size: 11.5px; color: var(--yf-muted); }
.yf-budget-glow { opacity: 0.22; }

/* The signature: a part that appears draws in, stroke by stroke, and its fills follow. */
.yf-budget-stroke { stroke-dasharray: 1; stroke-dashoffset: 0; }
.yf:not([data-motion="off"]) .yf-budget-part.is-entering .yf-budget-stroke {
  animation: yf-budget-draw 400ms var(--yf-ease) both, yf-budget-fill 400ms var(--yf-ease) both;
}
.yf:not([data-motion="off"]) .yf-budget-part.is-entering .yf-budget-glow { animation: yf-budget-fade 400ms var(--yf-ease) both; }
@keyframes yf-budget-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes yf-budget-fill { from { fill-opacity: 0; } 40% { fill-opacity: 0; } to { fill-opacity: 1; } }
@keyframes yf-budget-fade { from { opacity: 0; } to { opacity: 0.22; } }
@media (prefers-reduced-motion: reduce) {
  .yf .yf-budget-part.is-entering .yf-budget-stroke, .yf .yf-budget-part.is-entering .yf-budget-glow { animation: none; }
}

/* ---- shared bits: fields, links, the segmented level picker ---- */
.yf-budget-field { margin: 0 0 18px; }
.yf-budget-field > .yf-label { display: block; margin: 0 0 8px; }
.yf-budget-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0; background: none; border: 0;
  color: var(--yf-ink); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.yf-budget-link--quiet { font-weight: 600; color: var(--yf-muted); }
.yf-budget-link:focus-visible, .yf-budget-more:focus-visible { outline: 2px solid var(--yf-focus); outline-offset: 2px; }

.yf-budget-seg { display: flex; margin: 0; padding: 0; border: 0; min-width: 0; }
.yf-budget-seg__option {
  position: relative; flex: 1 1 0; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--yf-line); margin-left: -1px; background: var(--yf-surface); color: var(--yf-ink);
  font-size: 13.5px; font-weight: 600; cursor: pointer; transition: transform var(--yf-dur-1) var(--yf-ease);
}
.yf-budget-seg__option:first-of-type { margin-left: 0; border-radius: var(--yf-radius-control) 0 0 var(--yf-radius-control); }
.yf-budget-seg__option:last-of-type { border-radius: 0 var(--yf-radius-control) var(--yf-radius-control) 0; }
.yf-budget-seg__option:active { transform: scale(0.98); }
.yf-budget-seg__option:has(.yf-budget-seg__input:checked) { z-index: 1; background: var(--yf-action); border-color: var(--yf-action); color: var(--yf-action-ink); font-weight: 700; }
.yf-budget-seg__option:has(.yf-budget-seg__input:focus-visible) { z-index: 2; outline: 2px solid var(--yf-focus); outline-offset: 2px; }
/* The radio stays real and focusable; the segment is what the eye and the finger use. */
.yf-budget-seg__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.yf-budget-seg__label { position: relative; pointer-events: none; }

/* ---- beat 1: what are you working with? ---- */
.yf-budget-guests { margin: 0 0 18px; padding: 4px 16px; border-radius: var(--yf-radius-control); background: var(--yf-ground-2); }
.yf-budget-guests__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; font-size: 15px; color: var(--yf-ink); }
.yf-budget-guests__stepper { padding: 4px 0 12px; }
.yf-budget-money { display: flex; align-items: center; gap: 6px; padding: 0 14px; border: 1.5px solid var(--yf-ink); border-radius: var(--yf-radius-control); background: var(--yf-surface); }
.yf-budget-money:focus-within { outline: 2px solid var(--yf-focus); outline-offset: 2px; }
.yf-budget-money__sign { font-size: 24px; font-weight: 700; color: var(--yf-ink); }
.yf-budget-money .yf-budget-money__input { flex: 1; min-width: 0; min-height: 56px; padding: 0; border: 0; background: transparent; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; outline: none; }
.yf-budget-money--small { padding: 0 10px; max-width: 160px; }
.yf-budget-money--small .yf-budget-money__sign { font-size: 15px; }
.yf-budget-money--small .yf-budget-money__input { min-height: 44px; font-size: 16px; }
.yf-budget-slider { display: block; width: 100%; min-height: 44px; margin: 6px 0 0; accent-color: var(--yf-action); cursor: pointer; }
.yf-budget-hint { margin: 0 0 14px; padding: 14px 16px; border-radius: var(--yf-radius-control); background: var(--yf-ground-2); }
.yf-budget-hint__text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--yf-ink); }
.yf-budget-hint__suggested { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--yf-ink); }
.yf-budget-hint__note { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--yf-muted); }
.yf-budget-suggest { margin: 0 0 8px; }

/* ---- beat 2: build your wedding ---- */
.yf-budget-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.yf-budget-fact { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: 4px; background: var(--yf-ground-2); font-size: 12.5px; color: var(--yf-muted); }
.yf-budget-fact__value { font-weight: 700; color: var(--yf-ink); }
.yf-budget-fact__edit { min-height: 32px; font-size: 12.5px; }

.yf-budget-lines { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--yf-line); }
.yf-budget-lines--optional { border-top: 0; }
.yf-budget-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head amount" "seg seg" "quote quote" "panel panel";
  align-items: center; gap: 10px 12px; padding: 14px 0; border-bottom: 1px solid var(--yf-line);
}
.yf-budget-line__head { grid-area: head; display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.yf-budget-line__icon { flex: none; display: flex; width: 32px; height: 32px; color: var(--yf-ink); }
.yf-budget-icon { width: 32px; height: 32px; }
.yf-budget-line__text { min-width: 0; }
.yf-budget-line__label { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--yf-ink); }
.yf-budget-line__hint { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--yf-muted); }
.yf-budget-line__amount { grid-area: amount; margin: 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--yf-ink); text-align: right; }
.yf-budget-line > .yf-budget-seg { grid-area: seg; }
.yf-budget-line__tools { grid-area: quote; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.yf-budget-disclose, .yf-budget-leave { min-height: 32px; font-size: 13px; font-weight: 600; color: var(--yf-muted); }
.yf-budget-quote { grid-area: panel; display: flex; flex-direction: column; gap: 4px; }
.yf-budget-quote__label { font-size: 13px; color: var(--yf-muted); }
.yf-budget-quote__row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.yf-budget-line.is-out .yf-budget-line__label { color: var(--yf-muted); }
.yf-budget-line__add { grid-area: seg; justify-self: start; width: auto; }
.yf-budget-line--auto { grid-template-areas: "head amount" "tag tag"; }
.yf-budget-tag { grid-area: tag; justify-self: start; padding: 4px 8px; border-radius: 4px; background: var(--yf-ground-2); font-size: 12px; font-weight: 700; color: var(--yf-muted); }
.yf-budget-more {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 0; background: none; border: 0;
  border-bottom: 1px solid var(--yf-line); color: var(--yf-ink); font-size: 14px; font-weight: 700; text-align: left; cursor: pointer;
}
.yf-budget-pricenote { margin: 12px 0 16px; }

/* ---- the sticky total, above the sticky action bar ---- */
.yf-budget-total {
  position: sticky; bottom: var(--yf-budget-lift, 0px); z-index: 3; margin: 8px -20px 0; padding: 14px 20px 12px;
  background: var(--yf-ground); border-top: 1px solid var(--yf-line);
}
.yf-budget-total__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.yf-budget-total__label { margin: 0; font-size: 12.5px; color: var(--yf-muted); }
.yf-budget-total__amount { margin: 2px 0 0; font-family: var(--yf-font-display); font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--yf-ink); }
.yf-budget-total__range--short { display: none; }
.yf-budget-badge, .yf-budget-badge__short { margin: 0; padding: 6px 10px; border-radius: 4px; font-size: 12.5px; font-weight: 700; background: var(--wp-success-soft); color: var(--yf-ok); }
.yf-budget-badge__short { display: none; }
.yf-budget-total[data-verdict="over"] .yf-budget-badge, .yf-budget-total[data-verdict="over"] .yf-budget-badge__short { background: var(--wp-warning-soft); color: var(--yf-warn); }
.yf-budget-meter { position: relative; height: 8px; margin: 12px 0 8px; border-radius: 4px; background: var(--yf-ground-2); overflow: visible; }
.yf-budget-meter__fill {
  position: absolute; inset: 0 auto 0 0; width: calc(var(--yf-budget-fill, 0) * 100%); border-radius: 4px; background: var(--yf-budget-rose);
  transition: width var(--yf-dur-3) var(--yf-ease);
}
.yf-budget-total[data-verdict="over"] .yf-budget-meter__fill { background: var(--yf-food-gold); }
.yf-budget-meter__mark { position: absolute; top: -3px; bottom: -3px; left: calc(var(--yf-budget-mark, 0) * 100%); width: 2px; background: var(--yf-ink); }
.yf-budget-tip { margin: 0; font-size: 12.5px; color: var(--yf-muted); }
.yf[data-motion="off"] .yf-budget-meter__fill { transition: none; }
@media (prefers-reduced-motion: reduce) { .yf .yf-budget-meter__fill { transition: none; } }
@media (max-height: 480px) { .yf-budget-total { position: static; } }

.yf-budget-status { margin: 0 0 14px; }
.yf-budget-fallback { margin: 0 0 14px; }
.yf-budget-fallback:empty { display: none; }
/* A failure line, and a focused control, scroll in clear of the sticky total and action bar. */
.yf-budget-status, .yf-budget-fallback, .yf-budget-seg__input, .yf-budget-money__input, .yf-budget-link { scroll-margin-bottom: 260px; }

/* ---- phones: each line stacks, its picker full width; the total goes short ---- */
@container yf (max-width: 519px) {
  .yf-budget-placard { display: none; }
  .yf-budget-total__range { display: none; }
  .yf-budget-total__range--short { display: inline; }
  .yf-budget-badge { display: none; }
  .yf-budget-total .yf-budget-badge__short { display: inline-block; }
  .yf-budget-total__amount { font-size: 22px; }
}
@container yf (min-width: 640px) {
  .yf-budget-line { grid-template-columns: minmax(0, 1fr) minmax(220px, 260px) 84px; grid-template-areas: "head seg amount" "quote quote quote" "panel panel panel"; }
  .yf-budget-line--auto { grid-template-areas: "head tag amount"; }
  .yf-budget-tag { justify-self: end; }
  .yf-budget-line__add { justify-self: end; }
}

@media (forced-colors: active) {
  .yf-budget-seg__option { border: 1.5px solid ButtonText; }
  .yf-budget-seg__option:has(.yf-budget-seg__input:checked) { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}
