:root {
  --header-h: 0px;
  --paper: #faf7f0;
  --card: #fffdf8;
  --ink: #1f3a2e;
  --ink-soft: #4f6658;
  --sage: #4e7a5b;
  --sage-lt: #7fa37c;
  --sage-wash: #e2eadb;
  --terra: #c2593f;
  --terra-wash: #f4dcd2;
  --ochre: #d49a2a;
  --ochre-wash: #f6e8c6;
  --umber: #6b4f3a;
  --sand: #efe6d5;
  --sand-deep: #e2d3b8;
  --line: #ddd2bd;
  --max: 1120px;
  --prose: 44rem;
  --radius: 14px;
  --tap: 44px;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Charter, Georgia, ui-serif, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  overflow-wrap: break-word;
}
body.sheet-open {
  overflow: hidden;
}
img,
svg {
  max-width: 100%;
}
a {
  color: var(--sage);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 2px;
}
h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}
h1 {
  font-size: clamp(1.9rem, 6vw, 2.75rem);
  margin: 0.5rem 0 0.5rem;
  letter-spacing: -0.01em;
}
h2 {
  font-size: clamp(1.35rem, 4.4vw, 1.75rem);
  margin: 2rem 0 0.6rem;
}
h3 {
  font-size: 1.2rem;
  margin: 1.4rem 0 0.4rem;
}
p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--sand);
  padding: 0.05em 0.3em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
pre code {
  background: none;
  padding: 0;
}
.code-block {
  background: var(--ink);
  color: var(--paper);
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.5;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 50;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
}
.skip:focus {
  top: 0.75rem;
}

/* ---------- Header and footer ---------- */
.top {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.top-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.4rem 1rem 0.3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}
.brand img {
  width: 36px;
  height: 36px;
  flex: none;
}
.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.15rem;
  margin: 0 -0.5rem;
}
.top nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 0.5rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
}
.top nav a:hover {
  background: var(--sage-wash);
}
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--sand);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin-bottom: 0.5rem;
}
.site-footer nav a,
.site-footer p a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--ink);
}
.footer-affiliate {
  font-size: 0.85rem;
}

/* ---------- Heroes ---------- */
.hero-art {
  margin: 0 0 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
}
.hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Prose pages ---------- */
.prose {
  max-width: var(--prose);
}
.prose.wide {
  max-width: none;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
}
.note {
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.prose li {
  margin-bottom: 0.35rem;
}
.facts {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}
.facts li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  margin: 0;
}
.facts span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.faq dt {
  font-weight: 700;
  margin-top: 1rem;
}
.faq dd {
  margin: 0.25rem 0 0;
}
.fold {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 0 1rem;
  margin: 1.5rem 0;
}
.fold summary {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}
.fold ul {
  padding-left: 1.2rem;
}
.affiliate {
  border: 1px dashed var(--sand-deep);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 2rem 0;
  background: var(--card);
  font-size: 0.95rem;
}
.affiliate-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.affiliate ul {
  padding-left: 1.2rem;
  margin: 0;
}
.affiliate li a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
.tool-list {
  padding-left: 1.2rem;
}

/* ---------- Tier pills and mechanism tags ---------- */
.tier {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem 0.15rem 0.45rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
}
.tier img {
  width: 14px;
  height: 14px;
  flex: none;
}
.tier-lg {
  font-size: 1rem;
  padding: 0.3rem 0.9rem 0.3rem 0.65rem;
}
.tier-lg img {
  width: 18px;
  height: 18px;
}
.tier-university-backed {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.tier-practical {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--paper);
}
.tier-mixed {
  background: var(--ochre-wash);
  border-color: var(--ochre);
  color: var(--ink);
}
.tier-folklore {
  background: var(--paper);
  border-color: var(--umber);
  border-style: dashed;
  color: var(--umber);
}
.tier-antagonist {
  background: var(--terra);
  border-color: var(--terra);
  color: var(--paper);
}
.mech-tags {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.mech-tags li {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.3;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--sage-wash);
  color: var(--ink);
}
.verdict {
  margin: 0.25rem 0 1rem;
}

/* ---------- Pills and buttons ---------- */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pill,
.ghost,
.tabs [role='tab'] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--tap);
  padding: 0.35rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.pill:hover,
.ghost:hover {
  border-color: var(--sage);
}
.pill[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.crop-pill {
  padding-left: 0.4rem;
}
.crop-pill img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper);
  flex: none;
}
.ghost {
  background: transparent;
}
.linkish {
  background: none;
  border: 0;
  padding: 0.6rem 0.2rem;
  font: inherit;
  color: var(--sage);
  text-decoration: underline;
  cursor: pointer;
}
input[type='search'],
select {
  font: inherit;
  font-size: 1rem;
  min-height: var(--tap);
  max-width: 100%;
  padding: 0.4rem 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}
input[type='search']:focus,
select:focus {
  border-color: var(--sage);
}

