/* MORSE ROOM — emergency guide page. Requires common.css from the shared frame. */
.emergency-page { max-width: 1120px; }
.emergency-intro { padding: 27px 0 8px; }
.emergency-intro h1 { margin-bottom: 10px; }
.emergency-intro .lead { max-width: 720px; }

/* まずやること（緊急通報が先） */
.first-action { margin-top: 22px; padding: 20px; border: 1px solid #7a4a44; border-left: 4px solid var(--red); border-radius: var(--radius); background: linear-gradient(145deg, rgb(66 35 33 / 55%), rgb(20 31 34 / 98%)); box-shadow: var(--shadow-panel); }
.first-action h2 { margin: 0 0 8px; font-size: 19px; }
.first-action h2 .fa-code { color: var(--red); font: 10px var(--font-mono); letter-spacing: .13em; display: block; margin-bottom: 5px; }
.first-action p { margin: 0 0 14px; color: #d8c9c6; font-size: 13px; line-height: 2; }
.em-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin: 0 0 14px; }
.em-number { padding: 13px 15px; border: 1px solid #6b4a45; border-radius: 8px; background: #101a1c; }
.em-number strong { display: block; color: var(--text); font: 700 30px/1.1 var(--font-mono); letter-spacing: .06em; }
.em-number span { color: var(--muted); font-size: 11px; }
.first-action .fa-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.9; }
.first-action .fa-note strong { color: var(--text); }

/* SOS 発信ツール */
.sos-panel { margin-top: 26px; padding: 22px; border: 1px solid var(--line-bright); border-radius: var(--radius); background: linear-gradient(145deg, rgb(29 44 47 / 96%), rgb(20 31 34 / 98%)); box-shadow: var(--shadow-panel); }
.sos-panel__head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.sos-panel__head::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px rgb(238 119 112 / 70%); }
.sos-panel__head h2 { margin: 0; font-size: 21px; }
.sos-code-line { margin: 0 0 4px; color: var(--signal); font: 700 22px var(--font-mono); letter-spacing: .18em; }
.sos-desc { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.sos-stage { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.sos-stage .flash { flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid #82978a; border-radius: 50%; background: #33443e; box-shadow: inset 0 0 6px #101816; }
.sos-stage .flash.on { border-color: #e5ff82; background: var(--signal); box-shadow: 0 0 8px 4px rgb(214 243 106 / 22%), 0 0 26px rgb(214 243 106 / 80%); }
/* Full-screen flash overlay (flashMode = big / both)。converter.css と同じ定義を
   このページでも持つ（共通モジュール setFlash が #flashBig.bigflash.on を切り替える）。 */
.bigflash { position: fixed; inset: 0; z-index: 80; pointer-events: none; background: var(--signal); opacity: 0; }
.bigflash.on { opacity: .88; }
.sos-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-sos { min-height: 64px; padding: 0 34px; font-size: 18px; letter-spacing: .05em; }
.btn-sos-stop { min-height: 64px; padding: 0 28px; font-size: 16px; border-color: #7a4a44; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.sos-status { margin: 14px 0 0; color: var(--text); font-size: 13px; min-height: 1.8em; }
.sos-status:empty::before { content: "停止中 — 「SOSを発信する」を押すと、・・・－－－・・・ を繰り返し送ります。"; color: var(--subtle); }
.sos-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgb(83 108 108 / 45%); }
.sos-opt .control-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #dce7df; font-size: 11px; font-weight: 600; white-space: nowrap; }
.sos-opt .control-label span { color: #819690; font: 8px var(--font-mono); letter-spacing: .08em; }
.check-control { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.check-control input { width: 18px; height: 18px; accent-color: var(--signal); }
.check-control input[disabled] { cursor: not-allowed; }
.opt-note { margin: 6px 0 0; color: var(--subtle); font-size: 10px; line-height: 1.7; }
/* 非対応で無効化された項目の理由表示：通常の注記より目立たせ、「なぜ使えないか」を伝える */
.opt-note.note-unsupported { color: #e8d5ae; font-size: 11px; padding: 6px 9px; border: 1px solid rgb(239 182 94 / 45%); border-radius: 6px; background: rgb(60 45 20 / 35%); }
.sos-battery { margin: 16px 0 0; padding: 11px 14px; border: 1px solid rgb(239 182 94 / 40%); border-radius: 7px; color: #e8d5ae; background: rgb(60 45 20 / 35%); font-size: 11px; line-height: 1.9; }

/* 読み物セクション共通 */
.em-section { margin-top: 52px; }
.em-section > p { max-width: 760px; color: #c6d2c9; font-size: 13px; line-height: 2.1; }
.em-section h3 { margin: 26px 0 10px; font-size: 15px; }
.signal-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 18px; }
.signal-card { padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(145deg, #1d2c2f, #142124); box-shadow: var(--shadow-panel); }
.signal-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.signal-card__name { font-size: 14px; font-weight: 700; }
.signal-card__tag { color: var(--signal-dark); font: 9px var(--font-mono); letter-spacing: .08em; }
.signal-card__code { display: block; margin-bottom: 8px; color: var(--signal); font: 700 19px var(--font-mono); letter-spacing: .14em; overflow-wrap: anywhere; }
.signal-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.9; }
.digits-table td, .digits-table th { text-align: center; }
.phrase-table td.phrase-native { color: var(--text); white-space: nowrap; }
.phrase-table small { display: block; color: var(--subtle); font-size: 10px; }
.honest-note { margin-top: 14px; }

/* 手法カード（イラスト付き） */
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 18px; }
.method-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(145deg, #1d2c2f, #142124); box-shadow: var(--shadow-panel); }
.method-art { width: 104px; height: 104px; padding: 10px; border: 1px solid var(--line-bright); border-radius: 8px; background: #101a1c; color: var(--signal); }
.method-art svg { display: block; width: 100%; height: 100%; }
.method-card h3 { margin: 0 0 6px; font-size: 14px; }
.method-card h3 .m-tag { display: block; color: var(--signal-dark); font: 8px var(--font-mono); letter-spacing: .1em; margin-bottom: 3px; }
.method-card p, .method-card li { color: var(--muted); font-size: 11px; line-height: 1.9; }
.method-card p { margin: 0; }
.method-card ul { margin: 6px 0 0; padding-left: 0; list-style: none; }
.method-card li { position: relative; padding-left: 15px; margin-bottom: 3px; }
.method-card li::before { position: absolute; left: 2px; top: 11px; width: 5px; height: 5px; content: ""; border-radius: 50%; background: var(--signal-dark); }
.method-card li strong { color: var(--text); }

/* オフライン */
.offline-panel { margin-top: 52px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgb(23 35 38 / 55%); }
.offline-panel h2 { margin: 0 0 8px; font-size: 18px; }
.offline-panel p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 2; }
.offline-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
/* 保存案内（端末別の書き分け） */
.save-guides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 12px; }
.save-guide { padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #101a1c; }
.save-guide h3 { margin: 0 0 6px; font-size: 13px; }
.save-guide p { margin: 0 0 8px; }
.save-guide p:last-child { margin-bottom: 0; }
.save-guide .save-note { color: #e8d5ae; padding: 8px 10px; border: 1px solid rgb(239 182 94 / 45%); border-radius: 6px; background: rgb(60 45 20 / 35%); font-size: 11px; }
.save-guide .save-steps { margin: 0 0 8px; padding-left: 20px; }
.save-guide .save-steps li { margin-bottom: 4px; line-height: 1.9; }
.save-guide .save-steps li:last-child { margin-bottom: 0; }
.save-guide .save-steps strong { color: var(--text); }
.save-guide .save-verified { color: var(--signal); font-weight: 700; }

/* 出典と確認日 */
.sources-panel { margin-top: 26px; padding: 20px; border: 1px solid var(--line-bright); border-radius: var(--radius); background: linear-gradient(145deg, rgb(29 44 47 / 96%), rgb(20 31 34 / 98%)); }
.sources-panel h2 { margin: 0 0 6px; font-size: 18px; }
.verified-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 14px; }
.verified-badge { padding: 5px 12px; border: 1px solid var(--signal-dark); border-radius: 999px; color: var(--signal); font: 700 12px var(--font-mono); letter-spacing: .05em; }
.verified-line p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.sources-list { margin: 0; padding-left: 0; list-style: none; }
.sources-list li { margin-bottom: 9px; padding-left: 17px; position: relative; color: var(--muted); font-size: 12px; line-height: 1.9; }
.sources-list li::before { position: absolute; left: 2px; top: 12px; width: 6px; height: 6px; content: ""; border-radius: 50%; background: var(--signal-dark); }
.sources-list a { color: var(--signal); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.sources-list .src-what { color: var(--text); }
.print-only { display: none; }

@media (max-width: 760px) {
  .em-numbers { grid-template-columns: 1fr; }
  .save-guides { grid-template-columns: 1fr; }
  .em-number strong { font-size: 26px; }
  .sos-options { grid-template-columns: 1fr; }
  .signal-cards, .method-grid { grid-template-columns: 1fr; }
  .btn-sos, .btn-sos-stop { flex: 1 1 auto; }
}
@media (max-width: 520px) {
  .method-card { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .method-art { width: 76px; height: 76px; padding: 7px; }
  .sos-code-line { font-size: 17px; }
}

/* ============ 印刷／PDF 配布用レイアウト ============ */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; font-size: 12px; }
  .print-only { display: block; }
  .print-head { padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid #111; }
  .print-head strong { font-size: 16px; }
  .print-head span { display: block; color: #444; font-size: 10px; margin-top: 3px; }
  .site-header, .site-footer, .skip-link, .bigflash,
  .sos-actions, .sos-options, .offline-actions, .page-eyebrow { display: none !important; }
  .shell { width: 100%; margin: 0; }
  .page-main { padding: 0; }
  .emergency-intro { padding: 0 0 6px; }
  h1 { font-size: 22px; color: #111; }
  h1 span { color: #111; }
  .kicker, .section-heading__code { color: #555; }
  .lead, .em-section > p { color: #222; }
  .first-action, .sos-panel, .offline-panel, .sources-panel {
    border: 1px solid #888; border-left: 3px solid #111; background: #fff; box-shadow: none; color: #111;
  }
  .first-action h2 .fa-code { color: #555; }
  .first-action p, .first-action .fa-note { color: #222; }
  .em-number { border: 1px solid #888; background: #fff; }
  .em-number strong { color: #111; }
  .em-number span { color: #333; }
  .sos-code-line { color: #111; }
  .sos-desc, .sos-status { color: #222; }
  .sos-stage .flash { display: none; }
  .sos-battery { border: 1px solid #888; background: #fff; color: #222; }
  .save-guide { border: 1px solid #888; background: #fff; break-inside: avoid; }
  .save-guide h3 { color: #111; }
  .save-guide p { color: #222; }
  .save-guide .save-note { border: 1px solid #888; background: #fff; color: #222; }
  .save-guide .save-steps li { color: #222; }
  .save-guide .save-steps strong { color: #111; }
  .save-guide .save-verified { color: #111; }
  .section-heading { border-bottom: 1px solid #888; }
  .section-heading h2 { color: #111; }
  .signal-card, .method-card { border: 1px solid #888; background: #fff; box-shadow: none; break-inside: avoid; }
  .signal-card__code { color: #111; }
  .signal-card p, .method-card p, .method-card li { color: #222; }
  .signal-card__tag, .method-card h3 .m-tag { color: #555; }
  .method-art { border: 1px solid #888; background: #fff; color: #111; }
  .data-table th { background: #eee; color: #111; border-bottom: 1px solid #888; }
  .data-table td { color: #222; border-bottom: 1px solid #bbb; }
  .mono-cell, .morse-cell { color: #111 !important; }
  .phrase-table td.phrase-native { color: #111; }
  .phrase-table small { color: #444; }
  .notice-strip { border: 1px solid #888; background: #fff; }
  .notice-strip p { color: #222; }
  .notice-icon { border-color: #888; color: #111; }
  .verified-badge { border-color: #111; color: #111; }
  .sources-list li, .verified-line p { color: #222; }
  .sources-list a { color: #111; }
  .em-section, .offline-panel, .sources-panel { break-inside: avoid; margin-top: 28px; }
  .em-section { break-inside: auto; }
  a { color: #111; }
}

/* Contextual links inside emergency sections */
.em-section p a { color: var(--signal); font-weight: 700; }
