/* density: budget — merged into lists-density.css before commit */

/* budget-1: (retired) the Unused budget card is one of the three summary
   cards now; see sheet-budget-1 at the end. */

/* budget-2: the statement actions, a row of word-sized buttons. */
.review-cash-actions{gap:6px;margin:12px 0 4px}
.review-cash-actions .btn{flex:0 0 auto;padding:0 12px}
@media (max-width:720px){.review-cash-actions .btn{flex:1 1 auto}}

/* budget-3: the petty cash card in the same type size as its neighbours. */
.review-cash-card{font-size:13px}
.review-cash-card .review-notice{padding:8px 12px;font-size:12.5px;line-height:1.4;margin:6px 0 4px}
/* The statement's note is a plain grey panel with no mark down its left edge
   at all (queue.css draws a short round-ended bar on .review-notice; beside
   the rounded cards it read as a stray "{"). The cash forms opened from the
   statement drop it too. */
.review-cash-card .review-notice,.modal-bd.review-form .review-notice{border-left:0;border:1px solid var(--sag-line);
  border-radius:var(--sag-r,8px);background:var(--sag-app);color:var(--sag-text-2);padding:8px 12px;box-shadow:none}
.review-cash-card .review-notice::before,.modal-bd.review-form .review-notice::before{content:none;display:none}
.review-cash-card .hint{font-size:12px;line-height:1.4;margin:4px 0}
.review-cash-figures{gap:2px;margin:10px 0}
@media (pointer:fine){.review-cash-card summary{min-height:0;padding:8px 0;font-size:12.5px;font-weight:700}}

/* budget-4: a month with nothing sent has one column, full width like the
   cards around it (its figures go into two columns below, so the labels and
   amounts never sit 650px apart). */
.bgt-split.one{grid-template-columns:minmax(0,1fr)}

/* budget-5: sortable headers on the month's request table; shorter rows with a mouse. */
.bgt-list th[aria-sort]{padding:0}
.bgt-list th[aria-sort] .admin-sort{padding:4px 10px 8px;letter-spacing:inherit;text-transform:inherit;font-weight:inherit;border-radius:6px 6px 0 0}
.bgt-list th.num .admin-sort{justify-content:flex-end}
@media (pointer:fine){.bgt-list td{padding:6px 10px}}

/* budget-6: review forms (cash movement, monthly check, rules) in two columns. */
@media (pointer:fine) and (min-width:700px){
  .modal-bd.review-form{display:grid;grid-template-columns:1fr 1fr;column-gap:14px;align-content:start}
  .modal-bd.review-form>:not(.review-field){grid-column:1/-1}
  .modal-bd.review-form>.review-field:only-of-type,
  .modal-bd.review-form>.review-field:has(input[type=checkbox]){grid-column:1/-1}
  .modal-bd.review-form>details>.review-field{display:inline-grid;width:calc(50% - 7px);vertical-align:top}
  .modal-bd.review-form>details>.review-field:nth-of-type(odd){margin-right:14px}
  .modal-bd.review-form>details>.review-field:has(input[type=checkbox]){width:100%;margin-right:0}
  .modal .review-field{margin:6px 0;gap:4px;font-size:13px}
  .modal .review-field input:not([type=checkbox]),.modal .review-field select{padding:6px 10px;min-height:34px}
}

/* budget-8: the chart, shorter, with a caption the size of the other captions. */
.bgt-chart-view{--bg-plot:110px}
.bgt-chart-view .hint{font-size:11.5px;color:var(--muted);margin:6px 0 0}

/* budget-10: invoice tiles and owner rows. */
.bgt-inv-card{grid-template-columns:40px 1fr;padding:8px 10px;gap:10px}
.bgt-inv-card img,.bgt-inv-card .ph{width:40px;height:40px;border-radius:8px}
.bgt-who-row{padding-top:6px;padding-bottom:6px}

/* budget-7: an empty cash table names itself instead of showing a bare header. */
.bgt-list td.review-empty{color:var(--muted);font-style:normal;text-align:left;padding:10px;white-space:normal}


/* r2-budget-2: below 1100px the statement no longer shares a row with the
   breakdowns (it was squeezed to 450px and its buttons stacked four deep):
   statement full width, the two breakdown cards side by side under it. */
