:root {
  --ink: #17352d;
  --muted: #3d5a50;
  --bg: #f4f7f5;
  --paper: #ffffff;
  --brand: #1f5c4d;
  --brand-2: #2a7a66;
  --accent: #c45c26;
  --line: #c9d8d1;
  --yes: #1f5c4d;
  --no: #8b2e2e;
  --labeled: #8a5a12;
  --depends: #2f4f7a;
  --radius: 12px;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  /* Sticky .top height: single-row brand + nav (measured). */
  --header-h: 57px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* Keep in-page anchors (#use-freezer, #lookup, FAQ) clear of the sticky header. */
  scroll-padding-top: calc(var(--header-h) + 16px);
}
/* Fallback for browsers that honor scroll-margin on fragment targets more reliably. */
[id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #dce9e3 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #f0e0d4 0%, transparent 45%),
    var(--bg);
  font-family: var(--sans);
  line-height: 1.5;
}

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

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand img { display: block; height: 32px; width: auto; }
nav { display: flex; flex-wrap: wrap; gap: 0.75rem; }
nav a { text-decoration: none; color: var(--muted); font-size: 0.92rem; }
nav a:hover { color: var(--brand); }

main {
  width: min(920px, calc(100% - 1.75rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.hero, .prose, .lookup-wrap, section {
  margin-bottom: 1.1rem;
}
.hero { margin-bottom: 0.85rem; }
.hero .lede { margin: 0.35rem 0 0.75rem; }
.hero .page-img { margin: 0.75rem 0 0; }

h1, h2, h3 {
  font-family: var(--font);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 650;
}
h1 { font-size: clamp(1.7rem, 3.6vw, 2.35rem); margin: 0.2rem 0 0.55rem; }
h2 { font-size: 1.28rem; margin: 1.05rem 0 0.4rem; }
h3 { font-size: 1.05rem; margin: 0.85rem 0 0.3rem; }

.lede { font-size: 1.05rem; color: var(--muted); max-width: 42rem; }
.crumbs { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.35rem; }
.crumbs a { text-decoration: none; }

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff !important;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: var(--brand) !important;
  border: 1px solid var(--brand);
}
.btn:hover { filter: brightness(1.05); }

.page-img {
  display: block;
  width: min(100%, 560px);
  height: auto;
  margin: 0.65rem 0 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
}

.quick {
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  margin: 0.55rem 0 0.75rem;
}
.quick.yes { border-left-color: var(--yes); }
.quick.no { border-left-color: var(--no); }
.quick.labeled { border-left-color: var(--labeled); }
.quick.depends { border-left-color: var(--depends); }
.quick .verdict {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 0.2rem;
}
.quick.no .verdict { color: var(--no); }
.quick.labeled .verdict { color: var(--labeled); }
.quick.depends .verdict { color: var(--depends); }
.quick p { margin: 0.15rem 0; font-size: 0.98rem; }
.verdict img.badge, .action .tag img.badge { display: block; width: auto; }
.quick .verdict img.badge, .lookup-result .verdict img.badge { height: 30px; }
.action .tag img.badge { height: 24px; }
.by-use .tag { vertical-align: middle; }
.by-use .tag img.badge { height: 22px; }

.symbol-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin: 0.65rem 0 0.9rem;
}
.symbol-card {
  margin: 0;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem;
}
.symbol-card img, .symbol-card svg { width: 100%; height: auto; max-width: 140px; }
.symbol-card figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; }
.flow-figure { margin: 0.75rem 0 1rem; }
.flow-figure img { display: block; width: 100%; height: auto; }
.flow-figure figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; text-align: center; }
@media (max-width: 640px) {
  .flow-figure img { max-width: 420px; margin: 0 auto; }
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
  margin: 0.55rem 0;
}
.action {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
}
.action strong { display: block; margin-bottom: 0.15rem; font-size: 0.95rem; }
.action .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
}
.action p { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.35; }

.by-use {
  margin: 0.55rem 0 0.85rem;
  padding: 0.65rem 0.75rem;
  background: color-mix(in srgb, var(--paper) 80%, #e7f1ed);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.by-use h2 { margin-top: 0; font-size: 1.1rem; }
.by-use ul { list-style: none; padding: 0; margin: 0.35rem 0 0; }
.by-use li {
  margin: 0.4rem 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--muted);
}
.by-use .tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin-right: 0.25rem;
}
.by-use a { font-weight: 600; }
.by-use-more { white-space: nowrap; }
.lookup-nav { margin: 0.85rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.sources ul, .related ul { padding-left: 1.1rem; margin: 0.4rem 0; }
.sources li, .related li { margin: 0.25rem 0; }
.last-reviewed { color: var(--muted); font-size: 0.9rem; margin-top: 0.75rem; }

.fold {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 0.35rem 0.75rem 0.55rem;
  margin: 0.75rem 0;
}
.fold > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 650;
  padding: 0.45rem 0;
  color: var(--ink);
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before {
  content: "+ ";
  color: var(--brand);
  font-family: var(--sans);
  font-weight: 700;
}
.fold[open] > summary::before { content: "- "; }
.fold .fold-body { padding: 0.15rem 0 0.35rem; }
.fold h2, .fold h3 { margin-top: 0.6rem; }

.lookup-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 0.95rem 1rem;
  box-shadow: 0 14px 32px -26px rgba(23, 53, 45, 0.45);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.lookup-step,
.lookup-result {
  outline: none;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.lookup-kicker {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.3rem;
}
.lookup-fallback-note {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.92rem;
}
/* Home lookup choice cards (shipped in dist/static/site.css; build verifies these rules). */
.lookup-cards {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.55rem;
}
.lookup-cards > li {
  display: contents;
}
.lookup-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
  text-align: left;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  min-height: 7.25rem;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.lookup-card:hover,
.lookup-card:focus-visible {
  border-color: var(--brand);
  background: #e7f1ed;
  outline: none;
}
.lookup-card:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
}
.lookup-card-plain {
  min-height: 0;
  flex-direction: row;
  align-items: center;
}
.lookup-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.lookup-card strong {
  color: var(--brand);
  font-size: 0.95rem;
  line-height: 1.25;
}
.lookup-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}
.lookup-result .verdict {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
  margin: 0 0 0.25rem;
}
.lookup-result h2 { margin-top: 0.2rem; }
.lookup-result.yes .verdict { color: var(--yes); }
.lookup-result.no .verdict { color: var(--no); }
.lookup-result.labeled .verdict { color: var(--labeled); }
.lookup-result.depends .verdict { color: var(--depends); }

