/*
 * 使い方（/how-it-works/）だけで読み込む。site.css を直さずに足した規則
 * 変えたら how-it-works/index.html の ?v= を変える。赤紫（--mag）は使わない（経路の図だけの色）
 *
 * - .doc--howto     左の目次を「一度だけの準備」「飛ぶたびの通報」に分け、番号を 1〜12 で通す。幅 1024px 未満は左の目次を出さない
 * - .toc-fold       幅 1024px 未満の手順の一覧（<details>）。1024px 以上は左の目次と .howto-route
 * - .howto-route    全体の流れ（幅 1024px 以上）。手順を経路の地点のように横に並べた帯（2 つの区間）
 * - .do             手順 1・8 以外の「すること」（番号の無い箇条）
 * - .spec--steps    入力の画面の 7 つの区切り
 * - .fp-table       項目ごとの要点（第 7〜19 項）。幅 760px 未満は行ごとに縦に積む
 * - .spec--msg      送信できないときの表示と、すること
 */

/* 幅 1024〜1279px では目次の横の本文の欄が約 650〜890px しかないので、2 列の組みは縦に積む（site.css の .doc-body .split）。
   そのときの図は大きくなりすぎないように幅を抑える */
@media (max-width: 1279px) {
  .doc-body .split > .figure { max-width: 420px; }
}

/* 節の頭のすぐ後の塊は、節の頭の余白だけで離す（二重にしない） */
.doc--howto .sec-head + .doc-block { margin-top: 0; }

/* ───────── 目次 ───────── */
.doc--howto .toc-group { margin: 16px 0 6px; font-size: 12.5px; font-weight: 700; line-height: 1.5; color: var(--ink-3); letter-spacing: .06em; }
.doc--howto .toc a::before { color: var(--ink-3); }
.doc--howto .toc ol.toc-from6 { counter-reset: t 5; }
.doc--howto .toc ol.toc-plain { margin-top: 16px; }
.doc--howto .toc ol.toc-plain a { display: block; }
.doc--howto .toc ol.toc-plain a::before { content: none; }
.doc--howto .toc-title + .toc-plain { margin-top: 0; }
@media (max-width: 1023px) { .doc--howto > .toc { display: none; } }