@media (max-width:1099px){
  .bgt-split{grid-template-columns:minmax(0,1fr);row-gap:16px}
  .bgt-split>.bgt-split-col+.bgt-split-col{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:16px;align-items:stretch}
  .bgt-split>.bgt-split-col+.bgt-split-col>.bgt-card{margin-top:0}
}
/* r3-budget-1: from 1100px the tin and its cash book take the wider column
   and the section breakdown the narrower one, so the book's six columns fit
   without scrolling sideways (Ahmed, 14 Oct 2026). */
@media (min-width:1100px){
  .bgt-split:not(.one){grid-template-columns:minmax(0,2fr) minmax(300px,1fr)}
}
/* The cash book's headings may take two lines ("Tanggal / pembayaran"): on one
   line they were what made the table wider than its card. */
.bgt-book .bgt-list th{white-space:normal;vertical-align:bottom}
.bgt-book .bgt-list td:first-child{white-space:nowrap}
.bgt-book .bgt-card-hd [data-pc-excel]{margin-left:auto;align-self:center}
/* A wide statement reads as two short columns: the cash (opening, in, out,
   book balance) and the commitments against it. */
.review-cash-card{container-type:inline-size}
@container (min-width:640px){
  .review-cash-figures{grid-template-columns:repeat(2,minmax(0,380px));grid-template-rows:repeat(4,auto);grid-auto-flow:column;column-gap:48px}
}

/* r2-budget-3: attention chips scroll their target clear of the sticky top bar. */
#view-budget [id],#view-budget .review-cash-card{scroll-margin-top:72px}

/* r2-budget-4: nothing on the Budget screen under 11px. */
.bgt .bd-calendar b{font-size:11px;line-height:12px;padding-top:3px}
.bgt .bd-calendar strong{font-size:22px;line-height:27px}
.bgt-mo small,.bgt-state,.bgt-refill-stat i,.bgt-list th,.bgt-list .st,
.bgt-petty-fig span,.bgt-petty-fig i,.bgt-xl,.bgt-target-label{font-size:11px}
.bgt-xl u{font-size:11px}

/* r2-budget-5: the chart's bars wide enough to read when only a few months
   exist (the cap was 26px in a 300px slot); still the full slot on a phone. */
.bgt-chart-view .bgt-bar{max-width:56px}

/* r2-budget-6: on a phone the statement actions share rows: the primary on its
   own, the rest two to a row, long labels wrapping instead of running out. */
@media (max-width:720px){
  .review-cash-actions .btn{flex:1 1 calc(50% - 3px);white-space:normal;height:auto;min-height:44px;padding:6px 12px;line-height:1.25;text-align:center}
  .review-cash-actions .btn-ink,.review-cash-actions #cash-staff{flex-basis:100%}
}

/* r2-budget-7: touch targets on the Budget screen stay 44px under a finger. */
@media (pointer:coarse){
  .bgt-attn-item,.bgt-look button{min-height:44px}
  .bgt-row.opens{min-height:44px}
  .bgt-fold>summary{min-height:44px;align-items:center}
  .bgt-proof{display:inline-flex;align-items:center;min-height:44px;min-width:44px}
  .bgt-list th[aria-sort] .admin-sort{min-height:44px}
}

/* r2-budget-8: the Unused budget tables fit their popover (they scrolled 9px
   sideways and hid the end of the last amount): headers wrap, tighter cells. */
.bgt-pop .bgt-list th{white-space:normal;vertical-align:bottom}
.bgt-pop .bgt-list th,.bgt-pop .bgt-list td{padding-left:5px;padding-right:5px}
.bgt-pop .bgt-list th:first-child,.bgt-pop .bgt-list td:first-child{padding-left:0}
.bgt-pop .bgt-list th:last-child,.bgt-pop .bgt-list td:last-child{padding-right:0}

/* ══ sheet-budget: Budget as a sheet (the "try" view, in SAG colours) ══ */

/* sheet-budget-1: two summary cards in one row: the month, with the unused
   budget as one row at its foot, and the months wheel. The wheel is a fixed
   width, so its card stops at 400px and the month takes the rest. One above
   the other below 900px. */
