/* Got a bonus? (PV-009, js/bonus-ui.js). Play mood: each part wears its own kind colour (the bar, its tile, its swatch);
   everything else is the Money · Ledger surface. The split bar's handles are dark pills a finger can grab, springy under it.
   Linked just before pocket.css (it stays last): it reuses the Rent vs buy family (rv-*) and the effect styles (bn-eff, bn-rows).
   Design: docs/design/planning-v2/proto.html?screen=bonus */

.bn .rv-top { align-items: flex-start; }
.bn-head { margin-right: auto; min-width: 0; }
.bn-head .pl-tool-title { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.015em; }
.bn-q { margin: 4px 0 0; font: 400 13.5px/1.45 var(--font-sans); color: var(--text-dim); }

.bn-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.bn-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bn-ask { display: grid; gap: 16px; padding: 24px; }

/* the sentence: big, plain, Geist with tabular figures */
.bn-sent { margin: 0; font: 600 26px/1.38 var(--font-sans); letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.bn-ask .sp-hint { margin: -8px 0 0; }

/* the split bar: four parts, three handles that push each other */
.bn-split { position: relative; height: 54px; margin: 6px 0; user-select: none; -webkit-user-select: none; touch-action: none; }
.bn-segs { display: flex; height: 100%; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.bn-seg { display: block; height: 100%; min-width: 0; background: var(--c); }
.bn-hd { all: unset; position: absolute; top: -8px; bottom: -8px; width: 48px; margin-left: -24px; display: grid; place-items: center; cursor: ew-resize; touch-action: none; z-index: 2; -webkit-tap-highlight-color: transparent; }
.bn-hd i { display: block; width: 8px; height: 50px; border-radius: 4px; background: var(--text); box-shadow: 0 0 0 3px var(--surface); transition: transform 220ms cubic-bezier(.2, .9, .3, 1.15); }
.bn-hd.is-drag i { transform: scaleX(1.5); }
.bn-hd:focus-visible i { outline: 2px solid var(--accent); outline-offset: 3px; }

/* presets: pills, the one in use filled */
.bn-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.bn-pre { min-height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-mid); font: 500 13.5px var(--font-sans); cursor: pointer; }
.bn-pre:hover { color: var(--text); }
.bn-pre[aria-pressed="true"] { border-color: transparent; background: var(--accent-fill); color: var(--on-accent); }
.bn-pre:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* what each part does: a tile per part, tinted with its kind colour */
.bn-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bn-tile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: center; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.bn-ic { grid-row: 1 / 3; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--c); color: #fff; }   /* white on the mid-tone kind colours, the same in both themes */
.bn-ic svg { width: 18px; height: 18px; }
.bn-tile b { grid-column: 2; font: 600 14.5px var(--font-sans); color: var(--text); }
.bn-tl { grid-column: 2; font: 400 12.5px/1.4 var(--font-sans); color: var(--text-mid); }
.bn-amt { grid-column: 3; grid-row: 1 / 3; font: 600 16px var(--font-mono); color: var(--text); }
.bn-tile.is-none .bn-ic { background: var(--surface-2); color: var(--text-dim); }

/* PS-004: under the Plan sentence with no amount chosen yet, the split, presets, tiles and detail wait for one (a $0 split says nothing) */
.bn-wait .bn-split, .bn-wait .bn-presets, .bn-wait .bn-tiles, .bn-wait .bn-col, .bn-wait .sp-hint { display: none; }
.bn-wait .bn-body { grid-template-columns: minmax(0, 1fr); }
.bn-keep { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.bn-keep span { flex: 1; min-width: 220px; font: 400 13px/1.45 var(--font-sans); color: var(--text-dim); }

/* the detail: each part in full, stacked beside the split */
.bn-effs { display: grid; gap: 10px; margin-top: 12px; }
.bn-eff h3 span { display: inline-flex; align-items: center; gap: 8px; }
.bn-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

@media (max-width: 1100px) {
  .bn-body { display: flex; flex-direction: column; align-items: stretch; }
  .bn-head .pl-tool-title { font-size: 28px; }
}
@media (max-width: 768px) {
  .bn-ask { padding: 20px 18px; gap: 14px; }
  .bn-sent { font-size: 22px; }
  .bn-tiles { grid-template-columns: 1fr; }
  .bn-presets { display: grid; grid-template-columns: 1fr 1fr; }
  .bn-pre { min-height: 48px; }
  .bn-keep { flex-direction: column; align-items: stretch; }
  .bn-keep span { min-width: 0; }
}
