:root {
  --bg: #f4f5f9;
  --ink: #1d2032;
  --muted: #595d72;
  --line: #e2e4ef;
  --control-line: #cacde0;
  --accent: #4d478f;
  --accent-soft: #eeecfb;
  --action: #403977;
  --action-hover: #322c61;
  --focus: #6154ad;
  --radius: 18px;
}
body { background: var(--bg); }
input, select, textarea { font: inherit; }
textarea { min-width: 0; max-width: 100%; border: 1px solid var(--control-line); border-radius: 9px; padding: 12px; color: var(--ink); background: white; resize: vertical; }
.app-header { background: #ffffffed; border-color: var(--line); }
.brand-mark { background: var(--action); box-shadow: none; }
.navigation { border-color: var(--line); background: #f1f0f8; }
.account-link { justify-self: end; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 7px 12px; border-radius: 99px; color: var(--ink); text-decoration: none; }
.account-link:hover { background: var(--accent-soft); }
.account-link span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-intro { align-items: end; }
.workspace-intro h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.12; overflow-wrap: anywhere; }
.eyebrow { margin-bottom: 7px; font-size: .82rem; letter-spacing: .13em; color: var(--accent); font-weight: 700; }
.workspace-intro .balance-date { margin-top: 8px; padding: 0; border: 0; background: transparent; flex-wrap: wrap; }
.dashboard-grid { grid-template-areas: "balance shortcuts" "sentence shortcuts" "ledger breakdown"; }
.balance { background: #f0eefb; border-color: #e1ddf4; }
.balance-mark { background: #ffffff9c; border-color: #e3dff3; box-shadow: none; }
.balance-count { margin-top: 5px; }
.quick-sentence { grid-area: sentence; display: flex; gap: 9px; padding: 9px; }
.quick-sentence input { flex: 1; }
.workspace-filter { flex-wrap: wrap; }
.workspace-filter select { min-height: 38px; font-size: .8rem; }
.transaction-text a { color: var(--ink); text-decoration: none; }
.transaction-text a:hover { text-decoration: underline; }
.transaction-text > a strong { display: inline; }
.occurred { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.flight, .bus { --tone: #567999; --tile: #eaf0f9; --glyph: #385777; }
.parking { --tone: #62718d; --tile: #edf0f7; --glyph: #43526b; }
.office { --tone: #7468a0; --tile: #f1eef9; --glyph: #544474; }
.day-heading { background: #fafaff; }
.file-picker, .voice-entry { background: #f7f6fd; border-color: var(--control-line); }
.workspace-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.work-panel { padding: clamp(15px, 3vw, 24px); }
.work-panel > h2 { margin-bottom: 4px; font-size: 1.16rem; }
.work-panel > p { color: var(--muted); margin-top: 6px; }
.stack-form { display: grid; gap: 15px; align-content: start; }
.stack-form > .button { justify-self: start; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.inline-actions { display: flex; gap: 9px 13px; flex-wrap: wrap; align-items: center; }
.inline-actions > .voice-status { flex-basis: 100%; }
.profile-identity small, .trip-row small, .selection-row small { display: block; color: var(--muted); margin-top: 4px; }
.trip-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding: 13px 0; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.trip-row:last-child { border-bottom: 0; }
.trip-row + .inline-actions, form + .inline-actions { margin-top: 16px; }
.trip-project + .trip-project { border-top: 1px solid var(--line); }
.trip-project > .trip-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; border-bottom: 0; padding-block: 8px 12px; }
.trip-project-info { min-width: 0; }
.trip-project + .inline-actions { margin-top: 12px; }
.trip-title { display: flex; min-width: 0; align-items: center; gap: 3px; }
.trip-title > :is(h1, strong) { min-width: 0; overflow-wrap: anywhere; }
.trip-edit-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; color: var(--accent); }
.trip-edit-icon .icon { width: 16px; height: 16px; }
.trip-edit-icon:hover { background: var(--accent-soft); }
.project-editor { display: grid; gap: 12px; max-width: 680px; }
.project-details { border-top: 1px solid var(--line); }
.project-list .project-details { margin-top: 14px; }
.project-details > summary, .project-delete > summary { align-content: center; min-height: 44px; color: var(--accent); cursor: pointer; font-weight: 650; }
.project-details > .stack-form, .project-delete[open] > form { margin-top: 10px; }
.project-delete > summary, .project-delete .button { color: #a1263d; }
.identity-card { display: grid; gap: 16px; padding: clamp(22px, 7vw, 54px); margin-top: 32px; }
.identity-card .button { justify-self: start; }
.identity-card p { color: var(--muted); line-height: 1.55; }
dialog:modal { color-scheme: light; }
.draft-review { margin-top: 25px; }
.draft-item legend { margin-inline-start: 8px; padding: 0 5px; }
.source-quote { overflow-wrap: anywhere; padding: 8px 12px; border-left: 3px solid var(--control-line); color: var(--muted); }
.check-inline { display: inline-flex; gap: 7px; align-items: center; min-height: 34px; flex-wrap: wrap; }
.claim-project-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.claim-project-picker legend { padding: 0; font-weight: 650; }
.claim-project-picker legend small { margin-inline-start: 4px; color: var(--muted); font-weight: 400; }
.claim-project-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 8px;
  margin-top: 7px;
}
.claim-project-options label { min-height: 44px; flex-wrap: nowrap; padding: 7px 10px; border: 1px solid var(--control-line); border-radius: 9px; overflow-wrap: anywhere; }
.claim-project-options label > input { flex: none; }
.claim-entity-field small { margin-inline-start: 0; overflow-wrap: anywhere; }
.claim-entity-field small:empty { display: none; }
.claim-selection-actions [data-claim-selection-total] { color: var(--muted); font-variant-numeric: tabular-nums; }
input[type=checkbox], input[type=radio] { accent-color: var(--action); }
.receipt-heading > div, .receipt-card, .review-layout > * { min-width: 0; }
.receipt-heading h3 { overflow-wrap: anywhere; }
.review-layout { display: grid; gap: 16px; border-top: 1px solid var(--line); margin-top: 13px; padding-top: 13px; }
.review-layout .match-form { margin-top: 0; border-top: 0; padding-top: 0; }
.receipt-source { align-self: start; background: var(--bg); border-radius: 10px; padding: 12px; }
.receipt-source img { display: block; width: 100%; height: auto; margin: 8px auto; }
.receipt-source p { margin: 8px 0 0; font-size: .88rem; }
details > summary { cursor: pointer; color: var(--accent); min-height: 33px; padding-block: 5px; }
.receipt-corrections > .field-grid { margin-top: 8px; }
.receipt-input .check-inline { font-size: .78rem; color: var(--muted); }
.selection-list { padding: 0; margin: 0; list-style: none; }
.selection-list li + li { border-top: 1px solid var(--line); }
.selection-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 0; cursor: pointer; }
.selection-row > strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.claim-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.claim-actions { margin-bottom: 16px; }
.claim-handoff { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .87rem; }
.mismatch-ack { margin-right: 12px; }
.claim-paper { padding: clamp(16px, 5vw, 44px); background: #fff; color: #181d2b; border-top: 4px solid #3c3f57; --paper-accent: #51546a; }
.claim-paper-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 24px; border-bottom: 1px solid #a6a9b7; padding-bottom: 16px; }
.claim-entity { font-size: .92rem; letter-spacing: .07em; color: #484b63; font-weight: 660; }
.claim-paper-head h2 { margin: 6px 0; font-size: clamp(1.5rem, 4vw, 2.5rem); line-height: 1.12; }
.claim-no { font-size: .82rem; letter-spacing: .055em; color: #555a70; }
.claim-identity { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.claim-paper-status { font-size: .72rem; color: var(--muted); }
.claim-paper-status.closed { color: var(--accent); font-weight: 750; }
.claim-hero-total { display: grid; justify-items: end; align-content: start; gap: 3px; color: #42465b; }
.claim-hero-total strong { position: relative; color: #1e2236; font-size: clamp(1.55rem, 3.3vw, 2.4rem); font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.15; }
.claim-hero-total span, .claim-hero-total small { font-size: .76rem; text-align: right; }
.claim-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 18px 0 22px; }
.claim-meta > div { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 4px; align-items: baseline; }
.claim-meta dt { font-size: .76rem; color: #555a70; }
.claim-meta dd { overflow-wrap: anywhere; font-weight: 650; font-size: .9rem; }
.claim-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .82rem; line-height: 1.38; }
.claim-col-date { width: 17%; }
.claim-col-category { width: 12%; }
.claim-col-money { width: 17%; }
.claim-col-index { width: 12%; }
.claim-table th, .claim-table td { vertical-align: top; text-align: left; padding: 8px 7px; overflow-wrap: anywhere; border-bottom: 1px solid #dcdee6; }
.claim-table thead th { background: #eef0f5; color: #3d4052; }
.claim-table thead th:nth-child(4), .claim-table .claim-number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.claim-table th:last-child:not([colspan]), .claim-table td:last-child { text-align: center; }
.claim-table td > small, .claim-table td:nth-child(3) > span, .claim-table td:nth-child(3) > strong { display: block; }
.claim-table td > small { color: #51546a; }
.claim-table .claim-project-source { margin-bottom: 2px; color: #723342; font-weight: 700; }
.claim-group-heading { font-weight: 750; }
.claim-group-heading th, .claim-group-heading td { border-top: 1px solid var(--control-line); }
.claim-group-heading small { margin-inline-start: 5px; font-weight: 450; color: var(--muted); }
.claim-tax-line { margin-top: 2px; }
.claim-totals { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; flex-wrap: wrap; padding-top: 14px; }
.claim-totals span { color: #555a70; font-size: .79rem; }
.claim-totals strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.claim-breakdown { display: flex; flex-wrap: wrap; gap: 6px 17px; margin-top: 8px; color: #464a60; font-size: .77rem; }
.claim-breakdown div { display: inline-flex; gap: 6px; align-items: baseline; }
.claim-breakdown dd { font-weight: 670; font-variant-numeric: tabular-nums; }
.claim-paper .signatures { border-top: 1px solid #a6a9b7; }
.claim-paper .signatures > div { display: grid; gap: 10px; }
.claim-paper .signatures span { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; align-items: baseline; border: 0; padding: 0; color: #414457; }
.claim-paper .signatures span::after { content: ''; border-bottom: 1px solid var(--control-line); min-height: 1em; }
.claim-attachment-list { margin-top: 22px; padding-top: 11px; border-top: 1px solid var(--line); font-size: .8rem; overflow-wrap: anywhere; }
.claim-attachment-list h3 { margin-bottom: 4px; }
.claim-attachment-list table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; }
.claim-attachment-list :is(th, td) { border-bottom: 1px solid var(--line); padding: 4px 7px; vertical-align: top; }
.claim-attachment-list th:first-child { width: 10%; }
.claim-attachment-list th:nth-child(2) { width: 19%; }
.claim-attachment-list small { display: block; color: var(--muted); }
.claim-history { margin-top: 18px; }
@media screen and (min-width: 741px) {
  .review-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); }
}
@media screen and (max-width: 740px) {
  .navigation { border-color: var(--line); background: #ffffffed; }
  .dashboard-grid { grid-template-areas: "balance" "sentence" "ledger" "shortcuts" "breakdown"; }
  .workspace-columns { grid-template-columns: minmax(0, 1fr); }
  .claim-entity-field { grid-column: 1 / -1; }
  .workspace-intro .button { min-height: 40px; padding-inline: 10px; }
  .quick-entry .button { padding-inline: 8px; }
  .claim-paper { padding: 12px; }
  .claim-meta { gap: 8px 10px; }
  .claim-meta > div { display: block; }
  .claim-paper-head { grid-template-columns: minmax(0, 1fr); }
  .claim-hero-total { justify-items: start; }
  .claim-table { font-size: .66rem; }
  .claim-table th, .claim-table td { padding: 5px 3px; }
  .claim-col-date { width: 22%; }
  .claim-col-category { width: 13%; }
  .claim-col-money { width: 20%; }
  .claim-col-index { width: 11%; }
  .claim-paper .signatures { gap: 8px; }
  .claim-paper .signatures span { overflow-wrap: anywhere; }
}
@media print {
  body { background: #fff; }
  .claim-paper { padding: 3mm 0 0; border: 0; border-top: 2px solid #3c3f57; border-radius: 0; box-shadow: none; print-color-adjust: exact; }
  .claim-paper-head { break-inside: avoid; padding-bottom: 3mm; }
  .claim-paper-head h2 { font-size: 22pt; }
  .claim-hero-total strong { font-size: 20pt; }
  .claim-meta { break-inside: avoid; margin: 3.5mm 0; gap: 1.15mm 5mm; }
  .claim-meta dt { font-size: 8.6pt; }
  .claim-meta dd { font-size: 9.5pt; }
  .claim-table { font-size: 8.8pt; }
  .claim-table thead, .claim-attachment-list thead { display: table-header-group; }
  .claim-table tr, .claim-paper .signatures, .claim-attachment-list tr { break-inside: avoid; }
  .claim-group-heading, .claim-attachment-list h3 { break-after: avoid; }
  .claim-table th, .claim-table td { padding: 1.5mm; }
  .claim-paper .signatures { margin-top: 3mm; padding-top: 3mm; }
  .claim-paper .signatures > div { gap: 2mm; }
  .claim-attachment-list { margin-top: 3mm; padding-top: 2mm; }
  .claim-attachment-list :is(th, td) { padding: 1mm 1.5mm; }
  .claim-attachment-list small { display: inline; margin-inline-start: 2mm; }
  .claim-attachment-list a, .claim-table a { color: inherit; text-decoration: none; }
}
