@font-face {
  font-family: "Inter Variable";
  src: url("assets/InterVariable-v4.1.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --text: #1f1f1d;
  --text-secondary: #686963;
  --text-muted: #70716b;
  --border: #e8e8e4;
  --border-strong: #dcdcd7;
  --surface: #ffffff;
  --surface-subtle: #f7f7f5;
  --hover: #f0f0ed;
  --focus: #557b9e;
  --danger: #a94b43;
  --danger-bg: #fbeeed;
  --danger-border: #efd0cc;
  --success: #347052;
  --success-bg: #edf7f1;
  --success-border: #cfe5d7;
  --warning: #765f21;
  --warning-bg: #faf4dd;
  --warning-border: #eadca5;
  --shadow: 0 16px 36px rgba(31, 31, 29, 0.07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--surface-subtle); color: var(--text); }
body { margin: 0; font-family: "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.shadow-banner { min-height: 36px; padding: 8px 24px; display: flex; justify-content: center; gap: 10px; align-items: center; background: #252522; color: #fff; font-size: 12px; letter-spacing: 0.01em; }
.shadow-banner span { color: #d7d7d1; }
.shadow-banner-danger { background: #6f2e29; }
.shadow-banner-danger span { color: #fff; }
.shell { max-width: 1240px; min-height: calc(100vh - 36px); margin: 0 auto; padding: 0 28px; background: var(--surface); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.topbar { height: 76px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 32px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; gap: 10px; align-items: center; font-weight: 750; text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--text); color: #fff; font-size: 11px; letter-spacing: 0.06em; }
nav { display: flex; gap: 4px; }
.nav-link { padding: 9px 12px; color: var(--text-secondary); text-decoration: none; border-radius: 7px; }
.nav-link:hover, .nav-link.is-active { background: var(--surface-subtle); color: var(--text); }
.nav-link.is-active { font-weight: 650; }
.user-chip { padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--text-secondary); }
main { padding: 42px 0 56px; }
footer { padding: 20px 0 28px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 36px; margin-bottom: 34px; }
.compact-page-head { align-items: center; margin-bottom: 26px; }
.compact-summary { margin: 0; color: var(--text-secondary); }
.compact-head { max-width: 820px; }
.eyebrow { margin: 0 0 7px; color: var(--text-secondary); font-size: 12px; font-weight: 700; letter-spacing: 0.065em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 800px; margin-bottom: 10px; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -0.045em; }
h2 { margin-bottom: 8px; font-size: 19px; line-height: 1.25; letter-spacing: -0.025em; }
.lead { max-width: 710px; margin-bottom: 0; color: var(--text-secondary); font-size: 16px; }
.muted { color: var(--text-secondary); }
.hash { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.button { min-height: 42px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-weight: 700; text-decoration: none; white-space: nowrap; }
.button-primary { background: var(--text); color: #fff; }
.button-primary:hover { background: #353532; }
.button-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.button-secondary:hover { background: var(--hover); }
.text-link { color: #365f82; font-weight: 650; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.status { display: inline-flex; width: fit-content; padding: 5px 9px; border: 1px solid; border-radius: 999px; font-size: 11px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.status-warning { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border); }
.status-danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.status-success { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }

.work-list { border-top: 1px solid var(--border-strong); }
.work-item { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: start; gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--border); }
.work-state { display: flex; flex-direction: column; gap: 9px; }
.work-main p:not(.eyebrow) { max-width: 670px; color: var(--text-secondary); }
.inline-facts { display: flex; flex-wrap: wrap; gap: 28px; margin: 18px 0 0; }
.inline-facts div { display: grid; gap: 2px; }
dt { color: var(--text-muted); font-size: 12px; }
dd { margin: 0; font-weight: 650; }
.quiet-note { margin-top: 26px; padding: 18px 20px; background: var(--surface-subtle); border-left: 3px solid var(--border-strong); }
.quiet-note p { margin: 4px 0 0; color: var(--text-secondary); }

.fact-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 42px; padding: 22px 0; border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border); }
.fact-strip div { padding: 0 22px; border-right: 1px solid var(--border); }
.fact-strip div:first-child { padding-left: 0; }
.fact-strip div:last-child { border: 0; }
.fact-strip span { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: 12px; }
.fact-strip strong { font-size: 18px; letter-spacing: -0.02em; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(280px, 0.8fr); gap: 58px; }
.section-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.section-spaced { margin-top: 42px; }
.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.scenario { min-height: 128px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 10px; }
.scenario-primary { background: #f2f6f9; border-color: #d8e3eb; }
.scenario span, .scenario small { color: var(--text-secondary); }
.scenario strong { margin: 10px 0; font-size: 23px; letter-spacing: -0.035em; }
.scenario small + small { margin-top: 5px; }
.method-note { margin: 12px 0 0; color: var(--text-secondary); font-size: 12px; }
.side-column { border-left: 1px solid var(--border); padding-left: 28px; }
.side-section { padding: 0 0 26px; margin-bottom: 26px; border-bottom: 1px solid var(--border); }
.plain-list { margin: 12px 0 0; padding-left: 20px; color: var(--text-secondary); }
.plain-list li { margin: 6px 0; }
.stacked-facts { display: grid; gap: 12px; margin: 0; }
.stacked-facts div { display: grid; grid-template-columns: 100px 1fr; gap: 10px; }
.document-ref { padding: 10px 12px; background: var(--surface-subtle); border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-secondary); font-size: 12px; font-weight: 700; }

.decision-grid { align-items: start; }
.decision-form { display: grid; gap: 20px; max-width: 720px; }
.decision-form label { display: grid; gap: 7px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 11px 12px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; }
textarea { resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.notice { margin: -10px 0 28px; padding: 13px 15px; border: 1px solid; border-radius: 8px; }
.notice-success { color: var(--success); background: var(--success-bg); border-color: var(--success-border); }
.notice-danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.history-list, .audit-list { padding: 0; margin: 0; list-style: none; }
.history-list li, .audit-list li { padding: 13px 0; border-bottom: 1px solid var(--border); }
.history-list strong, .audit-list strong, .history-list span, .audit-list span, .history-list small, .audit-list small { display: block; }
.history-list span, .audit-list span, .history-list small, .audit-list small { color: var(--text-secondary); font-size: 12px; }
.history-list p { margin: 7px 0; }
.empty-state { color: var(--text-secondary); }
.document-panel { min-height: 190px; padding: 28px; display: flex; justify-content: space-between; align-items: center; gap: 28px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 12px; }
.document-panel h2 { margin: 16px 0 7px; font-size: 25px; }
.document-panel p { margin: 0; color: var(--text-secondary); }

/* Fast Shadow: decision-first dashboard surfaces. */
.section-block { margin-top: 42px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 42px; }
.metric { min-height: 132px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 10px; }
.metric span, .metric small { color: var(--text-secondary); }
.metric strong { margin: 10px 0 4px; font-size: 32px; line-height: 1; letter-spacing: -0.04em; }
.metric-danger { background: var(--danger-bg); border-color: var(--danger-border); }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.summary-grid-compact { margin-bottom: 28px; }
.summary-line { min-height: 78px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 22px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 9px; }
.summary-line div { display: grid; gap: 3px; }
.summary-line span { color: var(--text-secondary); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.7fr); gap: 42px; align-items: start; }
.due-section { grid-column: 1; grid-row: 1; }
.attention-panel { grid-column: 2; grid-row: 1; }
.compact-work-item { grid-template-columns: 112px minmax(0, 1fr) auto; gap: 20px; padding: 22px 0; }
.list-footer-link { display: inline-block; margin-top: 16px; }
.attention-panel { padding: 22px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 10px; }
.exception-preview { padding: 0; margin: 0 0 20px; list-style: none; }
.exception-preview li { display: grid; gap: 3px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.exception-preview a { width: fit-content; font-weight: 750; text-decoration: none; }
.exception-preview a:hover { text-decoration: underline; }
.exception-preview span { color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.preview-heading { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.preview-heading .status { font-size: 9px; }
.button-full { width: 100%; }
.priority-action { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 28px; align-items: center; margin-bottom: 8px; padding: 22px 24px; border: 1px solid; border-left-width: 4px; border-radius: 10px; }
.priority-danger { background: var(--danger-bg); border-color: var(--danger-border); border-left-color: var(--danger); }
.priority-warning { background: var(--warning-bg); border-color: var(--warning-border); border-left-color: var(--warning); }
.priority-copy h2 { margin-bottom: 4px; }
.priority-copy p:last-child { margin-bottom: 0; color: var(--text-secondary); }
.priority-facts { display: flex; gap: 24px; margin: 0; }
.priority-facts div { min-width: 100px; }
.reconciliation-line { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 24px; padding: 14px 16px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 8px; }
.reconciliation-equation { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--text-secondary); }
.reconciliation-equation b { color: var(--text); }
.equation-sign { color: var(--text-muted); }
.state-panel { margin-bottom: 32px; padding: 22px 24px; background: var(--surface-subtle); border: 1px solid var(--border); border-left-width: 4px; border-radius: 9px; }
.state-panel h2, .state-panel p:last-child { margin-bottom: 0; }
.state-panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.state-danger { background: var(--danger-bg); border-color: var(--danger-border); border-left-color: var(--danger); }
.state-warning { background: var(--warning-bg); border-color: var(--warning-border); border-left-color: var(--warning); }
.filter-panel { margin-bottom: 24px; padding: 20px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 10px; }
.filter-form { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 12px; align-items: end; }
.filter-form label, .search-field { display: grid; gap: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.search-field { max-width: 480px; margin-bottom: 16px; }
.filter-disclosure { margin-bottom: 26px; padding: 14px 16px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 9px; }
.filter-panel .filter-disclosure { margin-bottom: 0; padding: 0; border: 0; background: transparent; }
.filter-disclosure > summary, .technical-details > summary { width: fit-content; cursor: pointer; color: #365f82; font-weight: 700; }
.filter-disclosure[open] > summary { margin-bottom: 16px; }
.exception-filter-disclosure { max-width: 800px; }
.filter-form .button { min-height: 43px; }
.reset-link { min-height: 43px; display: inline-flex; align-items: center; }
.table-surface { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.portfolio-table th { position: sticky; top: 0; background: var(--surface-subtle); white-space: nowrap; }
.portfolio-table td { vertical-align: top; }
.portfolio-table tbody tr:hover { background: #fbfbfa; }
.portfolio-table tbody tr[hidden] { display: none; }
.row-link { display: block; width: fit-content; color: #365f82; font-weight: 750; text-decoration: none; }
.row-link:hover { text-decoration: underline; }
.row-secondary { display: block; max-width: 320px; margin-top: 3px; color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.portfolio-mobile-controls { padding: 14px 16px; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; }
.portfolio-search-empty { margin: 0; padding: 24px 16px; color: var(--text-secondary); text-align: center; }
.exception-filters { max-width: 760px; grid-template-columns: repeat(2, minmax(180px, 1fr)) auto auto; margin-bottom: 28px; }
.exception-list { border-top: 1px solid var(--border-strong); }
.exception-item { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 26px; align-items: start; padding: 25px 0; border-bottom: 1px solid var(--border); }
.exception-state { display: grid; gap: 9px; }
.reason-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 12px 0 0; list-style: none; }
.reason-list li { padding: 5px 8px; color: var(--danger); background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.human-reason-list { margin: 12px 0; padding-left: 20px; }
.human-reason-list li { margin: 4px 0; }
.next-action { margin: 12px 0; }
.technical-details { margin-top: 14px; color: var(--text-secondary); font-size: 12px; }
.technical-details[open] > summary { margin-bottom: 10px; }
.technical-details p { margin: 0; }
.source-details { padding: 16px; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 9px; }
.source-details > summary { cursor: pointer; color: #365f82; font-weight: 700; }
.source-details[open] > summary { margin-bottom: 14px; }
.details-intro { margin-bottom: 14px; color: var(--text-secondary); }
.source-details .stacked-facts { margin-top: 14px; }
.source-details .technical-details { padding-top: 14px; border-top: 1px solid var(--border); }
.technical-list { margin-top: 12px; }
.footer-details { margin-top: 0; text-align: right; }
.footer-details div { display: grid; gap: 2px; margin-top: 8px; }
.decision-safety { margin: -18px 0 28px; padding: 12px 14px; color: var(--text-secondary); background: var(--surface-subtle); border-left: 3px solid var(--border-strong); }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--border); }
.detail-list div { min-width: 0; padding: 15px 0; border-bottom: 1px solid var(--border); }
.detail-list div:nth-child(odd) { padding-right: 22px; }
.detail-list dd { overflow-wrap: anywhere; }
.danger-text { color: var(--danger); }

@media (max-width: 860px) {
  .shell { padding: 0 18px; }
  .topbar { height: auto; padding: 16px 0; grid-template-columns: 1fr auto; }
  nav { grid-column: 1 / -1; overflow-x: auto; }
  .page-head, .document-panel { flex-direction: column; align-items: stretch; }
  .fact-strip { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .fact-strip div:nth-child(2) { border-right: 0; }
  .content-grid { grid-template-columns: 1fr; gap: 42px; }
  .side-column { border-left: 0; padding-left: 0; }
  .work-item { grid-template-columns: 1fr; gap: 18px; }
  .scenario-grid { grid-template-columns: 1fr; }
  .metric-grid, .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .due-section, .attention-panel { grid-column: 1; grid-row: auto; }
  .priority-action { grid-template-columns: 1fr; gap: 18px; }
  .priority-facts { justify-content: flex-start; }
  .filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exception-item { grid-template-columns: 1fr; gap: 16px; }
  footer { flex-direction: column; }
  .footer-details { text-align: left; }
}

@media (max-width: 560px) {
  .shadow-banner { padding: 8px 12px; align-items: flex-start; flex-direction: column; gap: 2px; }
  .shell { padding: 0 14px; }
  .topbar { grid-template-columns: 1fr; gap: 12px; }
  nav { grid-column: 1; width: 100%; }
  .user-chip { display: none; }
  main { padding-top: 30px; }
  .page-head { gap: 18px; margin-bottom: 26px; }
  h1 { font-size: 32px; }
  .metric-grid, .summary-grid, .filter-form, .detail-list { grid-template-columns: 1fr; }
  .summary-line { align-items: flex-start; flex-direction: column; gap: 10px; }
  .compact-work-item { grid-template-columns: 1fr; }
  .priority-action { padding: 18px; }
  .priority-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .reconciliation-line { align-items: flex-start; flex-direction: column; }
  .reconciliation-equation { gap: 5px; font-size: 13px; }
  .fact-strip { grid-template-columns: 1fr; }
  .fact-strip div, .fact-strip div:first-child { padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .fact-strip div:last-child { border-bottom: 0; }
  .table-surface { border: 0; border-radius: 0; box-shadow: none; }
  .portfolio-table, .portfolio-table tbody { display: block; width: 100%; }
  .portfolio-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .portfolio-table tr { width: 100%; margin-bottom: 10px; padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
  .portfolio-table td { display: block; width: auto; min-width: 0; padding: 0; border-bottom: 0; }
  .portfolio-table td::before { display: block; margin-bottom: 2px; content: attr(data-label); color: var(--text-muted); font-size: 11px; font-weight: 700; }
  .portfolio-table .cell-position { grid-column: 1; grid-row: 1; }
  .portfolio-table .cell-position::before, .portfolio-table .cell-state::before { content: none; }
  .portfolio-table .cell-state { grid-column: 2; grid-row: 1; justify-self: end; }
  .portfolio-table .cell-direction { grid-column: 1; grid-row: 2; }
  .portfolio-table .cell-amount { grid-column: 2; grid-row: 2; text-align: right; }
  .portfolio-table .cell-maturity { grid-column: 1 / -1; grid-row: 3; padding-top: 10px; border-top: 1px solid var(--border); }
  .portfolio-table .cell-owner, .portfolio-table .cell-document { display: none; }
  .portfolio-table td.empty-state { display: block; }
  .portfolio-table td.empty-state::before { content: none; }
  .portfolio-mobile-controls { display: flex; margin-top: 2px; padding: 14px 0; border-top: 0; }
  .portfolio-mobile-controls .button { min-height: 38px; padding: 8px 12px; }
  .exception-item { padding: 20px 0; }
}
