:root {
  --paper: #f4efe6;
  --card: #fffdf8;
  --ink: #14263c;
  --ink-2: #22395a;
  --muted: #3e4c60;
  --line: #ddd4c7;
  --line-strong: #c3b8a8;
  --spine: #0e5e5b;
  --spine-soft: #e3eeeb;
  --amber: #8a4b12;
  --amber-bright: #e7b15a;
  --field: #fffdf8;
  --field-line: #b9ad9b;
  --danger: #8c3129;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 38, 60, 0.06), 0 4px 14px rgba(20, 38, 60, 0.05);
  --shadow-hover: 0 2px 4px rgba(20, 38, 60, 0.08), 0 10px 24px rgba(20, 38, 60, 0.09);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { background: var(--paper); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  transform: translateY(-200%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  z-index: 30;
}

.skip:focus { transform: none; }

.shell {
  width: min(72rem, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Header */

.site-header {
  position: relative;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--amber-bright);
}

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding: 0.8rem 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--paper);
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.logo-mark { width: 2rem; height: 2rem; display: block; flex: none; }

.logo-tile { fill: var(--ink-2); }

.logo-word {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.logo-accent { font-weight: 500; color: var(--amber-bright); }

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.25rem;
  font-size: 0.95rem;
}

.site-header nav > a,
.nav-categories summary {
  color: var(--paper);
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  text-decoration: none;
}

.nav-categories summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  cursor: pointer;
  font: inherit;
  background: none;
  border: 0;
}

.nav-categories summary::-webkit-details-marker { display: none; }

.nav-categories summary::after {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.08rem) rotate(45deg);
}

.nav-categories[open] summary::after {
  transform: translateY(0.08rem) rotate(225deg);
}

.site-header nav > a:hover,
.site-header nav > a:focus-visible,
.nav-categories summary:hover,
.nav-categories summary:focus-visible,
.nav-categories[open] summary {
  background: rgba(244, 239, 230, 0.12);
}

.site-header nav > a[aria-current="page"] {
  color: var(--ink);
  background: var(--amber-bright);
}

.nav-categories { position: relative; }

.nav-categories ul {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: auto;
  right: 0;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  box-sizing: border-box;
  min-width: 15.5rem;
  width: max-content;
  max-width: min(20rem, calc(100vw - 2rem));
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  z-index: 21;
}

/* On narrow screens the Categories control sits toward the left after the
   header wraps, so a right-anchored panel would overflow the viewport.
   Position the menu against the header instead, as a full-width panel. */
@media (max-width: 860px) {
  .nav-categories { position: static; }
  .nav-categories ul {
    left: 0;
    right: 0;
    width: auto;
    min-width: 0;
    max-width: 100%;
    border-radius: 0;
  }
}

.nav-categories a {
  display: block;
  color: var(--ink);
  padding: 0.4rem 0.9rem;
  text-decoration: none;
}

.nav-categories a:hover,
.nav-categories a:focus-visible {
  background: var(--spine-soft);
  color: var(--spine);
}

.nav-categories a[aria-current="page"] {
  font-weight: 600;
  background: var(--spine-soft);
  color: var(--ink);
}

/* Type */

main { padding: 2.4rem 0 4rem; }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); }

h1 {
  margin: 0.3rem 0 0.8rem;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.25;
}

h3 { font-size: 1.2rem; font-weight: 500; line-height: 1.3; }

.lede { font-size: 1.2rem; line-height: 1.55; margin: 0; max-width: 44rem; color: var(--muted); }

.kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

a { color: var(--spine); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }

a:hover { text-decoration-thickness: 2px; }

/* Homepage */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, 16.5rem);
  gap: 1.4rem 2rem;
  align-items: center;
  max-width: none;
  margin: 0.4rem 0 2.2rem;
}

.hero-copy { min-width: 0; }

.hero .lede { margin-top: 0.35rem; }

.hero-graphic { margin: 0; }

.hero-graphic svg {
  width: 100%;
  height: auto;
  display: block;
}

.featured { margin: 0 0 2.3rem; }

.featured-card {
  display: block;
  max-width: 40rem;
  padding: 1.15rem 1.3rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
}

.featured-card:hover,
.featured-card:focus-within {
  border-color: var(--spine);
  box-shadow: var(--shadow-hover);
}

.featured-card .kicker { margin-bottom: 0.2rem; }

.featured-card h3 {
  margin: 0 0 0.25rem;
  color: var(--ink);
}

