/* Shared density and typography for the downloader and analyst workspaces. */
:root {
  --bg: #12091f;
  --panel: #1a102b;
  --panel2: #211438;
  --border: #3a2853;
  --text: #f2f2f2;
  --muted: #b5a9c3;
  --amber: #ffd400;
  --blue: #2196f3;
}
body {font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 13px; line-height: 1.45; background: var(--bg)}
h2 {color: var(--amber); text-transform: none; letter-spacing: -.25px; font-size: 23px; line-height: 1.25}
h3 {letter-spacing: 0; text-transform: none}
label {text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--amber)}
button, .smallBtn, .actionBtn, .primaryActionBtn, .secondaryActionBtn, .cancelBtn {
  width: auto;
  max-width: 100%;
  min-height: 32px;
  margin: 0;
  padding: 6px 11px;
  border-radius: 5px;
  font: 600 12px/1.35 Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  box-shadow: none;
  background: linear-gradient(180deg, #ffbd24, #d58f00);
  border: 1px solid #946900;
  color: #111;
}
button:hover {filter: brightness(1.08)}
button:disabled {opacity: .5; cursor: default}
button:focus-visible, a:focus-visible, summary:focus-visible {outline: 2px solid var(--amber); outline-offset: 2px}
.secondaryActionBtn, .actionBtn, .smallBtn {background: #211438; border-color: #614579; color: #f2eaf9}
.cancelBtn {background: #432632; border-color: #835365; color: #ffdce5}
input, select {min-height: 32px; padding: 6px 9px; font-size: 13px; margin: 4px 0 8px; background: #10091c; border-color: #4c3564}
input[type=checkbox], input[type=radio] {min-height: 0; accent-color: var(--amber)}
.card {max-width: 1440px; margin: 16px auto; padding: 20px; border-radius: 10px; background: #1a102b; border-color: #3a2853; box-shadow: 0 6px 20px #0002}
#loginBox {max-width: 390px; margin-top: 9vh; padding: 28px}
#loginBtn {width: 100%; margin-top: 12px}
.coreBadge, .panelEyebrow {letter-spacing: .2px; font-size: 10px; text-transform: none}
.workspaceTabs, .financialMappingTabs {gap: 6px}
.workspaceTabs {grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-top: 12px}
.workspaceTab {padding: 10px 12px; line-height: 1.35}
.workspaceTab strong {font-size: 14px; overflow-wrap: anywhere}
.companySelectionGrid {grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr); gap: 5px 12px; align-items: start}
.companySelectionGrid > div {min-width: 0}
.companySelectionGrid label {margin: 0}
.companySelectionGrid input {margin: 4px 0 0}
.companySelectionGrid .searchHint {grid-column: 1 / -1; margin: 2px 0 6px; line-height: 1.4}
.companySearchField {position: relative}
.companySearchField #suggestions {position: absolute; top: 100%; left: 0; right: 0; z-index: 50; max-height: 320px; overflow: auto; box-shadow: 0 8px 20px #0005}
.companySearchField #suggestions:empty {display: none}
.companySearchField #suggestions, .companySearchField #suggestions .suggestion {background: #10091c !important; opacity: 1; backdrop-filter: none}
.companySearchField #suggestions .suggestion:hover {background: #211438 !important}
#app select, #app option {background: #10091c !important; color: var(--text)}
.v58DateRow {max-width: 640px; grid-template-columns: repeat(2, minmax(0, 1fr))}
.v58DateRow label {margin: 4px 0 0}
#secWorkspace > .v59Control {display: inline-flex; width: auto; margin: 8px 0; padding: 6px 10px; align-items: center}
#secWorkspace > .checkboxGrid {grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); align-items: start; max-width: 1320px}
#secWorkspace > .checkboxGrid > .checkItem {margin: 0; padding: 8px 10px; min-height: 44px; box-sizing: border-box}
#secWorkspace .checkItem > span {min-width: 0; font-size: 12px; line-height: 1.4; overflow-wrap: normal; word-break: normal}
#secWorkspace .secFormCode {display: inline-block; white-space: nowrap}
#secWorkspace .v70StatementChoices {padding: 10px; border-color: var(--border)}
#secWorkspace .v70StatementChoices .checkItem {padding: 8px; min-height: 36px; box-sizing: border-box}
#secWorkspace #downloadFormat {max-width: 440px}
#secWorkspace > .downloadActionRow {display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 8px}
#secWorkspace > .downloadActionRow > button {flex: 0 1 auto; width: auto}
#observedFormsSection {padding: 0; margin: 12px 0; max-width: 1320px}
#observedFormsSection > summary {padding: 11px 14px; cursor: pointer; color: var(--amber); font-size: 13px; font-weight: 600}
#observedFormsSection > summary:hover {background: #ffd4000a}
.observedFormsContent {padding: 0 14px 14px}
.workspaceTab, .financialMappingTab {min-width: 0; width: auto; flex: 0 1 auto; border: 1px solid #4c3564; background: #211438; color: #eee5f7}
.workspaceTab.active, .financialMappingTab.active {background: #30213e; border-color: var(--amber); box-shadow: inset 0 -2px var(--amber)}
.financialMappingTab strong {font-size: 12px}
.financialMappingTab small {font-size: 10px; color: #c8b8da; text-transform: none; line-height: 1.3}
#financialMappingModal {padding: 0 !important; overflow: hidden !important; background: #080411aa}
#financialMappingModal .financialMappingDialog {
  width: 100vw !important; height: 100dvh !important; min-height: 0 !important; max-height: 100dvh !important;
  display: flex !important; flex-direction: column; overflow: hidden !important; border-radius: 0; background: #160c26;
}
#financialMappingModal .financialMappingHeader {padding: 9px 14px !important; background: #1a102b; border-bottom: 1px solid #3a2853}
#financialMappingModal .financialMappingHeader h2 {font-size: 19px !important; line-height: 1.2 !important; text-transform: none; color: var(--amber)}
#financialMappingModal .financialMappingHeader p {margin: 3px 0; font-size: 11px !important; max-width: 1000px !important; color: #bfb1cf}
#financialMappingModal .financialMappingSummary {display: flex; flex-wrap: wrap; gap: 5px !important; padding: 4px 14px !important}
#financialMappingModal .financialMappingSummary > span {display: flex; align-items: center; gap: 5px; padding: 4px 7px !important; min-width: 0; border: 1px solid #3a2853; background: #211438; color: #cabbda; font-size: 10px !important; line-height: 1.2 !important}
#financialMappingModal .financialMappingSummary strong {font-size: 12px !important}
#financialMappingModal .financialMappingSummary button {font-size: 10px; min-height: 26px}
#financialMappingModal .financialMappingTabs {position: static !important; padding: 4px 14px !important; background: #1a102b !important; border-color: #3a2853 !important; overflow-x: auto; flex-wrap: nowrap}
#financialMappingModal .financialMappingTab {min-height: 32px !important; padding: 5px 9px !important; max-width: 240px; text-align: left}
#financialMappingModal .financialMappingTab small {overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px}
#financialMappingModal .financialMappingToolbar {position: static !important; background: #211438 !important; padding: 4px 14px !important; grid-template-columns: auto minmax(140px,200px) auto minmax(200px,400px) minmax(0,1fr) !important}
#financialMappingModal .financialMappingToolbar > span {max-width: 420px; color: #bfb1cf}
#financialMappingModal .v48EvidenceWorkspace {flex: 1 1 auto; min-height: 0; overflow: hidden}
#financialMappingModal .financialMappingTableWrap {
  flex: 1 1 auto !important; min-height: 120px !important; height: auto !important; max-height: none !important;
  overflow: auto !important; margin: 0 10px !important; scrollbar-gutter: stable;
}
#financialMappingModal .v48EvidenceWorkspace.v48EvidenceOpen .financialMappingTableWrap {max-height: none !important}
#financialMappingModal .financialMappingValidation {position: static !important; flex: none; margin: 0; max-height: 46px !important; padding: 5px 14px; overflow: auto; font-size: 11px}
#financialMappingModal .financialMappingFooter {position: static !important; flex: none; margin: 0; padding: 7px 14px !important; min-height: 0; border-top: 1px solid #4c3564; background: #1a102b}
#financialMappingModal .financialMappingFooter > div {display: flex; gap: 6px; flex-wrap: wrap}
#financialMappingModal .financialMappingFooter button {min-height: 30px !important; padding: 5px 10px !important; font-size: 11px !important}
#financialMappingModal .v53StatementExport {flex: none; display: flex; gap: 7px; padding: 5px 14px; margin: 0; background: #1a102b; border-color: #4c3564}
#financialMappingModal .v53StatementExport details {margin: 0}
#financialMappingModal .v53StatementExport > small {font-size: 10px}
#financialMappingModal .v53StatementExport button {min-height: 29px; padding: 5px 10px}
#financialMappingModal .v69AI {flex: none; margin: 0; border-radius: 0; border: 0; border-bottom: 1px solid #3a2853; background: #211438; color: #eee5f7}
#financialMappingModal .v69AI > summary {padding: 6px 14px; font-size: 11px}
#financialMappingModal .v48EvidenceMeta {max-height: 115px; overflow: auto}
#financialMappingModal .v48SourceEvidencePanel {min-height: 0; overflow: hidden}
#financialMappingModal .v48SourceEvidencePanel .v48EvidenceFrame {min-height: 100px; flex: 1}
#financialMappingModal .v48EvidenceActions {gap: 4px; flex-wrap: wrap}
#financialMappingModal .v48EvidenceActions a {padding: 4px 7px; font-size: 11px}
#financialMappingModal .v48EvidenceHeader {padding: 6px 10px}
#financialMappingModal .v48EvidenceHeader h3 {font-size: 14px}
#financialMappingModal[data-review-type=CAPITAL] .financialMappingHeader p,
#financialMappingModal[data-review-type=CAPITAL] .financialMappingSummary,
#financialMappingModal[data-review-type=CAPITAL] .financialMappingHeader .coreBadge,
#financialMappingModal[data-review-type=CAPITAL] .v69AI {display: none}
#financialMappingModal .v53CapitalControls {
  display: block; flex: none; padding: 8px 14px 6px; color: #eee5f7; background: #1a102b;
  border-bottom: 1px solid #4c3564; max-height: min(42vh,400px); overflow: auto;
}
.v991-capital-heading, .v991-capital-toolbar, .v991-inline-actions, .v991-view-options {display: flex; align-items: center; gap: 6px; flex-wrap: wrap}
.v991-capital-heading {justify-content: space-between; gap: 10px}
.v991-capital-heading > div:first-child {display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap}
.v991-capital-heading strong {font-size: 14px}
.v991-capital-heading span {color: #bfb1cf; font-size: 11px}
.v991-capital-toolbar {margin-top: 6px}
.v991-capital-toolbar input[type=search] {width: 200px; flex: 0 1 230px}
.v991-capital-toolbar select {width: auto; max-width: 180px}
.v991-capital-toolbar input, .v991-capital-toolbar select {margin: 0; font-size: 11px; min-height: 29px}
.v991-view-options {gap: 0; border: 1px solid #614579; border-radius: 5px; overflow: hidden}
.v991-view-options button {background: transparent; border: 0; border-radius: 0; min-height: 28px; padding: 4px 10px}
.v991-view-options button[aria-pressed=true] {background: var(--amber); color: #111}
.v991-row-count {color: #bfb1cf; font-size: 11px; margin-right: auto}
#v53CapitalControls label.v991-check, .v991-check {display: inline-flex; gap: 5px; align-items: center; margin: 0; font-size: 11px; text-transform: none; white-space: nowrap; color: #d5c5e5}
.v991-check input[type=checkbox] {width: 13px; height: 13px; min-width: 13px; padding: 0; margin: 0}
#v53CapitalControls .v991-review-details {margin: 0}
#v53CapitalControls summary {padding: 4px 0; font-size: 11px; color: #dcc9ee}
#v53CapitalControls .v991-source-picker,
#v53CapitalControls .v991-tranche-mapping {margin: 5px 0 0; border-top: 1px solid #3a2853}
#v53CapitalControls .v991-source-picker:not([open]) {display: none}
.v991-source-controls {display: flex; align-items: flex-end; flex-wrap: wrap; gap: 7px}
#v53CapitalControls .v991-source-controls label {display: flex; flex-direction: column; gap: 2px; align-items: stretch; margin: 0; font-size: 11px}
.v991-source-controls select {width: 230px; margin: 0}
.v991-source-controls input {width: 280px; margin: 0}
.v991-source-picker > input[type=search] {width: min(480px,100%); margin: 6px 0}
.v991-source-list {max-height: 155px; overflow: auto; border: 1px solid #4c3564; border-radius: 5px}
.v991-source-choice {display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid #3a2853}
.v991-source-choice > input[type=checkbox] {width: 13px; height: 13px; min-height: 0; margin: 0}
.v991-source-choice > div {min-width: 0}
.v991-source-choice > div > span {display: block; font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis}
.v991-source-choice small {color: #bfb1cf; font-size: 10px}
.v991-source-choice button {flex: none; font-size: 11px; padding: 3px 7px; min-height: 26px}
#v53CapitalControls .v991-inline-status:empty {display: none}
.v991-aliases {max-height: 180px; overflow: auto}
#v53CapitalControls .v991-aliases > label {display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; align-items: center; margin: 3px 0; font-size: 11px}
.v991-aliases select {margin: 0; padding: 4px 7px; font-size: 11px}
#financialMappingModal .financialMappingTable.v62CapitalGrid {
  table-layout: auto !important; width: 100% !important; min-width: 800px !important; font-size: 12px;
}
#financialMappingModal .financialMappingTable.v62CapitalGrid th,
#financialMappingModal .financialMappingTable.v62CapitalGrid td {
  width: auto !important; min-width: 85px; height: auto; padding: 7px 10px !important; vertical-align: middle;
  white-space: nowrap !important; background: #160c26; color: #eee5f7; border-color: #3a2853;
}
#financialMappingModal .financialMappingTable.v62CapitalGrid th {position: sticky; top: 0; z-index: 3; background: #30213e; text-align: left}
#financialMappingModal .financialMappingTable.v62CapitalGrid th:first-child,
#financialMappingModal .financialMappingTable.v62CapitalGrid td:first-child {
  min-width: 230px; width: 28% !important; max-width: 350px; white-space: normal !important;
  position: sticky; left: 0; z-index: 2; line-height: 1.4;
}
#financialMappingModal .financialMappingTable.v62CapitalGrid th:first-child {z-index: 4}
#financialMappingModal .financialMappingTable.v62CapitalGrid tr:nth-child(even) td {background: #1c112e}
#financialMappingModal .financialMappingTable.v62CapitalGrid .v60ReportedTotal td {background: #30213e; font-weight: 600}
#financialMappingModal .financialMappingTable.v62CapitalGrid .v53Number {color: var(--amber) !important; text-transform: none; font-size: 12px !important}
#financialMappingModal .financialMappingTable.v62CapitalGrid .v53Number.hasWarning {color: #ffd18b !important}
#financialMappingModal .v991-row-actions {margin: 0}
.v991-row-actions > summary {padding: 3px 0; font-size: 11px; cursor: pointer}
.v991-row-actions[open] {position: relative; min-width: 160px}
.v991-row-actions input {min-width: 130px; max-width: 190px; margin: 5px 0}
.v991-row-actions button {display: block; min-height: 26px; margin: 3px 0; font-size: 11px}
#financialMappingModal .v53Editor {padding: 10px; margin: 8px 0; background: #211438; border-color: #614579}
#financialMappingModal .v53Editor h3 {font-size: 14px; margin: 0 0 8px}
#financialMappingModal .v53Editor label {margin: 6px 0; font-size: 11px}
#financialMappingModal .v65FacilityPanel {margin: 5px 0 0; padding: 0; border: 0; border-top: 1px solid #3a2853}
#financialMappingModal .v65FacilityPanel > summary {font-size: 11px; padding: 4px 0}
#financialMappingModal .v65FacilityPanel:not([open]) {max-height: 26px}
.v72-overlay .v85-dialog button {font-weight: 600; text-transform: none}
.v72-overlay .v85-dialog .v72-table-choice {width: 100%; text-align: left}
@media(max-width:900px) {
  .workspaceTabs {grid-template-columns: repeat(2, minmax(0, 1fr))}
  body {padding: 8px}
  .card {padding: 14px}
  #financialMappingModal .financialMappingToolbar {grid-template-columns: auto minmax(0,1fr) !important}
  #financialMappingModal .financialMappingToolbar > span {display: none}
  #financialMappingModal .financialMappingSummary {max-height: 80px; overflow: auto}
  #financialMappingModal .financialMappingHeader p {display: none}
  #financialMappingModal .v48EvidenceWorkspace.v48EvidenceOpen {grid-template-rows: minmax(120px,1fr) minmax(180px,45%) !important}
  .v991-capital-heading {gap: 5px}
  #financialMappingModal .v53CapitalControls {max-height: 44vh}
  .v991-source-controls input, .v991-source-controls select {max-width: 90vw}
}
@media(max-width:600px) {
  .workspaceTabs, .companySelectionGrid, .v58DateRow {grid-template-columns: minmax(0, 1fr)}
}