.bgt .bgt-head{margin:16px 0 12px}
.bgt-sum{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:0 0 14px}
@media (min-width:900px){.bgt-sum{grid-template-columns:minmax(0,1fr) minmax(300px,400px)}}
/* On the local app the tin joins the row, as the month's cash statement:
   three cards from 1200px (the month, the tin, the wheel). Between 900 and
   1199px the month and the wheel share a row and the tin takes the next.
   The balance card opens its statement in Track. */
@media (min-width:1200px){.bgt-sum.three{grid-template-columns:minmax(0,1fr) minmax(0,1.6fr) minmax(280px,300px)}}
@media (min-width:900px) and (max-width:1199px){.bgt-sum.three>.bgt-petty-stmt{grid-column:1/-1;order:3}}
.bgt-sum>.bgt-petty-stmt{display:flex;flex-direction:column;min-width:0}
.bgt-sum>.bgt-petty-stmt .bgt-sub{margin:2px 0 0}
.bgt-sum>.bgt-petty-stmt .bgt-petty-actions{margin:auto 0 0;padding-top:10px}
/* B10: one route from the local balance card to its bank-style tracker. */
.pc-budget-share{margin-top:14px}
.bgt-sum>.bgt-petty-stmt .pc-budget-share .bgt-meter{margin:6px 0 0;background:var(--sag-selected)}
.pc-budget-share .m-left{background:var(--sag-primary)}
.pc-card-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.pc-card-totals>span{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--sag-text-3)}
.pc-card-totals b{font-size:16px;font-weight:650;color:var(--sag-text);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.pc-tracker{min-width:0}
.pc-period{margin-bottom:16px;border:1px solid var(--sag-line);border-radius:var(--sag-r,8px)}
.pc-period>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;
  cursor:pointer;list-style:none;font-size:13px;font-weight:600;color:var(--sag-text)}
