:root {
  --bg: #f3efe6;
  --bg-2: #ebe6da;
  --paper: #fffcf6;
  --ink: #1b211d;
  --muted: #5d6660;
  --line: #d8d1c4;
  --line-strong: #c4bbab;
  --accent: #b24a14;
  --accent-2: #8d3910;
  --accent-soft: #f6e4d6;
  --teal: #1d4a43;
  --teal-soft: #dceae6;
  --silver: #3d5c57;
  --alkaline: #7a5a12;
  --lithium: #2a4574;
  --shadow: 0 18px 50px rgba(27, 33, 29, 0.08);
  --radius: 18px;
  --max: 1120px;
  --sans: "Figtree", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #f8e7d4 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #dce8e4 0%, transparent 50%),
    var(--bg);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.55;
}

a {
  color: var(--accent-2);
  text-underline-offset: 0.14em;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

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

.skip:focus {
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  left: 1rem;
  top: 1rem;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 0.9rem;
  z-index: 20;
}

.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, white);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background:
    conic-gradient(from 210deg, #d9d2c4, #8a8376 30%, #f4efe4 55%, #6e6860 80%, #d9d2c4),
    #cfc7b8;
  box-shadow:
    inset 0 0 0 5px #f7f2e8,
    inset 0 0 0 6px #8b8374,
    0 4px 10px rgba(27, 33, 29, 0.16);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 35% 18% auto;
  height: 2px;
  background: #8b5a2b;
}

.brand small {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

nav {
  display: flex;
  gap: 0.35rem;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}

nav a:hover,
nav a[aria-current="page"] {
  background: var(--paper);
  color: var(--accent-2);
}

.hero {
  padding: 3.4rem 0 2.2rem;
}

.hero h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  max-width: 14ch;
}

.lede {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0 0 1.5rem;
}

.search-shell {
  position: relative;
  max-width: 42rem;
}

.search-shell input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: 999px;
  padding: 1rem 1.2rem 1rem 3.1rem;
  font: inherit;
  box-shadow: var(--shadow);
}

.search-shell input::placeholder {
  color: var(--muted);
}

.search-shell input:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, white);
  border-color: var(--accent);
}

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.15rem;
  height: 1.15rem;
  color: var(--muted);
  pointer-events: none;
}

.suggest {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.45rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 5;
}

.suggest.open {
  display: block;
}

.suggest a,
.suggest .empty {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--line);
}

.suggest a:first-child,
.suggest .empty:first-child {
  border-top: 0;
}

.suggest a:hover,
.suggest a[aria-selected="true"] {
  background: var(--accent-soft);
}

.suggest b {
  font-family: var(--mono);
  font-weight: 600;
}

.suggest span {
  color: var(--muted);
  font-size: 0.9rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--paper);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.84rem;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.9rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem 1.15rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

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

.card h2,
.card h3 {
  margin: 0 0 0.35rem;
  letter-spacing: -0.03em;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.silver-oxide { background: var(--teal-soft); color: var(--silver); }
.badge.alkaline { background: #f3e8c8; color: var(--alkaline); }
.badge.lithium { background: #dce6f5; color: var(--lithium); }

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

.section {
  padding: 1.4rem 0 2.4rem;
}

.section h2 {
  margin: 0 0 0.9rem;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

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

.step-num {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 1.2rem 0 0.4rem;
}

.breadcrumbs a {
  color: inherit;
}

.page-title {
  margin: 0.2rem 0 0.5rem;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.spec-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0 1.2rem;
}

.spec {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  min-width: 7.5rem;
}

.spec dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.spec dd {
  margin: 0.1rem 0 0;
  font-family: var(--mono);
  font-weight: 600;
}

.brand-table,
.chart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.brand-table th,
.brand-table td,
.chart-table th,
.chart-table td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.brand-table th,
.chart-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg-2);
}

.brand-table tr:last-child td,
.chart-table tbody tr:last-child td {
  border-bottom: 0;
}

.chart-wrap {
  overflow: auto;
  max-height: min(70dvh, calc(100dvh - 16rem));
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  overscroll-behavior: contain;
}

body.is-chart {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.is-chart .site-header {
  position: static;
}

body.is-chart main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body.is-chart main > .wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: min(1400px, calc(100% - 2rem));
}

body.is-chart .chart-wrap {
  flex: 1 1 auto;
  max-height: none;
  min-height: 14rem;
}

body.is-chart .site-footer {
  margin-top: 0.8rem;
  padding-top: 1rem;
  padding-bottom: 1.2rem;
}

body.is-chart .lede {
  margin-bottom: 0.85rem;
}

.chart-table {
  border: 0;
  border-radius: 0;
  min-width: 1100px;
  font-size: 0.92rem;
}

.chart-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}

.chart-table th:first-child,
.chart-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--paper);
  z-index: 1;
}

.chart-table thead th:first-child {
  z-index: 3;
  background: var(--bg-2);
}

.chart-table tbody tr:hover td:first-child {
  background: #fff7ef;
}

.chart-table a {
  font-family: var(--mono);
  font-weight: 600;
  text-decoration: none;
}

.chart-table tbody tr:hover {
  background: #fff7ef;
}

.aliases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.alias {
  font-family: var(--mono);
  background: var(--bg-2);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  font-size: 0.88rem;
}

.callout {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.callout.warn {
  background: #f7ecd2;
  border-left-color: var(--alkaline);
}

.prose {
  max-width: 46rem;
}

.prose h2 {
  margin-top: 2rem;
  letter-spacing: -0.03em;
}

.prose h3 {
  margin-top: 1.4rem;
}

.faq details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin: 0.55rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-2);
  color: #fff;
}

.btn-ghost {
  background: var(--paper);
  border-color: var(--line-strong);
  color: var(--ink);
}

.site-footer {
  margin-top: 2rem;
  padding: 2rem 0 2.6rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.4rem;
}

.footer-grid a {
  color: inherit;
}

.muted {
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.filters input,
.filters select {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.filters input {
  min-width: min(100%, 18rem);
}

.stat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 1rem;
  color: var(--muted);
}

.detail-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.cell {
  width: 3.4rem;
  height: 3.4rem;
  flex: 0 0 3.4rem;
  border-radius: 50%;
  margin: 0.15rem 0 0.7rem;
  background:
    radial-gradient(circle at 35% 30%, #fff 0 18%, transparent 19%),
    conic-gradient(from 200deg, #ece7dc, #9a9386 28%, #f7f3ea 58%, #6f6960 82%, #ece7dc);
  box-shadow:
    inset 0 0 0 7px #f6f1e7,
    inset 0 0 0 8px #857e71,
    0 8px 16px rgba(27, 33, 29, 0.12);
}

.cell.li {
  background:
    radial-gradient(circle at 35% 30%, #fff 0 18%, transparent 19%),
    conic-gradient(from 200deg, #e8edf3, #7d8794 28%, #f4f7fb 58%, #4d5661 82%, #e8edf3);
}

.related-list {
  display: grid;
  gap: 0.55rem;
}

.related-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

@media (max-width: 800px) {
  .steps,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  nav a {
    padding: 0.4rem 0.5rem;
    font-size: 0.88rem;
  }

  .hero {
    padding-top: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header,
  .site-footer,
  .actions,
  .search-shell,
  .filters {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .chart-wrap {
    max-height: none;
    overflow: visible;
  }
}
