/* NOTAMビジュアライザー。law_map と同じく 100dvh フル画面 2ペイン。
   色・角丸・影・モーションはサイト共通トークン（style.css :root）に統一。
   系列5色は視認性優先で独自に維持し、notam_map.js の SERIES 定義と一致させる。 */

:root {
  --notam-fir: #1a6fc4;      /* FIR / 空域 (rjjj) */
  --notam-obst: #d98a00;     /* 障害物 (robl) */
  --notam-uav: #7c53c3;      /* 無人機 (rjdr) */
  --notam-warn: #d1453b;     /* 警報 (rjtd) */
  --notam-ad: #178f6f;       /* 空港 (aerodrome) */
  --notam-line: var(--color-border);
  --notam-accent: var(--color-accent);
  --notam-accent-dark: var(--color-accent-dark);
}

/* ヘッダー高さの決め打ちを避け、残り領域をぴったり埋める（law_map と同方針） */
html, body { height: 100%; height: 100dvh; }
body { display: flex; flex-direction: column; overflow: hidden; }
.site-main {
  max-width: none; margin: 0; padding: 0;
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}

#notam-wrapper {
  position: relative; width: 100%;
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--color-bg); overflow: hidden;
}

/* 開発中バナー */
#notam-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 500; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.92); border: 1px solid var(--color-border);
  border-radius: var(--radius-pill); padding: 5px 16px; font-size: 12px; color: var(--color-muted);
  box-shadow: var(--shadow-sm); pointer-events: none;
}
.banner-dev-badge {
  font-size: 11px; font-weight: 700; color: var(--notam-accent);
  background: #e3f0fb; border-radius: var(--radius-pill); padding: 2px 8px; letter-spacing: 0.04em;
}

/* 2ペイン */
#notam-layout { display: flex; width: 100%; flex: 1 1 auto; min-height: 0; }

/* 左レール：フィルタ */
#notam-rail {
  flex: 0 0 316px; width: 316px; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--color-surface); border-right: 1px solid var(--notam-line);
  padding: 18px 16px 32px;
}
.rail-head { padding-bottom: 12px; border-bottom: 1px solid var(--notam-line); margin-bottom: 14px; }
.rail-head-row { display: flex; align-items: center; justify-content: space-between; }
.rail-title { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: 0.04em; color: var(--color-heading); }
.rail-freshness { font-size: 11px; color: var(--color-muted-2); margin: 4px 0 0; }
.rail-freshness.is-stale { color: var(--notam-obst); font-weight: 700; }
.rail-freshness.is-old { color: var(--notam-warn); font-weight: 700; }

.filter-block { margin-bottom: 18px; }
.filter-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--color-muted-2); margin-bottom: 7px;
}
.filter-input {
  width: 100%; box-sizing: border-box; padding: 8px 10px;
  border: 1px solid var(--color-input-border); border-radius: var(--radius-md); font-size: 13px;
  background: var(--color-surface-alt); color: var(--color-text);
  transition: border-color 0.15s, background 0.15s;
}
.filter-input:focus { outline: none; border-color: #9cc2ea; background: var(--color-surface); }
.filter-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.filter-row:first-child { margin-top: 0; }
.time-tz { font-size: 12px; color: var(--color-muted); flex-wrap: wrap; }
.time-tz label { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }
.alt-row .alt-input { width: 50%; }
.alt-sep { color: var(--color-muted-2); }

.link-btn {
  background: none; border: none; color: var(--notam-accent); font-size: 12px;
  cursor: pointer; padding: 0; text-decoration: underline;
}
.link-btn:hover { color: var(--notam-accent-dark); }

/* 系列フィルタ（pill チップトグル。aria-pressed 方式） */
.series-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.series-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-border); background: var(--color-surface-alt);
  font-size: 12px; color: var(--color-muted-2); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.series-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--color-border-soft); background: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.series-pill[aria-pressed="true"] {
  background: var(--color-surface); border-color: var(--chip-color);
  color: var(--color-text); box-shadow: var(--shadow-sm);
}
.series-pill[aria-pressed="true"] .series-dot { background: var(--chip-color); border-color: var(--chip-color); }
.series-pill:hover { border-color: var(--color-border-soft); }
.series-count { font-size: 10px; color: var(--color-muted-2); }

