:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e3e3e6;
  --soft: #f6f6f7;
  --accent: #0b57d0;
  --warn: #b3261e;
  --earlier: #fff8e6;
  --tap: 40px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.5; background: #fff; }
main { max-width: 1180px; margin: 0 auto; padding: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 8px 0 4px; }
h2 { font-size: 15px; margin: 20px 0 6px; }
.hint, .muted { color: var(--muted); }
.hint { margin: 4px 0 12px; }
.error { color: var(--warn); }
.top { display: flex; gap: 20px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top nav { display: flex; gap: 16px; }
.top nav a[aria-current] { color: var(--ink); font-weight: 600; }
.top .who { margin-left: auto; color: var(--muted); }
button, .button { min-height: var(--tap); padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { border: 0; min-height: 0; padding: 0; color: var(--accent); background: none; }
button:disabled { opacity: .55; cursor: default; }
input { font: inherit; min-height: var(--tap); padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }
label { display: grid; gap: 4px; color: var(--muted); }
.login { max-width: 340px; margin: 12vh auto 0; display: grid; gap: 14px; }
.period { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 8px 0 12px; }
.table-scroll, .block { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: 12px; color: var(--muted); white-space: nowrap; }
th span { font-weight: 400; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 600; border-bottom: 0; }
tr.earlier td { background: var(--earlier); }
td.pick, th.pick { width: 32px; }
.note { color: var(--warn); font-size: 12px; }
ul.plain { padding-left: 18px; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 16px 0; position: sticky; bottom: 0; background: #fff; padding: 10px 0; border-top: 1px solid var(--line); }
.actions .grand { margin-left: auto; }
.actions-inline { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.statement { font-size: 13px; }
.statement .who { min-width: 190px; }

/* the statement as a document */
.paper { max-width: 1000px; margin: 8px auto 32px; }
.letterhead { font-size: 12px; line-height: 1.45; }
.letterhead div:first-child { font-weight: 700; font-size: 14px; }
.doc-title { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 8px; font-size: 16px; }
.doc-title span { font-size: 12px; color: var(--muted); }
table.meta th { width: 12%; }
table.meta td { width: 21%; }
.grand-total { text-align: right; font-size: 15px; margin: 14px 0; }
.signatures { display: flex; justify-content: space-around; margin-top: 48px; text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 640px) {
  main { padding: 12px 16px; }
  .actions .grand { margin-left: 0; width: 100%; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  .top, .no-print, .actions { display: none !important; }
  main { padding: 0; max-width: none; }
  .paper { margin: 0; max-width: none; }
  body { font-size: 11px; }
  th, td { padding: 4px 5px; }
  .block { overflow: visible; break-inside: auto; }
  tr { break-inside: avoid; }
  .statement .who { min-width: 0; width: 26%; }
}
