:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #172942;
  background: #f2f5fb;
  --blue: #2459d4;
  --muted: #596b83;
  --border: #dce4ef;
}
* { box-sizing: border-box; }
body { --nav-height: 0px; --top-height: 48px; margin: 0; display: grid; grid-template-columns: 234px minmax(0, 1fr); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #83a8ff; outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.sidebar { position: sticky; top: 0; z-index: 5; align-self: start; display: flex; flex-direction: column; min-height: 100dvh; padding: 28px 18px 20px; background: #142541; color: white; }
.brand, .sidebar-foot { display: flex; align-items: center; gap: 12px; }
.brand { padding: 0 5px 35px; }
.brand strong { font-size: 17px; }
.brand small, .sidebar-foot small { display: block; margin-top: 4px; color: #bdcae0; font-size: 12px; }
.logo, .avatar { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 11px; background: #3469eb; font-size: 21px; }
.avatar { background: #354967; font-size: 15px; }
nav { display: grid; gap: 8px; }
.nav { text-align: left; background: transparent; color: #d7e1f2; border: 0; padding: 12px; border-radius: 8px; }
.nav span { display: inline-block; width: 23px; }
.nav.active, .nav:hover { background: #273c61; color: white; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #354664; padding: 16px 4px 0; }
.top { position: sticky; top: var(--nav-height); z-index: 4; display: flex; gap: 6px; align-items: center; justify-content: space-between; height: var(--top-height); background: white; border-bottom: 1px solid var(--border); padding: 0 34px; font-size: 14px; }
.slash { color: #8292a7; margin: 0 7px; }
.demo { border-radius: 20px; padding: 5px 12px; background: #edf2fb; color: #345582; font-size: 13px; }
.workspace { max-width: 1480px; margin: auto; padding: 36px 34px; }
.hero { display: flex; gap: 16px; justify-content: space-between; align-items: center; }
h1 { font-size: 32px; letter-spacing: -.03em; }
.hero p, .dialog-head p { color: var(--muted); margin-top: 7px; }
.primary, .secondary { border: 1px solid transparent; border-radius: 8px; padding: 9px 14px; white-space: nowrap; }
.primary { background: var(--blue); color: white; font-weight: 600; }
.primary:hover { background: #1949b6; }
.primary:disabled { opacity: .55; cursor: wait; }
.secondary { background: white; border-color: var(--border); color: #263b59; }
.secondary:hover { background: #edf3ff; }
.metrics { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 15px; margin: 24px 0; }
.metric { padding: 19px 22px; display: grid; gap: 8px; border-radius: 12px; border: 1px solid var(--border); background: white; }
.metric strong { font-size: 32px; font-variant-numeric: tabular-nums; }
.metric span { font-size: 14px; font-weight: 650; }
.metric small, .muted, .footnote { color: var(--muted); font-size: 13px; }
.metric.total { background: #2152bc; border-color: #2152bc; color: white; }
.total small { color: #e3ecff; }
.panel { background: white; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.ledger-panel-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 12px; }
.ledger-view-switch { display: inline-flex; padding: 3px; gap: 3px; border-radius: 8px; border: 1px solid var(--border); background: #f3f6fc; }
.ledger-view-switch button { border: 0; padding: 6px 10px; border-radius: 5px; background: transparent; color: #485d7a; font-size: 13px; white-space: nowrap; }
.ledger-view-switch button[aria-pressed="true"] { background: #2459d4; color: white; font-weight: 650; }
.ledger-pictures { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 22px 20px; border-top: 1px solid #e7edf5; background: #f7f9fd; }
.ledger-pictures-empty { grid-column: 1 / -1; }
.ledger-picture-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: stretch; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: white; }
.ledger-picture-info { display: grid; align-content: start; gap: 8px; min-width: 0; }
.ledger-picture-headline { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.ledger-picture-amount { font-size: clamp(17px, 2vw, 24px); font-variant-numeric: tabular-nums; color: #152f58; }
.ledger-picture-note { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.ledger-picture-fields { margin: 0; gap: 4px 8px; font-size: 13px; }
.ledger-picture-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; font-size: 13px; }
.ledger-picture-preview { position: relative; display: grid; place-items: center; width: 100%; min-width: 0; height: clamp(155px, 23vh, 212px); overflow: hidden; padding: 5px; border: 1px solid #dce4ef; border-radius: 7px; background: #f7f9fc; }
button.ledger-picture-preview { cursor: zoom-in; }
button.ledger-picture-preview:hover { border-color: #2459d4; }
.ledger-picture-preview img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.ledger-picture-zoom { position: absolute; right: 5px; bottom: 5px; padding: 2px 5px; border-radius: 4px; background: #17365e; color: white; font-size: 11px; }
.ledger-picture-placeholder { color: var(--muted); font-size: 13px; }
#upload-groups { display: grid; gap: 10px; }
.uploads-empty { padding: 18px; color: var(--muted); }
.upload-group { position: relative; container-type: inline-size; }
.upload-group-details > summary { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 68px; padding: 14px 18px; cursor: pointer; list-style: none; }
.upload-group-details > summary::-webkit-details-marker { display: none; }
.upload-group-details > summary::before { content: "▸"; color: #2459b6; }
.upload-group-details[open] > summary::before { content: "▾"; }
.upload-group-details > summary:hover { background: #f6f8fc; }
.upload-group-removable summary { padding-right: 120px; }
.upload-group-remove { position: absolute; top: 15px; right: 18px; padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.upload-group-info { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.upload-group-total, .upload-line-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.upload-lines { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; margin: 0; border-top: 1px solid var(--border); list-style: none; }
@container (min-width: 720px) {
  .upload-lines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.upload-line-field { display: grid; align-content: start; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.upload-line-field > small { font-weight: 650; }
.upload-line-note { min-height: 44px; padding: 6px 8px; margin: 0; border: 1px solid var(--border); border-radius: 7px; background: white; font-size: 14px; }
.upload-line-remove { align-self: center; padding: 6px 10px; font-size: 13px; }
.upload-line-date { overflow-wrap: anywhere; }
@media (min-width: 1150px) {
  .ledger-pictures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
h2 { font-size: 20px; }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; padding: 16px 22px; }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 600; min-width: 0; }
input, select { width: 100%; min-width: 0; min-height: 39px; border: 1px solid #cbd7e7; border-radius: 7px; background: white; color: #182d49; padding: 7px 9px; font-weight: 400; }
select { appearance: none; padding-right: 25px; background: linear-gradient(45deg, transparent 50%, #566b87 50%) right 14px center / 5px 5px no-repeat, linear-gradient(135deg, #566b87 50%, transparent 50%) right 9px center / 5px 5px no-repeat white; }
.filter-actions { display: flex; gap: 7px; }
.subtotals { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 22px 15px; }
.subtotals:empty { display: none; }
.chip { display: inline-block; border-radius: 6px; background: #edf3ff; color: #254c8e; padding: 4px 8px; font-size: 13px; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-top: 1px solid #e7edf5; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
th { background: #f3f6fc; color: #4b5f79; font-weight: 650; }
td.amount { font-weight: 650; font-variant-numeric: tabular-nums; }
.amount { text-align: right; }
tbody tr:hover { background: #f8faff; }
.table-link { background: transparent; border: 0; color: #1d52c5; padding: 5px 0; font-weight: 600; }
.table-link:hover { text-decoration: underline; }
.ledger-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
.ledger-row-actions button { white-space: nowrap; }
#line-edit-dialog { width: min(520px, calc(100% - 24px)); }
.line-edit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.line-edit-wide { grid-column: 1 / -1; }
.line-edit-fields textarea { width: 100%; resize: vertical; font: inherit; color: inherit; border: 1px solid #cbd7e7; border-radius: 7px; padding: 8px; }
.empty { text-align: center; color: var(--muted); padding: 32px; }
.footnote { margin-top: 14px; }
dialog { width: min(740px, calc(100% - 24px)); max-height: 90vh; padding: 0; border: 1px solid var(--border); border-radius: 14px; color: inherit; box-shadow: 0 15px 60px #0c1e4350; }
dialog::backdrop { background: #11213f90; }
.dialog-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 22px; background: white; }
.dialog-head { position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--border); }
.dialog-actions { position: sticky; bottom: 0; justify-content: flex-end; border-top: 1px solid var(--border); }
.dialog-actions:has(> #edit-bill[hidden]) { display: none; }
.dialog-body { padding: 19px 22px; }
#editor { padding-block: 14px; }
#expense { background: white; border: 1px solid var(--border); border-radius: 12px; }
.expense-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 9px 16px; }
.expense-heading h1 { font-size: 24px; }
.expense-heading .host-tools { margin: 0; }
.expense-heading .host-tools button { min-height: 30px; padding: 4px 9px; font-size: 13px; }
.expense-fixed { position: sticky; top: calc(var(--nav-height) + var(--top-height)); z-index: 2; padding: 6px 16px; border-block: 1px solid var(--border); background: white; }
.expense-fixed label { grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 6px; }
.expense-fixed input, .expense-fixed select { min-height: 34px; padding-block: 4px; }
#expense .dialog-actions { position: static; border-radius: 0 0 12px 12px; }
.expense-details { container-type: inline-size; padding-block: 10px 16px; }
.expense-details .line-head { margin-top: 6px; }
.expense-details .host-inline { margin: 0 0 8px; }
.close { border: 0; border-radius: 7px; width: 36px; height: 36px; color: #3f516d; background: #f0f4fa; font-size: 23px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.line-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.host-tools, .host-inline { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 10px; }
.host-inline label { flex: 1 1 160px; }
.host-inline p { flex: 1 1 240px; align-self: center; }
.danger { color: #a71924; border-color: #efc1c4; }
#lines { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 10px; }
@container (min-width: 720px) {
  #lines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#lines > .line:only-child { grid-column: 1 / -1; }
.line {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) auto; align-content: start;
  gap: 8px; padding: 10px; min-width: 0; background: #f4f7fc; border: 1px solid #e0e8f4; border-radius: 8px;
}
.line label { gap: 4px; font-size: 13px; }
.line [name=note] { width: 100%; min-width: 0; resize: vertical; border: 1px solid #cbd7e7; border-radius: 7px; background: white; color: #182d49; padding: 5px 8px; line-height: 1.35; font-size: 14px; }
.line [name=amount] { font-variant-numeric: tabular-nums; font-weight: 650; }
.line .wide { grid-column: 1 / -1; }
.receipt-drop {
  position: relative; display: grid; place-content: center; justify-items: center; gap: 6px;
  width: 100%; min-height: 108px; padding: 15px; border: 1px dashed #95acd6;
  border-radius: 8px; background: #fff; text-align: center; overflow-wrap: anywhere;
}
.receipt-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.receipt-drop:hover, .receipt-drop:focus-within, .receipt-drop.is-dragging { border-color: #2455cc; background: #edf3ff; }
.receipt-drop:focus-within { outline: 2px solid #2455cc; outline-offset: 2px; }
.receipt-drop strong { color: #1d52c5; }
.receipt-drop small { max-width: 100%; font-weight: normal; }
.receipt-drop small.mismatch { color: #a71924; }
.receipt-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.line.has-recognized-proof:not(.show-proof-upload) .proof-field,
.line.has-recognized-proof:not(.show-proof-upload) .receipt-recognize,
.line.has-recognized-proof:not(.show-proof-upload) .receipt-help { display: none; }
.receipt-preview-actions { display: grid; justify-items: start; gap: 5px; }
.receipt-proof-role { color: #344f73; font-size: 13px; }
.stored-proof-actions { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.receipt-open, .receipt-replace { border: 0; background: none; padding: 3px 0; color: #1d52c5; font-size: 14px; text-decoration: underline; text-align: left; }
.receipt-result, .receipt-preview { width: 100%; overflow-wrap: anywhere; }
.receipt-result { color: #305989; font-size: 14px; }
.receipt-result.mismatch { color: #a71924; }
.original-receipt { color: #1d52c5; font-size: 14px; }
.receipt-preview { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.receipt-thumbnail { display: grid; place-items: center; width: 100%; height: clamp(156px, 22vh, 218px); overflow: hidden; padding: 5px; cursor: zoom-in; background: white; border: 1px solid #d5dfed; border-radius: 7px; }
.receipt-thumbnail:hover { border-color: #2459d4; }
.receipt-thumbnail img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.original-receipt { display: inline-block; margin-top: 12px; }
.use-total { margin-top: 8px; }
#import-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 5px 0 0; padding: 4px 8px; }
.import-meta { font-size: 13px; }
.import-counts { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.import-count { padding: 3px 6px; border: 0; border-radius: 4px; background: #fff; color: #254877; font: inherit; font-size: 14px; }
button.import-count { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.import-count.ok { color: #17603f; }
.import-count.review { color: #863c06; background: #fff3de; }
.import-count.missing { color: #a51f2d; background: #fff0f1; }
.import-count strong { font-weight: 750; }
.import-count-label { align-self: center; color: var(--muted); font-size: 13px; }
.line.import-missing [name=amount], .line.import-review [name=amount] { background: #fff0f1; border-color: #ca6570; color: #972634; font-weight: 750; }
.line.import-missing [name=amount]::placeholder { color: #972634; opacity: 1; }
.line.import-review [name=amount] { background: #fff3de; border-color: #c68847; color: #863c06; }
.skipped-receipt { margin: 8px 0; padding: 10px 12px; border: 1px solid #edb4bc; border-radius: 8px; background: #fff0f1; color: #a51f2d; }
.skipped-receipt .receipt-open { display: block; margin-top: 4px; }
.import-spotlight { outline: 2px solid #9a500e; outline-offset: -2px; }
.line .remove { align-self: end; min-height: 36px; padding: 4px 8px; font-size: 13px; }
.balance { margin-top: 14px; padding: 11px 12px; border-radius: 7px; background: #eff4fc; }
.balance.match { background: #e6f6ed; color: #155c39; }
.error, .balance.mismatch { background: #fff0f0; color: #a71924; }
.inline { margin: 10px 0 0; padding: 9px 12px; border-radius: 7px; }
#filter-error { margin: 0 22px 12px; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 16px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
#proof img { display: block; max-width: 100%; max-height: 65vh; object-fit: contain; margin: auto; }
html:has(#receipt-viewer[open]) { overflow: hidden; scrollbar-gutter: stable; }
#receipt-viewer { width: min(1120px, calc(100% - 24px)); max-height: 92dvh; overflow: hidden; background: white; }
#receipt-viewer[open] { display: flex; flex-direction: column; }
.receipt-viewer-head { display: flex; flex: none; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.receipt-viewer-head h2 { font-size: 18px; }
#receipt-viewer-source { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.receipt-viewer-actions { display: flex; align-items: center; gap: 6px; }
.receipt-viewer-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 10px; background: #f2f5fb; }
#receipt-viewer-image { display: block; max-width: 100%; max-height: 76dvh; margin: auto; object-fit: contain; }
#receipt-viewer.zoomed #receipt-viewer-image { width: 100%; max-height: none; height: auto; }
.sample-proof { background: #f4f6fb; border: 1px dashed #8799b5; border-radius: 8px; text-align: center; padding: 30px 12px; }
.sample-proof strong { display: block; margin: 12px 0; font-size: 26px; }
#toast { position: fixed; bottom: 20px; right: 20px; background: #164632; color: white; padding: 11px 16px; border-radius: 8px; z-index: 2; }
.board-controls { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.board-controls button[aria-pressed="true"] { background: #edf3ff; color: #1949b6; border-color: #a9bff5; }
.board-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 15px; margin-top: 15px; align-items: start; }
.trend-scroll { overflow-x: auto; margin: 17px 22px 14px; }
.trend {
  display: grid;
  grid-template-columns: repeat(var(--columns, 1), minmax(var(--column-width, 22px), 1fr));
  gap: 3px;
  background: repeating-linear-gradient(to top, #e7edf5 0 1px, transparent 1px 28px) 0 0 / 100% 112px no-repeat;
}
.trend-column { border: 0; background: transparent; padding: 0 2px; display: grid; gap: 6px; min-width: 0; color: var(--muted); }
.trend-plot { height: 112px; display: flex; align-items: end; justify-content: center; border-bottom: 1px solid #cbd7e7; }
.trend-bar { display: block; width: min(68%, 35px); min-height: 2px; border-radius: 5px 5px 0 0; background: #3c6ee4; }
.trend-column:hover .trend-bar, .trend-column:focus-visible .trend-bar { background: #1745ac; }
.trend-label { font-size: 13px; text-align: center; white-space: nowrap; }
.breakdown { display: grid; padding: 8px 14px 12px; }
.breakdown-row {
  border: 0; border-bottom: 1px solid #edf1f7; background: white; color: inherit; text-align: left;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 9px 8px;
}
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-row:hover, .breakdown-row:focus-visible { background: #f3f7ff; border-radius: 6px; }
.breakdown-label { display: flex; gap: 7px; align-items: center; }
.breakdown-amount, .breakdown-meta { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.breakdown-meta { font-size: 13px; color: var(--muted); }
.share-track { display: block; height: 6px; border-radius: 9px; background: #ebf0f8; overflow: hidden; }
.share-fill { display: block; height: 100%; background: #4e79df; border-radius: inherit; }
#board-ranking .share-fill { background: #2b8b7a; }
.rank { display: inline-grid; place-items: center; min-width: 21px; height: 21px; border-radius: 5px; color: #2d528e; background: #eaf1fe; font-size: 13px; }
@media (max-width: 1060px) {
  body { grid-template-columns: 175px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand { gap: 7px; }
  .brand strong { font-size: 15px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { --nav-height: 46px; --top-height: 41px; display: block; }
  .sidebar { min-height: 0; height: var(--nav-height); padding: 3px 8px; justify-content: center; }
  .brand { display: none; }
  .sidebar-foot { display: none; }
  nav { display: flex; gap: 2px; justify-content: space-between; }
  .sidebar .nav { min-height: 38px; padding: 5px 3px; font-size: 12px; white-space: nowrap; }
  .sidebar .nav span { display: none; }
  .upload-group-details > summary { grid-template-columns: 14px minmax(0, 1fr); gap: 4px 6px; padding: 10px; }
  .upload-group-removable summary { padding-right: 94px; }
  .upload-group-remove { top: 12px; right: 10px; padding-inline: 8px; }
  .upload-group-total { grid-column: 2; font-size: 13px; }
  .upload-lines { padding: 8px; }
  .upload-line-preview { grid-template-columns: minmax(0, 1fr); }
  .upload-line-preview .receipt-preview-actions { display: flex; flex-wrap: wrap; gap: 5px 12px; }
  .top { padding-inline: 8px; font-size: 12px; }
  .top .session-actions { flex-wrap: nowrap; min-width: 0; gap: 4px; }
  .top #session-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top .demo { padding: 3px 5px; white-space: nowrap; font-size: 11px; }
  .top #logout { padding: 4px 6px; }
  .workspace { padding: 19px 12px; }
  #editor { padding-block: 10px; }
  .hero { align-items: flex-start; }
  h1 { font-size: 25px; }
  .hero p { font-size: 14px; }
  .metrics { gap: 6px; margin: 16px 0; }
  .metric { padding: 9px; gap: 4px; }
  .metric strong { font-size: clamp(14px, 4.4vw, 24px); }
  .metric small { display: none; }
  .panel-head, .filters, .subtotals { padding-inline: 12px; }
  #ledger .panel-head { gap: 6px; }
  .ledger-panel-tools { gap: 5px 7px; }
  .ledger-view-switch button { min-height: 32px; padding: 4px 6px; }
  .ledger-pictures { padding-inline: 8px; }
  .ledger-picture-card { gap: 7px; padding: 8px; }
  .ledger-picture-fields { gap: 4px 5px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .dialog-body, .dialog-head, .dialog-actions { padding-inline: 12px; }
  .expense-heading, .expense-fixed { padding-inline: 8px; }
  .expense-fixed .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .expense-fixed label { grid-template-columns: minmax(0, 1fr); gap: 2px; font-size: 12px; }
  .expense-fixed input, .expense-fixed select { font-size: 16px; padding-inline-start: 4px; }
  .board-hero { flex-direction: column; }
  .board-grid { grid-template-columns: 1fr; }
  .trend-scroll { margin-inline: 12px; }
  .nav, .primary, .secondary, .close { min-height: 44px; }
  .close { min-width: 44px; }
  input, select { min-height: 44px; font-size: 16px; }
  .filter-actions { grid-column: 1 / -1; }
  .filter-actions > button { flex: 1; }
  .table-scroll { overflow: visible; background: #f3f6fc; padding: 8px; }
  #ledger table, #ledger tbody { display: block; white-space: normal; }
  #ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #ledger tbody { display: grid; gap: 8px; }
  #ledger tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 12px 4px;
  }
  #ledger tbody td { display: block; border: 0; padding: 0; overflow-wrap: anywhere; }
  #ledger tbody td:nth-child(1) { grid-area: 1 / 1; color: var(--muted); }
  #ledger tbody td:nth-child(2) { grid-area: 2 / 1; font-weight: 650; }
  #ledger tbody td:nth-child(3) { grid-area: 2 / 2; text-align: right; color: #2459b6; font-weight: 600; }
  #ledger tbody td:nth-child(4) { grid-area: 3 / 1 / 4 / 3; }
  #ledger tbody td:nth-child(5) { grid-area: 1 / 2; font-size: 17px; }
  #ledger tbody td:nth-child(6) { grid-area: 4 / 1; color: var(--muted); }
  #ledger tbody td:nth-child(6)::before { content: "录入人 · "; }
  #ledger tbody td:nth-child(7) { grid-area: 4 / 2; text-align: right; }
  .ledger-row-actions { justify-content: flex-end; gap: 0 8px; }
  #ledger tbody td.empty { grid-column: 1 / -1; padding: 20px 0; }
  .table-link { min-height: 44px; }
  dialog { max-height: 90dvh; }
  .dialog-actions { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .line .remove { grid-column: 1 / -1; justify-self: end; order: 1; }
  .line input[type="file"] { font-size: 16px; }
}
