/* Scoped corrections; no calculator formula, persistence schema or brand changes. */
html{scroll-padding-top:104px}
.topbar{position:sticky;top:0;z-index:25}
@media(min-width:921px){.sidebar{position:sticky;top:88px;height:calc(100dvh - 88px);overflow-y:auto;align-self:start;overscroll-behavior:contain}}
.workspace-toolbar{min-width:0;align-items:flex-start;flex-wrap:wrap}
.quick-tabs{display:flex;min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;grid-template-columns:none}
.quick-tab{flex:0 0 auto;white-space:nowrap;min-height:40px}
.workspace,.form-panel,.results-panel,.bank-workspace,.history-workspace{min-width:0}
.tool-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:20px}
.tool-actions>.calculate-button{width:auto;flex:1 1 160px}
.form-clear{min-height:44px;padding:10px 20px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft)}
.world-search-row{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 14px;align-items:end}
.world-search-row>.input-field{display:contents}
.world-search-row .label-line{grid-column:1/-1;max-width:none}
.world-search-row .field-label{grid-column:1/-1;width:100%;max-width:none;line-height:1.6}
.world-search-row input{grid-column:1;width:100%;min-width:0}
.world-search-row>button{grid-column:2;min-height:44px}
.bank-workspace .field-hint,.record-dialog .field-hint{margin:12px 0;max-width:none;line-height:1.7;height:auto;white-space:normal;overflow-wrap:anywhere}
.bank-workspace>.workspace-tabs{margin-block:20px}
.bank-workspace>.year-grid{margin-top:20px}
.bank-workspace>.table-scroll,.bank-workspace>.tool-layout{margin-top:24px}
.bank-workspace .month-card{min-width:0}
.history-card{row-gap:16px}
.history-card-title{display:grid;gap:10px;align-content:start}
.history-card-title .indicator-region{line-height:1.5}
.history-card-title .history-open{line-height:1.5;min-height:0;white-space:normal;padding:0;justify-content:flex-start}
.history-card-title time.field-hint{display:block;margin:0;max-width:none;line-height:1.6}
.history-card .history-summary,.history-card .history-result{line-height:1.75;margin:0}
.history-card .history-summary{max-width:none}
@media(max-width:920px){html{scroll-padding-top:88px}}
@media(max-width:620px){.workspace-toolbar{display:block}.quick-tabs{width:100%;display:flex;margin-bottom:12px}.quick-tab{padding-inline:14px;font-size:12px}.world-search-row{gap:8px 10px}.history-card{padding:20px;gap:18px}.bank-controls{flex-wrap:wrap}.bank-controls>.field{flex:1 1 160px}}

/* Approved original 111 mark: stable box dimensions, decorative beside wordmark. */
.brand-mark{padding:0;overflow:hidden;flex-shrink:0}
.brand-mark img{display:block;width:100%;height:100%}

/* R2: shared field rows and actions keep a common baseline. */
.fields-grid{align-items:stretch}
.fields-grid>.input-field{grid-template-rows:1fr auto;align-content:stretch}
.fields-grid>.input-field>.label-line{align-self:stretch;align-items:flex-start}
.fields-grid>.input-field>.label-line label{align-self:center}
.fields-grid>.input-field>.label-line>.field-info{align-self:center}
.tool-actions{align-items:stretch}
.tool-actions>button,.tool-actions>.calculate-button{margin:0;min-height:46px;align-self:stretch;display:flex;align-items:center;justify-content:center}
.help-entry{align-items:flex-start;justify-content:flex-start;text-align:left}
.help-entry>*{width:100%;text-align:left}
.help-article,.help-article h2,.help-article h3,.help-article p{text-align:left}
.version-label{font-weight:650;letter-spacing:.08em;color:var(--accent);background:var(--accent-soft);padding:6px 10px;border-radius:6px;line-height:1.25}
@media(max-width:620px){.version-label{display:inline-flex;font-size:10px}.header-actions{gap:10px}}

@media(max-width:420px){.tool-actions>button,.tool-actions>.calculate-button{flex:0 0 auto;width:100%}}

@media(max-width:380px){.topbar{padding-inline:14px}.header-actions{gap:6px}.settings-button{min-width:40px;padding-inline:10px}.settings-button .settings-label{display:none}}