.pc-period>summary::-webkit-details-marker{display:none}
.pc-period>summary:focus-visible{outline:2px solid var(--sag-primary);outline-offset:2px;border-radius:var(--sag-r,8px)}
.pc-period-action{display:inline-flex;align-items:center;gap:6px;color:var(--sag-text-2);font-size:12px;white-space:nowrap}
.pc-period-action svg{width:16px;height:16px;flex:none}
.pc-period .pc-range{display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px;margin:0;padding:4px 12px 12px}
.pc-period .fld{flex:1 1 160px;min-width:0;margin:0}
.pc-period .fld label{font-size:12px;text-transform:none;letter-spacing:normal}
.pc-period input{width:100%;min-width:0}
.pc-tracker .bgt-petty-top{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 16px;padding:0}
.pc-tracker .bgt-petty-fig span{font-size:12px;text-transform:none;letter-spacing:normal}
.pc-tracker .bgt-petty-fig b{font-size:20px;overflow-wrap:anywhere;white-space:normal;font-variant-numeric:tabular-nums}
.pc-tracker .bgt-scroll{overflow:auto;margin:0}
.pc-tracker .stmt{min-width:620px;font-size:12.5px}
.pc-tracker .stmt th{font-size:12px;text-transform:none;letter-spacing:normal;white-space:nowrap}
.pc-tracker .stmt td{vertical-align:top}
.pc-tracker .stmt td:first-child{white-space:nowrap}
.pc-tracker .stmt th:nth-child(2){width:40%}
.pc-tracker .stmt .hint{white-space:normal;overflow-wrap:anywhere;font-size:12px}
.pc-tracker .pc-balance-row{background:var(--sag-app);font-weight:600}
.pc-tracker .pc-balance-row td{border-top:1px solid var(--sag-line)}
.pc-book-details{margin-top:16px;color:var(--sag-text-3);font-size:12px}
.pc-book-details>summary{cursor:pointer;padding:8px 0}
.pc-book-details .bgt-note{padding-left:0;font-size:12px}
@media(max-width:480px){
  .pc-period>summary{flex-wrap:wrap;gap:8px}
  .pc-period .fld{flex-basis:100%}
  .pc-tracker .bgt-petty-top{grid-template-columns:minmax(0,1fr);gap:8px}
  .pc-tracker .bgt-petty-fig{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
  .pc-tracker .bgt-petty-fig span{margin:0}
  .pc-tracker .bgt-petty-fig b{font-size:16px;white-space:nowrap}
  .pc-tracker .stmt th:last-child,.pc-tracker .stmt td:last-child{position:sticky;right:0;background:var(--sag-surface);
    box-shadow:-1px 0 var(--sag-line)}
  .pc-tracker .stmt .pc-balance-row td:last-child{background:var(--sag-app)}
}
/* The months card: the iPhone alarm's picker (B9). Five rows fill the wheel
   whatever its height (each is a fifth of it, --wm-h, set by sizeWheelRows), the band across the middle
   holds the chosen month, two greyed months stand beyond each end, and the
   rows tilt on a drum (paintWheel). */
.bgt-roll-card{display:flex;flex-direction:column;gap:6px}
.bgt-wheel{position:relative;flex:1 1 auto;min-height:170px;perspective:520px}
.bgt-wheel-band{position:absolute;left:0;right:0;top:40%;height:20%;border-radius:10px;
  background:var(--sag-selected,var(--sag-selected));pointer-events:none}
.bgt-wheel-drum{position:absolute;inset:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;outline:none;
  -webkit-mask-image:linear-gradient(180deg,rgba(0,0,0,.2) 0,#000 24%,#000 76%,rgba(0,0,0,.2) 100%);
  mask-image:linear-gradient(180deg,rgba(0,0,0,.2) 0,#000 24%,#000 76%,rgba(0,0,0,.2) 100%)}
.bgt-wheel-drum::-webkit-scrollbar{display:none}
.bgt-wheel:has(.bgt-wheel-drum:focus-visible){box-shadow:var(--sag-ring-inset,inset 0 0 0 2px #1B3038);border-radius:10px}
.bgt-wm{height:var(--wm-h,34px);display:grid;grid-template-columns:80px minmax(0,1fr);align-items:center;gap:12px;padding:0 10px;
  cursor:pointer;transform-origin:50% 50%;will-change:transform,opacity;color:var(--sag-text-2,#4A5B62);font-size:13px;white-space:nowrap}
.bgt-wm.off{cursor:default;color:var(--sag-text-3,var(--sag-text-3))}
.bgt-wm.off .bgt-wm-line{background:none;box-shadow:none}
.bgt-wm b{font-weight:600;overflow:hidden;text-overflow:ellipsis}
.bgt-wm b span{font-weight:500;color:var(--sag-text-3,#6B7A80)}
/* The month's line carries its words: how much of the pot went, or that it
   went over. */
.bgt-wm-line{position:relative;display:block;height:20px;border-radius:999px;overflow:hidden;
  background:var(--sag-app,var(--sag-app));box-shadow:inset 0 0 0 1px var(--sag-line,#E5E9EA)}
.bgt-wm-line i{position:absolute;left:0;top:0;bottom:0;background:#D3DDE2}
.bgt-wm-line small{position:relative;display:block;padding:0 9px;line-height:20px;font-size:12px;font-weight:600;
  color:var(--sag-text-2,#4A5B62);overflow:hidden;text-overflow:ellipsis}
.bgt-wm.off .bgt-wm-line small{font-weight:500;color:var(--sag-text-3,var(--sag-text-3))}
.bgt-wm.on{color:var(--sag-text,var(--sag-text))}
.bgt-wm.on b{font-weight:700}
.bgt-wm.on .bgt-wm-line small{color:var(--sag-text,var(--sag-text))}
.bgt-wm.on .bgt-wm-line i{background:#BCCBD2}
.bgt-wm.now b::after{content:"";display:inline-block;width:5px;height:5px;margin-left:5px;border-radius:50%;
  background:var(--sag-ok,var(--sag-ok));vertical-align:middle}
.bgt-wm.went-over b,.bgt-wm.went-over .bgt-wm-line small{color:var(--sag-risk-fg,var(--sag-risk-fg))}
.bgt-wm.went-over .bgt-wm-line i{background:#F1CDC2}
.bgt-wm.went-over .bgt-wm-line{box-shadow:inset 0 0 0 1px #E6B3A4}
@media (pointer:coarse){.bgt-wheel{min-height:200px}.bgt-wm{font-size:14px;grid-template-columns:90px minmax(0,1fr)}
  .bgt-wm-line{height:22px}.bgt-wm-line small{line-height:22px}}
.bgt-sum>.bgt-sum-card{margin:0;padding:12px 14px;border-radius:var(--sag-r-lg,12px);box-shadow:none;min-width:0;
  border:1px solid var(--sag-line);background:var(--sag-surface)}
/* No colour rail down the left edge: cut by the 12px corner it read as a "{"
   stuck to the card. The tone already shows in the status pill, the meter and
   the figure (red when over), so the card keeps a plain even border. */
.bgt-hero::before,.bgt-petty::before{content:none}
.bgt-sum>.bgt-hero{padding-left:14px}
.bgt-petty .bgt-card-hd{padding-left:0}
.bgt-sum .bgt-hero-top{gap:6px 8px;margin:0}
.bgt-sum .bgt-hero-top .bgt-when{font-size:11px;font-weight:700;letter-spacing:.06em;color:var(--sag-text-3)}
.bgt-sum .bgt-state{padding:2px 8px;font-size:10.5px;letter-spacing:.06em}
.bgt-sum .bgt-fig{font-size:22px;font-weight:700;letter-spacing:-.01em;line-height:1.25;margin:4px 0 2px;
  color:var(--sag-text);font-variant-numeric:tabular-nums}
.bgt-sum .bgt-hero.over .bgt-fig{color:var(--tone-ink)}
.bgt-sum .bgt-sub{font-size:12.5px;line-height:1.4;color:var(--sag-text-2);margin:0}
.bgt-sum .bgt-meter{height:6px;margin:8px 0 6px}
.bgt-sum .bgt-key{gap:2px 12px;font-size:12px;line-height:1.5}
.bgt-sum .bgt-key em{width:8px;height:8px}
.bgt-key .k-wait em{background:transparent;border:1.5px solid var(--bg-ink-soft)}
.bgt-sum-line{font-size:12px;line-height:1.45;color:var(--sag-text-2);margin:6px 0 0}
.bgt-sum-line b{color:var(--sag-text);font-weight:700;font-variant-numeric:tabular-nums}
/* The unused budget: one row at the foot of the month's card, under the line
   that says what the month hands to it. A hairline sets it apart; red only
   when later months owe it back. */
.bgt-pot{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;
  margin-top:10px;padding-top:8px;border-top:1px solid var(--sag-line)}
.bgt-pot .bgt-sum-line{margin:0;flex:1 1 220px;min-width:0}
.bgt-pot-name{font-weight:600;color:var(--sag-text)}
.bgt-pot.over .bgt-sum-line b{color:var(--sag-risk-fg,var(--sag-risk-fg))}
.bgt-pot-acts{display:flex;flex-wrap:wrap;gap:6px;margin-left:auto}
@media (pointer:fine){.bgt-pot-acts .btn.btn-sm{height:28px;font-size:12.5px;padding:0 10px;border-radius:var(--sag-r,8px)}}
@media (pointer:coarse){.bgt-pot-acts .btn.btn-sm{height:auto;min-height:44px;padding:0 14px;white-space:normal}}

/* sheet-budget-2: a figure with rows behind it is a link to them. */
.bgt-trace{display:inline;border:0;background:none;padding:0;margin:0;font:inherit;font-weight:700;color:var(--sag-text);
  text-decoration:underline;text-decoration-color:var(--sag-line-strong);text-underline-offset:2px;cursor:pointer;
  font-variant-numeric:tabular-nums;height:auto;min-height:0}
.bgt-trace:hover{text-decoration-color:currentColor}
.bgt-trace:focus-visible{outline:2px solid var(--sag-focus);outline-offset:2px;border-radius:2px}
.sh-grid .bgt-trace{font-weight:500}
/* Under a finger the hit area grows, the line does not: a 44px-tall button in
   a key / value list pushed its line apart from the plain ones around it. */
@media (pointer:coarse){
  .bgt-trace{display:inline;position:relative;min-height:0}
  .bgt-trace::after{content:"";position:absolute;left:-8px;right:-8px;top:50%;height:44px;transform:translateY(-50%)}
}

.bgt-neg{color:var(--sag-risk-fg)}
.bgt-off{color:var(--sag-text-3)}
.bgt-missing{color:var(--sag-risk-fg);font-weight:700}
.bgt .bgt-month-hd{scroll-margin-top:72px}
.bgt .bgt-month-hd:focus{outline:none}

/* sheet-budget-4: the month's request sheet sits in its fold. */
.bgt-req-sheet{margin-top:10px}
/* A month's requests are a few dozen rows on a page that already scrolls: the
   sheet shows them all rather than scrolling inside itself, so the sticky
   totals row never sits over the last rows in view. */
.bgt-req-sheet .sh{--sh-max-h:none}
.bgt-req-sheet .sh-scroll{min-height:0}
.bgt-req-sheet .sh-grid .hint{margin:0;font-size:12px;line-height:1.35}
/* The section's icon on a tile beside its name, and the products at reading
   size in their own column (B77). */
.bgt-req-sheet .bgt-sec{display:flex;align-items:center;gap:10px;min-width:0}
.bgt-req-sheet .bgt-sec-ic{flex:0 0 32px;width:32px;height:32px;display:grid;place-items:center;border-radius:8px;
  background:var(--sag-app);border:1px solid var(--sag-line);font-size:17px;line-height:1;color:var(--sag-text-2);
  font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif}
.bgt-req-sheet .bgt-sec-ic svg{width:17px;height:17px}
.bgt-req-sheet .bgt-items{font-size:14px;line-height:1.4;color:var(--sag-text)}
.bgt-req-sheet .bgt-items .admin-items-more{font-size:12px;color:var(--sag-text-3);white-space:nowrap}
.bgt-req-sheet .bgt-proof{min-height:0}
@media (pointer:coarse){
  .bgt-req-sheet .bgt-proof{display:inline;position:relative;min-height:0;min-width:0}
  .bgt-req-sheet .bgt-proof::after{content:"";position:absolute;left:-12px;right:-12px;top:50%;height:44px;transform:translateY(-50%)}
}

/* sheet-budget-6 (round b): the running month carries a small neutral "Now"
   tag beside its name; its Status says how it stands, not "This month". */
.bgt-now{display:inline-block;margin-left:6px;padding:0 6px;border:1px solid var(--sag-line-strong,#C9D1D3);
  border-radius:var(--sag-r-sm,6px);font-size:10.5px;font-weight:700;line-height:16px;letter-spacing:.04em;
  color:var(--sag-text-2);background:var(--sag-surface);vertical-align:1px;white-space:nowrap}
/* "Proof missing" overlaps the other chips (they add up to All; it does not),
   so it is set apart by a wider gap and a dashed outline. */
.bgt-req-sheet .sh-chip[data-sh-chip="proof"]{margin-left:14px;border-style:dashed}
/* A folded card ("Every request in …", "Subscription invoices") opens from
   anywhere on it, not only from the line of its words (Ahmed, 27 Oct 2026):
   its heading takes the card's padding as its own, so the card's edges are
   part of the heading, and the card's content gets the side padding back.
   The heading takes focus when a figure leads to it: a ring on the card's own
   corners for the keyboard only, never a square box after a click or a tap. */
.bgt-card.bgt-fold{--fold-pad:18px 20px 14px;--fold-side:20px;padding:0}
.bgt-card.bgt-fold[open]{padding-bottom:16px}
.bgt-card.bgt-fold>summary{padding:var(--fold-pad);border-radius:inherit}
.bgt-card.bgt-fold[open]>summary{margin-bottom:0;padding-bottom:12px}
.bgt-card.bgt-fold>:not(summary){margin-left:var(--fold-side);margin-right:var(--fold-side)}
@media (max-width:640px){.bgt-card.bgt-fold{--fold-pad:15px 14px 12px;--fold-side:14px}}
.bgt-fold>summary:focus{outline:none}
.bgt-fold>summary:focus-visible{outline:2px solid var(--sag-focus,#3A5560);outline-offset:-2px;border-radius:var(--sag-r-lg,12px)}

/* sheet-budget-5: the unused budget's breakdown opens in a popover over the
   page, so opening it never stretches the card or its neighbours. The month's
   card lets it out. It opens from the card's left edge, rightwards: the card
   is the first on the row and narrower than the popover, so from its right
   edge it ran off the screen on the left (B12; keepPopInView catches the rest). */
.bgt-sum>.bgt-hero{overflow:visible}
.bgt-pop{position:absolute;z-index:40;top:calc(100% + 6px);left:0;right:auto;width:min(460px,calc(100vw - 32px));
  max-height:min(440px,70vh);overflow:auto;background:var(--sag-surface);border:1px solid var(--sag-line);
  border-radius:var(--sag-r-lg,12px);box-shadow:var(--sag-shadow-2,0 12px 32px rgba(16,32,38,.18));padding:10px 14px 12px}
.bgt-pop[hidden]{display:none}
.bgt-pop-hd{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 6px}
.bgt-pop-hd h3{font-size:14px;margin:0}
.bgt-pop-sub{font-size:12.5px;font-weight:700;margin:12px 0 4px;color:var(--sag-text)}
.bgt-pop .bgt-list{font-size:12.5px;width:100%}
.bgt-pop .bgt-list th.num,.bgt-pop .bgt-list td.num{text-align:right}
.bgt-pop .bgt-note{margin:4px 0}
@media (pointer:fine){.bgt-pop-hd .btn.btn-sm{height:28px;font-size:12.5px;padding:0 10px}}
@media (max-width:899px){.bgt-pop{right:auto;left:0}}
@media (max-width:600px){.bgt-pop{left:0;right:0;width:auto}}

/* A7: two summary cards. The next budget is one line on the month's card. */
.bgt-next-line{margin-top:8px;padding-top:7px;border-top:1px solid var(--sag-line,var(--sag-line))}
/* B61: a finished month still waiting for New budget, said under that line on
   the running month's card, with the one button that moves it. Amber like the
   other things that wait; the words carry the meaning. */
.bgt-newbudget{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin-top:8px;padding:8px 10px;
  border-radius:var(--sag-r,8px);background:var(--sag-wait-bg);border:1px solid var(--sag-line)}
.bgt-newbudget p{flex:1 1 240px;min-width:0;margin:0;font-size:12.5px;line-height:1.45;color:var(--sag-text)}
.bgt-newbudget .btn{margin-left:auto}
@media (pointer:fine){.bgt-newbudget .btn.btn-sm{height:28px;font-size:12.5px;padding:0 10px}}
@media (pointer:coarse){.bgt-newbudget .btn.btn-sm{min-height:44px}}
/* Where it came from: the months still waiting are not in the pot yet. */
.bgt-pot-list tr.bgt-pot-waiting td{color:var(--sag-text-2)}
.bgt-pot-list td .hint{font-size:12px;color:var(--sag-text-2);font-weight:400}
.bgt-pot-list td:first-child{min-width:8.5em}
.bgt-pot-list td.num{white-space:nowrap}

/* G16: a section bar opens the parts that made it up, indented under it. */
.bgt-row.bgt-sec .r-name em svg{display:block;width:12px;height:12px}
.bgt-row.bgt-sec .r-name em{display:inline-block;width:12px;height:12px;vertical-align:-1px;
  transition:transform .18s var(--sag-ease,ease)}
.bgt-row.bgt-sec[aria-expanded="true"] .r-name em{transform:rotate(90deg)}
.bgt-parts{grid-column:1/-1;display:grid;grid-template-columns:subgrid;row-gap:2px;margin:0 0 6px}
.bgt-parts[hidden]{display:none}
.bgt-row.bgt-part{min-height:22px}
.bgt-row.bgt-part .r-name{padding-left:14px;font-size:12px;color:var(--sag-text-3,var(--sag-text-3))}
.bgt-row.bgt-part .r-track{height:6px}
.bgt-row.bgt-part .r-track i{opacity:.6}
.bgt-row.bgt-part .r-val{font-size:12px;font-weight:600}

/* A section's name is never cut on a phone: it wraps beside its bar. */
@media (max-width:720px){
  .bgt-sections .bgt-row .r-name{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.25}
}

/* B11: a month chosen, smoothly. While the figures roll (budgetRollTo), the
   month's details under the cards come in softly instead of jumping. */
@keyframes bgt-swap{from{opacity:.35;transform:translateY(6px)}to{opacity:1;transform:none}}
.bgt.bgt-swap>:not(.bgt-head):not(.bgt-sum){animation:bgt-swap .38s var(--sag-ease,ease) both}
@media (prefers-reduced-motion:reduce){.bgt.bgt-swap>*{animation:none}}
