/* Game kit I "budget" (Budget-Rechner) – levers on the left, a live "receipt" on the right that turns green and gets stamped.
   Builds on app.css tokens + games.css (.gk, .gk-bix, .gk-track, .gk-opts, .gk-solved). Light, dark, lab (advanced) and dev tiers. */
.gk-budget{--gkb-ok:#2F7A55;--gkb-ok-bg:color-mix(in srgb,var(--lime) 34%,var(--surface));--gkb-warn:var(--sun);--gkb-paper:#FFFDF6;--gkb-paper-ink:#123D2F;--gkb-rule:rgba(18,61,47,.22);
  --gkb-ai:color-mix(in srgb,var(--sky) 24%,var(--surface));--gkb-team:color-mix(in srgb,var(--sun) 22%,var(--surface));--gkb-human:color-mix(in srgb,var(--coral) 18%,var(--surface))}
:root[data-theme="dark"] .gk-budget,body[data-tier="advanced"] .gk-budget,body[data-tier="dev"] .gk-budget{--gkb-paper:#0D2219;--gkb-paper-ink:#EAF6E4;--gkb-rule:rgba(234,246,228,.18);--gkb-ok:#C9F27A}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .gk-budget{--gkb-paper:#0D2219;--gkb-paper-ink:#EAF6E4;--gkb-rule:rgba(234,246,228,.18);--gkb-ok:#C9F27A}}
body[data-tier="dev"] .gk-budget{--gkb-paper:#061218;--gkb-rule:rgba(143,211,244,.2)}

.gk-budget .qblock{margin:0}
.gk-budget .gkb-track li span:not(.sr){font-size:13px}

/* ---------- board: levers | receipt ---------- */
.gk-budget .gkb-board{display:grid;gap:14px;min-width:0}
.gk-budget .gkb-ctls{display:flex;flex-direction:column;gap:12px;min-width:0;position:relative}
@media (min-width:920px){
  .gkb-board{grid-template-columns:minmax(0,1fr) minmax(290px,360px);align-items:start}
  .gkb-panel{position:sticky;top:76px}
  .gkb-mini{display:none!important}
}

/* ---------- a lever card ---------- */
.gk-budget .gkb-ctl{background:var(--surface);border:2px solid var(--line);border-radius:18px;padding:12px 14px 14px;min-width:0}
.gk-budget .gkb-ctl-h{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.gk-budget .gkb-ctl-l{font-weight:900;font-size:16px;line-height:1.3;color:var(--ink);min-width:0;overflow-wrap:anywhere}
.gk-budget .gkb-val{font:800 19px/1.1 var(--mono);font-variant-numeric:tabular-nums;color:var(--ink);background:var(--soft);border-radius:10px;padding:6px 10px;white-space:nowrap}
.gk-budget .gkb-hint{margin:8px 0 0;font-size:14px;color:var(--muted);font-weight:700}

.gk-budget .gkb-stepper{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:center;gap:10px}
.gk-budget .gkb-pm{width:48px;height:48px;border-radius:50%;border:2px solid var(--line-2);background:var(--soft);color:var(--ink);font:900 26px/1 var(--body);cursor:pointer;display:grid;place-items:center;box-shadow:0 3px 0 var(--line-2);-webkit-tap-highlight-color:transparent}
.gk-budget .gkb-pm:active{transform:translateY(2px);box-shadow:0 1px 0 var(--line-2)}
.gk-budget .gkb-pm:disabled{opacity:.4;cursor:default;transform:none}
.gk-budget .gkb-pm:focus-visible,.gk-budget .gkb-seg button:focus-visible,.gk-budget .gkb-mv button:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.gk-budget .gkb-stepper input[type=range]{width:100%;min-width:0;height:44px;margin:0;accent-color:var(--gkb-ok);cursor:pointer;background:transparent}
.gk-budget .gkb-stepper input[type=range]:focus-visible{outline:3px solid var(--focus);outline-offset:2px;border-radius:8px}
.gk-budget .gkb-stepper input[type=range]:disabled{cursor:default;opacity:.6}

.gk-budget .gkb-seg{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,118px),1fr));gap:8px}
.gk-budget .gkb-seg button{min-height:56px;padding:8px 10px;border-radius:14px;border:2px solid var(--line-2);background:var(--surface);color:var(--ink);font:800 16px/1.2 var(--body);text-align:left;cursor:pointer;display:flex;flex-direction:column;gap:3px;justify-content:center;min-width:0;box-shadow:0 3px 0 var(--line-2);-webkit-tap-highlight-color:transparent}
.gk-budget .gkb-seg button b{overflow-wrap:anywhere}
.gk-budget .gkb-seg button small{font:700 12.5px/1.2 var(--mono);color:var(--muted)}
.gk-budget .gkb-seg button[aria-checked="true"]{background:var(--lime);border-color:var(--lime-shadow);color:var(--lime-ink);box-shadow:0 3px 0 var(--lime-shadow)}
.gk-budget .gkb-seg button[aria-checked="true"] small{color:var(--lime-ink);opacity:.85}
.gk-budget .gkb-seg button[aria-checked="true"] b::before{content:"● ";font-size:.8em}
.gk-budget .gkb-seg button:disabled{cursor:default}
.gk-budget .gkb-seg button:disabled:not([aria-checked="true"]){opacity:.55}

