@font-face {
  font-family: Bitter;
  src: url("./assets/fonts/bitter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("./assets/fonts/source-sans-3.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #faf8f1;
  --sheet: #fffdf7;
  --ink: #273938;
  --navy: #243b45;
  --teal: #235f61;
  --muted: #58665f;
  --line: #d9d4c5;
  --gold: #edd5a0;
  --rust: #88492e;
  --wash: #efeee3;
  --serif: Bitter, Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.48 var(--sans);
  caret-color: var(--teal);
}
::selection {
  background: #d6e6d3;
  color: #182f2c;
}
a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}
a:hover {
  color: var(--rust);
}
:focus-visible {
  outline: 3px solid #ad5c25;
  outline-offset: 3px;
}
h1,
h2,
h3,
p,
figure,
dl {
  margin: 0;
}
h1,
h2,
h3,
.brand,
.footer-name {
  font-family: var(--serif);
  text-wrap: balance;
}
h1 {
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.038em;
}
h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.95rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.034em;
}
h3 {
  font-weight: 600;
  font-size: 1.14rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
select,
summary {
  cursor: pointer;
}
button {
  background: var(--sheet);
  border: 1px solid #aeb9ad;
  border-radius: 6px;
  padding: 0.48rem 0.87rem;
}
button:hover:enabled {
  background: #ecf0e4;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.shell {
  width: min(1160px, calc(100% - 5rem));
  margin-inline: auto;
}
main {
  min-height: 66vh;
  padding: 2.2rem 0 4.5rem;
}
main:focus {
  outline: none;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -85px;
  background: white;
  z-index: 99;
  padding: 0.65rem;
}
.skip:focus {
  top: 0.5rem;
}
.masthead {
  background: var(--navy);
  color: #fff9e9;
  border-top: 3px solid #c3a269;
}
.mast-inner,
.header-actions,
.brand,
.header-search,
.edition-select,
.footer-inner {
  display: flex;
  align-items: center;
}
.mast-inner {
  min-height: 65px;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  gap: 0.73rem;
  color: #fff7e4;
  text-decoration: none;
  font-size: clamp(1.05rem, 2.3vw, 1.51rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}
.brand:hover,
.header-search:hover {
  color: var(--gold);
}
.brand svg {
  color: var(--gold);
  flex-shrink: 0;
}
.header-actions {
  gap: 1.15rem;
}
.header-search,
.edition-select {
  color: #fff8eb;
  font-size: 0.97rem;
  gap: 0.48rem;
}
.header-search {
  text-decoration: none;
  font-weight: 600;
  border-left: 1px solid #617278;
  padding-left: 1.1rem;
  min-height: 36px;
}
kbd {
  font: 500 0.83rem var(--sans);
  border: 1px solid #8e9b98;
  border-radius: 3px;
  padding: 0 0.33rem;
  color: #f3e6c5;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2354665c' stroke-width='1.7'/%3E%3C/svg%3E");
  background-position: right 0.65rem center;
  background-repeat: no-repeat;
  padding-right: 2rem !important;
}
.edition-select span {
  color: #d2dbd6;
}
.edition-select select {
  background-color: #334b53;
  border: 1px solid #677b7d;
  color: white;
  border-radius: 5px;
  padding: 0.28rem 0.6rem;
  font-size: 0.94rem;
  min-height: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23e8ddbb' stroke-width='1.6'/%3E%3C/svg%3E");
}
.tabrail {
  background: #fffdf7;
  border-bottom: 1px solid var(--line);
}
#navigation {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
#navigation a {
  white-space: nowrap;
  color: #435348;
  text-decoration: none;
  font-weight: 600;
  padding: 0.63rem 0.05rem 0.54rem;
  border-bottom: 3px solid transparent;
}
#navigation a[aria-current="page"] {
  color: #1c5352;
  border-color: #427665;
}
#navigation a:hover {
  text-decoration: underline;
}
.cover {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4.6vw, 4.25rem);
  padding: 0.45rem 0 2.2rem;
  border-bottom: 1px solid var(--line);
}
.cover h1 {
  font-size: clamp(3.3rem, 5.65vw, 4.85rem);
  line-height: 1.02;
  color: #243b3d;
}
.cover h1 em {
  font-style: normal;
  color: #316863;
}
.cover-copy > p {
  color: #4c5d55;
  max-width: 46ch;
  margin: 0.85rem 0 1.22rem;
  font-size: 1.12rem;
  line-height: 1.45;
}
.cover-art {
  position: relative;
  padding: 7px;
  background: #fffcf0;
  border: 1px solid #c4b898;
  box-shadow: 0 6px 14px #3e412019;
  transform: rotate(1deg);
  margin: 0 0.3rem;
}
.cover-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5/2.68;
  object-fit: cover;
  object-position: 50% 53%;
}
.cover-art figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.38rem 0.25rem 0.02rem;
  color: #434e45;
  font: 600 0.98rem var(--serif);
}
.cover-art figcaption span {
  font: 400 0.84rem var(--sans);
  color: var(--muted);
}
.wiki-search {
  display: flex;
  align-items: center;
  background: var(--sheet);
  border: 1.5px solid #677f72;
  border-radius: 7px;
  padding: 0.28rem 0.3rem 0.28rem 0.8rem;
  gap: 0.5rem;
  max-width: 760px;
}
.wiki-search:focus-within {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.wiki-search > svg {
  color: var(--teal);
  flex-shrink: 0;
}
.wiki-search input {
  border: 0;
  outline: none;
  min-width: 0;
  background: transparent;
  width: 100%;
  padding: 0.42rem 0;
  font-size: 1.06rem;
}
input::placeholder {
  color: #637067;
  opacity: 1;
}
.wiki-search button,
.action-link {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
  font-weight: 600;
  padding: 0.43rem 1.15rem;
  text-decoration: none;
  border-radius: 4px;
}
.wiki-search button:hover:enabled,
.action-link:hover {
  background: #184749;
  color: white;
}
.home-search {
  position: relative;
  z-index: 2;
}
.suggest-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 5;
  background: var(--sheet);
  box-shadow: 0 7px 18px #27342f26;
  border: 1px solid #b8c0ad;
  border-radius: 5px;
  padding: 0.35rem 0.85rem 0.6rem;
  max-height: 48vh;
  overflow: auto;
}
.suggest-panel .result-list a {
  padding: 0.42rem 0.1rem;
  gap: 0.3rem;
}
.suggest-panel .result-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  max-width: 100%;
}
.suggest-panel .result-list a > span:first-child {
  min-width: 0;
}
.all-results {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 600;
}
.quick,
.topic-links {
  display: flex;
  align-items: baseline;
  gap: 0.55rem 0.9rem;
  flex-wrap: wrap;
  font-size: 0.94rem;
}
.quick {
  margin-top: 0.65rem;
}
.quick > span {
  font-weight: 600;
  color: var(--muted);
}
.section-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.95rem;
}
.section-line > a {
  font-size: 0.97rem;
  font-weight: 600;
}
.wiki-index,
.item-shelf,
.reading-grid {
  margin-top: 2rem;
}
.index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.index-link {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  color: var(--ink);
  padding: 1rem 0.9rem 1rem 0.25rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.index-link:hover,
.specimens a:hover,
.place-line:hover,
.place-index summary:hover {
  background: #f0f1e5;
}
.index-link strong,
.index-link small,
.result-list strong,
.result-list small,
.tools-box > a small,
.tools-box > a strong {
  display: block;
}
.index-link strong {
  font: 600 1.1rem var(--serif);
  letter-spacing: -0.02em;
}
.index-link small,
.tools-box small,
.result-list small,
.detail-list small {
  color: var(--muted);
  font-size: 0.94rem;
}
.index-icon {
  background: #e4ede3;
  color: #305954;
  border: 1px solid #c6d5c2;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.tone-1,
.tone-5 {
  color: #725063;
  background: #f0e7eb;
  border-color: #dfcdd2;
}
.tone-2,
.tone-3 {
  color: #855739;
  background: #f2e9d7;
  border-color: #e2d1af;
}
.item-shelf .section-line {
  margin-bottom: 0.65rem;
}
.specimens {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #f3f0e4;
  border-radius: 7px;
  overflow: hidden;
}
.specimens a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.68rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1rem;
  line-height: 1.12;
  border-right: 1px solid var(--line);
}
.specimens a:last-child {
  border: 0;
}
.specimens a > span {
  width: 35px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
}
.specimens img {
  max-width: 31px;
  max-height: 31px;
  width: auto;
  height: 29px;
  image-rendering: pixelated;
}
.reading-grid,
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(235px, 0.9fr);
  gap: clamp(2rem, 5vw, 4rem);
}
.question {
  border-top: 1px solid var(--line);
  padding: 0.9rem 0;
}
.question p {
  color: var(--muted);
  max-width: 69ch;
  margin-top: 0.28rem;
}
.question h3 a,
.tools-box a strong,
.guide-directory a,
.index-link:hover strong {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.tools-box {
  align-self: start;
  padding: 1.2rem 1.4rem;
  background: #eaf0e7;
  border-top: 3px solid #6f8b73;
}
.tools-box h2 {
  font-size: 1.45rem;
}
.tools-box > a {
  display: block;
  padding: 0.63rem 0;
  border-bottom: 1px solid #cbd5c9;
  text-decoration: none;
}
.edition-note {
  margin-top: 1rem;
  font-size: 0.96rem;
  color: #40564b;
}
.footer-inner {
  padding: 1.3rem 0;
  gap: 0.5rem 1.2rem;
  flex-wrap: wrap;
  color: #536258;
  font-size: 0.95rem;
}
footer {
  border-top: 1px solid var(--line);
  background: #f1efe5;
}
.footer-name {
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}
.footer-inner span {
  margin-right: auto;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.45em;
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 0.95rem;
}
.page-heading {
  margin-bottom: 1.45rem;
}
.page-heading h1 {
  font-size: clamp(2.15rem, 4.7vw, 3.45rem);
  max-width: 25ch;
}
.page-heading p {
  font-size: 1.16rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 66ch;
  margin-top: 0.62rem;
}
.topic-links {
  margin: -0.25rem 0 1.35rem;
}
.topic-links a {
  font-weight: 600;
}
.filters,
.result-filters,
.pager {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.filters {
  background: #eeefe5;
  border: 1px solid var(--line);
  padding: 0.75rem 1rem;
  border-radius: 7px;
}
.filters label,
.calculator label {
  display: grid;
  gap: 0.22rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.filters .grow {
  flex: 1 1 200px;
}
.filters input,
.filters select,
.calculator input,
.calculator select {
  border: 1px solid #aab5a7;
  border-radius: 4px;
  padding: 0.46rem 0.65rem;
  background-color: #fffef8;
  min-height: 39px;
  max-width: 100%;
  min-width: 0;
}
.count,
.subtext,
.empty,
.loading {
  color: var(--muted);
}
.count {
  font-size: 0.95rem;
  margin: 0.8rem 0 0.5rem;
}
.empty,
.loading {
  padding: 1rem 0;
}
.table-scroll {
  overflow-x: auto;
  scrollbar-color: #9baaa3 var(--wash);
}
.catalogue {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sheet);
  overflow: hidden;
}
table {
  border-collapse: collapse;
  text-align: left;
  width: 100%;
}
th,
td {
  padding: 0.68rem 0.85rem;
  border-bottom: 1px solid #dddcd1;
  vertical-align: top;
}
thead {
  background: #e8ede4;
  color: #314f44;
}
th {
  font-size: 0.96rem;
  font-weight: 650;
}
td:first-child {
  font-weight: 600;
}
tbody tr:nth-child(even) {
  background: #f7f7ee;
}
td small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.86rem;
}
.number,
.facts dd,
output {
  font-variant-numeric: tabular-nums;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}
.chip,
.result-kind {
  background: #e7eee4;
  color: #355548;
  border-radius: 4px;
  padding: 0.1rem 0.38rem;
  font-size: 0.88rem;
}
.pager {
  padding: 0.65rem 1rem;
  align-items: center;
  justify-content: space-between;
}
.callout,
.coverage {
  margin: 1.2rem 0;
  background: #edf1e8;
  padding: 1rem 1.2rem;
  max-width: 80ch;
}
.coverage p {
  margin-top: 0.8rem;
}
.coverage .action-link {
  display: inline-block;
  margin: 0 0.6rem 0.5rem 0;
}
.result-filters {
  margin: 1rem 0 0.5rem;
  gap: 0.45rem;
}
.result-filters button {
  font-size: 0.95rem;
  padding: 0.38rem 0.72rem;
}
.result-filters button[aria-pressed="true"] {
  background: var(--navy);
  color: white;
}
.result-filters small {
  font-size: 0.9em;
}
.result-list {
  max-width: 850px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.result-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding: 0.72rem 0.25rem;
}
.result-list a:hover {
  background: var(--wash);
}
.result-list strong {
  text-decoration: underline;
  text-underline-offset: 0.17em;
}
.more {
  margin-top: 0.8rem;
}
.place-index,
.guide-directory {
  columns: 2;
  column-gap: 2.5rem;
}
.place-line,
.place-index details {
  break-inside: avoid;
  border-top: 1px solid var(--line);
  padding: 0.58rem 0.15rem;
}
.place-line small,
.place-index small {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.86rem;
  margin-left: 0.5rem;
}
.place-index ul {
  padding-left: 1.2rem;
}
summary {
  font-weight: 600;
  color: var(--teal);
}
.guide-directory section {
  margin-bottom: 1.5rem;
  break-inside: avoid;
}
.guide-directory h2,
.section-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.48rem;
  margin-bottom: 0.4rem;
}
.guide-directory ul {
  padding-left: 1.2rem;
  line-height: 1.9;
  margin: 0.65rem 0;
}
.article-layout {
  grid-template-columns: minmax(160px, 0.65fr) minmax(0, 2fr);
  max-width: 1060px;
}
.contents {
  align-self: start;
  position: sticky;
  top: 1rem;
  padding: 0.8rem 0;
  border-block: 1px solid var(--line);
}
.contents h2 {
  font: 650 1rem var(--sans);
  margin-bottom: 0.35rem;
}
.contents a,
.read-next a {
  display: block;
  margin: 0.3rem 0;
  font-size: 1rem;
}
.article {
  max-width: 74ch;
}
.article > section,
.article > details,
.article > .calculator,
.detail-section {
  margin: 0 0 1.8rem;
}
.article h2,
.section-heading h2,
.guide-directory h2 {
  font-size: 1.5rem;
}
.article section p,
.article section ul,
.detail-section p,
.article details p {
  margin-top: 0.6rem;
}
.article details,
.detail-section details {
  margin-top: 0.6rem;
}
.rom-ref {
  overflow-wrap: anywhere;
  font:
    0.88rem/1.5 ui-monospace,
    monospace;
}
.detail-section {
  max-width: 83ch;
}
.detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.detail-list li {
  padding: 0.42rem 0;
  border-bottom: 1px solid #e3e0d3;
}
.facts {
  display: flex;
  gap: 0.6rem 1.8rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}
