:root {
  color-scheme: light;
  --canvas: #eef0e9;
  --paper: #fbfcf7;
  --ink: #202920;
  --subtle: #546051;
  --line: #d7ddd0;
  --green: #263f33;
  --accent: #e4edca;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--green); text-underline-offset: .18em; }
a:hover { color: #486849; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .66; }
:focus-visible { outline: 3px solid #4a7456; outline-offset: 3px; }

.masthead { border-bottom: 1px solid var(--line); background: var(--paper); }
.masthead-inner {
  min-height: 72px;
  max-width: 1056px;
  margin-inline: auto;
  padding: 12px 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 26px;
}
.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.22rem;
  letter-spacing: -.045em;
  font-weight: 760;
}
nav { display: flex; gap: clamp(12px, 2.5vw, 30px); align-items: center; }
nav a, .quiet { color: var(--subtle); font-size: .91rem; font-weight: 625; text-decoration: none; }
nav a[aria-current] { color: var(--green); text-decoration: underline; }
.quiet { background: transparent; border: 0; padding: 4px 0; }
.quiet:hover { text-decoration: underline; }

main { max-width: 1056px; margin-inline: auto; padding: clamp(38px, 8vw, 82px) 26px 64px; }
main:focus { outline: none; }
.loading { color: var(--subtle); }
.narrow { max-width: 456px; margin: 14px auto 0; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(22px, 4vw, 34px);
}
.auth-card { box-shadow: 0 8px 28px #25332209; }
h1, h2, p { margin: 0; }
h1 {
  font-family: Charter, Georgia, serif;
  font-size: clamp(2.25rem, 6vw, 4.1rem);
  line-height: 1.03;
  letter-spacing: -.055em;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.narrow h1 { font-size: clamp(2.1rem, 6vw, 2.8rem); }
h2 { font-size: 1.1rem; font-weight: 690; letter-spacing: -.02em; }
p.muted, .loading { color: var(--subtle); }
.heading { margin-bottom: 26px; }
.heading p { margin-block: 6px; }
.narrow p.muted { margin-top: 12px; }
form { display: grid; gap: 16px; margin-block: 26px 0; }
label { display: grid; gap: 6px; font-weight: 630; font-size: .91rem; }
input {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  border-radius: 8px;
  border: 1px solid #bfc9b9;
  background: white;
}
.action {
  border: 1px solid var(--green);
  background: var(--green);
  border-radius: 9px;
  color: #f5f8ef;
  padding: 10px 16px;
  font-weight: 660;
}
.action:hover { background: #344e40; }
.secondary { color: var(--green); background: var(--paper); }
.secondary:hover { background: #e8eddf; }
.error { color: #982c23; font-size: .92rem; }
.switch, .password-help { color: var(--subtle); font-size: .9rem; }
.switch { margin-top: 23px; }
.password-help { margin-top: -10px; }

.balance {
  color: var(--accent);
  background: var(--green);
  border-color: var(--green);
  margin-bottom: 18px;
}
.balance h2 { color: #f3f5e8; }
.balance-value { margin-block: 12px 15px; }
.balance-value strong, .return-balance strong {
  font-family: Charter, Georgia, serif;
  font-weight: 500;
  font-size: clamp(3.6rem, 10vw, 6.1rem);
  letter-spacing: -.085em;
  line-height: 1;
}
.balance-value span, .return-balance span { font-size: 1.2rem; }
.billing-link { color: #f3f5e8; font-weight: 600; }
.billing-link:hover { color: white; }
.balance a:focus-visible { outline-color: var(--accent); }
.history h2 { margin-bottom: 15px; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows li {
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  padding-block: 11px;
  border-top: 1px solid var(--line);
}
.rows time, .rows .empty { color: var(--subtle); font-size: .9rem; }
.rows strong { color: var(--green); white-space: nowrap; }
.history-grid { display: grid; gap: 18px; margin-top: 18px; grid-template-columns: 1fr 1.2fr; }
.membership-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.membership p + p { margin-top: 8px; }
.membership-actions:not(:empty) { margin-top: 18px; }
.pill { padding: 3px 9px; background: #e6edd9; color: var(--green); border-radius: 20px; font-size: .82rem; font-weight: 650; }
.return-balance { margin: 16px 0 20px; }
@media (max-width: 680px) {
  .history-grid { grid-template-columns: 1fr; }
  .masthead-inner, main { padding-inline: 18px; }
}