/* ---------- lanes (tasks / costs moved between columns) ---------- */
.gk-budget .gkb-lanes{display:grid;gap:10px;grid-template-columns:minmax(0,1fr)}
.gk-budget .gkb-ctls{container-type:inline-size}
@container (min-width:600px){.gk-budget .gkb-lanes{grid-template-columns:repeat(var(--n),minmax(0,1fr))}}
.gk-budget .gkb-lane{border-radius:18px;padding:10px;min-width:0;background:var(--soft);border:2px solid var(--line)}
.gk-budget .gkb-lane[data-lane="ai"]{background:var(--gkb-ai)}
.gk-budget .gkb-lane[data-lane="team"]{background:var(--gkb-team)}
.gk-budget .gkb-lane[data-lane="human"]{background:var(--gkb-human)}
.gk-budget .gkb-lane[data-lane="fix"]{background:var(--gkb-team)}
.gk-budget .gkb-lane[data-lane="var"]{background:var(--gkb-ai)}
.gk-budget .gkb-lane h4{margin:0 0 8px;display:flex;align-items:center;justify-content:space-between;gap:8px;font:900 15px/1.25 var(--body);color:var(--ink)}
.gk-budget .gkb-lane h4 span{min-width:0;overflow-wrap:break-word;hyphens:auto}
.gk-budget .gkb-lane h4 b{font:800 13px/1 var(--mono);background:var(--surface);border-radius:999px;padding:5px 9px;white-space:nowrap}
.gk-budget .gkb-lane h4 b:empty{display:none}
.gk-budget .gkb-cards{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;min-height:44px}
.gk-budget .gkb-card{background:var(--surface);border:2px solid var(--line-2);border-radius:14px;padding:9px 10px;display:flex;flex-direction:column;gap:6px;min-width:0;box-shadow:0 3px 0 var(--line)}
.gk-budget .gkb-card.moved{animation:gkbIn .32s cubic-bezier(.3,1.4,.5,1)}
@keyframes gkbIn{0%{transform:scale(.94);opacity:.4}100%{transform:none;opacity:1}}
.gk-budget .gkb-card-t{margin:0;font-weight:800;font-size:15.5px;line-height:1.3;color:var(--ink);overflow-wrap:anywhere;hyphens:auto}
.gk-budget .gkb-gain{margin:0;font:700 12.5px/1.2 var(--mono);color:var(--muted)}
.gk-budget .gkb-mv{display:flex;flex-wrap:wrap;gap:6px}
.gk-budget .gkb-mv button{min-height:44px;padding:6px 12px;border-radius:999px;border:2px solid var(--line-2);background:var(--soft);color:var(--ink);font:800 14px/1.1 var(--body);cursor:pointer;flex:1 1 auto;-webkit-tap-highlight-color:transparent}
.gk-budget .gkb-mv button:hover{border-color:var(--ink-2)}
.gk-budget .gkb-empty{list-style:none;font-size:14px;color:var(--muted);font-weight:700;padding:10px 4px;text-align:center;border:2px dashed var(--line-2);border-radius:12px}

/* ---------- the receipt ---------- */
.gk-budget .gkb-panel{position:relative;background:var(--gkb-paper);color:var(--gkb-paper-ink);border-radius:16px 16px 6px 6px;padding:14px 16px 20px;min-width:0;
  box-shadow:inset 0 5px 0 var(--gkb-warn),0 10px 26px rgba(0,0,0,.18);border:1px solid var(--gkb-rule);transition:box-shadow .3s}
