:root {
  color-scheme: dark;
  font-family: "Inter Variable", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a { color: inherit; text-decoration: none; }
svg { flex: none; vertical-align: middle; }
h1, h2, h3, p, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[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;
}
.workspace { display: grid; min-height: 100dvh; grid-template-columns: var(--rail-width) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  background: var(--rail); border-right: 1px solid var(--line); padding: 0 12px 10px;
}
.brand {
  display: flex; min-height: var(--header-height); gap: 8px; align-items: center; padding-inline: 6px;
  font-size: 1.075rem; font-weight: 650; letter-spacing: -.028em;
}
.brand-mark {
  display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 8px;
  background: var(--ink); color: var(--primary-text); flex: none; font-size: 1rem; font-weight: 650;
}
.nav-section { flex: 1; min-height: 0; overflow-y: auto; padding-block: 1px 12px; }
.nav-group { display: grid; gap: 4px; }
.nav-group + .nav-group { margin-top: 21px; }
.nav-label { color: var(--quiet); font-size: .81rem; font-weight: 500; padding: 0 8px 3px; }
.nav-link {
  display: flex; min-height: 32px; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 10px;
  color: var(--muted); font-size: .875rem; font-weight: 500;
}
.nav-link:hover { background: var(--raised); color: var(--ink); }
.nav-link[aria-current] { background: var(--active); color: #fafafa; }
.sidebar-bottom { padding-top: 8px; border-top: 1px solid var(--line); }
.side-profile { display: flex; align-items: center; gap: 9px; padding: 3px 2px; }
.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  color: var(--ink); background: #282828; border: 1px solid var(--control-line); font-size: .75rem; font-weight: 650;
}
.side-profile > div { flex: 1; min-width: 0; }
.side-profile strong, .side-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-profile strong { color: var(--text); font-size: .82rem; font-weight: 550; }
.side-profile small { color: var(--muted); font-size: .75rem; margin-top: 2px; }
.main-shell { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr minmax(180px, 244px) 1fr;
  align-items: center; height: var(--header-height); gap: 12px; padding: 0 15px;
  background: var(--page); border-bottom: 1px solid var(--line);
}
.top-context { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: .875rem; }
.top-context strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-search {
  display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; min-height: 32px; padding: 0 8px;
  background: var(--page); border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: .8125rem;
}
.top-search:hover { background: var(--surface); border-color: var(--control-line); color: var(--ink); }
.top-search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-search kbd {
  margin-left: auto; flex: none; color: var(--muted); font: inherit; font-size: .68rem; line-height: 16px;
  padding: 0 4px; border: 1px solid var(--line); border-radius: 4px;
}
.top-avatar { justify-self: end; width: 29px; height: 29px; font-size: .72rem; }
.mobile-menu { display: none !important; }
.drawer-scrim { display: none; }
#main { width: min(calc(100% - 40px), 1152px); margin: 0 auto; padding: 34px 0 48px; min-width: 0; }
.page-heading { display: flex; gap: 14px; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.page-heading h1, .overview-intro h1 {
  font-size: 1.75rem; line-height: 1.22; letter-spacing: -.036em; font-weight: 500;
}
.page-heading p { color: var(--muted); font-size: .875rem; line-height: 1.5; margin-top: 5px; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.monthly-folders h1:focus { outline: none; }
.month-folder-year + .month-folder-year { margin-top: 30px; }
.month-folder-year h2 { margin-bottom: var(--space-3); font-size: 15px; font-weight: 550; }
.month-folder-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--space-3); }
.month-folder {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
  min-height: 76px; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-row);
  background: var(--surface); transition: background-color var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease);
}
.month-folder:hover { background: var(--raised); border-color: var(--field-line); }
.month-folder-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-control); background: var(--active); }
.month-folder strong, .month-folder small { display: block; }
.month-folder strong { font-size: 14px; font-weight: 550; }
.month-folder small, .month-folder > svg { margin-top: 3px; color: var(--muted); }
.month-folder-back {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--compact-height);
  margin-bottom: var(--space-2); color: var(--muted); font-size: 13px;
}
.month-folder-back:hover { color: var(--ink); }
.month-invoice-list { border-block: 1px solid var(--line); gap: 0; }
.month-invoice { gap: var(--space-3); padding: var(--space-2); }
.month-invoice + .month-invoice { border-top: 1px solid var(--line); }
.month-invoice[data-selected] { background: var(--active); }
.month-selection-toolbar { padding-inline: var(--space-2); }
.month-selection-count { display: flex; align-items: center; gap: var(--space-3); }
.month-invoice-check { flex: none; width: 32px; justify-content: center; cursor: pointer; }
.month-invoice-check:has(:disabled) { cursor: default; }
.month-invoice time { color: var(--muted); font-size: 13px; margin-right: var(--space-2); white-space: nowrap; }
.month-invoice-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); padding-top: var(--space-3); color: var(--muted); font-size: 13px; }
.month-folder-loading { padding: var(--space-4) 0; color: var(--muted); font-size: 14px; }
.month-invoice-error { margin-bottom: var(--space-3); }
@media (max-width: 480px) {
  .month-invoice time { font-size: 12px; margin-right: 0; }
}
.overview-intro { display: grid; justify-items: center; gap: 19px; padding: 35px 0 34px; margin-bottom: 13px; }
.overview-intro h1 { font-size: 1.75rem; font-weight: 450; text-align: center; }
.monthly-invoice-tracker { margin-bottom: var(--space-6); }
.monthly-invoice-tracker .panel-header { flex-wrap: wrap; align-items: end; }
.monthly-invoice-tracker form { min-width: min(100%, 180px); }
.monthly-invoice-results { padding: 0 var(--space-4) var(--space-3); color: var(--text); font-size: 14px; line-height: 1.45; }
.monthly-invoice-results > p a { margin-inline-start: var(--space-1); }
.monthly-invoice-results ul { margin-top: var(--space-2); gap: 0; }
.monthly-invoice-results li { padding: var(--space-2) 0; border-top: 1px solid var(--line); color: var(--ink); }
.vendor-monthly-dates { display: grid; gap: var(--space-2); }
.intake-panel {
  display: flex; align-items: center; gap: 12px; width: min(100%, 650px); padding: 9px 10px 9px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px;
}
.intake-panel.dragging { border-color: var(--muted); background: var(--raised); }
.intake-icon {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px;
  color: var(--text); background: var(--active); border-radius: 9px;
}
.intake-copy { flex: 1; min-width: 0; }
.intake-copy strong { display: block; color: var(--ink); font-size: .875rem; font-weight: 550; }
.intake-copy p { margin-top: 3px; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.button {
  display: inline-flex; min-height: 36px; justify-content: center; align-items: center; gap: 6px; white-space: nowrap;
  border: 1px solid transparent; border-radius: 10px; padding: 5px 12px; font-size: .875rem; font-weight: 500; line-height: 1.25;
}
.primary { color: var(--primary-text); background: var(--primary); border-color: var(--primary); }
.primary:hover:not(:disabled) { background: #e4e4e4; border-color: #e4e4e4; }
.secondary { background: var(--page); border-color: var(--control-line); color: var(--ink); }
.secondary:hover:not(:disabled), .icon-button:hover:not(:disabled), .plain:hover { background: var(--raised); }
.plain { background: transparent; color: var(--muted); }
.compact { padding: 4px 9px; min-height: 32px; font-size: .8125rem; }
.icon-button {
  display: inline-grid; place-items: center; width: 31px; height: 31px; padding: 0; flex: none;
  background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--muted);
}
.icon-button.outlined { border-color: var(--control-line); }
.text-button {
  display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0;
  color: var(--ink); font-size: inherit; font-weight: 500;
}
.text-button:hover { text-decoration: underline; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.toolbar-label { color: var(--ink); font-size: 1rem; font-weight: 550; letter-spacing: -.014em; }
.toolbar-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.overview-toolbar { margin-bottom: 12px; }
.overview-picker { min-width: 0; max-width: min(178px, 100%); }
input::placeholder, textarea::placeholder { color: var(--quiet); }
select option { background: var(--raised); color: var(--ink); }
.metrics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px;
  border: 1px solid var(--line); border-inline: 0;
}
.metric { padding: 16px 17px; min-width: 0; }
.metric:first-child { padding-inline-start: 0; }
.metric + .metric { border-left: 1px solid var(--line); }
.tile-icon, .empty-icon {
  display: inline-grid; place-items: center; flex: none; border-radius: 9px;
  background: var(--raised); color: var(--text);
}
.tile-icon { width: 34px; height: 34px; }
.metric p { color: var(--muted); margin-bottom: 5px; font-weight: 500; font-size: .875rem; }
.metric > strong {
  display: block; font-size: clamp(1.46rem, 2.05vw, 1.95rem); line-height: 1.16; letter-spacing: -.032em;
  font-weight: 550; overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
}
.metric-foot { display: flex; gap: 6px; align-items: center; min-height: 19px; margin-top: 5px; font-size: .8rem; color: var(--muted); }
.badge {
  display: inline-flex; flex: none; align-items: center; gap: 5px; white-space: nowrap;
  border-radius: 999px; padding: 4px 8px; font-size: .75rem; font-weight: 550; line-height: 1.1;
}
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.delta, .badge.reviewed { background: #292929; color: #e3e3e3; }
.badge.attention { color: #efc081; background: #33281c; }
.badge.processing { color: #bdc9ea; background: #272c36; }
.badge.neutral { background: var(--raised); color: var(--muted); }
.chart-grid {
  display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); margin-bottom: 15px;
}
.chart-grid > section { min-width: 0; }
.chart-grid > section + section { border-left: 1px solid var(--line); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 12px; }
.panel-header h2, .shared-card h2 { font-weight: 550; font-size: 1rem; letter-spacing: -.012em; }
.panel-header p, .shared-card p { margin-top: 4px; font-size: .8125rem; color: var(--muted); line-height: 1.45; }
.chart-panel { padding-bottom: 10px; }
.chart-range { white-space: nowrap; color: var(--muted); font-size: .8rem; }
.bar-chart { display: block; width: calc(100% - 30px); height: auto; min-height: 165px; max-height: 211px; margin: 0 auto; overflow: visible; }
.gridline { stroke: var(--line); vector-effect: non-scaling-stroke; }
.chart-axis, .chart-label { fill: var(--muted); font-family: inherit; font-size: 12px; }
.chart-label.current { fill: var(--ink); font-weight: 550; }
.chart-bar { fill: #595959; }
.chart-bar.active, .chart-bar:hover { fill: #e8e8e8; }
.allocation { display: flex; flex-direction: column; }
.donut-wrap { position: relative; align-self: center; margin: 0 auto 5px; width: 112px; height: 112px; }
.donut { width: 100%; height: 100%; fill: none; stroke-width: 11; }
.donut-track { stroke: var(--raised); }
.donut-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-label strong { font-weight: 550; font-size: 1rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.donut-label small { color: var(--muted); font-size: .73rem; margin-top: 2px; }
.project-legend { list-style: none; margin: 0 16px 3px; }
.project-legend li {
  display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 7px; align-items: center;
  padding: 4px 0; color: var(--text); font-size: .8125rem;
}
.project-legend li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-legend strong { color: var(--ink); font-weight: 550; font-variant-numeric: tabular-nums; }
.chart-empty { text-align: center; color: var(--muted); font-size: .8125rem; margin: 5px 12px 10px; }
.overview-note { margin: -3px 0 12px; color: var(--muted); font-size: .8125rem; }
.list-section { background: transparent; }
.list-section > .panel-header { padding-inline: 0; }
.table-scroll { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: .875rem; color: var(--text); }
thead { background: var(--surface); color: var(--muted); }
th, td { padding: 9px 12px; border-top: 1px solid var(--line); }
th { font-weight: 500; font-size: .8125rem; }
td { height: 53px; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { padding-left: 15px; }
th:last-child, td:last-child { padding-right: 10px; }
tbody tr:hover { background: var(--raised); }
.invoice-name {
  display: inline-flex; background: none; border: 0; padding: 0; gap: 8px; align-items: center; text-align: left; color: var(--ink);
}
.invoice-name:hover strong { text-decoration: underline; }
.invoice-name strong, .invoice-name small { display: block; overflow: hidden; text-overflow: ellipsis; max-width: 228px; }
.invoice-name strong { font-size: .875rem; font-weight: 550; }
.invoice-name small { color: var(--muted); font-size: .75rem; margin-top: 2px; }
.vendor-mark {
  display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 7px;
  font-size: .675rem; font-weight: 650; background: var(--raised); color: var(--text);
}
.project-tag { display: inline-block; color: var(--text); background: var(--raised); border-radius: 5px; padding: 4px 6px; font-size: .765rem; }
.amount-cell { text-align: right; }
td.amount-cell { color: var(--ink); font-weight: 550; }
.row-action { width: 39px; text-align: right; padding-left: 0; }
.empty, .boot { display: grid; place-items: center; text-align: center; gap: 9px; color: var(--muted); padding: 35px 20px; }
.empty h3, .boot h1 { color: var(--ink); font-weight: 550; }
.empty p, .boot p { line-height: 1.45; font-size: .875rem; }
.empty-icon { width: 40px; height: 40px; }
.boot { min-height: 80vh; align-content: center; }
.pagination {
  padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .8125rem;
}
.pagination > div { display: flex; gap: 5px; }
.shared-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 14px; }
.description-cell { white-space: normal; min-width: 160px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.settings-body { padding: 0 16px 16px; display: grid; gap: 12px; }
.members { border-top: 1px solid var(--line); list-style: none; padding: 3px 16px; }
.members li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; gap: 6px; }
.members li + li { border-top: 1px solid var(--line); }
.members strong, .members small { display: block; overflow-wrap: anywhere; }
.members strong { font-size: .875rem; font-weight: 550; }
.members small { color: var(--muted); font-size: .76rem; margin-top: 2px; }
.member-actions { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.integration-panel { grid-column: 1 / -1; }
code { overflow-wrap: anywhere; font-size: .92em; }
dialog {
  color: var(--ink); background: var(--surface); border: 1px solid var(--control-line); border-radius: 13px; padding: 0;
  width: min(520px, calc(100vw - 28px)); max-height: calc(100dvh - 36px); box-shadow: 0 16px 64px #0007;
}
dialog::backdrop { background: #0009; }
.dialog-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 16px 17px 13px;
  border-bottom: 1px solid var(--line);
}
.dialog-header h2 { font-size: 1.24rem; font-weight: 550; letter-spacing: -.018em; overflow-wrap: anywhere; }
.dialog-header p { color: var(--muted); margin-top: 4px; font-size: .875rem; line-height: 1.4; overflow-wrap: anywhere; }
.dialog-body { padding: 15px 17px 17px; display: grid; gap: 12px; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.dropzone {
  min-height: 128px; display: grid; align-content: center; justify-items: center; gap: 7px; border: 1px dashed var(--control-line);
  border-radius: 10px; color: var(--text); background: var(--page); padding: 14px; text-align: center; cursor: pointer;
}
.dropzone:hover, .dropzone.dragging, .dropzone:has(+ input:focus-visible) { background: var(--raised); border-color: var(--muted); }
.dropzone svg { color: var(--text); }
.dropzone strong { font-weight: 550; font-size: .875rem; }
.dropzone span { color: var(--muted); font-size: .8rem; }
.upload-files { list-style: none; }
.upload-files:empty { display: none; }
.upload-files li { display: flex; align-items: center; min-height: 36px; gap: 8px; border-bottom: 1px solid var(--line); font-size: .8125rem; }
.upload-files li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-files li small { color: var(--muted); }
.upload-files .bad-text, .form-error { color: var(--error); }
.form-note, .field-hint { font-size: .8125rem; line-height: 1.42; color: var(--muted); }
.form-note svg { margin-right: 3px; }
.form-error { font-size: .875rem; line-height: 1.43; }
.form-error:empty { display: none; }
.field { display: grid; gap: 5px; font-size: .875rem; color: var(--text); min-width: 0; font-weight: 550; }
.field input, .field textarea, .field select {
  color: var(--ink); font-weight: 450; width: 100%; min-height: 36px; padding: 6px 8px;
  background: var(--page); border: 1px solid var(--control-line); border-radius: 8px; letter-spacing: normal;
}
.field input:disabled { opacity: .58; }
.field input[type="date"] { min-width: 0; }
.field textarea { resize: vertical; line-height: 1.45; }
.form-grid, .invoice-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; }
.form-full { grid-column: 1 / -1; }
.new-vendor-area { margin-top: -3px; font-size: .8125rem; }
.inline-form { display: flex; align-items: end; gap: 7px; margin-top: 7px; }
.inline-form .field { flex: 1; }
.extraction-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--page); padding: 9px 10px; }
.extraction-top { display: flex; justify-content: space-between; gap: 7px; align-items: flex-start; }
.extraction-top strong { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-size: .875rem; font-weight: 550; }
.extraction-top p { color: var(--muted); font-size: .8rem; line-height: 1.43; margin: 3px 0 0; }
.extraction-top .button { min-height: 29px; padding: 4px 7px; font-size: .765rem; }
.ai-summary { color: var(--text); font-size: .84rem; font-weight: 550; margin: 8px 0 3px; overflow-wrap: anywhere; }
.checks { display: grid; }
.company-check {
  border-top: 1px solid var(--line); padding: 5px 0; display: flex; justify-content: space-between;
  align-items: center; gap: 5px; font-size: .8rem; color: var(--text);
}
.company-check small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.invoice-meta dt { font-size: .8125rem; color: var(--muted); margin-bottom: 3px; }
.invoice-meta dd { font-size: .94rem; font-weight: 550; overflow-wrap: anywhere; }
.loading { color: var(--muted); }
.toast {
  position: fixed; z-index: 10; bottom: 18px; right: 18px; max-width: min(380px, calc(100vw - 36px));
  color: var(--ink); background: var(--raised); border: 1px solid var(--control-line); padding: 10px 13px;
  border-radius: 9px; font-size: .875rem; visibility: hidden; opacity: 0; transition: opacity 130ms ease;
}
.toast.visible { visibility: visible; opacity: 1; }
.toast.error { color: var(--error); }
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: var(--page); }
.auth-panel { width: min(100%, 408px); padding: 24px; }
.auth-panel h1 { margin-top: 13px; font-size: 1.6rem; letter-spacing: -.022em; font-weight: 550; }
.auth-panel p { color: var(--muted); margin-top: 6px; }
.auth-panel form { display: grid; gap: 12px; margin-top: 19px; }
.auth-panel form .form-error { color: var(--error); }
.auth-panel form .button { justify-self: start; min-width: 93px; }
dialog.invoice-dialog {
  width: min(1080px, calc(100vw - 28px)); height: min(900px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px); border-radius: var(--radius-dialog); overflow: hidden;
}
dialog.invoice-dialog[open] { display: flex; flex-direction: column; }
.invoice-dialog .dialog-header { flex: none; }
.invoice-view-toolbar {
  display: flex; flex: none; align-items: center; justify-content: space-between; flex-wrap: wrap;
  column-gap: var(--space-4); row-gap: var(--space-2); padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.invoice-preview-tools, .invoice-preview-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); min-width: 0;
}
.invoice-preview-tools ledger-picker { width: min(220px, 100%); }
.invoice-preview-panel, .invoice-details-panel { flex: 1; min-height: 0; }
.invoice-preview-panel { display: grid; grid-template-rows: minmax(0, 1fr); background: var(--page); }
.invoice-pdf-reader { display: flex; flex-direction: column; min-height: 0; }
.invoice-pdf-pages { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--space-3); }
.invoice-pdf-page { display: grid; justify-items: center; }
.invoice-pdf-page canvas { display: block; max-width: 100%; border-radius: 2px; background: var(--ink); }
.invoice-pdf-status { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 12px; }
.invoice-pdf-navigation {
  flex: none; display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-2); border-top: 1px solid var(--line); background: var(--surface); font-size: 13px;
}
.invoice-preview-empty { align-self: center; justify-self: center; padding: var(--space-4); color: var(--muted); }
.invoice-details-panel { overflow: auto; }
.invoice-details-panel > .dialog-body { width: min(810px, 100%); margin-inline: auto; }
.document-links { list-style: none; display: grid; gap: 4px; }
.document-links li {
  display: flex; align-items: center; gap: 5px; min-width: 0; padding: 5px;
  border: 1px solid var(--line); border-radius: 8px;
}
.document-links li > div { display: grid; gap: 3px; min-width: 0; flex: 1; padding: 0 4px; }
.document-links strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; font-weight: 550; }
.document-links small { color: var(--muted); font-size: .76rem; }
.checkbox-field { display: flex; align-items: center; gap: 5px; margin-top: 7px; font-size: .8125rem; color: var(--text); }
.attach-action { justify-self: start; min-height: 31px; }
.attach-list { display: grid; gap: 7px; list-style: none; }
.attach-list .button { white-space: normal; text-align: left; width: 100%; justify-content: flex-start; }
@media (max-width: 1090px) {
  :root { --rail-width: 201px; }
  .invoice-name strong, .invoice-name small { max-width: 165px; }
}
@media (max-width: 850px) {
  :root { --rail-width: 175px; }
  .chart-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .allocation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
  .allocation .panel-header { grid-column: 1 / -1; }
  .chart-grid > section + section { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 690px) {
  .workspace { display: block; }
  .sidebar {
    display: none; position: fixed; z-index: 5; top: var(--header-height); left: 0;
    width: min(256px, 82vw); height: calc(100dvh - var(--header-height)); padding: 0 10px 10px;
    box-shadow: 12px 0 30px #0005;
  }
  .workspace.menu-open .sidebar { display: flex; }
  .workspace.menu-open .drawer-scrim {
    display: block; position: fixed; inset: var(--header-height) 0 0; z-index: 4; background: #0007; border: 0;
  }
  .topbar { padding: 0 10px; gap: 8px; grid-template-columns: 1fr minmax(115px, 180px) auto; }
  .top-search kbd { display: none; }
  .mobile-menu { display: inline-grid !important; }
  #main { width: calc(100% - 24px); padding: 25px 0 28px; }
  .page-heading { flex-wrap: wrap; margin-bottom: 14px; }
  .heading-actions { justify-content: flex-start; }
  .overview-intro { padding: 8px 0 19px; gap: 12px; }
  .overview-intro h1, .page-heading h1 { font-size: 1.6rem; }
  .intake-panel { padding: 8px; gap: 7px; }
  .intake-icon { width: 31px; height: 31px; }
  .intake-copy p { font-size: .75rem; }
  .toolbar-label { display: none; }
  .toolbar-controls { gap: 5px; }
  .metric, .metric:first-child { padding: 8px; }
  .metric p { font-size: .77rem; line-height: 1.18; min-height: 28px; }
  .metric > strong { font-size: clamp(1.03rem, 4.2vw, 1.32rem); }
  .metric-foot { align-items: flex-start; flex-wrap: wrap; font-size: .72rem; }
  .metric-foot .text-button svg { display: none; }
  .panel-header { padding-inline: 11px; }
  .dialog-header, .dialog-body { padding-inline: 11px; }
}
@media (max-width: 370px) {
  .intake-copy p { display: none; }
  .intake-icon { display: none; }
}
@media (max-width: 500px) {
  dialog.invoice-dialog { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
  .invoice-view-toolbar { padding-inline: var(--space-2); }
  .invoice-details-panel #review-form .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
