:root {
  --ink: #17212b;
  --muted: #536273;
  --paper: #ffffff;
  --surface: #f3f7f8;
  --line: #cbd6dc;
  --primary: #075985;
  --accent: #087f72;
  --warning: #9a6700;
  --danger: #b42318;
  --eog: #7357b4;
  --eeg: #2563a6;
  --ecg: #c24152;
  --fnirs: #a15416;
  --resp: #087f72;
  --eda: #647018;
  --font-body: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --font-data: "Roboto Mono", "BIZ UDGothic", Consolas, monospace;
  --font-math: "STIX Two Math", "Cambria Math", serif;
  --measure: 76ch;
  --toc-width: 15rem;
  --content-max: 78rem;
  --page-max: 96.25rem;
  --radius: 0.4rem;
  --figure-single: 88.9mm;
  --figure-double: 182mm;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  font-kerning: normal;
  line-break: strict;
  word-break: normal;
  overflow-wrap: normal;
}
.skip-link {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 10;
  transform: translateY(-120%);
  padding: 0.6rem 1rem;
  color: #fff;
  background: var(--primary);
}
.skip-link:focus { transform: translateY(0); }
.site-header {
  padding: 2.8rem max(1rem, calc((100vw - 78rem) / 2));
  color: #fff;
  background: linear-gradient(125deg, #0b2545, #075985 62%, #087f72);
}
.site-header .kicker {
  margin: 0 0 0.35rem;
  font: 700 0.82rem/1.4 var(--font-data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e5f4f6;
}
.site-header h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.25; }
.site-header .subtitle { margin: 0.6rem 0 0; color: #f2fbfc; font-size: 1.15rem; }
.site-header .meta { margin: 0.8rem 0 0; color: #dcecf1; font-size: 0.88rem; }
.page {
  display: grid;
  grid-template-columns: var(--toc-width) minmax(0, 1fr);
  gap: 1.25rem;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: 0 auto;
  padding: 1.5rem 1rem;
}
#TOC {
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 0.9rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.88rem;
  line-height: 1.5;
}
.toc-disclosure > summary {
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
}
#TOC ul { margin: 0; padding-inline-start: 0.9rem; }
#TOC ul ul { padding-inline-start: 0.7rem; }
#TOC ul ul ul { padding-inline-start: 0.6rem; font-size: 0.94em; }
#TOC li { margin: 0.25rem 0; }
#TOC a { color: var(--ink); text-decoration: none; }
#TOC a:hover { color: var(--primary); text-decoration: underline; }
main { width: 100%; max-width: var(--content-max); min-width: 0; }
main > p:first-child {
  margin-top: 0;
  padding: 1rem 1.1rem;
  border-inline-start: 4px solid var(--primary);
  background: var(--surface);
}
h1, h2, h3, h4 { line-height: 1.35; letter-spacing: 0.01em; scroll-margin-top: 1rem; }
main h1 {
  margin: 3.2rem 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--primary);
  color: #0b3b56;
  font-size: 1.65rem;
}
main h1:first-child { margin-top: 0; }
h2 { margin: 2.2rem 0 0.7rem; color: var(--primary); font-size: 1.3rem; }
h3 { margin: 1.7rem 0 0.5rem; font-size: 1.08rem; }
h4 { margin: 1.35rem 0 0.45rem; color: #29495a; font-size: 1rem; }
p, li { max-width: var(--measure); }
aside.note {
  margin: 1.25rem 0;
  padding: 0.8rem 1rem;
  border-inline-start: 4px solid var(--warning);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #fff8df;
  overflow-wrap: break-word;
}
aside.note p { margin: 0.3rem 0; }
a { color: #075985; text-decoration-thickness: 0.1em; text-underline-offset: 0.16em; }
a:hover { color: #064364; }
.term-link {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--primary);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.2em;
}
.term-link:hover,
.term-link:focus-visible {
  color: var(--primary);
  background: #eaf4f7;
  text-decoration-style: solid;
}
:target { scroll-margin-top: 1rem; }
:is(th, td):has(> .term-definition:target) {
  background: #fff3bf;
  box-shadow: inset 4px 0 0 var(--warning);
}
.term-definition-anchor {
  display: block;
  position: relative;
  top: -0.4rem;
  scroll-margin-top: 1rem;
}
:focus-visible {
  outline: 3px solid #0b2545;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #fff;
}
main:focus-visible {
  outline-color: var(--primary);
  outline-offset: 0.45rem;
}
code, kbd, samp { font-family: var(--font-data); }
code { padding: 0.08em 0.3em; border-radius: 0.2rem; background: #edf1f3; overflow-wrap: normal; }
pre {
  max-width: 100%;
  margin: 1.1rem 0;
  padding: 0.95rem 1rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--eeg);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #f6f9fb;
  font: 0.84rem/1.55 var(--font-data);
  tab-size: 4;
}
pre code { padding: 0; border-radius: 0; background: transparent; }
.math.display {
  display: block;
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border-inline-start: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  font-family: var(--font-math);
}
.table-wrap {
  width: 100%;
  max-width: 54rem;
  margin: 1.25rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.table-wrap:has(th:nth-child(3)) { max-width: 62rem; }
.table-wrap:has(th:nth-child(4)) { max-width: 68rem; }
.table-wrap:has(th:nth-child(5)) { max-width: var(--content-max); }
.table-disclosure {
  width: 100%;
  max-width: 54rem;
  margin: 1.25rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}
.table-disclosure:has(th:nth-child(3)) { max-width: 62rem; }
.table-disclosure:has(th:nth-child(4)) { max-width: 68rem; }
.table-disclosure:has(th:nth-child(5)) { max-width: var(--content-max); }
.table-disclosure > summary {
  display: list-item;
  padding: 0.72rem 0.9rem;
  color: var(--primary);
  background: var(--surface);
  cursor: pointer;
  font-weight: 750;
  line-height: 1.5;
}
.table-disclosure > summary::marker { color: var(--primary); }
.table-disclosure > summary:hover { background: #e8f1f4; }
.table-disclosure > summary:focus-visible { outline-offset: -3px; }
.table-disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.table-disclosure > .table-wrap { max-width: none; margin: 0; }
table {
  display: table;
  width: 100%;
  min-width: 0;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.91rem;
  line-height: 1.58;
}
table.table-cols-4 { min-width: 48rem; }
table.table-cols-5-plus { min-width: 62rem; }
caption {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-bottom: 0;
  color: #29495a;
  background: #f6f9fb;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: break-word;
}
th, td { padding: 0.65rem 0.75rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { color: #102f3d; background: #e8f1f4; }
tbody th[scope="row"] {
  color: #163f50;
  background: #f1f6f8;
  font-weight: 650;
}
caption, th, td { word-break: normal; overflow-wrap: break-word; }
tbody tr:nth-child(even) { background: #f8fafb; }
figure { max-width: 100%; margin: 1.5rem auto; }
figure img, figure svg, figure canvas { display: block; max-width: 100%; height: auto; }
figcaption { margin-top: 0.45rem; color: var(--muted); font-size: 0.84rem; line-height: 1.55; }
.figure-single { width: min(100%, var(--figure-single)); }
.figure-double { width: min(100%, var(--figure-double)); }
.plot-panel {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}
hr { margin: 3rem 0 1rem; border: 0; border-top: 1px solid var(--line); }
.signal-eog { border-color: var(--eog); }
.signal-eeg { border-color: var(--eeg); }
.signal-ecg { border-color: var(--ecg); }
.signal-fnirs { border-color: var(--fnirs); }
.signal-resp { border-color: var(--resp); }
.signal-eda { border-color: var(--eda); }
.site-footer { padding: 1.2rem; color: var(--muted); background: var(--surface); text-align: center; font-size: 0.85rem; }

@media (max-width: 900px) {
  .page { grid-template-columns: minmax(0, 1fr); padding: 1rem; }
  #TOC { position: static; max-height: none; }
  .toc-disclosure[open] > summary { margin-bottom: 0.55rem; }
  table { white-space: normal; }
  pre { font-size: 0.79rem; }
}
@media (min-width: 901px) {
  .toc-disclosure > summary { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  @page { size: A4; margin: 16mm 15mm 18mm; }
  body { color: #000; font-size: 9.5pt; line-height: 1.62; }
  .skip-link, .site-footer { display: none !important; }
  .site-header { padding: 0 0 18mm; color: #000; background: none; }
  .site-header h1 { font-size: 24pt; }
  .page { display: block; padding: 0; }
  #TOC { position: static; max-height: none; break-after: page; border: 0; padding: 0; background: none; }
  .toc-disclosure > summary { display: none; }
  main h1 { break-before: page; color: #000; border-color: #000; }
  h1, h2, h3, h4 { break-after: avoid-page; }
  figure, aside.note, .math.display, pre { break-inside: avoid; }
  .math.display { overflow: visible; font-size: 8pt; }
  .table-wrap { max-width: none; overflow: visible; }
  table, table.table-cols-4, table.table-cols-5-plus { min-width: 0; break-inside: auto; }
  pre { font-size: 7.5pt; white-space: pre-wrap; overflow-wrap: anywhere; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  a { color: #000; }
  .table-disclosure {
    max-width: none;
    overflow: visible;
    border: 0;
    background: none;
  }
  .table-disclosure > summary { display: none !important; }
  .table-disclosure:not([open]) > :not(summary) { display: block !important; }
  .table-disclosure > .table-wrap { max-width: none; overflow: visible; }
  .table-disclosure table { break-inside: auto; }
}