/* Icon placeholder hooks: sized box + text fallback when no <img> is present. */
.icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  min-width: 3.25rem;
  min-height: 3.25rem;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--paper) 70%, var(--bg));
  overflow: hidden;
}
.icon-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
}
.icon-slot:has(img[src]:not([src=""])),
.icon-slot.has-icon {
  border-style: solid;
  background: var(--paper);
}
.icon-slot:has(img) .icon-fallback,
.icon-slot.has-icon .icon-fallback { display: none; }
.icon-fallback {
  display: block;
  padding: 0.2rem;
  font-size: 0.62rem;
  line-height: 1.15;
  text-align: center;
  text-transform: capitalize;
  color: var(--muted);
  font-weight: 600;
}
.hub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.4rem 0 0.15rem;
}
.hub-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--brand);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
}
.hub-chip:hover,
.hub-chip:focus-visible {
  border-color: var(--brand);
  color: var(--accent);
}
.hub-chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.hub-chip .icon-slot {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.4rem;
}
.hub-chip .icon-slot img {
  width: 1.85rem;
  height: 1.85rem;
}
.hub-chips-more {
  font-size: 0.92rem;
  font-weight: 600;
  margin-left: 0.15rem;
}
.hub-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.55rem 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.hub-table {
  width: 100%;
  min-width: 36rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}
.hub-table th,
.hub-table td {
  padding: 0.65rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.hub-table thead th {
  background: color-mix(in srgb, var(--paper) 70%, var(--bg));
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.hub-table tbody tr:last-child th,
.hub-table tbody tr:last-child td {
  border-bottom: 0;
}
.hub-table th.sticky-col,
.hub-table td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--paper);
  min-width: 8.5rem;
  box-shadow: 1px 0 0 var(--line);
}
.hub-table thead th.sticky-col {
  z-index: 2;
  background: color-mix(in srgb, var(--paper) 70%, var(--bg));
}
.hub-verdict,
.hub-check {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  color: inherit;
  min-height: 28px;
}
.hub-verdict:hover,
.hub-verdict:focus-visible,
.hub-check:hover,
.hub-check:focus-visible {
  color: var(--accent);
}
.hub-verdict img.badge {
  height: 22px;
  width: auto;
  display: block;
}
.hub-check {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.88rem;
}
.hub-cards {
  display: none;
}
.hub-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 0.75rem 0.85rem;
}
.hub-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
}
.hub-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.hub-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.hub-card-use {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}
.hero-symbol {
  margin: 0.75rem 0 0;
}
.hero-symbol img {
  display: block;
  width: 120px;
  height: 120px;
}

/* /symbols/ browsable library grid (shipped in dist/static/site.css; build verifies these rules). */
.symbol-library-wrap {
  margin: 0.65rem 0 1rem;
}
.symbol-library {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
  margin: 0.65rem 0 0;
}
.symbol-library-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  min-height: 100%;
}
.symbol-library-card:hover,
.symbol-library-card:focus-visible {
  border-color: var(--brand);
  outline: none;
}
.symbol-library-card:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
}
.symbol-library-card .icon-slot {
  width: 4.25rem;
  height: 4.25rem;
}
.symbol-library-card strong {
  color: var(--brand);
  font-size: 0.98rem;
  line-height: 1.25;
}
.symbol-library-card .meaning {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.prose > h1 + .quick { margin-top: 0.35rem; }
.prose section h2:first-child { margin-top: 0.75rem; }

.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;
}

footer {
  border-top: 1px solid var(--line);
  padding: 1.15rem 1.1rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
footer p { margin: 0.28rem 0; }
footer a { color: var(--muted); }

/* Nav wraps under the brand at this width (nav { width: 100% }). */
@media (max-width: 640px) {
  :root { --header-h: 91px; }
  nav { width: 100%; }
  .lookup-cards {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .hub-table-wrap {
    display: none;
  }
  .hub-cards {
    display: grid;
    gap: 0.65rem;
    margin: 0.55rem 0 0.85rem;
  }
}

/* Nav link row wraps onto a second line. */
@media (max-width: 410px) {
  :root { --header-h: 125px; }
}