.featured-card h3 a {
  color: inherit;
  text-decoration: none;
}

.featured-card h3 a:hover,
.featured-card h3 a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.featured-card p { margin: 0; color: var(--muted); }

.catalog { margin: 2.2rem 0 1.2rem; }

.catalog-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.catalog-list a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}

.catalog-list a:hover,
.catalog-list a:focus-visible {
  border-color: var(--spine);
  color: var(--spine);
}

.catalog-list .count {
  color: var(--muted);
  font-size: 0.85rem;
}

.directory > h2 { margin-bottom: 1rem; }

.groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.directory .groups {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.groups section {
  padding: 1.2rem 1.3rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.groups section > p { margin: 0.2rem 0 0.4rem; }

.directory h3 { margin: 0; }

.category-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: -0.35rem -0.5rem 0;
  padding: 0.35rem 0.5rem;
  color: var(--ink);
  font-size: 1.35rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background-color 120ms ease, color 120ms ease;
}

.category-link:hover,
.category-link:focus-visible {
  background: var(--spine-soft);
  color: var(--spine);
}

.category-link:hover span:not(.category-arrow) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }

.category-arrow {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 1.1rem;
  color: var(--spine);
  transition: transform 120ms ease;
}

.category-link:hover .category-arrow,
.category-link:focus-visible .category-arrow { transform: translateX(3px); }

.category-mark {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0.25rem;
  flex: none;
  color: var(--spine);
  background: var(--spine-soft);
  border-radius: 8px;
}

.tool-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.tool-list li { border-bottom: 1px solid var(--line); }

.tool-list .entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 0.4rem;
  border-radius: var(--radius-sm);
}

.tool-list .entry::after {
  content: "›";
  margin-left: auto;
  color: var(--line-strong);
  font-size: 1.2rem;
  line-height: 1;
}

.tool-list .entry:hover { background: var(--paper); }

.tool-list .entry:hover::after { color: var(--spine); }

.directory .tool-list .entry-name {
  font-family: var(--sans);
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-list .entry:hover .entry-name { text-decoration: underline; }

.more {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Directory entries on category pages */

.heading-link { color: var(--ink); text-decoration: none; }

.heading-link:hover,
.heading-link:focus-visible { color: var(--spine); text-decoration: underline; text-decoration-thickness: 1px; }

.heading-link::after {
  content: " →";
  font-family: var(--sans);
  font-size: 0.85em;
  color: var(--spine);
}

.entry {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.entry-name {
  color: var(--spine);
  font-family: var(--serif);
  font-size: 1.2rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.entry:hover .entry-name { text-decoration-thickness: 2px; }

.entry-desc { color: var(--muted); font-size: 0.97rem; }

.crumbs { margin: 0 0 1.1rem; font-size: 0.9rem; color: var(--muted); }

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.45rem;
  color: var(--line-strong);
}

/* Calculators */

.workbench {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.8rem 0 2.6rem;
  align-items: start;
}

.workbench.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.calc {
  margin: 0;
  padding: 1.2rem 1.3rem 1.3rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--spine);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.shell > .calc { max-width: 46rem; margin: 1.8rem 0 2.6rem; }

.shell > .calc .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.calc h2 { font-size: 1.3rem; }

.fields { display: grid; gap: 0.8rem 1rem; margin: 0.7rem 0 1rem; }

.field { display: grid; gap: 0.3rem; align-content: start; }

label, .check { font-size: 0.9rem; font-weight: 600; }

.check { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 400; }

input, select, button { font: inherit; }

input[type="text"], select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input[type="text"]:hover, select:hover { border-color: var(--muted); }

button {
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease;
}

button:hover { background: var(--ink-2); }

.copy {
  margin-top: 0.7rem;
  color: var(--ink);
  background: transparent;
  border-color: var(--field-line);
}

.copy:hover { background: #ece5d9; }

:focus-visible {
  outline: 3px solid var(--amber-bright);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--ink);
}

.hint, .message, .source, .site-footer p { font-size: 0.93rem; color: var(--muted); }

.message[hidden], .result[hidden] { display: none; }

.message:not([hidden]) { color: var(--danger); }

.result {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--spine-soft);
  border-radius: var(--radius-sm);
}

.result-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-value {
  margin: 0.15rem 0 0;
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.result-unit { margin: 0.15rem 0 0; color: var(--muted); }

/* Method and prose */

.method { max-width: 44rem; }

.method h2 { margin-top: 2.2rem; }

.method p, .method li { line-height: 1.7; }

.formula {
  padding: 0.6rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber-bright);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  overflow-x: auto;
}

.related {
  margin-top: 2.8rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-strong);
}

.related h2 { font-size: 1.2rem; }

.related ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.related a {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
}

.related a:hover { border-color: var(--spine); text-decoration: underline; }

/* Footer */

.site-footer {
  background: #ebe4d8;
  border-top: 1px solid var(--line);
  padding: 2rem 0 1.6rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(12rem, 1.35fr) repeat(3, minmax(9rem, 1fr));
  gap: 1.6rem 2rem;
  align-items: start;
}

.footer-brand { max-width: 22rem; }

.footer-wordmark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.55rem;
  color: var(--ink);
  line-height: 1;
}

