
  :root {
    --paper: #F2F1EC;
    --paper-raised: #FAF9F6;
    --ink: #1D1F24;
    --steel: #5B6572;
    --line: #D8D6CE;
    --indigo: #2E4E7E;
    --indigo-soft: #E4E9F1;
    --seal: #AE3A2C;
    --seal-soft: #F3E4E1;
    --mono-bg: #E9E8E1;
  }
  :root:not([data-theme="light"]) {
    color-scheme: light dark;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --paper: #16181C;
      --paper-raised: #1F2228;
      --ink: #E6E4DC;
      --steel: #9AA3AE;
      --line: #333740;
      --indigo: #8FAEDB;
      --indigo-soft: #232C3B;
      --seal: #D96A57;
      --seal-soft: #33221F;
      --mono-bg: #23262C;
    }
  }
  :root[data-theme="dark"] {
    --paper: #16181C;
    --paper-raised: #1F2228;
    --ink: #E6E4DC;
    --steel: #9AA3AE;
    --line: #333740;
    --indigo: #8FAEDB;
    --indigo-soft: #232C3B;
    --seal: #D96A57;
    --seal-soft: #33221F;
    --mono-bg: #23262C;
  }
  * { box-sizing: border-box; }
  body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic UI", -apple-system, sans-serif;
    line-height: 1.65;
    margin: 0;
    font-size: 16px;
  }
  .mincho, h1, h2, h3 {
    font-family: "Yu Mincho", "Hiragino Mincho ProN", "MS PMincho", Georgia, "Times New Roman", serif;
  }
  h1, h2, h3 { text-wrap: balance; font-weight: 600; }
  a { color: var(--indigo); text-decoration-thickness: 1px; text-underline-offset: 2px; }
  a:focus-visible, .toc a:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 2px; }

  .frame { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0; max-width: 1080px; margin: 0 auto; }
  @media (max-width: 900px) { .frame { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

  .toc {
    position: sticky; top: 0; align-self: start;
    padding: 2.5rem 1.25rem 2rem 1.5rem;
    font-size: 0.82rem;
    max-height: 100vh; overflow-y: auto;
  }
  .toc .jp { font-size: 1.6rem; color: var(--seal); letter-spacing: 0.1em; margin-bottom: 1.2rem; writing-mode: vertical-rl; height: 8.5rem; }
  .toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
  .toc a { color: var(--steel); text-decoration: none; }
  .toc a:hover { color: var(--indigo); }

  main { padding: 0 1.5rem 5rem; min-width: 0; border-left: 1px solid var(--line); }
  @media (max-width: 900px) { main { border-left: none; } }

  header.hero { padding: 3.5rem 0 2.5rem; border-bottom: 3px double var(--line); margin-bottom: 2.5rem; }
  .hero .kanji { font-size: clamp(3rem, 9vw, 5.5rem); line-height: 1.1; letter-spacing: 0.06em; margin: 0; }
  .hero h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0.4rem 0 1rem; color: var(--ink); }
  .hero .sub { color: var(--steel); max-width: 62ch; margin: 0 0 1.4rem; }
  .hero .markrow { display: flex; flex-wrap: wrap; gap: 0.5rem; }

  .mei {
    display: inline-block; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    color: var(--seal); background: var(--seal-soft);
    border: 1px solid color-mix(in srgb, var(--seal) 35%, transparent);
    padding: 0.05rem 0.5rem; border-radius: 3px; font-size: 0.95em; white-space: nowrap;
  }

  section { max-width: 72ch; margin: 0 0 3.2rem; }
  section.wide { max-width: none; }
  h2 { font-size: 1.55rem; margin: 0 0 0.3rem; }
  h2 .no { color: var(--seal); font-size: 0.85em; margin-right: 0.5em; }
  h3 { font-size: 1.12rem; margin: 1.6rem 0 0.4rem; color: var(--ink); }
  .kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; color: var(--steel); margin-bottom: 1.1rem; }
  p { margin: 0.7rem 0; }
  .lede { font-size: 1.08rem; }

  sup.c { font-size: 0.7em; }
  sup.c a { text-decoration: none; color: var(--indigo); }

  .tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-raised); }
  table { border-collapse: collapse; width: 100%; font-size: 0.86rem; min-width: 620px; table-layout: fixed; }
  th { text-align: left; font-weight: 600; color: var(--steel); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.68rem; padding: 0.6rem 0.55rem; border-bottom: 2px solid var(--line); }
  td { padding: 0.55rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: normal; line-height: 1.5; }
  tr:last-child td { border-bottom: none; }
  td.person { font-weight: 600; }
  col.c-mark { width: 13%; } col.c-person { width: 15%; } col.c-place { width: 12%; }
  col.c-dates { width: 13%; } col.c-notes { width: 40%; } col.c-src { width: 7%; }
  td .mei { margin-bottom: 0.2rem; }
  tbody td:last-child a { white-space: nowrap; display: inline-block; margin: 0 0.15rem 0.1rem 0; }
  .num { font-variant-numeric: tabular-nums; }

  .case {
    background: var(--paper-raised); border: 1px solid var(--line);
    border-top: 3px solid var(--seal); border-radius: 6px; padding: 1.5rem 1.7rem; margin: 1.4rem 0;
  }
  .case h3 { margin-top: 0; }

  /* documentation plates — owner's physical evidence */
  figure.evidence { margin: 1.5rem 0 0.5rem; }
  figure.evidence > figcaption { font-size: 0.82rem; color: var(--steel); margin-top: 0.6rem; font-style: italic; }
  .plates { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; }
  .plates figure { margin: 0; }
  .plates img, .plate-lead img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 4px; background: var(--mono-bg); }
  .plate-lead { margin-bottom: 0.8rem; }
  .plates figcaption, .plate-lead figcaption { font-size: 0.75rem; color: var(--steel); margin-top: 0.35rem; text-align: center; }
  .plates .stamp img { object-fit: contain; }

  .note { background: var(--indigo-soft); border-radius: 6px; padding: 1rem 1.2rem; font-size: 0.92rem; }

  blockquote { margin: 1rem 0; padding: 0.2rem 0 0.2rem 1.1rem; border-left: 3px solid var(--seal); color: var(--steel); font-style: italic; }
  blockquote .jp { display: block; font-style: normal; font-family: "Yu Mincho", serif; color: var(--ink); margin-bottom: 0.25rem; }

  dl.timeline { margin: 1rem 0; }
  dl.timeline > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px dotted var(--line); }
  dl.timeline dt { color: var(--seal); font-weight: 600; font-variant-numeric: tabular-nums; margin: 0; }
  dl.timeline dd { margin: 0; }

  ol.sources { padding-left: 1.6rem; font-size: 0.88rem; }
  ol.sources li { margin: 0.45rem 0; }
  .src-group { margin-top: 1.6rem; font-weight: 600; color: var(--steel); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; }
  code { font-family: Consolas, "SF Mono", Menlo, monospace; font-size: 0.85em; background: var(--mono-bg); padding: 0.08em 0.35em; border-radius: 3px; }

  .status { display: inline-block; font-size: 0.66rem; padding: 0.03rem 0.4rem; border-radius: 99px; border: 1px solid var(--line); color: var(--steel); }
  .status.active { color: var(--indigo); border-color: color-mix(in srgb, var(--indigo) 40%, transparent); }

  footer { border-top: 3px double var(--line); padding-top: 1.5rem; color: var(--steel); font-size: 0.85rem; max-width: 72ch; }
  @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }


