:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #142e26;
  background: #eef4ef;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p, dl, dd { margin: 0; }
.shell {
  max-width: 58rem;
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.masthead { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .8rem 1.15rem; margin: .38rem 0 1.25rem; }
h1 { font-size: clamp(2.05rem, 8.5vw, 2.8rem); font-weight: 730; line-height: 1.15; letter-spacing: -.05em; }
h2 { font-size: 1.13rem; letter-spacing: -.02em; }
.quiet { color: #4b6257; font-size: .875rem; line-height: 1.5; }
.masthead .quiet { margin-top: .3rem; }
.device-state { display: flex; gap: .26rem; flex-direction: column; font-size: .75rem; line-height: 1.4; color: #385f50; }
.device-state span:first-child { font-weight: 675; }
.summary { padding: 1.1rem 1.18rem; color: #fff; background: #16584a; border-radius: 1rem; }
.summary h2 { color: #d6eee4; font-size: .875rem; font-weight: 620; }
.summary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: .8rem; }
.summary dl div + div { border-inline-start: 1px dashed #82b2a5; padding-inline-start: .85rem; }
.summary dt { color: #deefe7; font-size: .8rem; }
.summary dd { font-size: clamp(1.26rem, 5.4vw, 2rem); letter-spacing: -.045em; font-weight: 680; overflow-wrap: anywhere; }
dd, .amount, #entry-count { font-variant-numeric: tabular-nums; }
.workspace { display: grid; gap: .85rem; align-items: start; margin-top: .9rem; }
.sheet { min-width: 0; padding: 1.12rem 1.15rem; background: #fcfefc; border: 1px solid #c8d7cf; border-radius: .95rem; }
.entry-sheet h2 { margin-bottom: .85rem; }
form { display: grid; gap: .68rem; }
label, legend { color: #36554a; font-size: .85rem; font-weight: 640; }
.kind-switch { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; }
.kind-switch legend { margin-bottom: .35rem; }
.kind-switch label { position: relative; }
.kind-switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.kind-switch span { display: grid; place-items: center; min-height: 2.7rem; padding: .35rem; border: 1px solid #c8d7cf; border-radius: .55rem; font-size: .92rem; }
.kind-switch input:checked + span { background: #e1eee7; color: #184e40; border-color: #82a999; }
.kind-switch input:focus-visible + span, input:focus-visible, button:focus-visible { outline: 2px solid #216756; outline-offset: 2px; }
input:not([type=radio]) {
  display: block; width: 100%; min-width: 0; min-height: 2.72rem; margin-top: .32rem; padding: .48rem .63rem;
  border: 1px solid #bacdc2; border-radius: .55rem; color: #142e26; background: #f7faf7;
  font: inherit; font-size: 1rem;
}
input::placeholder { color: #5b6f65; font-weight: 400; }
button { min-height: 2.78rem; margin-top: .2rem; padding: .56rem .8rem; border: 0; border-radius: .58rem; color: #fff; background: #155f4e; font: inherit; font-weight: 670; cursor: pointer; }
button:disabled { opacity: .58; cursor: default; }
.form-status { color: #215744; font-size: .87rem; line-height: 1.5; }
.form-status.error { color: #8e2d1b; }
.section-heading, .record-top { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
#empty { padding-top: .85rem; }
.records { margin: .35rem 0 0; padding: 0; list-style: none; }
.record { padding: .72rem 0; border-bottom: 1px solid #e0e9e3; }
.record:last-child { padding-bottom: .2rem; border: 0; }
.record-name { overflow-wrap: anywhere; font-weight: 640; }
.record-top .amount { font-size: .96rem; white-space: nowrap; }
.record .quiet { margin-top: .28rem; }
.income { color: #1b6950; }
@media (min-width: 42rem) {
  .shell { padding-inline: max(1.4rem, env(safe-area-inset-left)) max(1.4rem, env(safe-area-inset-right)); }
  .workspace { grid-template-columns: minmax(16rem, .85fr) minmax(0, 1.15fr); }
  .device-state { text-align: right; }
}
