/* Compile Once, Serve Many — paper tables, calculator, print. */

.article-body .paper-meta {
  margin: 0 0 1.6em;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.article-body .paper-meta strong {
  color: var(--ink);
}

.article-exec {
  margin: 0 0 1.8em;
  padding: 1.1em 1.15em 1.15em;
  border: 1px solid var(--line);
  border-left: 4px solid var(--article-teal);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--surface) 88%, var(--article-rail) 12%);
}

.article-exec h2 {
  margin-top: 0;
}

.article-sdg {
  margin: 0 0 1.8em;
  padding: 1.05em 1.15em 1.1em;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  border-radius: 0 10px 10px 0;
  background: var(--surface);
}

.article-sdg h2 {
  margin-top: 0;
}

.article-sdg p:last-child {
  margin-bottom: 0;
}

.article-body table.paper-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.5em;
  font-size: 0.88rem;
}

.article-body table.paper-table th,
.article-body table.paper-table td {
  padding: 0.45em 0.5em;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

.article-body table.paper-table th:first-child,
.article-body table.paper-table td:first-child {
  text-align: left;
}

.article-body table.paper-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-table-note {
  margin: 0 0 1.6em;
  color: var(--muted);
  font-size: 0.86rem;
}

.refs ol {
  padding-left: 1.3em;
}

.refs li {
  margin: 0 0 0.55em;
  color: var(--ink);
  font-size: 0.92rem;
}

.refs a {
  font-weight: 600;
}

button.article-button {
  appearance: none;
  cursor: pointer;
  font: inherit;
}

.hea-calc {
  display: grid;
  gap: 16px;
  margin: 0 0 1.8em;
}

.hea-calc-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.hea-calc-field label {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hea-calc-field input,
.hea-calc-field select {
  width: 100%;
  box-sizing: border-box;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.hea-calc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.hea-calc-stat {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.hea-calc-stat b {
  display: block;
  color: var(--ink);
  font-size: 1.15rem;
}

.hea-calc-stat span {
  color: var(--muted);
  font-size: 0.78rem;
}

@media (prefers-color-scheme: dark) {
  .hea-calc-controls,
  .hea-calc-stat,
  .article-exec,
  .article-sdg {
    background: var(--surface);
  }

  .hea-calc-field input,
  .hea-calc-field select {
    background: var(--bg);
    color: var(--ink);
    border-color: var(--line);
  }
}

@media print {
  .hea-header,
  .article-rail,
  .article-guide-band,
  #hea-footer-placeholder,
  .article-actions,
  .no-print,
  .hea-nav-util {
    display: none !important;
  }

  body.hea-article-page,
  body.hea-articles-index-page {
    background: #fff;
    color: #111;
  }

  .article-layout {
    display: block !important;
  }

  .article-hero-inner,
  .article-shell {
    width: auto;
    max-width: none;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.78em;
    font-weight: 400;
    color: #444;
  }

  .refs a[href^="http"]::after {
    content: none;
  }

  @page {
    size: A4;
    margin: 16mm 14mm;
  }
}