/* ---- site chrome (added by build) ---- */
.site-nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: baseline; gap: 1.5rem;
  padding: 0.7rem 1.5rem; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(6px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.site-nav .wordmark { font-family: "Yu Mincho","Hiragino Mincho ProN",Georgia,serif; font-weight: 600;
  color: var(--ink); text-decoration: none; font-size: 1.02rem; margin-right: auto; }
.site-nav .wordmark .jp { color: var(--seal); margin-right: 0.45rem; letter-spacing: 0.08em; }
.site-nav a.navlink { color: var(--steel); text-decoration: none; font-size: 0.85rem; letter-spacing: 0.02em; }
.site-nav a.navlink:hover, .site-nav a.navlink[aria-current="page"] { color: var(--indigo); }
.site-foot { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.6rem 1.5rem 3rem;
  color: var(--steel); font-size: 0.82rem; text-align: center; }
.site-foot a { color: var(--indigo); }

/* ---- article / prose pages ---- */
.article { max-width: 760px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.breadcrumb { font-size: 0.78rem; color: var(--steel); text-transform: uppercase; letter-spacing: 0.1em;
  margin: 1.8rem 0 0.4rem; }
.breadcrumb a { color: var(--steel); text-decoration: none; } .breadcrumb a:hover { color: var(--indigo); }
.prose { line-height: 1.72; }
.prose h1 { font-family: "Yu Mincho","Hiragino Mincho ProN",Georgia,serif; font-size: clamp(1.5rem,4vw,2.1rem);
  line-height: 1.2; text-wrap: balance; margin: 0.3rem 0 1.4rem; }
.prose h2 { font-family: "Yu Mincho","Hiragino Mincho ProN",Georgia,serif; font-size: 1.4rem;
  margin: 2.2rem 0 0.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); text-wrap: balance; }
.prose h3 { font-size: 1.12rem; margin: 1.6rem 0 0.3rem; }
.prose p, .prose li { max-width: 68ch; }
.prose blockquote { margin: 1.1rem 0; padding: 0.3rem 0 0.3rem 1.1rem; border-left: 3px solid var(--seal);
  color: var(--steel); font-style: italic; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9rem; margin: 1.2rem 0; display: block; overflow-x: auto; }
.prose th { text-align: left; border-bottom: 2px solid var(--line); padding: 0.5rem 0.7rem; color: var(--steel);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.prose td { border-bottom: 1px solid var(--line); padding: 0.5rem 0.7rem; vertical-align: top; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose code { font-family: Consolas,"SF Mono",Menlo,monospace; font-size: 0.85em; background: var(--mono-bg);
  padding: 0.08em 0.35em; border-radius: 3px; }
.prose a { color: var(--indigo); }
.article .endnav { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 3px double var(--line);
  display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; flex-wrap: wrap; }

/* ---- translations index ---- */
.tindex { max-width: 820px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.tindex .lead { color: var(--steel); max-width: 62ch; margin: 0.6rem 0 2rem; }
.tgroup { font-family: "Yu Mincho","Hiragino Mincho ProN",serif; font-size: 1.25rem; color: var(--ink);
  margin: 2.2rem 0 0.8rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--line); }
.tcard { display: block; text-decoration: none; padding: 0.9rem 1.1rem; border: 1px solid var(--line);
  border-left: 3px solid var(--seal); border-radius: 6px; background: var(--paper-raised); margin-bottom: 0.7rem; }
.tcard:hover { border-left-color: var(--indigo); }
.tcard .t { color: var(--ink); font-weight: 600; font-size: 1.02rem; }
.tcard .b { color: var(--steel); font-size: 0.88rem; margin-top: 0.2rem; }
.hero-lite { max-width: 820px; margin: 0 auto; padding: 2.5rem 1.5rem 0.5rem; }
.hero-lite .kanji { font-family: "Yu Mincho",serif; font-size: clamp(2.4rem,7vw,3.6rem); color: var(--seal);
  letter-spacing: 0.08em; margin: 0; }
.hero-lite h1 { font-family: "Yu Mincho",serif; font-size: clamp(1.4rem,4vw,1.9rem); margin: 0.3rem 0 0; }

/* keep the register's sticky sidebar-TOC and all anchor jumps clear of the top nav */
.toc { top: 54px !important; max-height: calc(100vh - 54px) !important; }
section[id], h2[id], h3[id], .prose h1[id], .prose h2[id], .prose h3[id] { scroll-margin-top: 64px; }
