/* The ledger uses green for a posted gain and pale brass for the stated objective. */
.tb-workspace {
  --tb-ink:#edf6ef; --tb-muted:#a7b8ad; --tb-rule:#a7c4b329;
  --tb-brass:#ead9a8; --tb-green:#a4f3bf; --tb-red:#ffb0aa;
  display:grid; gap:16px; min-width:0; color:var(--tb-ink);
  font-family:Vazirmatn,Tahoma,sans-serif;
}
.tb-workspace * {box-sizing:border-box}
.tb-workspace [hidden] {display:none!important}
.tb-workspace :is(h2,h3,h4,p,dl,dt,dd) {margin:0}
.tb-workspace bdi {unicode-bidi:isolate;font-variant-numeric:tabular-nums}
.tb-heading,.tb-heading-title,.tb-actions,.tb-line,.tb-account-head,.tb-progress-labels,
.tb-history-title,.tb-form-top,.tb-form-foot,.tb-review h4 {display:flex;align-items:center}
.tb-heading,.tb-line,.tb-account-head,.tb-progress-labels,.tb-history-title,.tb-form-top {justify-content:space-between;gap:12px}
.tb-heading-title,.tb-actions,.tb-form-foot{gap:9px}
.tb-heading-title h2{font-size:clamp(20px,2vw,28px);font-weight:605;line-height:1.5;letter-spacing:-.025em}
.tb-heading-mark {display:grid;place-items:center;border-radius:11px;width:37px;height:37px;color:#c7f1d5;background:#a5e0bf10;border:1px solid #c0f2ce2e}
.tb-modes{display:flex;align-items:center;gap:2px;padding:3px;background:#07110d8c;border:1px solid var(--tb-rule);border-radius:24px}
.tb-workspace button,.tb-workspace summary {font-family:inherit;cursor:pointer}
.tb-mode,.tb-primary,.tb-secondary,.tb-edit,.tb-danger,.tb-text {
  appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;
  min-height:36px;padding:5px 13px;color:var(--tb-ink);font-size:12px;line-height:1.6;
  border:1px solid transparent;border-radius:10px;background:transparent;
}
.tb-workspace .tb-mode{min-height:32px;border-radius:18px;padding-inline:11px;color:#afc1b6}
.tb-mode[aria-pressed=true]{color:#f2fff5;background:linear-gradient(155deg,#3b5946,#253b30);border-color:#a2e8b83b}
.tb-workspace[data-mode=actual] .tb-mode[aria-pressed=true]{background:linear-gradient(150deg,#46525d,#313c43);border-color:#babfda40;color:#f2f5ff}
.tb-primary{background:linear-gradient(162deg,#baf4c9,#7dddab);color:#0e2b1a;font-weight:650;border-color:#c8ffdb9c;box-shadow:inset 0 1px #edfff460}
.tb-secondary,.tb-edit{background:#b4d8c60b;border-color:var(--tb-rule);color:#d9e6dd}
.tb-edit{min-height:30px;align-self:flex-start;padding:3px 9px;font-size:11px;border-radius:8px}
.tb-first-opening{background:#c6efcf;color:#123120;border-color:#ceefd9}
.tb-danger{color:#ffbeb9;background:#ee837317;border-color:#ee83734a}
.tb-text{color:#bdcbbf;min-height:28px;padding:0 2px;font-size:11px}
.tb-workspace button:disabled{opacity:.5;cursor:wait}
.tb-workspace :is(button,summary,input,select,textarea):focus-visible{outline:2px solid #abedc3;outline-offset:3px}
.tb-workspace :is(.tb-primary,.tb-secondary,.tb-edit,.tb-mode):hover:not(:disabled){filter:brightness(1.16)}
.tb-status,.tb-form-message{display:flex;align-items:center;flex-wrap:wrap;gap:8px;color:#e7d2a4;font-size:12px}
.tb-status:empty,.tb-form-message:empty,.tb-form-host:empty{display:none}
.tb-summary{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:11px}
.tb-goal,.tb-account,.tb-history,.tb-form{border:1px solid var(--tb-rule);border-radius:15px;min-width:0}
.tb-goal,.tb-account{display:flex;flex-flow:column;padding:clamp(15px,1.7vw,25px);min-height:168px}
.tb-goal{position:relative;background:radial-gradient(ellipse at 103% 0%,#42895e30,transparent 65%),linear-gradient(135deg,#102218,#14281f 65%,#1c3026);border-top-color:#abdfba50}
.tb-workspace[data-mode=actual] .tb-goal{background:radial-gradient(ellipse at 100% 0%,#52677839,transparent 65%),linear-gradient(135deg,#142122,#1a2927)}
.tb-account,.tb-history,.tb-form{background:linear-gradient(142deg,#202723eb,#131a17 76%)}
.tb-goal h3,.tb-account h3,.tb-label{font-weight:450;font-size:12px;color:var(--tb-muted);line-height:1.6}
.tb-line,.tb-account-head{align-items:flex-start}
.tb-target{display:inline-flex;align-items:center;flex-wrap:wrap;gap:5px;color:var(--tb-brass);font-size:11px;font-weight:500}
.tb-target bdi{font:540 14px/1.4 system-ui,sans-serif}
.tb-profit,.tb-equity>bdi,.tb-item-amount,.tb-metric>bdi,.tb-remaining>bdi{font-family:system-ui,sans-serif;font-variant-numeric:tabular-nums}
.tb-profit{display:block;align-self:flex-start;font-size:clamp(39px,4vw,63px);font-weight:435;line-height:1.16;letter-spacing:-.038em;margin:2px 0 15px}
.tb-profit[data-sign=up],.tb-item-amount[data-sign=up]{color:var(--tb-green)}
.tb-goal-reading {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 10px}
.tb-curve{max-width:126px;margin:0 0 5px;color:#afcbb5;font-size:10px;text-align:center}
.tb-curve svg{display:block;width:100%;height:31px;color:#c2e5ca;direction:ltr}
.tb-profit[data-sign=down],.tb-item-amount[data-sign=down]{color:var(--tb-red)}
.tb-progress{display:block;appearance:none;width:100%;height:7px;margin-top:auto;background:#0a1510;border:0;border-radius:5px;overflow:hidden;accent-color:#a4edbb}
.tb-progress::-webkit-progress-bar{background:#0a1510;border-radius:5px;box-shadow:inset 0 0 0 1px #c9efd214}
.tb-progress::-webkit-progress-value{background:linear-gradient(90deg,#5bbe8f,#baf5c3);border-radius:5px}
.tb-progress::-moz-progress-bar{background:#93e8b6;border-radius:5px}
.tb-progress-labels{margin-top:7px;gap:6px;flex-wrap:wrap;color:#b2c6b9;font-size:11px}
.tb-remaining{display:inline-flex;align-items:baseline;gap:4px}.tb-remaining bdi{font-size:14px;color:#e4f3e9}
.tb-equity>bdi{display:block;font-weight:470;font-size:clamp(28px,2.7vw,40px);letter-spacing:-.035em;line-height:1.4}
.tb-breakdown{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin-top:auto;padding-top:12px;border-top:1px solid var(--tb-rule)}
.tb-metric{display:flex;flex-direction:column;min-width:0;gap:3px}
.tb-breakdown>.tb-metric+.tb-metric{border-inline-start:1px solid var(--tb-rule);padding-inline-start:13px}
.tb-metric>bdi{align-self:flex-start;overflow-wrap:anywhere;font-size:15px;font-weight:520;line-height:1.4}
.tb-scenario{grid-column:1/-1;color:#ccdacd;font-size:12px}
.tb-workspace summary{list-style:none}
.tb-workspace summary::-webkit-details-marker{display:none}
.tb-scenario summary,.tb-form-more summary{display:flex;align-items:center;gap:7px;min-height:30px;width:fit-content}
.tb-scenario summary>svg:first-child{color:var(--tb-brass)}.tb-scenario[open] summary>svg:last-child,.tb-record[open]>summary>svg:last-child{transform:rotate(180deg)}
.tb-scenario p{max-width:82ch;margin:5px 0 0;line-height:1.8;color:var(--tb-muted)}
.tb-form,.tb-history{padding:clamp(15px,1.55vw,22px)}
.tb-form{border-color:#80b99556;background:linear-gradient(135deg,#17241c,#121a16)}
.tb-form h3,.tb-history-title h3{font-size:17px;line-height:1.45;font-weight:600}
.tb-scope{font-size:11px;color:#c2ddc9;border:1px solid #8ba39545;padding:1px 7px;border-radius:12px}
.tb-form-help,.tb-empty,.tb-review p,.tb-record-note{color:var(--tb-muted);font-size:12px;line-height:1.8}
.tb-form>.tb-form-help{margin-top:8px}
.tb-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:15px 0}
.tb-field{display:flex;flex-direction:column;align-items:stretch;gap:5px;min-width:0;color:#d2e1d6;font-size:12px}
.tb-field.tb-wide{grid-column:1/-1}
.tb-workspace .tb-field :is(input,select,textarea){width:100%;min-width:0;min-height:40px;margin:0;padding:6px 10px;color:#f0f5f1;font:inherit;border:1px solid #8ca3954a;border-radius:8px;background:#0c1410}
.tb-workspace .tb-field input[dir=ltr]{font-family:system-ui,sans-serif;font-size:14px;font-variant-numeric:tabular-nums}
.tb-field textarea{resize:vertical}.tb-form-more{margin:12px 0;font-size:12px;color:#c9dece}
.tb-form-more summary{text-decoration:underline;text-underline-offset:4px}
.tb-form-foot{flex-wrap:wrap;margin-top:12px}
.tb-form[data-kind=opening] .tb-fields{grid-template-columns:minmax(120px,270px)}
.tb-history-title{padding-bottom:10px;border-bottom:1px solid var(--tb-rule)}
.tb-today{align-items:flex-end}.tb-today>bdi{align-self:flex-end}
.tb-history .tb-empty{margin:12px 0 0}
.tb-records{max-height:430px;overflow:auto;scrollbar-width:thin}
.tb-record{border-bottom:1px solid #bfdec411}
.tb-record>summary{display:grid;align-items:center;grid-template-columns:34px minmax(0,1fr) auto 16px;gap:10px;min-height:58px;padding:6px 2px}
.tb-entry-icon{width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:#cce6d20a;border:1px solid #d9f9e01f;color:#bcd3c5}
.tb-entry-copy,.tb-entry-copy strong{display:flex}.tb-entry-copy{flex-direction:column;min-width:0}.tb-entry-copy strong{align-items:baseline;gap:6px;line-height:1.4}
.tb-entry-copy bdi{overflow-wrap:anywhere;font-size:14px}
.tb-entry-copy small,.tb-entry-copy time{font-size:10.5px;color:#aabbad;font-weight:430}
.tb-record[data-voided=true] .tb-item-amount{text-decoration:line-through;color:#a5aea7}
.tb-entry-copy small.tb-voided{color:#eed4aa}.tb-item-amount{font-size:16px;color:#e6efe8}
.tb-record>summary>svg:last-child{color:#9eb2a4}
.tb-record-body{padding:3px 0 12px}
.tb-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:10px;padding:9px;border-radius:8px;background:#09120d69}
.tb-fact{min-width:0}.tb-fact dt{color:#a6b9ab;font-size:11px}.tb-fact bdi{font:500 13px system-ui,sans-serif;overflow-wrap:anywhere}
.tb-void-confirm{display:flex;align-items:center;flex-wrap:wrap;gap:7px;color:#e5c5bd;font-size:12px;margin-top:5px}
.tb-review{padding-top:12px}.tb-review h4{font-size:13px;font-weight:600}
.tb-history>.tb-secondary{margin-top:8px}
@media(max-width:820px){.tb-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.tb-summary{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}}
@media(max-width:680px){
  .tb-workspace{gap:12px}.tb-heading{align-items:flex-start;flex-wrap:wrap;gap:6px}
  .tb-summary{grid-template-columns:minmax(0,1fr);gap:8px}
  .tb-goal{min-height:150px}.tb-account{min-height:135px}
  .tb-heading-title h2{font-size:20px}.tb-primary,.tb-secondary,.tb-edit,.tb-workspace .tb-mode{min-height:40px}
  .tb-workspace .tb-mode{padding-inline:9px;font-size:11px}.tb-mode svg{width:14px}
  .tb-metric>bdi{font-size:14px}.tb-target{gap:4px}.tb-goal,.tb-account{padding:14px}
  .tb-fields{gap:9px}.tb-form-message{flex-basis:100%}.tb-form-foot{gap:6px}
  .tb-field input,.tb-field select,.tb-field textarea{font-size:16px}
}
@media(max-width:390px){
  .tb-heading-mark{display:none}.tb-heading-title h2{font-size:18px}
  .tb-actions{gap:6px;flex-wrap:wrap}.tb-actions button{padding-inline:9px}
  .tb-progress-labels,.tb-label{font-size:11px}.tb-breakdown>.tb-metric+.tb-metric{padding-inline-start:6px}
  .tb-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.tb-field:has([type=datetime-local]){grid-column:1/-1}
}
