*{box-sizing:border-box}
:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#252e29;background:#f7f3ea;font-size:16px;line-height:1.5;font-synthesis:none;--ink:#263c36;--muted:#515a52;--rule:#c7c8bb;--paper:#fffdf7;--success:#eaf0e5}
html{width:100%;min-width:0;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;width:100%;min-width:0;border-top:8px solid var(--ink)}
button,input{font:inherit}
button,a,input{touch-action:manipulation}
button{min-height:44px;min-width:44px;max-width:100%;padding:10px 14px;border:1px solid #858b7e;border-radius:4px;background:var(--paper);color:var(--ink);font-size:14px;font-weight:600;cursor:pointer;line-height:1.4;overflow-wrap:anywhere}
button:hover:not(:disabled){background:#e4e8db;border-color:var(--ink)}
button:disabled{cursor:not-allowed;color:#63685d;background:#e2e2d8;border-color:#a8ac9f}
:focus-visible{outline:3px solid #226b94;outline-offset:3px}
input:focus-visible{outline-offset:2px}
a{color:var(--ink);text-underline-offset:5px}
h1,h2,h3,p{margin:0;overflow-wrap:anywhere}
h1{font-size:clamp(29px,3vw,40px);line-height:1.15;letter-spacing:-1.3px;font-weight:750}
h2{font-size:22px;line-height:1.25;letter-spacing:-.45px}
h3{font-size:20px;line-height:1.35;letter-spacing:-.35px}
.masthead{width:100%;max-width:1536px;margin:auto;display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding:26px 32px 20px;border-bottom:1px solid var(--rule)}
.masthead>div{min-width:0}
.masthead a{display:inline-flex;align-items:center;min-height:44px;flex-shrink:0;margin-top:8px}
.eyebrow{text-transform:uppercase;letter-spacing:1.8px;font-size:12px;font-weight:700;color:var(--muted);margin-bottom:8px}
.subtitle{font-size:17px;color:var(--muted);margin-top:8px}
main{width:100%;min-width:0;max-width:1536px;margin:auto;padding:14px 32px 0}
.toolbar,.example-tools,.file-tools{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0;max-width:100%}
.toolbar{justify-content:space-between;gap:12px}
.tag{font-size:12px;text-transform:uppercase;letter-spacing:1px;font-weight:700;background:#e9dfc5;color:#534222;padding:5px 8px;border:1px solid #cbbb93}
.quiet{background:transparent;border-color:transparent;text-decoration:underline;text-underline-offset:4px}
.notice{min-height:40px;padding:10px 0 12px;font-size:14px;color:var(--muted);overflow-wrap:anywhere}
.notice.error{color:#8b2924;font-weight:600}
.bench{display:grid;grid-template-columns:344px minmax(0,1fr);gap:32px;align-items:start;min-width:0}
.bench>*{min-width:0}
.editor{padding:22px 24px;background:#eeebdd;border:1px solid var(--rule);border-radius:5px}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;flex-wrap:wrap}
output{font-size:14px;color:var(--muted);font-variant-numeric:tabular-nums}
.help{font-size:14px;color:var(--muted);line-height:1.5}
.token-row{border:0;border-bottom:1px solid #d3d0c2;margin:16px 0;padding:0 0 14px;min-width:0}
.token-row legend{padding:0;font-size:14px;font-weight:700;margin-bottom:6px;display:flex;align-items:center;gap:7px}
.token-fields{display:grid;grid-template-columns:minmax(0,1fr) 75px 44px;gap:8px;align-items:end}
.field{min-width:0}
label{font-size:14px;font-weight:600;display:block;overflow-wrap:anywhere}
.field label{margin-bottom:5px}
input[type=text],input[type=number]{display:block;width:100%;min-width:0;min-height:44px;border:1px solid #858b7e;border-radius:3px;background:var(--paper);color:#252e29;padding:8px 10px;font-size:16px}
input[type=number]{font-variant-numeric:tabular-nums}
input:disabled{background:#e2e0d5;color:#596051}
input[aria-invalid=true]{border:2px solid #a3342d}
.remove-token{font-size:24px;padding:3px;min-width:44px;font-weight:400;text-decoration:none}
.field-error{font-size:13px;color:#8b2924;line-height:1.45;margin-top:6px;font-weight:600;overflow-wrap:anywhere}
.wide{width:100%}
.secondary{background:#f7f3ea}
.draw-control{display:grid;grid-template-columns:minmax(0,1fr) 88px;align-items:center;gap:12px;margin-top:22px}
.draw-control label{font-size:16px}
.rules{border-top:1px solid var(--rule);margin-top:20px;padding-top:18px}
.rules>.help{margin-top:7px}
.requirement-row{margin-top:14px}
.requirement-fields{display:grid;grid-template-columns:minmax(0,1fr) 80px;gap:12px;align-items:end}
.check-label{min-height:44px;display:flex;align-items:center;gap:8px;cursor:pointer;overflow-wrap:anywhere;font-size:16px;font-weight:500;min-width:0}
.check-label>span{min-width:0}
input[type=checkbox]{width:22px;height:22px;flex-shrink:0;accent-color:var(--ink);margin:0 3px 0 0}
.assumptions{margin:22px 0 18px;padding:14px 0;border-top:1px solid var(--rule);font-size:16px;color:#414a41}
.assumptions strong{font-weight:600}
.assumptions p{font-size:13px;margin-top:6px}
.primary{background:var(--ink);border-color:var(--ink);color:white}
.primary:hover:not(:disabled){background:#355a4d;color:white}
#calculate{font-size:17px;min-height:52px}
#validation-summary{margin-top:10px;font-size:13px}
.workspace,#working-ledger,#baseline-ledger{min-width:0;max-width:100%}
.workspace-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px}
.workspace-heading .eyebrow{margin:0;flex-shrink:0}
.workspace-heading .help{font-size:12px;text-align:right}
.comparison-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(175px,.85fr);background:var(--paper);border:1px solid var(--rule);border-radius:5px;min-width:0}
.summary,.difference{padding:22px;min-width:0}
.summary+.summary,.difference{border-left:1px solid #d7d7ca}
.summary h2,.difference h2{font-size:15px;color:var(--muted);letter-spacing:0;font-weight:600;line-height:1.4}
.hero{display:flex;align-items:center;gap:15px;margin:20px 0 14px;flex-wrap:wrap;min-width:0}
.hero>div:not(.bag){flex:1 1 100px;min-width:0;max-width:100%}
.rate{font-size:clamp(35px,3.7vw,58px);font-weight:750;line-height:1.05;letter-spacing:-2px;color:var(--ink);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.fraction{font-size:14px;color:var(--muted);margin-top:8px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.bag{width:94px;flex:0 0 94px;position:relative;padding-top:13px}
.bag:before{content:"";display:block;position:absolute;width:46px;height:12px;top:0;left:24px;border:2px solid #8f7958;border-bottom:4px double #8f7958;border-radius:0 0 4px 4px;background:#eadbc0;transform:rotate(-3deg)}
.bag-tokens{display:grid;grid-template-columns:repeat(4,15px);gap:5px;align-content:center;justify-content:center;min-height:86px;padding:13px 9px 17px;border:2px solid #8f7958;border-radius:26px 26px 35px 35px;background:#f1e5cc}
.token{display:inline-block;width:15px;height:15px;border:1.5px solid #80571c;border-radius:50%;background:#d7972d;flex-shrink:0;vertical-align:middle}
.tone-1{background:#407da5;border-color:#244d6b}
.tone-2{background:#aa718f;border-color:#683d56}
.tone-3{background:#6f8a55;border-color:#405332}
.config-tokens{list-style:none;margin:0 0 9px;padding:0;display:flex;flex-wrap:wrap;gap:5px 12px;font-weight:650;font-size:16px}
.config-tokens li{display:flex;align-items:center;gap:6px;overflow-wrap:anywhere;min-width:0;max-width:100%}
.config-tokens li span:last-child{min-width:0}
.config-rule{font-size:14px;color:var(--muted);overflow-wrap:anywhere}
.config-rule+.config-rule{margin-top:4px}
.empty-summary{font-size:16px;color:var(--muted);margin:20px 0 12px}
.empty-summary strong{display:block;color:var(--ink);font-size:20px;line-height:1.35;margin-bottom:8px}
.difference-number{font-size:clamp(32px,3.8vw,54px);font-weight:750;line-height:1.12;letter-spacing:-1px;font-variant-numeric:tabular-nums;margin-top:23px;overflow-wrap:anywhere;color:#2c6249}
.difference-number.negative{color:#754a30}
.difference-label{font-size:15px;color:var(--muted);margin:5px 0 18px}
.difference .help{margin:20px 0}
.difference button{width:100%;margin-top:8px}
.ledger-section{margin-top:26px;min-width:0;max-width:100%}
.ledger-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.ledger-heading p{font-size:14px;color:var(--muted);font-variant-numeric:tabular-nums}
.table-scroll{overflow:auto;width:100%;min-width:0;max-width:100%;border-bottom:1px solid #adb7a5}
table{border-collapse:separate;border-spacing:0;width:100%;min-width:650px;font-size:15px;font-variant-numeric:tabular-nums}
th,td{padding:13px 14px;border-bottom:1px solid #ccd2c3;text-align:right;vertical-align:middle;background:var(--paper)}
thead th{background:#e9e7db;color:#414a41;font-size:14px;font-weight:600;padding-top:8px;padding-bottom:8px;white-space:nowrap}
tbody th{font-weight:500}
th:first-child{text-align:left;min-width:220px;max-width:360px;position:sticky;left:0;z-index:1}
thead th:first-child{z-index:2}
th:last-child,td:last-child{text-align:left;white-space:nowrap}
.succeeds th,.succeeds td{background:var(--success)}
.outcome-success{color:#2c6249;font-weight:650}
.outcome-fail{color:#665346}
.composition{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;overflow-wrap:anywhere;min-width:0}
.composition-part{display:inline-flex;align-items:center;gap:5px;min-width:0;max-width:100%}
.composition-part span:last-child{min-width:0;overflow-wrap:anywhere}
.composition .token{width:12px;height:12px}
.exact-probability{display:block;white-space:nowrap;font-size:13px;color:var(--muted)}
.percentage{white-space:nowrap}
tfoot td,tfoot th{background:#e9e7db;font-weight:650;font-size:14px;border-bottom:0}
.ledger-note{border-top:1px solid var(--rule);padding-top:14px;margin-top:24px;font-size:14px;color:var(--muted)}
.ledger-empty{padding:36px 28px;margin-top:24px;border-top:2px solid var(--ink);border-bottom:1px solid var(--rule);background:repeating-linear-gradient(to bottom,transparent 0,transparent 35px,#e9e5d9 35px,#e9e5d9 36px)}
.ledger-empty h2{font-size:28px;line-height:1.25;max-width:420px}
.ledger-empty>p{max-width:500px;margin-top:12px;color:var(--muted)}
.empty-steps{list-style:none;margin:24px 0 0;padding:0;display:flex;gap:24px;flex-wrap:wrap;font-size:14px}
.empty-steps li{display:flex;align-items:center;gap:8px;min-width:0}
.step-number{display:inline-flex;width:30px;height:30px;flex-shrink:0;align-items:center;justify-content:center;border:1px solid #858b7e;border-radius:50%;font-size:12px;font-weight:700;background:#f7f3ea}
footer{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;border-top:1px solid var(--rule);margin-top:32px;padding:18px 0 24px;color:var(--muted);font-size:13px}
dialog{border:1px solid #858b7e;border-top:5px solid var(--ink);border-radius:5px;padding:26px;background:var(--paper);color:#252e29;width:min(540px,calc(100% - 32px));max-width:calc(100% - 32px);max-height:85vh;overflow:auto}
dialog::backdrop{background:rgb(24 35 28 / 48%)}
dialog h2{margin-bottom:12px}
#confirmation-preview{margin-top:18px;padding-top:14px;border-top:1px solid var(--rule)}
#confirmation-preview:empty{display:none}
#confirmation-preview h3{font-size:16px;margin:12px 0 8px}
.dialog-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:24px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.print-assumptions{display:none}
[hidden]{display:none!important}
.noscript{margin:24px;padding:20px;border:2px solid #8b2924}
@media(min-width:1350px){.summary,.difference{padding:22px 24px}.hero{flex-wrap:nowrap}.rate{font-size:54px}}
@media(max-width:1150px){.bench{grid-template-columns:310px minmax(0,1fr);gap:22px}.editor{padding:20px}.comparison-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.difference{grid-column:1/-1;border-left:0;border-top:1px solid var(--rule);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 20px}.difference h2{grid-column:1/-1}.difference-number{margin-top:4px;font-size:38px}.difference-label{margin-bottom:0}.difference button{align-self:center;margin:0}.difference .help{margin:8px 0}.summary{padding:20px}.workspace-heading{align-items:flex-start}.workspace-heading .help{max-width:200px}.hero{gap:12px}.rate{font-size:42px}}
@media(max-width:850px){.masthead{padding:22px 20px 18px}main{padding:14px 20px 0}.bench{grid-template-columns:280px minmax(0,1fr);gap:18px}.editor{padding:18px 16px}.comparison-grid{grid-template-columns:minmax(0,1fr)}.summary+.summary{border-left:0;border-top:1px solid var(--rule)}.hero{flex-wrap:nowrap}.difference{grid-template-columns:minmax(0,1fr)}.difference h2{grid-column:auto}.workspace-heading{display:block}.workspace-heading .help{max-width:none;text-align:left;margin-top:5px}.token-fields{grid-template-columns:minmax(0,1fr) 65px 44px;gap:6px}.ledger-empty{padding:26px 18px}.ledger-empty h2{font-size:25px}.empty-steps{gap:12px}.rate{font-size:48px}}
@media(max-width:660px){.masthead{padding:20px 16px 16px;gap:12px;flex-wrap:wrap}.masthead a{margin-top:0}h1{font-size:32px}.eyebrow{font-size:12px;letter-spacing:1.4px}main{padding:12px 16px 0}.toolbar{align-items:flex-start}.file-tools{gap:7px}.file-tools button{flex:1 1 auto}.notice{padding-top:12px}.bench{grid-template-columns:minmax(0,1fr);gap:24px}.editor{padding:20px}.token-fields{grid-template-columns:minmax(0,1fr) 80px 44px;gap:8px}.workspace-heading{display:flex}.workspace-heading .help{max-width:175px;text-align:right;margin:0}.summary,.difference{padding:22px}.hero{gap:22px}.rate{font-size:54px}.bag{width:104px;flex-basis:104px}.bag:before{left:29px}.bag-tokens{min-height:96px;grid-template-columns:repeat(4,16px)}.bag-tokens .token{width:16px;height:16px}.ledger-heading{display:block}.ledger-heading p{margin-top:6px}.ledger-empty{padding:28px 20px}.ledger-empty h2{font-size:28px}.empty-steps{display:grid;gap:12px}footer{display:block}footer p+p{margin-top:8px}th:first-child{min-width:190px;max-width:230px}.difference{grid-template-columns:minmax(0,1fr)}.difference-number{font-size:46px}}
@media(max-width:360px){.editor{padding:18px 14px}.token-fields{grid-template-columns:minmax(0,1fr) 68px 44px;gap:6px}.hero{gap:12px;flex-wrap:wrap}.workspace-heading{display:block}.workspace-heading .help{text-align:left;max-width:none;margin-top:6px}.summary,.difference{padding:18px}}
@media(prefers-reduced-motion:no-preference){button{transition:background-color .12s,border-color .12s}}
@media print{
@page{margin:14mm;size:landscape}
html,body{width:100%;min-width:0;max-width:100%}
body{border:0;background:white;color:#111;font-size:16px}
.masthead{padding:0 0 12px;max-width:100%;display:block}
.masthead a,.toolbar,.notice,.editor,footer,dialog,button,.workspace-heading,.ledger-empty,.noscript{display:none!important}
main{padding:0;max-width:100%;width:100%}
.masthead h1{font-size:28px}.subtitle{font-size:14px}.eyebrow{font-size:12px}
.bench{display:block;min-width:0}.workspace{width:100%;max-width:100%;min-width:0}
.print-assumptions{display:block;font-size:12px;margin:14px 0}
.comparison-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;max-width:100%;border-radius:0;break-inside:avoid}
.summary,.difference{padding:14px;display:block;grid-column:auto;min-width:0}
.difference{border-top:0;border-left:1px solid var(--rule)}
.summary+.summary{border-top:0;border-left:1px solid var(--rule)}
.summary h2,.difference h2{font-size:14px}
.rate{font-size:36px}.difference-number{font-size:32px}.bag{display:none}
.hero{display:block;margin:12px 0}.hero>div:not(.bag){min-width:0;max-width:100%}
.fraction,.config-tokens,.config-rule,.difference-label,.help,.ledger-heading p{font-size:12px}
.ledger-section{margin-top:20px;width:100%;min-width:0;max-width:100%}
.ledger-heading{display:block}.ledger-heading h2{font-size:18px}.ledger-heading p{margin-top:6px}
.table-scroll{overflow:visible;width:100%;min-width:0;max-width:100%}
table{table-layout:fixed;width:100%;min-width:0;max-width:100%;font-size:12px}
thead{display:table-header-group}
th,td{padding:7px 8px;min-width:0;max-width:none;white-space:normal;overflow-wrap:anywhere;word-break:normal}
thead th,tfoot td,tfoot th,.exact-probability{font-size:12px}
th:first-child{position:static;left:auto;min-width:0;max-width:none;width:36%}
th:nth-child(2){width:18%}th:nth-child(3){width:25%}th:nth-child(4){width:21%}
th:last-child,td:last-child,.exact-probability,.percentage{white-space:normal;overflow-wrap:anywhere}
.composition{display:block;min-width:0}.composition-part{display:flex;min-width:0;max-width:100%;margin:3px 0;gap:4px}
.composition-part span:last-child{min-width:0;overflow-wrap:anywhere}
tr{break-inside:avoid}.ledger-note{font-size:12px}.empty-summary{font-size:14px}.composition .token{width:12px;height:12px}
*{print-color-adjust:exact;-webkit-print-color-adjust:exact}
}
@media print and (max-width:660px){
.comparison-grid{grid-template-columns:minmax(0,1fr)}
.summary,.difference{padding:12px;break-inside:avoid}
.summary+.summary,.difference{border-left:0;border-top:1px solid var(--rule)}
.rate{font-size:32px}.difference-number{font-size:28px;margin-top:8px}
th,td{padding:7px 4px}
}
