/* Inter and Instrument Serif are declared once, in finexa-tokens.css: declared again here, a server answering no-store sent every preloaded font twice. */
:root { color-scheme: light; --canvas: #fafbfc; --surface: #fff; --sidebar: #f9fafc; --ink: #202738; --muted: #697386; --faint: #929aab; --line: #e9ecf1; --line-strong: #d8dde7; --blue: #326bf6; --blue-dark: #2055d6; --blue-soft: #edf3ff; --green: #15805a; --green-soft: #eaf7f1; --red: #c23d48; --red-soft: #fff0f1; --amber: #976615; --amber-soft: #fff8e9; --card: #fff; --field: #fff; --hover: #f0f2f7; --violet: #6d5bd0; --accent: #326bf6; --chart-0: #326bf6; --chart-1: #79a3ff; --chart-2: #a9c4fb; --chart-3: #cfdfff; --chart-4: #dfe6f4; --chart-5: #b0c8f5; --sidebar-width: 256px; --radius: 12px; font-family: Inter, sans-serif; font-size: 14px; font-synthesis: none; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
input, textarea, select { max-width: 100%; }
button:disabled, input:disabled, select:disabled, .button[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.3; }
h1 { font-size: 27px; letter-spacing: -.8px; }
h2 { font-size: 17px; letter-spacing: -.3px; }
h3 { font-size: 14px; }
p + p { margin-top: 10px; }
small { font-size: 12px; }
svg { flex: none; vertical-align: middle; }
button svg, a svg, .workspace-symbol svg, .search-field svg, .month-picker svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid #67e8f9; outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 200; padding: 12px 18px; color: #050816; background: var(--blue); border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

/* Application shell */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; width: var(--sidebar-width); background: var(--sidebar); border-right: 1px solid var(--line); transition: width .2s, transform .2s; }
.sidebar-brand-row { display: flex; align-items: center; justify-content: space-between; flex: none; height: 80px; padding: 0 20px 0 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .brand-mark { width: 30px; height: 30px; color: var(--blue); stroke: none; }
.brand-name { font-size: 25px; font-weight: 600; letter-spacing: -1.3px; }
.brand-period { color: var(--blue); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; padding: 7px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; transition: background .15s, color .15s; }
.icon-button:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
.icon-button[aria-pressed="true"] { background: var(--blue-soft); color: var(--blue); border-color: rgba(103,232,249,.3); }
.sidebar-toggle { width: 29px; height: 29px; }
.workspace-picker { display: flex; align-items: center; gap: 10px; flex: none; margin: 3px 16px 20px; padding: 11px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 2px #14274503; }
.workspace-symbol { display: flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border: 0; border-radius: 8px; color: #050816; background: var(--accent); }
.workspace-details { min-width: 0; flex: 1; }
.workspace-details label { display: block; margin-bottom: 2px; font-size: 11px; color: var(--muted); }
.workspace-details select { width: 100%; min-height: 20px; padding: 0 14px 0 0; border: 0; border-radius: 2px; background: transparent; font-size: 12px; font-weight: 500; cursor: pointer; text-overflow: ellipsis; }
.navigation { display: flex; flex: 1; flex-direction: column; gap: 4px; min-height: 0; padding: 0 14px 15px; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-group + .nav-group { margin-top: 20px; }
.nav-label { display: block; margin: 13px 12px 7px; color: var(--faint); font-size: 11px; font-weight: 500; letter-spacing: .9px; text-transform: uppercase; }
.nav-link, .navigation > a, .navigation > button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 10px 12px; border-radius: 7px; color: var(--muted); background: transparent; text-align: left; font-size: 12px; font-weight: 500; line-height: 1.5; transition: color .15s, background .15s; }
.nav-link:hover, .navigation > a:hover, .navigation > button:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
.nav-link.active, .nav-link[aria-current="page"], .navigation > .active, .navigation > [aria-current="page"] { color: var(--ink); background: var(--blue-soft); }
.nav-link svg { width: 18px; height: 18px; }
.nav-link .badge { margin-left: auto; }
.sidebar-footer { flex: none; margin: 0 16px; padding: 17px 8px 16px; border-top: 1px solid var(--line); font-size: 11px; }
.local-indicator { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 500; }
.status-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.sidebar-footer p { margin: 5px 0 10px 13px; color: var(--muted); font-size: 11px; }
.sidebar-return { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.sidebar-return svg { width: 15px; height: 15px; }
.sidebar-backdrop { display: none; }
.app-shell { margin-left: var(--sidebar-width); min-height: 100vh; transition: margin-left .2s; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 74px; padding: 14px 30px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-start, .topbar-actions { display: flex; align-items: center; min-width: 0; }
.topbar-actions { gap: 14px; }
.breadcrumb { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--ink); font-size: 12px; font-weight: 500; }
.breadcrumb-parent { color: var(--muted); font-weight: 400; white-space: nowrap; }
.breadcrumb-divider { color: var(--faint); }
#breadcrumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.search-field input { width: 238px; min-height: 35px; padding: 7px 10px 7px 35px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--field); font-size: 11px; }
.search-field input::placeholder { color: var(--faint); }
.profile-avatar { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border: 3px solid var(--canvas); border-radius: 50%; color: #050816; background: var(--accent); font-size: 11px; font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.mobile-toggle { display: none; }
.mobile-brand { display: none; }
.main-content { max-width: 1800px; margin: 0 auto; padding: 22px 30px 48px; }
.context-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.month-picker { display: inline-flex; align-items: center; gap: 8px; min-height: 33px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); }
.month-picker svg { width: 15px; height: 15px; color: var(--muted); }
.month-picker input { min-width: 135px; width: 142px; min-height: 23px; padding: 0; border: 0; background: transparent; font-size: 11px; font-weight: 500; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 25px; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 12px; }
.page-heading > div:first-child { min-width: 0; }
.page-heading .toolbar { flex-shrink: 0; margin: 0; }

/* Cards, key figures and small components */
.card { min-width: 0; padding: 21px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 3px #12284c02; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 19px; }
.card-heading h2 { font-size: 14px; letter-spacing: -.15px; }
.card-heading h3 { font-size: 13px; }
.card-heading p { margin-top: 5px; font-size: 11px; color: var(--muted); }
.card-heading .button { min-height: 29px; padding: 5px 10px; font-size: 11px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 22px; }
.kpi { min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.kpi .label, .label { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.kpi .value, .value { display: block; margin-top: 9px; color: var(--ink); font-size: 27px; font-weight: 600; line-height: 1.25; letter-spacing: -.9px; font-variant-numeric: tabular-nums; }
.kpi .change, .change { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 9px; color: var(--muted); font-size: 11px; }
.kpi .change svg { width: 13px; height: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(265px, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.grid-2 + .grid-2, .grid-main + .grid-2, .grid-main + .card, .grid-2 + .card, .card + .card { margin-top: 22px; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.muted { color: var(--muted); }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.amount { font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--hover); font-size: 11px; font-weight: 500; line-height: 1.5; }
.badge.positive { border-color: rgba(167,243,208,.3); background: var(--green-soft); }
.badge.negative { border-color: rgba(252,165,165,.3); background: var(--red-soft); }
.badge.primary { border-color: rgba(103,232,249,.3); color: var(--blue); background: var(--blue-soft); }
.badge.warning { border-color: rgba(252,211,77,.3); color: var(--amber); background: var(--amber-soft); }
.workspace-badge { padding: 3px 8px; background: var(--hover); font-weight: 400; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--field); color: var(--ink); font-size: 11px; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.button:hover { border-color: rgba(255,255,255,.28); background: var(--hover); text-decoration: none; }
.button.primary, .button-primary { border-color: #f4f6fb; color: #050816; background: #f4f6fb; box-shadow: none; }
.button.primary:hover, .button-primary:hover { border-color: #fff; background: #fff; }
.button.danger { color: var(--red); border-color: rgba(252,165,165,.3); background: var(--red-soft); }
.button.danger:hover { background: rgba(252,165,165,.2); }
.button.small { min-height: 28px; padding: 5px 9px; font-size: 11px; }
.button svg { width: 15px; height: 15px; }
.text-button { padding: 0; color: var(--blue); background: transparent; font-size: 11px; font-weight: 500; }
.text-button:hover { text-decoration: underline; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.toolbar input, .toolbar select { width: auto; max-width: 260px; min-height: 35px; font-size: 11px; }
.toolbar .search-field { flex: 1; min-width: 180px; }
.toolbar .search-field input { width: 100%; max-width: none; }
.tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--field); }
.tab { display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 500; }
.tab.active, .tab[aria-selected="true"] { border-color: var(--line); background: rgba(255,255,255,.14); color: var(--ink); box-shadow: none; }
.notice { margin-bottom: 20px; padding: 13px 16px; border: 1px solid rgba(103,232,249,.25); border-radius: 9px; background: var(--blue-soft); color: var(--muted); font-size: 12px; line-height: 1.7; }
.notice p + p { margin-top: 7px; }
.notice .button { margin-top: 9px; }
.notice-warning { border-color: rgba(252,211,77,.3); color: var(--amber); background: var(--amber-soft); }
.notice-danger { border-color: rgba(252,165,165,.3); color: var(--red); background: var(--red-soft); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 200px; padding: 30px 20px; color: var(--muted); text-align: center; }
.empty-state h1, .empty-state h2, .empty-state h3 { color: var(--ink); }
.empty-state p { max-width: 410px; font-size: 12px; line-height: 1.7; }
.empty-state svg { width: 35px; height: 35px; color: var(--faint); }
.empty-state .button { margin-top: 5px; }

/* Portfolio charts and account summaries */
.chart { display: block; width: 100%; min-width: 0; overflow: hidden; }
.chart svg, svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: var(--blue); stroke: var(--canvas); stroke-width: 2; }
.chart-label { fill: var(--faint); font-family: Inter, sans-serif; font-size: 11px; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 11px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
/* One series palette: SVG fills, legend dots and progress bars all read --chart-N. */
.dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--chart-0); }
.dot.color-1, .color-1 .dot { background: var(--chart-1); }
.dot.color-2, .color-2 .dot { background: var(--chart-2); }
.dot.color-3, .color-3 .dot { background: var(--chart-3); }
.dot.color-4, .color-4 .dot { background: var(--chart-4); }
.dot.color-5, .color-5 .dot { background: var(--chart-5); }
.color-0 { fill: var(--chart-0); }
.color-1 { fill: var(--chart-1); }
.color-2 { fill: var(--chart-2); }
.color-3 { fill: var(--chart-3); }
.color-4 { fill: var(--chart-4); }
.color-5 { fill: var(--chart-5); }
.allocation-list, .metric-list { margin: 0; padding: 0; list-style: none; }
.allocation-list > li, .metric-list > li, .metric-list > div { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.allocation-list > li:last-child, .metric-list > li:last-child, .metric-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.allocation-list > li:first-child, .metric-list > li:first-child, .metric-list > div:first-child { padding-top: 0; }
.allocation-list .split { gap: 9px; }
.metric-list dt { color: var(--muted); }
.metric-list dd { margin: 0; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.account-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.account-card h3 { margin-top: 15px; }
.account-card .value { margin: 9px 0 6px; }
.progress, progress { display: block; width: 100%; height: 7px; margin: 10px 0; overflow: hidden; border: 0; border-radius: 10px; background: var(--hover); accent-color: var(--blue); }
progress::-webkit-progress-bar { background: var(--hover); border-radius: 10px; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 10px; }
progress::-moz-progress-bar { background: var(--blue); border-radius: 10px; }
progress.color-0::-webkit-progress-value { background: var(--chart-0); }
progress.color-1::-webkit-progress-value { background: var(--chart-1); }
progress.color-2::-webkit-progress-value { background: var(--chart-2); }
progress.color-3::-webkit-progress-value { background: var(--chart-3); }
progress.color-0::-moz-progress-bar { background: var(--chart-0); }
progress.color-1::-moz-progress-bar { background: var(--chart-1); }
progress.color-2::-moz-progress-bar { background: var(--chart-2); }
progress.color-3::-moz-progress-bar { background: var(--chart-3); }
.progress svg { display: block; width: 100%; height: 100%; }
.progress rect { fill: var(--blue); }

/* Journal and accessible input controls */
.table-wrap { width: 100%; max-width: 100%; overflow: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; }
.data-table caption { padding-bottom: 12px; color: var(--muted); font-size: 11px; text-align: left; }
.data-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.035); font-size: 11px; font-weight: 400; white-space: nowrap; }
.data-table td { max-width: 360px; padding: 14px 12px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.data-table th:first-child, .data-table td:first-child { padding-left: 9px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 9px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(255,255,255,.03); }
.data-table td strong { font-weight: 500; color: var(--ink); }
.data-table .amount, .data-table .numeric { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.data-table .actions { white-space: nowrap; text-align: right; }
.data-table .button { min-height: 28px; padding: 4px 8px; font-size: 11px; }
.data-table .icon-button { width: 28px; height: 28px; padding: 5px; }
.data-table .muted { display: block; margin-top: 3px; color: var(--faint); font-size: 11px; }
.data-table .void { text-decoration: line-through; opacity: .6; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 17px; margin-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination .toolbar { margin: 0; gap: 6px; }
.pagination button { min-height: 29px; padding: 5px 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--muted); font-size: 12px; }
.field.full, .form-grid > .full { grid-column: 1 / -1; }
.field label, label.field > span:first-child { font-size: 11px; font-weight: 500; }
input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea { min-height: 37px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink); background: var(--field); font-size: 12px; outline-offset: 2px; }
/* Native option lists take these opaque colours, so they stay readable next to the translucent field. */
option { color: var(--ink); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: rgba(103,232,249,.6); }
textarea { min-height: 105px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; margin: 0 5px 0 0; accent-color: var(--blue); vertical-align: middle; }
input[type="file"] { width: 100%; padding: 7px; font-size: 11px; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 10px; border: 0; border-radius: 5px; color: var(--blue); background: var(--blue-soft); font: inherit; cursor: pointer; }
.field small { color: var(--faint); font-size: 11px; line-height: 1.5; }
.field:has(input[type="checkbox"]) { justify-content: center; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); }
.validation { margin: 15px 0 0; padding: 11px 13px; border: 1px solid rgba(252,165,165,.35); border-radius: 7px; color: var(--red); background: var(--red-soft); font-size: 12px; }
.validation:empty { display: none; }
details { border-bottom: 1px solid var(--line); }
details + details { margin-top: 12px; }
summary { padding: 12px 0; color: var(--ink); font-size: 12px; font-weight: 500; cursor: pointer; }
details[open] { padding-bottom: 16px; }
/* Shell fields override generic form controls. */
.workspace-details select { min-height: 20px; padding: 0 14px 0 0; border: 0; background: transparent; font-size: 12px; }
.month-picker input { min-height: 23px; padding: 0; border: 0; background: transparent; font-size: 11px; }
.search-field input { min-height: 35px; padding: 7px 10px 7px 35px; border-color: var(--line); background: var(--field); font-size: 11px; }

/* Modal, feedback and accessibility */
.app-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 24px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 100px rgba(0,0,0,.6); overscroll-behavior: contain; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 23px; }
.dialog-heading h2 { font-size: 19px; letter-spacing: -.5px; }
.dialog-heading .icon-button { width: 31px; height: 31px; }
#dialog-content > p { margin-bottom: 16px; color: var(--muted); font-size: 12px; line-height: 1.75; }
#dialog-content .notice { margin-bottom: 17px; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 100; max-width: min(480px, calc(100vw - 36px)); padding: 13px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); box-shadow: 0 8px 40px rgba(0,0,0,.5); font-size: 12px; }
.toast:empty { display: none; }
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 50vh; text-align: center; }
.loading-state h1 { margin-top: 23px; font-size: 22px; }
.loading-state p { margin-top: 10px; font-size: 12px; }
.loading-spinner { display: block; width: 27px; height: 27px; border: 2px solid rgba(255,255,255,.12); border-top-color: var(--blue); border-radius: 50%; animation: loading-spin .9s linear infinite; }
.noscript-message { position: fixed; z-index: 200; inset: auto 20px 20px; padding: 20px; border: 1px solid rgba(252,165,165,.4); border-radius: 10px; background: var(--red-soft); color: var(--red); }
@keyframes loading-spin { to { transform: rotate(360deg); } }

/* Screen compositions: one coherent rhythm across financial workflows. */
.navigation > p.nav-group { display: block; margin: 17px 12px 5px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .7px; text-transform: uppercase; }
.navigation > p.nav-group:first-child { margin-top: 0; }
.nav-link .nav-label { display: block; margin: 0; color: inherit; font-size: inherit; font-weight: inherit; letter-spacing: normal; text-transform: none; }
.card.kpi .label { display: flex; align-items: center; gap: 7px; }
.card.kpi .label svg { width: 14px; height: 14px; color: var(--faint); }
.kpi-grid > .card, .grid-main > .card, .grid-2 > .card, .grid-3 > .card, .stack > .card { margin-top: 0; }
.grid-main + .grid-main, .card + .grid-2, .grid-2 + .notice { margin-top: 22px; }
.card > h2 { margin-bottom: 17px; }
.card > p.muted { margin-top: 13px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.card > .button { margin-top: 15px; }
.card-heading > a { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 11px; font-weight: 500; }
.card-heading > a svg { width: 13px; height: 13px; }
.card-heading .value { margin: 8px 0 0; font-size: 28px; }
.small { font-size: 11px; }
.allocation-list > div { margin-top: 18px; }
.allocation-list > div:first-child { margin-top: 0; }
.allocation-list .split { font-size: 11px; }
.allocation-list .split > span { display: flex; align-items: center; gap: 7px; }
.allocation-list strong { font-weight: 500; }
.allocation-list .muted { font-size: 11px; }
.allocation-list .progress { height: 6px; margin-top: 9px; margin-bottom: 5px; }
.demo-notice { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 13px; background: var(--hover); color: var(--muted); font-size: 11px; }
.demo-notice > span { min-width: 0; }
.demo-notice .badge { margin-right: 8px; font-size: 11px; }
.demo-notice .button { flex: none; min-height: 29px; margin-top: 0; padding: 5px 9px; font-size: 11px; }
.filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 19px; }
.filters > .field { flex: 1; min-width: 150px; }
.filters input, .filters select { width: 100%; font-size: 11px; }
.checkbox-field { display: flex; align-items: flex-start; gap: 7px; margin: 16px 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.checkbox-field input { flex: none; margin-top: 2px; }
.budget-row { padding: 15px 0; border-bottom: 1px solid var(--line); }
.budget-row:first-child { padding-top: 0; }
.budget-row:last-child { padding-bottom: 0; border-bottom: 0; }
.budget-row .split { font-size: 12px; }
.budget-row .muted { font-size: 11px; }
.budget-row .button { min-height: 28px; padding: 5px 8px; font-size: 11px; }
.budget-row .progress { height: 6px; }
.obligation-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.obligation-row:last-child { border-bottom: 0; }
.obligation-row strong { font-size: 12px; font-weight: 500; }
.obligation-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.obligation-row > strong { text-align: right; white-space: nowrap; }
.obligation-row > .badge { justify-self: start; }
.obligation-row > .button { justify-self: end; }
.card > .stack:has(.obligation-row) { gap: 0; }
.obligation-row .toolbar { justify-content: flex-end; margin: 0; }
.obligation-row .button { min-height: 28px; padding: 5px 8px; font-size: 11px; }
.metric-list { margin-block: 13px; }
.metric-list > div > span { color: var(--muted); }
.metric-list strong { font-weight: 500; text-align: right; }
.account-card .toolbar { margin: 18px 0 0; }
.data-table th[scope="row"] { padding-block: 14px; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; font-size: 11px; font-weight: 400; white-space: normal; }
.data-table th[scope="row"] strong { font-weight: 500; }
.data-table th[scope="row"] small, .data-table td > small { display: block; margin-top: 4px; color: var(--faint); font-size: 11px; font-weight: 400; }
.data-table .toolbar { flex-wrap: nowrap; gap: 5px; margin: 0; }
.data-table td:has(> .amount), .data-table td:has(> .toolbar) { white-space: nowrap; }
.data-table tbody tr:last-child th { border-bottom: 0; }
.data-table .void-row { opacity: .5; }
.data-table .void-row th strong { text-decoration: line-through; }
.data-table td.numeric { color: var(--ink); }
.data-table .long-token { overflow-wrap: anywhere; }
.report-document h2 { margin-top: 20px; margin-bottom: 14px; }
.report-document h2:first-child { margin-top: 0; }
.report-document .metric-list { margin-bottom: 22px; }
.report-document > p { color: var(--muted); font-size: 12px; }
.report-document > h3 { margin: 22px 0 13px; }
.card > hr { margin: 22px 0; border: 0; border-top: 1px solid var(--line); }
.card > h3 + p { margin-top: 10px; }
.card > p + .toolbar { margin-top: 15px; }
.card > .notice { margin-top: 18px; }
#finance-form > .form-grid + .form-grid { margin-top: 17px; }
#finance-form > p { margin-top: 17px; font-size: 11px; line-height: 1.7; }
#finance-form > h3 { margin: 23px 0 12px; }
#finance-form > p + .form-grid { margin-top: 17px; }
progress.negative::-webkit-progress-value { background: var(--red); }
progress.negative::-moz-progress-bar { background: var(--red); }
#import-preview > hr { margin: 20px 0; border: 0; border-top: 1px solid var(--line); }
#import-preview > h3 { margin: 22px 0 13px; }
#import-preview > p, #restore-preview > p { margin: 12px 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
#import-preview > .button { margin-top: 15px; }
#restore-preview > h3 { margin: 22px 0 12px; }
.badge.primary { color: var(--blue-dark); }
#dialog-content pre { max-width: 100%; padding: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--field); color: var(--muted); font-size: 11px; }

@media (min-width: 1025px) {
  .sidebar-collapsed { --sidebar-width: 78px; }
  .sidebar-collapsed .sidebar-brand-row { justify-content: center; height: 116px; padding: 20px 0 47px; }
  .sidebar-collapsed .brand-name, .sidebar-collapsed .workspace-picker, .sidebar-collapsed .sidebar-footer, .sidebar-collapsed .navigation > p.nav-group { display: none; }
  .sidebar-collapsed .sidebar-toggle { position: absolute; top: 66px; left: 24px; transform: rotate(180deg); }
  .sidebar-collapsed .navigation { padding: 0 13px 20px; }
  .sidebar-collapsed .nav-link, .sidebar-collapsed .navigation > a, .sidebar-collapsed .navigation > button { justify-content: flex-start; gap: 25px; width: 50px; overflow: hidden; white-space: nowrap; padding: 12px 16px; }
  .sidebar-collapsed .nav-link > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); overflow: hidden; white-space: nowrap; }
}
@media (min-width: 1600px) {
  :root { --sidebar-width: 272px; }
  .main-content { padding: 26px 40px 55px; }
  .topbar { padding-inline: 40px; }
  .nav-link, .navigation > a, .navigation > button { min-height: 44px; font-size: 13px; }
  .kpi { padding: 21px 24px; }
  .kpi .value { font-size: 30px; }
}
@media (max-width: 1250px) {
  :root { --sidebar-width: 228px; }
  .topbar, .main-content { padding-left: 23px; padding-right: 23px; }
  .search-field input { width: 200px; }
  .kpi-grid { gap: 12px; }
  .kpi { padding: 16px; }
  .kpi .value { font-size: 24px; }
  .grid-main, .grid-2 { gap: 17px; }
  .card { padding: 19px; }
  .grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(230px, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar { width: 256px; visibility: hidden; transform: translateX(-100%); box-shadow: 20px 0 80px rgba(0,0,0,.5); transition: transform .2s, visibility 0s linear .2s; }
  .app-shell { margin-left: 0; }
  .sidebar-open .sidebar { visibility: visible; transform: translateX(0); transition: transform .2s, visibility 0s; }
  .sidebar-open .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; display: block; width: 100%; height: 100%; background: rgba(2,4,12,.6); }
  .sidebar-open { overflow: hidden; }
  .mobile-toggle { display: inline-flex; margin-right: 10px; margin-left: -7px; }
  .mobile-brand { display: inline-flex; flex: none; gap: 7px; margin-right: 18px; }
  .mobile-brand .brand-mark { width: 26px; height: 26px; }
  .mobile-brand .brand-name { font-size: 21px; letter-spacing: -1px; }
  .sidebar-toggle svg { transform: rotate(180deg); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main-content { padding-bottom: 35px; }
}
@media (max-width: 760px) {
  .topbar { gap: 12px; padding: 12px 18px; min-height: 66px; }
  .topbar-actions { gap: 6px; }
  .breadcrumb { font-size: 11px; gap: 8px; }
  .breadcrumb-parent, .breadcrumb-divider { display: none; }
  .search-field input { width: 175px; }
  .profile-avatar { display: none; }
  .main-content { padding: 19px 19px 32px; }
  h1 { font-size: 24px; }
  .page-heading { align-items: flex-start; margin-bottom: 20px; }
  .page-heading .toolbar { justify-content: flex-end; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; }
  .kpi { padding: 17px; }
  .kpi .value { font-size: 26px; }
  .grid-main, .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .card { padding: 19px; }
  .stack { gap: 17px; }
  .grid-main + .grid-2, .grid-2 + .grid-2, .grid-main + .grid-main, .grid-main + .card, .grid-2 + .card { margin-top: 17px; }
  .data-table th, .data-table td { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 480px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .topbar-start { flex: 1; }
  .topbar-actions { display: contents; }
  .hide-amounts { order: 1; }
  .topbar .search-field { flex: 1 0 100%; order: 2; }
  .topbar .search-field input { width: 100%; min-height: 34px; font-size: 11px; }
  .breadcrumb { display: none; }
  .mobile-brand { margin-right: 0; }
  .main-content { padding: 17px 14px 28px; }
  .context-bar { margin-bottom: 18px; }
  .month-picker { gap: 5px; padding-inline: 7px; }
  .month-picker input { width: 132px; min-width: 120px; font-size: 11px; }
  .month-picker svg { width: 14px; }
  .workspace-badge { max-width: 145px; font-size: 11px; }
  h1 { font-size: 23px; }
  .page-heading { flex-direction: column; gap: 15px; }
  .page-heading p { margin-top: 6px; font-size: 11px; line-height: 1.7; }
  .page-heading .toolbar { width: 100%; justify-content: flex-start; }
  .page-heading > .button { align-self: flex-start; }
  .button { min-height: 37px; font-size: 11px; }
  .kpi-grid { gap: 10px; }
  .kpi { padding: 14px 12px; }
  .kpi .label { min-height: 16px; }
  .kpi .value { margin-top: 8px; font-size: clamp(18px, 5.5vw, 24px); letter-spacing: -.7px; }
  .kpi .change { min-height: 15px; }
  .card { padding: 17px 15px; border-radius: 11px; }
  .card-heading { margin-bottom: 16px; gap: 10px; }
  .card-heading h2 { font-size: 13px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .toolbar { gap: 7px; }
  .toolbar input, .toolbar select { max-width: 100%; }
  .toolbar .search-field { min-width: 100%; }
  .pagination { align-items: flex-start; flex-direction: column; gap: 10px; }
  .pagination > .toolbar { width: 100%; justify-content: flex-end; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .form-actions { margin-top: 20px; }
  .form-actions .button { flex: 1; }
  .app-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); padding: 21px 17px; }
  .dialog-heading { margin-bottom: 19px; }
  .dialog-heading h2 { font-size: 18px; }
  .toast { right: 14px; bottom: 14px; left: 14px; max-width: none; }
  .notice { font-size: 11px; padding: 12px; }
  .demo-notice { flex-direction: column; align-items: flex-start; gap: 10px; }
  .demo-notice .button { align-self: flex-start; }
  .filters { align-items: stretch; }
  .filters > .field { min-width: 100%; }
  .obligation-row { flex-wrap: wrap; }
  .obligation-row .toolbar { width: 100%; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  :root { font-size: 10px; color-scheme: light; --faint: #697386; }
  body { color: #172033; background: white; }
  .sidebar, .topbar, .context-bar, .sidebar-backdrop, .skip-link, .toast, .app-dialog, .toolbar, .form-actions, .button, .icon-button, .tabs, .pagination, .no-print { display: none !important; }
  .app-shell { margin: 0; min-height: 0; }
  .main-content { max-width: none; margin: 0; padding: 0; }
  .page-heading { margin-bottom: 18px; }
  h1 { font-size: 22px; }
  .card, .kpi, .account-card { break-inside: avoid; box-shadow: none; border-color: #ccd3de; }
  .card { margin-bottom: 15px; padding: 15px; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 10px; }
  .kpi .value { font-size: 20px; }
  .grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-wrap { overflow: visible; }
  .data-table { min-width: 0; font-size: 9px; }
  .data-table th, .data-table td { padding: 8px 5px; }
  .data-table .actions { display: none; }
  .data-table tr { break-inside: avoid; }
  .data-table thead { display: table-header-group; }
  .chart { break-inside: avoid; }
  a { color: inherit; }
  .notice { background: white; border-color: #ccd3de; color: #46536b; }
}
