:root {
  color-scheme: light;
  --bg: #f5f8fc;
  --panel: #ffffff;
  --panel-soft: #eef5fb;
  --line: #d7e1ec;
  --line-strong: #a8b9cb;
  --text: #1f2937;
  --muted: #5f6f82;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --accent: #9b5f16;
  --danger: #a53f3f;
  --warning: #80610b;
  --shadow: 0 10px 30px rgba(31, 41, 55, 0.08);
  --radius: 8px;
  --content-max: 1280px;
  --header-height: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  min-width: 0;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
}

a {
  color: var(--primary-dark);
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--primary);
}

a:focus-visible,
button:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.32);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--primary-dark);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(100deg, #ffffff 0%, #f5f9ff 100%);
  box-shadow: 0 2px 12px rgba(31, 41, 55, 0.05);
}

/* ヘッダーは1段（PC・スマホとも）。左にロゴ・サイト名・by 運営者・副題、右に一覧へのリンクと「目次」ボタン */
.site-header__inner {
  display: flex;
  min-height: var(--header-height);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 8px 24px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand__logo {
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.brand__text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.3;
}

.brand__line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.brand__name {
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.brand__operator {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.brand__tagline {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header__tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

/* 「目次」ボタン（幅920px以下・JavaScript 有効時だけ表示）。右に今いる章を小さく出す */
.toc-toggle {
  display: none;
  min-width: 0;
  max-width: 52vw;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #9db8df;
  border-radius: 8px;
  align-items: center;
  gap: 7px;
  color: var(--primary-dark);
  background: var(--panel);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.toc-toggle:hover,
.toc-toggle[aria-expanded="true"] {
  background: var(--primary-soft);
}

.toc-toggle__label {
  flex: 0 0 auto;
}

.toc-toggle__label::before {
  content: "☰ ";
  font-weight: 700;
}

.toc-toggle__current {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-toggle__current:empty {
  display: none;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-nav > a {
  display: inline-flex;
  min-height: 42px;
  padding: 8px 13px;
  border-radius: 8px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.primary-nav > a:hover {
  color: var(--primary-dark);
  background: var(--panel-soft);
}

.primary-nav > a[aria-current="page"] {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.nav-status,
.status-pill,
.count-pill {
  display: inline-flex;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.nav-status {
  min-height: 20px;
  padding: 1px 7px;
  border-color: #ddc68a;
  color: var(--warning);
  background: #fff9e8;
  font-size: 11px;
}

.status-pill--warning {
  border-color: #ddc68a;
  color: var(--warning);
  background: #fff9e8;
}

.count-pill {
  border-color: #b9d1f4;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-variant-numeric: tabular-nums;
}

.page-shell {
  width: min(100% - 40px, var(--content-max));
  min-width: 0;
  margin: 0 auto;
  padding: 28px 0 48px;
}

.page-shell--narrow {
  max-width: 960px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 4px 18px rgba(31, 41, 55, 0.055);
}

.panel--primary {
  border-top: 3px solid var(--primary);
  box-shadow: var(--shadow);
}

.page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.7fr);
  padding: 28px 30px;
  align-items: start;
  gap: 36px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
}

.page-intro__description {
  max-width: 48rem;
  margin: 12px 0 0;
  color: var(--muted);
}

.page-intro__tagline {
  margin: 10px 0 0;
  color: #344154;
  font-size: 16px;
  font-weight: 700;
}

.page-intro__operator {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* トップの「項目を探す」: 名前の絞り込み欄と分類のボタン（JavaScript 有効時だけ） */
.finder__controls {
  display: grid;
  margin: 0 0 18px;
  gap: 8px;
}

.finder__label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.finder__input {
  width: 100%;
  max-width: 560px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--panel);
  font: inherit;
  font-size: 16px;
}

.finder__input:focus-visible {
  border-color: var(--primary);
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 0;
}

.finder__filters {
  display: flex;
  margin-top: 2px;
  flex-wrap: wrap;
  gap: 6px;
}

.finder__filter {
  min-height: 36px;
  padding: 4px 13px;
  border: 1px solid #9db8df;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--panel);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.finder__filter:hover {
  background: var(--panel-soft);
}

.finder__filter[aria-pressed="true"] {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.finder__empty {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

.finder__empty[hidden],
.requirements-group[hidden],
.requirements-list__item[hidden] {
  display: none;
}

.requirements-group + .requirements-group {
  margin-top: 20px;
}

.requirements-group__title {
  display: flex;
  margin: 0 0 10px;
  align-items: baseline;
  gap: 8px;
  color: #2e3a4b;
  font-size: 15px;
}

.requirements-group__count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.requirements-list__points {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.requirements-list__points-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

/* 点数のチップ: 区分（第1章の表の1列目の原文）を小さく、点数を太く。区分が長いときは区分の中で折り返す */
.point-chip {
  display: inline-flex;
  min-height: 22px;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 999px;
  align-items: baseline;
  gap: 5px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.point-chip__label {
  min-width: 0;
  color: #3b5687;
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.point-chip__value {
  white-space: nowrap;
}

.revision-summary {
  display: grid;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.revision-summary > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  padding: 10px 13px;
  gap: 12px;
}

.revision-summary > div + div {
  border-top: 1px solid var(--line);
}

.revision-summary dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.revision-summary dd {
  margin: 0;
  font-weight: 700;
}

.list-panel {
  margin-top: 22px;
  padding: 24px 26px 8px;
}

.section-heading {
  display: flex;
  margin-bottom: 14px;
  padding-left: 13px;
  border-left: 4px solid var(--primary);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2,
.notice-panel h2,
.exercise-panel h2 {
  margin: 0;
  font-size: 20px;
}

.requirements-list,
.exercise-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.requirements-list__item {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  border-top: 1px solid var(--line);
  align-items: stretch;
}

.requirements-list__number {
  display: grid;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  place-items: center;
}

.requirements-list__link {
  display: flex;
  min-width: 0;
  min-height: 58px;
  padding: 13px 8px 13px 4px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.requirements-list__item:hover {
  background: #f5f9ff;
}

.requirements-list__link:hover {
  color: var(--primary-dark);
}

.requirements-list__action {
  color: var(--primary-dark);
  font-size: 13px;
  white-space: nowrap;
}

.notice-panel {
  display: flex;
  margin-top: 22px;
  padding: 20px 24px;
  border: 1px solid #e2d29f;
  border-radius: var(--radius);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #fffdf5;
}

.notice-panel h2 {
  margin-top: 8px;
}

.notice-panel p {
  margin: 5px 0 0;
  color: var(--muted);
}

.secondary-link {
  display: inline-flex;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #9db8df;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  background: var(--panel);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.secondary-link:hover {
  background: var(--panel-soft);
  transform: translateY(-1px);
}

.breadcrumb {
  display: flex;
  margin: 0 0 18px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a {
  color: var(--muted);
}

.document-heading {
  margin-bottom: 22px;
}

.document-heading__revision {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.requirement-layout {
  display: grid;
  grid-template-columns: minmax(220px, 264px) minmax(0, 1fr);
  min-width: 0;
  align-items: start;
  gap: 22px;
}

.toc-panel {
  position: sticky;
  top: calc(var(--header-height) + 18px);
  max-height: calc(100vh - var(--header-height) - 36px);
  padding: 17px;
  overflow: auto;
  background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 3px 14px rgba(31, 41, 55, 0.045);
}

.toc-panel__heading {
  display: flex;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.toc-panel__heading h2 {
  margin: 0;
  font-size: 16px;
}

.toc-panel__heading span {
  color: var(--muted);
  font-size: 11px;
}

.toc-list,
.toc-list ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-list {
  padding-top: 8px;
}

.toc-list > li + li {
  border-top: 1px solid #e7edf4;
}

.toc-list a {
  display: block;
  padding: 8px 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.toc-list a:hover {
  color: var(--primary-dark);
  background: var(--panel-soft);
}

.toc-list ol {
  padding: 0 0 7px 14px;
}

.toc-list ol a {
  padding: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* 今いる章・軸（site.js がスクロールに合わせて付ける） */
.toc-list a.is-current-section {
  color: var(--primary-dark);
}

.toc-list a[aria-current="location"] {
  border-radius: 6px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.toc-panel__close {
  display: none;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  place-items: center;
  color: var(--muted);
  background: var(--panel);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.toc-backdrop {
  position: fixed;
  z-index: 56;
  inset: 0;
  background: rgba(31, 41, 55, 0.28);
}

.toc-backdrop[hidden] {
  display: none;
}

.requirement-document {
  min-width: 0;
  padding: 26px clamp(18px, 3vw, 38px) 38px;
  border-top: 3px solid var(--primary);
  box-shadow: var(--shadow);
}

/* 最初は折りたたむ区画（冒頭の「参照情報・公的根拠の確認範囲」・資料一覧）。見出しと1行の説明だけを見せ、押すと開く */
.collapsible {
  margin-bottom: 12px;
  border: 1px solid #c9d9ea;
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.collapsible__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title chevron"
    "hint chevron";
  padding: 12px 14px 12px 16px;
  align-items: center;
  gap: 3px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  list-style: none;
}

.collapsible__summary::-webkit-details-marker {
  display: none;
}

.collapsible__summary:hover {
  background: #e4effa;
}

.collapsible__summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.32);
  outline-offset: -3px;
}

.collapsible__summary > h2,
.collapsible__title {
  grid-area: title;
  min-width: 0;
  margin: 0;
  padding-left: 11px;
  border-left: 3px solid var(--primary);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.4;
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.collapsible__hint {
  grid-area: hint;
  min-width: 0;
  padding-left: 14px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collapsible__chevron {
  display: grid;
  width: 32px;
  height: 32px;
  grid-area: chevron;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--panel);
  font-size: 0;
  line-height: 1;
  place-items: center;
  transform: rotate(-90deg);
  transition: transform 160ms ease;
}

/* 記号「⌄」は読み上げ対象外の飾りなので、形は線で描いて中央にそろえる（閉じている間は右向き） */
.collapsible__chevron::before {
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.collapsible[open] > .collapsible__summary .collapsible__chevron {
  transform: none;
}

.collapsible__body {
  min-width: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid #c9d9ea;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--panel);
}

.collapsible--lead .collapsible__body > .table-scroll:first-child {
  margin-top: 0;
}

.source-card__body {
  color: #344154;
  font-size: 13px;
}

.source-card__body p {
  margin: 0;
  overflow-wrap: anywhere;
}

.source-card__body p + p {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(168, 185, 203, 0.55);
}

.process-diagram {
  margin: 22px 0 26px;
  padding: 20px;
  border: 1px solid #c9d9ea;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: #fbfdff;
}

.process-diagram__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.process-diagram__heading .eyebrow {
  margin-bottom: 3px;
}

.process-diagram__heading h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.process-diagram__draft {
  flex: 0 0 auto;
}

.process-diagram__scroll {
  margin: 16px 0 14px;
  border-color: var(--line);
  background: #f8fafc;
}

.process-diagram__svg {
  display: block;
  max-width: none;
  font-family: inherit;
}

.process-lane__band {
  fill: #ffffff;
  stroke: var(--line);
  stroke-width: 1;
}

.process-lane--alternate .process-lane__band {
  fill: #f8fafc;
}

.process-lane__label-area {
  fill: var(--panel-soft);
  stroke: var(--line);
  stroke-width: 1;
}

.process-lane__label {
  fill: #344154;
  font-size: 14px;
  font-weight: 750;
}

.process-edge {
  fill: none;
  stroke: #718096;
  stroke-linecap: round;
  stroke-width: 2;
}

.process-edge--halo {
  stroke: #ffffff;
  stroke-width: 6;
}

.process-edge__arrow {
  fill: #718096;
}

.process-edge-label rect {
  fill: #ffffff;
  stroke: var(--line);
  stroke-width: 1;
}

.process-edge-label text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.process-node__box {
  vector-effect: non-scaling-stroke;
}

.process-node--req .process-node__box {
  fill: #f6f9ff;
  stroke: #7fa5d8;
  stroke-width: 1.5;
}

.process-node--ops .process-node__box {
  fill: #f4f5f7;
  stroke: #93a1b1;
  stroke-dasharray: 6 4;
  stroke-width: 1.5;
}

.process-node__label {
  fill: var(--text);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}

.process-node__ops-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.process-node__req-chip {
  fill: var(--primary-soft);
  stroke: #9dbce7;
  stroke-width: 1;
}

.process-node__req-id {
  fill: var(--primary-dark);
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}

.process-node__req-chip-group {
  pointer-events: none;
}

.process-node-link,
.process-node__req-link {
  cursor: pointer;
  text-decoration: none;
}

.process-node-link:hover .process-node__box,
.process-node-link:focus-visible .process-node__box {
  fill: #edf4ff;
  stroke: var(--primary-dark);
  stroke-width: 2.5;
}

.process-node__req-link:hover .process-node__req-chip,
.process-node__req-link:focus-visible .process-node__req-chip {
  fill: #c9defb;
  stroke: var(--primary-dark);
  stroke-width: 2;
}

.process-node-link:focus-visible,
.process-node__req-link:focus-visible {
  outline: none;
}

.process-diagram__legend {
  display: flex;
  margin: 0;
  padding: 0;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 9px 20px;
  color: #465468;
  font-size: 12px;
  list-style: none;
}

.process-diagram__legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.process-legend-swatch {
  display: inline-block;
  width: 26px;
  height: 15px;
  flex: 0 0 auto;
  border-radius: 4px;
}

.process-legend-swatch--req {
  border: 1.5px solid #7fa5d8;
  background: #f6f9ff;
}

.process-legend-swatch--ops {
  border: 1.5px dashed #93a1b1;
  background: #f4f5f7;
}

.process-legend-link {
  display: inline-grid;
  min-width: 34px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid #9dbce7;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 800;
  place-items: center;
}

.process-diagram__disclaimer {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
  background: #f4f7fa;
  font-size: 12px;
}

.process-diagram__details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.process-diagram__details summary {
  padding: 11px 2px 0;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.process-diagram__notes {
  display: grid;
  margin: 12px 0 0;
  gap: 8px;
}

.process-diagram__notes > div {
  display: grid;
  grid-template-columns: minmax(170px, 0.38fr) minmax(0, 1fr);
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  gap: 12px;
  background: var(--panel);
}

.process-diagram__notes dt,
.process-diagram__notes dd {
  margin: 0;
}

.process-diagram__notes dt {
  font-size: 12px;
  font-weight: 700;
}

.process-diagram__notes dd {
  color: #465468;
  font-size: 12px;
}

.process-note-kind {
  display: inline-block;
  margin-right: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
}

.process-note-kind--req {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.process-note-kind--ops {
  color: #526173;
  background: #e7ebf0;
}

.diagram-requirement-anchor {
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.learning-figure {
  min-width: 0;
  max-width: 100%;
  margin: 22px 0 26px;
  padding: 20px;
  border: 1px solid #c9d9ea;
  border-radius: var(--radius);
  background: #fbfdff;
}

.learning-figure--overview {
  border-left: 4px solid var(--primary);
}

.learning-figure--inline {
  margin: 8px 0 22px;
  padding: 16px;
  border-color: var(--line);
  background: #f9fbfd;
}

.learning-figure__heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.learning-figure__heading > div {
  min-width: 0;
}

.learning-figure__heading .eyebrow {
  margin-bottom: 3px;
}

.learning-figure__heading h2,
.learning-figure__heading h4 {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.learning-figure__heading h2 {
  font-size: 20px;
}

.learning-figure__heading h4 {
  font-size: 17px;
}

.learning-figure__draft,
.learning-figure__inline-draft {
  flex: 0 0 auto;
}

.learning-figure__inline-draft {
  padding: 3px 9px;
  font-size: 10px;
}

.phase-flow {
  display: grid;
  min-width: 0;
  margin: 18px 0 16px;
  padding: 0;
  gap: 18px;
  list-style: none;
}

.phase-flow__item {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.phase-flow__item:not(:last-child)::before {
  position: absolute;
  z-index: 0;
  top: 34px;
  bottom: -19px;
  left: 17px;
  width: 2px;
  background: #9db5cf;
  content: "";
}

.phase-flow__item:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  bottom: -18px;
  left: 13px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #71869d;
  border-bottom: 2px solid #71869d;
  content: "";
  transform: rotate(45deg);
}

.phase-flow--selective .phase-flow__item:not([data-connect-next="true"])::before,
.phase-flow--selective .phase-flow__item:not([data-connect-next="true"])::after {
  content: none;
}

.phase-flow__number {
  position: relative;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  border: 2px solid #8eacd2;
  border-radius: 50%;
  color: var(--primary-dark);
  background: #eef5ff;
  font-size: 13px;
  font-weight: 800;
  place-items: center;
}

.phase-flow__timing-note {
  margin: 14px 0 0 42px;
  padding: 9px 12px;
  border-left: 3px solid #d8b85a;
  color: #5f5132;
  background: #fff9e8;
  font-size: 12px;
}

.figure-node {
  min-width: 0;
  padding: 14px 15px;
  border: 1.5px solid #7fa5d8;
  border-radius: 8px;
  background: #f6f9ff;
  overflow-wrap: anywhere;
}

.figure-node--ops {
  border-color: #93a1b1;
  border-style: dashed;
  background: #f4f5f7;
}

.figure-node h3,
.figure-node h5 {
  margin: 8px 0 5px;
  line-height: 1.45;
}

.figure-node h3 {
  font-size: 16px;
}

.figure-node h5 {
  font-size: 15px;
}

.figure-node p {
  margin: 0;
  color: #3f4d61;
  font-size: 13px;
  line-height: 1.75;
}

.figure-node__meta,
.figure-node__refs {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.figure-node__refs {
  margin-top: 10px;
}

.figure-kind,
.figure-role,
.figure-role-label,
.day-boundary__rule {
  display: inline-flex;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  align-items: center;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
}

.figure-kind--req {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.figure-kind--ops {
  color: #526173;
  background: #e3e7ec;
}

.figure-role-label {
  color: var(--muted);
  background: transparent;
}

.figure-role {
  border: 1px solid #cbd7e4;
  color: #344154;
  background: #ffffff;
}

.figure-ref {
  display: inline-grid;
  min-width: 40px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #9dbce7;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
  place-items: center;
}

.figure-ref--axis {
  border-color: #b7c3d0;
  color: #425064;
  background: #edf1f5;
}

.figure-ref:hover,
.figure-ref:focus-visible {
  border-color: var(--primary-dark);
  color: #123b79;
  background: #d8e8ff;
  outline: 2px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.learning-figure__legend {
  display: flex;
  margin: 0;
  padding: 0;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 9px 20px;
  color: #465468;
  font-size: 12px;
  list-style: none;
}

.learning-figure__legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.figure-legend-swatch {
  display: inline-block;
  width: 26px;
  height: 15px;
  flex: 0 0 auto;
  border-radius: 4px;
}

.figure-legend-swatch--req {
  border: 1.5px solid #7fa5d8;
  background: #f6f9ff;
}

.figure-legend-swatch--ops {
  border: 1.5px dashed #93a1b1;
  background: #f4f5f7;
}

.learning-figure__disclaimer {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
  background: #f4f7fa;
  font-size: 12px;
}

.route-switcher__tabs {
  display: none;
  min-width: 0;
  margin-top: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.route-switcher__tabs--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.route-switcher.is-enhanced .route-switcher__tabs {
  display: grid;
}

.route-switcher__tabs button {
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #b8c7d8;
  border-radius: 7px;
  color: #425064;
  background: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.route-switcher__tabs button[aria-selected="true"] {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.route-switcher__tabs button:hover,
.route-switcher__tabs button:focus-visible {
  border-color: var(--primary);
  outline: 2px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.route-switcher__panels {
  display: grid;
  min-width: 0;
  margin-top: 10px;
  gap: 10px;
}

.route-panel {
  break-inside: avoid;
}

.route-switcher:not(.is-enhanced) .route-panel::before {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  content: "経路";
}

.day-boundary__band {
  display: grid;
  min-width: 0;
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.day-boundary__zone {
  border-radius: 0;
}

.day-boundary__zone:first-child {
  border-radius: 8px 0 0 8px;
}

.day-boundary__zone:last-child {
  border-radius: 0 8px 8px 0;
}

.day-boundary__zone--exception {
  border-color: #d8b85a;
  background: #fff9e8;
}

.day-boundary__zone--principle {
  border-color: #7fa5d8;
  background: #eef5ff;
}

.day-boundary__rule {
  color: #684f08;
  background: rgba(255, 255, 255, 0.72);
}

.day-boundary__quantity {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.day-boundary__caution {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #d8b85a;
  color: #5d4c1b;
  background: #fff9e8;
  font-size: 12px;
  line-height: 1.7;
}

.day-boundary__reference {
  margin: 9px 0 0;
  font-size: 12px;
}

.figure-checklist__list {
  display: grid;
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
}

.figure-checklist__item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  break-inside: avoid;
}

.figure-checklist__mark {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.5px solid #7fa5d8;
  border-radius: 5px;
  background: #ffffff;
}

.figure-checklist__mark::after {
  position: absolute;
  top: 4px;
  left: 7px;
  width: 5px;
  height: 9px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  content: "";
  transform: rotate(45deg);
}

.figure-checklist__content {
  min-width: 0;
}

.figure-requirement-anchor {
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.document-body {
  min-width: 0;
}

.chapter {
  min-width: 0;
  padding-top: 10px;
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.chapter + .chapter {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.chapter-heading {
  display: flex;
  min-width: 0;
  padding: 17px 0 12px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.chapter-heading h2 {
  min-width: 0;
  margin: 0;
  padding-left: 13px;
  border-left: 4px solid var(--primary);
  font-size: 22px;
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.chapter-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--panel);
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  place-items: center;
}

.chapter-toggle:hover {
  background: var(--primary-soft);
  box-shadow: 0 4px 10px rgba(31, 41, 55, 0.08);
  transform: translateY(-1px);
}

.chapter-toggle span {
  display: block;
  font-size: 20px;
  line-height: 1;
  transition: transform 180ms ease;
}

.chapter-toggle[aria-expanded="false"] span {
  transform: rotate(-90deg);
}

.no-js .chapter-toggle {
  display: none;
}

.chapter-content {
  min-width: 0;
  padding: 0 2px 8px;
}

/* 閉じた章は hidden="until-found"（ページ内検索で見つかる）。未対応のブラウザでは普通の hidden として隠れる */
.chapter-content[hidden]:not([hidden="until-found"]) {
  display: none;
}

.chapter-content[hidden="until-found"] {
  padding: 0;
}

.document-body h3 {
  margin: 25px 0 11px;
  padding: 9px 12px;
  border-left: 3px solid var(--primary);
  background: #f5f8fc;
  font-size: 18px;
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.document-body h4 {
  margin: 22px 0 9px;
  color: #2e3a4b;
  font-size: 16px;
}

.document-body p {
  margin: 0.72em 0;
}

.document-body ul,
.document-body ol {
  margin: 0.7em 0;
  padding-left: 1.65rem;
}

.document-body li + li {
  margin-top: 0.34em;
}

.document-body li > ul,
.document-body li > ol {
  margin-top: 0.34em;
  margin-bottom: 0.34em;
}

.document-body strong {
  color: #172033;
  font-weight: 750;
}

.document-body code {
  padding: 0.1em 0.36em;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #26364c;
  background: #f3f6f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.document-body blockquote {
  margin: 16px 0;
  padding: 11px 15px;
  border-left: 4px solid var(--line-strong);
  color: var(--muted);
  background: #f8fafc;
}

.document-body blockquote > :first-child {
  margin-top: 0;
}

.document-body blockquote > :last-child {
  margin-bottom: 0;
}

.table-scroll {
  max-width: 100%;
  margin: 14px 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
}

/* 本サイトでは本文の表を横にスクロールさせない。PC は表を横幅に収めて折り返し、
   幅680px以下（スマホ）は1行ずつの縦積みカードにする（下の @media screen and (max-width: 680px)）。 */
table {
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  font-size: 13px;
  line-height: 1.48;
}

th,
td {
  min-width: 4.5em;
  padding: 9px 11px;
  overflow-wrap: anywhere;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

/* 「NG-10」「A-10a」「注1」のような短い番号だけのセル（build.mjs が cell-code を付ける）は途中で折り返さない */
td.cell-code {
  overflow-wrap: normal;
  white-space: nowrap;
}

th:last-child,
td:last-child {
  border-right: 0;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: #303a49;
  background: #f4f5f7;
  font-weight: 750;
}

tbody tr:nth-child(even) td {
  background: #fafbfd;
}

tbody tr:hover td {
  background: #edf5ff;
}

td > :first-child,
th > :first-child {
  margin-top: 0;
}

td > :last-child,
th > :last-child {
  margin-bottom: 0;
}

/* 横にはみ出す表の手がかり: 表示文は site.js がはみ出す表にだけ付ける */
.table-scroll-hint {
  margin: 14px 0 -8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.table-scroll-hint::before {
  content: "↔ ";
}

/* 普通の表（カード・Q&A 以外）の 1 列目を左に固定する */
.table-scroll--plain th:first-child,
.table-scroll--plain td:first-child {
  position: sticky;
  z-index: 2;
  left: 0;
  background: var(--panel);
}

/* 区切り線は横にはみ出す表（site.js が is-scrollable を付ける）だけに引き、収まる表の見た目は変えない */
.table-scroll--plain.is-scrollable th:first-child,
.table-scroll--plain.is-scrollable td:first-child {
  box-shadow: 2px 0 0 var(--line);
}

.table-scroll--plain th:first-child {
  z-index: 3;
  background: #f4f5f7;
}

.table-scroll--plain tbody tr:nth-child(even) td:first-child {
  background: #fafbfd;
}

.table-scroll--plain tbody tr:hover td:first-child {
  background: #edf5ff;
}

.exercise-panel {
  padding: clamp(22px, 4vw, 38px);
  border-top: 3px solid var(--primary);
  box-shadow: var(--shadow);
}

.exercise-panel__heading {
  max-width: 760px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.exercise-panel__heading .eyebrow {
  margin-top: 14px;
}

.exercise-panel__heading p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

.exercise-panel > h2 {
  margin: 26px 0 10px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}

.exercise-list__item {
  display: flex;
  min-height: 54px;
  padding: 11px 4px;
  border-top: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-weight: 700;
}

/* プライバシーポリシー（privacy.html）。本文は算定要件ページと同じ document-body の書式（表はスマホで縦積みカード）を使い、見出しだけ足す */
.policy-document {
  min-width: 0;
  padding: 26px clamp(18px, 3vw, 38px) 38px;
  border-top: 3px solid var(--primary);
  box-shadow: var(--shadow);
}

.policy-document__body h1 {
  margin: 0 0 14px;
}

.policy-document__body h2 {
  margin: 30px 0 10px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  font-size: 19px;
}

.policy-document__body a {
  overflow-wrap: anywhere;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #edf3f9;
}

.site-footer__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 22px 24px 26px;
  font-size: 12px;
}

.site-footer__inner p {
  max-width: 72rem;
  margin: 0;
}

.site-footer__operator {
  margin-top: 6px !important;
}

.site-footer__operator a {
  color: inherit;
  text-decoration: underline;
}

.site-footer__revision {
  margin-top: 6px !important;
  font-weight: 700;
}

/* JavaScript が要るもの（目次ボタン・絞り込み欄等）は js-only、ブラウザの保存領域も要るもの（読了まわり）は storage-only。
   保存領域が使えない端末で隠すのは読了まわりだけにする（目次ボタンや絞り込み欄は保存領域に依存しない） */
.no-js .js-only,
.storage-unavailable .storage-only {
  display: none !important;
}

.reading-progress {
  margin-top: 22px;
  padding: 20px 24px;
  border-left: 4px solid var(--primary);
  box-shadow: 0 3px 14px rgba(31, 41, 55, 0.045);
}

.reading-progress__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.reading-progress__heading h2 {
  margin: 0;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.reading-progress__percent {
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.reading-progress__track {
  height: 9px;
  margin-top: 13px;
  border-radius: 999px;
  overflow: hidden;
  background: #dce6f1;
}

.reading-progress__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 220ms ease;
}

.reading-storage-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.list-panel {
  padding-bottom: 24px;
}

.requirements-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.requirements-list__item {
  display: block;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.requirements-list__item:hover {
  border-color: #a9c3e6;
  background: var(--panel);
  box-shadow: 0 7px 18px rgba(31, 41, 55, 0.08);
  transform: translateY(-1px);
}

.requirements-list__item.is-complete {
  border-color: #8fb3e6;
  background: #f8fbff;
}

.requirements-list__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 92px;
  padding: 14px 16px;
  align-content: space-between;
  align-items: center;
  gap: 10px 16px;
}

.requirements-list__link .completion-badge {
  align-self: start;
}

.requirements-list__link .requirements-list__points {
  grid-column: 1;
}

.requirements-list__link .requirements-list__action {
  grid-column: 2;
  justify-self: end;
}

.requirements-list__meta {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.requirements-list__number {
  display: inline-flex;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.requirements-list__name {
  min-width: 0;
  align-self: center;
  font-size: 16px;
  line-height: 1.45;
}

.completion-badge {
  display: inline-flex;
  min-height: 23px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  align-items: center;
  color: var(--muted);
  background: #f7f9fb;
  font-size: 11px;
  font-weight: 800;
}

.completion-badge.is-complete {
  border-color: #9dbbe5;
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.document-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.document-heading__text {
  min-width: 0;
}

.document-heading__tools {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  flex-direction: column;
}

.reading-toggle {
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  color: var(--primary-dark);
  background: var(--panel);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.reading-toggle:hover {
  background: var(--primary-soft);
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.reading-toggle.is-complete {
  color: #fff;
  background: var(--primary);
}

.axis-heading {
  --axis-color: var(--primary);
  --axis-soft: var(--primary-soft);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 58px;
  padding: 8px 14px 8px 8px !important;
  border: 1px solid color-mix(in srgb, var(--axis-color) 28%, var(--line)) !important;
  border-left: 4px solid var(--axis-color) !important;
  border-radius: var(--radius);
  align-items: center;
  gap: 12px;
  color: var(--text);
  background: var(--axis-soft) !important;
}

.axis-heading__badge {
  display: grid;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--axis-color);
  place-items: center;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}

.axis-heading--a { --axis-color: #2563eb; --axis-soft: #eaf2ff; }
.axis-heading--b { --axis-color: #317a78; --axis-soft: #eaf6f5; }
.axis-heading--c { --axis-color: #6b65a4; --axis-soft: #f0eff9; }
.axis-heading--d { --axis-color: #9b6a24; --axis-soft: #fbf4e8; }
.axis-heading--e { --axis-color: #9b566b; --axis-soft: #faeef2; }

.requirement-id-chip {
  display: inline-flex;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #a8c3e8;
  border-radius: 999px;
  align-items: center;
  color: var(--primary-dark);
  background: #eef5ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.requirement-reference {
  display: inline-block;
  padding: 0 0.2em;
  border-radius: 4px;
  color: var(--primary-dark);
  background: #eef5ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  font-weight: 750;
  text-decoration-thickness: 1px;
  white-space: nowrap;
}

.requirement-reference--range {
  white-space: nowrap;
}

/* 第1章で定義される語（注1・注2）。本文の中で目立ちすぎないよう、点線の下線だけにする */
.term-reference {
  color: inherit;
  text-decoration: underline dotted var(--primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.term-reference:hover,
.term-reference:focus-visible {
  color: var(--primary-dark);
  background: #eef5ff;
}

/* 「第3部」「D(例外要件)」のような章・軸への言及 */
.section-reference {
  color: var(--primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.requirement-reference[aria-expanded="true"],
.term-reference[aria-expanded="true"],
.figure-ref[aria-expanded="true"] {
  outline: 2px solid rgba(37, 99, 235, 0.4);
  outline-offset: 1px;
}

/* 参照の小窓（PC）。中身は本文の該当行の写し */
.ref-popover {
  position: absolute;
  z-index: 60;
  top: 0;
  left: 0;
  display: flex;
  width: min(440px, calc(100vw - 24px));
  max-height: min(60vh, 460px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  flex-direction: column;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 14px 40px rgba(31, 41, 55, 0.2);
  font-size: 14px;
  line-height: 1.55;
}

.ref-popover[hidden],
.ref-popover-backdrop[hidden],
.ref-back[hidden] {
  display: none;
}

.ref-popover:focus {
  outline: none;
}

.ref-popover:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.32);
  outline-offset: 2px;
}

.ref-popover__header {
  display: flex;
  padding: 8px 8px 8px 14px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel-soft);
  border-radius: var(--radius) var(--radius) 0 0;
}

.ref-popover__title {
  margin: 0;
  color: var(--primary-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
}

.ref-popover__close {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  place-items: center;
  color: var(--muted);
  background: var(--panel);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ref-popover__close:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.ref-popover__body {
  overflow: auto;
  padding: 4px 14px 12px;
  overscroll-behavior: contain;
}

.ref-popover__item + .ref-popover__item {
  border-top: 1px solid var(--line);
}

.ref-popover__item {
  padding: 8px 0 4px;
}

.ref-popover__item-title {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
}

.ref-field + .ref-field {
  margin-top: 8px;
}

.ref-field__label {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ref-field__value,
.ref-block {
  overflow-wrap: anywhere;
}

.ref-block p,
.ref-block ul,
.ref-block ol {
  margin: 0 0 6px;
}

.ref-block ul,
.ref-block ol {
  padding-left: 1.3em;
}

.ref-block__heading {
  font-weight: 800;
}

.ref-block .table-scroll {
  overflow-x: auto;
}

.ref-popover__jump {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
}

.ref-popover__jump::after {
  content: " ↓";
}

/* スマホ・タッチ端末では画面下からせり上がる窓にする */
.ref-popover-backdrop {
  position: fixed;
  z-index: 59;
  inset: 0;
  background: rgba(31, 41, 55, 0.28);
}

.ref-popover--sheet {
  position: fixed;
  top: auto !important;
  right: 0;
  bottom: 0;
  left: 0 !important;
  width: 100%;
  max-height: 72vh;
  border-width: 1px 0 0;
  border-radius: 14px 14px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  animation: ref-sheet-in 0.18s ease-out;
}

.ref-popover--sheet .ref-popover__header {
  border-radius: 14px 14px 0 0;
}

.ref-popover--sheet .ref-popover__close {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}

.ref-popover--sheet .ref-popover__body {
  padding-bottom: 18px;
}

@keyframes ref-sheet-in {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

/* ページ内リンクで飛んだ直後に出す「元の場所へ戻る」 */
.ref-back {
  position: fixed;
  z-index: 50;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  border: 1px solid var(--primary-dark);
  border-radius: 999px;
  overflow: hidden;
  background: var(--primary-dark);
  box-shadow: 0 10px 28px rgba(31, 41, 55, 0.25);
  transform: translateX(-50%);
}

.ref-back__button,
.ref-back__dismiss {
  min-height: 44px;
  border: 0;
  color: #fff;
  background: transparent;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.ref-back__button {
  padding: 0 14px 0 18px;
  white-space: nowrap;
}

.ref-back__dismiss {
  width: 44px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 18px;
}

.ref-back__button:hover,
.ref-back__dismiss:hover {
  background: rgba(255, 255, 255, 0.14);
}

.ref-back__button:focus-visible,
.ref-back__dismiss:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -5px;
}

/* 着いた行・見出しの色付け（数秒で消える） */
.ref-arrived {
  animation: ref-arrived 3s ease-out;
}

tr.ref-arrived {
  animation: none;
}

tr.ref-arrived > td,
tr.ref-arrived > th {
  animation: ref-arrived-cell 3s ease-out;
}

@keyframes ref-arrived {
  0%,
  45% {
    background-color: #fff1b8;
    box-shadow: 0 0 0 3px #f2cf5b;
  }

  100% {
    background-color: transparent;
    box-shadow: 0 0 0 3px transparent;
  }
}

@keyframes ref-arrived-cell {
  0%,
  45% {
    background-color: #fff1b8;
  }

  100% {
    background-color: transparent;
  }
}

.number-highlight {
  padding: 0.04em 0.28em;
  border-radius: 4px;
  color: #67460f;
  background: #fff3cf;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  font-weight: 750;
  white-space: nowrap;
}

.table-scroll--point-cards,
.table-scroll--ng-cards {
  border: 0;
  overflow: visible;
  background: transparent;
}

.point-card-table,
.ng-card-table,
.point-card-table tbody,
.ng-card-table tbody {
  display: block;
  width: 100%;
  min-width: 0;
}

.point-card-table thead,
.ng-card-table thead {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.point-card-table tbody,
.ng-card-table tbody {
  display: grid;
  gap: 12px;
}

.point-card-table tr.point-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 4px 14px rgba(31, 41, 55, 0.055);
  gap: 13px 18px;
}

.point-card-table tr.point-card:hover {
  border-color: #abc3e3;
  background: #fbfdff;
}

.point-card-table td,
.ng-card-table td {
  display: block;
  min-width: 0;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent !important;
}

.point-card-table td::before,
.ng-card-table td::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.point-card-table .point-card__content {
  grid-column: span 2;
}

.point-card-table .point-card__score {
  padding: 9px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  color: var(--primary-dark);
  background: var(--primary-soft) !important;
  font-size: 23px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.point-card-table .point-card__score::before {
  color: var(--primary-dark);
}

.point-card-table .point-card__score .number-highlight {
  padding: 0;
  color: inherit;
  background: transparent;
}

.ng-card-table tr.ng-card {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(180px, 1fr);
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #e5c4c4;
  border-left: 5px solid var(--danger);
  border-radius: var(--radius);
  background: #fff8f8;
  gap: 16px;
}

.ng-card-table tr.ng-card:hover {
  background: #fff3f3;
}

.decision-cell {
  border-left-width: 4px;
  border-left-style: solid;
  font-weight: 750;
}

.document-body td.decision-cell--allowed {
  border-left-color: var(--primary);
  color: var(--primary-dark);
  background: #eef5ff;
}

.document-body td.decision-cell--denied {
  border-left-color: var(--danger);
  color: #7f2f2f;
  background: #fff1f1;
}

.document-body td.decision-cell--caution {
  border-left-color: var(--warning);
  color: #674d08;
  background: #fff9e8;
}

.qa-accordion {
  display: grid;
  margin: 14px 0 20px;
  gap: 10px;
}

.qa-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: clip;
  background: var(--panel);
  box-shadow: 0 3px 12px rgba(31, 41, 55, 0.045);
}

.qa-item[open] {
  border-color: #a9c3e6;
}

.qa-item__summary {
  display: flex;
  min-height: 52px;
  padding: 13px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: #f7faff;
  cursor: pointer;
  list-style: none;
}

.qa-item__summary::-webkit-details-marker {
  display: none;
}

.qa-item__summary:hover {
  background: #eef5ff;
}

.qa-item__summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.32);
  outline-offset: -3px;
}

.qa-item__prompt {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.qa-field {
  min-width: 0;
}

.qa-field__label {
  display: inline-flex;
  margin-right: 8px;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
}

.qa-field__value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.qa-item__chevron {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--primary-dark);
  background: var(--panel);
  place-items: center;
  transition: transform 160ms ease;
}

.qa-item[open] .qa-item__chevron {
  transform: rotate(180deg);
}

.qa-item__answer {
  display: grid;
  padding: 16px;
  border-top: 1px solid var(--line);
  gap: 8px;
  background: var(--panel);
}

.qa-item__answer .qa-field__label {
  display: block;
  margin: 0 0 5px;
  color: var(--muted);
}

/* ---- キャラクター（飾り。aria-hidden。意味は必ず文字でも出す。置き場所の規則は README「キャラクター」） ---- */
/* ページ内に1回だけ置く <symbol> の入れ物。display: none にせず、大きさ0で見えなくする */
.chara-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.chara {
  display: inline-block;
  flex: 0 0 auto;
  overflow: visible;
  vertical-align: middle;
}

.chara--sm {
  width: 22px;
  height: 22px;
}

.chara--md {
  width: 26px;
  height: 26px;
}

.chara--lg {
  width: 48px;
  height: 48px;
}

/* 図の見出しの横（全体図=カプセル、経路の切替=ジョウ、D軸の図=シロ） */
.learning-figure__title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.learning-figure__title > div {
  min-width: 0;
}

.learning-figure--inline .learning-figure__chara {
  width: 44px;
  height: 44px;
}

/* 運用ノードの「運用例」の横のホウ */
.figure-kind__chara {
  width: 22px;
  height: 22px;
  margin-left: -2px;
}

/* 図の冒頭の、キャラクターの見方（凡例・免責の所に1回だけ） */
.chara-legend {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.chara-legend__title {
  margin: 0 0 6px;
  color: #465468;
  font-size: 12px;
  font-weight: 800;
}

.chara-legend__title span {
  color: var(--muted);
  font-weight: 600;
}

.chara-legend__list {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 6px 16px;
  color: #465468;
  font-size: 12px;
  line-height: 1.5;
  list-style: none;
}

.chara-legend__list li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.chara-legend__note {
  margin: 8px 0 0;
  color: #465468;
  font-size: 12px;
  line-height: 1.6;
}

/* 第3章の判断セル（可=オーディー、不可=チューブン、明文なし・要確認=ホウ） */
.decision-cell__chara {
  margin: -3px 4px -1px 0;
}

/* 第4章の NG カードの見出し（「NGケース」「NG例」の列見出し）の左にチューブン */
.ng-card-table td.ng-card__case {
  position: relative;
}

.ng-card-table td.ng-card__case::before {
  min-height: 22px;
  padding-left: 27px;
  line-height: 22px;
}

.ng-card-table td.ng-card__case > .ng-card__chara {
  position: absolute;
  top: 0;
  left: 0;
}

/* トップ: 冒頭のカプセルと仲間たち、点数の欄のシロ、該当なしのホウ */
.home-cast {
  display: grid;
  max-width: 42rem;
  margin: 18px 0 0;
  padding: 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
}

.home-cast li {
  display: grid;
  min-width: 0;
  align-content: start;
  justify-items: center;
  text-align: center;
  gap: 1px;
}

.home-cast .chara {
  width: 52px;
  height: 52px;
  margin-bottom: 2px;
}

.home-cast__name {
  color: #2e3a4b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.home-cast__role {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.requirements-list__points-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.requirements-list__chara {
  margin: -3px 0;
}

.finder__empty:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 920px) {
  :root {
    --header-height: 68px;
  }

  .page-intro,
  .requirement-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-intro {
    gap: 22px;
  }

  .toc-panel {
    position: static;
    max-height: none;
  }

  .toc-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }

  .js .toc-toggle {
    display: inline-flex;
  }

  /* JavaScript 有効時は、目次をページ上部に置かず、「目次」ボタンで画面下から開く */
  .js .toc-panel {
    position: fixed;
    z-index: 57;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    max-height: min(78vh, 640px);
    padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 14px 14px 0 0;
    overflow: auto;
    background: var(--panel);
    box-shadow: 0 -12px 36px rgba(31, 41, 55, 0.2);
    overscroll-behavior: contain;
  }

  .js .toc-panel.is-open {
    display: block;
    animation: ref-sheet-in 0.18s ease-out;
  }

  .js .toc-panel__heading {
    align-items: center;
  }

  .js .toc-panel__close {
    display: inline-grid;
  }

  .js .toc-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .js .toc-list a {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 28px, var(--content-max));
    padding-top: 20px;
  }

  .page-intro,
  .list-panel,
  .requirement-document {
    padding-right: 18px;
    padding-left: 18px;
  }

  .notice-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .requirements-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .requirements-list__link {
    min-height: 102px;
  }

  .reading-progress {
    padding: 18px;
  }

  .document-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
  }

  .document-heading__tools {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .document-heading__tools .reading-storage-note {
    margin: 0;
  }

  .toc-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .chapter-heading h2 {
    font-size: 20px;
  }

  .source-card {
    padding: 15px;
  }

  .process-diagram {
    margin-top: 18px;
    padding: 15px;
  }

  .process-diagram__heading {
    flex-direction: column;
    gap: 8px;
  }

  .process-diagram__legend {
    flex-direction: column;
    gap: 8px;
  }

  .process-diagram__notes > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .learning-figure {
    margin-top: 18px;
    padding: 15px;
  }

  .learning-figure--inline {
    padding: 14px;
  }

  .learning-figure__heading {
    flex-direction: column;
    gap: 8px;
  }

  .learning-figure__legend {
    flex-direction: column;
    gap: 8px;
  }

  .phase-flow__timing-note {
    margin-left: 0;
  }

  .day-boundary__band,
  .figure-checklist__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .day-boundary__band {
    gap: 8px;
  }

  .day-boundary__zone,
  .day-boundary__zone:first-child,
  .day-boundary__zone:last-child {
    border-radius: 8px;
  }

  .axis-heading {
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: 54px;
    gap: 10px;
  }

  .axis-heading__badge {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .point-card-table .point-card__content {
    grid-column: 1 / -1;
  }

  .ng-card-table tr.ng-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
  }

  .document-body ul,
  .document-body ol {
    padding-left: 1.35rem;
  }
}

/* スマホでは本文の表を「1列目（番号・語）→ 各列（列の見出し付き）」の縦積みカードにする。印刷には使わない */
@media screen and (max-width: 680px) {
  .table-scroll--plain {
    margin: 12px 0 18px;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
  }

  .table-scroll--plain > table,
  .table-scroll--plain > table > tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-scroll--plain > table > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table-scroll--plain > table > tbody {
    display: grid;
    gap: 10px;
  }

  .table-scroll--plain > table > tbody > tr {
    display: block;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel);
  }

  .table-scroll--plain > table > tbody > tr > td {
    position: static;
    display: block;
    min-width: 0;
    max-width: none;
    padding: 0;
    border: 0;
    box-shadow: none !important;
  }

  .table-scroll--plain > table > tbody > tr > td:not(.decision-cell) {
    background: transparent !important;
  }

  .table-scroll--plain > table > tbody > tr > td.decision-cell {
    padding: 6px 9px;
    border-radius: 6px;
  }

  .table-scroll--plain > table > tbody > tr > td + td {
    margin-top: 9px;
  }

  .table-scroll--plain > table > tbody > tr > td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  /* 1列目（要件ID・区分・用語など）はカードの見出しにする */
  .table-scroll--plain > table > tbody > tr > td:first-child {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    font-weight: 750;
  }

  /* 1列目の列見出し（「場面」「経路」等）も、見出しの上に小さく出す */
  .table-scroll--plain > table > tbody > tr > td:first-child::before {
    margin-bottom: 1px;
    font-size: 11px;
    font-weight: 800;
  }

  .table-scroll--plain > table > tbody > tr > td[data-label=""]::before {
    content: none;
  }

  .table-scroll--plain > table > tbody > tr > td:empty {
    display: none;
  }

  .table-scroll--plain tr.ref-arrived {
    animation: ref-arrived 3s ease-out;
  }

  .table-scroll--plain tr.ref-arrived > td {
    animation: none;
  }
}

@media (max-width: 560px) {
  :root {
    --header-height: 56px;
  }

  .learning-figure__chara,
  .learning-figure--inline .learning-figure__chara {
    width: 40px;
    height: 40px;
  }

  .home-cast {
    margin-top: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 4px;
  }

  .home-cast .chara {
    width: 40px;
    height: 40px;
  }

  .home-cast__name {
    font-size: 11px;
  }

  .home-cast__role {
    font-size: 10px;
  }

  /* スマホでもヘッダーは1段。副題はトップに出し、ヘッダーではサイト名と「by 運営者」を2行で小さく出す */
  .site-header__inner {
    padding: 6px 12px;
    gap: 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand__logo {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .brand__line {
    flex-direction: column;
    gap: 0;
  }

  .brand__name {
    font-size: 15px;
    line-height: 1.25;
  }

  .brand__operator {
    font-size: 10px;
    line-height: 1.25;
  }

  .brand__tagline {
    display: none;
  }

  .primary-nav > a {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 13px;
  }

  /* 算定要件ページでは右側を「目次」ボタンに譲る（一覧へはロゴとパンくずから戻れる） */
  .js .requirement-page .primary-nav {
    display: none;
  }

  /* ロゴとサイト名は縮めず、「目次」ボタンが残りの幅に収まる（今いる章は省略記号で切る） */
  .brand {
    flex: 0 0 auto;
  }

  .site-header__tools {
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  .toc-toggle {
    max-width: 100%;
  }

  .nav-status {
    display: none;
  }

  .page-intro {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .revision-summary > div {
    grid-template-columns: 4.8em minmax(0, 1fr);
    padding: 8px 12px;
    gap: 8px;
  }

  .page-intro {
    gap: 16px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .reading-progress__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .requirements-list__action {
    font-size: 0;
  }

  .requirements-list__action span {
    font-size: 18px;
  }

  .chapter-toggle {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .route-switcher__tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  .phase-flow__item {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 9px;
  }

  .phase-flow__number {
    width: 32px;
    height: 32px;
  }

  .phase-flow__item:not(:last-child)::before {
    top: 30px;
    left: 15px;
  }

  .phase-flow__item:not(:last-child)::after {
    left: 11px;
  }

  .figure-node {
    padding: 12px;
  }

  .point-card-table tr.point-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  .point-card-table .point-card__content {
    grid-column: auto;
  }

  .qa-item__summary,
  .qa-item__answer {
    padding: 13px;
  }

  .exercise-list__item {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}

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

  .ref-popover--sheet {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .table-scroll-hint {
    display: none;
  }

  .table-scroll--plain th:first-child,
  .table-scroll--plain td:first-child {
    position: static;
    box-shadow: none;
  }

  body {
    background: #fff;
  }

  /* 印刷では NG カードのチューブン（小さいアイコン）を出さないので、見出しの左の空きも詰める */
  .ng-card-table td.ng-card__case::before {
    padding-left: 0;
  }

  .chara--sm,
  .site-header,
  .toc-panel,
  .toc-backdrop,
  .finder__controls,
  .collapsible__chevron,
  .chapter-toggle,
  .ref-popover,
  .ref-popover-backdrop,
  .ref-back,
  .document-heading__tools,
  .reading-progress,
  .breadcrumb {
    display: none !important;
  }

  /* 印刷物にも、免責と運営者だけを小さく1段で出す（サイト名・改定名の行と、誤りの報告・プライバシーポリシーのリンクは出さない） */
  .site-footer {
    margin-top: 16px;
    border-top: 1px solid #b7b7b7;
    background: #fff;
  }

  .site-footer__inner {
    padding: 6px 0 0;
    font-size: 8.5px;
    line-height: 1.45;
  }

  .site-footer__inner p {
    display: inline;
    margin: 0 !important;
  }

  .site-footer__name,
  .site-footer__revision,
  .site-footer__report,
  .site-footer__privacy {
    display: none !important;
  }

  .site-footer__operator::before {
    content: " ";
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .requirement-layout {
    display: block;
  }

  .requirement-document,
  .source-card,
  .process-diagram,
  .learning-figure {
    border-color: #b7b7b7;
    box-shadow: none;
  }

  .chapter-content[hidden] {
    display: block;
    content-visibility: visible;
  }

  .collapsible__body {
    border-top: 0;
  }

  .qa-item {
    overflow: visible;
    break-inside: avoid;
    box-shadow: none;
  }

  .qa-item__answer {
    display: grid !important;
  }

  .table-scroll {
    overflow: visible;
  }

  .process-diagram__svg {
    width: 100%;
    height: auto;
  }

  .route-switcher__tabs {
    display: none !important;
  }

  .route-switcher [hidden] {
    display: block !important;
  }

  .route-switcher__panels,
  .figure-checklist__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .learning-figure,
  .figure-node {
    break-inside: avoid;
  }

  table {
    width: 100%;
    font-size: 10px;
  }
}
