:root {
  color-scheme: light;
  --ink: #1d2428;
  --muted: #5d6a72;
  --line: #d7dfdf;
  --paper: #f3f6f4;
  --card: #ffffff;
  --accent: #0f5c57;
  --accent-ink: #ffffff;
  --warn: #8a3d2b;
  --ok: #1f6b3a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}
header {
  position: relative;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 28px;
  background: #14332f;
  color: white;
}
.brand { font-weight: 700; letter-spacing: 0.04em; flex: none; }
nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav-main, .nav-more { display: flex; gap: 2px; align-items: center; }
.nav-more { margin-left: 6px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.28); }
nav a { color: white; text-decoration: none; }
nav > .nav-main > a,
nav > .nav-more > a,
nav .menu > summary {
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1.4;
}
nav > .nav-main > a:hover,
nav > .nav-more > a:hover,
nav .menu > summary:hover,
nav > .nav-main > a.current,
nav > .nav-more > a.current,
nav .menu.current > summary,
nav .menu[open] > summary { background: rgba(255, 255, 255, 0.16); }
nav .menu { position: relative; }
nav .menu > summary {
  display: flex;
  align-items: center;
  gap: 4px;
  color: white;
  cursor: pointer;
  list-style: none;
  font: inherit;
}
nav .menu > summary::-webkit-details-marker { display: none; }
nav .menu > summary::marker { content: ""; }
nav .menu > summary::after {
  content: "";
  border: 4px solid transparent;
  border-top-color: white;
  margin-top: 3px;
}
nav .menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 148px;
  padding: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 51, 47, 0.16);
}
nav .menu-panel a,
nav .menu-panel button {
  color: var(--ink);
  background: transparent;
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  text-align: left;
  font: inherit;
}
nav .menu-panel a:hover,
nav .menu-panel button:hover { background: #e7f3f1; }
nav .menu-panel a.current { background: #e7f3f1; color: var(--accent); font-weight: 700; }
nav .menu-panel form { margin: 0; }
nav button, button, .button {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font: inherit;
}
button.secondary { background: #5d6a72; }
button.danger { background: var(--warn); }
button:disabled, .button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
nav button { background: transparent; color: white; padding: 0; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
main.wide { max-width: 100%; overflow-x: clip; }
h1 { font-size: 28px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 0 0 10px; }
.dash-grid h3 { font-size: 15px; margin: 14px 0 8px; }
.lead { color: var(--muted); max-width: 760px; }
.note { color: var(--muted); font-size: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}
.preview-folded-wrap { margin: 8px 0 16px; }
.preview-folded-wrap > .note { margin-bottom: 8px; }
details.preview-fold.card {
  padding: 0;
}
details.preview-fold > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}
details.preview-fold > summary::-webkit-details-marker { display: none; }
details.preview-fold > summary::marker { content: ""; }
details.preview-fold > summary::before {
  content: "";
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-left-color: var(--muted);
  margin-right: 2px;
  transform: translateY(1px);
}
details.preview-fold[open] > summary::before {
  transform: rotate(90deg) translateX(2px);
  border-left-color: var(--ink);
}
.preview-fold-title { color: var(--ink); }
.preview-fold-hint {
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
}
.preview-fold-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}
.preview-fold-body > .note:first-child,
.preview-fold-body > .warn:first-child {
  margin-top: 12px;
}
.form { display: grid; gap: 12px; max-width: 760px; }
.form.unit-form { max-width: 920px; }
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
label { display: grid; gap: 4px; font-size: 14px; }
input, select, textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
}
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.unit-form input,
.unit-form select,
.unit-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.unit-form input[type="radio"],
.unit-form input[type="checkbox"] {
  width: auto;
  min-width: 0;
  min-height: 0;
  flex: none;
  align-self: center;
}
.unit-basics > label {
  align-content: start;
  min-width: 0;
}
.unit-basics > label > span:first-child {
  min-height: 1.25em;
  line-height: 1.25;
}
.unit-parking-bind {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}
.unit-parking-bind[hidden],
.unit-basics [hidden],
[data-shop-note][hidden] { display: none !important; }
.unit-remark { display: grid; gap: 4px; }
.unit-remark textarea { resize: vertical; }
.status-line { font-size: 16px; margin: 8px 0; }
.money-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.money-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #f8fbfa; }
.money-card h3, .money-year-title { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.money-line { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--line); }
.money-line:last-child { border-bottom: 0; }
.money-line strong { font-variant-numeric: tabular-nums; }
.money-year + .money-year { margin-top: 8px; }
@media (max-width: 640px) {
  .money-cards { grid-template-columns: 1fr; }
}
#handover-editor:not([hidden]) { display: grid; gap: 10px; max-width: 520px; margin-top: 8px; }
#handover-editor .handover-choices {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  min-inline-size: 0;
}
#handover-editor .handover-choices legend {
  padding: 0;
  margin: 0 0 2px;
  font-weight: 700;
  float: none;
  width: auto;
}
#handover-editor .handover-choices .check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1.4;
  cursor: pointer;
}
#handover-editor .handover-choices .check:has(input:checked) {
  background: #e7f3f1;
}
#handover-editor .handover-choices .check input[type="radio"] {
  width: auto;
  margin: 3px 0 0;
  padding: 0;
  flex: none;
}
#handover-editor .handover-choices .check span {
  flex: 1;
  min-width: 0;
  white-space: normal;
}
.choices { display: grid; gap: 10px; }
.choice-line { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.choice-cell { min-width: 14rem; }
.choice-cell .choice-line { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0; }
.choice-cell input[type="radio"] { width: auto; min-height: 0; margin-top: 3px; }
tr.recon-warn td:last-child { color: var(--warn); font-weight: 700; }
label.choice-line input[type="checkbox"] { width: auto; min-height: 0; }
.choice-line label { display: flex; align-items: center; gap: 6px; }
.choices .check { font-size: 15px; }
.choices input[type="radio"] { width: auto; }
.choice-line input[type="date"] { width: auto; }
.filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 8px; }
.filters input[type="number"] { width: 88px; }
.check { display: flex; align-items: center; gap: 6px; }
label.check:has(input:disabled) { color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.muted td { color: var(--muted); }
.warn { color: var(--warn); background: #f8ebe6; padding: 10px 12px; border-radius: 8px; }
.ok { color: var(--ok); background: #e7f4eb; padding: 10px 12px; border-radius: 8px; }
.inline { display: inline-block; margin-right: 8px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 0; }
.form-actions .button,
.form-actions button { margin: 0; }
.backup-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
}
.backup-hero-copy { flex: 1 1 28rem; min-width: 0; }
.backup-hero-copy .lead { margin: 0; max-width: none; }
.backup-hero-action { margin: 0; flex: none; }
.backup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 14px;
  align-items: start;
}
.backup-list-card { margin: 0; padding: 16px 18px; }
.backup-list-head { margin-bottom: 10px; }
.backup-list-head h2 { margin-bottom: 4px; }
.backup-list-head .note { margin: 0; font-size: 13px; line-height: 1.45; }
.backup-empty { margin: 8px 0 0; }
.backup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.backup-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.backup-item:first-child { border-top: 0; padding-top: 4px; }
.backup-item.is-muted { opacity: 0.72; }
.backup-item-main { min-width: 0; display: grid; gap: 4px; }
.backup-item-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}
.backup-item-title time {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.backup-kind {
  display: inline-block;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 20px;
  background: #e7f3f1;
  color: var(--accent);
}
.backup-item-file {
  color: var(--muted);
  font-size: 13px;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.backup-item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.warn-inline { color: var(--warn); }
.backup-item-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: flex-start;
  position: relative;
}
.button.compact,
.backup-item-ops > .button,
.backup-op > summary {
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.3;
}
.backup-op { position: relative; }
.backup-op > summary {
  list-style: none;
  cursor: pointer;
  border: 0;
  border-radius: 6px;
  background: #5d6a72;
  color: #fff;
  display: inline-block;
  font: inherit;
  user-select: none;
}
.backup-op > summary::-webkit-details-marker { display: none; }
.backup-op > summary::marker { content: ""; }
.backup-op.is-danger > summary { background: var(--warn); }
.backup-op[open] > summary { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.backup-confirm {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12;
  width: min(320px, calc(100vw - 48px));
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(20, 51, 47, 0.16);
}
.backup-confirm .note { margin: 0; font-size: 12px; line-height: 1.4; }
.backup-confirm .choice-line { gap: 8px; align-items: flex-start; font-size: 13px; }
.backup-confirm .choice-line span { line-height: 1.35; }
.backup-confirm button { width: 100%; }
.backup-upload {
  margin: 0;
  position: sticky;
  top: 16px;
  max-width: none;
}
.backup-file-picked { margin: 0; }
@media (max-width: 900px) {
  .backup-layout { grid-template-columns: 1fr; }
  .backup-upload { position: static; }
  .backup-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .backup-item-ops { justify-content: flex-start; }
}
.tabs { display: flex; gap: 8px; margin: 8px 0; }
.tabs a { text-decoration: none; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.tabs a.active { background: var(--accent); color: white; border-color: var(--accent); }
.ledger-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.ledger-stats article, .ledger-stats a { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; min-width: 120px; text-decoration: none; color: inherit; }
.ledger-stats a.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ledger-stats span { display: block; color: var(--muted); font-size: 13px; }
.ledger-stats strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 12px; line-height: 18px; vertical-align: 1px; }
.tag.prepaid { background: #d9ebf8; color: #1d4e89; }
.tag.prepaid-ahead { background: #f8d0dc; color: #8a2040; }
.tag.waiver { background: #eadcf5; color: #5b3b78; }
.tag.waiver.settlement-waiver { background: #efe8df; color: #6b5b4a; }
.tag.due { background: #f8d7ce; color: #8a3d2b; }
.tag.due.settlement-due { background: #efe8df; color: #6b5b4a; }
.tag.overpay { background: #f3e2a8; color: #6d5208; }
.tag.standard { background: #d9e3f8; color: #1e3a78; }
.tag.unhanded { background: #f3e6d4; color: #6d4a12; }
.tag.settlement { background: #efe8df; color: #6b5b4a; }
button.tag {
  border: 0;
  cursor: pointer;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  vertical-align: 1px;
  background: #efe8df;
  color: #6b5b4a;
}
button.tag.settlement:hover,
button.tag.settlement:focus-visible {
  outline: 2px solid #c4b09a;
  outline-offset: 1px;
}
.settlement-dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  max-width: min(640px, calc(100vw - 24px));
  width: 640px;
  color: inherit;
  background: #fff;
  box-shadow: 0 16px 40px rgba(20, 51, 47, 0.18);
}
.settlement-dialog::backdrop { background: rgba(20, 32, 30, 0.42); }
.settlement-dialog-body { margin: 0; padding: 16px 18px 14px; display: grid; gap: 12px; }
.settlement-dialog-body header h2 { margin: 0 0 4px; font-size: 18px; }
.settlement-dialog-body header .note { margin: 0; }
.settlement-part { display: grid; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.settlement-part:first-of-type { border-top: 0; padding-top: 0; }
.settlement-part h3 { margin: 0; font-size: 15px; }
.settlement-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.settlement-table th,
.settlement-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.settlement-table th { text-align: left; font-weight: 600; width: 42%; }
.settlement-table td:last-child { color: var(--muted); }
.settlement-dialog-body footer { display: flex; justify-content: flex-end; }
.ledger-stats strong.handed { color: #0f5c57; }
.ledger-stats strong.unhanded { color: #8a5a12; }
.ledger-stats strong.settlement { color: #6b5b4a; }
.ledger-stats article small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.3; }
.standard-hint { display: block; margin-top: 2px; color: #1e3a78; font-size: 12px; font-weight: 600; line-height: 16px; text-align: right; }
.ledger input.money-edit.off-standard { box-shadow: inset 0 0 0 1px #3d6fbf; }
.ledger tbody tr.standard td:first-child { box-shadow: inset 3px 0 0 #3d6fbf; }
.ledger tbody tr.prepaid-ahead td:first-child { box-shadow: inset 3px 0 0 #c4475a; }
.ledger td.prepaid-ahead { box-shadow: inset 0 0 0 2px #c4475a; }
.ledger-stats strong.prepaid-ahead { color: #8a2040; }
.ledger-stats strong.standard { color: #1e3a78; }
.overpay-amount { margin-top: 2px; color: #8a6a12; font-size: 12px; line-height: 18px; font-weight: 600; }
.prepaid-ahead-amount { margin-top: 2px; color: #8a2040; font-size: 12px; line-height: 18px; font-weight: 600; }
.prepaid-ahead-hint { display: block; margin-top: 4px; font-size: 12px; line-height: 1.35; max-width: 11rem; white-space: normal; text-align: right; }
.confirm-overpay,
.confirm-prepaid-ahead {
  display: block;
  margin: 4px 0 0 auto;
  border: 1px solid #8a6a12;
  background: white;
  color: #6d5208;
  border-radius: 6px;
  padding: 2px 8px;
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}
.confirm-prepaid-ahead { border-color: #8a2040; color: #8a2040; }
.confirm-overpay:disabled,
.confirm-prepaid-ahead:disabled { cursor: default; opacity: 0.75; }
.ledger-stats strong.overpay { color: #8a6a12; }
.ledger-stats strong.waiver { color: #5b3b78; }
.ledger-stats .due, .ledger td.due, .ledger tfoot td.due { color: var(--warn); }
.ledger-stats .credit, .ledger td.credit, .ledger tfoot td.credit { color: var(--ok); }
body.ledger-page { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.ledger-page header { flex: none; padding: 8px 20px; }
body.ledger-page main.wide {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px 16px 8px;
}
body.ledger-page main.wide > h1 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 8px;
}
body.ledger-page .filters { gap: 8px 10px; margin-bottom: 6px; }
body.ledger-page .filters label { gap: 2px; font-size: 13px; }
body.ledger-page .filters input,
body.ledger-page .filters select { padding: 5px 8px; }
body.ledger-page .filters .button,
body.ledger-page .filters button { padding: 6px 12px; }
.waiver-open { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 4px; color: #5b3b78; font-size: 12px; line-height: 1.2; }
.waiver-open a { padding: 0 6px; border-radius: 999px; background: #efe6f6; color: #5b3b78; text-decoration: none; }
.waiver-add { display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; margin: 0 0 4px; padding: 2px 8px; background: #f7f2fa; border: 1px solid #e4d7ee; border-radius: 8px; line-height: 1.2; }
.waiver-add p { margin: 0; font-weight: 700; font-size: 13px; color: #5b3b78; }
.waiver-add label { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.waiver-add .note { margin: 0; font-size: 12px; line-height: 1.2; }
.waiver-add input[type="number"] { width: 72px; }
body.ledger-page .waiver-add input,
body.ledger-page .waiver-add button { padding: 2px 8px; }
body.ledger-page .tabs { margin: 0 0 6px; gap: 6px; }
body.ledger-page .tabs a { padding: 4px 12px; }
body.ledger-page .ledger-stats { margin: 0 0 6px; gap: 8px; }
body.ledger-page .ledger-stats article,
body.ledger-page .ledger-stats a { padding: 6px 12px; min-width: 96px; border-radius: 8px; }
body.ledger-page .ledger-stats span { font-size: 12px; line-height: 1.2; }
body.ledger-page .ledger-stats strong { font-size: 20px; line-height: 1.2; }
body.ledger-page .ledger-help { flex: none; margin: 0 0 6px; }
body.ledger-page .ledger-help summary { cursor: pointer; color: var(--muted); font-size: 13px; }
body.ledger-page .ledger-help .note { margin: 4px 0 0; }
body.ledger-page main.wide > h1,
body.ledger-page .filters,
body.ledger-page .waiver-add,
body.ledger-page .waiver-open,
body.ledger-page .tabs,
body.ledger-page .ledger-stats,
body.ledger-page .ledger-help,
body.ledger-page .note,
body.ledger-page .ok,
body.ledger-page .warn { flex: none; }
body.ledger-page #ledger-amounts {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ledger-wrap {
  flex: 1;
  min-height: 160px;
  width: 100%;
  max-width: 100%;
  max-height: none;
  margin: 0;
  overflow: scroll;
  padding: 0 0 2px;
  scrollbar-width: auto;
  scrollbar-color: #3e5c66 #d7e2e6;
}
.ledger-wrap::-webkit-scrollbar { height: 18px; width: 14px; }
.ledger-wrap::-webkit-scrollbar-track { background: #d7e2e6; }
.ledger-wrap::-webkit-scrollbar-thumb { background: #3e5c66; border-radius: 8px; border: 3px solid #d7e2e6; min-height: 40px; min-width: 48px; }
.ledger-wrap::-webkit-scrollbar-corner { background: #d7e2e6; }
.ledger { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.ledger th, .ledger td { white-space: nowrap; background: white; vertical-align: middle; }
.ledger thead th { position: sticky; top: 0; z-index: 3; text-align: center; font-weight: 600; color: var(--ink); line-height: 20px; padding: 7px 8px; vertical-align: middle; }
.ledger tbody td,
.ledger tfoot td { vertical-align: middle; }
.ledger thead tr:first-child { height: 36px; }
.ledger thead tr:nth-child(2) th { top: 36px; z-index: 3; }
.ledger th.tone-base { background: #e7eef2; }
.ledger th.tone-recv { background: #d9efe8; }
.ledger th.tone-unpaid { background: #f8ebe6; }
.ledger th.tone-prepaid { background: #e7f4eb; }
.ledger th.tone-collect { background: #e4eef8; }
.ledger th.tone-waiver { background: #efe6f6; }
.ledger th.tone-due { background: #f7f4ee; }
.ledger th.tone-hold { background: #fff3dd; }
.ledger th.region-start,
.ledger td.region-start { border-left: 2px solid #8aa0a6; }
.ledger tbody tr:nth-child(even) td { background: #f6faf8; }
.ledger tbody tr:hover td { background: #e7f3f1; }
.ledger tbody tr.settled td { background: #e5f6ea; }
.ledger tbody tr.settled:hover td { background: #d4f0dc; }
.ledger tbody tr.due td { background: #fdeeea; }
.ledger tbody tr.due:hover td { background: #f8e0d8; }
.ledger tbody tr.overpay td { background: #fff4d6; }
.ledger tbody tr.overpay:hover td { background: #ffe8a3; }
.ledger tbody td.num.dirty-cell { background: #fff4cc; box-shadow: inset 0 0 0 1px #c4a035; }
.ledger td.settled-mark { color: var(--ok); font-weight: 700; text-align: center; }
.ledger input.money-edit { width: 7.2em; text-align: right; font: inherit; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 2px 4px; }
.ledger input.money-edit:focus { background: white; border-color: var(--accent); outline: none; }
.ledger input.money-edit.dirty { background: #fff4cc; border-color: #c4a035; }
.ledger textarea.remark-edit { width: 16em; min-height: 28px; max-height: 6.5em; resize: vertical; text-align: left; font: inherit; line-height: 1.4; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 2px 4px; }
.ledger textarea.remark-edit:focus { background: white; border-color: var(--accent); outline: none; }
.ledger textarea.remark-edit.dirty { background: #fff4cc; border-color: #c4a035; }
.ledger td[data-key="remark"] { white-space: normal; }
.edit-bar { position: sticky; bottom: 12px; z-index: 6; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; padding: 12px 16px; background: #14332f; color: white; border-radius: 10px; }
.edit-bar[hidden] { display: none; }
.edit-bar button { background: white; color: #14332f; }
.ledger td.num, .ledger th.num, .ledger tfoot td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger thead th.num { text-align: center; }
.ledger tfoot td { font-weight: 700; background: #f7f4ee; position: sticky; bottom: 18px; z-index: 2; }
.ledger thead tr:first-child th:nth-child(-n+3),
.ledger tbody td:nth-child(-n+3),
.ledger tfoot td:nth-child(-n+3) { position: sticky; z-index: 4; }
.ledger tbody td:nth-child(-n+3),
.ledger tfoot td:nth-child(-n+3) { z-index: 2; }
.ledger thead tr:first-child th:nth-child(1),
.ledger tbody td:nth-child(1),
.ledger tfoot td:nth-child(1) { left: 0; min-width: 56px; }
.ledger thead tr:first-child th:nth-child(2),
.ledger tbody td:nth-child(2),
.ledger tfoot td:nth-child(2) { left: 56px; min-width: 96px; }
.ledger thead tr:first-child th:nth-child(3),
.ledger tbody td:nth-child(3),
.ledger tfoot td:nth-child(3) { left: 152px; min-width: 120px; box-shadow: 4px 0 6px rgba(20, 51, 47, 0.06); }
.log { padding-left: 18px; }
.log time { color: var(--muted); margin-right: 8px; }
.dash-archive { display: grid; gap: 8px; margin-bottom: 10px; }
.dash-mix { display: flex; height: 12px; overflow: hidden; border-radius: 999px; background: #e7eeea; }
.dash-mix span { display: block; height: 100%; min-width: 2px; }
.dash-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: 8px;
}
.dash-cat { background: #f8fbfa; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.dash-cat span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.dash-cat i { width: 10px; height: 10px; border-radius: 2px; }
.dash-cat strong { display: block; margin-top: 2px; font-size: 22px; font-variant-numeric: tabular-nums; }
.dash-cat small { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.dash-kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-kpis article { background: #f8fbfa; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 112px; }
.dash-kpis span { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.dash-kpis strong { font-size: 18px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.dash-kpis small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.3; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dash-span { grid-column: 1 / -1; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif; }
.legend-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; color: var(--muted); font-size: 13px; }
.legend-row i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; vertical-align: -1px; }
.chart-table { font-size: 13px; }
.charge-cell { display: flex; flex-direction: column; gap: 2px; min-width: 9.5rem; }
.charge-cell small { color: #5d6a72; }
.charge-cell form { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; }
.charge-cell input { width: 7rem; padding: 4px 6px; }
.charge-cell button { padding: 3px 8px; }
.dash-kpis strong.overpay { color: #8a6a12; }
.dash-kpis strong.standard { color: #1e3a78; }
.dash-kpis strong.handed { color: #0f5c57; }
.dash-kpis strong.unhanded { color: #8a5a12; }
@media (max-width: 800px) {
  header { flex-direction: column; align-items: flex-start; }
  .nav-more { margin-left: 0; padding-left: 0; border-left: 0; }
  .grid, .dash-grid { grid-template-columns: 1fr; }
  .dash-span { grid-column: auto; }
}
body.phone-page { background: var(--paper); }
body.phone-page header.phone-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
}
body.phone-page .brand { color: white; text-decoration: none; }
body.phone-page header form { margin: 0; }
body.phone-page header button {
  background: transparent;
  color: white;
  min-height: 44px;
  padding: 8px 2px;
  font-size: 16px;
}
body.phone-page main {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px calc(28px + env(safe-area-inset-bottom));
}
body.phone-page h1.phone-title { margin: 4px 0 14px; font-size: 24px; line-height: 1.25; }
body.phone-page h2 { font-size: 16px; margin: 16px 0 8px; }
.phone-search, .phone-login, .phone-form { display: grid; gap: 12px; }
.phone-search label, .phone-login label, .phone-form label { font-size: 15px; }
.phone-search input, .phone-search select, .phone-login input,
.phone-form input:not([type="radio"]):not([type="checkbox"]),
.phone-form select, .phone-form textarea {
  min-height: 48px;
  font-size: 17px;
  width: 100%;
}
.phone-search button, .phone-login button, .phone-form button { min-height: 52px; font-size: 18px; width: 100%; }
.phone-primary, .phone-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 12px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}
.phone-primary { background: var(--accent); color: white; }
.phone-secondary { background: white; color: var(--ink); border: 1px solid var(--line); }
.phone-actions { display: grid; gap: 10px; margin: 14px 0; }
.phone-actions .phone-primary, .phone-actions .phone-secondary { margin-top: 0; }
.phone-hero, .phone-form, .phone-search, .phone-login {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.phone-place { margin: 0; color: var(--muted); font-size: 14px; }
.phone-owner { margin: 4px 0 12px; font-size: 20px; font-weight: 700; }
.phone-meta { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.phone-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.phone-figures article { background: #f8fbfa; border-radius: 10px; padding: 10px 12px; }
.phone-figures span { display: block; color: var(--muted); font-size: 13px; }
.phone-figures strong { display: block; margin-top: 2px; font-size: 22px; font-variant-numeric: tabular-nums; }
.phone-figures strong.due { color: var(--warn); }
.phone-figures strong.credit { color: var(--ok); }
.phone-years { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.phone-amount input { font-size: 28px; min-height: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.phone-submit { position: sticky; bottom: 0; padding-top: 8px; background: linear-gradient(transparent, white 28%); }
.phone-handover { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.phone-handover legend { padding: 0; font-weight: 700; }
.phone-members { display: grid; gap: 8px; margin: 12px 0; }
.phone-members article { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.phone-members p { margin: 0; }
.phone-members b { margin-right: 8px; }
.phone-members span { color: var(--muted); font-size: 14px; }
.phone-members a { color: var(--accent); text-decoration: none; font-size: 14px; }
.phone-members .due { color: var(--warn); font-weight: 700; }
.phone-members .credit { color: var(--ok); font-weight: 700; }
.pay-preview { min-height: 48px; padding: 10px 12px; border-radius: 12px; background: #f8fbfa; white-space: pre-line; line-height: 1.5; }
body.phone-page .phone-form label.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfa;
  font-size: 16px;
  line-height: 1.4;
}
body.phone-page .phone-form label.check span { flex: 1; min-width: 0; }
body.phone-page .phone-form label.check input {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}
body.phone-page .phone-form label.check:has(input:checked) {
  border-color: var(--accent);
  background: #e7f3f1;
}
.phone-back {
  position: sticky;
  top: 54px;
  z-index: 15;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
  padding-bottom: 4px;
  background: var(--paper);
}
.phone-back.only { grid-template-columns: 1fr; }
.phone-back a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.phone-back a.home { background: #e7f3f1; color: var(--accent); }
.phone-crumbs {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.phone-crumbs a { color: var(--accent); text-decoration: none; }
.crumbs { color: var(--muted); font-size: 14px; }
.crumbs a { text-decoration: none; }
.tap-list { display: grid; gap: 8px; margin: 12px 0; }
.tap-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  font-size: 17px;
}
.tap-list a span { display: grid; min-width: 0; }
.tap-list a b { font-weight: 700; }
.tap-list a small { color: var(--muted); font-size: 13px; font-weight: 400; }
.tap-list a strong { flex: none; color: var(--ink); font-size: 15px; font-weight: 600; }
body.collect-page .collect-bar {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px 18px;
  margin: 0 0 4px;
}
body.collect-page .collect-bar .filters,
body.collect-page .collect-bar .ledger-stats { margin: 0; }
body.collect-page .collect-bar .ledger-stats article { padding: 3px 10px; min-width: 0; }
body.collect-page .collect-bar .ledger-stats strong { font-size: 16px; }
body.collect-page .collect-sheet { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.collect-page .collect-sheet .ledger-wrap { flex: 1; min-height: 160px; }
.tag.shop { background: #e4eef8; color: #24557a; }
.tag.stall { background: #d9f0ea; color: #1d5c4a; }
.collect-ledger thead tr:first-child th:nth-child(-n+4),
.collect-ledger tbody td:nth-child(-n+4),
.collect-ledger tfoot td:nth-child(-n+4) { position: sticky; }
.collect-ledger thead tr:first-child th:nth-child(-n+4) { z-index: 6; }
.collect-ledger tbody td:nth-child(-n+4) { z-index: 2; }
.collect-ledger tfoot td:nth-child(-n+4) { z-index: 3; }
.collect-ledger thead tr:first-child th:nth-child(1),
.collect-ledger tbody td:nth-child(1),
.collect-ledger tfoot td:nth-child(1) { left: 0; width: 48px; min-width: 48px; max-width: 48px; }
.collect-ledger thead tr:first-child th:nth-child(2),
.collect-ledger tbody td:nth-child(2),
.collect-ledger tfoot td:nth-child(2),
.collect-ledger thead tr:first-child th:nth-child(3),
.collect-ledger tbody td:nth-child(3),
.collect-ledger tfoot td:nth-child(3) { white-space: normal; }
.collect-ledger thead tr:first-child th:nth-child(2),
.collect-ledger tbody td:nth-child(2),
.collect-ledger tfoot td:nth-child(2) { left: 48px; width: 148px; min-width: 148px; max-width: 148px; }
.collect-ledger thead tr:first-child th:nth-child(3),
.collect-ledger tbody td:nth-child(3),
.collect-ledger tfoot td:nth-child(3) { left: 196px; width: 188px; min-width: 188px; max-width: 188px; box-shadow: none; }
.collect-ledger thead tr:first-child th:nth-child(4),
.collect-ledger tbody td:nth-child(4),
.collect-ledger tfoot td:nth-child(4) {
  left: 384px;
  width: 128px;
  min-width: 128px;
  max-width: 128px;
  white-space: normal;
  line-height: 1.35;
  box-shadow: 4px 0 6px rgba(20, 51, 47, 0.06);
}
.collect-ledger td.sum { font-weight: 700; }
body.phone-page .check { min-height: 48px; font-size: 16px; }
a.button.secondary, button.secondary { background: #5d6a72; }
.desk-search { margin-top: 0; }
.desk-search .lead { margin-top: 0; }
.desk-find { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.desk-find input, .desk-find select { min-height: 46px; }
.desk-q input { font-size: 18px; }
.desk-results h2 { margin: 18px 0 10px; }
.desk-board h2 { margin: 0 0 10px; }
.desk-level { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: start; margin-top: 8px; }
.desk-level > span { padding-top: 6px; color: var(--muted); font-size: 13px; }
.desk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.desk-chips a {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: inherit;
  text-decoration: none;
  line-height: 1.4;
}
.desk-chips a.active { background: var(--accent); border-color: var(--accent); color: white; }
.desk-chips a i { font-style: normal; color: var(--muted); }
.desk-chips a.active i { color: rgba(255, 255, 255, 0.82); }
.desk-cats { margin-bottom: 4px; }
.desk-board section { margin-top: 14px; }
.desk-board h3 { margin: 0 0 8px; font-size: 15px; }
.desk-board h3 i { font-style: normal; color: var(--muted); font-weight: 500; font-size: 13px; }
.desk-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.desk-room {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfa;
  color: inherit;
  text-decoration: none;
}
.desk-room:hover { border-color: var(--accent); background: white; }
.desk-room b { font-size: 15px; line-height: 1.3; }
.desk-room span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-hits { display: grid; gap: 10px; }
.desk-hit {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}
.desk-hit:hover { border-color: var(--accent); background: #f8fbfa; }
.desk-hit strong { display: block; font-size: 20px; line-height: 1.3; }
.desk-hit span, .desk-hit em { display: block; color: var(--muted); font-style: normal; }
.desk-hit em { font-size: 13px; }
.desk-hit .tag { margin: 6px 0 0; }
.desk-due { text-align: right; min-width: 120px; }
.desk-due span, .desk-due small { display: block; color: var(--muted); font-size: 13px; }
.desk-due b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.desk-due.is-due b, .desk-due small { color: var(--warn); }
.desk-back { margin: 0 0 8px; }
.desk-work { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); gap: 16px; align-items: start; }
.desk-work > .card { margin: 0; }
.desk-place { margin: 0; color: var(--muted); }
.desk-house h2 { margin: 0; font-size: 28px; }
.desk-owner { margin: 2px 0 12px; font-size: 18px; font-weight: 700; }
.desk-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.desk-figures article { background: #f8fbfa; border-radius: 10px; padding: 12px 14px; }
.desk-figures span { display: block; color: var(--muted); font-size: 13px; }
.desk-figures strong { display: block; margin-top: 2px; font-size: 26px; font-variant-numeric: tabular-nums; }
.desk-figures strong.due { color: var(--warn); }
.desk-figures strong.settlement { color: #6b5b4a; }
.desk-figures small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.desk-members { display: grid; gap: 8px; margin: 12px 0; }
.desk-members article { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.desk-members span, .desk-members small, .desk-members a { color: var(--muted); font-size: 14px; }
.desk-members strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.desk-members strong.due { color: var(--warn); }
.desk-members strong.credit { color: var(--ok); }
.desk-dues { list-style: none; margin: 0 0 12px; padding: 0; }
.desk-dues li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.desk-dues b { font-variant-numeric: tabular-nums; }
.desk-pay { display: grid; gap: 12px; align-content: start; }
.desk-amount input { font-size: 32px; min-height: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.desk-modes { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.desk-modes legend { font-weight: 700; margin-bottom: 4px; }
.desk-modes .check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbfa;
}
.desk-modes .check:has(input:checked) { border-color: var(--accent); background: #e7f3f1; }
.desk-modes .check input { width: auto; min-height: 0; }
.pay-picks { display: grid; gap: 8px; }
.pay-picks[hidden] { display: none; }
.pay-picks .check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.pay-picks .check:has(input:checked) { border-color: var(--accent); background: #e7f3f1; }
.pay-picks .check input { width: auto; min-height: 0; }
.pay-picks .check span { flex: 1; }
.pay-picks .check b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.desk-pay .pay-preview { min-height: 72px; }
.desk-notes { margin: 0 0 12px; }
.desk-notes p { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.desk-notes ul { margin: 0; padding-left: 18px; }
.desk-notes li { margin: 2px 0; }
.review-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.review-reject { display: flex; gap: 8px; align-items: center; margin: 0; }
.review-reject input { min-width: 220px; }
.void-receipt { display: flex; gap: 8px; align-items: center; margin: 0; }
.void-receipt input { width: 148px; min-height: 36px; }
@media (max-width: 800px) {
  .desk-find, .desk-work, .desk-figures { grid-template-columns: 1fr; }
  .desk-due { text-align: left; }
}