.footer-wordmark a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
}

.footer-wordmark .logo-mark { width: 1.75rem; height: 1.75rem; }

.footer-wordmark .logo-word { font-size: 1.1rem; }

.site-footer .logo-accent { color: var(--amber); }

.footer-tagline {
  margin: 0 0 0.45rem;
  color: var(--ink);
}

.site-footer p { margin: 0; }

.footer-heading {
  margin: 0 0 0.65rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.3;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col a {
  color: var(--ink);
  text-decoration: none;
}

.footer-col a:hover,
.footer-col a:focus-visible {
  color: var(--spine);
  text-decoration: underline;
}

.footer-col a[aria-current="page"] { font-weight: 600; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.footer-bottom p { color: var(--muted); }

.shell > .lede { margin-bottom: 2rem; }

.directory .groups section { display: flex; flex-direction: column; }

.directory .more { margin-top: auto; padding-top: 0.85rem; }

@media (max-width: 1100px) {
  .directory .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .groups, .directory .groups, .workbench, .workbench.cols-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; margin-bottom: 1.8rem; }
  .hero-graphic { max-width: 13.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  main { padding-top: 1.6rem; }
  h1 { font-size: 2.15rem; }
  .shell > .calc .fields { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 2rem); }
  .header-bar { gap: 0.5rem; padding: 0.7rem 0 0.6rem; }
  .site-header nav { margin-inline: -0.65rem; font-size: 0.92rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .footer-brand { max-width: none; }
  .groups section, .calc { padding: 1rem; }
  .lede { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}


/* Charts and data tables */

.shell-chart { width: min(90rem, calc(100% - 2rem)); }

.download-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  margin: 1.2rem 0 1.6rem;
  padding: 0.85rem 1.05rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.download-link {
  display: inline-block;
  font-weight: 650;
  color: var(--paper);
  background: var(--spine);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
}

.download-link:hover, .download-link:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.download-meta { color: var(--muted); font-size: 0.97rem; }

.chart-scroll { overflow-x: auto; margin: 1rem 0 1.6rem; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.95rem;
}

.data-table caption {
  text-align: left;
  caption-side: top;
  font-weight: 600;
  margin-bottom: 0.55rem;
  color: var(--ink);
}

.data-table th, .data-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
  text-align: right;
  white-space: nowrap;
}

.data-table thead th {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-align: right;
}

.data-table tbody th, .split-chart-table td:first-child {
  text-align: left;
  font-weight: 650;
  color: var(--ink);
}

.element-data-table td:nth-child(2),
.element-data-table td:nth-child(3),
.element-data-table td:nth-child(10) {
  text-align: left;
  font-weight: 400;
}

.data-table tbody tr:nth-child(even) { background: #f7f1e8; }

.element-data-table tr:target {
  outline: 2px solid var(--spine);
  background: var(--spine-soft);
}

.fn-ref {
  font-size: 0.72em;
  font-weight: 650;
  margin-left: 0.12em;
}
.fn-ref a { text-decoration: none; }
#fn-thresholds { scroll-margin-top: 5rem; }
.source-list { margin: 0.4rem 0 1rem; padding-left: 1.2rem; }

.source-list li { margin: 0.25rem 0; }

.ptable-wrap { overflow-x: auto; margin: 1rem 0; }

.ptable {
  display: grid;
  grid-template-columns: 2.2rem repeat(18, minmax(3.05rem, 1fr));
  gap: 3px;
  min-width: 62rem;
}

.ptable-cell {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-height: 4.5rem;
  padding: 0.2rem 0.25rem 0.25rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.15;
}

.ptable-cell:hover, .ptable-cell:focus-visible {
  outline: 2px solid var(--spine);
  outline-offset: 0;
  text-decoration: none;
}

.ptable-z { font-size: 0.7rem; color: var(--muted); }

.ptable-sym { font-weight: 700; font-size: 1.05rem; color: var(--ink); }

.ptable-w { font-size: 0.7rem; color: var(--ink); }

.ptable-name {
  font-size: 0.62rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ptable-empty, .ptable-series-gap { min-height: 0; }

.ptable-group, .ptable-period, .ptable-series, .ptable-corner {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ptable-series {
  justify-content: flex-end;
  padding-right: 0.25rem;
  font-size: 0.7rem;
  text-align: right;
}

.ptable-placeholder {
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ptable-placeholder .ptable-sym { font-size: 0.78rem; font-weight: 650; }

.ptable-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 1.5rem;
  font-size: 0.88rem;
  color: var(--ink);
}

.ptable-legend li { display: inline-flex; align-items: center; gap: 0.35rem; }

.legend-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.cat-alkali { background: #f3d6d0; }
.cat-alkaline { background: #f6e3c8; }
.cat-transition { background: #d4e0f0; }
.cat-post { background: #d5e6db; }
.cat-metalloid { background: #e4e8c8; }
.cat-nonmetal { background: #d5ead5; }
.cat-halogen { background: #e4d8f0; }
.cat-noble { background: #d8e4f5; }
.cat-lanthanoid { background: #f0d4b8; }
.cat-actinoid { background: #e8c8b4; }
.cat-unknown { background: #e6e2dc; }

@media (max-width: 560px) {
  .shell-chart { width: calc(100% - 1.25rem); }
}


/* Rowing recruiting chart */
.recruiting-chart th[scope="row"] { font-variant-numeric: tabular-nums; }
.recruiting-chart td, .recruiting-chart th { font-variant-numeric: tabular-nums; }
.recruiting-chart .zone-note {
  text-align: left;
  font-weight: 400;
  white-space: normal;
  min-width: 12rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.recruiting-chart tr.cutoff-row { background: #efe4d2; }
.recruiting-chart tr.is-highlighted {
  outline: 2px solid var(--spine);
  background: var(--spine-soft);
}
.zone-legend { margin-bottom: 0.6rem; }
.typical-range-table td:nth-child(2),
.typical-range-table td:nth-child(3),
.typical-range-table th[scope="row"] {
  text-align: left;
  font-weight: 400;
}
.fields.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .fields.cols-2 { grid-template-columns: 1fr; }
}

.level-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.5rem;
  margin: 0.6rem 0 1.1rem;
}
.level-block { margin: 0 0 0.85rem; }
.level-block h4 { margin: 0 0 0.15rem; font-size: 1.02rem; }
.level-block .example,
.level-block .basis { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.92rem; }
.level-block .estimate { margin: 0 0 0.2rem; }
.level-block .zone-legend { margin: 0.2rem 0 0; }
@media (max-width: 860px) {
  .level-legend { grid-template-columns: 1fr; }
}

.threshold-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0.4rem 0.2rem 0;
  white-space: nowrap;
  font-size: 0.86rem;
}
.threshold-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.55rem;
  margin: 0 0 0.3rem;
}
.threshold-sep { color: var(--muted); }

.tier-mark {
  display: inline-block;
  margin: 0 0.2rem 0.2rem 0;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}
.tier-mark-result {
  background: #ece8e1;
  color: #3e4c60;
  font-weight: 500;
}
.marks-cell {
  text-align: left;
  min-width: 8.5rem;
  white-space: normal;
}
.color-key { margin: 0 0 1rem; }
.color-key-line { margin: 0 0 0.35rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.55rem; }
.color-key-line .key-label { color: var(--muted); font-size: 0.88rem; margin-right: 0.5rem; }
.muted-family { color: var(--muted); font-weight: 400; }
.tier-key-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 0 0 1.25rem;
}
@media (max-width: 860px) {
  .tier-key-grid { grid-template-columns: 1fr; }
}
.tier-key-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tier-key-table caption {
  text-align: left;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
  caption-side: top;
}
.tier-key-table th, .tier-key-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.4rem;
  vertical-align: top;
  text-align: left;
}
.tier-key-table thead th { font-size: 0.82rem; letter-spacing: 0.02em; }
.tier-key-table th[scope="row"] { font-weight: 650; min-width: 10rem; }
.tier-key-table .example, .tier-key-table .basis {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 400;
}