.facts > div {
  padding: 0.27rem 0;
}
.facts dt {
  font-size: 0.9rem;
  color: var(--muted);
}
.facts dd {
  margin: 0;
  font-weight: 600;
}
.detail-section details {
  background: #f0f1e7;
  padding: 0.42rem 0.72rem;
}
.calculator {
  background: #eaf0e5;
  border-radius: 6px;
  padding: 1.15rem;
}
.calculator h3 {
  font-size: 1.25rem;
}
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0;
}
.calculator output {
  display: block;
  padding: 0.55rem 0.75rem;
  color: #fff;
  background: #305952;
  border-radius: 4px;
  font-weight: 600;
}
@media (max-width: 920px) {
  .shell {
    width: calc(100% - 3rem);
  }
  .cover {
    gap: 1.5rem;
  }
  .index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .specimens {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .specimens a:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }
  .specimens a:nth-child(3n) {
    border-right: 0;
  }
  .reading-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(210px, 1fr);
    gap: 1.5rem;
  }
}
@media (max-width: 700px) {
  .shell {
    width: calc(100% - 2rem);
  }
  main {
    padding-top: 1.25rem;
  }
  .mast-inner {
    min-height: 58px;
  }
  .header-actions {
    gap: 0.55rem;
  }
  .edition-select span,
  .header-search kbd,
  .header-search span {
    display: none;
  }
  .header-search {
    padding-left: 0.6rem;
    min-width: 33px;
  }
  .brand svg {
    width: 30px;
    height: 32px;
  }
  .brand {
    gap: 0.4rem;
  }
  #navigation {
    gap: 1.25rem;
  }
  #navigation a {
    padding: 0.55rem 0 0.46rem;
  }
  .cover {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0.45rem 0 1.25rem;
  }
  .cover h1 {
    font-size: clamp(2.65rem, 9vw, 3.6rem);
  }
  .cover h1 br {
    display: none;
  }
  .cover h1 em::before {
    content: " ";
  }
  .cover-copy > p {
    margin: 0.6rem 0 0.85rem;
    font-size: 1.06rem;
  }
  .cover-art {
    transform: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }
  .cover-art img {
    aspect-ratio: 3.35;
    object-position: 50% 52%;
    border-radius: 4px;
  }
  .cover-art figcaption {
    padding: 0.25rem 0 0;
    font-size: 0.87rem;
  }
  .cover-art figcaption span {
    font-size: 0.8rem;
  }
  .wiki-index,
  .item-shelf,
  .reading-grid {
    margin-top: 1.45rem;
  }
  .index-link {
    gap: 0.55rem;
    padding: 0.72rem 0.36rem 0.72rem 0.05rem;
  }
  .index-icon {
    width: 34px;
    height: 37px;
    flex-basis: 34px;
  }
  .index-icon svg {
    width: 22px;
    height: 22px;
  }
  .index-link strong {
    font-size: 0.99rem;
  }
  .index-link small {
    font-size: 0.87rem;
    line-height: 1.25;
    margin-top: 0.1rem;
  }
  .reading-grid,
  .article-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }
  .tools-box,
  .contents {
    width: 100%;
  }
  .contents {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.9rem;
  }
  .contents h2 {
    width: 100%;
  }
  .contents a {
    margin: 0.1rem 0;
  }
  .place-index,
  .guide-directory {
    columns: 1;
  }
  th,
  td {
    padding: 0.55rem 0.6rem;
  }
  .guide-heading h1 {
    max-width: 100%;
  }
  .section-line {
    margin-bottom: 0.65rem;
  }
  .specimens a {
    font-size: 0.94rem;
    gap: 0.3rem;
    padding: 0.5rem 0.3rem;
  }
  .specimens a > span {
    width: 27px;
  }
  .specimens img {
    max-width: 24px;
    max-height: 25px;
  }
  .footer-inner span {
    margin-right: 0;
  }
  .footer-inner {
    gap: 0.4rem 1rem;
  }
}
@media (max-width: 430px) {
  .shell {
    width: calc(100% - 1.45rem);
  }
  .mast-inner {
    gap: 0.35rem;
  }
  .header-actions {
    gap: 0.3rem;
  }
  .edition-select select {
    font-size: 0.85rem;
  }
  .brand {
    font-size: 1.04rem;
  }
  .specimens {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .specimens a:nth-child(n) {
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .specimens a:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
  .specimens a:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
  .quick {
    gap: 0.3rem 0.65rem;
  }
  .index-grid {
    column-gap: 0.5rem;
  }
  .index-link {
    align-items: start;
  }
  .index-link small {
    max-width: 18ch;
  }
  .section-line h2 {
    font-size: 1.47rem;
  }
  .wiki-search input {
    font-size: 1rem;
  }
  .wiki-search button {
    padding: 0.42rem 0.8rem;
  }
  .brand svg {
    width: 25px;
  }
  .cover-art img {
    aspect-ratio: 3.1;
  }
}
.entity-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.65fr) minmax(0, 2fr);
  gap: clamp(2rem, 4vw, 4rem);
  max-width: 1070px;
}
.entity-sections {
  min-width: 0;
}
.page-heading:has(.entry-sprite) {
  display: flow-root;
}
.entry-sprite {
  display: grid;
  place-items: center;
  float: left;
  width: 83px;
  height: 83px;
  margin: 0.12rem 1.1rem 0 0;
  background: #e9ebdc;
  border: 1px solid #c6cdb7;
  border-radius: 10px;
}
.game-sprite {
  display: inline-block;
  flex: none;
  vertical-align: middle;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.portrait-note {
  display: block;
  font-size: .94rem;
}
.monster-link {
  display: inline-flex;
  gap: .4rem;
  align-items: center;
  vertical-align: middle;
}
.catalog-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.result-text {
  min-width: 0;
  flex: 1;
}
.result-kind {
  flex: none;
}
.guide-banner {
  height: 160px;
  overflow: hidden;
  margin: 0.7rem 0 2rem;
  background: #e4ddcf;
}
.guide-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}
@media (min-width: 850px) {
  main:has(.guide-directory) > .page-heading {
    min-height: 130px;
    max-width: 60%;
    margin-top: 1.6rem;
  }
  main:has(.guide-directory) {
    position: relative;
  }
  .guide-banner {
    position: absolute;
    right: 0;
    top: 2rem;
    width: min(32%, 340px);
    height: 135px;
    border: 4px solid #fffbed;
    outline: 1px solid #cbbfa6;
  }
}
@media (max-width: 700px) {
  .entity-layout {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }
  .entry-sprite {
    width: 65px;
    height: 65px;
    margin-right: 0.65rem;
  }
  .guide-banner {
    height: 120px;
  }
  .catalog-item {
    gap: 0.22rem;
  }
}
.page-heading:has(.entry-sprite) {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.1rem;
  align-items: start;
}
.page-heading:has(.entry-sprite) .entry-sprite {
  float: none;
  margin: 0;
  grid-column: 1;
  grid-row: 1/3;
}
.page-heading:has(.entry-sprite) > h1,
.page-heading:has(.entry-sprite) > p {
  grid-column: 2;
}
@media (max-width: 510px) {
  #navigation {
    gap: 0;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0.22rem 0;
  }
  #navigation a {
    font-size: 0.97rem;
    padding: 0.34rem 0.38rem 0.22rem;
  }
  .page-heading:has(.entry-sprite) {
    column-gap: 0.7rem;
  }
  .page-heading:has(.entry-sprite) > p {
    font-size: 1.03rem;
    margin-top: 0.3rem;
  }
}
.edition-context {
  margin: 0 0 1.25rem;
  border: 1px solid #d9c6a6;
  background: #f6efdf;
  border-radius: 5px;
  padding: 0.52rem 0.85rem;
  font-size: 1rem;
  color: #544733;
}
@media (max-width: 510px) {
  #navigation {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    justify-content: start;
    gap: 0 0.65rem;
  }
  #navigation a {
    justify-self: start;
  }
  .cover h1 br {
    display: block;
  }
  .cover h1 em::before {
    content: none;
  }
}
.room-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.45fr);
  align-items: center;
  background: #eff1e8;
  border: 1px solid var(--line);
  padding: 0.7rem;
  gap: 1.1rem;
  border-radius: 6px;
  margin: 0.8rem 0;
}
.room-map svg {
  display: block;
  width: 100%;
  height: clamp(180px, 23vw, 260px);
}
.room-map figcaption {
  display: grid;
  gap: 0.45rem;
  font-size: 0.93rem;
}
.room-map figcaption span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.room-map figcaption span::before {
  content: "";
  width: 10px;
  height: 10px;
  background: #805522;
  border-radius: 100%;
  flex: none;
}
.room-map figcaption .legend-pickup::before {
  background: #8d4865;
}
.room-map figcaption .legend-ore::before {
  background: #376a8a;
  transform: rotate(45deg);
  border-radius: 0;
}
.room-map figcaption .legend-gate::before {
  background: #417656;
  border-radius: 0;
}
.planner label {
  display: grid;
  gap: 0.2rem;
  margin: 0.8rem 0;
}
.planner select {
  min-width: 0;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #aab5a7;
  background-color: var(--sheet);
  border-radius: 4px;
}
.planner ol {
  padding-left: 1.4rem;
}
@media (max-width: 510px) {
  .room-map {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .room-map figcaption {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.85rem;
  }
}

.entry-preview {
  position: fixed;
  z-index: 80;
  box-sizing: border-box;
  width: max-content;
  max-width: min(23rem, calc(100vw - 20px));
  max-height: calc(100dvh - 20px);
  overflow-y: auto;
  padding: .9rem 1rem;
  border: 1px solid #aeb7a5;
  border-radius: 9px;
  background: #fffdf5;
  color: #283a36;
  box-shadow: 0 8px 25px #193e342c;
  font-size: 1rem;
  line-height: 1.35;
}
.entry-preview[hidden] { display: none; }
.preview-heading { display: flex; align-items: center; gap: .65rem; }
.preview-heading .game-sprite { flex: none; background-color: #ebeddf; border-radius: 6px; }
.preview-heading > div { display: grid; }
.preview-name { font-family: var(--serif); font-size: 1.24rem; line-height: 1.14; }
.preview-type { font-size: .83rem; color: #556554; margin-bottom: .16rem; }
.preview-facts { margin: .72rem 0 .3rem; padding-top: .56rem; border-top: 1px solid #dedfcf; font-weight: 600; }
.preview-detail { margin: .3rem 0 0; }

.preview-model { width: 5rem; height: 5rem; flex: none; object-fit: contain; }
rf4-model {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(10.5rem, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fffdf6;
}
.model-stage {
  position: relative;
  height: clamp(14rem, 29vw, 19rem);
  min-width: 0;
  background: radial-gradient(ellipse at 50% 62%, #fdfcf2 10%, #eef0df 75%, #e2e7d5 100%);
}
.model-stage canvas, .model-poster { width: 100%; height: 100%; position: absolute; inset: 0; }
.model-poster { padding: 0.8rem; box-sizing: border-box; object-fit: contain; pointer-events: none; }
.model-stage canvas { touch-action: none; cursor: grab; }
.model-stage canvas:active { cursor: grabbing; }
.model-stage canvas:focus-visible { outline-offset: -4px; }
.model-controls { display: flex; flex-direction: column; justify-content: center; gap: 0.85rem; padding: 1rem; }
.model-controls label { display: grid; gap: 0.3rem; font-size: 0.95rem; font-weight: 650; }
.model-controls select { width: 100%; }
.model-controls button { padding: 0.36rem 0.55rem; }
.model-orbit, .model-transport { display: flex; align-items: center; gap: 0.35rem; }
.model-orbit button[data-turn] { min-width: 2.6rem; }
.model-transport button { min-width: 4rem; }
.model-transport input { width: 0; min-width: 2rem; flex: 1; accent-color: #446958; }
.model-controls small, .model-controls [data-status] { font-size: 0.88rem; color: var(--muted); }
.model-controls [data-status]:empty { display: none; }
@media (max-width: 580px) {
  rf4-model { grid-template-columns: 1fr; }
  .model-stage { height: 14rem; }
  .model-controls { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 0.55rem 0.9rem; }
  .model-transport, .model-controls small, .model-controls [data-status], .model-controls p { grid-column: 1/-1; }
}

.guardian-art { margin: 0; }
.guardian-art img { display: block; width: min(100%, 32rem); background: #eef0df; border-radius: 8px; }
.guardian-art figcaption { color: var(--muted); font-size: 0.95rem; margin-top: 0.55rem; }


.motion-evidence { grid-column: 1 / -1; min-width: 0; font-size: 0.94rem; }
.motion-evidence summary { color: var(--teal); cursor: pointer; }
.model-controls .motion-evidence p { margin: .4rem 0 0; overflow-wrap: anywhere; line-height: 1.45; }
.model-controls select { min-width: 0; text-overflow: ellipsis; }
.model-controls label { min-width: 0; }
@media (max-width: 580px) {
  .model-controls label { grid-column: 1 / -1; }
}

/* The atlas has two scales: the lower-screen diagram and the room artwork. */
.atlas-grid, .atlas-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 215px), 1fr)); gap: .8rem; }
.atlas-card, .atlas-room { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--sheet); text-decoration: none; }
.atlas-card { flex-direction: column; }
.atlas-card:hover, .atlas-room:hover, .skill-card:hover { border-color: var(--teal); }
.atlas-card > span { padding: .6rem .85rem .72rem; }
.atlas-card strong { display: block; font: 600 1.12rem/1.3 var(--serif); }
.atlas-card small, .atlas-room small, .area-figure small { color: var(--muted); display: block; font-size: .93rem; }
.atlas-thumb { display: block; background: #344946; object-fit: cover; width: 100%; height: 104px; }
.atlas-thumb.mini-thumb { object-fit: contain; }
.atlas-back { display: inline-block; margin: .2rem 0 .65rem; }
.atlas-area-title { margin-bottom: .6rem; }
.atlas-spread { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.2fr); gap: 1.3rem 2rem; align-items: start; }
.atlas-spread:not(:has(.area-figure)) { display: block; }
.atlas-spread h3 { margin-bottom: .65rem; }
.atlas-rooms { grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr)); gap: .45rem; }
.atlas-room { align-items: center; line-height: 1.14; }
.atlas-room span { padding: .4rem .55rem; font-weight: 600; overflow-wrap: anywhere; }
.atlas-room small { font-weight: 400; margin-top: .14rem; }
.atlas-room .atlas-thumb { align-self: stretch; width: 3.7rem; height: 3.3rem; }
.extra-rooms { margin-top: .9rem; }
.extra-rooms summary { margin-bottom: .5rem; }
.area-figure { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; max-width: 530px; }
.area-illustration { background: radial-gradient(ellipse, #46645d, #223936); }
.area-illustration svg { display: block; width: 100%; max-height: 470px; }
.area-figure figcaption { padding: .55rem .8rem; background: var(--sheet); }
.room-hotspot rect { fill: transparent; stroke: transparent; stroke-width: 1; }
.room-hotspot:hover rect, .room-hotspot:focus rect, .current-room rect { stroke: white; fill: #174e6d66; stroke-width: 1.6; }
.current-room { pointer-events: none; }
.current-room rect { stroke: #fff295; fill: #12433480; }
.current-key { margin-left: .75rem; font-weight: 600; }
.current-key::before { display: inline-block; content: ""; background: #45665b; border: 2px solid #e3ca65; height: .74rem; width: .74rem; margin-right: .3rem; vertical-align: baseline; }
.sheet-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin: .45rem 0 .9rem; }
.sheet-tabs a { text-decoration: none; padding: .25rem .65rem; border: 1px solid var(--line); border-radius: 4px; }
.sheet-tabs a[aria-current] { background: var(--teal); color: white; border-color: var(--teal); }
.room-map { display: block; padding: 0; overflow: hidden; }
.map-stage { background: #2d423e; }
.room-map svg { width: 100%; height: auto; max-height: 510px; min-height: 185px; }
.room-map figcaption { display: block; padding: .55rem .85rem; background: var(--sheet); }
.map-layers { border: 0; margin: .25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.map-layers legend { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.map-layers label { font-size: .98rem; cursor: pointer; }
.map-layers input { accent-color: var(--teal); }
.map-stage a:hover circle, .map-stage a:focus circle { stroke: white; stroke-width: 2px; }
.room-map:has([data-map-layer="exit"]:not(:checked)) .layout-exit,
.room-map:has([data-map-layer="ore"]:not(:checked)) .layout-ore,
.room-map:has([data-map-layer="pickup"]:not(:checked)) .layout-pickup,
.room-map:has([data-map-layer="gate"]:not(:checked)) .layout-gate { display: none; }
@media(max-width: 720px) {
  .atlas-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .atlas-spread { grid-template-columns: 1fr; }
  .atlas-card .atlas-thumb { height: 85px; }
}
.skill-family { margin: 1rem 0 1.65rem; }
.skill-family h2 { margin: 0 0 .55rem; font-size: 1.48rem; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr)); gap: .6rem; }
.skill-card { display: flex; flex-direction: column; align-items: flex-start; padding: .65rem .9rem; gap: .18rem; border: 1px solid var(--line); border-left: 3px solid #819687; border-radius: 4px; text-decoration: none; background: var(--sheet); }
.skill-card strong { font-family: var(--serif); }
.skill-card span { color: var(--ink); }
.skill-card small, .skill-ref { color: var(--muted); font-size: .9rem; }
.skill-ref { display: block; margin-top: .2rem; }
.skill-article h3 { font-size: 1.12rem; margin: .9rem 0 0; }
.skill-article .facts { margin-bottom: 0; }
.skill-article .fields { margin: .8rem 0 1rem; }
.skill-article .level-cost { margin-bottom: .65rem; }
.level-cost strong { color: var(--teal); font-family: var(--serif); font-size: 1.4rem; margin-right: .35rem; }
.skill-stats { width: 100%; background: var(--sheet); border-collapse: collapse; }
.skill-stats td, .skill-stats th { padding: .4rem .55rem; text-align: right; }
.skill-stats th:first-child { text-align: left; }
.skill-math div { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.skill-math dt { font-weight: 600; }
.skill-math dd { margin: .18rem 0 0; }
.skill-math code { font-size: .94rem; overflow-wrap: anywhere; }
.skill-article blockquote { margin: .4rem 0 .6rem; padding-left: .85rem; border-left: 3px solid var(--line); }
@media(max-width: 500px) {
  .skill-article .calculator { padding: .75rem; }
  .skill-stats td, .skill-stats th { font-size: .92rem; padding: .25rem; }
}
.training-note { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.training-note p { margin: .35rem 0; max-width: 78ch; }

/* Resident portraits and the two views of a scheduled stop. */
.resident-family { margin: 1.4rem 0 1.8rem; }
.resident-family h2, .npc-spread h2 { font-size: 1.4rem; margin-bottom: .55rem; }
.resident-grid, .npc-room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 205px), 1fr)); gap: .6rem; }
.resident-card { display: flex; align-items: center; background: var(--sheet); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; text-decoration: none; min-height: 4.2rem; }
.resident-card:hover, .resident-card:focus-visible { border-color: var(--teal); background: #f2f3e9; }
.resident-icon { width: 2.2rem; height: 2.2rem; object-fit: contain; flex: none; }
.resident-card .resident-icon { width: 4.35rem; height: 4.35rem; background: linear-gradient(135deg,#f2eedc,#dbe4d8); margin: 0; }
.resident-card span { padding: .4rem .6rem; }
.resident-card strong { display: block; font: 600 1.08rem var(--serif); }
.resident-card small { display: block; margin-top: .22rem; line-height: 1.22; color: var(--muted); font-size: .92rem; }
.page-heading.npc-heading { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.npc-heading img { width: 5.8rem; height: 5.8rem; object-fit: contain; background: linear-gradient(145deg,#e4e9db,#f7f1de); border: 1px solid var(--line); border-radius: 6px; }
.npc-heading h1 { margin: 0; }
.npc-heading p { margin: .18rem 0 0; }
.resident-note { max-width: 77ch; margin: .6rem 0; }
.npc-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem 1rem; }
.npc-query { margin: 1rem 0 1.6rem; padding: .8rem 1rem; background: #eeefe5; border: 1px solid var(--line); border-radius: 6px; }
.npc-controls label, .npc-location { display: grid; gap: .18rem; min-width: 0; font-weight: 600; font-size: .98rem; }
.npc-controls select, .npc-controls input[type=time], .npc-location select { border: 1px solid #abb5aa; border-radius: 4px; min-height: 40px; max-width: 100%; padding: .4rem .55rem; background-color: var(--sheet); font: inherit; }
.npc-controls label.npc-married { display: flex; align-items: center; gap: .4rem; min-height: 40px; }
.npc-controls input[type=checkbox] { accent-color: var(--teal); }
.npc-spread { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); align-items: start; gap: clamp(1.2rem,3vw,2.2rem); }
.npc-target, .npc-agenda { min-width: 0; }
.npc-target p, .npc-agenda p { margin: .35rem 0 .6rem; }
.npc-target-time, .npc-next { color: var(--teal); }
.npc-location { margin-top: .65rem; }
.npc-location-map { margin: .65rem 0 .75rem; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: var(--sheet); }
.npc-map { display: block; width: 100%; height: auto; background: #2f403e; }
.npc-location-map .npc-map { max-height: 345px; }
.npc-location-map figcaption { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .25rem .65rem; padding: .45rem .65rem; }
.npc-location-map small, .npc-caveat { color: var(--muted); font-size: .96rem; }
.npc-journey { margin: .7rem 0; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 5px; background: var(--sheet); }
.npc-journey .npc-controls { margin-top: .7rem; }
.npc-journey label { flex: 1 1 180px; }
.npc-walk { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(135px,100%),1fr)); gap: .5rem; padding: 0; }
.npc-walk li { list-style: none; }
.npc-walk svg { height: 96px; border-radius: 4px; }
.npc-walk a { font-size: .95rem; }
.npc-agenda ol { list-style: none; padding: 0; margin: .5rem 0; border-top: 1px solid var(--line); }
.npc-agenda button { display: flex; align-items: baseline; gap: .75rem; width: 100%; font: inherit; text-align: left; padding: .43rem .6rem; background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.npc-agenda button:hover { background: var(--wash); }
.npc-agenda button[aria-current] { background: #e3eddf; box-shadow: inset 3px 0 0 var(--teal); }
.npc-agenda time { flex: 0 0 4.8rem; font-variant-numeric: tabular-nums; font-weight: 650; color: var(--teal); }
.npc-evidence { margin: 1.5rem 0; max-width: 84ch; }
.npc-evidence p { margin: .6rem 0; }
.npc-room-list { margin: .7rem 0; }
@media (max-width: 740px) {
  .npc-spread { grid-template-columns: 1fr; }
  .npc-query { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
  .npc-married { grid-column: 1/-1; }
}

.npc-heading .npc-birthday, .npc-heading .npc-birthday-note {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem;
  margin: .45rem 0 0; color: var(--muted); font-size: 1rem;
}
.npc-heading .npc-birthday img { width: 1.5rem; height: 1.5rem; border: 0; border-radius: 0; background: none; }
.npc-birthday strong { color: var(--ink); }
.npc-heading .npc-birthday-note { display: block; }
.resident-card .directory-birthday { color: var(--teal); }
.npc-gifts { margin: 1.15rem 0; padding: .95rem 1.15rem .7rem; background: var(--sheet); border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 5px; }
.gift-heading, .gift-picks > div, .gift-picks dd { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem 1rem; }
.gift-heading { justify-content: space-between; }
.npc-gifts h2 { font: 600 1.3rem var(--serif); margin: 0; }
.gift-heading > a, .gift-source { font-size: .94rem; }
.gift-picks { margin: .45rem 0 .6rem; }
.gift-picks > div { padding: .22rem 0; }
.gift-picks dt { color: var(--muted); min-width: 5.5rem; }
.gift-picks dd { margin: 0; }
.gift-item { display: inline-flex; align-items: center; gap: .32rem; }
.gift-book { border-top: 1px solid var(--line); }
.gift-book summary { cursor: pointer; color: var(--teal); font-weight: 600; padding: .55rem 0 .2rem; }
.gift-lookup { display: grid; gap: .25rem; max-width: 28rem; margin: .8rem 0; }
.gift-lookup input { width: 100%; padding: .45rem .65rem; border: 1px solid #87958b; border-radius: 4px; font: inherit; background: white; }
.gift-tier { padding: .1rem 0 .4rem; border-top: 1px solid var(--line); }
.gift-tier summary span { color: var(--muted); font-weight: 400; margin-left: .3rem; }
.gift-items { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,13rem),1fr)); gap: .3rem 1rem; padding: .55rem 0; }
.gift-results { padding: 0; max-width: 34rem; }
.gift-results li { list-style: none; padding: .35rem 0; border-top: 1px solid var(--line); }
.gift-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .1rem .6rem; }
.gift-results li p { font-size: .95rem; margin: .3rem 0; color: var(--muted); }
.gift-verdict { display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.gift-verdict small { color: var(--muted); }
.gift-results li strong { font-size: .95rem; }
.gift-source { color: var(--muted); margin: .7rem 0 .3rem; }
@media (max-width: 540px) {
  .npc-gifts { padding: .8rem; }
  .gift-picks > div { display: block; }
  .gift-picks dt { margin-bottom: .16rem; }
}

.farm-planner { display: grid; grid-template-columns: minmax(15rem, .86fr) minmax(0,1.5fr); max-width: 1060px; border: 1px solid var(--line); border-radius: .5rem; overflow: hidden; background: var(--sheet); margin: .8rem 0 2rem; }
.farm-controls, .farm-output { padding: clamp(1rem,2.4vw,1.7rem); }
.farm-controls { background: #f0f2e9; border-right: 1px solid var(--line); }
.farm-controls h2, .farm-output h2 { font: 600 1.4rem var(--serif); margin: 0 0 .65rem; }
.farm-controls label { display: grid; gap: .18rem; margin: .45rem 0; font-weight: 600; }
.farm-controls select, .farm-controls input[type=number] { width: 100%; min-width: 0; font: inherit; font-weight: 400; background-color: var(--sheet); border: 1px solid #84948a; border-radius: .25rem; padding: .38rem .5rem; }
.farm-planner summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.farm-planner details { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.farm-gear fieldset { border: 0; padding: .3rem 0; margin: .45rem 0 0; }
.farm-gear legend { font-weight: 650; }
.farm-gear label:has(input[type=checkbox]) { display: flex; align-items: center; font-weight: 400; gap: .5rem; }
.farm-target { display: flex; align-items: center; gap: .8rem; }
.farm-target h2 { margin: .15rem 0 0; }
.farm-target h2 a { display: flex; gap: .3rem; align-items: center; color: var(--ink); }
.farm-portrait { background: #efeee2; border: 1px solid var(--line); border-radius: .3rem; width: 5rem; height: 5rem; object-fit: contain; }
.farm-metrics, .farm-goals { padding: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .6rem; }
.farm-metrics { margin: 1.15rem 0; background: #eaf0e9; border-radius: .3rem; padding: .8rem; }
.farm-metrics dt, .farm-goals dt { color: var(--muted); font-size: .94rem; }
.farm-metrics dd { margin: .25rem 0 0; color: var(--teal); font: 620 clamp(1.15rem,2vw,1.6rem) var(--serif); font-variant-numeric: tabular-nums; }
.farm-goals dd { margin: .1rem 0 0; font-weight: 650; }
.farm-output h3 { font-size: 1.05rem; margin: .65rem 0 .35rem; }
.farm-goals { margin: .4rem 0 .8rem; }
.farm-hint, .farm-blocked { margin: .7rem 0; }
.farm-blocked { border-left: 3px solid var(--rust); padding-left: .6rem; }
.farm-map figure { margin: .65rem 0; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.farm-map svg { width: min(100%,15rem); height: auto; }
.farm-map figcaption { flex: 1 1 10rem; }
@media (max-width: 760px) {
  .farm-planner { grid-template-columns: minmax(0,1fr); }
  .farm-controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .farm-inputs { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 .7rem; }
}
@media (max-width: 460px) {
  .farm-inputs { display:block; }
  .farm-goals, .farm-metrics { gap: .45rem; }
  .farm-metrics { grid-template-columns: 1fr; }
  .farm-metrics div { display:flex; justify-content:space-between; align-items:baseline; gap:.4rem; }
}

.upgrade-filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,12rem),1fr)); gap: .85rem; padding: 1rem; border: 1px solid var(--line); border-radius: .4rem; background: #eef1e7; }
.upgrade-filters label { display: grid; gap: .25rem; align-content: end; font-weight: 600; }
.upgrade-filters label[hidden] { display: none; }
.upgrade-filters input, .upgrade-filters select { width: 100%; min-width: 0; padding: .46rem .55rem; font: inherit; font-weight: 400; color: var(--ink); background-color: var(--sheet); border: 1px solid #85958a; border-radius: .25rem; }
.upgrade-material { display: flex; align-items: center; gap: .5rem; min-width: 10rem; }
.upgrade-material > div > a { font-weight: 650; }
.upgrade-material small { display: block; color: var(--muted); font-size: .9rem; }
.upgrade-value { color: var(--teal); font: 650 1.1rem var(--serif); font-variant-numeric: tabular-nums; }
.upgrade-results .penalty { color: var(--rust); }
.upgrade-effect { display: inline-block; }
.upgrade-compat { padding: .6rem .85rem; border-left: 3px solid var(--teal); background: var(--sheet); }
.upgrade-notes { margin-top: 1rem; max-width: 80ch; }
.upgrade-notes summary { color: var(--teal); font-weight: 600; cursor: pointer; }
