:root {
  color-scheme: light;
  --ink: #182f35;
  --muted: #50676c;
  --paper: #fff;
  --background: #eef3f3;
  --line: #d6e1e1;
  --teal: #106353;
  --deep: #123c37;
  --mint: #dcf1e9;
  --shadow: 0 2px 3px #142b3510;
  font-family: "Aptos", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.55;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); letter-spacing: -.035em; line-height: 1.2; }
h2 { font-size: 1.22rem; letter-spacing: -.015em; line-height: 1.35; }
h3 { font-size: 1.05rem; line-height: 1.4; }
a { color: var(--teal); text-underline-offset: .2em; }
a:hover { color: #073e33; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #007f9b; outline-offset: 3px; }
.skip { position: fixed; top: -7rem; left: 1rem; padding: .7rem 1rem; background: var(--paper); z-index: 2; }
.skip:focus { top: .5rem; }
.site-header { background: var(--paper); border-top: 4px solid var(--deep); border-bottom: 1px solid var(--line); }
.header-inner {
  min-height: 4.15rem; max-width: 77rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.3rem);
  display: flex; gap: clamp(1rem, 4vw, 3.5rem); align-items: stretch;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-weight: 720; white-space: nowrap; }
.brand-mark { display: grid; place-content: center; gap: .19rem; width: 1.85rem; height: 1.85rem; background: var(--teal); border-radius: 6px; }
.brand-mark i { background: #d6efe5; width: .91rem; height: 2px; border-radius: 1px; }
.brand-mark i:last-child { width: .6rem; }
.tabs { display: flex; gap: 1.3rem; align-items: stretch; }
.tabs a { display: flex; align-items: center; white-space: nowrap; border-block: 3px solid transparent; color: var(--muted); font-size: .92rem; text-decoration: none; }
.tabs a:hover, .tabs a[aria-current] { color: var(--teal); }
.tabs a[aria-current] { border-bottom-color: var(--teal); font-weight: 700; }
.account { margin-left: auto; display: flex; align-items: center; gap: .8rem; font-size: .9rem; }
.account a { text-decoration: none; color: var(--ink); }
.account a:hover { text-decoration: underline; }
.text-button { border: 0; padding: .4rem .1rem; background: transparent; color: var(--teal); white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.demo-notice { padding: .4rem 1rem; background: #f8edd6; color: #664610; text-align: center; font-size: .87rem; }
.shell { max-width: 77rem; margin: 0 auto; padding: clamp(1.35rem, 4vw, 2.8rem) clamp(1rem, 4vw, 2.3rem) 4rem; }
.narrow-shell { max-width: 48rem; }
.auth-shell { max-width: 67rem; padding-top: clamp(2rem, 8vw, 6.5rem); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.45rem; }
.page-head p { margin-top: .45rem; color: var(--muted); }
.page-head > .button { flex: none; }
.back-link { display: inline-block; margin-bottom: .9rem; color: var(--teal); font-weight: 650; }
.button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 2.65rem;
  border: 1px solid transparent; border-radius: .36rem; padding: .5rem .95rem;
  font-weight: 700; font-size: .9rem; line-height: 1.35; text-decoration: none;
}
.button.primary { color: white; background: var(--teal); border-color: var(--teal); }
.button.primary:hover { color: white; background: #0e5347; }
.button.outline { color: var(--deep); background: var(--paper); border-color: #9cb2b1; }
.button.outline:hover { background: #eef6f3; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: .6rem; box-shadow: var(--shadow); }
.panel-pad { padding: clamp(1rem, 3vw, 1.6rem); }
.panel-pad > h2 { margin-bottom: .8rem; }
.panel-pad > p { margin-bottom: .85rem; }
.filter-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .75rem 1rem; padding: .95rem 1.1rem; }
.filter-bar > .field { flex: 1 0 8rem; max-width: 14rem; align-self: start; }
.filter-options { display: flex; min-height: 2.65rem; align-items: center; gap: .9rem; }
.filter-options .check-label { color: var(--ink); }
.field { min-width: 0; display: grid; gap: .35rem; align-content: start; }
.field > label, .field > legend, .existing legend { color: var(--ink); font-size: .9rem; font-weight: 700; }
.field input:not([type=checkbox]), .field textarea, .field select {
  width: 100%; min-height: 2.65rem; border: 1px solid #a9bcbe; border-radius: .34rem;
  background-color: var(--paper); color: var(--ink); padding: .48rem .6rem;
}
.field textarea { resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #60757a; }
.field select {
  appearance: none; padding-right: 1.6rem;
  background-image: linear-gradient(45deg, transparent 55%, var(--muted) 55%), linear-gradient(135deg, var(--muted) 48%, transparent 48%);
  background-repeat: no-repeat; background-size: 5px 5px; background-position: right 13px center, right 8px center;
}
.check-label { display: inline-flex; gap: .35rem; align-items: center; font-size: .9rem; font-weight: 600; white-space: nowrap; }
input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--teal); }
.field.has-errors input, .field.has-errors textarea, .field.has-errors select { border-color: #9f354b; }
.errorlist { margin: 0; padding: .15rem 0 .15rem 1.15rem; color: #8d243a; font-size: .91rem; }
.errorlist li { padding-inline-start: .05rem; }
.help { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.help ul { margin: .2rem 0; padding-inline-start: 1.2rem; }
.form-stack { display: grid; gap: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.upload-box { padding: .9rem; border: 1px dashed #9ab4b1; border-radius: .42rem; background: #f3f8f6; }
.field input[type=file] { max-width: 100%; padding: .28rem; }
input[type=file]::file-selector-button { border: 0; padding: .35rem .55rem; margin-right: .4rem; background: var(--mint); color: var(--deep); border-radius: .23rem; cursor: pointer; }
.existing { margin: 1rem 0 0; padding: .65rem; border: 1px solid var(--line); }
.existing a { display: block; overflow-wrap: anywhere; }
.existing .help { margin: .45rem 0; }
.ledger-strip { background: var(--deep); color: var(--paper); margin-top: 1.15rem; padding: 1.15rem 1.25rem 1.3rem; border-radius: .6rem; }
.strip-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding-bottom: .85rem; border-bottom: 1px solid #55736e; }
.strip-head h2 { font-size: 1.1rem; font-weight: 660; }
.strip-head span { font-size: .875rem; color: #c5ded7; }
.totals { margin: 1.05rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.totals div { padding-inline: clamp(.5rem, 2.5vw, 1.45rem); border-left: 1px solid #52716b; }
.totals div:first-child { padding-left: 0; border-left: 0; }
.totals dt { color: #c5ded7; font-size: .91rem; }
.totals dd { margin: .16rem 0 0; font-weight: 720; font-size: clamp(1rem, 2.7vw, 2.05rem); line-height: 1.2; overflow-wrap: anywhere; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.report-section { margin-top: 1.1rem; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; padding: .9rem 1.1rem; }
.muted, .row-sub { color: var(--muted); font-size: .88rem; }
.row-sub { display: block; margin-top: .11rem; }
.empty { border-top: 1px solid var(--line); padding: 1.7rem 1.1rem; color: var(--muted); }
.empty a { display: inline-block; margin-top: .35rem; }
.inline-link { font-weight: 680; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; min-width: 31rem; }
th, td { padding: .65rem 1.1rem; border-top: 1px solid var(--line); vertical-align: middle; }
thead th { font-size: .875rem; background: #f4f7f7; font-weight: 680; color: #395259; white-space: nowrap; }
tbody th { font-weight: 640; }
tfoot th, tfoot td { background: #f1f7f5; font-weight: 700; }
.amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.numeric { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.entry-table th[scope=row] { min-width: 9.5rem; overflow-wrap: anywhere; }
.entry-table .record-owner { min-width: 6.5rem; }
.entry-table td { font-size: .93rem; }
.entry-table a { font-weight: 690; }
.entry-table.roster th[scope=row] { min-width: initial; }
.member-group { border-top: 1px solid var(--line); }
.member-group summary, .return-box summary { padding: .75rem 1.1rem; cursor: pointer; }
.member-group summary::marker, .return-box summary::marker { color: var(--teal); }
.member-group summary:hover, .return-box summary:hover { background: #f5f8f7; }
.member-group summary .muted { margin-left: .45rem; }
.group-total { float: right; font-size: .9rem; color: var(--deep); }
.group-total strong { margin-left: .3rem; }
.status { display: inline-flex; width: fit-content; white-space: nowrap; align-items: center; padding: .18rem .53rem; border-radius: 1rem; color: #375259; background: #ecf1f2; font-size: .875rem; font-weight: 680; }
.status.review { background: #e5eff8; color: #245276; }
.status.payable { background: #f9eed6; color: #704b13; }
.status.paid { background: #ddf1e8; color: #195b44; }
.status.returned { background: #f8e7ea; color: #8b3045; }
.pagination { padding: .8rem 1.1rem; display: flex; gap: .65rem; align-items: center; border-top: 1px solid var(--line); }
.detail-grid { display: grid; align-items: start; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1rem; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.detail-head h2 { margin-bottom: .2rem; overflow-wrap: anywhere; }
.detail-main .facts { margin: 1rem 0 0; padding: 1rem 0; border-block: 1px solid var(--line); }
.facts { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts dt { color: var(--muted); font-size: .9rem; margin-bottom: .17rem; }
.facts dd { margin: 0; font-weight: 660; }
.money-large { font-size: 1.23rem; overflow-wrap: anywhere; }
.detail-files { margin: 1rem 0; }
.files { padding: 0; margin: .45rem 0 0; list-style: none; }
.files li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .65rem; padding: .32rem 0; }
.files a { overflow-wrap: anywhere; }
.files span { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.payment-slip { padding: .9rem; border: 1px solid #bcd7ce; background: #edf7f2; border-radius: .4rem; }
.payment-slip .facts { margin: .5rem 0 0; padding: .6rem 0 0; border-bottom: none; }
.payment-slip p { margin: .55rem 0; }
.payout-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tax-fields[hidden] { display: none; }
.tax-fields-body { padding: .75rem 1rem; border-top: 1px solid var(--line); }
.cancel-payment { margin-top: .4rem; }
.wrap { overflow-wrap: anywhere; white-space: pre-line; }
.manage-actions { display: grid; gap: .85rem; margin-top: 1.2rem; }
.return-box { border: 1px solid var(--line); border-radius: .4rem; overflow: hidden; }
.return-box summary { font-weight: 690; }
.return-box form { border-top: 1px solid var(--line); padding: .85rem 1rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; border-inline-start: 1px solid #bfd3ce; padding: 0 0 1rem 1rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { position: absolute; content: ""; left: -.28rem; top: .4rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--teal); }
.timeline-meta { display: block; margin: .15rem 0 .25rem; color: var(--muted); font-size: .85rem; }
.member-grid .report-section { margin: 0; }
.toasts { list-style: none; margin: 0 0 1rem; padding: 0; }
.toasts li { background: var(--mint); color: var(--deep); padding: .65rem .85rem; border: 1px solid #b4d7cb; border-radius: .35rem; }
.toasts li + li { margin-top: .4rem; }
.toasts li.error { background: #f9e9ed; border-color: #e6bcc6; color: #812d43; }
.auth-panel { display: grid; grid-template-columns: 1.02fr 1fr; border: 1px solid var(--line); border-radius: .85rem; overflow: hidden; background: var(--paper); box-shadow: var(--shadow); }
.auth-intro { position: relative; min-height: 24rem; padding: clamp(1.3rem, 5vw, 3.3rem); display: flex; flex-direction: column; justify-content: flex-end; background: var(--deep); color: var(--paper); }
.auth-intro h1 { font-size: clamp(2.1rem, 5vw, 3.15rem); }
.auth-intro p { max-width: 17rem; color: #c7e2d9; margin-top: 1rem; }
.auth-ledger { position: absolute; inset: 2.15rem 3rem auto; max-width: 10rem; display: grid; gap: .62rem; }
.auth-ledger i { height: 1px; background: #6b988d; }
.auth-ledger i:nth-child(2) { width: 80%; }
.auth-ledger i:nth-child(3) { width: 63%; }
.auth-ledger i:nth-child(4) { width: 45%; }
.auth-form { align-self: center; padding: clamp(1.3rem, 5vw, 3.1rem); }
.auth-form h2 { margin-bottom: 1rem; font-size: 1.4rem; }
.auth-form .button { margin-top: .2rem; }
@media (max-width: 760px) {
  .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 .55rem; padding-top: .65rem; padding-bottom: .55rem; min-height: 0; }
  .tabs { grid-row: 2; grid-column: 1 / -1; gap: .95rem; flex-wrap: wrap; margin-top: .4rem; }
  .tabs a { padding: .3rem 0; }
  .account { grid-row: 1; grid-column: 2; gap: .55rem; }
  .account > a, .account > span { max-width: 6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .detail-grid { grid-template-columns: 1fr; }
  .filter-bar > .field { max-width: none; }
  th, td { padding: .55rem .75rem; }
}
@media (max-width: 520px) {
  .auth-panel { grid-template-columns: 1fr; }
  .auth-intro { min-height: auto; }
  .auth-intro br, .auth-ledger { display: none; }
  .auth-intro h1 { font-size: 1.9rem; }
  .auth-intro p { margin-top: .5rem; }
  .ledger-strip { padding-inline: .9rem; }
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 0; }
  .totals div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .totals dd { font-size: 1.28rem; }
  .filter-bar { padding: .75rem; }
  .filter-bar > .field { flex-basis: 7rem; }
  .filter-options { width: 100%; justify-content: space-between; }
  .section-head { padding-inline: .75rem; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .usage-table { min-width: 100%; font-size: .85rem; }
  .usage-table th, .usage-table td { padding-inline: .35rem; }
  .usage-table thead th { font-size: .83rem; }
  .entry-table:not(.roster) { display: block; min-width: 0; }
  .entry-table:not(.roster) thead {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .entry-table:not(.roster) tbody { display: block; }
  .entry-table:not(.roster) tbody tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem .7rem; padding: .8rem .75rem; border-top: 1px solid var(--line);
  }
  .entry-table:not(.roster) tbody :is(th, td) { border: 0; padding: 0; text-align: left; }
  .entry-table:not(.roster) th[scope=row] { grid-column: 1 / -1; grid-row: 1; }
  .entry-table .record-owner { grid-column: 1 / -1; min-width: 0; }
  .entry-table .record-owner .row-sub { display: inline; margin-left: .4rem; }
  .entry-table td[data-label]::before {
    display: block; content: attr(data-label); color: var(--muted);
    font-size: .86rem; font-weight: 610;
  }
}
