:root {
  --paper: #f3efe6;
  --ink: #1c1915;
  --soft: #4a433a;
  --rule: #d5ccbe;
  --seal: #8f2d2a;
  --down: #1e4d3a;
  --surface: #fffdf8;
  --hover: #f6f0e4;
  --focus: #8f2d2a;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Hiragino Sans", "Noto Sans CJK JP", "Noto Sans JP", "Yu Gothic", "YuGothic", "Meiryo", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

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

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

a { color: #7a2e24; text-underline-offset: 0.18em; }

a:hover { color: #5e1f1c; }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  z-index: 2;
}

.skip:focus { top: 0.75rem; color: var(--paper); }

.wrap {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3.5rem;
}

.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 1.25rem;
}

.mark {
  color: var(--ink);
  text-decoration: none;
  font-family: "Iowan Old Style", "Palatino Linotype", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.mark span {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.12rem 0.28rem 0.08rem;
  border: 1px solid var(--seal);
  color: var(--seal);
  font-size: 0.92rem;
  letter-spacing: 0;
}

.site-nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.95rem; }

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 0.5rem;
  align-items: center;
  max-width: 40rem;
  margin: 0.6rem 0 1.1rem;
}

.search label { grid-column: 1 / -1; margin: 0; }

.search input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  border: 1px solid #8a8175;
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  caret-color: var(--seal);
}

.search input::placeholder { color: #5c5348; opacity: 1; }

.search button,
button {
  min-height: 48px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
}

.search button:hover,
button:hover { background: #3a332c; }

h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0.4rem 0 0.8rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.35;
  margin: 2.3rem 0 0.55rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 1.5rem 0 0.4rem;
}

.prose { max-width: 68ch; }

.prose p { margin: 0.7rem 0; }

.crumbs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.2rem;
  color: var(--soft);
  font-size: 0.92rem;
}

.crumbs li { display: inline; }

.crumbs li + li::before { content: "/"; margin-right: 0.35rem; color: #8a8175; }

.lede { font-size: 1.08rem; }

.sheet {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.98rem;
}

.sheet th,
.sheet td {
  padding: 0.48rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.sheet th {
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.sheet td.num,
.sheet th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.sheet.wide {
  width: max-content;
  min-width: 100%;
}

.sheet.wide th,
.sheet.wide td {
  white-space: nowrap;
}

.sheet tbody tr:hover { background: var(--hover); }

.scroll { overflow-x: auto; margin: 0.4rem 0 0.2rem; }

.hint { color: var(--soft); font-size: 0.9rem; margin: 0.2rem 0 0.6rem; }

.up { color: var(--seal); font-variant-numeric: tabular-nums; }

.down { color: var(--down); font-variant-numeric: tabular-nums; }

.flat { font-variant-numeric: tabular-nums; }

.note {
  max-width: 68ch;
  color: var(--soft);
  font-size: 0.95rem;
}

.site-foot {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink);
  color: var(--soft);
  font-size: 0.86rem;
}

.site-foot p { margin: 0.45rem 0; max-width: 78ch; }

.links { padding: 0; margin: 0.4rem 0 0; list-style: none; }

.links li { margin: 0.15rem 0; }

details { margin: 1.2rem 0; }

summary { cursor: pointer; font-weight: 650; }

.tag {
  display: inline-block;
  margin-left: 0.35rem;
  color: var(--soft);
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .wrap { width: min(960px, calc(100% - 1.25rem)); }
  .sheet { font-size: 0.92rem; }
  .sheet th, .sheet td { padding: 0.42rem 0.4rem; }
  .site-nav { width: 100%; }
}
