/* Interface layer. Reuses all portfolio inputs and calculation handlers. */
:root{--bg:#f4f6f8;--ink:#1e3447;--muted:#576b7c;--line:#e0e7ec;--primary:#146b68;--teal:#146b68;--radius:16px}
.topbar{background:#fff;color:var(--ink);height:68px;border-bottom:1px solid var(--line)}.brand,.brand>span:last-child{color:var(--ink)}.brand strong{letter-spacing:.8px}.divider{border-color:var(--line)}.local-label{color:var(--muted)}
main{max-width:1500px;padding:28px 32px 24px}.page-heading{margin-bottom:24px;align-items:start}h1{font-size:28px;letter-spacing:-.5px}.subtitle{font-size:14px}.eyebrow{letter-spacing:1.4px}.page-heading button{flex-shrink:0}
.workflow-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:7px;gap:6px;background:white;border:1px solid var(--line);border-radius:14px;position:sticky;top:8px;z-index:8;box-shadow:0 3px 16px #213b4e08}
.workflow-nav button{display:flex;align-items:center;gap:12px;text-align:left;color:var(--muted);background:transparent;min-height:64px;padding:10px 16px;border-radius:10px;font-size:15px}.workflow-nav button small{display:block;font-size:12px;font-weight:400;margin-top:2px}.nav-step{display:grid;place-items:center;width:30px;height:30px;flex-shrink:0;border-radius:9px;border:1px solid var(--line);font-size:13px}
.workflow-nav button[aria-selected=true]{background:#eaf4f1;color:#125e59}.workflow-nav button[aria-selected=true] .nav-step{background:var(--primary);color:white;border-color:var(--primary)}
.global-status{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:16px 0 22px}#status{font-size:12px;padding:0;min-height:0}.global-status>.tag{flex-shrink:0}
.app-view{padding:0;scroll-margin-top:96px;outline:none}.view-heading{margin-bottom:20px}.view-heading h2{font-size:23px;letter-spacing:-.3px}.view-heading p{font-size:14px;color:var(--muted);margin-top:5px;max-width:850px}
.quick-guide{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;padding:22px;margin-bottom:20px;background:#edf5f3;border-color:#d3e6df}.quick-guide strong{font-size:14px}.quick-guide p{font-size:13px;margin-top:6px;color:var(--muted)}
.panel{box-shadow:0 2px 6px #243f4e03}.calculation-panel{padding:18px 22px;margin-bottom:20px}.calculation-main{display:grid;grid-template-columns:1fr 1fr auto;gap:22px;align-items:end}.calculation-main .primary{min-width:240px;min-height:44px}.calculation-main label{max-width:330px}.calculation-options{border-top:1px solid var(--line);margin-top:16px;padding-top:9px}.calculation-options summary{font-size:12px;font-weight:500;color:var(--muted);min-height:36px;display:flex;align-items:center}.calculation-options summary:before{content:'+';margin-right:9px}.calculation-options[open] summary:before{content:'−'}.calculation-extra{display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:18px;align-items:end;padding:10px 0}.calculation-extra>.check{min-height:44px;justify-content:start}
.workspace{grid-template-columns:minmax(320px,.8fr) minmax(0,1.35fr);gap:20px}.composition,.allocation-panel{padding:22px}.section-heading{margin-bottom:12px}.section-heading h2{font-size:17px}.section-heading>div{min-width:0}.universe-help{font-size:13px;line-height:1.6;margin:8px 0 18px}.asset-row{padding:14px 0}.asset-name{font-size:12px;line-height:1.45}.asset-main{align-items:start}.asset-class{min-height:34px;font-size:12px;margin-top:2px}.asset-options summary{min-height:36px;font-size:12px}.asset-model{font-size:12px}.return-inputs{padding:0;background:transparent;margin:10px 0 4px;gap:12px}.return-inputs label{font-size:12px}.return-inputs input,.return-inputs select{font-size:13px;min-height:40px}.remove{min-width:32px;min-height:36px;color:#607486}.asset-extra{padding:14px}.composition-actions>button{width:100%;font-size:13px}
.disclosure{margin:14px 0 0;border:1px solid var(--line);border-radius:10px;background:white;overflow:hidden}.disclosure>summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap;list-style:none;min-height:46px;padding:12px 16px;font-size:13px;color:var(--ink)}.disclosure>summary:before{content:'+';color:var(--primary);font-size:17px;font-weight:400}.disclosure[open]>summary:before{content:'−'}.disclosure>summary span{margin-left:auto;font-size:12px;font-weight:400;color:var(--muted)}.disclosure-body{padding:4px 18px 18px}.disclosure-body>.small-note:first-child{margin-top:6px}.disclosure-body .panel{border:0;box-shadow:none;padding:8px 0;margin:0}.profile-settings{gap:12px;margin:16px 0 0}.profile-setting{padding:14px}.profile-setting h3{font-size:13px}.profile-setting details summary{min-height:40px}
.allocation-panel .profiles{gap:12px}.profile-card{padding:17px 14px;background:#fff}.profile-card .profile-label h3{font-size:15px}.profile-card .profile-stats{gap:16px;margin:15px 0 12px}.profile-stats strong{font-size:24px;font-weight:650}.profile-utility{font-size:12px}.profile-card .profile-var{font-size:12px;line-height:1.5}.profile-card .small-note{font-size:12px}.profile-card details{margin-top:12px}.profile-card summary{font-size:12px;min-height:36px;color:var(--muted)}.profile-card .stacked-bar{margin:14px 0}.profile-card .class-row{font-size:12px}.profile-card button{min-height:44px;font-size:12px}.profile-card.is-target{border-color:#6cab98;background:#f5faf8;box-shadow:0 0 0 1px #6cab981a}.profile-card .tag{font-weight:500}.empty-section{padding:38px 24px;min-height:320px;display:flex;flex-direction:column;justify-content:center;align-items:center;border:1px dashed #c8d9d5;border-radius:12px;background:#f9fcfb}.empty-section h3{font-size:18px;margin-top:18px}.empty-section p{max-width:360px;font-size:14px;margin-top:10px;line-height:1.6}.empty-number{color:var(--primary);font-size:24px;letter-spacing:8px}
.stock-panel,.client-export-panel,.frontier-panel{margin:0;padding:24px}.readiness{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 22px;border:1px solid #d7e5e1;border-radius:12px;background:#edf5f2;margin-bottom:20px}.readiness p{font-size:14px;line-height:1.6}.readiness button{flex-shrink:0}.stock-toolbar{display:grid;grid-template-columns:minmax(220px,1fr) auto auto;align-items:end;gap:12px}.stock-toolbar label{max-width:380px}.stock-panel>.disclosure{margin-bottom:18px}.issuer-limit-control{margin-top:8px}.class-group-title{min-width:150px}.class-group>summary{gap:12px;padding:15px 18px}.class-group-title small{font-size:12px}.budget-state{min-width:0}.class-securities{grid-template-columns:repeat(auto-fit,minmax(min(350px,100%),1fr))}.stock-asset-fields{gap:12px}.stock-asset-fields label{font-size:12px}.securities-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:20px 0}.weights-tools{position:relative;margin-left:auto}.weights-tools>summary{font-size:13px;min-height:44px;display:flex;align-items:center;color:var(--primary);padding:8px 12px;border:1px solid var(--line);border-radius:8px}.weights-tools>summary:after{content:'⌄';margin-left:12px}.weights-tools>div{position:absolute;right:0;top:48px;min-width:220px;background:white;border:1px solid var(--line);box-shadow:0 8px 30px #213b4e18;border-radius:9px;padding:8px;z-index:4}.weights-tools button{display:block;width:100%;text-align:left}.stock-optimizer{padding:0;background:white}.stock-caution{padding:0 18px 18px}.stock-panel .history-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}.stock-results-extra>summary{font-size:13px;color:var(--muted);margin:14px 0}
.snapshot-label{font-size:13px;font-weight:600;color:var(--muted);margin-bottom:9px}.summary-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:22px}.summary-cards article{padding:20px 22px;border:1px solid var(--line);border-radius:14px;background:white;display:flex;flex-direction:column;gap:7px}.summary-cards article>span{font-size:13px;color:var(--muted)}.summary-cards strong{font-size:28px;font-weight:650;line-height:1.2}.summary-cards small{font-size:12px;color:var(--muted)}.frontier-panel .optimizer{padding:0}.frontier-panel .chart-profiles{grid-template-columns:repeat(3,minmax(0,1fr))}.cal-panel{padding:0;margin:18px 0 0}.cal-panel .disclosure-body{padding:4px 22px 22px}.manual-panel{margin:0;padding:0}.custom-utility{margin-top:14px;padding:14px}.optimizer-heading{margin-top:10px}.optimizer-buttons button{font-size:13px;min-height:44px}.target-row{margin-bottom:6px}.target-row input{min-height:44px}.target-row button{min-height:44px}.proposal-panel{scroll-margin-top:110px}.analytics{margin-top:18px}.analytics .tabs{overflow:auto;flex-wrap:nowrap;gap:8px}.analytics .tabs button{white-space:nowrap;min-height:52px;font-size:13px}.method-grid{grid-template-columns:1fr 1fr}.chart-description{font-size:13px!important}.small-note{font-size:12px}.history-metrics strong{font-size:23px}.history-metrics>div{min-width:0}.data-card p{overflow-wrap:anywhere}.limits summary{font-size:12px;min-height:40px}.var-explanation{margin-top:18px}.var-explanation summary{min-height:44px}
.client-export-fields{grid-template-columns:1.3fr 1fr}.client-export-fields label{font-size:13px}.client-export-actions{margin:20px 0 0}.client-export-actions button{min-width:180px}.client-export-panel #client-purchase-details{padding:0}.client-export-panel #client-purchase-details>p,.client-export-panel #client-purchase-details>button,.client-export-panel #client-purchase-details>#client-purchase-rows{margin-left:18px;margin-right:18px}.client-export-panel #client-purchase-details>#client-purchase-rows{margin-bottom:18px}.research-export{margin-top:18px}.research-export button{margin-top:12px}.purchase-fields label{font-size:12px}.purchase-title span{font-size:13px}summary::-webkit-details-marker{display:none}
@media(max-width:1180px){.workspace{grid-template-columns:1fr}.composition .asset-row{display:grid;grid-template-columns:minmax(230px,1fr) minmax(260px,1fr);gap:8px 22px}.composition .return-inputs{margin:0;align-items:start}.composition .asset-model{grid-column:2;grid-row:2;margin:0}.composition .asset-options{grid-column:1;grid-row:2}.allocation-panel .profiles{grid-template-columns:repeat(3,minmax(0,1fr))}.calculation-main{gap:16px}.stock-panel .history-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){main{padding:24px 18px}.topbar{padding:0 20px}.workflow-nav button{padding:10px;gap:8px;font-size:13px}.workflow-nav button small{font-size:11px}.nav-step{width:25px;height:25px}.calculation-main{grid-template-columns:1fr 1fr}.calculation-main button{grid-column:1/-1;width:100%}.calculation-extra{grid-template-columns:1fr 1fr}.quick-guide{grid-template-columns:1fr;gap:16px}.summary-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.stock-toolbar{grid-template-columns:1fr 1fr}.stock-toolbar label{grid-column:1/-1}.readiness{align-items:start;flex-direction:column}.frontier-panel .chart-profiles{grid-template-columns:1fr}.method-grid{grid-template-columns:1fr}}
@media(max-width:540px){main{padding:20px 14px}.topbar{height:60px;padding:0 16px}.brand{gap:8px;font-size:12px}.brand strong{font-size:15px}.brand .divider{margin:0}.local-label{display:none}.page-heading{gap:12px;margin-bottom:20px}h1{font-size:24px}.page-heading .eyebrow{display:none}.page-heading .subtitle{font-size:12px;max-width:200px}.page-heading button{padding:8px 11px;font-size:12px}.workflow-nav{grid-template-columns:1fr 1fr;top:4px;gap:4px;padding:5px}.workflow-nav button{min-height:58px;font-size:13px;padding:8px 10px}.workflow-nav button small{font-size:11px}.app-view{scroll-margin-top:140px}.global-status{margin:14px 0 20px;gap:10px}.global-status #status{font-size:11px;line-height:1.6}.global-status .tag{font-size:10px}.view-heading h2{font-size:20px}.view-heading p{font-size:13px}.composition,.allocation-panel,.stock-panel,.client-export-panel,.frontier-panel{padding:18px}.calculation-panel{padding:18px}.calculation-main{gap:14px}.calculation-main label{font-size:12px}.calculation-main .primary{min-width:0;font-size:13px}.calculation-extra{gap:14px}.calculation-extra .quiet{font-size:12px}.composition .asset-row{display:block}.composition .asset-model{margin-top:8px}.composition .return-inputs{margin-top:10px}.composition .asset-badge{display:flex}.allocation-panel .profiles{grid-template-columns:1fr}.profile-card{padding:20px}.profile-card .profile-label h3{font-size:17px}.profile-card .profile-stats{justify-content:space-between}.profile-settings{grid-template-columns:1fr}.disclosure>summary{font-size:13px;padding:12px}.disclosure>summary span{font-size:11px;width:100%;margin-left:23px}.disclosure-body{padding:4px 12px 16px}.summary-cards{gap:10px}.summary-cards article{padding:16px}.summary-cards strong{font-size:25px}.summary-cards article>span,.summary-cards small{font-size:12px}.class-group>summary{padding:14px;gap:8px}.budget-numbers,.budget-state{padding-left:20px}.class-securities{padding:12px}.securities-actions .primary,.securities-actions .secondary{width:100%}.securities-actions .tag{margin-bottom:4px}.weights-tools{margin-left:0;width:100%}.weights-tools>summary{justify-content:space-between}.weights-tools>div{position:static;margin-top:8px;box-shadow:none}.stock-toolbar{grid-template-columns:1fr}.stock-toolbar label{grid-column:auto}.stock-panel .history-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.client-export-fields{grid-template-columns:1fr}.client-export-actions button{min-width:0;width:100%}.client-export-panel #client-purchase-details>p,.client-export-panel #client-purchase-details>button,.client-export-panel #client-purchase-details>#client-purchase-rows{margin-left:12px;margin-right:12px}.purchase-card{padding:12px}.purchase-fields{gap:12px}.analytics .tabs{padding:0 8px}.analytics .tabs button{padding:8px;font-size:12px}.stock-asset-fields{grid-template-columns:1fr 1fr}.utility-controls{grid-template-columns:1fr}.manual-panel .metrics{grid-template-columns:1fr 1fr}.proposal-panel{scroll-margin-top:150px}.proposal-values{font-size:12px}.client-export-fields input,.client-export-fields select,.stock-asset-fields input,.return-inputs input,.return-inputs select{font-size:16px}}

.profile-card .profile-label{min-height:28px}.profile-card>button{width:100%;margin-top:16px}.allocation-panel .profiles>.empty-section{grid-column:1/-1}.profile-card .profile-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px}.profile-card .profile-stats>div{font-size:12px}.stock-results-extra>summary{margin:0}.app-view .chart{max-width:none}.stock-panel .history-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:650px){.page-heading{flex-direction:row}.stock-panel .history-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Anchors remain below the sticky navigation, including when text wraps or is zoomed. */
.app-view,#stock-panel,#assets,#proposal,#manual-panel,#allocation-panel{scroll-margin-top:var(--workflow-offset,96px)}
.composition .asset-main{grid-template-columns:minmax(0,1fr) 44px}.remove{min-width:44px;min-height:44px}.asset-options summary,.calculation-options summary,.profile-card summary{min-height:44px}
.return-inputs:has(label[hidden]){grid-template-columns:1fr}.stock-asset-fields>label:has([data-stock-field=expected]){grid-column:1/-1}

.analysis-detail-body>.tabs{border-top:1px solid var(--line)}.cal-mix>label{flex-direction:row;align-items:center}

/* Instrument editors are disclosed one at a time; the universe stays scannable. */
.composition .asset-row{display:block;padding:0;border-bottom:1px solid var(--line)}.asset-summary{display:flex;align-items:center;gap:12px;min-height:80px;padding:15px 0;list-style:none;cursor:pointer}.asset-summary:after{content:'+';margin-left:auto;color:var(--primary);font-size:20px;font-weight:400;flex-shrink:0}.asset-row[open]>.asset-summary:after{content:'−'}.asset-summary .asset-title{min-width:0;align-items:start}.asset-summary .asset-title>span:last-child{min-width:0}.asset-summary-mode{display:block;font-size:12px;color:var(--primary);margin-top:5px}.asset-editor{padding:4px 0 14px}.asset-editor .asset-class{background:white;border:1px solid #ccd7df;max-width:none;min-height:40px;padding:8px 10px;font-size:13px}.asset-editor .asset-main{align-items:end}.asset-editor .asset-main label{font-size:12px}.asset-editor .asset-model{margin-top:8px}.asset-editor .return-inputs{margin-top:12px}.asset-editor .asset-options{margin-top:6px}

/* Two views of one model, with utility curves reserved for allocation. */
.allocation-frontier{margin:22px 0;padding:20px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);min-width:0}
.allocation-frontier h3{font-size:16px}.allocation-frontier .section-heading{gap:12px}.allocation-frontier .section-heading button{font-size:12px;white-space:nowrap;min-height:44px}
#allocation-chart-surface,#chart-surface{width:100%;min-width:0}#allocation-frontier-chart,#frontier-chart{position:relative;min-height:0;max-width:none;overflow:visible}
.opportunity-svg{display:block;width:100%;height:auto;overflow:visible;touch-action:pan-y}.axis-labels{font-variant-numeric:tabular-nums}
.plot-grid{stroke:#e2ebe8;stroke-width:1}.plot-grid-vertical{stroke:#e9efec;stroke-dasharray:3 5}.plot-zero{stroke:#c5d6d1}
.portfolio-cloud{stroke:#739b92;stroke-opacity:.35;stroke-width:1.8;stroke-linecap:round;fill:none}.frontier-path,.frontier-soft{fill:none;stroke:#146b68;stroke-linecap:round;stroke-linejoin:round}.frontier-path{stroke-width:3}.frontier-soft{stroke-width:9;stroke-opacity:.08}.utility-curve{fill:none;stroke-width:1.6;stroke-opacity:.75;stroke-dasharray:5 6}
.frontier-hit{cursor:pointer;outline:none}.frontier-hit:focus-visible{fill:#146b68;stroke:white;stroke-width:2;r:5}.opportunity-svg [role=button]{cursor:pointer}.opportunity-svg [role=button]:focus-visible{outline:2px solid #1d6660;outline-offset:4px;border-radius:6px}
.chart-tooltip{width:270px;max-width:100%;border:1px solid #d9e6e1;border-radius:12px;background:#fffffff5;color:var(--ink);padding:13px 15px;box-shadow:0 8px 30px #213b4e15;font-size:12px;line-height:1.45}.chart-tooltip>strong{display:block;font-size:13px;margin-bottom:10px}.chart-tooltip>div{display:grid;grid-template-columns:1fr 1fr;gap:12px}.chart-tooltip span{color:var(--muted)}.chart-tooltip b{display:block;margin-top:4px;color:var(--ink);font-size:18px;font-weight:650;font-variant-numeric:tabular-nums}
.chart-hint{font-size:12px;color:var(--muted);text-align:left;line-height:1.6;margin:8px 0 12px}.legend{gap:10px 18px;font-size:12px;line-height:1.5}.legend .line{background:#146b68}.legend .cloud-dot{background:#739b92}.legend .cal-line{background:none;border-top:2px dashed #b47727;height:0}.legend .dashed{border-color:#9463ac}
.allocation-chart-keys{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}.allocation-chart-key{display:flex;align-items:center;gap:8px;min-height:44px;font-size:12px;padding:6px 9px;background:white;border:1px solid var(--line);color:var(--ink)}.allocation-chart-key:hover{background:#f0f7f4}.allocation-chart-key .profile-number{width:22px;height:22px;font-size:12px;flex-shrink:0}
.allocation-point{padding:18px;border:1px solid #b8d7cd;border-radius:12px;background:#f3faf7;scroll-margin-top:var(--workflow-offset,96px);margin-top:18px}.allocation-point .section-heading{margin-bottom:14px}.allocation-point-metrics{display:flex;flex-wrap:wrap;gap:18px;font-size:12px;color:var(--muted)}.allocation-point-metrics strong{display:block;font-size:22px;color:var(--ink);margin-top:4px}.allocation-point>.primary{margin-top:16px;min-height:44px}.allocation-point [aria-label="Закрыть выбранный состав"]{min-width:44px;min-height:44px;font-size:23px}
#chart-dialog .allocation-chart-keys{display:flex}#chart-dialog .chart-hint{margin-top:10px}
@media(max-width:540px){.allocation-frontier{margin:18px 0;padding:18px 0}.allocation-frontier .section-heading h3{font-size:15px}.legend{gap:8px 14px;font-size:12px}.allocation-chart-key{font-size:12px}.allocation-point{padding:14px}.allocation-point>.primary{width:100%}.allocation-point-metrics{gap:12px}.allocation-point-metrics strong{font-size:20px}}