/* ---------- Home tools ---------- */
.home > h1 {
  margin-top: 0.25rem;
}
.tools {
  margin: 1rem 0 2rem;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.tabs[hidden] {
  display: none;
}
.tabs [role='tab'] {
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
}
.tabs [role='tab'][aria-selected='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  min-width: 0;
}
.panel > h2 {
  margin-top: 0;
}
.panel[hidden] {
  display: none;
}
.search {
  position: relative;
  margin-bottom: 0.75rem;
}
.search label,
.filters label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.search input {
  width: 100%;
}
.suggest {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0.25rem;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  background: var(--card);
  border: 1.5px solid var(--sage);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(31, 58, 46, 0.15);
}
.suggest[hidden] {
  display: none;
}
.suggest button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0.25rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.suggest button:hover,
.suggest button:focus {
  background: var(--sage-wash);
}
.quick {
  margin-bottom: 1rem;
}
.result:empty {
  display: none;
}
.lookup-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}
.lookup-head img {
  width: 64px;
  height: 64px;
  flex: none;
}
.lookup-head h3 {
  margin: 0;
  font-size: 1.4rem;
}
.lookup-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.lookup-head > div {
  flex: 1 1 10rem;
  min-width: 0;
}
.more {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 600;
}
.group {
  margin-top: 0.75rem;
}
.group h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
  margin: 0 0 0.5rem;
  padding-left: 0.6rem;
  border-left: 5px solid var(--sage);
  font-size: 1.1rem;
}
.group h4 small {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-soft);
}
.group .count {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.group-friends h4 {
  border-color: var(--ink);
}
.group-mixed h4 {
  border-color: var(--ochre);
}
.group-folklore h4 {
  border-color: var(--umber);
  border-left-style: dashed;
}
.group-avoid h4 {
  border-color: var(--terra);
}
.empty {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 0.5rem 0.6rem;
}
.cards {
  display: grid;
  gap: 0.5rem;
}
.nb-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.nb-card[open] {
  background: var(--card);
  border-color: var(--sage-lt);
}
.nb-card summary {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  min-height: var(--tap);
  padding: 0.75rem;
  cursor: pointer;
  list-style: none;
}
.nb-card summary::-webkit-details-marker {
  display: none;
}
.nb-card summary > img {
  width: 44px;
  height: 44px;
  flex: none;
}
.nb-main,
.pr-main {
  display: block;
  flex: 1;
  min-width: 0;
}
.nb-title,
.pr-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}
.nb-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.nb-card summary::after {
  content: '+';
  flex: none;
  width: 1.5rem;
  text-align: center;
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--sage);
}
.nb-card[open] summary::after {
  content: '\2212';
}
.nb-more {
  padding: 0 0.75rem 0.75rem;
  font-size: 0.95rem;
}
.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem 0.75rem;
}
.kv dt,
.kv-h {
  font-weight: 700;
}
.kv dd {
  margin: 0;
}
.kv-h {
  margin: 0 0 0.25rem;
}
.sources {
  padding-left: 1.1rem;
}
.sources a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
.crop-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}
.crop-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
.compare-q {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-family: var(--serif);
  font-size: 1.15rem;
}
.compare-q select {
  flex: 1 1 8rem;
  min-width: 0;
  font-family: var(--sans);
}
.verdict-card {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--paper);
}
.verdict-card h3 {
  margin: 0.5rem 0;
  font-size: 1.4rem;
}
.verdict-card.t-university-backed,
.verdict-card.t-practical {
  border-color: var(--sage);
}
.verdict-card.t-mixed {
  border-color: var(--ochre);
}
.verdict-card.t-folklore {
  border-color: var(--umber);
  border-style: dashed;
}
.verdict-card.t-antagonist {
  border-color: var(--terra);
}
.vc-crops,
.sheet-crops {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.vc-crops img {
  width: 72px;
  height: 72px;
}
.vc-plus {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--ink-soft);
}
.vc-answer {
  margin-top: 0.6rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
}
.bed-picker {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.bed-group {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.bed-group legend {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
  padding: 0;
}
.bed-picker .crop-pill {
  font-size: 0.9rem;
  padding: 0.25rem 0.7rem 0.25rem 0.3rem;
}
.bed-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.sum {
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}
.sum-wins {
  border-color: var(--sage);
}
.sum-conflicts {
  border-color: var(--terra);
}
.sum-cautions {
  border-color: var(--ochre);
}
.sum-folklore {
  border-color: var(--umber);
  border-style: dashed;
}
.check h3 {
  font-size: 1.1rem;
  margin: 1rem 0 0.4rem;
}
.check h3 small {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-soft);
}
.check ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.pair-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.pair-row:hover {
  border-color: var(--sage);
}
.pair-row > img {
  width: 32px;
  height: 32px;
  flex: none;
}
.pr-main {
  margin-left: 0.3rem;
}
.check-wins .pair-row {
  border-left: 5px solid var(--sage);
}
.check-conflicts .pair-row {
  border-left: 5px solid var(--terra);
}
.check-cautions .pair-row {
  border-left: 5px solid var(--ochre);
}
.check-folklore .pair-row {
  border-left: 5px dashed var(--umber);
}

/* ---------- Matrix ---------- */
.matrix-controls {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
}
.filters input,
.filters select {
  width: 100%;
}
.legend {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
}
.matrix-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 75vh;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  overscroll-behavior: contain;
}
.mx {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}
.mx th,
.mx td {
  padding: 0;
  border-right: 1px solid var(--sand);
  border-bottom: 1px solid var(--sand);
}
.mx thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  vertical-align: bottom;
  height: 8.5rem;
  font-weight: 600;
}
.mx thead th span {
  display: inline-block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  padding: 0.4rem 0;
  max-height: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mx tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 0.6rem;
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mx thead th.corner {
  left: 0;
  z-index: 3;
}
.mx td {
  width: var(--tap);
  height: var(--tap);
  text-align: center;
}
.mx td.self {
  background: repeating-linear-gradient(45deg, var(--sand) 0 3px, transparent 3px 7px);
}
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.cell img {
  width: 16px;
  height: 16px;
}
.cell.t-university-backed {
  background: var(--ink);
}
.cell.t-practical {
  background: var(--sage);
}
.cell.t-mixed {
  background: var(--ochre-wash);
  box-shadow: inset 0 0 0 2px var(--ochre);
}
.cell.t-folklore {
  background: var(--paper);
  outline: 1.5px dashed var(--umber);
  outline-offset: -5px;
}
.cell.t-antagonist {
  background: var(--terra);
}
.cell.t-none::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sand-deep);
}
.cell.dim {
  opacity: 0.18;
}
.cell:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: -3px;
}
.mx tr.x-row > th,
.mx th.x-col {
  background: var(--sage-wash);
  color: var(--ink);
}
.mx tr.x-row > td,
.mx td.x-col {
  background-color: rgba(127, 163, 124, 0.18);
}
.hub-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.hub-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}
.hub-table th,
.hub-table td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.hub-table .sticky-col {
  position: sticky;
  left: 0;
  background: var(--card);
}

