:root {
  color-scheme: light;
  --ink: #183d43;
  --quiet: #4e6567;
  --sea: #21736e;
  --foam: #e1eeea;
  --line: #d2e0da;
  --paper: #fffdf7;
  font-family: "Strichpunkt Sans", system-ui, sans-serif;
  color: var(--ink);
  background: #f5f3e9;
}
* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(160deg, #fff9eb 0%, #edf4ef 48%, #f5f3e9 100%); min-height: 100vh; }
a { color: #1d645f; text-underline-offset: .22em; }
:focus-visible { outline: 3px solid #a65633; outline-offset: 3px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(20px, calc((100% - 1180px) / 2)); background: #fffefa; border-bottom: 1px solid var(--line);
}
.topbar img { display: block; width: clamp(132px, 18vw, 196px); height: auto; }
.topbar nav { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px 20px; font-size: .88rem; font-weight: 650; }
main { max-width: 1220px; margin: auto; padding: clamp(22px, 4vw, 48px) 20px 50px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 18px 24px; flex-wrap: wrap; }
h1 { font-family: Petrona, Georgia, serif; font-weight: 400; font-size: clamp(2.1rem, 5vw, 3.65rem); line-height: 1.05; margin: 0 0 8px; letter-spacing: -.04em; }
h2 { font-size: 1.17rem; margin: 0 0 5px; line-height: 1.2; }
p { margin: 0; color: var(--quiet); line-height: 1.45; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.controls label { font-weight: 650; font-size: .87rem; }
button, select {
  min-height: 42px; padding: 8px 12px; border: 1px solid #92b4a8; border-radius: 8px;
  background: #fffefa; color: var(--ink); font: inherit; font-weight: 650;
}
button { cursor: pointer; background: var(--sea); color: white; border-color: var(--sea); }
button:disabled { opacity: .56; cursor: default; }
.status { margin: 16px 0; padding: 10px 12px; background: #ecf4eb; border-left: 3px solid var(--sea); border-radius: 6px; }
.status:empty { display: none; }
.totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 14px; }
.tile, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: clamp(14px, 2.4vw, 23px); }
.tile { border-top: 3px solid #4e998c; }
.tile:nth-child(even) { border-top-color: #c9885f; }
.tile h2 { font-size: .95rem; }
.tile strong { display: block; font-size: clamp(1.65rem, 3.8vw, 2.7rem); font-weight: 700; line-height: 1.12; margin: 6px 0; font-variant-numeric: tabular-nums; }
.tile p, .panel p { font-size: .9rem; }
.panel { margin-bottom: 14px; }
.trend header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; }
.period { font-variant-numeric: tabular-nums; }
.plot { height: clamp(135px, 24vw, 220px); display: grid; grid-template-columns: 3em minmax(0, 1fr); margin-top: 20px; }
.scale { display: flex; flex-direction: column; justify-content: space-between; color: var(--quiet); font-size: .78rem; }
.columns {
  display: flex; align-items: end; gap: clamp(1px, .35vw, 5px);
  background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 25%); border-top: 1px solid var(--line);
}
.column { flex: 1 1 0; min-width: 0; height: var(--height); background: linear-gradient(#4c9c91, #216d66); border-radius: 4px 4px 0 0; }
.column.latest { background: #a35e3c; }
.axis { margin: 5px 0 12px 3em; display: flex; justify-content: space-between; font-size: .8rem; color: var(--quiet); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.breakdown { display: grid; gap: 8px; margin: 14px 0 0; }
.breakdown div { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
.breakdown dt { font-size: .91rem; }
.breakdown dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.breakdown .track { grid-column: 1 / -1; display: block; height: 5px; margin-top: 4px; border-radius: 6px; overflow: hidden; background: var(--foam); }
.track span { display: block; width: var(--width); height: 100%; border-radius: inherit; background: #418d80; }
table { border-collapse: collapse; width: 100%; margin-top: 12px; font-size: .9rem; }
th, td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
tr > :first-child { text-align: left; }
tbody th { font-weight: 600; }
tbody tr:nth-child(even) { background: #edf3ed; }
summary { cursor: pointer; color: #1d645f; font-weight: 700; }
.methodology p { margin-top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) { .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 550px) { .grid { grid-template-columns: 1fr; } .topbar nav { gap: 4px 10px; } .controls label { width: 100%; } }

.sign-in { display: grid; min-height: 100svh; place-items: center; }
.sign-in main { width: min(100%, 510px); }
.sign-in .panel { margin: 0; padding: clamp(24px, 7vw, 40px); text-align: center; box-shadow: 0 12px 35px #183d4310; }
.sign-in-logo { display: block; width: min(250px, 100%); margin: 0 auto 22px; }
.sign-in-logo img { display: block; width: 100%; height: auto; }
.sign-in h1 { font-size: clamp(2rem, 7vw, 2.85rem); }
.sign-in-note { margin-top: 8px; font-size: .9rem; }
.signed-out { margin: 12px 0; padding: 8px 12px; border-radius: 8px; background: var(--foam); color: var(--ink); font-weight: 650; }
.signed-out:not(:target) { display: none; }
.sign-in-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; margin: 22px 0 17px;
  padding: 8px 20px; border-radius: 8px; background: var(--sea); color: white; font-weight: 700; text-decoration: none;
}
.sign-in-button:hover { background: #185e5a; }
.sign-in nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; font-size: .87rem; }

.account-form { display: grid; gap: 7px; width: min(100%, 410px); margin: 16px 0; text-align: left; }
.sign-in .account-form { margin: 18px auto; }
.account-form[hidden] { display: none; }
.account-form label { font-size: .9rem; font-weight: 650; }
.account-form input { min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid #92b4a8; border-radius: 8px; background: white; color: var(--ink); font: inherit; }
.account-form input + label { margin-top: 4px; }
.account-form small { color: var(--quiet); }
.account-form button { margin-top: 6px; }
.account-form p:empty, #session-status:empty, #account-status:empty { display: none; }
.account-details { margin-top: 16px; }
.account-details summary + p { margin-top: 8px; }
.topbar nav { align-items: center; }
#sign-out { min-height: 35px; padding: 5px 9px; }
#account-rows button { min-height: 32px; padding: 3px 8px; font-size: .85rem; }