/* R3: dashboard changes apply to both presentations; phone-only rules below. */
.dashboard-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:18px 0}
.dashboard-toolbar>.workspace-tabs{margin:0;flex:1 1 auto}
.dashboard-toolbar>#economic-refresh{min-height:44px;padding:10px 18px;border-radius:9px;flex-shrink:0}
.dashboard-time-note{font-size:12px;color:var(--muted);line-height:1.6;margin:12px 0}
.economic-workspace>.field-hint{margin:12px 0;max-width:none}
.world-search-results{grid-column:1/-1;display:grid;gap:8px;min-width:0}
.world-search-results:empty{display:none}
.world-search-match{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:12px;border:1px solid var(--line);border-radius:9px}
.world-search-match>span{flex:1 1 170px;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.world-search-match>button{min-height:44px;padding:8px 12px;border-radius:7px;font-size:12px}
.city-comparison-editor>.input-field{margin:14px 0}
@media(max-width:920px){.field.mobile-module.mobile-navigation{display:grid;grid-template-columns:1fr 1fr;gap:12px}.mobile-navigation>.field{min-width:0}.mobile-navigation select{width:100%;max-width:100%;text-overflow:ellipsis}}
@media(max-width:620px){
 /* Keep pinch zoom accessible; readable controls prevent Safari's focus zoom. */
 input:not([type=checkbox]):not([type=radio]),select,textarea,.input-field input,.input-field select,.input-field textarea{font-size:16px}
 .mobile-navigation .field-label{font-size:12px}
 .world-search-row{grid-template-columns:minmax(0,1fr)}
 .world-search-row input,.world-search-row>button{grid-column:1}
 .world-search-match>span{flex-basis:100%}
}

@media(max-width:920px){input:not([type=checkbox]):not([type=radio]),select,textarea,.input-field input,.input-field select,.input-field textarea{font-size:16px}.expression-editor{font-size:20px}}
@media(max-width:620px){.field.mobile-module.mobile-navigation{grid-template-columns:1fr}.dashboard-toolbar>.workspace-tabs{flex-basis:100%}.dashboard-toolbar>#economic-refresh{width:100%}}

/* Final audit: translated Settings labels must not widen narrow phone headers. */
@media(max-width:480px){
 .header-actions{gap:6px;flex-shrink:0}
 .settings-button{width:44px;min-height:44px;padding-inline:10px}
 .settings-button .settings-label{display:none}
}
/* Final audit: retain the existing accessible dark-theme green for the PRO badge. */
:root[data-theme=dark] .version-label{color:#9ad9bb}

/* Mobile focus: keep the selected calculator/tool above repeated navigation. */
.bank-mobile-copy{display:none}
@media(max-width:620px){
 .workspace{padding-top:14px}
 .field.mobile-module.mobile-navigation{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;margin-bottom:16px}
 .mobile-navigation>.field{gap:6px}
 .mobile-navigation select{min-height:44px}
 .workspace-toolbar{display:none}
 .module-heading{margin-bottom:16px}
 .module-heading h1{font-size:24px;line-height:1.2}
 .module-subtitle{display:none}
 .world-search-row,.world-search-results{display:none}
 .bank-scope-note,.bank-calendar-status.is-published{display:none}
 .bank-desktop-copy{display:none}
 .bank-mobile-copy{display:inline}
 .bank-workspace>.workspace-tabs{margin-block:12px}
 .bank-workspace .bank-calendar-status,.bank-workspace .bank-calendar-legend{margin:6px 0;font-size:11px;line-height:1.5}
 .bank-workspace>.year-grid{margin-top:12px}
 .bank-information summary{min-height:44px;display:flex;align-items:center}
 .dashboard-toolbar{flex-wrap:nowrap;align-items:flex-end;gap:8px;margin-block:12px}
 .dashboard-toolbar>.workspace-tabs{flex:1 1 0;min-width:0;gap:6px}
 .dashboard-toolbar>.workspace-tabs>button{min-height:44px;padding:8px 10px;font-size:12px}
 .dashboard-toolbar>#economic-refresh{flex:0 0 auto;width:auto;min-height:44px;max-width:100px;padding:8px 12px;font-size:12px;background:#def1e8;color:#17634f}
 :root[data-theme=dark] .dashboard-toolbar>#economic-refresh{background:#294f3e;color:#c5f0da}
}

/* R2 phone interactions. The native desktop controls stay unchanged. */
.world-mobile-city-field,.bank-year-mobile,.bank-year-notice,.dashboard-mobile-menu,.city-data-credit{display:none}
@media(max-width:620px){
 .field-help-dialog{width:calc(100% - 24px);max-width:480px;max-height:calc(100dvh - 24px);margin:auto;overflow:auto;overflow-wrap:anywhere}
 .field-help-dialog h2{font-size:20px;line-height:1.4}
 .field-help-dialog p{font-size:14px;line-height:1.65}
 .field-help-dialog .tool-actions{margin-top:20px}
 .world-desktop-city-field,.bank-year-desktop{display:none}
 .world-mobile-city-field,.bank-year-mobile{display:grid}
 .world-mobile-city-field input{font-size:16px;width:100%;min-width:0}
 .city-suggestions:empty,.city-search-status:empty{display:none}
 .city-suggestions{max-height:min(250px,35dvh);overflow:auto;border:1px solid var(--line);border-radius:9px;background:var(--surface)}
 .city-suggestion{width:100%;min-height:44px;text-align:left;justify-content:flex-start;padding:10px 12px;background:var(--surface);border-bottom:1px solid var(--line);font-size:13px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
 .city-suggestion[aria-selected=true]{background:var(--accent-soft);color:var(--ink)}
 .city-search-status,.bank-year-notice{font-size:12px;color:var(--muted);line-height:1.6}
 .city-data-credit{display:block;font-size:11px;color:var(--muted);line-height:1.6;margin-top:18px}
 .city-data-credit a{color:inherit}
 .bank-year-notice{display:block;margin:12px 0}
 .bank-year-notice:empty{display:none}
 .bank-year-pending>:not(.bank-controls):not(.bank-year-notice){display:none}
 .dashboard-toolbar{display:none}
 .dashboard-mobile-menu{display:flex;flex-wrap:wrap;align-items:stretch;gap:8px;margin:12px 0 16px}
 .dashboard-mobile-menu>button{flex:0 0 auto;min-height:44px;padding:8px 10px;font-size:12px;line-height:1.3;border:1px solid var(--line);border-radius:9px;background:var(--surface)}
 .dashboard-mobile-menu>button.active{background:var(--accent);color:white;border-color:var(--accent)}
 .dashboard-mobile-menu>#economic-refresh{background:#def1e8;color:#17634f;border-color:#def1e8;margin:0}
 :root[data-theme=dark] .dashboard-mobile-menu>#economic-refresh{background:#294f3e;color:#c5f0da;border-color:#294f3e}
 .dashboard-mobile-data-notes{margin-top:24px;padding-top:12px;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}
 .dashboard-mobile-data-notes .field-hint{margin:12px 0;max-width:none}
}

/* R3: prioritize the active tool on phones without changing desktop. */
@media(max-width:620px){
 #world-results{scroll-margin-top:90px}
 .world-comparisons{grid-column:1/-1;min-width:0}
 .world-comparisons .city-comparison-editor{margin-top:0;border-top:0;padding-top:0}
 .world-comparisons .world-comparison-result{margin-top:20px}
 .scientific-more{margin-top:16px;border-top:1px solid var(--line);padding-top:10px}
 .scientific-more>summary{min-height:44px;display:list-item;align-content:center;cursor:pointer;font-weight:600;color:var(--accent)}
 .scientific-workspace .calculator-panel{padding:16px}
 .scientific-workspace .expression-editor{margin:8px 0 12px;min-height:48px}
 .scientific-workspace .memory-keys{margin-block:6px}
 .bank-controls{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .bank-year-mobile{min-width:0}
 .month-card{scroll-margin-top:90px}
 .events-panel{margin-top:20px;display:flex;flex-direction:column;gap:12px}
 .events-panel>h2{font-size:22px;line-height:1.35;margin:0}
 .events-panel>.field-hint{margin:0;max-width:none;line-height:1.65;height:auto}
 .events-panel .event-row{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:18px 0;margin:0}
 .events-panel .event-row>*{margin:0;line-height:1.6;max-width:100%;height:auto}
 .events-panel .event-row h3{font-size:16px;line-height:1.45}
 .events-panel .event-row .source-link{margin:0;padding:4px 0;min-height:44px;display:flex;align-items:center}
 .events-panel .event-row .data-status{margin:0}
}

/* Follow-up: actual DOM order, not a scroll-only substitute. */
@media(max-width:620px){
 .fields-grid>.world-inline-result{grid-column:1/-1;margin:4px 0;padding:16px;background:var(--surface-soft);border:1px solid var(--line);border-radius:12px;min-width:0}
 .world-inline-result>h2{font-size:18px;margin-bottom:12px}
 .world-inline-result .money-result{font-size:32px;margin:0 0 8px}
 .world-inline-result .result-unit{margin-bottom:14px}
 .world-inline-result .empty-result{min-height:0;padding-top:0;font-size:12px;line-height:1.6}
 .world-inline-result .result-summary>div{padding-inline:6px}
 .events-panel .event-row{gap:12px;padding:20px 0}
 .events-panel .event-row .source-link{padding:0;min-height:44px}
}

/* R4: financial form hierarchy, limited to the phone presentation. */
@media(max-width:620px){
 .financial-designed-layout{gap:22px}
 .financial-designed-form{padding:0!important;border:0;background:transparent;border-radius:0}
 .financial-designed-form>h2{font-size:14px;line-height:1.4;color:var(--muted);font-weight:500;margin:0 0 14px}
 .financial-designed-form>.fields-grid{display:flex;flex-direction:column;gap:14px}
 .financial-input-group{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:16px;min-width:0;box-shadow:0 2px 6px #102a2003}
 .financial-group-title{display:flex;align-items:center;gap:9px;font-size:14px;line-height:1.45;letter-spacing:-.01em;margin:0 0 16px;padding-bottom:12px;border-bottom:1px solid var(--line)}
 .financial-group-number{display:inline-flex;align-items:center;justify-content:center;width:25px;height:25px;flex:0 0 25px;border-radius:8px;background:var(--accent-soft);color:var(--accent);font-size:10px;font-weight:600;letter-spacing:.03em}
 .financial-group-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:18px 12px;align-items:start}
 .financial-group-fields>.input-field{gap:8px;min-width:0}
 .financial-group-fields .label-line{min-height:28px;align-items:center}
 .financial-group-fields .field-label{font-size:12px;line-height:1.45;font-weight:500}
 .financial-group-fields input,.financial-group-fields select,.financial-group-fields textarea{width:100%;min-height:48px;border-radius:10px;background:var(--surface);font-size:16px;border:1px solid var(--line)}
 .financial-group-fields input:not(:disabled){box-shadow:inset 0 1px 2px #102a2003}
 .financial-group-fields input:disabled{background:var(--surface-soft);color:var(--muted)}
 .financial-group-fields select{background-color:var(--surface-soft)}
 .financial-group-fields .field-info summary{width:28px;min-height:28px;height:28px;background:var(--surface)}
 .financial-group-fields .maturity-preview{grid-column:1/-1;margin:0;padding:12px;border-radius:9px;border:1px solid var(--line);background:var(--surface-soft);font-size:12px;line-height:1.65}
 .financial-group-fields .maturity-preview.non-business{background:#ffdf65;color:#3c3408}
 .financial-group-fields .maturity-preview:empty{display:none}
 .financial-designed-form>.tool-actions{background:var(--surface);border:1px solid var(--line);padding:12px;border-radius:14px;gap:10px;align-items:stretch;margin-top:16px}
 .financial-designed-form .calculate-button{min-height:50px;margin-top:0;font-size:14px;font-weight:600}
 .financial-designed-form>button.calculate-button{width:100%;margin-top:16px;border-radius:12px}
 .financial-designed-form>.input-help{font-size:11px;line-height:1.65;margin:14px 2px}
 .financial-designed-form>.fee-editor,.financial-designed-form>.flow-editor,.financial-designed-form>.scenario-editor,.financial-designed-form>.input-field{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:16px;margin-top:14px;min-width:0}
 .financial-designed-form>.fee-editor>summary{padding:0;min-height:44px;font-size:13px;line-height:1.5;align-content:center}
 .financial-designed-form>.flow-editor>h3{font-size:14px;line-height:1.5;margin:0 0 12px}
 .financial-designed-form>.flow-editor>.input-help{margin:0 0 16px;line-height:1.65}
 .financial-designed-form .flow-row{border:1px solid var(--line);border-radius:10px;padding:12px;background:var(--surface-soft);margin-bottom:12px}
 .financial-designed-form>.scenario-editor{display:grid;gap:12px}
 .financial-designed-form>.scenario-editor button{margin:0;min-height:44px}
 .financial-designed-layout>.results-panel{border-radius:16px;padding:18px;border-top:3px solid var(--accent)}
 .financial-designed-layout>.results-panel>h2{font-size:18px;line-height:1.4;margin-bottom:16px}
 .financial-designed-layout>.results-panel>.empty-result{min-height:0;padding:0;font-size:13px;line-height:1.7}
 :root[data-theme=dark] .financial-group-number{background:#294f3e;color:#c5f0da}
}

/* R5: reuse the approved financial cards for the Tools section. */
.tools-bank-title{display:none}
@media(max-width:620px){
 .tools-designed-form>.weekday-settings{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:16px;margin-top:14px}
 .tools-designed-form>.weekday-settings legend{font-size:12px;font-weight:600;color:var(--ink)}
 .tools-designed-form>.tool-actions>.primary-button{min-height:50px;font-size:14px;font-weight:600}
 .tools-designed-form>.secondary-action{min-height:44px;padding:10px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface);margin-top:14px;font-size:12px}
 .tools-designed-form .world-inline-result{margin:4px 0 0;padding:14px;background:var(--surface-soft);grid-column:1/-1}
 .tools-designed-form .world-inline-result .result-summary>div{grid-template-columns:minmax(80px,.8fr) minmax(0,1.2fr);gap:10px}
 .tools-designed-bank>.bank-controls{display:block;margin:0}
 .tools-designed-bank>.bank-controls .financial-group-fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .tools-designed-bank .bank-year-mobile{gap:8px}
 .tools-designed-bank .bank-year-mobile>label{display:flex;align-items:center;min-height:28px;line-height:1.45;font-size:12px}
 .tools-designed-bank .financial-group-fields>.bank-year-desktop{display:none}
 .tools-designed-bank .month-card{border-radius:16px;border:1px solid var(--line);padding:16px}
 .tools-designed-bank .month-card>h3{padding-bottom:12px;border-bottom:1px solid var(--line);margin-bottom:12px;font-size:15px}
 .tools-designed-bank .bank-information{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px 16px}
 .tools-designed-bank>.tool-layout{gap:16px}
 .tools-designed-bank .tool-layout>.form-panel,.tools-designed-bank .tool-layout>.result-panel{border:1px solid var(--line);border-radius:16px;padding:16px;background:var(--surface);min-width:0}
 .tools-designed-bank .tool-layout>.form-panel{display:grid;gap:16px}
 .tools-designed-bank .tool-layout>.result-panel{border-top:3px solid var(--accent)}
 .tools-designed-bank .tools-bank-title{display:block;font-size:14px;padding-bottom:12px;border-bottom:1px solid var(--line);line-height:1.5}
 .tools-designed-bank .form-panel input:not([type=checkbox]),.tools-designed-bank .form-panel select{min-height:48px;font-size:16px;border-radius:10px}
 .tools-designed-bank .form-panel .tool-actions{margin-top:0}
}

/* R6: shared civil date selector and a compact mobile market overview. */
.date-picker-dialog{width:min(94vw,420px)}
.date-picker-navigation{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0}
.date-picker-navigation button{font-size:1.5rem;min-width:44px;min-height:44px}
.date-picker-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin:12px 0 20px}
.date-picker-days>span{text-align:center;padding:8px 0;color:var(--muted)}
.date-picker-days button{min-width:0;min-height:44px;padding:4px;border:1px solid transparent;border-radius:10px}
.date-picker-days button.today{outline:2px solid #16785f;outline-offset:-2px;font-weight:700}
.date-picker-days button.selected{background:#cde9df;color:#145a49}
.date-picker-input{cursor:pointer}
/* Financial mode switch: one rounded, quiet control with a clear selected state. */
.financial-sections{display:inline-flex;max-width:100%;gap:4px;margin:0 0 18px;padding:4px;border:1px solid var(--line);border-radius:16px;background:var(--surface-soft);box-sizing:border-box}
.financial-sections button{appearance:none;min-height:44px;min-width:0;padding:10px 16px;border:0;border-radius:12px;background:transparent;color:var(--muted);font:inherit;font-size:14px;font-weight:600;line-height:1.35;text-align:center;cursor:pointer;transition:background-color .15s ease,color .15s ease,box-shadow .15s ease}
.financial-sections button:hover{background:var(--surface);color:var(--ink)}
.financial-sections button.active{background:var(--accent,#17795f);color:#fff;box-shadow:0 1px 3px #00000012}
.financial-sections button:focus-visible{outline:2px solid var(--accent,#17795f);outline-offset:3px}
@media(max-width:620px){.financial-sections{display:flex;width:100%}.financial-sections button{flex:1 1 0;padding:10px 8px}}
@media(prefers-reduced-motion:reduce){.financial-sections button{transition:none}}
@media(max-width:620px){
 .tools-layout.result-priority{display:flex;flex-direction:column;gap:18px}
 .tools-layout.result-priority>.results-panel{order:-1;margin:0;padding:16px 20px}
 .result-priority .money-result{font-size:1.8rem}
 .scientific-more{margin:10px 0 14px}
 .economic-workspace .indicator-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:start}
 .economic-workspace .indicator-card{padding:14px 12px;min-height:0;gap:8px;min-width:0}
 .economic-workspace .indicator-card h3{font-size:.88rem;line-height:1.35;overflow-wrap:anywhere;margin:0}
 .economic-workspace .indicator-value{font-size:clamp(1.1rem,4.7vw,1.45rem);line-height:1.2;overflow-wrap:anywhere;margin:4px 0}
 .economic-workspace .indicator-card .field-hint{font-size:.72rem;line-height:1.4;margin:0}
 .economic-workspace .indicator-region{font-size:.65rem;margin:0}
 .economic-workspace .indicator-card .source-link{margin:4px 0;font-size:.75rem}
 .economic-workspace .indicator-card .data-status{font-size:.65rem;align-self:start}
 .economic-workspace .indicator-info{margin:0;font-size:.75rem}
 .economic-workspace .indicator-metadata{font-size:.75rem}
 .economic-workspace .indicator-metadata summary{padding:8px 0}
 .economic-workspace .indicator-metadata p{margin:5px 0}
 .economic-workspace .market-reference-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .market-reference-card{border:1px solid var(--line);border-radius:14px;padding:14px 12px;min-width:0}
 .market-reference-card h3{font-size:.88rem;margin:0 0 8px}
 .market-reference-card p,.market-reference-card a{font-size:.75rem;line-height:1.4}
 .event-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .economic-workspace .event-row{padding:14px 12px;margin:0;border:1px solid var(--line);border-radius:14px;display:flex;flex-direction:column;gap:10px;min-width:0}
 .economic-workspace .event-row>*{margin:0;line-height:1.45}
 .economic-workspace .event-row h3{font-size:.88rem}
 .economic-workspace .event-row p,.economic-workspace .event-row a{font-size:.75rem}
 .event-region-title{margin:22px 0 12px;font-size:1rem}
 .event-row .source-link{margin:0!important}
}

.compact-result-details>summary{cursor:pointer;padding:10px 0;font-weight:600}
@media(min-width:621px){.compact-result-details>summary{display:none}}
@media(max-width:620px){.result-priority .results-panel{gap:10px}.result-priority .results-panel>h2{margin:0 0 8px}.result-priority .money-result{margin:0;line-height:1.3}.result-priority .result-unit{margin:8px 0}.result-priority .compact-result-details{margin-top:10px}.result-priority .history-result-actions{margin-top:8px}}

.rate-history-editor{border-top:1px solid var(--line);margin:20px 0;padding-top:18px}.rate-history-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;border:1px solid var(--line);border-radius:14px;padding:14px;margin:12px 0}.rate-history-row>.secondary-action{grid-column:1/-1;justify-self:start}@media(max-width:620px){.rate-history-row{grid-template-columns:1fr}.rate-history-row>.secondary-action{justify-self:stretch}}

/* R7: one editable scientific display, between the two key groups on phones. */
@media(max-width:620px){
 .scientific-workspace .scientific-display{position:sticky;top:80px;z-index:20;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 12px;margin:10px 0;box-shadow:0 4px 14px #0000000d}
 .scientific-workspace .scientific-display .display-caption{display:block;margin:0 0 4px;font-size:11px}
 .scientific-workspace .scientific-display .expression-editor{display:block;margin:0;min-height:48px;font-size:22px;background:var(--surface-soft);border-color:transparent}
}

/* R14: equal neighbours, content-sized rows; no minimum or global row height. */
@media(max-width:620px){
 .economic-workspace .indicator-grid,.economic-workspace .event-grid{align-items:stretch;grid-auto-rows:auto}
 .economic-workspace .indicator-card,.economic-workspace .event-row{height:auto;min-height:0;box-sizing:border-box;gap:8px;background:var(--surface)}
 .economic-workspace .indicator-card>.source-link,.economic-workspace .event-row>.source-link{margin-top:auto!important}
 .economic-workspace .indicator-info summary{padding:5px 0}
 .economic-workspace .bls-snapshot-note{color:var(--muted)}
}


/* R21: exactly two readable, content-sized dashboard columns at all sizes. */
.economic-workspace .indicator-grid,.economic-workspace .event-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:stretch;grid-auto-rows:auto}
.economic-workspace .indicator-card,.economic-workspace .event-row{display:flex;flex-direction:column;gap:8px;min-height:0;height:auto;padding:18px;background:var(--surface);border:1px solid var(--line);border-radius:16px;min-width:0}
.economic-workspace .indicator-card>*{margin:0;overflow-wrap:anywhere}
.economic-workspace .indicator-card>.source-link{margin-top:4px!important;min-height:44px;align-content:center}
.economic-workspace .indicator-card .indicator-info{margin-top:0}
.interpolation-group{border:1px solid var(--line);border-radius:16px;background:var(--surface);padding:20px;margin-bottom:16px;display:grid;gap:16px}
.interpolation-group h3{margin:0;padding-bottom:12px;border-bottom:1px solid var(--line);font-size:1rem}
.tenor-unit-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.interpolation-group input,.interpolation-group select{width:100%;min-width:0;font-size:16px;min-height:48px}
.interpolation-formula{line-height:1.6;overflow-wrap:anywhere}
.interpolation-layout .results-panel{align-self:start}
@media(max-width:620px){.economic-workspace .indicator-card{padding:14px 12px}.interpolation-form{padding:0!important;background:transparent!important;border:0!important}.interpolation-group{padding:16px}.interpolation-group .input-field{min-width:0}.economic-workspace .indicator-card .indicator-value{font-size:clamp(1.1rem,4.5vw,1.5rem)}.economic-workspace .indicator-card .field-hint{font-size:.75rem;line-height:1.5}}

/* R22: use the established numbered input cards for interpolation. */
.interpolation-layout{gap:20px;align-items:start}
.interpolation-layout .interpolation-form{padding:0;background:transparent;border:0;box-shadow:none;min-width:0}
.interpolation-form-heading{font-size:14px;color:var(--muted);font-weight:500;margin:0 0 16px}
.interpolation-group{gap:18px;padding:18px;margin-bottom:16px;box-shadow:0 2px 6px #102a2003}
.interpolation-group .interpolation-group-title{display:flex;align-items:center;gap:9px;font-size:14px;line-height:1.45;padding-bottom:12px}
.interpolation-group-number{display:inline-flex;align-items:center;justify-content:center;width:25px;height:25px;flex:0 0 25px;border-radius:8px;background:var(--accent-soft);color:var(--accent);font-size:10px;font-weight:600}
.interpolation-method{margin-left:auto;border-radius:999px;background:var(--accent-soft);color:var(--accent);padding:5px 12px;font-size:12px;font-weight:600;white-space:nowrap}
.interpolation-group .input-field{min-width:0;gap:8px}
.interpolation-group .label-line{min-height:28px;align-items:center}
.interpolation-group .field-label{font-size:12px;line-height:1.45;font-weight:500}
.interpolation-group .field-info summary{width:28px;height:28px;min-height:28px}
.interpolation-group input,.interpolation-group select{box-sizing:border-box;height:48px;min-height:48px;max-height:48px;border-radius:10px;padding:10px 12px;border:1px solid var(--line);background-color:var(--surface);font-size:16px}
.interpolation-group select{background-color:var(--surface-soft)}
.interpolation-group .field-hint{margin:0;font-size:12px;line-height:1.65;color:var(--muted)}
.interpolation-form .tool-actions{padding:12px;border:1px solid var(--line);border-radius:16px;background:var(--surface);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
.interpolation-form .tool-actions button{min-height:48px;border-radius:10px}
.interpolation-layout .results-panel{min-width:0;padding:20px;border:1px solid var(--line);border-top:3px solid var(--accent);border-radius:16px;background:var(--surface)}
.interpolation-layout .results-panel>h2{font-size:18px;margin:0 0 16px}
.interpolation-result-value{padding:16px;background:var(--accent-soft);border-radius:12px;display:grid;gap:8px;margin-bottom:16px}
.interpolation-result-value .money-result{margin:0;font-size:30px;line-height:1.2;overflow-wrap:anywhere}
.interpolation-layout .result-summary{margin:0;font-size:13px}
.interpolation-layout .result-summary>div{padding:12px;gap:12px;align-items:start}
.interpolation-layout .result-summary dd{text-align:right;overflow-wrap:anywhere}
.interpolation-layout .interpolation-formula{font-size:12px;margin:16px 0;padding:12px;border-radius:10px;background:var(--surface-soft)}
@media(max-width:620px){.interpolation-group{padding:16px}.interpolation-layout{gap:16px}.interpolation-layout .results-panel{padding:16px}}

/* R23: optional fees follow the same field rhythm as the loan form. */
.loans-layout .fee-editor{border:1px solid var(--line);border-radius:16px;background:var(--surface);padding:16px;margin-top:16px}
.loans-layout .fee-editor>summary{font-size:14px;font-weight:600;padding:4px 0;min-height:32px}
.loan-fee-groups{display:grid;gap:16px;padding-top:16px}
.loan-fee-card{min-width:0;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.loan-fee-card h3{font-size:14px;margin:0 0 16px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.loan-fee-card .financial-group-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
.loan-fee-card .input-field{gap:8px;min-width:0}
.loan-fee-card .label-line{min-height:28px;align-items:center}
.loan-fee-card .field-label{font-size:12px;line-height:1.45;font-weight:500}
.loan-fee-card input,.loan-fee-card select{box-sizing:border-box;width:100%;height:48px;min-height:48px;max-height:48px;font-size:16px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background-color:var(--surface)}
.loan-fee-card select{background-color:var(--surface-soft)}
.loan-fee-card .field-info summary{height:28px;min-height:28px;width:28px}
/* Market Brief: news and context only, never a second indicator dashboard. */
.market-brief{min-width:0}.market-brief-updated,.market-brief-meta{font-size:12px;line-height:1.6;color:var(--muted)}.market-brief-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:18px 0}.market-brief-section,.market-brief-today,.market-brief-bottom{min-width:0;border:1px solid var(--line);border-radius:14px;padding:20px;background:var(--surface)}.market-brief h3{font-size:16px;line-height:1.4;margin:0 0 14px}.market-brief h4{font-size:14px;line-height:1.55;font-weight:600;margin:0 0 6px}.market-brief-story+.market-brief-story{margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}.market-brief-context{font-size:13px;line-height:1.65;margin:10px 0}.market-brief-source{font-size:12px;text-underline-offset:3px}.market-brief-meta{margin:0}.market-brief-today,.market-brief-bottom{margin-top:16px}.market-brief-bottom p{font-size:14px;line-height:1.65;margin:0}.market-brief details{font-size:12px;line-height:1.6;margin-top:12px}.market-brief summary{cursor:pointer;padding:6px 0;color:var(--muted)}.market-brief-context-archive .market-brief-story{margin-top:12px}.market-brief a{overflow-wrap:anywhere}.market-brief p{overflow-wrap:anywhere}.market-brief :focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.economic-workspace .dashboard-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.economic-workspace .dashboard-toolbar>.workspace-tabs{display:flex;flex-wrap:wrap;gap:6px;flex:1 1 auto}.economic-workspace .dashboard-toolbar>.workspace-tabs button{white-space:normal;min-height:40px}.economic-workspace .dashboard-toolbar>#economic-refresh{width:auto;flex:0 0 auto;min-height:40px;margin:0}
@media(max-width:620px){.market-brief-grid{grid-template-columns:1fr;gap:12px}.market-brief-section,.market-brief-today,.market-brief-bottom{padding:16px}.economic-workspace .dashboard-toolbar{gap:8px}.economic-workspace .dashboard-toolbar>.workspace-tabs{flex:1 1 100%}.economic-workspace .dashboard-toolbar>.workspace-tabs button{flex:1 1 auto;font-size:12px;padding:8px}.economic-workspace .dashboard-toolbar>#economic-refresh{justify-self:start;padding:8px 14px}}

.market-brief-grid{align-items:start}.market-brief a{color:var(--accent)}.market-brief-priorities{padding-left:18px;margin:0}.market-brief-priorities li+li{margin-top:14px}.market-brief-priorities a{font-size:13px;font-weight:600}.market-brief-priorities p{margin:6px 0 0}

/* Economic Dashboard: the refresh action belongs to its subtitle, above tabs. */
.module-heading .economic-subtitle-row{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:10px;width:fit-content;max-width:100%;min-width:0;margin-top:8px}
.economic-subtitle-row .module-subtitle{display:block;flex:0 1 auto;min-width:0;margin:0;line-height:1.5;overflow-wrap:break-word}
.economic-refresh-slot{display:flex;align-items:center;flex:0 0 auto}
.economic-refresh-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;box-sizing:border-box;min-height:34px;width:auto;margin:0;padding:6px 10px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--accent,#18775f);font:inherit;font-size:12px;font-weight:600;line-height:1.2;white-space:nowrap;cursor:pointer}
.economic-refresh-button svg{width:14px;height:14px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.economic-refresh-button:hover:not(:disabled){background:var(--surface-soft);border-color:var(--accent,#18775f)}
.economic-refresh-button:focus-visible{outline:2px solid var(--accent,#18775f);outline-offset:3px}
.economic-refresh-button:disabled{opacity:.6;cursor:wait}
/* Calendar has its own content flow; indicator-card sizing never governs events. */
.economic-workspace .events-panel{display:flex;flex-direction:column;gap:24px;margin-top:20px;text-align:left}
.economic-workspace .calendar-heading{display:flex;flex-direction:column;gap:8px;height:auto;min-height:0;position:static}
.economic-workspace .calendar-heading h2{margin:0;padding:0;font-size:22px;line-height:1.35;height:auto;position:static}
.economic-workspace .calendar-heading p{margin:0;padding:0;font-size:13px;line-height:1.6;height:auto;max-width:65ch;color:var(--muted)}
.economic-workspace .event-region{display:flex;flex-direction:column;gap:12px;min-width:0;margin:0}
.economic-workspace .event-region-title{margin:0;padding:0;font-size:16px;line-height:1.4;height:auto;position:static}
.economic-workspace .events-panel .event-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start;grid-auto-rows:auto}
.economic-workspace .events-panel .event-row{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:7px;height:auto;min-height:0;padding:18px;margin:0;border:1px solid var(--line);border-radius:14px;background:var(--surface);min-width:0}
.economic-workspace .events-panel .event-row>*{position:static;height:auto;min-height:0;max-width:100%;margin:0;line-height:1.55;overflow-wrap:anywhere}
.economic-workspace .events-panel .event-row .event-title{font-size:15px;line-height:1.45;font-weight:650;color:var(--ink)}
.economic-workspace .events-panel .event-row .event-date{font-size:13px;font-weight:550;color:var(--ink)}
.economic-workspace .events-panel .event-row .field-hint{font-size:12px;color:var(--muted)}
.economic-workspace .events-panel .event-row .data-status{align-self:flex-start;padding:3px 8px;font-size:11px;border-radius:6px;margin:3px 0;background:var(--accent-soft);color:var(--ink)}
.economic-workspace .events-panel .event-row>.source-link{display:inline-flex;align-items:center;min-height:44px;padding:0;margin:0!important;font-size:12px;color:var(--onelleve-accent);text-underline-offset:3px}
@media(max-width:767px){.economic-workspace .events-panel .event-grid{grid-template-columns:minmax(0,1fr)}.economic-workspace .events-panel .event-row{padding:16px}.economic-workspace .calendar-heading h2{font-size:20px}}
