:root {
  --bg: #fbfaf7;
  --panel: #f2efe8;
  --text: #22201c;
  --muted: #6b665d;
  --line: #ddd7cb;
  --accent: #8a3b2e;
  --accent-soft: #f3e3df;
  --link: #8a3b2e;
  --fig-bg: #ffffff;
  --measure: 42rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18;
    --panel: #24221f;
    --text: #e9e5dc;
    --muted: #a39d92;
    --line: #3a3732;
    --accent: #e09a86;
    --accent-soft: #3a2a25;
    --link: #e8a894;
    --fig-bg: #f4f2ee;
  }
}
* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Charter, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.6;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.layout { display: grid; grid-template-columns: 17rem minmax(0, 1fr); min-height: 100vh; }
nav.side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 1.6rem 1.2rem 2rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.86rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
nav.side .home { display: block; font-weight: 700; font-size: 1rem; color: var(--text); text-decoration: none; margin-bottom: 1.2rem; line-height: 1.3; }
nav.side h4 { margin: 1.2rem 0 0.35rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
nav.side ol, nav.side ul { list-style: none; margin: 0; padding: 0; }
nav.side li a { display: block; padding: 0.22rem 0.5rem; border-radius: 4px; color: var(--text); text-decoration: none; }
nav.side li a:hover { background: var(--accent-soft); }
nav.side li a.current { background: var(--accent); color: var(--bg); }
nav.side .num { color: var(--muted); display: inline-block; width: 1.6rem; }
nav.side li a.current .num { color: var(--bg); }

main { padding: 2.6rem 2.4rem 4rem; }
article, .page { max-width: var(--measure); margin: 0 auto; }
.kicker { font-family: system-ui, sans-serif; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.4rem; }
h1 { font-size: 2.1rem; line-height: 1.2; margin: 0 0 1rem; font-weight: 600; }
h2 { font-size: 1.35rem; margin: 2.4rem 0 0.6rem; font-weight: 600; }
h3 { font-size: 1.1rem; margin: 1.8rem 0 0.4rem; }
p { margin: 0 0 1rem; }
.summary {
  font-size: 1.08rem; color: var(--text);
  border-left: 3px solid var(--accent); padding: 0.2rem 0 0.2rem 1rem; margin: 0 0 2rem;
}
.note {
  font-family: system-ui, sans-serif; font-size: 0.88rem; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 0.8rem 1rem; margin: 1.4rem 0;
}
.note strong { color: var(--text); }

figure { margin: 1.8rem 0; }
figure.wide { margin-left: -6rem; margin-right: -6rem; }
figure a.img { display: block; background: var(--fig-bg); border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem; }
figure img { display: block; width: 100%; height: auto; }
figure.photo a.img { padding: 0; overflow: hidden; background: transparent; }
figure.photo img { max-height: 46rem; object-fit: contain; background: var(--panel); }
figcaption { font-family: system-ui, sans-serif; font-size: 0.84rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.45; }
figcaption b { color: var(--text); font-weight: 600; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.8rem 0; }
.pair figure { margin: 0; }

.related, .pager {
  font-family: system-ui, sans-serif; font-size: 0.9rem;
  border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1.2rem;
}
.related h2 { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.related ul { margin: 0; padding-left: 1.1rem; }
.related li { margin: 0.3rem 0; }
.pager { display: flex; justify-content: space-between; gap: 1rem; border-top: none; margin-top: 1.4rem; padding-top: 0; }
.pager a { text-decoration: none; }

.map { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.card {
  display: block; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem 1rem; background: var(--panel);
}
.card:hover { border-color: var(--accent); }
.card .t { font-weight: 600; display: block; margin-bottom: 0.25rem; }
.card .d { font-family: system-ui, sans-serif; font-size: 0.83rem; color: var(--muted); line-height: 1.4; }
.part-title { margin-top: 2.2rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.8rem; }
.gallery a { display: block; background: var(--fig-bg); border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem; text-decoration: none; }
.gallery img { width: 100%; height: 9rem; object-fit: contain; display: block; }
.gallery span { display: block; font-family: system-ui, sans-serif; font-size: 0.75rem; color: #555; margin-top: 0.3rem; line-height: 1.3; }

dl.gloss dt { font-weight: 600; margin-top: 1.1rem; }
dl.gloss dd { margin: 0.2rem 0 0 0; }
ul.plain { padding-left: 1.1rem; }
ul.plain li { margin: 0.4rem 0; }

.menu-toggle { display: none; }

@media (max-width: 1100px) {
  figure.wide { margin-left: 0; margin-right: 0; }
}
@media (max-width: 820px) {
  .layout { display: block; }
  nav.side { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 1rem 16px; }
  nav.side .lists { display: none; }
  nav.side.open .lists { display: block; }
  .menu-toggle {
    display: inline-block; font: inherit; font-size: 0.85rem; background: none; border: 1px solid var(--line);
    border-radius: 4px; padding: 0.25rem 0.6rem; color: var(--text); cursor: pointer;
  }
  nav.side .home { display: inline-block; margin: 0 1rem 0 0; }
  main { padding: 1.6rem 16px 3rem; }
  h1 { font-size: 1.7rem; }
  .pair { grid-template-columns: 1fr; }
}

/* Illustration boxes (model pictures) and parts awaiting approval */
.illustration, .draft {
  border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 6px;
  padding: 0.9rem 1.1rem 0.2rem; margin: 1.8rem 0; background: var(--panel);
}
.draft { border-left-color: var(--accent); background: transparent; }
.box-label {
  font-family: system-ui, sans-serif; font-size: 0.78rem; letter-spacing: 0.04em; color: var(--muted);
  margin: 0 0 0.8rem;
}
.box-label b { text-transform: uppercase; letter-spacing: 0.08em; color: var(--text); }
.illustration > p:not(.box-label) { font-size: 0.95rem; }
.illustration figure.wide { margin-left: 0; margin-right: 0; }
.note.status { margin-top: -0.8rem; margin-bottom: 2rem; }
.open { font-style: italic; }