.toggle-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text); cursor: pointer; }
.reset-btn {
  width: 100%; padding: 9px; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-button-secondary); color: var(--color-heading); font-size: 13px; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.reset-btn:hover { background: #dde3ea; }

/* 表示モード（新着のみ／ピン留めのみ） */
.mode-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.mode-pill {
  padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid var(--color-border);
  background: var(--color-surface-alt); font-size: 12px; color: var(--color-muted-2); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.mode-pill[aria-pressed="true"] {
  background: var(--notam-accent); border-color: var(--notam-accent); color: #fff; box-shadow: var(--shadow-sm);
}
.mode-pill:hover { border-color: var(--color-border-soft); }

/* モバイル: ドロワー内の「適用して閉じる」（デスクトップでは不要） */
.apply-close-btn { display: none; }
@media (max-width: 860px) {
  .apply-close-btn {
    display: block; width: 100%; margin-top: 8px; padding: 9px; border: none; border-radius: var(--radius-md);
    background: var(--notam-accent); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer;
  }
  .apply-close-btn:hover { background: var(--notam-accent-dark); }
}

/* ルート近傍 */
.route-btn {
  width: 100%; padding: 8px; border: 1px solid var(--color-input-border); border-radius: var(--radius-md);
  background: var(--color-surface-alt); color: var(--color-text); font-size: 13px; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.route-btn[aria-pressed="true"] { background: var(--notam-accent); color: #fff; border-color: var(--notam-accent); }
.route-row { justify-content: space-between; margin-top: 8px; }
.route-width { font-size: 12px; color: var(--color-muted); }
.route-width .alt-input { width: 60px; }
.route-hint { font-size: 11px; color: var(--notam-accent); margin: 8px 0 0; line-height: 1.5; }

/* 印刷ブロック */
.print-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 16px; margin-bottom: 8px;
  border: none; border-radius: var(--radius-pill);
  background: var(--notam-accent); color: #fff; font-size: 13px; font-weight: bold; cursor: pointer;
  box-shadow: 0 2px 8px rgba(26, 111, 196, 0.35);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.print-btn:hover { background: var(--notam-accent-dark); box-shadow: 0 3px 10px rgba(26,111,196,.45); transform: translateY(-1px); }
.print-btn--secondary {
  background: var(--color-surface); color: var(--color-heading);
  border: 1px solid var(--color-border); box-shadow: none;
}
.print-btn--secondary:hover { background: var(--color-surface-alt); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.print-hint { font-size: 11px; color: var(--color-muted-2); margin: 4px 0 0; line-height: 1.5; }

.rail-attribution {
  margin: 18px 2px 0; padding-top: 14px; border-top: 1px solid var(--notam-line);
  font-size: 11px; color: var(--color-muted-2); line-height: 1.6;
}
.rail-attribution a { color: #6a89a8; }

/* パネル閉じるボタン（レール見出し内・リスト件数行内）— アクセント色のピルで目立たせる */
.pane-close-btn {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  background: #eaf3fc; border: 1px solid #bcd9f4; font-size: 12px; font-weight: 700;
  color: var(--notam-accent); cursor: pointer; padding: 6px 13px;
  border-radius: var(--radius-pill);
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.pane-close-btn:hover {
  background: var(--notam-accent); border-color: var(--notam-accent);
  color: #fff; box-shadow: var(--shadow-sm);
}

/* 右：地図＋リスト */
/* min-height:0 が必須: モバイルで #notam-layout が縦フレックスになると、min-height:auto の
   ままでは #notam-main が全リスト(数百〜千件)の高さまで膨張し、地図が画面外へ伸びて真っ白に見える。 */
#notam-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
#notam-map { flex: 1 1 auto; min-height: 0; background: #dfe3e7; }
#notam-map .leaflet-container { font: inherit; }
#notam-map .leaflet-popup-content-wrapper { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

#notam-listwrap {
  flex: 0 0 38%; min-height: 120px; max-height: 46%;
  border-top: 1px solid var(--notam-line); background: var(--color-surface);
  overflow-y: auto; overscroll-behavior: contain;
  transition: flex-basis 0.2s ease, min-height 0.2s ease, max-height 0.2s ease;
}
.list-count {
  position: sticky; top: 0; z-index: 2; background: var(--color-surface);
  padding: 9px 14px; font-size: 12px; color: var(--color-muted);
  border-bottom: 1px solid var(--color-border); font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.notam-list { padding: 4px 0 16px; }

.notam-item {
  padding: 10px 14px; border-bottom: 1px solid #eef0ee; cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.notam-item:hover { background: var(--color-surface-alt); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.notam-item.active { background: var(--color-highlight-bg); border-left-color: var(--notam-accent); }
.ni-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.ni-id { font-size: 13px; font-weight: 700; color: var(--color-heading); }
.ni-badge {
  font-size: 10px; font-weight: 700; color: #fff; border-radius: var(--radius-pill);
  padding: 1px 7px; letter-spacing: 0.02em;
}
.ni-type { font-size: 10px; color: var(--color-muted-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 0 6px; }
.ni-nogeo {
  font-size: 10px; color: var(--color-muted-2); background: var(--color-surface-alt);
  border: 1px dashed var(--color-border-soft); border-radius: var(--radius-md); padding: 0 6px;
}
.ni-new {
  font-size: 10px; font-weight: 700; color: #fff; background: var(--notam-warn);
  border-radius: var(--radius-md); padding: 0 6px; letter-spacing: 0.03em;
}
.ni-pin {
  margin-left: auto; background: none; border: none; cursor: pointer; font-size: 15px; line-height: 1;
  color: var(--color-muted-2); padding: 0 2px;
}
.ni-pin.is-pinned { color: #e0a100; }
.ni-summary { font-size: 12px; color: var(--color-text); line-height: 1.45; }
.ni-meta { font-size: 11px; color: var(--color-muted-2); margin-top: 3px; }

/* リスト分割描画（さらに表示） */
.notam-list-more {
  display: block; width: calc(100% - 28px); margin: 8px 14px; padding: 9px;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface-alt); color: var(--notam-accent); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.notam-list-more:hover { background: var(--color-surface); }

/* 系列色（バッジ／ドット共通） */
.s-fir   { background: var(--notam-fir); }
.s-obst  { background: var(--notam-obst); }
.s-uav   { background: var(--notam-uav); }
.s-warn  { background: var(--notam-warn); }
.s-ad    { background: var(--notam-ad); }

/* 地図ポップアップ */
.notam-popup { font-size: 12px; max-width: 260px; }
.notam-popup .np-id { font-weight: 700; font-size: 13px; margin-bottom: 4px; color: var(--color-heading); }
.notam-popup .np-row { margin: 2px 0; color: var(--color-text); }
.notam-popup .np-detail {
  margin-top: 8px; background: var(--notam-accent); color: #fff; border: none; border-radius: var(--radius-md);
  padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background 0.15s;
}
.notam-popup .np-detail:hover { background: var(--notam-accent-dark); }

/* パネル開閉（完全に隠す方式） */
/* デスクトップ: レールをスライドで隠す（min-width:861px 限定でモバイルドロワーと衝突させない） */
@media (min-width: 861px) {
  #notam-rail { transition: margin-left 0.2s ease, visibility 0s; }
  #notam-layout.rail-collapsed #notam-rail {
    margin-left: -316px; visibility: hidden;
    transition: margin-left 0.2s ease, visibility 0s linear 0.2s;
  }
}
@media (max-width: 860px) {
  #notam-rail-collapse, #notam-rail-restore { display: none !important; }
}
/* リスト折りたたみ（全幅有効） */
#notam-layout.list-collapsed #notam-listwrap {
  flex-basis: 0; min-height: 0; max-height: 0; border-top: none; overflow: hidden;
}

/* 復帰ボタン（既定は非表示、collapsed 時のみ） */
#notam-rail-restore {
  display: none; position: absolute; top: 10px; left: 10px; z-index: 450;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-surface); border: 1px solid var(--color-border);
  font-size: 16px; color: var(--color-heading); cursor: pointer;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, transform 0.15s;
  align-items: center; justify-content: center;
}
#notam-layout.rail-collapsed #notam-rail-restore { display: flex; }
#notam-rail-restore:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* リスト復帰ボタン: 初期状態でリストが閉じているため、開けることが一目で
   伝わるよう大きめ・アクセントカラーで目立たせる（印刷ボタンと同系のスタイル）。 */
#notam-list-restore {
  display: none; align-items: center; gap: 8px;
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 450; padding: 12px 22px; border-radius: var(--radius-pill); border: none;
  background: var(--notam-accent); color: #fff; cursor: pointer;
  box-shadow: 0 3px 12px rgba(26, 111, 196, 0.4);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
#notam-layout.list-collapsed #notam-list-restore { display: flex; }
#notam-list-restore:hover {
  background: var(--notam-accent-dark); box-shadow: 0 4px 16px rgba(26, 111, 196, 0.5);
  transform: translateX(-50%) translateY(-2px);
}
.list-restore-arrow { font-size: 14px; line-height: 1; }
.list-restore-text { font-size: 14px; font-weight: 800; letter-spacing: 0.01em; }
.list-restore-count {
  font-size: 12px; font-weight: 700; background: rgba(255,255,255,0.25);
  border-radius: var(--radius-pill); padding: 2px 9px;
}
@media (max-width: 480px) {
  .list-restore-text { display: none; }
  #notam-list-restore { padding: 12px 18px; }
}

/* モバイル用フィルタトグル（既定は非表示、レール開閉オーバーレイ） */
.filter-toggle {
  display: none; position: absolute; top: 10px; left: 10px; z-index: 450;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  padding: 7px 16px; font-size: 13px; font-weight: 700; color: var(--color-text);
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.filter-toggle-count {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: var(--radius-pill);
  background: var(--notam-accent); color: #fff; font-size: 11px; font-weight: 700;
}
#notam-rail-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 900;
}

/* 鮮度ガード */
.notam-stale {
  padding: 8px 14px; font-size: 12px; font-weight: 700; text-align: center;
  background: var(--color-notice-bg); color: var(--color-notice-text); border-bottom: 1px solid var(--color-notice-border);
}
.notam-stale.is-critical { background: var(--color-warning-bg); color: var(--color-warning-text); border-bottom-color: var(--color-warning-border); }
#notam-map.is-dimmed::after {
  content: ''; position: absolute; inset: 0; z-index: 400;
  background: rgba(255,255,255,0.55); pointer-events: none;
}

/* NOTAMデコーダー（2タブ） */
#notam-detail-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 1500; align-items: center; justify-content: center; padding: 18px;
}
#notam-detail-overlay.visible { display: flex; animation: notam-fade 0.15s ease; }
#notam-detail-overlay.visible #notam-detail { animation: notam-pop 0.18s ease; }
#notam-detail {
  background: var(--color-surface); border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-md); position: relative;
}
#detail-close {
  position: absolute; top: 10px; right: 12px; background: none; border: none;
  font-size: 24px; line-height: 1; color: var(--color-muted-2); cursor: pointer; z-index: 2;
}
#detail-close:hover { color: var(--color-heading); }
#detail-header { padding: 20px 20px 12px; border-bottom: 1px solid var(--notam-line); }
.detail-head-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#detail-id { font-size: 18px; font-weight: 800; margin: 0; color: var(--color-heading); }
#detail-sub { font-size: 12px; color: var(--color-muted-2); margin-top: 5px; }
.detail-pin-btn {
  margin-left: auto; padding: 5px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-border); background: var(--color-surface-alt);
  font-size: 12px; font-weight: 700; color: var(--color-muted-2); cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.detail-pin-btn[aria-pressed="true"] { background: #fff6e0; border-color: #e0a100; color: #b57e00; }
.detail-copy-btn {
  margin-bottom: 12px; padding: 6px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-border); background: var(--color-surface-alt);
  font-size: 12px; font-weight: 700; color: var(--color-text); cursor: pointer;
  transition: background 0.15s;
}
.detail-copy-btn:hover { background: var(--color-surface); }
.detail-copy-btn:disabled { color: #178f6f; cursor: default; }

.detail-tabs { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--notam-line); }
.detail-tab {
  background: none; border: none; font-size: 14px; font-weight: 700; color: var(--color-muted-2);
  padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.detail-tab.active { color: var(--notam-accent); border-bottom-color: var(--notam-accent); }
.detail-body { overflow-y: auto; padding: 16px 20px 22px; }

.decode-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.decode-table th, .decode-table td {
  text-align: left; padding: 8px 6px; border-bottom: 1px solid #eef0ee; vertical-align: top;
}
.decode-table th { width: 34%; color: var(--color-muted-2); font-weight: 700; white-space: nowrap; }
.decode-table td { color: var(--color-text); }
.decode-note { font-size: 11px; color: var(--color-muted-2); margin-top: 14px; line-height: 1.6; }

.detail-raw {
  white-space: pre-wrap; font-family: var(--font-mono);
  font-size: 12px; color: var(--color-text); background: var(--color-surface-alt); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 12px; margin: 0 0 14px; line-height: 1.6;
}
.abbrev-title { font-size: 12px; font-weight: 700; color: var(--color-muted-2); margin: 0 0 8px; }
.abbrev-list { display: flex; flex-direction: column; gap: 5px; }
.abbrev-item { font-size: 12px; color: var(--color-text); }
.abbrev-item b { color: var(--notam-accent); font-family: var(--font-mono); }

/* 開発中のお知らせモーダル（表示制御は dismiss_popup.js が .visible を付与） */
#dev-notice-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 2000; align-items: center; justify-content: center; padding: 20px;
}
#dev-notice-overlay.visible { display: flex; animation: notam-fade 0.15s ease; }
#dev-notice {
  background: var(--color-surface); border-radius: var(--radius-lg); padding: 28px 24px 22px;
  max-width: 380px; width: 100%; text-align: center;
  box-shadow: var(--shadow-md); animation: notam-pop 0.18s ease;
}
#dev-notice-icon { font-size: 36px; line-height: 1; margin-bottom: 10px; }
#dev-notice-title { font-size: 18px; font-weight: 700; color: var(--color-heading); margin: 0 0 12px; }
#dev-notice-body { font-size: 13px; color: var(--color-muted); line-height: 1.7; margin: 0 0 22px; }
#dev-notice-actions { display: flex; flex-direction: column; gap: 10px; }
#dev-notice-close {
  font-size: 14px; font-weight: 700; color: #fff; background: var(--notam-accent);
  border: none; border-radius: var(--radius-md); padding: 11px 16px; cursor: pointer;
  transition: background 0.15s;
}
#dev-notice-close:hover { background: var(--notam-accent-dark); }
#dev-notice-dismiss {
  font-size: 13px; font-weight: 600; color: var(--color-muted); background: none; border: none;
  padding: 6px; cursor: pointer; text-decoration: underline;
}
#dev-notice-dismiss:hover { color: var(--color-heading); }

