:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: #161819;
  background: #fff;
  font-size: 14px;
  line-height: 1.55;
  --ink: #161819;
  --muted: #62676b;
  --quiet: #656e77;
  --border: #e9ebec;
  --soft: #f5f6f6;
  --surface: #fff;
  --positive: #1350ae;
  --negative: #bb2534;
  --sidebar-width: clamp(208px, 18vw, 250px);
  --page-gutter: clamp(24px, 3vw, 48px);
  --page-top: 34px;
  --nav-inset: 14px;
  --panel-gutter: clamp(16px, 1.45vw, 23px);
  --plot-height: 196px;
  --accent: #1753e5;
  --accent-soft: #edf2ff;
  --trend-income: #82aaff;
  --trend-expense: #d2e2fb;
  --trend-net: #1753e5;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: #fff; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
a { color: inherit; }
button { color: inherit; }
h1, h2, h3, p, dl, dd { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.icon { display: block; width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] { display: inline-flex; flex: none; }
.skip-link { position: fixed; top: 8px; left: 8px; padding: 10px 16px; transform: translateY(-150%); z-index: 5; background: #fff; border: 1px solid var(--ink); }
.skip-link:focus { transform: translateY(0); }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: var(--page-top) 12px 22px; border-right: 1px solid var(--border); }
.workspace-brand { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 9px; padding-inline: var(--nav-inset); min-height: 49px; }
.workspace-brand img { object-fit: contain; }
.brand-text { display: grid; line-height: 1.4; }
.brand-text strong { font-size: 19px; font-weight: 670; letter-spacing: .01em; }
.brand-text span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.workspace-nav { display: grid; gap: 5px; margin-top: 32px; }
.workspace-nav a, .sidebar-logout { display: flex; align-items: center; gap: 11px; min-height: 45px; padding: 0 var(--nav-inset); background: transparent; border: 0; border-radius: 8px; text-decoration: none; text-align: left; color: var(--muted); font-size: 14px; font-weight: 500; }
.workspace-nav a:hover, .sidebar-logout:hover { color: var(--ink); background: var(--soft); }
.workspace-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
.sidebar-bottom { margin-top: auto; }
.sidebar-logout { width: 100%; }
.workspace-main { min-width: 0; }
.topbar { display: none; gap: 16px; align-items: center; justify-content: space-between; min-height: 52px; padding-inline: var(--page-gutter); }
.company-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.company-brand img { flex: none; }
.company-name { font-size: 13px; font-weight: 570; line-height: 1.45; }
.mobile-logout { display: none !important; }
.content { max-width: 1700px; padding: var(--page-top) var(--page-gutter) 52px; margin-inline: auto; }
.content:focus { outline: none; }
.page-header { display: flex; align-items: center; justify-content: space-between; column-gap: 24px; row-gap: 14px; margin-bottom: 40px; }
.page-header h1 { flex: none; }
h1 { font-size: clamp(27px, 3vw, 38px); line-height: 1.2; font-weight: 680; letter-spacing: -.035em; }
.page-subtitle { font-size: 13px; margin-top: 9px; color: var(--muted); }
h2 { font-size: 19px; font-weight: 650; line-height: 1.35; letter-spacing: -.015em; }
h3 { font-size: 14px; font-weight: 640; }
.actions { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 9px; }
.actions-end { justify-content: flex-end; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; border: 1px solid #dde2e5; background: #fff; color: var(--ink); border-radius: 8px; padding: 7px 12px; white-space: nowrap; font-size: 13px; font-weight: 560; text-decoration: none; }
.button:hover { background: var(--soft); }
.button:disabled { cursor: wait; opacity: .60; }
.button-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button-primary:hover { color: #fff; background: #1146c5; }
.button-quiet { border-color: transparent; color: var(--muted); }
.button-icon { padding: 7px; min-width: 38px; }
.button-text { min-height: 34px; padding: 4px 0; border: 0; background: transparent; color: var(--muted); }
.button-text:hover { background: transparent; color: var(--ink); }
.currency { color: var(--muted); font-size: 12px; white-space: nowrap; margin-right: 2px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 30px; }
.metric { display: grid; align-content: start; min-width: 0; }
.metric-label { font-size: 15px; font-weight: 620; }
.metric-value { margin-top: 7px; font-size: clamp(19px, 2.3vw, 32px); line-height: 1.16; font-weight: 670; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.035em; overflow-wrap: anywhere; }
.metric-caption { margin-top: 6px; font-size: 12px; color: var(--muted); }
@supports (grid-template-rows: subgrid) {
  .metrics { row-gap: 0; }
  .metric { grid-row: span 3; grid-template-rows: subgrid; }
}
.amount-positive { color: var(--positive); }
.amount-negative { color: var(--negative); }

.chart-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(265px, 1fr); gap: 16px; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 12px; }
.chart-panel { display: grid; grid-template-rows: auto 1fr; min-height: 321px; padding: var(--panel-gutter); }
.panel-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 13px; }
.panel-description { margin-top: 5px; color: var(--muted); font-size: 12px; }
.chart-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.chart-legend span, .breakdown-label { display: inline-flex; align-items: center; gap: 6px; }
.series-dot { width: 8px; height: 8px; display: inline-block; flex: none; border-radius: 50%; background: var(--series, #4c6058); }
.chart-empty { min-height: calc(var(--plot-height) + 36px); display: grid; place-content: center; text-align: center; color: var(--muted); font-size: 13px; }
.chart-empty p { background: #fff; padding: 5px 12px; }
.line-chart { display: grid; grid-template-columns: max-content minmax(0, 1fr); grid-template-rows: var(--plot-height) auto; align-self: center; column-gap: 11px; row-gap: 9px; margin-top: 20px; font-variant-numeric: tabular-nums; color: var(--quiet); font-size: 10px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; margin-block: -.5em; line-height: 1; grid-row: 1; grid-column: 1; }
.chart-plot { height: 100%; width: 100%; overflow: visible; grid-column: 2; grid-row: 1; }
.chart-plot .gridline { stroke: var(--border); stroke-width: 1; }
.chart-plot polyline { fill: none; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-x { display: flex; justify-content: stretch; grid-column: 2; text-align: center; white-space: nowrap; }
.case-summary { min-height: calc(var(--plot-height) + 22px); display: grid; align-items: center; justify-items: center; grid-template-columns: minmax(108px, 1fr) minmax(115px, 1fr); gap: 15px; margin-top: 17px; }
.breakdown-chart { width: min(100%, 210px); height: auto; overflow: visible; }
.breakdown-chart .ring-base { stroke: #eff1f1; stroke-width: 13; fill: none; }
.breakdown-chart .ring-segment { stroke-width: 13; fill: none; }
.breakdown-chart text { fill: var(--muted); font: 11px -apple-system, system-ui, sans-serif; text-anchor: middle; }
.breakdown-chart .ring-count { fill: var(--ink); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.breakdown-list { width: 100%; min-width: 0; display: grid; max-height: calc(var(--plot-height) + 8px); overflow-y: auto; gap: 8px; align-self: center; color: var(--muted); font-size: 12px; }
.breakdown-row { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: baseline; gap: 8px; }
.breakdown-row dd { font-variant-numeric: tabular-nums; }
.breakdown-label { min-width: 0; }
.breakdown-label span { overflow-wrap: anywhere; }

.records-section { margin-top: 28px; }
.records-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 11px; }
.records-section table { table-layout: fixed; }
.records-section :is(th, td):first-child { width: 17%; }
.records-section :is(th, td):nth-child(3) { width: 15%; }
.records-section :is(th, td):last-child { width: 25%; }
.records-section td.money { overflow-wrap: anywhere; white-space: normal; }

.table-panel { min-width: 0; overflow: hidden; border-radius: 8px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th { background: #f3f5f6; font-size: 12px; font-weight: 600; color: #555c5f; }
th, td { padding: 11px var(--panel-gutter); vertical-align: top; }
tbody tr:hover { background: #f4f6f6; }
td.money, th.money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr .cell-note { color: var(--muted); }
.cell-title { min-width: 120px; max-width: 360px; overflow-wrap: anywhere; }
.cell-date, .cell-actions { white-space: nowrap; }
.cell-type { max-width: 11rem; overflow-wrap: anywhere; }
.record-table :is(.cell-actions, th:last-child) { text-align: right; }
.record-table .cell-actions .button { position: relative; min-height: auto; padding: 0; line-height: inherit; }
.record-table .cell-actions .button::before { content: ""; position: absolute; inset: -6px; }
.cell-date { font-variant-numeric: tabular-nums; }
.cell-note { display: block; margin-top: 3px; font-size: 12px; }
.cell-files { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 95px; }
.file-link { display: inline-flex; gap: 5px; align-items: center; max-width: 210px; color: #4a5353; text-underline-offset: 3px; }
.file-link:hover { color: var(--ink); }
.file-link span:last-child { min-width: 0; overflow-wrap: anywhere; }
.empty { display: grid; place-items: center; text-align: center; gap: 9px; padding: 38px 20px; min-height: 170px; color: var(--muted); }
.empty > .icon { color: var(--quiet); }
.empty strong { font-size: 14px; color: var(--ink); font-weight: 600; }
.empty p { font-size: 12px; }
.empty-inline { min-height: 96px; padding: 22px 18px; gap: 4px; }
.list-summary { display: flex; flex-wrap: wrap; gap: 9px 22px; margin: 0 0 15px; color: var(--muted); font-size: 13px; }
.list-summary div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.list-summary dd { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.list-summary dd.amount-negative { color: var(--negative); }

.auth { display: grid; min-height: 100dvh; place-items: center; padding: clamp(18px, 5vw, 44px); }
.auth-panel {
  width: min(100%, 468px);
  padding: clamp(22px, 4.5vw, 41px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 570; line-height: 1.45; font-size: 13px; margin-bottom: 24px; }
.auth-brand img { flex: none; object-fit: contain; }
.auth-panel h1 { font-size: clamp(29px, 4.7vw, 37px); }
.auth-panel > p { margin-top: 9px; }
.auth-panel > p:not(.form-error) { color: var(--muted); }
.auth-panel form { margin-top: 24px; }
.auth-method { display: grid; gap: 11px; }
.auth-panel .button-primary { justify-content: space-between; min-height: 46px; padding-inline: 13px; }
.auth-provider { width: 100%; }
.auth-panel .field input { min-height: 44px; }
.account-link { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 24px var(--page-gutter) 0; padding: 13px 16px; border-radius: 10px; background: var(--accent-soft); }
.account-link h2 { font-size: 15px; }
.account-link p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.stack-form { display: grid; gap: 15px; min-width: 0; }
.field { display: grid; align-content: start; gap: 5px; min-width: 0; font-size: 13px; font-weight: 570; }
.field small, .form-help { font-size: 12px; font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea { min-width: 0; width: 100%; min-height: 41px; padding: 8px 10px; border: 1px solid #dce0e1; border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 450; }
.field input[type="file"] { padding: 6px 7px; }
.field input::file-selector-button { font: inherit; padding: 3px 8px; margin-right: 8px; border: 0; border-radius: 4px; background: #eef0f0; color: var(--ink); cursor: pointer; }
.field textarea { resize: vertical; min-height: 74px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 14px; }
.form-wide { grid-column: 1 / -1; }
.form-error { color: var(--negative); font-weight: 510; font-size: 13px; }
.result-warning { color: var(--negative); margin-top: 12px; font-size: 12px; }
.form-footer { justify-content: flex-end; margin-top: 4px; }
.import-preview { min-width: 0; }
.import-result { display: grid; gap: 10px; }
.import-result .table-scroll { border: 1px solid var(--border); border-radius: 8px; max-height: 235px; }
.import-issues { max-height: 130px; overflow: auto; margin: 0; padding-left: 20px; }
.import-issues li { margin-bottom: 4px; font-size: 12px; }

dialog { width: min(calc(100% - 28px), 560px); max-height: calc(100dvh - 28px); padding: 0; color: var(--ink); background: #fff; border: 1px solid #e1e4e4; border-radius: 14px; box-shadow: 0 14px 54px #16181926; }
dialog[data-wide] { width: min(calc(100% - 28px), 700px); }
dialog::backdrop { background: #14181944; }
.modal-content { padding: 22px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 17px; }
.modal-header h2 { font-size: 20px; }
.modal-header .button { border-color: transparent; }
.attachment-list { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
.notification { position: fixed; right: 18px; bottom: 16px; background: #1b2020; color: #fff; padding: 9px 14px; border-radius: 8px; box-shadow: 0 3px 18px #16181915; max-width: calc(100% - 36px); z-index: 2; }
.notification:empty { display: none; }
.startup-state { position: fixed; inset: 0; place-content: center; display: grid; background: #fff; color: var(--muted); }
.period-date { display: inline-flex; }
.period-options { display: flex; flex-wrap: wrap; gap: 7px; }
.period-options .button[aria-pressed="true"] { border-color: var(--ink); }
.count-quiet { color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  :root { --sidebar-width: 184px; --nav-inset: 12px; }
  .brand-text span { font-size: 11px; }
  .case-summary { grid-template-columns: minmax(88px, .9fr) minmax(108px, 1.1fr); }
}

@media (max-width: 860px) {
  :root { --plot-height: 184px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 15px; }
  @supports (grid-template-rows: subgrid) {
    .metrics { row-gap: 0; }
    .metric:nth-child(-n + 2) .metric-caption { padding-bottom: 17px; }
  }
  .chart-grid { grid-template-columns: 1fr; gap: 12px; }
  .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 26px; }
  .chart-panel { min-height: 245px; }
  .metric-label { font-size: 13px; }
  h2 { font-size: 17px; }
  .breakdown-list, .chart-legend { font-size: 11px; }
  .case-summary { grid-template-columns: minmax(110px, 145px) minmax(115px, 240px); justify-content: center; min-height: 160px; }
  .chart-empty { min-height: calc(var(--plot-height) + 12px); }
}

@media (max-width: 640px) {
  :root { --page-gutter: 16px; --panel-gutter: 15px; --plot-height: 172px; }
  .app-shell { display: flex; flex-direction: column; }
  .sidebar { position: sticky; top: 0; z-index: 1; height: auto; padding: 5px var(--page-gutter) 8px; border: 0; border-bottom: 1px solid var(--border); flex-direction: row; background: #fff; }
  .workspace-brand, .sidebar-bottom { display: none; }
  .workspace-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; margin: 0; }
  .workspace-nav a { min-width: 0; min-height: 43px; gap: 3px; justify-content: center; padding: 6px 2px; flex-direction: column; white-space: nowrap; font-size: 11px; }
  .topbar { display: flex; gap: 8px; }
  .company-name { font-size: 11px; }
  .mobile-logout { display: inline-flex !important; min-height: 40px; min-width: 40px; margin-inline-end: -6px; border: 0; }
  .content { width: 100%; padding-block: 23px 36px; scroll-margin-block-start: 62px; }
  .page-header { display: grid; margin-bottom: 20px; row-gap: 13px; }
  .page-subtitle { margin-top: 7px; }
  .metric-value { font-size: clamp(18px, 5.4vw, 25px); }
  .metric-label { font-size: 12px; gap: 6px; }
  .metric-caption { font-size: 10px; margin-top: 5px; }
  .chart-panel { min-height: 250px; }
  th, td { padding: 10px 12px; }
  .cell-title { max-width: 190px; }
  .notification { right: 13px; bottom: max(13px, env(safe-area-inset-bottom)); }
  .modal-content { padding: 15px; }
}

@media (max-width: 380px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .breakdown-list { font-size: 10px; }
  :root { --panel-gutter: 12px; }
}

.chart-legend .series-dot { width: 13px; height: 7px; border-radius: 2px; }
.chart-legend .series-net { position: relative; height: 2px; }
.chart-legend .series-net::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 6px; height: 6px; border: 1px solid var(--series); border-radius: 50%; background: #fff; transform: translate(-50%, -50%); }
.series-income { --series: var(--trend-income); }
.series-expense { --series: var(--trend-expense); }
.series-net { --series: var(--trend-net); }
.series-0 { --series: #1753e5; }
.series-1 { --series: #77a2f5; }
.series-2 { --series: #51729e; }
.series-3 { --series: #a3b7d4; }
.series-4 { --series: #3c5a83; }
.series-5 { --series: #cad9ef; }
.bar-income { fill: var(--trend-income); }
.bar-expense { fill: var(--trend-expense); }
.line-net { stroke: var(--trend-net); }
.ring-segment { stroke: var(--series); }
.breakdown-row .cell-note { margin: 1px 0 0 14px; font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-plot .zero-line { stroke: #b8c1ca; stroke-width: 1; }
.chart-x span { flex: 1; min-width: 0; }
.chart-x time { display: inline-block; }
.chart-x .tick-minimal { visibility: hidden; }
.table-caption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.record-filters { margin-bottom: 15px; }
.record-toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); align-items: end; gap: 11px 12px; }
.record-toolbar .field :is(input, select), .record-date .button { min-height: 41px; }
.record-date .button { justify-content: flex-start; text-align: left; }
.record-date .date-label { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.record-filter-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 5px; }
.record-filter-meta .button:disabled { visibility: hidden; }
.record-pagination { justify-content: flex-end; margin-top: 15px; }
.record-pagination .button:disabled { cursor: default; }
.record-pagination span { text-align: center; min-width: 65px; }
.page-header .button[data-action="export"]:disabled:not([aria-busy="true"]) { cursor: default; }
.kind-choice { flex: 1 1 120px; min-height: 58px; }
.record-delete { color: var(--negative); margin-right: auto; }
.check-option { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.check-option input { width: 15px; height: 15px; min-height: 15px; flex: none; }
.import-result .amount-negative { color: var(--negative); }
.import-instructions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.import-warning { color: var(--negative); }
.startup-state { justify-items: center; gap: 10px; }
.button .icon, .file-link .icon { color: currentColor; }
.date-label { white-space: nowrap; }

@media (max-width: 1060px) {
  .date-label:not(.custom-date) .date-dates { display: none; }
}
@media (max-width: 640px) {
  .chart-x time { font-size: 9px; }
}
@media (max-width: 430px) {
  .chart-x .tick-mobile { visibility: hidden; }
}

.order-trend { margin-bottom: 24px; }

@media (max-width: 640px) {
  .button:has(.custom-date) { max-width: 100%; text-align: left; }
  .custom-date { white-space: normal; }
  .records-section :is(th, td) { min-width: 0; max-width: none; padding-inline: 5px; font-size: 11px; }
  .records-section :is(th, td):first-child { width: 23%; padding-left: 8px; }
  .records-section :is(th, td):nth-child(3) { width: 12%; }
  .records-section :is(th, td):last-child { width: 30%; padding-right: 8px; overflow-wrap: anywhere; white-space: normal; }
}

@media (min-width: 381px) and (max-width: 640px) {
  .records-section :is(th, td):first-child { width: 25%; padding-left: var(--panel-gutter); }
  .records-section :is(th, td):last-child { padding-right: var(--panel-gutter); }
}

@media (max-width: 640px) {
  .page-header .currency { flex-basis: 100%; }
  .record-table, .record-table tbody { display: block; }
  .record-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .record-table tr {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px 11px;
    margin-bottom: 8px;
    padding: 11px 13px;
    border-radius: 8px;
    background: #f6f7f7;
  }
  .record-table td, .record-table td.money {
    grid-column: span 3;
    min-width: 0;
    max-width: none;
    padding: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .record-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
  }
  .record-table td.cell-title { grid-column: 1 / -1; grid-row: 1; font-size: 14px; font-weight: 630; }
  .record-table .cell-title .cell-note { font-weight: 400; }
  .record-table [data-kind="order"] td.money { grid-column: span 2; }
  .record-table td.file-cell { grid-column: span 4; }
  .record-table td.cell-actions { grid-column: span 2; justify-self: end; align-self: end; }
  .record-table .cell-actions .button { padding-inline: 7px; min-height: 34px; }
  .record-table .cell-files { min-width: 0; }
}

.invoice-tools {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.invoice-read-actions { display: flex; justify-content: flex-start; }
.invoice-read-actions:has(> button[hidden]), .invoice-message:empty, .invoice-result:empty { display: none; }
.invoice-message { font-size: 12px; color: var(--muted); }
.invoice-message[data-error] { color: var(--negative); }
.invoice-result { display: grid; gap: 11px; }
.invoice-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; }
.invoice-details div { min-width: 0; }
.invoice-details div:first-child { grid-column: 1 / -1; }
.invoice-details div:last-child dd { font-weight: 650; }
.invoice-details dt { color: var(--muted); font-size: 11px; }
.invoice-details dd { font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.invoice-prefill { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
