:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101311;
  color: #f4f6ee;
  --muted: #aab2a8;
  --accent: #d4fa86;
  --border: #303831;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 76% 0%, #212b21, transparent 52rem); }
h1, h2, p { margin: 0; }
.shell {
  width: min(100%, 58rem);
  margin-inline: auto;
  padding: clamp(1.6rem, 6vw, 3.5rem) clamp(1rem, 4vw, 2rem) max(2rem, env(safe-area-inset-bottom));
}
.brand { display: flex; align-items: center; gap: .75rem; margin-bottom: clamp(1.4rem, 4vw, 2.1rem); }
.brand img { border-radius: .85rem; }
.brand h1 { font-size: 1.2rem; font-weight: 670; letter-spacing: -.035em; }
.summary {
  padding: clamp(1.3rem, 4vw, 2.2rem);
  border: 1px solid #40543b;
  border-radius: 1.6rem;
  background:
    repeating-linear-gradient(115deg, transparent 0 21px, #bad4a40b 21px 22px, transparent 22px 42px) right top / 42% 100% no-repeat,
    radial-gradient(ellipse at 98% 10%, #3c5632, transparent 68%),
    linear-gradient(132deg, #243723, #1a271c 70%);
  box-shadow: 0 14px 42px #0004, inset 0 1px #f4ffe31a;
}
.summary-top { display: flex; align-items: center; justify-content: space-between; gap: .65rem; }
.summary h2 { color: #e0e9d7; font-size: .95rem; font-weight: 620; }
.period { position: relative; display: inline-flex; align-items: center; max-width: 58%; }
.period::after { content: ""; position: absolute; right: .85rem; width: .42rem; height: .42rem; border: solid #d9e4d3; border-width: 0 1.5px 1.5px 0; transform: translateY(-25%) rotate(45deg); pointer-events: none; }
.period select { appearance: none; max-width: 100%; min-height: 2.75rem; padding: .45rem 1.95rem .45rem .8rem; font-family: inherit; font-size: .875rem; font-weight: 600; color: #f2f5eb; background: #121d16a8; border: 1px solid #687d615e; border-radius: .65rem; }
.total { margin-top: .9rem; font-size: clamp(2.6rem, 8vw, 5.3rem); font-weight: 720; letter-spacing: -.072em; line-height: 1.02; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.count { margin-top: .85rem; color: #d5e3cc; font-size: .94rem; }
.details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 1rem; align-items: start; margin-top: 1rem; }
.panel { padding: clamp(1.15rem, 3vw, 1.55rem); border: 1px solid var(--border); border-radius: 1.25rem; background: #181d19; }
.panel h2 { font-size: 1.11rem; font-weight: 660; letter-spacing: -.025em; margin-bottom: 1.05rem; }
form label { display: block; margin-bottom: .45rem; color: #d7ded4; font-size: .9rem; }
.amount-field { display: flex; align-items: center; border-radius: .8rem; border: 1px solid #495849; background: #0f140f; overflow: hidden; }
.amount-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.amount-field input { width: 100%; min-width: 0; padding: .72rem .85rem; color: #f4f6ee; background: none; font-family: inherit; font-size: 1.25rem; font-weight: 620; font-variant-numeric: tabular-nums; border: 0; outline: none; }
.amount-field input::placeholder { color: #94a093; }
.amount-field span { padding-inline: .45rem .85rem; color: #b8c3b6; }
button { display: block; width: 100%; min-height: 2.9rem; margin-top: .8rem; padding: .6rem; background: var(--accent); color: #172311; border: 0; border-radius: .78rem; font: inherit; font-weight: 720; cursor: pointer; }
button:hover { background: #e3ffa8; }
button:active { background: #bbeb68; }
button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.message { margin-top: .7rem; font-size: .875rem; color: var(--accent); line-height: 1.45; }
.message.error { color: #ffbaac; }
.history ul { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; padding: .83rem 0; border-top: 1px solid var(--border); }
.history li:last-child { padding-bottom: 0; }
.history time { color: #d5ddd3; font-size: .93rem; }
.history strong { font-weight: 665; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: .2rem 0 .45rem; color: var(--muted); line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 42rem) {
  .details { grid-template-columns: 1fr; gap: .85rem; margin-top: .85rem; }
}