/* リスト再描画のフェードイン */
@keyframes notam-fade { from { opacity: 0; } }
@keyframes notam-pop  { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
.notam-list.is-refreshed { animation: notam-fade 0.15s ease; }

/* 印刷用コンテナ（画面では非表示） */
#notam-print-area, #notam-print-map-area { display: none; }

/* 画面側: 地図印刷（1件1ページ）準備中は専用エリアを全面表示してタイルを読み込む */
body.print-mode-mappages #notam-print-map-area {
  display: block; position: fixed; inset: 0; z-index: 3000;
  background: var(--color-bg); overflow: auto; padding: 14px;
}
body.print-mode-mappages #notam-layout { visibility: hidden; }
.pm-prep {
  width: 960px; max-width: 100%; margin: 0 auto 12px; padding: 10px 14px; box-sizing: border-box;
  background: var(--color-notice-bg); color: var(--color-notice-text);
  border: 1px solid var(--color-notice-border); border-radius: var(--radius-md);
  font-size: 13px; font-weight: 700; text-align: center;
}
.print-map-page {
  width: 984px; max-width: 100%; margin: 0 auto 14px; padding: 10px 12px 12px; box-sizing: border-box;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.pm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pm-badge {
  font-size: 10px; font-weight: 700; color: #fff; border-radius: var(--radius-pill);
  padding: 1px 8px; letter-spacing: 0.02em;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.pm-id { font-size: 14px; font-weight: 800; color: var(--color-heading); }
.pm-idx { margin-left: auto; font-size: 11px; color: var(--color-muted-2); }
.pm-sub { font-size: 12px; color: var(--color-text); line-height: 1.45; }
.pm-meta { font-size: 11px; color: var(--color-muted-2); margin: 2px 0 6px; }
.pm-canvas {
  width: 960px; height: 540px; border-radius: var(--radius-md);
  overflow: hidden; background: #dfe3e7;
}

/* 印刷: テキスト印刷 / 地図印刷（1件1ページ）の2モード（body クラスで切替） */
@media print {
  @page { size: A4 portrait; margin: 12mm 10mm; }

  /* 共通で隠すUI */
  #notam-banner, .filter-toggle, #notam-rail-overlay, #dev-notice-overlay,
  #notam-detail-overlay, #notam-stale, #notam-rail-restore, #notam-list-restore,
  .leaflet-control-container, .site-header, .site-footer { display: none !important; }

  /* テキスト印刷: print-area のみ表示 */
  body.print-mode-text #notam-layout { display: none !important; }
  body.print-mode-text, body.print-mode-text .site-main,
  body.print-mode-text #notam-wrapper {
    height: auto !important; overflow: visible !important; display: block !important;
  }
  body.print-mode-text #notam-print-area { display: block !important; }

  .print-head { margin-bottom: 5mm; }
  .print-title { font-size: 14pt; margin: 0 0 2mm; }
  .print-meta { font-size: 9pt; margin: 0 0 1mm; color: #333; }
  .print-item { display: flex; border: 1px solid #000; margin-bottom: 4mm; break-inside: avoid; }
  .print-raw {
    flex: 1 1 auto; margin: 0; padding: 3mm; border-right: 1px solid #000;
    font: 9pt/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: pre-wrap; word-break: break-word;
  }
  .print-side { flex: 0 0 34mm; padding: 3mm; }
  .print-id { font-weight: 700; font-size: 10.5pt; }

  /* 地図印刷（1件1ページ）: 準備エリアのみ表示、各ページで改ページ */
  body.print-mode-mappages #notam-layout, body.print-mode-mappages #notam-print-area { display: none !important; }
  body.print-mode-mappages, body.print-mode-mappages .site-main,
  body.print-mode-mappages #notam-wrapper {
    height: auto !important; overflow: visible !important; display: block !important;
  }
  body.print-mode-mappages #notam-print-map-area {
    display: block !important; position: static !important;
    padding: 0 !important; background: #fff !important;
  }
  .pm-prep { display: none !important; }
  .print-map-page {
    width: auto; max-width: none; margin: 0; padding: 0; border: none; box-shadow: none;
    break-inside: avoid; break-after: page; page-break-after: always;
  }
  .print-map-page:last-child { break-after: auto; page-break-after: auto; }
  .pm-head { margin-bottom: 2mm; }
  .pm-canvas {
    border: 1px solid #000; border-radius: 0;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}

@media (max-width: 860px) {
  #notam-layout { flex-direction: column; }
  #notam-rail {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000;
    width: 84%; max-width: 340px; flex-basis: auto;
    transform: translateX(-100%); transition: transform 0.22s ease;
    box-shadow: 2px 0 16px rgba(0,0,0,0.18);
  }
  #notam-rail.is-open { transform: translateX(0); }
  .filter-toggle { display: block; }
  #notam-listwrap { flex-basis: 42%; max-height: 42%; }
  #notam-banner { top: 10px; }
}

/* アニメーション抑制の配慮（サイト標準の踏襲） */
@media (prefers-reduced-motion: reduce) {
  #notam-rail, #notam-listwrap, .notam-item, .series-pill, .print-btn,
  #notam-rail-restore, #notam-list-restore, .pane-close-btn, .reset-btn,
  .route-btn, .filter-input, .detail-tab, .mode-pill, .notam-list-more,
  .detail-pin-btn, .detail-copy-btn { transition: none !important; }
  #notam-detail-overlay.visible, #notam-detail-overlay.visible #notam-detail,
  #dev-notice-overlay.visible, #dev-notice, .notam-list.is-refreshed { animation: none !important; }
}
