/* STUDY NOTES: CSS controls appearance. Selectors target HTML elements; media queries adapt layouts to smaller screens. */
:root{color-scheme:dark;--navy:#101a2c;--ink:#e5ecf7;--muted:#a4b2ca;--blue:#8caeff;--line:#2c3a51;--bg:#0b1220;--white:#141f31;--low:#48232d;--mid:#42371d;--high:#183f34;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);font-size:16px}*{box-sizing:border-box}body{margin:0;background:var(--bg)}button,input,select{font:inherit}button,label.button,summary{cursor:pointer}button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #84a9ff;outline-offset:3px}button{border:0}button:disabled{opacity:.45;cursor:not-allowed}.topbar{height:72px;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 36px}.brand{display:flex;gap:12px;align-items:center;font-size:20px;letter-spacing:-.4px}.brand>span:nth-child(2){font-weight:400}.mark{display:grid;place-items:center;width:36px;height:36px;border:1px solid #526689;border-radius:9px;font-size:14px;font-weight:800;letter-spacing:-1px;color:#b8ccff}.version{font-size:12px;background:#283957;border-radius:4px;padding:4px 6px;color:#afc0dd}.top-actions{display:flex;gap:8px}.quiet{background:transparent;color:#d8e3f5;font-size:14px;padding:10px 12px;border-radius:6px}.quiet:hover{background:#263754}main{max-width:1720px;margin:auto;padding:30px 36px}.workspace-head{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}.eyebrow{font-size:12px;font-weight:700;letter-spacing:1.8px;color:var(--blue)}h1{margin:7px 0;font-size:30px;letter-spacing:-1px;line-height:1.3}.source{font-size:14px;color:var(--muted);margin:7px 0 0}.demo-tag{display:inline-block;background:#fff0cb;color:#856017;padding:2px 6px;border-radius:4px;font-weight:600;margin-right:7px}.head-actions{display:flex;gap:10px;align-items:center}.button,.secondary{display:inline-flex;align-items:center;justify-content:center;gap:9px;padding:12px 16px;border-radius:7px;font-size:14px;font-weight:650;white-space:nowrap}.primary{background:var(--blue);color:white;box-shadow:0 3px 9px #315de822}.primary:hover{background:#244ed0}.secondary{background:var(--white);color:var(--ink);border:1px solid var(--line)}.secondary:hover{border-color:#9dadc6}.summary{display:grid;grid-template-columns:repeat(4,1fr);background:var(--white);border:1px solid var(--line);border-radius:10px;margin-bottom:24px;box-shadow:0 2px 8px #18304c03}.summary>div{padding:19px 24px;border-right:1px solid var(--line)}.summary>div:last-child{border:0}.summary span{display:block;font-size:14px;color:var(--muted)}.summary strong{display:block;font-size:31px;letter-spacing:-1px;margin:3px 0;font-variant-numeric:tabular-nums}.summary small{font-size:12px;color:var(--muted)}.layout{display:grid;grid-template-columns:248px minmax(0,1fr);gap:22px;align-items:start}.model-panel{background:var(--white);border:1px solid var(--line);border-radius:10px;padding:20px;position:sticky;top:20px}.panel-title{display:flex;justify-content:space-between;align-items:center}h2{font-size:17px;letter-spacing:-.3px;margin:0}.text-button{background:transparent;color:var(--blue);padding:5px 0;font-size:14px}.text-button:hover{text-decoration:underline}.muted{font-size:14px;line-height:1.5;color:var(--muted);margin:10px 0 20px}.weight-row{margin:0 0 14px}.weight-row label{display:flex;align-items:center;justify-content:space-between;font-size:14px;gap:4px}.weight-number{display:flex;align-items:center;gap:3px;color:var(--muted)}.weight-number input{width:49px;padding:4px 5px;text-align:right;border:1px solid #3b4b65;border-radius:5px;font-size:14px;font-weight:650;color:var(--ink)}input[type=range]{width:100%;height:4px;accent-color:var(--blue);margin-top:11px;cursor:pointer}.weight-total{display:flex;justify-content:space-between;border-top:1px solid var(--line);padding:15px 0;font-size:14px}.weight-total strong{color:#89dcb6}.weight-total strong.invalid{color:#ffadb8}.peer-label{display:flex;align-items:center;justify-content:space-between;font-size:13px;color:var(--muted);gap:6px;margin-bottom:17px}.peer-label input{width:54px;border:1px solid var(--line);border-radius:5px;padding:5px;font-size:14px}.full{width:100%}.local-note{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);margin:17px 0}.factor-note{border-top:1px solid var(--line);padding-top:14px;font-size:12px;line-height:1.8;color:var(--muted)}.results-panel{min-width:0;background:var(--white);border:1px solid var(--line);border-radius:10px;overflow:hidden}.result-title{display:flex;justify-content:space-between;align-items:center;padding:20px 20px 14px}.result-title h2 span{color:var(--muted);font-size:13px;font-weight:400;margin-left:7px}.score-key{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}.score-key i{height:11px;width:11px;border-radius:3px;margin-left:6px;border:1px solid #00000009}.low{background:var(--low)}.mid{background:var(--mid)}.high{background:var(--high)}.filters{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:0 20px 15px}.search-box{display:flex;align-items:center;gap:8px;min-width:180px;flex:1;border:1px solid var(--line);border-radius:6px;padding:9px 10px;color:var(--muted)}.search-box input{width:100%;min-width:80px;border:0;outline:0;font-size:14px}.filter-menu{position:relative;font-size:14px}.filter-menu summary{list-style:none;border:1px solid var(--line);border-radius:6px;padding:9px 26px 9px 10px;background:var(--white);position:relative;white-space:nowrap}.filter-menu summary:after{content:'⌄';position:absolute;right:9px;top:5px;color:var(--muted);font-size:18px}.filter-menu summary::-webkit-details-marker{display:none}.filter-options{position:absolute;z-index:6;top:43px;left:0;width:240px;max-height:340px;overflow:auto;background:var(--white);border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 30px #1b2b4825;padding:10px}.filter-options.wide{width:320px}.filter-options label{display:flex;align-items:center;gap:9px;padding:8px 4px;cursor:pointer;font-size:14px}.filter-options label:hover{background:var(--bg)}.filter-options input{accent-color:var(--blue)}.filter-options button{margin:4px 0 8px}.status-select select{border:1px solid var(--line);border-radius:6px;padding:9px;font-size:14px;background:var(--white);color:var(--ink)}.sort-panel{background:#111c2e;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.sort-panel>summary{display:flex;justify-content:space-between;align-items:center;padding:11px 20px;font-size:14px;font-weight:600}.sort-panel>summary:after{content:'⌄';margin-left:auto;padding-left:12px}.sort-hint{font-size:12px;color:var(--muted);font-weight:400;margin-left:15px}.sort-fields{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;padding:0 20px 16px}.sort-item label{font-size:12px;color:var(--muted);display:block;margin-bottom:5px}.sort-item select{width:100%;border:1px solid #3b4b65;border-radius:5px;padding:7px 4px;background:var(--white);color:var(--ink);font-size:13px}.sort-item select+select{margin-top:5px;font-size:12px}.table-scroll{overflow:auto;max-height:650px;min-height:260px}table{border-collapse:separate;border-spacing:0;width:100%;font-size:14px;white-space:nowrap}thead th{position:sticky;top:0;z-index:3;background:#1c2a40;text-align:left;padding:12px 11px;border-bottom:1px solid #2c3a51;color:#b1bfd5;font-size:12px;font-weight:600}thead button{background:transparent;color:inherit;padding:0;font-size:inherit;font-weight:inherit}thead button:hover{color:var(--blue)}td{padding:10px 11px;border-bottom:1px solid #26334a;height:47px}tbody tr:hover td{background:#1e2e46}td.rank{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;text-align:right;min-width:48px}td.ticker{position:sticky;left:0;z-index:2;background:var(--white);border-right:1px solid #2c3a51;min-width:80px}.ticker button{font-weight:750;color:var(--blue);font-size:14px;background:transparent;padding:3px 0}.ticker button:hover{text-decoration:underline}td.company{min-width:195px;max-width:220px;overflow:hidden;text-overflow:ellipsis}.company small{display:block;color:var(--muted);font-size:12px;padding-top:3px;max-width:215px;overflow:hidden;text-overflow:ellipsis}td.sector,td.industry{color:#a4b2ca;font-size:13px}td.industry{max-width:230px;overflow:hidden;text-overflow:ellipsis}.score{display:inline-block;min-width:50px;text-align:center;padding:5px 7px;border-radius:5px;font-variant-numeric:tabular-nums;font-size:13px;font-weight:600}.score.final{border:1px solid #0000000a;font-weight:800;min-width:58px}.dash{color:#a8b1c0;font-size:13px}.coverage{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}.coverage-bar{width:46px;height:3px;background:#2c3a51;margin-top:4px;border-radius:4px;overflow:hidden}.coverage-bar i{height:100%;display:block;background:#4981c3}.provisional-mark{font-size:11px;background:#fff0cb;color:#7a5b19;border-radius:3px;padding:2px 4px;margin-left:6px}.table-foot{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:12px 20px;color:var(--muted);font-size:12px;border-top:1px solid var(--line)}#empty-view{padding:50px 25px;text-align:center;color:var(--muted);font-size:14px}footer{padding:25px 0;color:#a4b2ca;font-size:12px;line-height:1.8}footer span{color:#a4b2ca}#message{border:1px solid #34537e;border-radius:7px;background:#182b48;color:#bfd5ff;padding:13px 16px;font-size:14px;margin-bottom:18px}#message.error{background:#3b202c;color:#ffb5bb;border-color:#70414d}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}dialog{width:min(1050px,calc(100% - 32px));max-height:90vh;border:0;border-radius:12px;padding:0;box-shadow:0 30px 90px #0d192944;color:var(--ink)}dialog::backdrop{background:#12213888;backdrop-filter:blur(3px)}.dialog-top{position:sticky;top:0;z-index:4;background:var(--navy);color:white;padding:23px 26px;display:flex;justify-content:space-between;align-items:center}.dialog-top h2{font-size:23px}.dialog-top p{margin:6px 0 0;color:#bfcce0;font-size:14px}.close-button{background:transparent;color:#fff;font-size:28px;padding:2px 8px}.detail-factors{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;padding:23px 26px}.detail-factor{border:1px solid var(--line);border-radius:8px;padding:13px}.detail-factor span{display:block;font-size:13px;color:var(--muted);margin-bottom:8px}.detail-factor strong{font-size:24px}.detail-factor small{display:block;font-size:12px;color:var(--muted);margin-top:5px}.detail-table{padding:0 26px 24px;overflow:auto}.detail-table h3{font-size:16px;margin:20px 0 8px}.detail-table table{font-size:13px}.detail-table th{position:static}.detail-table td{font-size:13px;padding:9px 8px}.status-note{margin:0 26px 20px;padding:13px 15px;border-radius:7px;background:#3c321e;font-size:14px;line-height:1.6}.method-content{padding:24px 28px;line-height:1.65}.method-content p{font-size:15px;color:#b7c5dc}.method-content h3{font-size:17px;margin:24px 0 8px}.method-content ul{padding-left:20px;font-size:14px;color:#b7c5dc}.drag-active:after{content:'Drop your Finviz CSV to analyze';position:fixed;inset:16px;z-index:20;background:#315de8e8;color:white;border:3px dashed #c4d5ff;border-radius:15px;display:grid;place-items:center;font-size:28px;font-weight:650;pointer-events:none}@media(min-width:1450px){.table-scroll{max-height:740px}}@media(max-width:1150px){main{padding:24px}.topbar{padding:0 24px}.layout{grid-template-columns:215px minmax(0,1fr);gap:15px}.model-panel{padding:16px}.sort-fields{grid-template-columns:repeat(3,minmax(0,1fr))}.head-actions{flex-wrap:wrap;justify-content:flex-end}.filters{padding-left:15px;padding-right:15px}.summary>div{padding:16px}.filter-options.wide{left:auto;right:0}}@media(max-width:800px){main{padding:20px 14px}.topbar{padding:0 14px;height:64px}.top-actions{gap:0}.quiet{padding:9px 7px;font-size:12px}.workspace-head{align-items:flex-start;flex-direction:column;gap:15px}h1{font-size:26px}.head-actions{width:100%;justify-content:flex-start}.summary{grid-template-columns:repeat(2,1fr);margin-bottom:16px}.summary>div{padding:15px}.summary>div:nth-child(2){border-right:0}.summary>div:nth-child(-n+2){border-bottom:1px solid var(--line)}.summary strong{font-size:27px}.layout{grid-template-columns:1fr}.model-panel{position:static}.model-panel #weight-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}.weight-row{margin-bottom:12px}.factor-note{display:none}.local-note{margin-bottom:0}.peer-label{max-width:260px}.sort-fields{grid-template-columns:repeat(2,minmax(0,1fr));padding:0 14px 14px}.sort-hint{display:none}.filters{gap:7px}.search-box{flex-basis:100%}.filter-menu summary{font-size:13px}.status-select select{font-size:13px}.filter-options.wide{width:min(320px,80vw);left:0;right:auto}.result-title{padding:17px 14px 13px}.table-scroll{max-height:650px}.detail-factors{grid-template-columns:repeat(2,1fr);padding:18px}.dialog-top{padding:18px}.detail-table{padding:0 18px 18px}}@media(prefers-reduced-motion:no-preference){button,.button{transition:background .15s,border-color .15s}dialog[open]{animation:appear .15s ease-out}@keyframes appear{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}}
.weight-inputs{display:grid;grid-template-columns:minmax(0,1fr) 52px 14px;align-items:center;gap:8px;margin-top:6px}.weight-inputs input[type=range]{margin:0}.weight-inputs input[type=number]{width:52px;padding:5px;border:1px solid #3b4b65;border-radius:5px;text-align:right;color:var(--ink)}.weight-inputs span{font-size:12px;color:var(--muted)}th button{background:transparent;color:inherit;font:inherit;font-weight:650;padding:0;white-space:nowrap;text-align:left}.sort-indicator{color:var(--blue);font-size:11px}.detail-hero{display:flex;align-items:center;gap:30px;margin:24px 26px;padding:24px;border-radius:9px;background:#1b2c47}.detail-hero span{display:block;font-size:13px;color:var(--muted)}.detail-hero strong{font-size:40px}.detail-hero strong small{font-size:18px;color:var(--muted)}.detail-hero p{margin:8px 0 0}.detail-warning,.detail-note{margin:18px 26px;font-size:13px;line-height:1.6}.detail-warning{background:#3c321e;padding:12px;border-radius:6px}.metric-table small{display:block;font-size:11px;color:var(--muted)}.company-name{display:block;overflow:hidden;text-overflow:ellipsis}.provisional-label{color:#f0ca75;font-size:11px}.method-category h4{margin-bottom:6px}.method-category ul{padding-left:20px;font-size:14px;line-height:1.8}@media(max-width:800px){.detail-hero{margin:18px;padding:16px;gap:18px}.detail-hero strong{font-size:30px}}

/* Dark theme control and score states. */
input,select{background:var(--white);color:var(--ink)}input::placeholder{color:var(--muted);opacity:1}.primary{background:#315de8;color:#fff}.primary:hover{background:#416cf1}.summary,.model-panel,.results-panel,dialog{background:var(--white)}.score.low{color:#ffc0c6}.score.mid{color:#f9d98c}.score.high{color:#98e7bd}.score-key i{border-color:#ffffff22}.secondary:hover{background:#1e2e46}.search-box:focus-within{border-color:var(--blue);outline:1px solid var(--blue)}.filter-options{box-shadow:0 10px 30px #0008}.detail-warning,.status-note{color:#f4d899}.detail-hero{border:1px solid #314665}.table-scroll{scrollbar-color:#465a78 #111c2e}dialog::backdrop{background:#050a15b3}.missing{color:var(--muted)}
.workspace-tabs{display:flex;gap:8px;margin:24px 0;flex-wrap:wrap}.workspace-tabs button{padding:12px 18px;border:1px solid var(--border,#33405b);border-radius:8px;background:#172137;color:#bdc9e1;font-size:14px;cursor:pointer}.workspace-tabs button.active{background:#345bd6;color:white;border-color:#678cff}.config-card{border:1px solid #33405b;background:#121c2e;border-radius:12px;padding:22px;min-width:0}.portfolio-config-grid{display:grid;grid-template-columns:1fr 1.4fr;gap:20px}.config-fields{display:grid;gap:14px}.config-fields label{display:grid;grid-template-columns:1fr 110px;align-items:center;gap:16px;font-size:14px;line-height:1.4}.config-fields input,.config-card td input{width:100%;padding:9px;background:#0b1323;color:#edf2ff;border:1px solid #405173;border-radius:6px;font:inherit}.config-card td input{min-width:90px;max-width:130px}.config-card h3{margin-top:0}.config-card .muted{font-size:14px;line-height:1.7}.exposure-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:28px}.exposure-list div{padding:14px;background:#152138;border-radius:8px}.exposure-list span,.exposure-list strong{display:block;font-size:14px;line-height:1.8}.selected-candidate td{background:#12312d}#portfolio-workspace,#candidates-workspace,#config-workspace{min-width:0}#candidate-search{padding:10px;border:1px solid #405173;background:#0b1323;color:#edf2ff;border-radius:6px;font-size:16px}#candidate-table select{padding:8px;border:1px solid #405173;background:#172137;color:#edf2ff;border-radius:6px;font-size:14px}#portfolio-workspace .summary strong{font-size:26px}#portfolio-workspace .table-scroll{max-height:620px}#config-workspace .head-actions{flex-wrap:wrap}#portfolio-workspace td,#candidate-table td{font-size:14px}#portfolio-workspace td:nth-last-child(5),#candidate-table td:nth-last-child(3){min-width:260px;white-space:normal}section[hidden],div[hidden]{display:none!important}@media(max-width:900px){.portfolio-config-grid,.exposure-list{grid-template-columns:1fr}.workspace-tabs button{flex:1;min-width:130px}.config-card{padding:16px}.config-fields label{grid-template-columns:1fr 100px}#portfolio-workspace .summary strong{font-size:21px}} 
/* Monte Carlo: extend the existing dark research workspace. */
.mc-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(320px,1fr);gap:20px}.mc-intro{font-size:16px;line-height:1.6}.mc-grid h3,.mc-run h3{font-size:18px}.mc-note{font-size:14px;line-height:1.65;padding:14px;background:#1a2841;border-left:3px solid #678cff;margin:16px 0}.mc-grid select{max-width:100%;width:100%;padding:8px;border:1px solid #405173;border-radius:6px}.mc-grid .config-fields label{grid-template-columns:minmax(0,1fr) 135px}.mc-holdings{margin:18px -6px 0;max-height:480px}.mc-holdings input{padding:9px;border:1px solid #405173;border-radius:6px;font-size:14px;width:115px;background:#0b1323;color:#edf2ff}.mc-holdings th{white-space:normal;min-width:110px;line-height:1.5;font-size:14px}.mc-holdings input:disabled{opacity:.65}.mc-row-actions{margin-top:14px;flex-wrap:wrap}.mc-run,.mc-output{margin-top:20px}.mc-ack{display:flex;align-items:flex-start;gap:12px;margin:15px 0;font-size:16px;line-height:1.6}.mc-ack input{width:20px;height:20px;margin-top:3px}.mc-run .head-actions{flex-wrap:wrap}#mc-status{font-size:16px;line-height:1.6}#mc-results{margin:28px 0}#mc-results.mc-stale{opacity:.55}#mc-results .summary strong{font-size:28px}#mc-results .summary small{white-space:normal;line-height:1.5}.mc-chart{width:100%;height:auto;display:block}.mc-legend{display:flex;gap:25px;font-size:14px;margin-top:10px}.mc-range{color:#9cbbff}.mc-median{color:#78cbbd}.mc-output details{padding:16px 0;border-top:1px solid #33405b;margin-top:15px}.mc-output summary{font-size:16px;cursor:pointer}.mc-output p,.mc-output li{font-size:16px;line-height:1.65}.mc-output td{font-size:14px}.mc-output td:first-child{white-space:normal;min-width:240px}.mc-run button:disabled{opacity:.5;cursor:not-allowed}@media(max-width:1000px){.mc-grid{grid-template-columns:1fr}.mc-grid .config-fields label{grid-template-columns:minmax(0,1fr) 145px}}@media(max-width:600px){.mc-summary{grid-template-columns:1fr 1fr}#mc-results .summary strong{font-size:21px}.mc-grid .config-fields label{grid-template-columns:1fr 120px}.mc-legend{flex-wrap:wrap}.mc-intro{font-size:16px}}
.core-mode{display:flex;gap:10px;margin:12px 0}.config-card input:disabled{opacity:.65}.config-card td input[data-core-name]{min-width:140px;max-width:230px}

.reference-help{cursor:help;text-decoration:underline dotted;text-underline-offset:4px;}

/* Installable workspace and phone ergonomics. */
[hidden]{display:none!important}.pwa-status{padding:12px 16px;margin-bottom:16px;border:1px solid #405173;border-radius:8px;background:#182b48;color:#bfd5ff;font-size:14px;line-height:1.6}.pwa-status button{margin-left:10px}.table-scroll{overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}.topbar{height:auto;min-height:72px;padding-top:env(safe-area-inset-top);padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}main{padding-bottom:max(30px,env(safe-area-inset-bottom))}.source{overflow-wrap:anywhere}
@media(max-width:600px){.topbar{flex-wrap:wrap;gap:8px;padding-top:max(12px,env(safe-area-inset-top));padding-bottom:12px}.brand{font-size:18px;gap:8px}.top-actions{width:100%;justify-content:flex-end;flex-wrap:wrap}.quiet{min-height:44px}.workspace-head{align-items:stretch;flex-direction:column;gap:12px}.head-actions{flex-wrap:wrap}.head-actions>*{flex:1}.workspace-tabs{flex-wrap:nowrap;overflow-x:auto;padding-bottom:8px;gap:6px}.workspace-tabs button{flex:none;min-width:auto;min-height:44px;white-space:nowrap;padding:12px}.summary{grid-template-columns:repeat(2,minmax(0,1fr))}.summary>div{padding:14px;border-bottom:1px solid var(--line)}.summary strong{font-size:25px}.layout{grid-template-columns:minmax(0,1fr)}.model-panel{position:static}.result-title{flex-wrap:wrap;gap:10px;padding:16px}.filters{padding:0 14px 14px}.search-box{flex-basis:100%}.filter-options,.filter-options.wide{width:min(290px,calc(100vw - 56px))}.sort-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.sort-hint{display:none}.detail-factors{grid-template-columns:repeat(2,minmax(0,1fr));padding:16px}.detail-hero{flex-wrap:wrap}.dialog-top{padding:16px}.dialog-top h2{font-size:20px}.method-content{padding:18px}.config-fields label{grid-template-columns:minmax(0,1fr) 100px}.mc-grid .config-fields label{grid-template-columns:minmax(0,1fr) 112px}input:not([type=range]):not([type=checkbox]),select{font-size:16px!important}button,.button,summary{touch-action:manipulation}button,.button,select{min-height:44px}.config-card{padding:14px}.table-scroll{max-height:65vh}h1{font-size:25px}.mc-legend{gap:12px}.pwa-status button{margin:8px 0 0}}

/* On phones, show results first and open dataset/model controls only on request.
   Desktop keeps the existing expanded arrangement. Native details supplies keyboard behavior. */
.mobile-disclosure{display:contents}.mobile-disclosure>summary{display:none}.disclosure-content{display:contents}
@media(max-width:600px){
 .mobile-disclosure{display:block;border:1px solid var(--line);border-radius:9px;background:var(--white);margin-bottom:14px}
 .mobile-disclosure>summary{display:list-item;padding:12px 16px;min-height:44px;font-size:15px;font-weight:650;color:var(--ink)}
 .disclosure-hint{font-size:12px;font-weight:400;color:var(--muted);margin-left:8px}
 .mobile-disclosure>.disclosure-content{display:block;padding:14px}
 .mobile-disclosure:not([open])>.disclosure-content{display:none}
 .data-source-panel .eyebrow,.data-source-panel h1{display:none}
 .data-source-panel .workspace-head{margin-bottom:14px}.data-source-panel .summary{margin-bottom:0}
 .model-disclosure{order:2}.results-panel{order:1}.model-disclosure .model-panel{border:0;padding:0}
 .filter-disclosure{margin:0 14px 12px}.filter-disclosure>.disclosure-content{padding:0}
 .filter-disclosure .filters{padding-top:12px}.sort-panel{margin-top:0}
}

/* Phone home: rounded raised buttons, with a short pressed state for touch feedback. */
.phone-home,.phone-home-back{display:none}
@media(min-width:0px){
 body.phone-home-active{background:#0b1426}
 .phone-home-active #app-shell{display:none}
 .phone-home-active .phone-home{display:flex;flex-direction:column;position:relative;isolation:isolate;min-height:100svh;max-width:600px;margin:auto;padding:max(34px,env(safe-area-inset-top)) 22px max(28px,env(safe-area-inset-bottom));overflow:hidden}
 .home-orb{position:absolute;z-index:-1;width:420px;height:420px;top:-210px;left:50%;transform:translateX(-50%);border-radius:50%;background:radial-gradient(circle,#325baf60,transparent 70%);pointer-events:none}
 .home-intro{text-align:center;padding:8px 0 30px}.home-mark{display:inline-grid;place-items:center;width:54px;height:54px;border-radius:18px;color:#cfddff;font-weight:800;font-size:20px;background:linear-gradient(145deg,#2e4874,#162840);border:1px solid #5775a7;box-shadow:0 6px 0 #07101f,0 12px 24px #0004;margin-bottom:16px}
 .home-intro h1{font-size:clamp(34px,9vw,44px);letter-spacing:-1.4px;margin:4px 0 6px;line-height:1.1;color:#f3f7ff}
 .home-subtitle{font-size:15px;color:#9db5da;margin:0;letter-spacing:.4px}
 .home-buttons{display:grid;gap:16px}.home-workspace-button{display:flex;align-items:center;gap:14px;min-height:88px;width:100%;padding:18px;border-radius:22px;text-align:left;color:#f4f8ff;border:1px solid #6488da;border-top-color:#adc5ff;background:linear-gradient(155deg,#3c66b5,#24447f);box-shadow:0 6px 0 #102850,0 10px 19px #0005,inset 0 1px 1px #ffffff35;transition:transform .12s,box-shadow .12s}
 .home-workspace-button:nth-child(2){background:linear-gradient(155deg,#315f90,#203d61);border-color:#547fab;border-top-color:#8cb5dc;box-shadow:0 6px 0 #10233e,0 10px 19px #0005,inset 0 1px 1px #ffffff35}
 .home-workspace-button:nth-child(3){background:linear-gradient(155deg,#416680,#254256);border-color:#6089a0;border-top-color:#a2c7d7;box-shadow:0 6px 0 #112b3a,0 10px 19px #0005,inset 0 1px 1px #ffffff35}
 .home-workspace-button:nth-child(4){background:linear-gradient(155deg,#47567c,#2b3451);border-color:#7584a9;border-top-color:#b5bdd8;box-shadow:0 6px 0 #172037,0 10px 19px #0005,inset 0 1px 1px #ffffff35}
 .home-workspace-button:nth-child(5){background:linear-gradient(155deg,#5357a0,#303569);border-color:#888cd0;border-top-color:#bebff4;box-shadow:0 6px 0 #1d2049,0 10px 19px #0005,inset 0 1px 1px #ffffff35}
 .home-workspace-button:active{transform:translateY(4px);box-shadow:0 2px 0 #102850,0 4px 8px #0004}
 .home-button-icon{width:42px;height:42px;display:grid;place-items:center;flex:none;border-radius:13px;background:#ffffff12;border:1px solid #ffffff22}.home-button-icon svg{width:26px;height:26px}.home-button-copy{min-width:0}.home-button-copy strong{display:block;font-size:18px;line-height:1.25}.home-button-copy small{display:block;font-size:12px;color:#cfddf5;margin-top:5px}.home-chevron{margin-left:auto;font-size:30px;color:#ceddff}
 .home-footnote{text-align:center;font-size:12px;color:#879dbd;margin:28px 0 0}
 .phone-home-back{display:inline-flex;align-items:center;justify-content:center;min-height:44px;border-radius:12px;padding:8px 12px;background:#20324e;color:#dce8ff;border:1px solid #41597e;margin-left:auto}
}
@media(prefers-reduced-motion:reduce){.home-workspace-button{transition:none}}

/* Wider home screen uses the same raised buttons in a spacious two-column layout. */
.home-open-workspace{align-self:center;margin-top:28px;padding:12px 24px;border:1px solid #637fae;border-radius:14px;background:#192c48;color:#dce8ff;box-shadow:0 4px 0 #0a172a;font-size:15px;font-weight:650}
@media(min-width:601px){
 .phone-home-active .phone-home{max-width:940px;justify-content:center;padding:48px 40px;min-height:100svh}
 .home-intro{padding-bottom:42px}.home-intro h1{font-size:58px}.home-subtitle{font-size:18px}.home-mark{width:64px;height:64px;font-size:24px}
 .home-buttons{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.home-workspace-button{min-height:110px;padding:24px;border-radius:24px}
 .home-workspace-button:last-child{grid-column:auto}.home-button-copy strong{font-size:21px}.home-button-copy small{font-size:14px}.home-button-icon{width:50px;height:50px}.home-button-icon svg{width:30px;height:30px}
 .home-workspace-button:hover{filter:brightness(1.1)}.home-footnote{margin-top:22px}.phone-home-back{margin-left:20px;margin-right:auto}
}

/* About introduces the purpose without competing with the workspace cards. */
.home-about{margin:30px auto 0;text-align:center;max-width:560px;padding-top:22px;border-top:1px solid #7b9ccc25}
.home-about p{margin:0 0 8px;color:#a9bbd5;font-size:14px;line-height:1.6}
.home-about button{background:transparent;border:0;color:#cfddf5;font-size:13px;padding:10px 14px;min-height:44px;border-radius:12px}
.home-about button:hover{background:#ffffff09}.home-about button span{margin-left:8px;color:#8caaf0}
.about-dialog{box-sizing:border-box;width:min(620px,calc(100% - 32px));max-height:calc(100svh - 48px);overflow:auto;padding:30px;border:1px solid #536b9366;border-radius:26px;background:linear-gradient(145deg,#1b2d49,#101c30);color:#dce6fa;box-shadow:0 24px 80px #0008}
.about-dialog::backdrop{background:#040b1866}
.about-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.about-eyebrow{font-size:11px;letter-spacing:2px;color:#9db9ea;font-weight:700}
#about-close{border:1px solid #ffffff20;background:#ffffff08;color:#dce6fa;border-radius:12px;width:44px;height:44px;font-size:26px;flex:none}
.about-dialog h2{font-size:clamp(24px,5vw,32px);line-height:1.25;letter-spacing:-.5px;margin:18px 0 22px;color:#f2f6ff}
.about-dialog p{font-size:15px;line-height:1.8;color:#bbcbe3;margin:0 0 18px}.about-dialog .about-purpose{padding-top:18px;margin-bottom:0;border-top:1px solid #ffffff15;color:#e3edff;font-weight:600}
body.about-open{overflow:hidden}button:focus-visible{outline:2px solid #a7c6ff;outline-offset:4px}
@media(max-width:600px){.about-dialog{padding:24px;border-radius:22px}.home-about{margin-top:28px}.home-about p{font-size:13px}}

/* Larger introduction card and touch target on every screen. */
.home-about{width:100%;max-width:680px;box-sizing:border-box;margin:32px auto 0;padding:24px;border:1px solid #6586b366;border-radius:22px;background:linear-gradient(145deg,#1c304e,#14233b);box-shadow:0 8px 24px #0003}
.home-about p{font-size:20px;line-height:1.5;font-weight:600;color:#edf3ff;margin:0 0 18px}
.home-about button{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:54px;padding:14px 24px;background:#355b93;border:1px solid #89aadd;border-radius:14px;color:#fff;font-size:17px;font-weight:650;box-shadow:0 3px 0 #10233e}
.home-about button:hover{background:#416da9}.home-about button span{color:#e0ebff;margin:0;font-size:21px}
.about-dialog p{font-size:17px;line-height:1.8}
@media(max-width:600px){.home-about{padding:22px 18px;margin-top:30px}.home-about p{font-size:18px}.home-about button{width:100%;font-size:16px;min-height:56px}.about-dialog p{font-size:16px}}

/* Keep the About button, remove the surrounding introduction card. */
.home-about{background:transparent;border:0;box-shadow:none}

/* Business exposure groups: touch-friendly cards and searchable stock picker. */
.exposure-toolbar,.exposure-group-head,.exposure-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.exposure-toolbar{margin:16px 0}.exposure-toolbar>span,.exposure-group-head>span{color:#b6c7df;font-size:14px}.exposure-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:12px}.exposure-group{padding:16px;background:#0d182a;border:1px solid #354965;border-radius:14px}.exposure-group-head strong{font-size:17px;color:#f1f6ff}.exposure-chips{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}.exposure-chip{display:inline-flex;align-items:center;gap:5px;background:#243f62;border-radius:9px;padding:4px 4px 4px 11px;font-weight:650}.exposure-chip button{min-width:36px;min-height:36px;padding:2px;font-size:22px}.exposure-actions{justify-content:flex-start}.exposure-actions button{min-height:44px}.exposure-picker{margin-top:20px;border:1px solid #6b92c4;border-radius:14px;padding:18px;background:#101e34}.exposure-picker h4{font-size:19px;margin:0 0 16px}.exposure-picker-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}.exposure-picker-fields label{display:flex;flex-direction:column;gap:7px}.exposure-picker-fields input{width:100%;box-sizing:border-box;min-height:46px}.exposure-options{max-height:330px;overflow:auto;border:1px solid #354965;border-radius:10px;margin:12px 0 18px}.exposure-option{display:flex;align-items:center;gap:12px;padding:12px;min-height:48px;border-bottom:1px solid #283b56;cursor:pointer}.exposure-option:hover{background:#203553}.exposure-option input[type=checkbox]{width:22px;min-width:22px;height:22px;accent-color:#82b4ff}.exposure-option span{font-size:15px;line-height:1.5}.exposure-option strong{color:#fff;margin-right:7px}.exposure-option small{display:block;color:#b6c7df}.exposure-card #exposure-status{color:#bfd7fa;line-height:1.5}@media(max-width:600px){.exposure-picker-fields{grid-template-columns:1fr}.exposure-groups{grid-template-columns:1fr}.exposure-toolbar>button{width:100%}.exposure-picker{padding:14px}.exposure-actions button{flex:1}}

.home-study-links{display:flex;justify-content:center;gap:48px;flex-wrap:wrap;margin:24px 0 8px}.home-study-links a{font-size:18px;font-weight:700;color:#dce6fa;text-underline-offset:3px}.home-study-links a:hover{color:#9bc0ff}.home-study-links a:focus-visible{outline:2px solid #9bc0ff;outline-offset:6px}

.code-nav-link{display:inline-flex;align-items:center;font-weight:700;text-underline-offset:3px;white-space:nowrap}.top-actions{align-items:center}@media(max-width:800px){.topbar{height:auto;min-height:64px;flex-wrap:wrap;gap:8px;padding-top:10px;padding-bottom:10px}.top-actions{margin-left:auto;flex-wrap:wrap;justify-content:flex-end}}

.cc-layout{display:grid;grid-template-columns:minmax(280px,340px) minmax(0,1fr);gap:20px;align-items:start}.cc-output{min-width:0}.cc-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.cc-summary strong{font-size:24px}.cc-legend{display:flex;gap:24px;flex-wrap:wrap}.cc-layout [hidden]{display:none!important}@media(max-width:900px){.cc-layout{grid-template-columns:1fr}}
.cc-layout .config-fields label{display:flex;flex-direction:column;align-items:stretch;gap:7px;font-size:14px}.cc-layout .config-fields input,.cc-layout .config-fields select{width:100%;min-width:0;min-height:42px;padding:10px;background:#0b1426;color:#e5ecf7;border:1px solid #40516d;border-radius:7px}.cc-layout .config-fields{gap:16px}

/* Three allocation modes share the workspace layout. */
.workspace-tabs{flex-wrap:wrap}.brand{flex-wrap:wrap}.brand strong{line-height:1.35}#custom-workspace>label{display:block;max-width:340px;margin:20px 0}#custom-workspace>label input{display:block;width:100%;margin-top:8px}#custom-workspace .head-actions{margin:18px 0}.head-actions>label{display:grid;gap:6px}#weighted-workspace .config-fields{margin:16px 0}#custom-workspace input{max-width:260px}@media(max-width:600px){.brand{max-width:100%}.workspace-tabs button{flex:1 0 auto}#custom-workspace input{max-width:150px}}

#weighted-workspace select,#mc-portfolio-source{padding:10px 12px;border:1px solid #34445d;border-radius:8px;background:#101a2c;color:#dce6fa;min-height:42px}#weighted-workspace label{display:grid;gap:8px}#custom-workspace>label{display:grid;gap:8px}

/* Brand hierarchy: prominent product name, followed by purpose and allocation choices. */
.home-eyebrow{margin:0 0 14px;font-size:11px;font-weight:700;letter-spacing:3px;color:#91abd0}
.home-intro h1{font-size:clamp(48px,8vw,80px);font-weight:800;letter-spacing:-3px;line-height:1.08;margin:0 0 16px}
.home-quant-word{background:linear-gradient(110deg,#b4d6ff,#729cff 65%,#aaa5ff);color:#97bcff;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.home-intro .home-subtitle{font-size:clamp(21px,3vw,29px);font-weight:500;color:#e2ebfb;letter-spacing:-.4px}
.home-brand-detail{margin:13px 0 0;color:#97accb;font-size:12px;line-height:1.7;letter-spacing:.25px}
@media(max-width:600px){.home-intro h1{letter-spacing:-2px}.home-brand-detail{font-size:11px}.home-eyebrow{font-size:10px;letter-spacing:2.4px}}

/* Workspace tabs retain their own accent in both inactive and selected states. */
.workspace-tabs{gap:9px;padding:5px 0 9px}
.workspace-tabs button{--tab-rgb:104,156,255;position:relative;isolation:isolate;min-height:46px;padding:13px 18px;border:1px solid rgba(var(--tab-rgb),.38);border-radius:12px;background:linear-gradient(145deg,rgba(var(--tab-rgb),.19),rgba(var(--tab-rgb),.07));color:#edf3ff;font-weight:600;box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 3px 8px #0002;transition:background .16s,border-color .16s,box-shadow .16s,transform .16s}
.workspace-tabs button[data-tab="rankings"]{--tab-rgb:100,157,255}
.workspace-tabs button[data-tab="portfolio"]{--tab-rgb:47,194,155}
.workspace-tabs button[data-tab="weighted"]{--tab-rgb:151,123,255}
.workspace-tabs button[data-tab="custom"]{--tab-rgb:215,115,217}
.workspace-tabs button[data-tab="candidates"]{--tab-rgb:58,185,217}
.workspace-tabs button[data-tab="config"]{--tab-rgb:218,166,77}
.workspace-tabs button[data-tab="montecarlo"]{--tab-rgb:105,126,255}
.workspace-tabs button[data-tab="compounding"]{--tab-rgb:145,190,85}
.workspace-tabs button:hover{border-color:rgba(var(--tab-rgb),.85);background:linear-gradient(145deg,rgba(var(--tab-rgb),.32),rgba(var(--tab-rgb),.15));transform:translateY(-1px)}
.workspace-tabs button.active{color:#fff;border-color:rgba(var(--tab-rgb),.95);background:linear-gradient(135deg,rgba(var(--tab-rgb),.64),rgba(var(--tab-rgb),.32));box-shadow:inset 0 1px 0 #ffffff30,0 0 0 1px rgba(var(--tab-rgb),.18),0 5px 16px rgba(var(--tab-rgb),.2)}
.workspace-tabs button.active:after{content:"";position:absolute;bottom:4px;left:calc(50% - 10px);width:20px;height:3px;border-radius:2px;background:#eef5ff}
.workspace-tabs button:focus-visible{outline:3px solid rgb(var(--tab-rgb));outline-offset:4px}
@media(prefers-reduced-motion:reduce){.workspace-tabs button{transition:none}.workspace-tabs button:hover{transform:none}}
