* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #f3f1ea;
  color: #1c1c1c;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

a { color: var(--olive); }

.site-header {
  background: var(--ink);
  color: #fff;
}

.header-inner, .site-footer .footer-inner, main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: #fff;
  text-decoration: none;
}

.brand img { height: 46px; width: auto; display: block; }

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.1;
}

.brand-name span {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.nav a[aria-current="page"] { color: var(--green); }

.who { color: #d9d9d9; font-size: 0.85rem; white-space: nowrap; }

.linkish {
  background: transparent;
  color: #fff;
  border: 0;
  font: 600 0.95rem/1 var(--sans);
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.banner {
  background: #fff3cd;
  color: #1c1c1c;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.55rem 1rem;
  text-align: center;
}

main { padding: 1.6rem 0 3rem; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.6rem;
}

h1 { font-size: 2.1rem; }

h2 {
  font-size: 1.55rem;
  border-bottom: 2px solid var(--green);
  padding-bottom: 0.3rem;
}

.kicker {
  display: block;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 0.2rem;
}

.lede, .caption { color: #333; max-width: 70ch; }

.caption { font-size: 0.85rem; margin-top: 0.35rem; }

.block { margin: 1.6rem 0 2rem; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.9rem;
}

.card {
  background: var(--green);
  color: #111;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.95rem 1.05rem 1rem;
  min-height: 7.4rem;
}

.card.missing {
  background: #f0f0f0;
  box-shadow: none;
  border: 1px dashed #999;
}

.card-title {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
}

.card-value {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.05;
  margin: 0.4rem 0 0.3rem;
}

.card.missing .card-value { font-size: 1.15rem; color: #555; }

.delta { font-size: 0.85rem; font-weight: 700; }
.delta.up { color: #14381c; }
.delta.down { color: #6d1814; }
.delta.flat { color: #333; }
.card .delta.up::before { content: "▲ "; }
.card .delta.down::before { content: "▼ "; }

.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.panel {
  background: #fff;
  border-radius: 1em;
  padding: 1rem 1.1rem 1.15rem;
}

.panel.dark { background: var(--ink); color: #fff; }
.panel.dark h3 { color: #fff; }

.panel h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.panel ul { margin: 0; padding-left: 1.1rem; }
.panel li { margin: 0.25rem 0; }

.two-col {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.chart-wrap svg { display: block; width: 100%; height: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-top: 0.4rem;
}

thead th {
  text-align: right;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #555;
  font-weight: 700;
  border-bottom: 2px solid var(--ink);
  padding: 0.4rem 0.45rem;
  background: #f6f6f6;
}

thead th:first-child, tbody th { text-align: left; }

tbody th, tbody td {
  padding: 0.38rem 0.45rem;
  border-bottom: 1px solid #e4e4e4;
}

tbody td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-scroll { overflow-x: auto; }

.form-panel {
  display: grid;
  gap: 0.9rem;
}

fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0; }
code { font-size: 0.92em; }
.chart-gap { margin-top: 1rem; }

.choices, .field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  align-items: start;
}

.field {
  display: grid;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.92rem;
}

label.choice {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  font-weight: 600;
  font-size: 0.95rem;
}

label.choice input { margin: 0; }

input, select {
  font: 500 1rem/1.3 var(--sans);
  padding: 0.45rem 0.55rem;
  border: 1px solid #b9b9b9;
  border-radius: 0.6rem;
  background: #fff;
  color: #111;
}

input:disabled, select:disabled { background: #eee; color: #666; }

.hint { font-weight: 500; color: #555; font-size: 0.85rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }

button, .button {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font: 700 0.95rem/1 var(--sans);
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.form-error {
  background: #f8e6e4;
  border: 1px solid #e3b2ad;
  border-radius: 0.8rem;
  padding: 0.7rem 0.9rem;
  font-weight: 700;
}

.login-wrap {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.4rem 1.5rem;
}

.login-card form { display: grid; gap: 0.8rem; }

.site-footer {
  background: var(--footer);
  color: #ccc;
  padding: 0.8rem 0;
  font-size: 0.85rem;
}

.site-footer strong { color: var(--green); font-weight: 700; }

.footer-inner { display: flex; justify-content: space-between; gap: 1rem; }

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .grid-cards, .charts, .two-col { grid-template-columns: 1fr; }
  .header-inner { align-items: flex-start; flex-direction: column; }
  .footer-inner { flex-direction: column; }
}