/* ---------- Pair sheet ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
}
.sheet[hidden] {
  display: none;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 58, 46, 0.45);
}
.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.5rem 1rem 1.5rem;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 32px rgba(31, 58, 46, 0.25);
}
.sheet-grip {
  width: 44px;
  height: 5px;
  margin: 0.25rem auto 0.5rem;
  border-radius: 3px;
  background: var(--sand-deep);
}
.sheet-close {
  float: right;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.sheet-crops img {
  width: 56px;
  height: 56px;
}
#sheet-title {
  margin: 0.5rem 0;
}

/* ---------- Hub pages ---------- */
.crop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.6rem;
}
.crop-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 0.6rem;
  align-items: center;
  min-height: var(--tap);
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
}
.crop-card:hover {
  border-color: var(--sage);
}
.crop-card img {
  grid-row: span 2;
  width: 48px;
  height: 48px;
}
.crop-card span {
  font-weight: 700;
  line-height: 1.2;
}
.crop-card small {
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.2;
}
.neighbor-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.neighbor-list li {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.neighbor-list p {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.nb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  min-height: var(--tap);
  color: var(--ink);
  text-decoration: none;
}
.nb img {
  width: 40px;
  height: 40px;
  flex: none;
}
.nb-name {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--sage-lt);
  text-underline-offset: 0.2em;
}
.nb:hover .nb-name {
  text-decoration-color: var(--ink);
}
.tier-groups {
  list-style: none;
  padding: 0;
}
.tier-groups li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.tier-groups li a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
.featured {
  margin-top: 2rem;
}

@media (min-width: 560px) {
  .tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  :root {
    --header-h: 64px;
  }
  .top {
    position: sticky;
    top: 0;
  }
  .top-inner {
    flex-wrap: nowrap;
    min-height: var(--header-h);
    padding-top: 0;
    padding-bottom: 0;
  }
  .top nav {
    margin: 0;
  }
  main {
    padding: 1.5rem 1.5rem 4rem;
  }
  .panel {
    padding: 1.25rem 1.5rem;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .matrix-controls {
    grid-template-columns: auto auto;
    justify-content: start;
    align-items: end;
    column-gap: 1.5rem;
  }
  .filters {
    grid-column: 1 / -1;
  }
  .mx td,
  .cell {
    width: 36px;
    height: 36px;
  }
  .sheet-panel {
    top: 0;
    left: auto;
    width: min(440px, 92vw);
    max-height: none;
    border-radius: 18px 0 0 18px;
    padding: 1.25rem 1.5rem 2rem;
    box-shadow: -12px 0 32px rgba(31, 58, 46, 0.25);
  }
  .sheet-grip {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .nb-card summary::after,
  .pill,
  .cell {
    transition: background-color 0.15s, opacity 0.15s;
  }
}
