:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #18212f;
  --muted: #5a6a7f;
  --line: #d8e0ea;
  --accent: #005ea8;
  --accent-soft: #e8f1fb;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.wrap {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(135deg, #0e2742, #154a78);
  color: #fff;
  padding: 2rem 0 1.5rem;
}
.site-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
}
.lede { margin: 0; color: #d7e7f7; }

.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.site-nav .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem 0;
}
.site-nav a {
  text-decoration: none;
  color: var(--accent);
  font-size: 0.93rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0.4rem;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--accent-soft);
  outline: none;
}
.annex-nav-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

main { padding: 1.2rem 0 2rem; }
.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem 1rem 1.1rem;
  margin-bottom: 1rem;
}
.section h2 {
  margin-top: 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
}
.muted { color: var(--muted); }

.table-wrap { overflow-x: auto; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 780px;
}
th, td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.55rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}
th {
  background: #f2f6fb;
  font-weight: 650;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.7rem;
}
.card {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.8rem;
  background: #fbfdff;
}
.card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.card .meta {
  font-size: 0.86rem;
  color: var(--muted);
}
.annex-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.annex-quicklinks a {
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #c8ddf4;
  border-radius: 999px;
  font-size: 0.82rem;
  padding: 0.18rem 0.5rem;
}
.status-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 650;
  color: #0a4d23;
  background: #e6f6eb;
  border: 1px solid #b9e5c7;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
}
.annex-card a {
  color: var(--accent);
}

.plot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.8rem;
}
.plot-card {
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.8rem;
}
.plot-card h3 { margin-top: 0; }
.plot-box {
  border: 2px dashed #a6bad3;
  background: #f8fbff;
  border-radius: 0.5rem;
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 600;
}

.status {
  font-size: 0.92rem;
  color: var(--muted);
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.55rem 0.65rem;
}
.markdown-view {
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.8rem;
  background: #fff;
  white-space: pre-wrap;
}

.site-footer {
  padding: 1rem 0 2rem;
  color: var(--muted);
}

/* Blending Calculator */
.calc-note {
  background: #fffbe6;
  border: 1px solid #e8d48b;
  border-radius: 0.5rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  color: #5a4e1a;
  margin-bottom: 1rem;
}
.calc-controls {
  margin-bottom: 1rem;
}
.calc-ratios {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.calc-ratios label {
  font-weight: 600;
  font-size: 0.92rem;
}
.ratio-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.ratio-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: var(--accent-soft);
  border: 1px solid #c8ddf4;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.88rem;
}
.ratio-field {
  width: 3.2rem;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  text-align: right;
  font-family: inherit;
  color: var(--text);
  outline: none;
}
.ratio-field:focus { background: #fff; border-radius: 4px; }
.btn-small {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  font-size: 0.85rem;
  padding: 0.3rem 0.65rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-family: inherit;
}
.btn-small:hover { background: var(--accent-soft); }
.btn-calc {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-calc:hover { background: #004a85; }

.calc-table { min-width: 900px; }
.calc-table th, .calc-table td { font-size: 0.88rem; padding: 0.4rem 0.5rem; }
.calc-table input[type="number"] {
  width: 5.5rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  padding: 0.25rem 0.35rem;
  font-size: 0.86rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.calc-table input[type="number"]:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}
.calc-table .group-header {
  background: #f2f6fb;
  font-weight: 650;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge { 
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 650;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-pass { background: #e6f6eb; color: #0a4d23; border: 1px solid #b9e5c7; }
.badge-margin { background: #fff7e0; color: #6b5a00; border: 1px solid #e8d48b; }
.badge-fail { background: #fde8e8; color: #8b1a1a; border: 1px solid #f0b8b8; }
.badge-na { background: #f0f2f5; color: var(--muted); border: 1px solid var(--line); }
.blend-val { font-weight: 600; }

/* Commercial Projects */
.projects-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  align-items: center;
}
.filter-group-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
  margin-right: 0.15rem;
}
.proj-pre-construction { background: #fef3e0; color: #7a5400; border: 1px solid #e8c96b; }
.filter-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.filter-btn:hover { background: var(--accent-soft); color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.annex-group-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--text);
}
.annex-project-group { margin-bottom: 1.2rem; }
.blend-tag {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  background: #f2f6fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.proj-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.65rem;
}
.proj-card {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.75rem 0.85rem;
  background: #fbfdff;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.proj-card-co { border-left: 3px solid #c8ddf4; }
.proj-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.proj-card-header strong { font-size: 0.95rem; }
.proj-card-meta { font-size: 0.84rem; color: var(--muted); }
.proj-card-detail { font-size: 0.86rem; }
.proj-card-notes { font-size: 0.84rem; color: #3a4a5e; line-height: 1.45; }
.proj-card-sources { font-size: 0.8rem; margin-top: 0.2rem; }
.proj-card-sources a { color: var(--accent); text-decoration: none; }
.proj-card-sources a:hover { text-decoration: underline; }

.proj-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 650;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.proj-operating { background: #e6f6eb; color: #0a4d23; border: 1px solid #b9e5c7; }
.proj-commissioning { background: #e8f1fb; color: #1a5a9e; border: 1px solid #b0cfe8; }
.proj-construction { background: #fff7e0; color: #6b5a00; border: 1px solid #e8d48b; }
.proj-announced { background: #f0f2f5; color: var(--muted); border: 1px solid var(--line); }
.proj-inactive { background: #fde8e8; color: #8b1a1a; border: 1px solid #f0b8b8; }
.proj-demo { background: #f3eeff; color: #5a3d8e; border: 1px solid #d4c5f0; }

.projects-supplementary { margin-top: 0.5rem; }

@media (max-width: 620px) {
  .section { padding: 0.85rem; }
  th, td { font-size: 0.88rem; }
}