/* 狭い画面の手順の一覧（コラムの .toc-fold と同じ形） */
@media (min-width: 1024px) { .doc--howto .toc-fold { display: none; } }
.doc--howto .toc-fold { margin-top: 24px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule-2); font-size: 15px; }
.doc--howto .toc-fold summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 2px; font-weight: 700; letter-spacing: .04em; }
.doc--howto .toc-fold summary::-webkit-details-marker { display: none; }
.doc--howto .toc-fold summary::after { content: ""; flex: none; margin-left: auto; margin-right: 6px; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.doc--howto .toc-fold[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.doc--howto .toc-fold .toc-count { font-size: 13px; font-weight: 400; color: var(--ink-3); letter-spacing: .02em; }
.doc--howto .toc-fold ol { list-style: none; counter-reset: t; border-top: 1px solid var(--rule); margin-bottom: 4px; }
.doc--howto .toc-fold li { counter-increment: t; border-bottom: 1px solid var(--rule); }
.doc--howto .toc-fold li:last-child { border-bottom: 0; }
.doc--howto .toc-fold a { display: grid; grid-template-columns: 2em 1fr; padding: 10px 0; color: var(--ink); text-decoration: none; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
.doc--howto .toc-fold a::before { content: counter(t); color: var(--ink-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.doc--howto .toc-fold .toc-src a { color: var(--ink-2); }
.doc--howto .toc-fold .toc-src a::before { content: ""; }
.doc--howto .toc-fold a:hover { color: var(--blue); text-decoration: underline; }

/* ───────── 全体の流れ（経路の帯。幅 1024px 以上） ───────── */
.howto-route { display: none; }
@media (min-width: 1024px) {
  .howto-route { display: grid; gap: 22px; margin-top: 28px; padding: 20px 24px 22px; background: var(--sheet); border: 1px solid var(--rule-2); }
}
.howto-route + .fine { margin-top: 12px; }
.hr-leg-t { margin: 0 0 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); }
.hr-leg ol { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: relative; }
.hr-leg li { position: relative; min-width: 0; }
.hr-leg li:not(:last-child)::before { content: ""; position: absolute; left: 15px; width: 100%; top: 14px; border-top: 2px solid var(--ink); }  /* 区間の線（次の地点の印の中心まで） */
.hr-leg a { display: grid; justify-items: start; gap: 6px; padding-right: 8px; color: var(--ink); text-decoration: none; }
.hr-no { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 50%; background: var(--sheet); font-family: var(--font-data); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hr-t { font-size: 14px; font-weight: 700; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.hr-w { margin-top: -4px; font-size: 12.5px; line-height: 1.4; color: var(--ink-3); }
.hr-leg a:hover .hr-t { color: var(--blue); text-decoration: underline; }
.hr-leg a:hover .hr-no { border-color: var(--blue); color: var(--blue); }

/* ───────── すること（手順 1・8 以外。番号の無い箇条） ───────── */
.do-head { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); }
.do-list { padding-left: 1.3em; max-width: 46em; font-size: 15.5px; line-height: 1.85; color: var(--ink-2); }
.do-list li { text-wrap: pretty; }
.do-list li + li { margin-top: 10px; }
.do-list b { color: var(--ink); }
.do-list ul { margin-top: 6px; padding-left: 1.2em; list-style: circle; }
.do-list ul li + li { margin-top: 4px; }

/* ───────── 入力の画面の区切り ───────── */
.spec--steps { margin-top: 0; }
.spec--steps > div { grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 12px; }
.spec--steps dt .data { display: inline-block; min-width: 1.5em; color: var(--ink-3); }
.spec--steps + p { margin-top: 16px; font-size: 15px; color: var(--ink-2); }

/* ───────── 項目ごとの要点（第 7〜19 項。IFR と VFR の例は項目ごとに並べない） ───────── */
.fp-items-lead { margin-bottom: 16px; }
.fp-table { border-top: 2px solid var(--ink); }
.fp-table caption { font-size: 14px; font-weight: 400; color: var(--ink-2); }
.fp-table tbody th { width: 13em; font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; }
.fp-table th a { color: var(--ink); text-decoration-color: var(--rule-2); }
.fp-table th a:hover { color: var(--blue); text-decoration-color: currentColor; }
.fp-no { display: block; font-family: var(--font-data); font-size: 12.5px; letter-spacing: .04em; color: var(--ink-3); }
.fp-where { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.fp-table td:last-child { font-size: 14.5px; color: var(--ink-2); text-wrap: pretty; }
@media (max-width: 759px) {
  .fp-table, .fp-table tbody, .fp-table tr, .fp-table th, .fp-table td { display: block; width: 100%; }
  .fp-table thead { display: none; }
  .fp-table caption { display: block; width: 100%; }
  .fp-table tr { padding: 12px 0 14px; border-bottom: 1px solid var(--rule); }
  .fp-table tbody th, .fp-table td { padding: 4px 2px; border-bottom: 0; }
  .fp-table td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); }
}

/* 注記の中の箇条書き（11 の「公式の資料に記載がない点」）。ul の余白は site.css で 0 にしてあるので、印が枠の外に出ないように */
.doc--howto .note ul { padding-left: 1.3em; }

/* ───────── 送信できないとき ───────── */
.spec--msg { margin-top: 0; }
.spec--msg > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.spec--msg dt { font-weight: 400; color: var(--ink); word-break: normal; text-wrap: pretty; }
@media (max-width: 759px) { .spec--msg > div { gap: 4px; } .spec--msg dt { font-weight: 700; } } /* 縦に積むときは、表示の文を太くして、することと分ける */
@media (min-width: 760px) { .spec--msg > div { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }
