:root {
  --ink: #1a1d21;
  --muted: #5c564c;
  --faint: #8a8174;
  --paper: #f6f3ed;
  --paper-2: #efeae2;
  --line: #ddd4c6;
  --line-strong: #c9bdaa;
  --navy: #1c2836;
  --brass: #8a7044;
  --link: #1a3f68;
  --focus: #8a7044;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "STSong", "Noto Serif SC", "PMingLiU", serif;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --measure: 68ch;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #e6d7b8;
  color: var(--ink);
}

a {
  color: var(--link);
  text-underline-offset: 0.16em;
}

a:hover { color: #10283f; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--navy);
  color: #f7f4ee;
  padding: 0.5rem 0.8rem;
  z-index: 10;
}

.skip:focus { top: 0.75rem; }

.masthead {
  background: var(--navy);
  color: #f3eee6;
}

.masthead-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 1.6rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.15rem;
  align-items: start;
}

.mark {
  width: 2.7rem;
  height: 2.7rem;
  margin-top: 1.55rem;
  border: 1px solid #c4b48a;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  letter-spacing: 0.06em;
  font-size: 0.92rem;
  color: #f3eee6;
}

.kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c4b48a;
}

.masthead h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.deck {
  margin: 0.45rem 0 0;
  max-width: 40rem;
  color: #d9d0c3;
  font-size: 1rem;
  line-height: 1.6;
}

.meta-line {
  margin: 0.7rem 0 0;
  color: #b7c0ca;
  font-size: 0.86rem;
}

.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
  display: grid;
  gap: 2rem;
  min-width: 0;
}

.toc {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
  min-width: 0;
}

.toc p {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}

.toc ol {
  list-style: none;
  display: flex;
  gap: 0.35rem 1.1rem;
  margin: 0;
  padding: 0;
  overflow-x: auto;
}

.toc a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
}

.toc a:hover { border-bottom-color: var(--brass); }

.sheet {
  max-width: 760px;
  min-width: 0;
}

.sheet > section {
  padding: 2.4rem 0 0.4rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1.25rem;
}

.sheet > section:first-child { border-top: 0; padding-top: 0.4rem; }

.sec-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}

h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

h2 { font-size: 1.85rem; margin: 0 0 0.9rem; }

h3 { font-size: 1.25rem; margin: 1.6rem 0 0.45rem; }

p { margin: 0.75rem 0; }

.lede { font-size: 1.08rem; }

.note, .limit {
  margin: 1.15rem 0;
  padding: 0.9rem 0 0.9rem 1rem;
  border-left: 2px solid var(--brass);
  background: transparent;
}

.limit {
  background: var(--paper-2);
  border-left-color: var(--navy);
  padding: 1rem 1.1rem;
}

.limit p:first-child,
.note p:first-child { margin-top: 0; }

.limit p:last-child,
.note p:last-child { margin-bottom: 0; }

.tracks {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 1.3rem 0 0.4rem;
}

.tracks article {
  background: #fcfbf8;
  padding: 0.95rem 1.05rem 1rem;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.35rem 0.8rem;
  align-items: start;
}

.tracks h3 {
  margin: 0.1rem 0 0.35rem;
  grid-column: 2;
  grid-row: 1;
}

.tracks article > p:not(.num) {
  grid-column: 2;
  grid-row: 2;
}

.tracks p { margin: 0; color: var(--ink); }

.num {
  margin: 0;
  grid-column: 1;
  grid-row: 1;
  font-family: var(--serif);
  color: var(--brass);
  font-size: 0.92rem;
}

ul, ol { padding-left: 1.2rem; }

li + li { margin-top: 0.35rem; }

.table-wrap {
  margin: 1rem 0 0.4rem;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border-top: 1px solid var(--ink);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
  min-width: 640px;
}

caption {
  caption-side: bottom;
  text-align: left;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.55rem 0 0;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 0.7rem 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.rail {
  list-style: none;
  margin: 1.2rem 0;
  padding: 0;
  border-left: 1px solid var(--line-strong);
}

.rail li {
  margin: 0;
  padding: 0 0 1.25rem 1.15rem;
  position: relative;
}

.rail li::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid var(--brass);
  background: var(--paper);
  position: absolute;
  left: -4px;
  top: 0.45rem;
}

.rail h3 { margin: 0 0 0.25rem; }

.rail p { margin: 0.3rem 0 0; }

.glossary { min-width: 520px; }

details {
  margin: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0;
}

summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.05rem;
}

summary:hover { color: var(--link); }

.sources { padding-left: 1.15rem; }

.sources li { margin-top: 0.45rem; }

.colophon {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.4rem 1.5rem 2.5rem;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.88rem;
}

.colophon p { margin: 0.35rem 0; }

@media (min-width: 960px) {
  .layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
    padding-top: 2.25rem;
  }

  .toc {
    position: sticky;
    top: 1.25rem;
    border: 0;
    padding: 0;
  }

  .toc ol {
    display: grid;
    gap: 0.45rem;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .masthead-inner { grid-template-columns: auto 1fr; }
  .mark { margin-top: 0.15rem; }
  h2 { font-size: 1.55rem; }
}

@media print {
  body { background: white; font-size: 11pt; }
  .skip, .toc { display: none; }
  .masthead { background: white; color: black; }
  .masthead h1, .deck, .meta-line, .kicker { color: black; }
  .layout, .colophon { max-width: none; padding: 0; }
  a { color: black; text-decoration: none; }
  .sheet > section { break-inside: avoid; }
}
