/* Functional, local-only workbooks. No fixed-width tables or clipped controls. */
.fw-tool { margin: 18px 0; color: #13362d; min-width: 0; }
.fw-tool * { box-sizing: border-box; }
.fw-tool .fw-intro { font-size: 18px !important; line-height: 1.5 !important; color: #173e32 !important; margin: 0 0 10px; }
.fw-tool .fw-assumptions { font-size: 14px !important; line-height: 1.5 !important; color: #52685f !important; margin: 0 0 20px; }
.fw-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,360px),1fr)); gap: 18px; }
.fw-tool fieldset { border: 1px solid #cfdfd6; border-radius: 16px; padding: 18px; margin: 0; min-width: 0; background: #fff; }
.fw-tool legend { color: #006749; font: 600 19px/1.35 inherit; font-size: 19px; font-weight: 600; padding: 0 8px; }
.fw-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.fw-tool .fw-field { min-width: 0; }
.fw-tool .fw-field label, .fw-tool .fw-check label { display: block; font-size: 15px !important; line-height: 1.4; font-weight: 600; color: #133c30; margin: 0 0 7px; }
.fw-tool input[type=number], .fw-tool select { display: block; width: 100% !important; max-width: 100%; min-width: 0 !important; height: auto; min-height: 46px; border: 1px solid #b6cdc0; border-radius: 9px; background: #fff; color: #163a2e !important; padding: 10px 12px; font-size: 17px !important; font-weight: 500; }
.fw-tool input[type=range] { display: block; width: 100%; margin: 4px 0 0; padding: 0; height: 30px; accent-color: #078c54; cursor: pointer; }
.fw-tool input[aria-invalid=true] { border-color: #b52e26; outline: 2px solid #f0c3ba; }
.fw-tool :is(input,select,button):focus-visible { outline: 3px solid #d3ad48; outline-offset: 3px; }
.fw-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.fw-tool .fw-actions button { font-size: 15px; line-height: 1.3; min-height: 44px; padding: 11px 16px; border: 1px solid #8cae9d; border-radius: 9px; background: #f3f8f4; color: #0a5138; font-weight: 600; cursor: pointer; }
.fw-tool .fw-actions button:first-child { background: #075740; color: #fff; border-color: #075740; }
.fw-tool .fw-example-note { color: #6a4b0b !important; background: #fff5d9; padding: 10px 12px; border-radius: 8px; font-size: 14px !important; }
.fw-result { background: linear-gradient(120deg,#013e32,#07583f); color: #fff; padding: 20px; border-radius: 16px; border-top: 3px solid #d4b35c; margin: 18px 0; }
.fw-result { scroll-margin-top: 110px; }
.fw-tool .fw-result-title { color: inherit !important; font-size: 20px !important; font-weight: 600 !important; margin: 0 0 14px; }
.fw-result[data-state=incomplete] { background: #f3f7f3; color: #244d3a; border-top-color: #b4c9bd; }
.fw-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,160px),1fr)); gap: 12px; }
.fw-metric { min-width: 0; padding: 13px; border: 1px solid #ffffff30; border-radius: 10px; background: #ffffff0a; }
.fw-metric span { display: block; font-size: 14px !important; line-height: 1.45; color: #d7ece1; font-weight: 400; }
.fw-metric strong { display: block; margin-top: 7px; color: #ffe29a !important; font-size: clamp(20px,2vw,26px) !important; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.fw-negative strong { color: #ffcbc2 !important; }
.fw-result .fw-message { color: inherit !important; font-size: 15px !important; line-height: 1.55 !important; margin: 14px 0 0; }
.fw-result[data-state=incomplete] .fw-message { margin-top: 0; }
.fw-chart { display: grid; gap: 8px; margin: 16px 0 0; }
.fw-chart:empty { display: none; }
.fw-bar { display: grid; grid-template-columns: minmax(80px,1fr) minmax(70px,2fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.fw-bar>span:first-child { color: #e3f2e9; font-size: 13px !important; }
.fw-track { height: 8px; background: #ffffff25; border-radius: 10px; overflow: hidden; }
.fw-track i { display: block; height: 100%; background: #e4c97a; border-radius: 10px; }
.fw-bar b { color: #fff; font-weight: 500; }
.fw-checklist { border: 1px solid #d6e3dc; border-radius: 12px; background: #fafcf9; margin-top: 16px; }
.fw-tool .fw-checklist>summary { display: block; padding: 14px 16px; font-size: 16px; font-weight: 600; color: #07533b; cursor: pointer; }
.fw-checklist>summary::after { content: ' +'; }
.fw-checklist[open]>summary::after { content: ' −'; }
.fw-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 0 14px 14px; }
.fw-check { min-width: 0; background: #fff; padding: 14px; border: 1px solid #e1e9e3; border-radius: 9px; }
.fw-tool .fw-check p { font-size: 14px !important; line-height: 1.5 !important; color: #53685d !important; margin: 0 0 12px; overflow-wrap: anywhere; }
.fw-tool .fw-check select { font-size: 15px !important; }
.fw-check-result { padding: 16px; margin: 0 14px 14px; background: #edf5ef; border-left: 3px solid #0a8756; border-radius: 8px; }
.fw-tool .fw-check-result :is(p,li,span) { font-size: 14px !important; line-height: 1.5 !important; color: #335445 !important; }
.fw-check-result ul { padding-left: 20px; margin: 10px 0 0; }
.fw-check-result li { margin-bottom: 8px; }
.fw-tool [hidden] { display: none !important; }
@media(max-width:900px){.fw-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}.fw-fields{grid-template-columns:1fr;}}
@media(max-width:540px){.fw-field-grid,.fw-check-grid{grid-template-columns:1fr;}.fw-tool fieldset{padding:14px;}.fw-result{padding:14px;}.fw-metric{padding:10px;}.fw-check-grid{padding:0 10px 10px;}.fw-tool .fw-intro{font-size:17px!important;}.fw-bar{grid-template-columns:1fr auto;}.fw-track{grid-column:1/-1;grid-row:2;}.fw-actions button{flex:1 1 140px;}.fw-metric strong{font-size:21px!important;}}
@media(min-width:360px) and (max-width:540px){.fw-field-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 10px;}.fw-tool .fw-field label{font-size:14px!important;}.fw-tool input[type=number]{padding:10px 8px;}}