.gk-budget .gkb-panel::after{content:"";position:absolute;left:0;right:0;bottom:-7px;height:8px;background:radial-gradient(circle at 6px 0,var(--gkb-paper) 5px,transparent 5.5px) 0 0/12px 8px repeat-x}
.gk-budget .gkb-panel.fit{box-shadow:inset 0 5px 0 var(--gkb-ok),0 0 0 3px color-mix(in srgb,var(--lime) 55%,transparent),0 10px 26px rgba(0,0,0,.18)}
.gk-budget .gkb-panel.glow{animation:gkbGlow .9s ease}
@keyframes gkbGlow{40%{box-shadow:inset 0 5px 0 var(--gkb-ok),0 0 0 7px color-mix(in srgb,var(--lime) 60%,transparent),0 10px 26px rgba(0,0,0,.18)}}
.gk-budget .gkb-rc-h{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding-bottom:10px;border-bottom:2px dashed var(--gkb-rule)}
.gk-budget .gkb-rc-t{font:800 13px/1.2 var(--mono);letter-spacing:.08em;text-transform:uppercase}
.gk-budget .gkb-status{font:900 13px/1 var(--body);padding:6px 10px;border-radius:999px;background:var(--sun);color:var(--sun-ink);white-space:nowrap}
.gk-budget .gkb-panel.fit .gkb-status{background:var(--lime);color:var(--lime-ink)}
.gk-budget .gkb-given{margin:10px 0 0;display:flex;flex-wrap:wrap;gap:4px 14px;font-size:13px}
.gk-budget .gkb-given div{display:flex;gap:6px;align-items:baseline;min-width:0}
.gk-budget .gkb-given dt{opacity:.75;font-weight:700}
.gk-budget .gkb-given dd{margin:0;font:800 13px/1.3 var(--mono);font-variant-numeric:tabular-nums;white-space:nowrap}
.gk-budget .gkb-lines{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-direction:column}
.gk-budget .gkb-lines li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;padding:8px 0;border-bottom:1px dotted var(--gkb-rule);align-items:baseline}
.gk-budget .gkb-ln-l{font-weight:800;font-size:14px;min-width:0;overflow-wrap:anywhere}
.gk-budget .gkb-ln-m{grid-column:1 / -1;grid-row:2;font:600 13.5px/1.35 var(--mono);opacity:.82;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.gk-budget .gkb-ln-r{grid-column:2;grid-row:1;font:800 15px/1.2 var(--mono);font-variant-numeric:tabular-nums;white-space:nowrap;text-align:right}
.gk-budget .gkb-lines li.total{border-bottom:3px double var(--gkb-rule);padding-top:10px}
.gk-budget .gkb-lines li.total .gkb-ln-r{font-size:19px}
.gk-budget .gkb-goals-h{margin:12px 0 6px;display:flex;justify-content:space-between;gap:8px;font:800 12px/1.2 var(--mono);letter-spacing:.08em;text-transform:uppercase}
.gk-budget .gkb-goals-h span{letter-spacing:0;text-transform:none;opacity:.8}
.gk-budget .gkb-goals{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.gk-budget .gkb-goals li{display:grid;grid-template-columns:24px minmax(0,1fr);gap:2px 8px;align-items:start;font-size:14px;font-weight:700;line-height:1.35}
.gk-budget .gkb-goals li i{font-style:normal;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:900;background:var(--no-bg);color:var(--ink)}
.gk-budget .gkb-goals li.ok i{background:var(--lime);color:var(--lime-ink)}
.gk-budget .gkb-goals li em{grid-column:2;font:800 13px/1.2 var(--mono);font-style:normal;opacity:.85;font-variant-numeric:tabular-nums}
.gk-budget .gkb-goals li.no em{color:var(--danger)}
.gk-budget .gkb-stamp{position:absolute;right:10px;top:9px;transform:rotate(-9deg) scale(1.6);opacity:0;pointer-events:none;font:900 14px/1 var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--gkb-ok);
  border:3px solid currentColor;border-radius:9px;padding:5px 9px;background:color-mix(in srgb,var(--gkb-paper) 70%,transparent);transition:transform .35s cubic-bezier(.3,1.5,.5,1),opacity .2s}
.gk-budget .gkb-panel.stamped .gkb-stamp{opacity:.92;transform:rotate(-6deg) scale(1)}
.gk-budget .gkb-panel.stamped .gkb-status{visibility:hidden}

/* phones: a slim status bar that stays in view while the levers scroll */
.gk-budget .gkb-mini{position:sticky;bottom:calc(var(--gkb-foot,124px) + env(safe-area-inset-bottom,0px));z-index:4;align-self:center;display:flex;align-items:center;gap:8px;padding:8px 14px;border-radius:999px;background:var(--surface);border:2px solid var(--sun);box-shadow:0 6px 18px rgba(0,0,0,.22);font-weight:900;font-size:14px;color:var(--ink)}
.gk-budget .gkb-mini i{width:12px;height:12px;border-radius:50%;background:var(--sun);flex:none}
.gk-budget .gkb-mini b{font:800 13px/1 var(--mono);opacity:.8}
.gk-budget .gkb-mini.fit{border-color:var(--lime-shadow)}
.gk-budget .gkb-mini.fit i{background:var(--lime)}
.gk-budget .gkb-board.locked .gkb-mini{display:none}

/* ---------- check + why ---------- */
.gk-budget .gkb-act{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.gk-budget .gkb-act:empty{display:none}
.gk-budget .gkb-check{min-height:52px;font-size:18px}
.gk-budget .gkb-act .gk-out{width:100%}
.gk-budget .gkb-act .verdict{margin:0}
.gk-budget .gkb-why:empty{display:none}
.gk-budget .gkb-why{display:flex;flex-direction:column;gap:6px;scroll-margin-bottom:120px}
.gk-budget .gkb-why .gk-learn{margin-top:8px}
.gk-budget .gkb-sum{margin-top:12px}

/* ---------- tiers ---------- */
body[data-tier="dev"] .gk-budget .gkb-ctl{border-width:1px;border-radius:12px;background:color-mix(in srgb,var(--surface) 92%,#000)}
body[data-tier="dev"] .gk-budget .gkb-ctl-l{font-family:var(--body);font-weight:800;font-size:15px}
body[data-tier="dev"] .gk-budget .gkb-pm{border-radius:10px;box-shadow:none;border-width:1px}
body[data-tier="dev"] .gk-budget .gkb-seg button{border-radius:10px;box-shadow:none;border-width:1px}
body[data-tier="dev"] .gk-budget .gkb-seg button[aria-checked="true"]{background:color-mix(in srgb,var(--sky) 22%,var(--surface));border-color:var(--sky);color:var(--ink)}
body[data-tier="dev"] .gk-budget .gkb-seg button[aria-checked="true"] small{color:var(--ink)}
body[data-tier="dev"] .gk-budget .gkb-lane{border-radius:12px;border-width:1px}
body[data-tier="dev"] .gk-budget .gkb-card{border-radius:10px;border-width:1px;box-shadow:none}
body[data-tier="dev"] .gk-budget .gkb-mv button{border-radius:8px;border-width:1px;font-family:var(--mono);font-size:13px}
body[data-tier="dev"] .gk-budget .gkb-panel{border-radius:10px 10px 4px 4px;box-shadow:inset 0 3px 0 var(--gkb-warn),0 10px 26px rgba(0,0,0,.35)}
body[data-tier="dev"] .gk-budget .gkb-panel.fit{box-shadow:inset 0 3px 0 var(--gkb-ok),0 0 0 2px color-mix(in srgb,var(--lime) 45%,transparent),0 10px 26px rgba(0,0,0,.35)}
body[data-tier="dev"] .gk-budget .gkb-stepper input[type=range]{accent-color:var(--sky)}

@media (max-width:560px){
  .gk-budget .gkb-track li:not(.on){flex:0 0 auto;justify-content:center}
  .gk-budget .gkb-track li:not(.on) span:not(.sr){display:none}
  .gk-budget .gkb-track li.on{flex:1 1 auto}
  .gkb-ctl{padding:10px 12px 12px}
  .gkb-panel{padding:12px 12px 18px}
  .gkb-val{font-size:17px}
  .gkb-seg button{font-size:15px}
}
@media (prefers-reduced-motion:reduce){.gk-budget .gkb-card.moved,.gk-budget .gkb-panel.glow{animation:none!important}.gk-budget .gkb-stamp,.gk-budget .gkb-panel{transition:none}}
@media (forced-colors:active){.gk-budget .gkb-panel.fit{outline:3px solid Highlight}.gk-budget .gkb-seg button[aria-checked="true"]{outline:3px solid Highlight}.gk-budget .gkb-goals li i{border:1px solid CanvasText}}
