:root {
  color-scheme: light;
  --page: #f8f7f2;
  --paper: #fffefa;
  --ink: #1d2721;
  --muted: #59665d;
  --line: #dedfd5;
  --accent: #264937;
  --active: #dce8d7;
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, p, ul, dl, dd { margin: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(2.35rem, 6vw, 3.4rem); font-weight: 400; line-height: 1.04; letter-spacing: -.045em; margin-bottom: 1.4rem; }
h2 { font-size: 1.12rem; font-weight: 650; }
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header-inner { max-width: 69rem; padding: 1rem clamp(1rem, 4vw, 2rem); min-height: 4.5rem; margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-size: 1.16rem; font-weight: 700; letter-spacing: -.045em; text-decoration: none; }
.mark { display: inline-block; width: 1.52rem; height: 1.52rem; border: 1px solid var(--accent); border-radius: .48rem; background: radial-gradient(circle at 50% 50%, var(--accent) 0 12%, transparent 13% 27%, var(--accent) 28% 33%, transparent 34%), var(--active); }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1.25rem; }
nav a, .text-button { font-size: .9rem; text-decoration: none; color: var(--muted); }
nav [aria-current=page] { color: var(--ink); font-weight: 700; }
nav form { position: relative; }
.text-button { background: transparent; border: 0; padding: .35rem 0; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.signout-error { position: absolute; top: 100%; right: 0; background: var(--paper); width: 13rem; padding: .75rem; border: 1px solid var(--line); }
main { padding: clamp(2rem, 8vw, 4.5rem) 1rem 4rem; margin-inline: auto; }
.wide { max-width: 62rem; }
.narrow { max-width: 32rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1.25rem, 5vw, 2rem); }
.auth-panel { padding: clamp(1.35rem, 6vw, 2.5rem); }
.auth-panel h1 { font-size: clamp(2rem, 7vw, 2.85rem); }
.intro { color: var(--muted); line-height: 1.55; margin-bottom: 1rem; }
label { display: block; font-size: .9rem; font-weight: 650; margin-top: .95rem; margin-bottom: .3rem; }
input:not([type=submit]) { width: 100%; min-height: 2.8rem; border-radius: .5rem; border: 1px solid #bfc6ba; background: var(--paper); padding: .55rem .7rem; color: var(--ink); }
input, button { font: inherit; }
:focus-visible { outline: 2px solid #396149; outline-offset: 3px; }
.primary { display: inline-block; min-height: 2.8rem; font-weight: 650; border: 0; border-radius: .5rem; background: var(--accent); color: white; padding: .65rem 1rem; cursor: pointer; text-decoration: none; }
.primary:hover { background: #19392a; }
.primary:disabled { opacity: .65; cursor: wait; }
.auth-panel .primary { width: 100%; margin-top: 1.25rem; }
.settings-grid .primary { margin-top: 1rem; }
.hint, .account-switch { color: var(--muted); font-size: .875rem; line-height: 1.45; margin-top: .55rem; }
.account-switch { border-top: 1px solid var(--line); margin-top: 1.7rem; padding-top: 1.15rem; }
.error, .notice { border-radius: .55rem; padding: .75rem 1rem; margin-bottom: 1rem; line-height: 1.45; }
.error { color: #7c2821; background: #f7e6e2; }
ul.error { padding-left: 2rem; }
.notice { color: #1e452d; background: var(--active); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.balance-panel { background: #e9efe3; border-color: #d7e0d2; }
.balance-value { font-family: Georgia, serif; letter-spacing: -.07em; font-size: clamp(4.25rem, 12vw, 6.25rem); line-height: 1; margin-top: .5rem; }
.balance-caption, time { color: var(--muted); font-size: .875rem; }
.pack-price { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-top: 1rem; font-family: Georgia, serif; font-size: clamp(1.35rem, 4.5vw, 2rem); }
.pack-price strong { color: var(--accent); }
.pack-panel .intro { margin-top: .45rem; }
.activity-section { margin-top: 2.2rem; }
.activity-section h2 { margin-bottom: .75rem; }
.empty { color: var(--muted); }
.activity-list { list-style: none; padding: 0; }
.activity-list li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: 1rem 1.25rem; }
.activity-list li + li { border-top: 1px solid var(--line); }
.activity-list div time { display: block; margin-top: .25rem; }
.receipt-link { margin-left: auto; font-size: .875rem; }
.credit { color: var(--accent); font-weight: 700; white-space: nowrap; }
.details { display: grid; gap: .2rem; margin-top: 1rem; }
.details dt { color: var(--muted); font-size: .875rem; }
.details dd { margin-bottom: .9rem; overflow-wrap: anywhere; }
.monospace { font-family: ui-monospace, monospace; font-size: .875rem; }
.back { display: inline-block; margin-bottom: 1rem; }
.return-balance { margin-bottom: .5rem; }
@media (max-width: 40rem) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .activity-list li { padding-inline: .8rem; }
}
