/* JavaScript が動かないとき（boot.js が html に js を付けない）だけ、案内を隠して手順を開いておく */
html:not(.js) .guide { display: none; }
html:not(.js) .situations .aid[hidden] { display: block; }
/* 慌てているときに読むページなので、最初の画面から質問の選択肢が見えるよう、冒頭を詰める。
   窓口の丸いボタン（.aid-c）と窓口の札（.contact）は emergency/help.css（記事のページと共通） */
.hero { padding-bottom: clamp(28px, 5vw, 56px); }
.hero .lead { margin-top: 20px; margin-bottom: 0; }
.em-head { margin-bottom: 20px; }
.em-head .no { margin-bottom: 8px; }
@media (max-width: 600px) {
  .hero { padding-top: 28px; }
  .hero .eyebrow { margin-bottom: 12px; }
  .hero h1 { font-size: 1.75rem; }
  .hero .lead { margin-top: 14px; font-size: 1rem; line-height: 1.85; }
  .em-head h2 { font-size: 1.25rem; }
  /* 狭い画面では、最初の画面にガイドの質問が入るよう、見出しを一行にし、01 の見出しは読み上げだけにする */
  .hero { padding-top: 20px; padding-bottom: 24px; }
  .hero .eyebrow { display: none; }
  .hero h1 { font-size: clamp(1.4rem, 6.6vw, 1.75rem); }
  .hero h1 br { display: none; }
  #find .em-head { margin-bottom: 12px; }
  #find .em-head .no { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* 冒頭の三つの電話。詰めて並べる */
.quick { margin-top: 24px; }
.quick .aid-c { margin-top: 0; gap: 8px; }
.quick .aid-c a[href^="tel:"] { padding-right: 16px; padding-left: 14px; gap: 8px; }
.quick .aid-c a b { font-size: 1.12rem; }
.aid-c a.to-list { padding: 8px 4px; border: 0; background: none; color: var(--ink-2); font-size: .88rem; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .3em; }
.aid-c a.to-list::before { display: none; }
.aid-c a.to-list::after { content: "↓"; content: "↓" / ""; margin-left: -4px; font-family: var(--mono); color: var(--ink-3); }
@media (hover: hover) { .aid-c a.to-list:hover { background: none; color: var(--accent); } }
.aid-c a.to-list:active { background: none; color: var(--accent); }
@media (max-width: 600px) {
  .quick { margin-top: 16px; }
  .quick .aid-c a[href^="tel:"] { padding-right: 14px; padding-left: 12px; gap: 6px; }
  .quick .aid-c a::before { width: 16px; height: 16px; }
  .quick .aid-c a b + span { letter-spacing: .02em; }
}
/* 幅の狭い端末では、110 と #9110 を一行に収める */
@media (max-width: 359px) {
  .quick .aid-c { gap: 6px; }
  .quick .aid-c a[href^="tel:"] { padding-right: 12px; padding-left: 10px; }
  .quick .aid-c a b { font-size: 1.02rem; }
  .quick .aid-c a b + span { font-size: .8rem; letter-spacing: 0; }
}

/* ---------- ガイド：質問に答えて、当てはまる記事へ ---------- */
.guide { max-width: 760px; padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.g-log { display: flex; flex-direction: column; gap: 10px; }
.g-row { display: flex; margin: 0; }
.g-row.me { justify-content: flex-end; }
.g-bub { max-width: 92%; margin: 0; padding: 11px 16px; border-radius: 18px; line-height: 1.75; word-break: auto-phrase; text-wrap: pretty; }
.bot .g-bub { background: var(--bg-2); border: 1px solid var(--line); border-top-left-radius: 6px; }
.me .g-bub { background: var(--ink); color: var(--bg); border-top-right-radius: 6px; font-size: .95rem; }
.g-q { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; }
.g-q:focus { outline: none; }
.g-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.g-choices { display: grid; gap: 10px; margin-top: 16px; }
@media (min-width: 820px) { .g-choices { grid-template-columns: 1fr 1fr; } }
.g-choice { appearance: none; position: relative; width: 100%; min-height: 56px; margin: 0; padding: 12px 44px 12px 18px; border: 1px solid var(--ink-3); border-radius: 14px; background: var(--bg); color: var(--ink); font: inherit; font-family: var(--font-head); font-weight: 700; font-size: 1rem; line-height: 1.55; letter-spacing: .03em; text-align: left; word-break: auto-phrase; text-wrap: pretty; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: border-color .15s, background .15s; }
.g-choice::after { content: ""; position: absolute; right: 20px; top: 50%; width: 9px; height: 9px; margin-top: -5px; border-top: 2px solid var(--ink-3); border-right: 2px solid var(--ink-3); transform: rotate(45deg); }
@media (hover: hover) { .g-choice:hover { border-color: var(--ink); background: var(--surface); } .g-choice:hover::after { border-color: var(--accent); } }
.g-choice:active { background: var(--bg-2); border-color: var(--ink); }
.g-ctrl { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; }
.g-ctrl button { min-height: 44px; padding: 0 2px; }
.g-ctrl[hidden] { display: none; }
/* 着いた記事 */
.g-urgent { margin: 16px 0 0; padding: 12px 16px; border-left: 4px solid var(--danger); border-radius: 0 12px 12px 0; background: var(--danger-soft); color: var(--ink); line-height: 1.8; }
.g-urgent b { display: block; color: var(--danger); font-family: var(--font-head); letter-spacing: .08em; }
.g-card { margin-top: 16px; padding: 18px 20px 20px; border: 2px solid var(--accent); border-radius: 16px; background: var(--surface); }
.g-card h3 { font-size: 1.08rem; line-height: 1.6; margin-bottom: 8px; }
.g-card .g-first-h { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: .88rem; color: var(--accent); letter-spacing: .06em; }
.g-card ol { margin: 4px 0 16px; padding-left: 1.4em; font-size: .95rem; line-height: 1.8; color: var(--ink-2); }
.g-card ol li + li { margin-top: .4em; }
.g-card .btn { width: 100%; }
@media (min-width: 600px) { .g-card .btn { width: auto; } }
@media (prefers-reduced-motion: no-preference) {
  .g-row.new, .g-choices.new, .g-card.new, .g-urgent.new { animation: gIn .32s cubic-bezier(.2, .8, .2, 1) both; }
  .g-choices.new { animation-delay: .08s; }
  @keyframes gIn { from { opacity: 0; transform: translateY(6px); } }
}

/* ---------- 言葉で探す ---------- */
/* 探し方のタブ（JS が動くときだけ出す。動かないときは三つを縦に並べる） */
.em-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; max-width: 760px; margin-bottom: 16px; padding: 4px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); }
.em-tabs[hidden], .em-tabs [hidden], .em-panel[hidden] { display: none; }
.em-tabs [role="tab"] { min-height: 48px; padding: 6px 8px; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--ink-2); font-family: var(--font-head); font-weight: 700; font-size: .95rem; line-height: 1.35; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.em-tabs [role="tab"] span { display: inline-block; }
.em-tabs [aria-selected="true"] { border-color: var(--ink); background: var(--surface); color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
@media (hover: hover) { .em-tabs [aria-selected="false"]:hover { color: var(--ink); background: var(--surface); } }
@media (prefers-reduced-motion: no-preference) { .em-tabs [role="tab"] { transition: background .15s, color .15s; } }
/* 狭い画面では、三つ目のタブが出て二行になっても高さが変わらないよう、二行分の高さを取っておく */
@media (max-width: 599px) { .em-tabs [role="tab"] { min-height: 56px; padding: 4px 6px; font-size: .88rem; } }
.em-tabs:not([hidden]) ~ .em-panel > .em-search:first-child, .em-tabs:not([hidden]) ~ .em-panel > .em-ask:first-child { margin-top: 0; }
.em-search { max-width: 760px; margin-top: 28px; }
.em-search label { display: block; margin-bottom: 8px; font-family: var(--font-head); font-weight: 700; }
.em-search .input { font-family: var(--font-body); font-size: 1.05rem; letter-spacing: .02em; min-height: 52px; }
.em-search .input::-webkit-search-cancel-button { cursor: pointer; }
.hits { max-width: 760px; margin-top: 14px; }
.hits[hidden] { display: none; }
.hits-n { margin: 0 0 6px; font-size: .88rem; color: var(--ink-3); }
.hit-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.hit-list > li { margin: 0; border-bottom: 1px solid var(--line); }
.hit-list a { position: relative; display: block; padding: 14px 36px 14px 0; text-decoration: none; color: var(--ink); }
.hit-list a::after { content: "→"; content: "→" / ""; position: absolute; right: 4px; top: 50%; margin-top: -.8em; font-family: var(--mono); color: var(--accent); }
.hit-list .hit-cat { display: block; font-size: .78rem; color: var(--ink-3); line-height: 1.6; }
.hit-list b { display: block; font-family: var(--font-head); line-height: 1.6; }
.hit-list .hit-d { display: block; margin-top: 2px; font-size: .88rem; line-height: 1.7; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: hover) { .hit-list a:hover b { color: var(--accent); } }
.hits-zero p { margin: 0 0 10px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.chip { appearance: none; min-height: 44px; padding: 6px 16px; border: 1px solid var(--ink-3); border-radius: 999px; background: var(--bg); color: var(--ink); font: inherit; font-size: .92rem; cursor: pointer; touch-action: manipulation; }
@media (hover: hover) { .chip:hover { border-color: var(--ink); } }
.hits-zero .to-guide { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- 文章で相談する（/status で受付中のときだけ表示。表示前は場所を取らず、ページの下側に出る） ---------- */
.em-ask { max-width: 760px; margin-top: 28px; }
.em-ask[hidden], .ask-res[hidden] { display: none; }
.em-ask label { display: block; margin-bottom: 8px; font-family: var(--font-head); font-weight: 700; }
.em-ask textarea { display: block; width: 100%; min-height: 104px; resize: vertical; font-family: var(--font-body); font-size: max(16px, 1.05rem); line-height: 1.7; }
.ask-note { margin: 8px 0 12px; font-size: .88rem; line-height: 1.7; color: var(--ink-2); }
.em-ask .btn { min-height: 48px; }
@media (max-width: 599px) { .em-ask .btn { width: 100%; } }
.ask-ts { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#askText.nudge { animation: ask-nudge .35s; border-color: var(--accent); }
@keyframes ask-nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { #askText.nudge { animation: none; } }
.ask-cnt { margin: 4px 0 0; text-align: right; font-family: var(--mono); font-size: .75rem; color: var(--ink-3); }
.ask-res { max-width: 760px; margin-top: 16px; }
.ask-res:focus { outline: none; }
.ask-res > p { margin: 0 0 10px; color: var(--ink-2); }
.ask-zero .lead-z { font-family: var(--font-head); font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.ask-next { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 8px; }
.ask-next a { display: flex; align-items: center; min-height: 48px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.ask-next a::before { content: "→"; content: "→" / ""; margin-right: 10px; color: var(--accent); font-family: var(--mono); }
.ask-cards { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.ask-cards a { position: relative; display: block; min-height: 56px; padding: 14px 44px 14px 18px; border: 1px solid var(--ink-3); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; }
.ask-cards a::after { content: "→"; content: "→" / ""; position: absolute; right: 16px; top: 50%; margin-top: -.8em; font-family: var(--mono); color: var(--accent); }
.ask-cards b { display: block; font-family: var(--font-head); line-height: 1.6; word-break: auto-phrase; }
.ask-cards span { display: block; margin-top: 4px; font-size: .88rem; line-height: 1.7; color: var(--ink-2); }
@media (hover: hover) { .ask-cards a:hover { border-color: var(--ink); } .ask-cards a:hover b { color: var(--accent); } }
.ask-res .to-guide { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- 状況の一覧 ---------- */
#situations { max-width: 760px; }
/* 分類（一層目）。閉じていれば見出しの行だけになる */
.em-cat { border-top: 1px solid var(--ink-3); }
.em-cat:last-of-type { border-bottom: 1px solid var(--ink-3); }
.em-cat > summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.em-cat > summary::-webkit-details-marker { display: none; }
.em-cat > summary::after { content: "+"; content: "+" / ""; margin-left: auto; font-family: var(--mono); font-size: 1.3rem; color: var(--accent); }
.em-cat[open] > summary::after { content: "−"; content: "−" / ""; }
.em-cat h3 { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; line-height: 1.5; color: var(--ink); }
.em-cat summary .n { flex: none; font-size: .8rem; color: var(--ink-3); }
.em-cat[open] > .situations { margin-bottom: 18px; }
.em-cat[open] > .situations > li:last-child { border-bottom: 0; }
.situations { list-style: none; padding: 0; margin: 0; }
/* 区切り線は状況の行だけに引く（中の手順の番号付きリストには引かない） */
.situations > li { margin: 0; border-top: 1px solid var(--line); }
.situations > li:last-child { border-bottom: 1px solid var(--line); }
.situations button { appearance: none; width: 100%; min-height: 64px; text-align: left; background: none; border: 0; padding: 14px 0; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; line-height: 1.6; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; word-break: auto-phrase; text-wrap: pretty; -webkit-tap-highlight-color: transparent; }
/* 記号は見た目だけのもの。開閉の状態は aria-expanded で伝わるため、読み上げ用の代替テキストは空にする */
.situations button::after { content: "+"; content: "+" / ""; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--ink-3); border-radius: 50%; font-family: var(--mono); font-size: 1.05rem; line-height: 1; color: var(--ink); font-weight: 400; transition: background .15s, border-color .15s, color .15s; }
@media (hover: hover) { .situations button:hover::after { border-color: var(--ink); background: var(--surface); } }
.situations button:active::after { background: var(--bg-2); }
.situations button[aria-expanded="true"] { color: var(--accent); }
.situations button[aria-expanded="true"]::after { content: "−"; content: "−" / ""; border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.situations .aid { padding: 0 0 24px; }
.situations .aid ol { margin-bottom: 0; padding-left: 1.4em; color: var(--ink-2); }
.situations .aid li { text-wrap: pretty; }
.situations .aid-c { margin-top: 16px; }
.aid-more { margin: 10px 0 0; }
.aid-more a { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; font-family: var(--font-head); font-weight: 700; }
.aid-more .arr { color: var(--accent); transition: transform .2s; }
@media (hover: hover) { .aid-more a:hover .arr { transform: translateX(4px); } }

.pass { margin-top: clamp(32px, 5vw, 48px); padding-top: clamp(24px, 4vw, 32px); border-top: 1px solid var(--line); }
.pass h3 { margin-bottom: 12px; }
.pass > p { max-width: 40em; color: var(--ink-2); font-size: .95rem; }
.pass-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; }
.pass-words { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 3.2rem; margin: 0; font-family: var(--font-head); font-weight: 700; font-size: clamp(1.3rem, 4.5vw, 1.6rem); }
.pass-words span[id] { padding: 4px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pass-and { color: var(--ink-3); font-size: 1rem; }
.pass-words.swap span[id] { animation: passIn .35s ease-out; }
@keyframes passIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pass-words.swap span[id] { animation: none; } }

/* 印刷：紙では開閉できないため、すべての状況の「まず、いますぐ」を開いた形で載せ、できるだけ少ない枚数に収める */
@media print {
  .em-ask, .ask-res { display: none !important; }
  @page { margin: 12mm 14mm; }
  /* 暗い表示のまま印刷しても、白い紙に黒い文字で出す */
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) { --ink: #000; --ink-2: #333; --ink-3: #555; --line: #bdbdbd; --surface: #fff; --bg: #fff; --bg-2: #fff; --accent: #b3321b; color-scheme: light; }
  body { font-size: 9.5pt; line-height: 1.65; }
  .hero { padding: 0 0 10px !important; }
  .hero .eyebrow { margin-bottom: 4px; font-size: 7.5pt; }
  .hero h1 { max-width: none; font-size: 18pt; }
  .hero h1 br { display: none; }
  .hero .lead { max-width: none; margin-top: 6px; font-size: 9.5pt; line-height: 1.65; }
  .section, .section.alt { padding: 14px 0 0 !important; }
  .section-head { margin-bottom: 8px; max-width: none; break-inside: avoid; break-after: avoid; }
  .section-head .no { margin-bottom: 2px; font-size: 7.5pt; }
  .section-head .no::before { height: 0; border-top: 1px solid; background: none; }
  .section-head h2 { font-size: 13pt; }
  .section-head h2 + p { margin-top: 2px; }
  h2, h3 { break-after: avoid; }
  #find { display: none; }
  /* 状況ごとに、見出しと手順を同じページに置く */
  #situations { max-width: none; }
  .em-cat { border: 0 !important; margin-top: 10px; }
  .em-cat > summary { min-height: 0; padding: 0; }
  .em-cat > summary::after, .em-cat summary .n { display: none; }
  .em-cat h3 { margin: 0; font-size: 8.5pt; color: var(--accent); }
  .situations > li { break-inside: avoid; }
  .situations button, .situations button[aria-expanded="true"] { min-height: 0; padding: 6px 0 1px; font-size: 10pt; line-height: 1.5; color: var(--ink); }
  .situations button::after, .situations button[aria-expanded="true"]::after { display: none; }
  .situations .aid, .situations .aid[hidden] { display: block; padding: 0 0 6px; }
  .situations .aid ol { margin: 0; padding-left: 1.6em; }
  .situations .aid li + li { margin-top: .1em; }
  .aid-more { display: none; }
  /* 状況ごとの窓口は、番号と名前だけを一行に並べる（Web のアドレスは下の「相談窓口」に載せる） */
  .situations .aid-c { gap: 0 16px; margin: 2px 0 0 1.6em; }
  .aid-c a { display: inline; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; line-height: 1.6; text-decoration: none; }
  .aid-c a::before { display: none; }
  .aid-c a b { margin-right: 4px; font-size: 10pt; }
  .aid-c a span, .aid-c a b + span { font-family: var(--font-body); font-weight: 400; font-size: 8.5pt; color: var(--ink-2); }
  .aid-c a:not([href^="tel:"]) span::before { content: "→ "; }
  .cols.c3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .cols h3 { margin-bottom: 2px; font-size: 10pt; }
  .cols p { font-size: 8.5pt; line-height: 1.6; }
  .next, .course-nav { display: none !important; }
}
