/* Route-scoped styles for the BRRRR and Land Development calculator pages.
   Mirrors the approved Fix & Flip standalone treatment (premium-tools-standalone.css) for #calcView only.
   No shared Home, Deal Analysis or existing calculator styles are changed. */
body.ds-calc-page #calcView{position:relative;display:block;width:100%;max-width:100%;min-width:0;margin:0;padding:0;color:var(--pt-ink)}
body.ds-calc-page #calcView :is(h2,h3,legend,label){color:var(--pt-ink)!important;opacity:1!important}
body.ds-calc-page #calcView :is(p,.card-sub,.hint,.vsub,.business-note){color:var(--pt-muted)!important;opacity:1!important}
body.ds-calc-page #calcView :is(.card,.ff-topbar){min-width:0!important;max-width:100%!important;background:var(--pt-surface)!important;background-image:none!important;border:1px solid var(--pt-stroke)!important;border-radius:17px!important;box-shadow:var(--mc-shadow)!important;color:var(--pt-ink)!important}
body.ds-calc-page #calcView :is(input:not([type=checkbox]),select){width:100%;max-width:100%!important;min-width:0!important;min-height:43px!important;box-sizing:border-box!important;border-radius:9px!important;background:var(--mc-field)!important;background-image:none!important;border:1px solid #8ca6b2!important;color:var(--mc-field-text)!important;opacity:1!important;box-shadow:none!important;font:600 14px/1.45 Inter,Arial,sans-serif!important;padding:9px 11px}
body.ds-calc-page #calcView input::placeholder{color:#596977!important;opacity:1!important}
body.ds-calc-page #calcView input[readonly]{background:var(--pt-tint)!important;color:var(--pt-ink)!important}
body.ds-calc-page #calcView :is(input,select,button):focus-visible{outline:3px solid #14927c!important;outline-offset:2px!important}
body.ds-calc-page #calcView :is(input,select).attention-required,body.ds-calc-page #calcView :is(input,select)[aria-invalid=true]{border:2px solid #c45f2b!important;box-shadow:0 0 0 3px rgba(196,95,43,.16)!important}
body.ds-calc-page #calcView button{cursor:pointer}
body.ds-calc-page #calcView :is(.clear-section-btn,.ff-mode-btn){border:1px solid var(--pt-stroke)!important;background:var(--pt-tint)!important;color:var(--pt-ink)!important;border-radius:9px!important;font:700 13px/1.35 Inter,Arial,sans-serif!important;padding:10px 14px!important}
body.ds-calc-page #calcView .ff-mode-btn.active{background:#147966!important;color:#fff!important;border-color:#147966!important}
body.ds-calc-page #calcView .ff-mode-toggle{display:flex;gap:4px;padding:4px;border:1px solid var(--pt-stroke);border-radius:12px;background:var(--pt-tint)}
body.ds-calc-page #calcView .ff-topbar{padding:24px!important;display:flex!important;flex-wrap:wrap!important;gap:12px!important;align-items:center!important;justify-content:space-between;margin:0 0 18px!important}
body.ds-calc-page #calcView .ff-topbar h2{font:700 clamp(25px,3vw,33px)/1.2 'Space Grotesk',Inter,sans-serif!important;margin:2px 0 5px!important}
body.ds-calc-page #calcView .ff-topbar .ff-kicker{color:#1d68ac!important;font-size:12px;letter-spacing:.18em;font-weight:800}
body.ds-calc-page #calcView .calc-mode-groups{display:flex;flex-wrap:wrap;gap:8px}
body.ds-calc-page #calcView .calc-strip{position:static!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px!important;padding:15px!important;margin:0 0 18px!important;border:1px solid var(--pt-stroke)!important;border-radius:17px!important;background:var(--pt-surface)!important;box-shadow:var(--mc-shadow)!important;color:var(--pt-ink)!important}
body.ds-calc-page #calcView .calc-strip>.vcell{min-width:0!important;margin:0!important;padding:16px!important;border:1px solid var(--pt-stroke)!important;border-radius:12px!important;background:var(--pt-tint)!important;color:var(--pt-ink)!important}
body.ds-calc-page #calcView .calc-strip>.vcell:nth-child(1){background:#e4f3fa!important}
body.ds-calc-page #calcView .calc-strip>.vcell:nth-child(2){background:#f1e9ff!important}
body.ds-calc-page #calcView .calc-strip>.vcell:nth-child(3){background:#e4f6ee!important}
body.ds-calc-page #calcView .calc-strip>.vcell:nth-child(4){background:#fff3dc!important}
body.ds-calc-page #calcView .calc-strip .vlabel{color:#31465b!important;font-weight:800!important;font-size:13px}
body.ds-calc-page #calcView .calc-strip .vvalue{color:#15283d!important;font:750 clamp(21px,2.4vw,30px)/1.15 'Space Grotesk',Inter,sans-serif!important;overflow-wrap:anywhere!important;margin:6px 0 4px}
body.ds-calc-page #calcView .calc-strip .vsub{color:#415567!important;font-size:12px}
body.ds-calc-page #calcView .calc-strip .deal-verdict-row{grid-column:1/-1!important;margin:0!important;padding:14px 17px!important;background:var(--pt-tint)!important;border:1px solid var(--pt-stroke)!important;border-radius:12px!important}
body.ds-calc-page #calcView .calc-strip .deal-verdict-reason{color:var(--pt-ink)!important;font-weight:700}
body.ds-calc-page #calcView .badge-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
body.ds-calc-page #calcView .badge{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:800;border:1px solid var(--pt-stroke);color:#273e51!important;background:rgba(255,255,255,.6)}
body.ds-calc-page #calcView .badge.pass{background:#dbf2e9;border-color:#8fd3b6;color:#0c654f!important}
body.ds-calc-page #calcView .badge.fail{background:#fbe4dc;border-color:#e6a58d;color:#9b4937!important}
body.ds-calc-page #calcView .calc-card{padding:25px 26px!important;margin:0 0 18px!important}
body.ds-calc-page #calcView .calc-card h2{font:700 23px/1.25 'Space Grotesk',Inter,sans-serif!important;margin:0 0 9px!important}
body.ds-calc-page #calcView .calc-card h3{font:700 16px/1.3 Inter,Arial,sans-serif!important;margin:18px 0 8px!important}
body.ds-calc-page #calcView .calc-card .grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:16px 20px!important}
body.ds-calc-page #calcView .field{min-width:0;display:flex;flex-direction:column;gap:6px}
body.ds-calc-page #calcView [hidden]{display:none!important}
body.ds-calc-page #calcView .field label{font:700 13px/1.45 Inter,Arial,sans-serif!important}
body.ds-calc-page #calcView .field .hint{font-size:12px;line-height:1.45}
body.ds-calc-page #calcView .optional-label{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--pt-muted)!important;font-weight:700;margin-left:6px}
body.ds-calc-page #calcView .calc-check{justify-content:center}
body.ds-calc-page #calcView .checkbox-label{display:flex!important;gap:10px;align-items:flex-start;font-weight:700}
body.ds-calc-page #calcView .checkbox-label input{width:18px;height:18px;margin-top:2px;flex:0 0 auto}
body.ds-calc-page #calcView .ff-itemized-block{background:var(--pt-tint)!important;border:1px solid var(--pt-stroke)!important;border-radius:12px!important;padding:15px!important;margin:16px 0!important}
body.ds-calc-page #calcView .ff-subheading{font-size:12px;letter-spacing:.14em;text-transform:uppercase;font-weight:800;color:var(--pt-ink)!important;margin-bottom:10px}
body.ds-calc-page #calcView .calc-group-note{margin:0 0 10px}
body.ds-calc-page #calcView .clear-section-row{margin-top:16px;display:flex;justify-content:flex-end}
body.ds-calc-page #calcView .ff-target-card{border-top:3px solid #2F9E8F!important}
body.ds-calc-page #calcView .ff-draw-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
body.ds-calc-page #calcView .ff-draw-total{margin-top:8px;font-size:12px;font-weight:800;color:var(--pt-muted)}
body.ds-calc-page #calcView .ff-draw-total.bad{color:#b34f38}
body.ds-calc-page #calcView .future-metrics{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important}
body.ds-calc-page #calcView .future-metric{background:var(--pt-tint)!important;color:var(--pt-ink)!important;border:1px solid var(--pt-stroke)!important;border-radius:12px!important;padding:14px!important;min-width:0!important;overflow-wrap:anywhere!important}
body.ds-calc-page #calcView .fm-label{font-size:12px;font-weight:800;color:var(--pt-muted)}
body.ds-calc-page #calcView .fm-value{font:750 22px/1.2 'Space Grotesk',Inter,sans-serif;color:var(--pt-ink)!important;margin:6px 0 4px}
body.ds-calc-page #calcView .fm-note{font-size:11.5px;color:var(--pt-muted);line-height:1.4}
body.ds-calc-page #calcView .calc-two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}
body.ds-calc-page #calcView .calc-rows{margin:0;display:grid;gap:0}
body.ds-calc-page #calcView .calc-row{display:flex;justify-content:space-between;gap:14px;padding:8px 0;border-top:1px solid var(--pt-stroke)}
body.ds-calc-page #calcView .calc-row dt{margin:0;color:var(--pt-ink);font-size:13.5px}
body.ds-calc-page #calcView .calc-row dd{margin:0;font-family:var(--mono,ui-monospace,monospace);font-weight:700;text-align:right;white-space:nowrap;color:var(--pt-ink)}
body.ds-calc-page #calcView .calc-row.strong dt,body.ds-calc-page #calcView .calc-row.strong dd{font-weight:900}
body.ds-calc-page #calcView .calc-warning{margin-top:12px;padding:12px 14px;border-radius:11px;background:rgba(210,135,75,.12);border:1px solid rgba(210,135,75,.35);color:#8b4f22;font-weight:700;font-size:13.5px}
body.ds-calc-page #calcView .calc-warning.shortfall{background:rgba(188,85,62,.12);border-color:rgba(188,85,62,.45);color:#8e3b28}
body.ds-calc-page #calcView .ff-stress-card{border-top:3px solid #d2874b!important}
body.ds-calc-page #calcView .ff-stress-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
body.ds-calc-page #calcView .ff-stress-scenario{border:1px solid var(--pt-stroke);border-radius:14px;padding:16px;background:var(--pt-tint)}
body.ds-calc-page #calcView .ff-scenario-title{font-size:18px;font-weight:900}
body.ds-calc-page #calcView .ff-scenario-assumption{font-size:12px;color:var(--pt-muted);min-height:34px;margin:4px 0 12px}
body.ds-calc-page #calcView .ff-scenario-metric{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-top:1px solid var(--pt-stroke);font-size:13px}
body.ds-calc-page #calcView .ff-scenario-metric strong{font-family:var(--mono,ui-monospace,monospace);text-align:right}
body.ds-calc-page #calcView .ff-scenario-target{margin-top:10px;padding:8px;border-radius:9px;text-align:center;font-weight:900;font-size:12px;background:rgba(0,0,0,.04)}
body.ds-calc-page #calcView .ff-scenario-target.pass{background:rgba(68,152,116,.13);color:#2f795b}
body.ds-calc-page #calcView .ff-scenario-target.fail{background:rgba(188,85,62,.10);color:#9b4937}
body.ds-calc-page #calcView .calc-table-wrap{overflow-x:auto;max-width:100%;border:1px solid var(--pt-stroke);border-radius:12px;margin:8px 0 6px}
body.ds-calc-page #calcView .calc-table{width:100%;min-width:560px;border-collapse:collapse;font-size:13px}
body.ds-calc-page #calcView .calc-table :is(th,td){padding:9px 10px;border-bottom:1px solid var(--pt-stroke);text-align:right;font-family:var(--mono,ui-monospace,monospace);white-space:nowrap;color:var(--pt-ink)}
body.ds-calc-page #calcView .calc-table thead th{background:var(--pt-tint);font-family:Inter,Arial,sans-serif;font-weight:800}
body.ds-calc-page #calcView .calc-table tbody th{text-align:left;background:var(--pt-tint);font-weight:800}
body.ds-calc-page #calcView .calc-table td.base-cell{outline:2px solid #147966;outline-offset:-2px;font-weight:900}
body.ds-calc-page #calcView .calc-table td.bad{color:#a2412c}
body.ds-calc-page #calcView .calc-table td.good{color:#0c654f}
body.ds-calc-page #calcView .calc-land-line{margin:0 0 14px;padding:10px 14px;border-radius:10px;background:var(--pt-tint);border:1px dashed var(--pt-stroke);font-weight:700;font-size:13.5px;color:var(--pt-ink)}
body.ds-calc-page #calcView details.calc-schedule summary{cursor:pointer;font-weight:800;margin:10px 0;color:var(--pt-ink)}
body.ds-calc-page #calcView .screening-disclaimer{color:var(--pt-muted)!important;background:var(--pt-tint)!important;border:1px solid var(--pt-stroke)!important;border-radius:12px!important;padding:14px 16px;font-size:13px;line-height:1.55}
/* Pro gate — fail closed; hides the calculator until the existing entitlement code grants access */
#calcView.pro-access-locked:not(.pro-access-granted){position:relative;height:350px!important;min-height:350px!important;overflow:hidden!important}
#calcView.pro-access-locked:not(.pro-access-granted)>:not(.pro-lock-overlay){visibility:hidden!important}
#calcView.pro-access-locked:not(.pro-access-granted)>.pro-lock-overlay{position:absolute!important;inset:0!important;z-index:99!important;display:flex!important;visibility:visible!important;align-items:center!important;justify-content:center!important;padding:20px!important;background:var(--pt-surface)!important;color:var(--pt-ink)!important;border:1px solid var(--pt-stroke)!important;border-radius:17px!important}
#calcView.pro-access-granted>.pro-lock-overlay{display:none!important}
/* Page-local What's What dialog */
.calc-help-modal{position:fixed;inset:0;z-index:10050;background:rgba(8,16,29,.66);display:flex;align-items:flex-start;justify-content:center;padding:4vh 16px;overflow-y:auto}
.calc-help-modal[hidden]{display:none!important}
.calc-help-dialog{width:min(100%,880px);background:var(--mc-surface,#fff);color:var(--mc-ink,#15283d);border:1px solid var(--mc-stroke,#d6dde3);border-radius:18px;box-shadow:0 30px 80px rgba(0,0,0,.35);padding:26px 28px}
.calc-help-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:8px}
.calc-help-head h2{margin:2px 0 0;font:700 26px/1.2 'Space Grotesk',Inter,sans-serif;color:inherit}
.calc-help-kicker{font-size:11px;letter-spacing:.16em;font-weight:800;color:#147966;text-transform:uppercase}
.calc-help-close{border:1px solid var(--mc-stroke,#d6dde3);background:var(--mc-tint,#f2f5f4);color:inherit;border-radius:10px;font-size:22px;line-height:1;width:40px;height:40px;cursor:pointer}
.calc-help-body{font-size:14.5px;line-height:1.6}
.calc-help-body h3{margin:22px 0 6px;font:700 18px/1.3 'Space Grotesk',Inter,sans-serif;color:inherit}
.calc-help-body p{margin:6px 0}
.calc-help-body ul{margin:6px 0 6px 20px;padding:0}
.calc-help-body .formula{display:block;margin:6px 0;padding:8px 11px;border-radius:9px;background:var(--mc-tint,#f2f5f4);font-family:var(--mono,ui-monospace,monospace);font-size:13px}
body.calc-help-open{overflow:hidden}
/* Dark mode (approved near-black / brown palette) */
html[data-theme=dark] body.ds-calc-page #calcView :is(input:not([type=checkbox]),select){border-color:#827b6c!important;background:#211f19!important;color:#f7f4ec!important}
html[data-theme=dark] body.ds-calc-page #calcView input::placeholder{color:#bbb4a4!important}
html[data-theme=dark] body.ds-calc-page #calcView .calc-strip>.vcell:nth-child(1){background:#193748!important}
html[data-theme=dark] body.ds-calc-page #calcView .calc-strip>.vcell:nth-child(2){background:#352b50!important}
html[data-theme=dark] body.ds-calc-page #calcView .calc-strip>.vcell:nth-child(3){background:#1b3d32!important}
html[data-theme=dark] body.ds-calc-page #calcView .calc-strip>.vcell:nth-child(4){background:#4a371e!important}
html[data-theme=dark] body.ds-calc-page #calcView .calc-strip .vcell :is(.vlabel,.vvalue,.vsub){color:#f7f4ec!important}
html[data-theme=dark] body.ds-calc-page #calcView .badge{background:#302e25;color:#f7f4ec!important}
html[data-theme=dark] body.ds-calc-page #calcView .badge.pass{background:#264039;color:#a4e5c5!important;border-color:#3f7a66}
html[data-theme=dark] body.ds-calc-page #calcView .badge.fail{background:#4a2a22;color:#f3b8a5!important;border-color:#8a4a38}
html[data-theme=dark] body.ds-calc-page #calcView .calc-warning{background:rgba(210,135,75,.16);color:#f2c49b;border-color:rgba(210,135,75,.45)}
html[data-theme=dark] body.ds-calc-page #calcView .calc-warning.shortfall{background:rgba(188,85,62,.2);color:#f3b8a5}
html[data-theme=dark] body.ds-calc-page #calcView .calc-table td.bad{color:#f3a28c}
html[data-theme=dark] body.ds-calc-page #calcView .calc-table td.good{color:#a4e5c5}
html[data-theme=dark] body.ds-calc-page #calcView .calc-table td.base-cell{outline-color:#a4e5c5}
html[data-theme=dark] body.ds-calc-page #calcView .ff-scenario-target.pass{color:#a4e5c5}
html[data-theme=dark] body.ds-calc-page #calcView .ff-scenario-target.fail{color:#f3b8a5}
html[data-theme=dark] body.ds-calc-page #calcView .ff-topbar .ff-kicker{color:#9cc9f0!important}
html[data-theme=dark] .calc-help-kicker{color:#a4e5c5}
@media(max-width:960px){body.ds-calc-page #calcView .calc-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}body.ds-calc-page #calcView .future-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}body.ds-calc-page #calcView .calc-two-col{grid-template-columns:minmax(0,1fr)}}
@media(max-width:700px){body.ds-calc-page #calcView .ff-stress-grid{grid-template-columns:minmax(0,1fr)}body.ds-calc-page #calcView .ff-scenario-assumption{min-height:0}body.ds-calc-page #calcView .ff-topbar{flex-direction:column;align-items:flex-start!important}body.ds-calc-page #calcView .ff-mode-toggle{width:100%}body.ds-calc-page #calcView .ff-mode-btn{flex:1}body.ds-calc-page #calcView .ff-draw-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){body.ds-calc-page #calcView .calc-card{padding:18px!important}body.ds-calc-page #calcView .calc-card .grid{grid-template-columns:minmax(0,1fr)!important}body.ds-calc-page #calcView .calc-strip{padding:10px!important;gap:8px!important}body.ds-calc-page #calcView .calc-strip>.vcell{padding:12px!important}.calc-help-dialog{padding:18px}}
@media(max-width:420px){body.ds-calc-page #calcView .calc-strip,body.ds-calc-page #calcView .future-metrics{grid-template-columns:minmax(0,1fr)!important}}

/* New calculator header fixes — dark-mode contrast and stable desktop nav. */
html[data-theme="dark"] body.ds-calc-page > header.mc-site-header :is(.mc-main-nav > a,.ds-prof-nav-menu > summary,.ds-prof-en,.ds-prof-es,.ds-prof-chevron){
  color:#f7f4ec!important;
}
html[data-theme="dark"] body.ds-calc-page > header.mc-site-header .ds-prof-nav-menu > summary:hover{color:#b5f0d2!important;}
body.ds-calc-page > header.mc-site-header{overflow:visible!important;}
body.ds-calc-page > header.mc-site-header .mc-main-nav{min-width:0!important;}

/* Official verdict returned by Supabase database functions; thresholds never live in browser code. */
body.ds-calc-page #calcView .official-verdict{display:grid!important;grid-template-columns:minmax(150px,.42fr) minmax(0,1.58fr)!important;align-items:center!important;gap:18px!important;}
body.ds-calc-page #calcView .official-verdict .deal-verdict-title{font:800 18px/1.25 'Space Grotesk',Inter,Arial,sans-serif;color:var(--pt-ink)!important;}
body.ds-calc-page #calcView .official-verdict.strong{background:rgba(47,158,143,.12)!important;border-color:rgba(47,158,143,.38)!important;}
body.ds-calc-page #calcView .official-verdict.workable{background:rgba(216,154,62,.12)!important;border-color:rgba(216,154,62,.35)!important;}
body.ds-calc-page #calcView .official-verdict.weak{background:rgba(179,70,44,.11)!important;border-color:rgba(179,70,44,.34)!important;}
body.ds-calc-page #calcView .official-verdict.is-loading,body.ds-calc-page #calcView .official-verdict.is-unavailable{opacity:.86;}
html[data-theme=dark] body.ds-calc-page #calcView .official-verdict .deal-verdict-title{color:#f7f4ec!important;}
@media(max-width:620px){body.ds-calc-page #calcView .official-verdict{grid-template-columns:1fr!important;gap:6px!important;}}
