/* ANOVYR pilot workspace: presentation-only layer over the existing application. */
:root {
  color-scheme: light;
  --bg: #f5f7fa; --panel: #fff; --panel2: #f6f8fb; --border: #dce3ec;
  --text: #172b45; --muted: #56677d; --accent: #155bcb; --danger: #b42338; --warn: #925a12;
  --navy: #0c1b30; --cyan: #47cfdf; --radius: 12px;
}
body { font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea, summary, a { outline-offset: 3px; }
:focus-visible { outline: 3px solid #247bd6 !important; box-shadow: 0 0 0 2px #fff; }
[hidden], .hidden { display: none !important; }
input, select, textarea, .field-select, .notes, .admin-search, .admin-note, .context-bar select {
  border: 1px solid #cbd5e2; background: #fff; color: var(--text); border-radius: 7px; padding: 10px 12px;
  max-width: 100%; min-height: 42px;
}
input::placeholder, textarea::placeholder { color: #68798e; opacity: 1; }
input[type=checkbox] { min-height: auto; accent-color: var(--accent); }
input[type=file] { max-width: 100%; font-size: 13px; }
input[type=file]::file-selector-button { padding: 8px 12px; border: 1px solid var(--border); border-radius: 5px; background: #f2f6fb; color: var(--text); margin-right: 12px; cursor: pointer; }
.shell { grid-template-columns: 224px minmax(0,1fr); }
.sidebar { background: var(--navy); border: 0; padding: 28px 16px 16px; color: #eaf1fb; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #344960 transparent; z-index: 40; }
.brand { gap: 11px; font-size: 22px; letter-spacing: .09em; }
.brand .mark { width: 34px; height: 34px; border: 0; border-radius: 0; padding: 0; background: transparent; object-fit: contain; }
.sidebar .brand { padding: 0 12px; }
.finance-kicker { color: #9caec5; background: transparent; border: 0; font-size: 9px; letter-spacing: .13em; margin: 12px 0 18px; padding-left: 12px; }
.sidebar nav { gap: 4px; margin: 0 0 20px; }
.sidebar nav .nav-link, .sidebar nav a { color: #aebdd0; display: flex; gap: 11px; align-items: center; font-size: 13px; font-weight: 550; padding: 10px 12px; border-radius: 7px; min-height: 40px; }
.sidebar nav .nav-link:hover, .sidebar nav a:hover { color: #fff; background: #172d48; }
.sidebar nav .nav-link.active, .sidebar nav a.active { color: #fff; background: #1c3859; box-shadow: inset 3px 0 #45c4df; }
.nav-link strong { font-weight: inherit; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-icon svg { display: block; width: 100%; height: 100%; }
.nav-group-label { color: #91a4be; font-size: 9px; font-weight: 650; letter-spacing: .14em; padding: 19px 12px 5px; }
.nav-link > span:last-child:not(.nav-icon) { margin-left: auto; font-size: 11px; }
.user-card { margin-top: auto; border-color: #283d57; background: #112339; padding: 13px; font-size: 12px; flex-shrink: 0; }
.user-card small, .signout-button { color: #adbed1; }
.sidebar-note { color: #9aacbf; font-size: 10px; margin: 16px 12px 0; }
.admin-launch-link { color: #bed6f4; border-color: #304b6b; background: #132841; margin: 0 0 12px; }
main { max-width: 1800px; padding: 0 36px 44px; min-width: 0; }
.context-bar { height: 88px; padding: 15px 0; margin-bottom: 30px; align-items: center; gap: 18px; background: var(--bg); }
.context-label { color: var(--muted); letter-spacing: .09em; font-size: 10px; font-weight: 650; }
.workspace-picker { min-width: 0; }
.workspace-picker select { min-width: 210px; max-width: 310px; background: #fff; font-size: 13px; font-weight: 600; padding: 7px 32px 7px 10px; min-height: 34px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.search-trigger { font-size: 12px; display: flex; align-items: center; gap: 26px; background: #fff !important; }
kbd { border: 1px solid var(--border); border-radius: 4px; padding: 0 6px; font: inherit; color: var(--muted); }
.pilot-badge, .pilot-badge.live-policy { background: #edf4ff; color: #205692; border: 1px solid #ccdff4; font-weight: 600; letter-spacing: 0; }
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; cursor: pointer; gap: 9px; font-size: 12px; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.avatar { height: 33px; width: 33px; display: grid; place-items: center; border: 1px solid #cbdcf0; border-radius: 50%; background: #e4edf9; color: #1c528f; font-size: 12px; font-weight: 700; }
.account-name { max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-menu > div { position: absolute; top: 44px; right: 0; z-index: 50; min-width: 260px; padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 40px #17375920; display: grid; gap: 8px; }
.account-menu small { color: var(--muted); margin-bottom: 8px; }
.mobile-nav-toggle { display: none; }
header { max-width: none; margin-bottom: 26px; }
header:has(> div) { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
h1, .small-header h1 { font-size: clamp(25px,2.6vw,34px); line-height: 1.2; font-weight: 650; letter-spacing: -.035em; }
h2 { font-size: 17px; font-weight: 650; line-height: 1.4; letter-spacing: -.02em; }
h3 { color: #465a74; font-size: 10px; font-weight: 700; letter-spacing: .08em; margin: 24px 0 10px; }
.eyebrow { color: #4d6684; font-size: 9px; font-weight: 700; letter-spacing: .13em; margin-bottom: 7px; }
.sub { font-size: 14px; line-height: 1.65; margin: 10px 0 0; max-width: 770px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.primary, .secondary, .ghost-button, .upload-button span { padding: 10px 14px; font-size: 12px; font-weight: 600; min-height: 40px; border-radius: 7px; text-decoration: none; line-height: 1.4; }
.primary { background: #155bcb; color: #fff; border: 1px solid #155bcb; box-shadow: 0 1px 2px #17355410; }
.primary:hover:not(:disabled) { background: #114ba8; border-color: #114ba8; }
.secondary { color: #164f9c; border-color: #bfd2ec; background: #edf4fe; }
.secondary:hover:not(:disabled) { background: #e0edff; }
.ghost-button, .upload-button span { border-color: #d0dae6; background: #fff; color: #354d69; }
.ghost-button:hover, .upload-button:hover span { color: #17447f; border-color: #9eb9dc; background: #f2f7ff; }
.danger-ghost:hover { color: #a72138; border-color: #e0a6b1; background: #fff1f3; }
.metrics { gap: 16px; margin: 22px 0; }
.metric, .history-panel, .alerts-panel, .case-panel, .connector-card, .xero-panel, .upload-panel, .first-run-guide { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: 0 2px 3px #16365503; }
.metric { padding: 22px; min-height: 158px; gap: 4px; }
.metric > span { color: #4e6076; font-weight: 550; font-size: 12px; }
.metric strong { color: var(--text); font-size: 31px; font-weight: 650; letter-spacing: -.045em; margin: 7px 0 9px; line-height: 1.25; }
.metric small { color: var(--muted); font-size: 11px; line-height: 1.55; }
.metric.risk strong { color: var(--text); font-size: 34px; }
.metric.risk strong span { font: inherit; color: inherit; }
.metric strong em { font-size: 15px; font-weight: 450; font-style: normal; color: var(--muted); letter-spacing: 0; margin-left: 5px; }
.dashboard-metrics { grid-template-columns: 1.65fr 1fr 1fr 1fr; }
.recovery-hero { background: #102a46; border-color: #102a46; }
.recovery-hero > span { color: #d6e9f8; }
.recovery-hero strong { color: #fff; font-size: clamp(24px,2.5vw,36px); }
.recovery-hero small { color: #b0c9df; }
.metric-link { color: #77e0ec; width: fit-content; background: transparent; border: 0; padding: 8px 0 0; font-size: 11px; margin-top: 0; text-align: left; }
.secondary-metrics .metric { min-height: 122px; background: transparent; box-shadow: none; }
.secondary-metrics .metric strong { font-size: 24px; }
.dashboard-insights, .report-types { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.history-panel { padding: 24px; margin-bottom: 20px; }
.dashboard-insights .history-panel { min-width: 0; }
.section-head { align-items: center; gap: 16px; margin-bottom: 20px; }
.section-head.compact { margin-bottom: 14px; }
.pill, .integration-badge { color: #50667f; background: #f6f8fb; border-color: #dce4ee; white-space: nowrap; font-weight: 500; font-size: 10px; padding: 4px 8px; }
.chart-row { margin: 15px 0; }
.chart-row > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 11px; }
.chart-row > div > span:not(.severity-badge) { white-space: normal; overflow-wrap: anywhere; color: #4b607b; }
.chart-row strong { font-variant-numeric: tabular-nums; }
meter { width: 100%; display: block; height: 7px; margin-top: 8px; border: 0; background: #edf1f6; border-radius: 4px; }
meter::-webkit-meter-bar { background: #edf1f6; border: 0; height: 7px; }
meter::-webkit-meter-optimum-value { background: #377fd0; border-radius: 4px; }
meter::-moz-meter-bar { background: #377fd0; border-radius: 4px; }
meter.critical::-webkit-meter-optimum-value { background: #bb3951; }
meter.high::-webkit-meter-optimum-value { background: #c27b31; }
meter.medium::-webkit-meter-optimum-value { background: #caab49; }
meter.low::-webkit-meter-optimum-value { background: #5799be; }
#categoryChart { max-height: 230px; overflow: auto; padding-right: 8px; }
.severity-badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid; border-radius: 5px; padding: 3px 7px; font-size: 10px; font-weight: 600; width: fit-content; }
.severity-badge::before { content: ''; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.severity-badge.critical, .case-risk.critical, .supplier-risk.high, .supplier-score.high { color: #a92540; background: #fff0f3; border-color: #f1c9d2; }
.severity-badge.high, .case-risk.high, .supplier-risk.watch, .supplier-score.watch { color: #955013; background: #fff5e9; border-color: #efdabd; }
.severity-badge.medium, .case-risk.medium, .supplier-risk.review, .supplier-score.review { color: #79600e; background: #fffbea; border-color: #e9dfa9; }
.severity-badge.low, .case-risk.low, .supplier-risk.normal, .supplier-score.normal { color: #1a5d8d; background: #ecf6fd; border-color: #beddef; }
.severity-badge.unknown { color: #56677d; background: #f3f5f8; border-color: var(--border); }
.severity-dot { box-shadow: none !important; }
.priority-row { width: 100%; display: grid; grid-template-columns: 76px minmax(0,1fr) auto 14px; gap: 16px; align-items: center; padding: 16px 0; text-align: left; background: transparent; border: 0; border-top: 1px solid #e8edf3; color: var(--text); font-size: 12px; }
.priority-row:hover { background: #f7faff; }
.priority-row small, .document-row small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.priority-amount { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.priority-amount small { font-weight: 400; }
.data-caveat { font-size: 11px; color: var(--muted); margin: -5px 0 26px; }
.queue-toolbar { display: flex; gap: 10px; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 18px; }
.queue-toolbar .search-field { flex: 1; }
.queue-toolbar input { width: 100%; }
.queue-toolbar input, .queue-toolbar select { font-size: 12px; }
.content-grid { grid-template-columns: minmax(0,1.15fr) minmax(360px,1fr); gap: 20px; }
.queue-panel { padding: 0; overflow: hidden; }
.queue-count { padding: 14px 20px; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--border); background: #fafbfd; }
.finding-card { display: flex; flex-direction: column; gap: 9px; padding: 20px; border-top: 0; border-bottom: 1px solid #e5eaf1; }
.finding-card:last-child { border-bottom: 0; }
.finding-card:hover { background: #f6f9fd; }
.finding-card[aria-pressed=true] { background: #edf4ff; box-shadow: inset 3px 0 #226bcc; }
.finding-top { width: 100%; align-items: center; }
.queue-status { font-size: 10px; border: 1px solid #d7e1ed; background: #f6f8fb; color: #51677e; padding: 3px 7px; border-radius: 5px; }
.finding-title { font-size: 14px; font-weight: 650; }
.finding-supplier { color: #526882; font-size: 12px; }
.finding-facts { display: grid; width: 100%; grid-template-columns: 1.1fr 1fr .7fr; gap: 12px; font-size: 11px; }
.finding-facts small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.finding-facts > span { overflow-wrap: anywhere; }
.queue-recovery { font-size: 11px; color: #21687a; border-top: 1px solid #dce7ee; padding-top: 9px; width: 100%; display: flex; justify-content: space-between; gap: 12px; }
.case-panel { padding: 26px; scroll-margin-top: 20px; }
.case-panel h2 { padding-right: 48px; font-size: 21px; }
.case-risk { font-size: 14px; border-radius: 10px; width: 42px; height: 42px; }
.case-supplier { margin: 8px 0 14px; font-size: 12px; }
.case-meta > div, .case-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.case-meta { margin-bottom: 18px; }
.case-facts { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0 4px; }
.case-facts dt { font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.case-facts dd { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.case-exposure { font-size: 12px; gap: 12px; padding: 15px; background: #f2f6fc; border: 1px solid #e0e8f3; }
.case-exposure strong { color: #173e71; font-size: 16px; text-align: right; }
.risk-meaning { font-size: 10px; color: var(--muted); }
ul, .recommendation { color: #465b75; font-size: 12px; line-height: 1.75; }
.recommendation { border-left: 3px solid #54a7cf; padding: 12px 14px; background: #f1f8fc; }
.evidence-row { font-size: 11px; align-items: start; gap: 20px; }
.evidence-row span { flex: 0 0 36%; }
.evidence-row strong { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; font-weight: 500; }
.transaction-references ul { max-height: 145px; overflow: auto; padding-left: 19px; }
code { font-size: 11px; }
.structured-evidence summary { font-size: 12px; color: #235c9e; cursor: pointer; padding: 10px 0; }
.history-row, .case-row, .supplier-row { border-color: #e5ebf3; padding: 16px 6px; font-size: 12px; }
.history-row:hover, .case-row:hover, .supplier-row:hover { background: #f3f7fd; }
.case-tag, .signal-chip { color: #286682; background: #eaf6fb; border-color: #c9e2ed; }
.profile-metrics > div { background: #f7f9fc; }
.history-stats strong { font-size: 12px; }
.case-workspace, .supplier-workspace { grid-template-columns: minmax(0,1fr) minmax(360px,1fr); gap: 20px; }
.upload-panel { margin: 22px 0; padding: 24px; }
.upload-panel p { font-size: 12px; line-height: 1.7; max-width: 770px; }
.upload-button { position: relative; background: transparent; border-radius: 7px; }
.upload-button input { display: block; position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-button:focus-within span { outline: 3px solid #247bd6; outline-offset: 3px; }
.first-run-guide { padding: 24px; }
.first-run-step { background: #f6f9fd; border-color: #dde5ee; color: var(--text); }
.first-run-step strong { color: var(--text); }
.first-run-step small { color: var(--muted); }
.first-run-step.done { background: #eef8f6; border-color: #bbdcd4; }
.first-run-guide.completed { background: #f3faf7; border-color: #c4dfd2; }
.step-check { color: #486585; background: #e5edf7; }
.first-run-step.done .step-check { color: #246744; background: #dbeee3; }
.first-run-step:hover { transform: none; }
.sidebar .feedback-shortcut { background: transparent; color: #b6c8dc; border-color: #2e4663; margin: 0 0 12px; }
.connected-source { border-color: #e1e8f0; }
.xero-panel { background: #fff; border-color: var(--border); padding: 24px; }
.integration-head h2 { font-size: 19px; }
.integration-head p, .connector-card p { font-size: 12px; }
.integration-logo { background: #edf5fd; border-color: #d4e4f5; color: #2562a5; box-shadow: none; }
.integration-badge.connected { background: #eaf7f0; border-color: #bfdfce; color: #216346; }
.integration-badge.warning { background: #fff7e8; border-color: #eed5ad; color: #86520e; }
.xero-setup { background: #f7f9fc; }
.code-line code { color: #3e597c; background: #eef3f9; }
.integration-action { min-width: 170px; }
.sync-strip span { font-size: 11px; }
.connector-grid { gap: 18px; }
.connector-card { padding: 24px; }
.report-symbol { display: grid; place-items: center; height: 36px; width: 36px; font-size: 11px; font-weight: 650; border: 1px solid #cdddf0; border-radius: 8px; background: #edf4ff; color: #2564aa; margin-bottom: 18px; }
.report-types p { font-size: 13px; }
.document-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 16px; width: 100%; text-align: left; padding: 17px 0; border: 0; border-top: 1px solid #e3eaf2; color: var(--text); background: transparent; text-decoration: none; font-size: 12px; }
.document-row:hover { background: #f7faff; }
.document-icon { display: grid; place-items: center; height: 36px; border: 1px solid var(--border); border-radius: 7px; color: #2e6eaa; background: #f2f7fd; }
.ask-anovyr-shortcut { background: #f0f6fc; border-color: #d5e4f2; }
.ask-anovyr-shortcut p.muted { margin: 5px 0 0; font-size: 12px; max-width: 570px; }
.ask-anovyr-shortcut .section-head { margin: 0; }
.chat-workspace { grid-template-columns: minmax(230px,.65fr) minmax(0,1.35fr); gap: 20px; }
.chat-workspace .case-panel { position: static; }
.chat-workspace .case-panel h2 { padding: 0; }
.chat-thread { padding: 0 4px 0 0; max-height: 58vh; }
.chat-thread:empty { display: none; }
.chat-message { padding: 18px; border-radius: 10px; }
.chat-message.user { background: #eef4fe; border-color: #d7e4f7; margin-left: 40px; }
.chat-message.assistant { background: #fff; border-color: #dce5ee; margin-right: 0; }
.chat-message p { color: #304961; font-size: 13px; line-height: 1.8; }
.chat-message small { color: #3c6486; font-size: 10px; }
.notes.ask-input { border-color: #b9cde5; background: #fff; min-height: 100px; margin-bottom: 10px; padding: 15px; box-shadow: 0 2px 5px #173b6908; font-size: 13px; }
.quick-prompts button { color: #315e8b; background: #f4f8fd; border-color: #d7e3f0; font-size: 11px; padding: 8px 10px; border-radius: 6px; text-align: left; }
.quick-prompts button:hover { color: #124d91; border-color: #aec9e7; background: #eaf3fd; }
#askWorkspacePrompts button { font-size: 12px; padding: 13px 12px; }
#askWorkspaceMode { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.ask-answer { background: #f3f8fc; border-color: #d1e1ef; color: #29465e; }
.ask-head { align-items: start; }
.tool-trace, .tool-trace-row { border-color: #dce6ef; }
.tool-trace-row { flex-wrap: wrap; }
.tool-trace-row small { text-align: left; }
.recon-conclusion, .investigate-panel { background: #f1f8fb; border-color: #c8e0ec; }
.recon-conclusion p:last-child { color: #395972; }
.investigate-files > div { background: #fff; }
.pilot-feedback { background: #f8fafc; border-color: #dde6f0; }
.feedback-buttons button { background: #fff; border-color: #d4dfec; color: #48617b; }
.feedback-buttons button:hover, .feedback-buttons button.selected { background: #edf4ff; color: #195aaa; border-color: #a4c3eb; }
.audit-event { background: #fff; border-color: var(--border); }
.audit-event strong { color: var(--text); }
.audit-event time, .audit-event small { color: var(--muted); }
.admin-mode { background: #142b47; border-color: #2a4361; margin-top: 24px; }
.admin-mode span { color: #a8bfdd; }
.admin-live { font-size: 12px; }
.admin-table th, .admin-table td { border-color: #e2e8f1; }
.admin-table th { color: #4e6481; }
.admin-table td strong { color: #213d60; }
.admin-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
.admin-table-wrap { border-radius: 8px; }
.progress { background: #e9eff6; }
.progress span { background: #3a87cb; }
.feedback-card { border-color: #dfe7f0; background: #fff; }
.feedback-category { color: #285e9a; background: #edf4ff; }
.feedback-status { border-color: #d5e1ef; }
.status-new { color: #946217; }.status-reviewed { color: #215dab; }.status-planned { color: #6b439c; }.status-closed { color: #256a4e; }
.connector-admin-row { border-color: #e2e8f1; }
.status-dot.healthy:before { background: #30805d; box-shadow: none; }
.rating-row { color: #906b14; }
.auth-body { background: #f1f5fa; position: relative; isolation: isolate; }
.auth-body::before { content: ''; position: fixed; inset: 0 auto 0 0; width: 30%; background: var(--navy); z-index: -1; }
.auth-shell { width: min(94vw,520px); padding: 48px 0; }
.auth-card { background: #fff; border: 1px solid #dce5ef; border-radius: 16px; padding: 38px; box-shadow: 0 12px 50px #1937560c; }
.auth-brand { margin-bottom: 32px; color: #172e49; }
.auth-card h1 { font-size: 28px; font-weight: 650; line-height: 1.2; }
.auth-card .muted { font-size: 13px; }
.auth-form label { color: #334e6d; font-size: 12px; font-weight: 600; }
.auth-form input { color: var(--text); background: #fff; border-color: #cbd7e5; border-radius: 7px; padding: 12px; outline-offset: 3px; }
.auth-form .primary { grid-column: auto; min-height: 45px; }
.auth-form small { color: #586b83; font-size: 11px; }
.auth-error, .admin-error { background: #fff1f3; border-color: #edc3cd; color: #9d223a; }
.security-note { border-color: #dfe7ef; color: #5c6e84; font-size: 11px; }
.security-note a { color: #1759a6; }
.auth-card > p > a { font-size: 12px; }
.pilot-security-list { color: #506983; font-size: 10px; }
.auth-secret { padding: 14px; border: 1px solid #cbd9e9; border-radius: 8px; background: #f1f6fc; color: #243d5d; overflow-wrap: anywhere; font-family: ui-monospace,monospace; letter-spacing: .08em; }
.recovery-code { background: #f4f7fb; color: #213c5c; border: 1px solid #d6e0ec; padding: 10px 12px; border-radius: 7px; font-family: ui-monospace,monospace; font-size: 13px; }
.notice { padding: 14px 18px; border: 1px solid #cfdfef; border-radius: 8px; background: #eef5fc; color: #2c587d; margin: 0 0 20px; font-size: 12px; }
.empty-state { padding: 36px 24px; color: var(--muted); font-size: 13px; text-align: center; line-height: 1.7; }
.empty-state h2 { color: #34516f; font-size: 16px; }
.accounting-map-field { display: grid; grid-template-columns: minmax(150px,.8fr) minmax(220px,1.2fr); gap: 12px; align-items: center; padding: 7px 0; }
.accounting-map-field > span { color: #435c78; font-size: 12px; }
.accounting-map-field small { color: var(--muted); font-size: 10px; }
.workspace-dialog { color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 30px; width: min(94vw,480px); box-shadow: 0 20px 100px #061a3540; }
.workspace-dialog::backdrop { background: #06172b80; }
.workspace-dialog label { display: grid; gap: 8px; font-size: 12px; }
.dialog-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 8px; }
.sr-only, .skip-link:not(:focus) { 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:focus { position: fixed; top: 10px; left: 10px; background: #fff; color: #134b87; z-index: 100; padding: 12px; border-radius: 8px; }
[aria-busy=true] { cursor: progress; }
@media (min-width: 981px) and (max-height: 860px) {
  .sidebar { padding-top: 20px; }.sidebar nav { gap: 2px; }.sidebar nav .nav-link { min-height: 34px; padding-top: 7px; padding-bottom: 7px; }.sidebar-note { display: none; }
}
@media (max-width: 1350px) {
  main { padding-left: 26px; padding-right: 26px; }.account-name { display: none; }.topbar-actions { gap: 10px; }.metric { padding: 18px; }.dashboard-metrics { grid-template-columns: 1.4fr 1fr 1fr 1fr; }.metric strong { font-size: 28px; }
}
@media (max-width: 1150px) {
  .dashboard-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }.content-grid, .case-workspace, .supplier-workspace { grid-template-columns: 1fr; }
  #alerts #casePanel { position: static !important; max-height: none !important; overflow: visible !important; }
  .queue-toolbar { flex-wrap: wrap; }.queue-toolbar .search-field { flex-basis: 100%; }.queue-toolbar > label { flex: 1; }.queue-toolbar select { width: 100%; }
  .search-trigger { display: none; }.header-actions { flex-wrap: wrap; }.header-actions .primary { white-space: nowrap; }
  .priority-row { gap: 10px; }.dashboard-insights { gap: 14px; }.history-panel { padding: 20px; }
}
@media (max-width: 980px) {
  .shell { display: block; }.sidebar { display: flex; position: fixed; width: 240px; left: 0; top: 0; height: 100dvh; visibility: hidden; transform: translateX(-100%); box-shadow: 12px 0 40px #0b21343b; }
  .nav-open .sidebar { visibility: visible; transform: translateX(0); }.mobile-nav-toggle { display: block; flex-shrink: 0; font-size: 18px; padding: 6px 10px; }
  main { padding: 0 24px 36px; }.context-bar { flex-direction: row; height: 83px; margin-bottom: 25px; align-items: center; }
  .context-bar select { width: 100%; min-width: 0; }.workspace-picker { flex: 1; }.workspace-picker select { max-width: 320px; }.topbar-actions { flex-shrink: 0; }
  .chat-workspace { grid-template-columns: 1fr; }.case-panel { position: static; }.report-types { grid-template-columns: 1fr 1fr; }
  .admin-shell .sidebar { position: static; width: 100%; height: auto; visibility: visible; transform: none; padding: 20px; box-shadow: none; }
  .admin-shell .sidebar nav { display: flex; flex-wrap: wrap; margin: 14px 0 0; }.admin-shell .sidebar nav button { width: auto; }.admin-shell .sidebar .user-card, .admin-shell .sidebar .sidebar-note, .admin-shell .admin-mode { display: none; }.admin-back { margin: 0; }
}
@media (max-width: 700px) {
  .accounting-map-field { grid-template-columns: minmax(0,1fr); gap: 6px; }
  main { padding: 0 16px 28px; }.context-bar { gap: 10px; }.topbar-actions > .pilot-badge { display: none; }.workspace-picker select { max-width: 100%; font-size: 12px; }.context-label { font-size: 9px; }
  header:has(> div) { align-items: flex-start; flex-direction: column; gap: 16px; }.header-actions { width: 100%; }.header-actions button { flex: 1; }
  .dashboard-insights, .report-types, .connector-grid { grid-template-columns: 1fr; gap: 0; }.dashboard-metrics, .secondary-metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dashboard-metrics .recovery-hero { grid-column: 1/-1; min-height: 180px; }.dashboard-metrics .metric:last-child { grid-column: 1/-1; min-height: 116px; }.recovery-hero strong { font-size: 36px; }
  .metric { min-height: 145px; padding: 18px; }.secondary-metrics .metric { min-height: 142px; }.metric strong { font-size: 29px; }
  .history-panel, .alerts-panel, .case-panel, .connector-card { padding: 18px; }.queue-panel { padding: 0; }.finding-card { padding: 18px; }.finding-facts { grid-template-columns: 1fr 1fr; }.finding-facts > span:last-child { display: none; }
  .priority-row { grid-template-columns: 72px minmax(0,1fr); gap: 9px; }.priority-amount { grid-column: 2; text-align: left; }.priority-row > span:last-child { display: none; }.priority-amount small { display: inline; margin-left: 8px; }
  .section-head { flex-wrap: wrap; }.queue-toolbar > label { flex-basis: 40%; }.finding-top { gap: 8px; }.case-facts { gap: 12px; }
  .upload-panel { grid-template-columns: 1fr; padding: 20px; }.upload-panel .primary { grid-column: 1; }.upload-button span { display: flex; }.upload-button input { left: 0; }
  .history-row { grid-template-columns: minmax(0,1fr); gap: 7px; }.history-stats { text-align: left; }.history-stats span { display: inline; margin-right: 8px; }.case-row { grid-template-columns: 8px minmax(0,1fr); }.case-row .history-stats { grid-column: 2; }
  .document-row { grid-template-columns: 30px minmax(0,1fr); }.document-row .pill { grid-column: 2; width: fit-content; }.evidence-row { gap: 12px; }.evidence-row span { flex-basis: 35%; }
  .auth-body::before { width: 100%; height: 200px; }.auth-shell { padding: 28px 0; }.auth-card { padding: 26px; }.auth-card h1 { font-size: 26px; }
  .chat-message.user { margin-left: 20px; }.chat-thread { max-height: none; }.ask-head { flex-direction: column; }.terms-grid, .investigation-outcomes { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media print {
  body { background: #fff; }.sidebar, .context-bar, .queue-toolbar, .header-actions, .feedback-buttons, .ask-input, .ask-box, .ghost-button, .primary, .secondary { display: none !important; }.shell { display: block; }main { padding: 0; max-width: none; }.case-panel, #alerts #casePanel { position: static !important; max-height: none !important; overflow: visible !important; }.content-grid { display: block; }.queue-panel { display: none; }.case-panel { border: 0; }.history-panel { break-inside: avoid; }.recovery-hero { background: #fff; border-color: #173857; }.recovery-hero strong, .recovery-hero span, .recovery-hero small { color: #172b45; }
}

/* Financial overview: value, priority, then an actionable evidence queue. */
.workspace-body { --bg: #f3f7fc; --border: #dce6f0; --text: #112b49; }
.workspace-body main { padding-left: 30px; padding-right: 30px; }
.workspace-body .context-bar { height: 76px; margin-bottom: 24px; }
.workspace-body .sidebar { background: #081e36; }
.workspace-body .sidebar nav .nav-link.active { background: #0953a2; box-shadow: inset 3px 0 #4bcfff,0 3px 10px #0002; }
.workspace-body .sidebar nav .nav-link { color: #bdcde0; }
.workspace-body .sidebar nav .nav-link.active { color: white; }
.workspace-body header { margin-bottom: 18px; }
.workspace-body h1 { font-size: clamp(26px,2.4vw,32px); font-weight: 720; }
.workspace-body .eyebrow { color: #45678e; letter-spacing: .12em; }
.workspace-body .history-panel { box-shadow: 0 3px 12px #21487905; }
.dashboard-metrics { grid-template-columns: 1.45fr 1fr 1fr 1fr; gap: 14px; margin: 0 0 16px; }
.dashboard-metrics .metric { position: relative; padding: 20px; min-height: 154px; gap: 2px; border-radius: 12px; box-shadow: 0 3px 14px #153c6505; }
.dashboard-metrics .metric > span:not(.metric-icon) { font-size: 12px; font-weight: 650; color: #365273; }
.dashboard-metrics .metric strong { overflow-wrap: anywhere; margin: 8px 0 6px; font-size: 32px; font-weight: 750; line-height: 1.12; font-variant-numeric: tabular-nums; }
.dashboard-metrics .metric .metric-icon { position: absolute; top: 17px; right: 17px; width: 30px; height: 30px; display: grid; place-items: center; padding: 6px; border-radius: 8px; color: #1260b4; background: #eaf3ff; }
.metric-icon svg, .guide-icon svg, .severity-symbol svg { width: 100%; height: 100%; }
.dashboard-metrics .metric > span:not(.metric-icon) { padding-right: 32px; }
.dashboard-metrics .metric .metric-link { min-height: 30px; color: #165bab; margin-top: auto; padding-top: 5px; font-weight: 650; font-size: 12px; }
.dashboard-metrics .recovery-hero { background: linear-gradient(115deg,#eaf8f3,#f5fbff); border-color: #b9ddd2; }
.dashboard-metrics .recovery-hero > span:not(.metric-icon) { color: #1b6657; }
.dashboard-metrics .recovery-hero strong { color: #103b35; font-size: clamp(25px,2.5vw,36px); }
.dashboard-metrics .recovery-hero small { color: #426c60; }
.dashboard-metrics .recovery-hero .metric-link { color: #166e57; }
.dashboard-metrics .recovery-hero .metric-icon { color: #167457; background: #d3efdf; }
.dashboard-metrics .risk .metric-icon { background: #fff0f1; color: #bd2b49; }
.dashboard-metrics .review-metric .metric-icon { background: #fff3e3; color: #9e5c07; }
.dashboard-metrics .risk small { margin-top: auto; }
#riskGauge { appearance: none; border: 0; height: 4px; width: 100%; border-radius: 4px; overflow: hidden; margin-top: 8px; }
#riskGauge::-webkit-progress-bar { background: #edf1f7; }
#riskGauge::-webkit-progress-value { background: #327acc; }
#riskGauge::-moz-progress-bar { background: #327acc; }
.analysis-guide { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 24px; border: 1px solid #c7def6; border-left: 4px solid #298be3; border-radius: 10px; background: #eaf4ff; }
.analysis-guide .guide-icon { flex: 0 0 38px; width: 38px; height: 38px; padding: 8px; border-radius: 10px; background: #fff; color: #176ccc; }
.analysis-guide > div { flex: 1; min-width: 0; }
.guide-label { font-size: 12px; color: #2866a3; letter-spacing: .11em; font-weight: 750; }
.analysis-guide h2 { margin: 3px 0; font-size: 17px; color: #123c6a; }
.analysis-guide p { font-size: 14px; margin: 3px 0 0; color: #44658b; }
.analysis-guide .primary { display: inline-flex; gap: 14px; align-items: center; flex-shrink: 0; background: #1464c6; }
.analysis-guide .primary svg { width: 17px; height: 17px; }
.severity-section { margin-bottom: 22px; }
.severity-section .section-head { margin: 0 0 12px; }
.severity-section .section-head > .muted { font-size: 12px; }
.severity-tiles { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.severity-tile { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; text-align: left; padding: 15px; border: 1px solid; border-radius: 10px; background: white; }
.severity-tile.critical { background: #fff2f5; border-color: #f0cdd6; color: #ac2543; }
.severity-tile.high { background: #fff5e9; border-color: #efd9bc; color: #90500c; }
.severity-tile.medium { background: #fffbed; border-color: #eadfad; color: #78600c; }
.severity-tile.low { background: #edf6ff; border-color: #c7dff4; color: #185e9e; }
.severity-tile:hover { box-shadow: 0 3px 12px #12345912; border-color: currentColor; }
.severity-symbol { grid-row: 1 / span 2; width: 25px; height: 25px; }
.severity-tile strong { font-size: 25px; line-height: 1; font-weight: 760; }
.severity-name { font-size: 14px; font-weight: 700; }
.severity-tile small { grid-column: 2; font-size: 12px; }
.tile-arrow { position: absolute; right: 12px; top: 12px; font-size: 14px; }
.dashboard-insights { grid-template-columns: 1fr 1fr; gap: 16px; }
.dashboard-insights .history-panel { padding: 20px; margin-bottom: 20px; }
.dashboard-insights .section-head { margin-bottom: 14px; }
#severityOverview { display: flex; align-items: center; gap: 20px; padding: 12px 0; }
.severity-ring { position: relative; flex: 0 0 142px; width: 142px; height: 142px; }
.severity-ring svg { display: block; width: 100%; height: 100%; }
.severity-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.severity-ring strong { font-size: 32px; font-weight: 750; color: #173552; line-height: 1.2; }
.severity-ring span { font-size: 12px; color: #5a7189; }
.severity-explainer { flex: 1; min-width: 0; }
.severity-explainer > strong { font-size: 14px; line-height: 1.4; }
.severity-explainer p { font-size: 12px; color: #536b84; margin: 7px 0 12px; }
.chart-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chart-legend > span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #405c78; }
.chart-legend i { width: 6px; height: 6px; border-radius: 50%; }
.chart-legend b { margin-left: auto; }
#categoryChart { max-height: none; overflow: visible; padding: 0; }
.category-row { display: grid; grid-template-columns: 1.5fr 1fr 18px; align-items: center; gap: 12px; width: 100%; border: 0; padding: 10px 0; background: transparent; color: #3c5573; text-align: left; font-size: 12px; }
.category-row:hover { color: #124f9a; background: #f3f8ff; }
.category-row strong { text-align: right; color: #224e7c; }
.category-bar { height: 8px; border-radius: 3px; background: #eaf1fa; overflow: hidden; }
.category-bar i { display: block; height: 100%; border-radius: 3px; background: #388ef0; }
.text-action { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 0; color: #125caf; border: 0; background: transparent; font-size: 12px; font-weight: 650; text-align: left; }
.text-action:hover { text-decoration: underline; }
.section-description { font-size: 12px; color: #536c87; margin: 6px 0 0; }
.priority-panel { padding: 20px; }
.priority-panel .section-head { margin-bottom: 12px; }
.priority-heading, .priority-row { display: grid; grid-template-columns: 78px minmax(0,1fr) auto 18px; gap: 14px; align-items: center; }
.priority-heading { font-size: 12px; color: #4b698b; background: #edf4fc; padding: 10px 12px; border-radius: 6px; }
.priority-heading > span:nth-child(3) { text-align: right; }
.priority-row { padding: 13px 12px; font-size: 12px; }
.priority-row small { font-size: 12px; }
.priority-amount small { display: none; }
.priority-row .row-arrow { color: #3077bc; font-size: 17px; }
.secondary-metrics { margin: 0 0 18px; gap: 0; border: 1px solid #dce6ef; border-radius: 10px; background: #eaf0f8; }
.secondary-metrics .metric { border: 0; border-radius: 0; min-height: 104px; padding: 16px; }
.secondary-metrics .metric + .metric { border-left: 1px solid #d4dfeb; }
.secondary-metrics .metric > span { font-size: 12px; }
.secondary-metrics .metric strong { font-size: 21px; margin: 4px 0; }
.secondary-metrics .metric small { font-size: 12px; }
.finding-card { gap: 6px; padding: 16px 18px; }
.finding-title { font-size: 15px; }
.queue-recovery { color: #166a55; background: #f0faf5; border-radius: 5px; border-top: 0; padding: 6px 8px; }
.case-panel .case-risk { box-shadow: none; }
.case-panel h3 { color: #244f7c; }
.workspace-body .case-exposure { background: #edf5ff; border-color: #c9def4; }
.workspace-body .recommendation { border-left-color: #2180d0; background: #eaf5ff; color: #254f76; }
.mobile-brand, .mobile-nav { display: none; }
.finding-dialog { padding: 0; color: var(--text); border: 1px solid #d4e1ef; border-radius: 14px; width: min(96vw,680px); max-height: 92dvh; background: #fff; }
.finding-dialog::backdrop { background: #081e36a8; }
.finding-dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; position: sticky; top: 0; z-index: 2; background: #eff5fc; border-bottom: 1px solid #dce6ef; }
.finding-dialog-header > span { font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.finding-dialog .case-panel { display: block; border: 0; border-radius: 0; max-height: none; box-shadow: none; }
@media (min-width: 981px) and (max-width: 1250px) {
  .dashboard-metrics { grid-template-columns: 1.25fr 1fr 1fr 1fr; }
  .dashboard-metrics .metric { padding: 15px; }
  .dashboard-metrics .metric .metric-icon { top: 12px; right: 12px; width: 26px; height: 26px; }
  .dashboard-metrics .metric strong, .dashboard-metrics .recovery-hero strong { font-size: 26px; }
  #severityOverview { flex-direction: column; gap: 10px; padding: 0; }
  .severity-ring { width: 118px; height: 118px; flex-basis: 118px; }
  .severity-explainer { width: 100%; }
}
@media (max-width: 980px) {
  .workspace-body main { padding-left: 22px; padding-right: 22px; }
  .dashboard-metrics { grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 10px; }
  .dashboard-metrics .metric { padding: 15px; }
  .dashboard-metrics .metric strong, .dashboard-metrics .recovery-hero strong { font-size: 27px; }
  .severity-ring { width: 112px; height: 112px; flex-basis: 112px; }
  #severityOverview { gap: 12px; }
  .chart-legend { gap: 7px 10px; }
}
@media (max-width: 700px) {
  .workspace-body main { padding: 0 16px calc(86px + env(safe-area-inset-bottom)); }
  .workspace-body .context-bar { margin: 0 -16px 20px; padding: 12px 16px; display: grid; grid-template-columns: 36px 1fr 36px; gap: 10px; height: auto; background: #0b2440; border-bottom: 2px solid #2175b3; }
  .workspace-body .mobile-nav-toggle { min-height: 36px; border-color: #43617e; background: #102e50; color: #e5f3ff; padding: 4px; }
  .mobile-brand { display: flex; gap: 8px; align-items: center; font-size: 17px; color: #fff; font-weight: 720; letter-spacing: .13em; text-decoration: none; }
  .mobile-brand img { width: 24px; height: 24px; object-fit: contain; }
  .workspace-body .context-bar .workspace-picker { grid-column: 1/-1; grid-row: 2; }
  .workspace-body .context-bar .workspace-picker label { display: none; }
  .workspace-body .context-bar .workspace-picker select { width: 100%; max-width: none; color: #dceafb; background: #163653; border: 1px solid #3c5974; font-size: 16px; min-height: 36px; font-weight: 500; padding: 5px 9px; }
  .context-bar .topbar-actions { grid-column: 3; grid-row: 1; }
  .context-bar .avatar { width: 32px; height: 32px; border-color: #477394; background: #164974; color: #eef9ff; }
  .workspace-body header:has(> div) { gap: 12px; margin-bottom: 14px; }
  .workspace-body h1 { font-size: 26px; }
  .workspace-body header .sub { font-size: 12px; margin-top: 6px; line-height: 1.5; overflow-wrap: anywhere; }
  .workspace-body .header-actions { gap: 8px; }
  .workspace-body .header-actions button { min-height: 38px; padding: 8px 12px; }
  .dashboard-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 0 0 12px; }
  .dashboard-metrics .metric, .dashboard-metrics .metric:last-child { min-width: 0; grid-column: auto; min-height: 112px; padding: 13px 10px; border-radius: 9px; }
  .dashboard-metrics .metric > span:not(.metric-icon) { padding: 0; font-size: 12px; }
  .dashboard-metrics .metric .metric-icon { display: none; }
  .dashboard-metrics .metric strong { font-size: 27px; margin: 9px 0 5px; }
  .dashboard-metrics .metric strong em { font-size: 12px; margin-left: 2px; }
  .dashboard-metrics .metric small, .dashboard-metrics .metric .metric-link { font-size: 12px; line-height: 1.5; }
  .dashboard-metrics .recovery-hero { grid-column: 1/-1; min-height: 142px; padding: 17px 19px; }
  .dashboard-metrics .recovery-hero > span:not(.metric-icon) { font-size: 12px; }
  .dashboard-metrics .recovery-hero strong { font-size: 36px; margin: 8px 0 5px; }
  .dashboard-metrics .recovery-hero .metric-icon { display: grid; top: 18px; right: 18px; width: 36px; height: 36px; padding: 8px; }
  .dashboard-metrics .recovery-hero small { font-size: 12px; }
  .dashboard-metrics .recovery-hero .metric-link { font-size: 12px; padding-top: 7px; }
  .analysis-guide { display: grid; grid-template-columns: 28px 1fr; gap: 8px 10px; padding: 14px; margin-bottom: 20px; }
  .analysis-guide .guide-icon { width: 28px; height: 28px; padding: 6px; margin-top: 5px; }
  .analysis-guide h2 { font-size: 15px; }
  .analysis-guide p { font-size: 14px; }
  .analysis-guide > button { grid-column: 2; justify-content: center; min-height: 40px; margin-top: 3px; width: fit-content; }
  .severity-section .section-head { gap: 4px; }
  .severity-section h2 { font-size: 17px; }
  .severity-section .section-head > .muted { font-size: 12px; }
  .severity-tiles { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .severity-tile { padding: 12px; gap: 2px 7px; grid-template-columns: 24px 1fr; min-height: 86px; }
  .severity-symbol { width: 22px; height: 22px; }.severity-tile strong { font-size: 24px; }
  .dashboard-insights { grid-template-columns: minmax(0,1fr); gap: 0; }
  .dashboard-insights .history-panel { padding: 17px; margin-bottom: 14px; }
  #severityOverview { flex-direction: row; gap: 15px; padding: 4px 0; }
  .severity-ring { width: 112px; height: 112px; flex-basis: 112px; }
  .severity-ring strong { font-size: 29px; }.severity-explainer > strong { font-size: 13px; }
  .category-row { min-height: 44px; font-size: 14px; grid-template-columns: 1.5fr 1fr 18px; gap: 10px; }
  .category-panel .text-action { min-height: 44px; }
  .priority-panel { padding: 17px 14px; }.priority-panel .section-head { gap: 8px; }
  .priority-heading { display: none; }
  .priority-row { grid-template-columns: minmax(0,1fr) auto; padding: 14px 0; gap: 8px 10px; }
  .priority-row > span:first-child { grid-column: 1; grid-row: 1; }
  .priority-row > span:nth-child(2) { grid-column: 1/-1; grid-row: 2; }
  .priority-row .priority-amount { grid-column: 2; grid-row: 1; text-align: right; font-size: 13px; }
  .priority-row .priority-amount small { display: block; font-size: 12px; margin-left: 0; font-weight: 400; }
  .priority-row .row-arrow { display: none; }
  .priority-row > span:nth-child(2) strong { font-size: 14px; }.priority-row small { font-size: 12px; }
  .secondary-metrics { grid-template-columns: 1fr 1fr; gap: 0; }
  .secondary-metrics .metric { min-height: 100px; padding: 13px; }.secondary-metrics .metric:nth-child(3) { border-left: 0; }
  .secondary-metrics .metric:nth-child(n+3) { border-top: 1px solid #d4dfeb; }
  .workspace-body input:not([type=checkbox]):not([type=file]), .workspace-body select, .workspace-body textarea { font-size: 16px; }
  .queue-toolbar { gap: 9px; padding: 12px; }.queue-toolbar > label { min-width: 0; }.queue-toolbar select { min-height: 44px; }
  .finding-card { padding: 15px; gap: 7px; }.finding-title { font-size: 15px; }.finding-supplier { font-size: 12px; }
  .finding-facts { font-size: 12px; }.finding-facts small { font-size: 12px; }.queue-recovery { font-size: 12px; }
  #alerts > #casePanel { display: none; }
  .finding-dialog { max-height: 100dvh; height: 100dvh; width: 100%; max-width: 100%; margin: 0; border: 0; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
  .finding-dialog .case-panel { max-height: none !important; overflow: visible !important; position: static !important; padding: 20px 18px 30px; }.finding-dialog .case-panel h2 { font-size: 22px; }
  .finding-dialog .case-facts dd, .finding-dialog ul, .finding-dialog .recommendation { font-size: 14px; }
  .finding-dialog .evidence-row { font-size: 14px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4,1fr); position: fixed; z-index: 30; inset: auto 0 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #d5e2ef; box-shadow: 0 -4px 16px #1539540a; }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 49px; border: 0; border-radius: 8px; background: transparent; color: #526d88; font-size: 12px; font-weight: 650; }
  .mobile-nav button > span { display: block; width: 21px; height: 21px; font-size: 16px; line-height: 18px; }
  .mobile-nav svg { display: block; width: 100%; height: 100%; }
  .mobile-nav button[aria-current=page] { color: #125fae; background: #eaf3ff; }
  .workspace-body .sidebar { width: min(290px,86vw); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .workspace-body .sidebar nav .nav-link { min-height: 44px; font-size: 14px; }
  .nav-open .mobile-nav { visibility: hidden; }
  .workspace-body .case-row, .workspace-body .document-row { font-size: 13px; }
}
@media print { .mobile-nav, .analysis-guide > button, .mobile-brand { display: none !important; } }

/* ANOVYR navy workspace. Screen-only so printed evidence keeps its light palette. */
@media screen and (prefers-color-scheme: dark) {
  :root, .workspace-body {
    color-scheme: dark;
    --bg: #081e36; --panel: #102a46; --panel2: #173653; --border: #35516d;
    --text: #edf5ff; --muted: #b3c5da; --accent: #83caff;
    --danger: #ffa7b8; --warn: #ffd18f; --navy: #06182c;
    --positive: #8ee5c3; --positive-bg: #123d3b; --positive-border: #39756a;
    --critical-bg: #42273e; --critical-border: #825066;
    --high-bg: #40332c; --high-border: #82674a;
    --medium-bg: #39372a; --medium-border: #7f7547;
    --low-bg: #153a59; --low-border: #3c7299;
  }
  body, .auth-body { background: var(--bg); color: var(--text); }
  body :focus-visible { outline-color: var(--cyan) !important; box-shadow: 0 0 0 2px var(--bg); }
  body :is(input, select, textarea, .field-select, .notes, .admin-search, .admin-note),
  body .context-bar select, body .auth-form input {
    background: var(--bg); border-color: #587694; color: var(--text);
  }
  body :is(input, textarea)::placeholder { color: #a4b9d0; }
  body input[type=file]::file-selector-button { background: var(--panel2); color: var(--text); }
  body :is(.metric, .history-panel, .alerts-panel, .case-panel, .connector-card, .xero-panel,
    .upload-panel, .first-run-guide, .queue-toolbar, .account-menu > div, .audit-event,
    .feedback-card, .auth-card, .workspace-dialog, .finding-dialog) {
    background: var(--panel); border-color: var(--border); box-shadow: 0 4px 18px #020d191a;
  }
  .workspace-body .sidebar, .admin-shell .sidebar { background: var(--navy); border-right: 1px solid var(--border); }
  body .context-bar { background: var(--bg); border-color: var(--border); }
  body .search-trigger { background: var(--panel) !important; }
  body :is(.ghost-button, .upload-button span, .feedback-buttons button, .quick-prompts button) {
    background: var(--panel2); border-color: #587694; color: #d7e9ff;
  }
  body :is(.ghost-button, .quick-prompts button):hover, body .upload-button:hover span,
  body .feedback-buttons :is(button:hover, button.selected) {
    background: #234a70; border-color: #83caff; color: #fff;
  }
  body .primary, body .analysis-guide .primary { background: #2472d4; border-color: #6faaff; color: #fff; }
  body .primary:hover:not(:disabled) { background: #175aaa; border-color: #83caff; }
  body .secondary { background: #183f65; border-color: #5d8eb8; color: #c7e8ff; }
  body .secondary:hover:not(:disabled) { background: #234f79; }
  body .danger-ghost:hover { color: #ffc1ce; border-color: var(--critical-border); background: var(--critical-bg); }
  body :is(.eyebrow, h3, .case-panel h3, .guide-label, .metric > span:not(.metric-icon),
    .dashboard-metrics .metric > span:not(.metric-icon), .accounting-map-field > span,
    .auth-form label, .chart-row > div > span:not(.severity-badge)) { color: #b9d5f0; }
  body :is(.auth-brand, .empty-state h2, .admin-table td strong, .severity-ring strong,
    .analysis-guide h2, .case-exposure strong, .category-row strong) { color: var(--text); }
  body :is(ul, .finding-supplier, .chat-message p, .recon-conclusion p:last-child) { color: #c8d9eb; }
  body :is(.severity-explainer p, .chart-legend > span, .section-description,
    .auth-form small, .security-note, .pilot-security-list, .risk-meaning) { color: var(--muted); }
  body :is(.security-note a, .structured-evidence summary, .text-action,
    .dashboard-metrics .metric .metric-link, .chat-message small) { color: var(--accent); }
  body :is(.pill, .integration-badge, .queue-status, .feedback-status) {
    color: #c4d7ed; background: var(--panel2); border-color: var(--border);
  }
  body :is(.pilot-badge, .pilot-badge.live-policy, .avatar, .report-symbol,
    .document-icon, .integration-logo, .case-tag, .signal-chip, .feedback-category) {
    color: #b2ddff; background: #193c60; border-color: #456e95;
  }
  .workspace-body .dashboard-metrics .recovery-hero {
    background: linear-gradient(115deg,#123d3b,#12324b); border-color: var(--positive-border);
  }
  .workspace-body .dashboard-metrics .recovery-hero strong { color: #c1ffe8; }
  .workspace-body .dashboard-metrics .recovery-hero > span:not(.metric-icon),
  .workspace-body .dashboard-metrics .recovery-hero .metric-link { color: var(--positive); }
  .workspace-body .dashboard-metrics .recovery-hero small { color: #b3d9ce; }
  body .dashboard-metrics .metric .metric-icon { background: #1b4165; color: #a7d9ff; }
  body .dashboard-metrics .recovery-hero .metric-icon { background: #20554b; color: #a2f5d2; }
  body .dashboard-metrics .risk .metric-icon { background: var(--critical-bg); color: var(--danger); }
  body .dashboard-metrics .review-metric .metric-icon { background: var(--high-bg); color: var(--warn); }
  body.workspace-body :is(.analysis-guide, .recommendation, .case-exposure, .ask-anovyr-shortcut,
    .ask-answer, .recon-conclusion, .investigate-panel, .notice) {
    background: #143553; border-color: #416789; color: #d0e3f5;
  }
  body .analysis-guide, body .recommendation { border-left-color: #59baff; }
  body .analysis-guide p { color: #bed5ed; }
  body .analysis-guide .guide-icon { background: #204e73; color: #9bdbff; }
  body :is(.severity-tile.critical, .severity-badge.critical, .case-risk.critical,
    .supplier-risk.high, .supplier-score.high, .auth-error, .admin-error) {
    background: var(--critical-bg); border-color: var(--critical-border); color: var(--danger);
  }
  body :is(.severity-tile.high, .severity-badge.high, .case-risk.high,
    .supplier-risk.watch, .supplier-score.watch, .integration-badge.warning) {
    background: var(--high-bg); border-color: var(--high-border); color: var(--warn);
  }
  body :is(.severity-tile.medium, .severity-badge.medium, .case-risk.medium,
    .supplier-risk.review, .supplier-score.review) {
    background: var(--medium-bg); border-color: var(--medium-border); color: #f2de8e;
  }
  body :is(.severity-tile.low, .severity-badge.low, .case-risk.low,
    .supplier-risk.normal, .supplier-score.normal) {
    background: var(--low-bg); border-color: var(--low-border); color: #9bd8ff;
  }
  body .severity-badge.unknown { background: var(--panel2); color: var(--muted); }
  body :is(.integration-badge.connected, .queue-recovery, .first-run-step.done,
    .first-run-guide.completed) { background: var(--positive-bg); border-color: var(--positive-border); color: var(--positive); }
  body :is(.priority-heading, .secondary-metrics, .profile-metrics > div, .queue-count,
    .xero-setup, .code-line code, .first-run-step, .pilot-feedback, .auth-secret,
    .recovery-code, .finding-dialog-header) { background: var(--panel2); border-color: var(--border); color: #c3d7ed; }
  body .secondary-metrics .metric { background: transparent; border-color: var(--border); }
  body .step-check { background: #294e73; color: #d5eaff; }
  body .first-run-step.done .step-check { background: #20554b; color: #a2f5d2; }
  body :is(.category-row, .mobile-nav button) { color: #bfd5eb; }
  body :is(.priority-row, .finding-card, .history-row, .case-row, .supplier-row,
    .document-row, .connected-source, .tool-trace, .tool-trace-row, .security-note,
    .admin-table th, .admin-table td, .connector-admin-row) { border-color: var(--border); }
  body :is(.priority-row, .finding-card, .history-row, .case-row, .supplier-row,
    .document-row, .category-row):hover { background: #1a3b5c; color: var(--text); }
  body .finding-card[aria-pressed=true] { background: #1b4268; box-shadow: inset 3px 0 #69c4ff; }
  body :is(.category-bar, .progress) { background: #294762; }
  body .category-bar i, body .progress span { background: #67b5f7; }
  body #riskGauge::-webkit-progress-bar { background: #294762; }
  body #riskGauge::-webkit-progress-value { background: #67b5f7; }
  body #riskGauge::-moz-progress-bar { background: #67b5f7; }
  body .severity-ring > svg > circle { stroke: #294762; }
  body .priority-row .row-arrow { color: #83caff; }
  body .chat-message.user { background: #183c60; border-color: #446f97; }
  body .chat-message.assistant, body .investigate-files > div { background: var(--bg); border-color: var(--border); }
  body .notes.ask-input { background: var(--bg); border-color: #587694; }
  body .admin-table th { color: var(--muted); }
  body .status-new, body .rating-row { color: var(--warn); }
  body .status-reviewed { color: var(--accent); }
  body .status-planned { color: #d2b9ff; }
  body .status-closed { color: var(--positive); }
  body .status-dot.healthy:before { background: #8ee5c3; }
  body .mobile-nav { background: #0b2440; border-color: var(--border); box-shadow: 0 -4px 18px #020d1940; }
  body .mobile-nav button[aria-current=page] { color: #a8ddff; background: #1b4268; }
  body :is(.finding-dialog, .workspace-dialog)::backdrop { background: #020c18c9; }
  body .skip-link:focus { background: var(--panel2); color: var(--text); }
}

/* Recovery scope and softer blue/cyan emphasis. Screen presentation only. */
@media screen and (prefers-color-scheme: dark) {
  .recovery-scope-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:0 0 20px; }
  .recovery-scope-bar label { color:#d7eaff; font-weight:600; }
  .recovery-scope-bar .field-select { width:auto; min-width:190px; }
  .recovery-scope-bar p { flex-basis:100%; margin:0; }
  #recoveryMetrics { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .recovery-hero { background:linear-gradient(125deg,#113963,#104951) !important; border-color:#347d9b !important; }
  .recovery-hero > strong { color:#e1fcff !important; }
  .recovery-hero small, .recovery-hero > span { color:#c6ecf5 !important; }
  .guide-icon, .metric-icon { color:#77e2f2; }
}
@media screen and (max-width:1000px) { #recoveryMetrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media screen and (max-width:420px) { .recovery-scope-bar .field-select { width:100%; } }
.evidence-pagination { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:10px 0; max-width:100%; }
.evidence-pagination > span { flex:1 1 100%; font-size:12px; overflow-wrap:anywhere; }
.evidence-pagination label { display:flex; align-items:center; gap:6px; font-size:12px; }
.evidence-pagination input { width:76px; min-height:38px; max-width:100%; padding:6px; color:inherit; background:transparent; border:1px solid currentColor; border-radius:6px; }
.evidence-pagination button { min-height:40px; margin:0; }
.evidence-pagination button:disabled { opacity:.5; cursor:default; }
.evidence-page, .evidence-row > div { min-width:0; overflow-wrap:anywhere; white-space:pre-wrap; }
.evidence-row > div { flex:1; }
.evidence-row .evidence-row { display:block; }
.evidence-page > .finding-card, .evidence-page > .li-supplier-row { white-space:normal; }
