/* ============================================================
   map.css — 制限マップ本体スタイル
   デザイン: C — Aerial Pop
   注意: index.html の DOM 構造・クラス名・ID(dfm-*)は変更していない前提。
         このファイルは見た目のみを C トークンに合わせて全面書き直し。
   トークン運用:
     --accent は body クラスでモード切替する共通アクセント変数。
     既定(制限マップ)= --sky。body.mode-spot は spot.css 側で
     --accent を再定義しないため、ここで body.mode-spot { --accent: var(--pop) }
     を宣言し、.dfm-mode の active 配色などをオレンジに連動させる。
     （spot.css は別途 --spot 独自変数で .dfm-mode button.active を
       上書きしているが、後勝ちで問題なし。ここでは主に --accent を
       参照する他要素の一貫性のために切り替えておく。）
   ============================================================ */

:root {
  --ink: #222222;         /* 主文字(Airbnb 系のほぼ黒) */
  --ink-2: #717171;       /* 弱 */
  --ink-3: #B0B0B0;       /* 最弱 */
  --line: #EBEBEB;        /* 罫線 */
  --line-strong: #DDDDDD;
  --bg: #FFFFFF;
  --surface: #FFFFFF;

  --sky: #222222;         /* 制限マップ側アクセント = 黒(Airbnb の主ボタン) */
  --sky-press: #000000;
  --pop: #FF7A1A;         /* ドロスポッ!側アクセント(購入・選択のみ) */
  --pop-press: #E8650D;

  /* セマンティック(判定の視認性最優先・彩度は落ち着かせる) */
  --danger: #C13515;
  --warn: #B06000;
  --airport: #00787A;
  --ok: #008A05;

  --did: #C13515;
  --rz: #A32C12;
  --yz: #B06000;

  --r-card: 16px;
  --r-pill: 999px;
  --r-input: 10px;

  --shadow: 0 6px 16px rgba(0, 0, 0, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .08), 0 4px 12px rgba(0, 0, 0, .05);

  --accent: var(--sky);
  --accent-press: var(--sky-press);
}

/* ドロスポッ!モード: アクセントを橙に切替(トグル配色などが連動) */
body.mode-spot {
  --accent: var(--pop);
  --accent-press: var(--pop-press);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: .01em;
}
#map { position: fixed; inset: 0; }
button { font-family: inherit; }

/* ---- ブランド + マイ地点 + モード切替(独立フローティングピル群) ---- */
.dfm-topleft {
  position: fixed;
  top: calc(max(env(safe-area-inset-top), 10px));
  left: 12px;
  z-index: 10;
  display: flex; align-items: stretch; gap: 8px;
  flex-wrap: wrap;
}
.dfm-brand {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface);
  border: none;
  border-radius: var(--r-pill);
  padding: 9px 16px 9px 13px;
  box-shadow: var(--shadow-sm);
}
.dfm-mypl-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 0 15px;
  border: none; border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color .12s, box-shadow .12s;
}
.dfm-mypl-btn svg { color: var(--accent); flex-shrink: 0; }
.dfm-mypl-btn:hover { color: var(--ink); box-shadow: var(--shadow); }
/* 実ロゴの4リング(ローター)マークを SVG 化。色はモード連動(--accent) */
.dfm-brand-mark { display: block; color: var(--accent); flex-shrink: 0; }
.dfm-logo {
  font-weight: 800; font-size: 13.5px; color: var(--ink);
  text-transform: uppercase; letter-spacing: .1em;
  white-space: nowrap;
  margin: 0; /* h1 のデフォルト余白打ち消し(見た目は従来の span と同一) */
}
/* スクリーンリーダー・クローラー向け補足テキスト(視覚上は非表示) */
.dfm-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.dfm-brand-sub { font-weight: 600; font-size: 12px; color: var(--ink-3); }

/* ---- 言語切替(日本語 / EN) ---- */
/* 言語切替: 地球アイコン + ポップオーバー(2026-08-01 ピル2択から変更) */
.dfm-lang { position: relative; }
.dfm-lang-globe {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: none; border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: color .12s;
}
.dfm-lang-globe:hover { color: var(--ink); }
.dfm-lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 132px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 40;
}
.dfm-lang-menu a {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px;
  border-radius: 10px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  text-decoration: none; white-space: nowrap;
}
.dfm-lang-menu a:hover { background: var(--bg); color: var(--ink); }
.dfm-lang-menu a.active { color: var(--ink); }
.dfm-lang-menu a.active::after {
  content: ""; margin-left: auto;
  width: 10px; height: 6px;
  border-left: 2.2px solid var(--accent); border-bottom: 2.2px solid var(--accent);
  transform: rotate(-45deg) translateY(-1px);
}

/* ---- モード切替(制限マップ / ドロスポッ!) ---- */
.dfm-mode {
  display: flex;
  background: var(--surface);
  border: none;
  border-radius: var(--r-pill);
  padding: 4px;
  box-shadow: var(--shadow-sm);
  gap: 2px;
}
.dfm-mode button {
  height: 32px;
  padding: 0 15px;
  border: none; border-radius: var(--r-pill);
  background: none;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s, box-shadow .12s;
}
.dfm-mode button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 38%, transparent);
}
.dfm-mode button:not(.active):hover { color: var(--ink); }

/* ---- 右下コントロール(レイヤー+ベースマップ切替、Mapbox 帰属表示の上) ---- */
.dfm-controls {
  position: fixed;
  bottom: calc(max(env(safe-area-inset-bottom), 12px) + 24px);
  right: 12px;
  z-index: 10;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
/* 地図ツール折りたたみボタン: モバイル専用(640px メディア内で display:flex) */
.dfm-ctrl-fold { display: none; }
/* 3D日照の極小バー: モバイル没入モード専用(640px メディア内で表示) */
.dfm-s3-minibar { display: none; }

/* 出典・クレジット集約ダイアログ(モバイルで出典ⓘから開く) */
.dfm-attr-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 59;
}
.dfm-attr-modal {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 36px));
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  z-index: 60;
  overflow: hidden;
}
.dfm-attr-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  font-size: 14px; font-weight: 700; color: var(--ink);
}
.dfm-attr-modal-close {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: none; border-radius: var(--r-pill);
  background: var(--bg); color: var(--ink-2);
  cursor: pointer;
  position: relative;
}
.dfm-attr-modal-close::after { content: ""; position: absolute; inset: -8px; }
.dfm-attr-modal-body {
  padding: 0 16px 16px;
  font-size: 12.5px; line-height: 1.75; color: var(--ink-2);
}
.dfm-attr-modal-body p { margin: 0 0 10px; }
.dfm-attr-modal-body p:last-child { margin-bottom: 0; }
.dfm-attr-modal-body a { color: #0033cc; text-decoration: none; }
.dfm-attr-modal-body a:hover { text-decoration: underline; }
.dfm-basemap {
  display: flex;
  background: var(--surface);
  border: none;
  border-radius: var(--r-pill);
  padding: 4px;
  box-shadow: var(--shadow-sm);
}
.dfm-basemap button {
  height: 32px; padding: 0 15px;
  border: none; border-radius: var(--r-pill);
  background: none;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.dfm-basemap button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 38%, transparent);
}
.dfm-layers-btn {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px;
  border: none; border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color .12s, box-shadow .12s;
}
.dfm-layers-btn:hover { color: var(--ink); box-shadow: var(--shadow); }
.dfm-layers-body {
  background: var(--surface);
  border: none;
  border-radius: var(--r-card);
  padding: 8px;
  box-shadow: var(--shadow);
  width: 268px;
  /* 画面からはみ出さない: 右下アンカーから上方向の可視域に収め、超過分は内部スクロール */
  max-height: calc(100vh - 170px);
  max-height: calc(100dvh - 170px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
/* ---- レイヤーグループ(折りたたみ) ---- */
.dfm-lgroup { border-top: 1px solid var(--line); }
.dfm-lgroup:first-child { border-top: none; }
.dfm-lgroup-head {
  display: flex; align-items: center; gap: 7px;
  width: 100%;
  padding: 11px 10px;
  border: none; background: none;
  font-family: inherit;
  font-size: 13px; font-weight: 700; color: var(--ink);
  cursor: pointer;
  text-align: left;
  border-radius: 10px;
}
.dfm-lgroup-head:hover { background: var(--bg); }
/* グループ一括スイッチ(見出し左) */
.dfm-lgroup-sw {
  flex-shrink: 0;
  width: 34px; height: 20px;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  transition: background .15s ease;
}
.dfm-lgroup-sw i {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: left .15s ease;
}
.dfm-lgroup-sw.on { background: var(--ink); }
.dfm-lgroup-sw.on i { left: 16px; }
.dfm-lgroup-sw.mix { background: var(--ink-3); }
.dfm-lgroup-sw.mix i { left: 9px; }
.dfm-lgroup-count {
  margin-left: auto;
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.dfm-lgroup-chev { color: var(--ink-3); transition: transform .18s ease; }
.dfm-lgroup.open .dfm-lgroup-chev { transform: rotate(180deg); }
.dfm-lgroup-body { display: none; padding-bottom: 4px; }
.dfm-lgroup.open .dfm-lgroup-body { display: block; }

.dfm-layer-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px;
  cursor: pointer; user-select: none;
  font-size: 12.5px;
  border-radius: 12px;
  transition: background .12s;
}
.dfm-layer-row:hover { background: var(--bg); }
.dfm-layer-row input { width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.dfm-swatch { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.dfm-layer-name { line-height: 1.35; font-weight: 700; color: var(--ink); }
.dfm-layer-name small { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 500; margin-top: 1px; }

/* ---- 折りたたみコンパクトボタン(FAB) ---- */
.dfm-sheet-fab {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(max(env(safe-area-inset-bottom), 14px));
  z-index: 11;
  display: flex; align-items: center; gap: 9px;
  height: 56px; padding: 0 30px;
  border: none; border-radius: var(--r-pill);
  background: var(--ink);
  font-size: 15px; font-weight: 700; color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
  transition: box-shadow .12s, transform .12s;
}
.dfm-sheet-fab:hover { box-shadow: 0 10px 34px rgba(0,0,0,.32); transform: translateX(-50%) scale(1.03); }
.dfm-sheet-fab svg { color: #fff; }

/* ---- 下部操作カード(検索・判定) ---- */
.dfm-sheet-handle {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 22px;
  margin: -6px 0 4px;
  border: none; background: none;
  color: var(--ink-3);
  cursor: pointer;
}
.dfm-sheet-handle:hover { color: var(--ink-2); }
.dfm-sheet {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(max(env(safe-area-inset-bottom), 12px));
  z-index: 11;
  width: min(560px, calc(100vw - 20px));
  background: var(--surface);
  border: none;
  border-radius: var(--r-card);
  padding: 16px;
  box-shadow: var(--shadow);
}
.dfm-search-wrap { position: relative; }
.dfm-search-icon {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); pointer-events: none;
}
.dfm-search-wrap input {
  width: 100%; height: 48px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  padding: 0 18px 0 44px;
  font-size: 14.5px; font-weight: 500;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.dfm-search-wrap input::placeholder { color: var(--ink-3); font-weight: 500; }
.dfm-search-wrap input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.dfm-search-results {
  margin-top: 8px;
  background: #fff;
  border: none;
  border-radius: var(--r-input);
  overflow: hidden;
  max-height: 40vh; overflow-y: auto;
  box-shadow: var(--shadow-sm);
}
.dfm-search-results button {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 12px 15px;
  border: none; border-bottom: 1px solid var(--line);
  background: none; text-align: left;
  font-size: 13px; font-weight: 600; color: var(--ink);
  cursor: pointer;
}
.dfm-search-results button:last-child { border-bottom: none; }
.dfm-search-results button:hover { background: var(--bg); }
.dfm-search-results button { flex-direction: column; align-items: flex-start; gap: 1px; }
.dfm-sr-title { font-weight: 700; color: var(--ink); }
.dfm-sr-sub { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.dfm-search-results .dfm-noresult { padding: 12px 15px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }

.dfm-check-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px;
  margin-top: 10px;
  border: none; border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 15px; font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: background .12s, box-shadow .12s;
}
.dfm-check-btn:hover { background: var(--accent-press); }
.dfm-check-btn:active { background: var(--accent-press); }
.dfm-check-btn.loading { opacity: .85; pointer-events: none; }
/* 取得中は位置アイコンをスピナーに差し替えて「処理中」を明示する */
.dfm-check-btn.loading svg { display: none; }
.dfm-check-btn.loading::before {
  content: ""; width: 15px; height: 15px; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%;
  animation: dfm-spin .7s linear infinite;
}
@keyframes dfm-spin { to { transform: rotate(360deg); } }

/* ---- 非ブロッキング通知トースト(現在地取得エラー等) ---- */
.dfm-toast {
  position: fixed;
  left: 50%; transform: translateX(-50%) translateY(8px);
  bottom: calc(max(env(safe-area-inset-bottom), 12px) + 76px);
  z-index: 30;
  max-width: min(480px, calc(100vw - 32px));
  padding: 12px 16px;
  background: rgba(15,23,42,.94); color: #fff;
  font-size: 13px; line-height: 1.55;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.3);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.dfm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.dfm-legend {
  display: flex; justify-content: center; gap: 16px;
  margin-top: 13px; padding-top: 12px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.dfm-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--ink-2);
}
.dfm-legend-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dfm-guide-link {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  margin-top: 11px; padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  text-decoration: none;
}
.dfm-guide-link:hover { color: var(--ink); }
.dfm-guide-link svg { flex-shrink: 0; }

/* ---- マイ地点パネル(お気に入り・履歴) ---- */
.dfm-panel-backdrop {
  position: fixed; inset: 0; z-index: 29;
  background: rgba(11, 34, 57, .32);
}
.dfm-panel {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 30;
  width: min(340px, 86vw);
  background: var(--surface);
  box-shadow: 0 0 44px rgba(11, 34, 57, .24);
  transform: translateX(-105%);
  transition: transform .22s ease;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
.dfm-panel.open { transform: translateX(0); }
.dfm-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 12px 18px;
}
.dfm-panel-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.dfm-panel-close {
  width: 30px; height: 30px;
  border: none; border-radius: var(--r-pill);
  background: var(--bg); color: var(--ink-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.dfm-panel-close:hover { background: var(--line); }
.dfm-panel-tabs {
  display: flex; gap: 0;
  margin: 2px 14px 6px;
  background: var(--bg);
  border-radius: var(--r-pill);
  padding: 4px;
}
.dfm-panel-tabs button {
  flex: 1; height: 34px;
  border: none; border-radius: var(--r-pill);
  background: none;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.dfm-panel-tabs button.active {
  background: #fff; color: var(--accent);
  box-shadow: var(--shadow-sm);
}
/* 下端の padding はフッター非表示時(お気に入りタブ)のホームインジケーター回避分 */
.dfm-panel-list { flex: 1; overflow-y: auto; padding: 8px 8px calc(max(env(safe-area-inset-bottom), 8px)); }
.dfm-pl-row {
  display: flex; align-items: center;
  border-radius: 14px;
}
.dfm-pl-row:hover { background: var(--bg); }
.dfm-pl-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 11px 4px 11px 12px;
  border: none; background: none; text-align: left;
  cursor: pointer;
}
.dfm-pl-title {
  max-width: 100%;
  font-size: 13px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dfm-pl-sub {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--ink-3);
}
.dfm-pl-sub i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.dfm-pl-del {
  flex-shrink: 0;
  width: 32px; height: 32px;
  margin-right: 6px;
  border: none; border-radius: var(--r-pill);
  background: none; color: var(--ink-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.dfm-pl-del:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.dfm-panel-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px; line-height: 1.7;
}
.dfm-panel-empty svg { color: var(--line); margin-bottom: 10px; }
.dfm-panel-foot {
  padding: 11px 14px calc(max(env(safe-area-inset-bottom), 11px));
  border-top: 1px solid var(--line);
}
.dfm-panel-foot button {
  width: 100%; height: 40px;
  border: none; border-radius: var(--r-pill);
  background: var(--bg);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.dfm-panel-foot button:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }

/* ---- 判定結果シート ---- */
.dfm-result {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(max(env(safe-area-inset-bottom), 12px));
  z-index: 12;
  width: min(560px, calc(100vw - 20px));
  background: var(--surface);
  border: none;
  border-radius: var(--r-card);
  /* 縦に長い判定結果は画面内に収めて内部スクロール(モバイル対応) */
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow);
  animation: dfm-in .16s ease-out;
}
@keyframes dfm-in { from { transform: translateX(-50%) translateY(10px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
/* ---- モバイル: 判定シートのトップバー(ドラッグハンドル+★/共有/×)+三段スナップ ---- */
/* トップバーは sticky でシート可視域の上端に常に固定する。★/共有/×を absolute 単体で
   置くと内容と一緒にスクロールして iOS でシート外に「浮き出す」ため(2026-07-11 実機報告)、
   4つとも topbar の中に収める。PC では topbar は高さ0(ハンドル非表示・★/共有/×は従来位置)。 */
.dfm-result-topbar { position: relative; height: 0; }
.dfm-result-handle { display: none; }
@media (max-width: 640px) {
  .dfm-result-topbar {
    position: sticky; top: 0;
    height: 40px;
    background: var(--surface);
    border-radius: var(--r-card) var(--r-card) 0 0;
    z-index: 3;
  }
  .dfm-result-handle {
    display: flex; align-items: center; justify-content: center;
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    margin: 0; padding: 0;
    border: none; background: none;
    cursor: grab;
    touch-action: none;
  }
  .dfm-result-handle i {
    width: 40px; height: 4px; border-radius: 999px;
    background: #CBD5E1;
  }
  /* ★/共有/×はトップバー行内の右側(topbar が基準になるので top は行内オフセット)。
     ※ 基底ルール(.dfm-result-fav{top:12px})が後方にあるため親付きで詳細度を上げる。 */
  .dfm-result .dfm-result-fav,
  .dfm-result .dfm-result-share,
  .dfm-result .dfm-result-close { top: 5px; z-index: 2; }
  .dfm-result { transition: height .28s cubic-bezier(.32,.72,0,1), transform .22s ease; }
  .dfm-result.dragging { transition: none; }
}
.dfm-result-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px;
  border: none; border-radius: var(--r-pill);
  background: rgba(255,255,255,.75); color: var(--ink-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: background .12s;
}
.dfm-result-close:hover { background: #fff; }
/* 判定地点の共有ボタン(Web Share API、非対応環境はリンクをコピー) */
.dfm-result-share {
  position: absolute; top: 12px; right: 54px;
  width: 30px; height: 30px;
  border: none; border-radius: var(--r-pill);
  background: rgba(255,255,255,.75); color: var(--ink-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: background .12s, color .12s, opacity .12s;
}
.dfm-result-share:hover { background: #fff; color: var(--accent); }
.dfm-result-share:disabled { opacity: .42; cursor: default; }
/* お気に入り保存(★)ボタン */
.dfm-result-fav {
  position: absolute; top: 12px; right: 96px;
  width: 30px; height: 30px;
  border: none; border-radius: var(--r-pill);
  background: rgba(255,255,255,.75); color: var(--ink-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: background .12s, color .12s;
}
.dfm-result-fav svg { fill: none; }
.dfm-result-fav:hover { background: #fff; }
.dfm-result-fav.active { background: #FFF1E2; color: var(--pop); }
.dfm-result-fav.active svg { fill: currentColor; }
/* 3ボタンは30px角で隣接するため、見た目を変えずタップ判定だけ約42pxに拡張 */
.dfm-result-fav::before, .dfm-result-share::before, .dfm-result-close::before {
  content: ""; position: absolute; inset: -6px;
}
/* 上部ステータスバー(重大度で色分け・セマンティック色を維持) */
.dfm-result-head {
  padding: 20px 24px 16px;
  background: color-mix(in srgb, var(--sev, #999999) 7%, #FFFFFF);
}
.dfm-result-head.sev-4 { --sev: var(--rz); }
.dfm-result-head.sev-3 { --sev: var(--airport); }
.dfm-result-head.sev-2 { --sev: var(--did); }
.dfm-result-head.sev-1 { --sev: var(--yz); }
.dfm-result-head.sev-0 { --sev: var(--ok); }
/* サーバー全量判定の待機中ヘッダーと海域専用ヘッダー(2026-07-10) */
.dfm-result-head.sev-judging { --sev: #64748B; }
.dfm-result-head.sev-judging .dfm-result-title::after {
  content: ""; display: inline-block; vertical-align: -2px;
  width: 14px; height: 14px; margin-left: 8px;
  border: 2px solid #CBD5E1; border-top-color: #64748B;
  border-radius: 50%;
  animation: dfm-spin .7s linear infinite;
}
.dfm-result-head.sev-sea { --sev: #0369A1; }
.dfm-result-status { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--sev); }
.dfm-result-title { font-size: 20px; font-weight: 700; line-height: 1.35; margin-top: 4px; color: var(--ink); letter-spacing: -.01em; }
.dfm-result-place { font-size: 13px; color: var(--ink-2); font-weight: 400; margin-top: 4px; }
.dfm-result-rows { padding: 16px 24px 4px; display: flex; flex-direction: column; gap: 14px; }
.dfm-result-row {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14px; line-height: 1.55;
}
.dfm-result-row .dfm-chip {
  flex-shrink: 0; margin-top: 1px;
  font-size: 11.5px; font-weight: 700;
  color: var(--c, var(--ink-2));
  padding: 4px 10px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--c, var(--ink-2)) 9%, #fff);
  white-space: nowrap;
}
.dfm-result-row .dfm-row-body { color: var(--ink); font-weight: 600; }
.dfm-result-row .dfm-row-body strong { color: var(--ink); font-weight: 800; }
.dfm-result-row .dfm-row-body small { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 400; margin-top: 3px; line-height: 1.6; }
/* 空港高さ制限 */
.dfm-heights {
  margin: 2px 0;
  border: none;
  background: #F7F7F7;
  border-radius: 12px;
  padding: 14px 16px;
}
/* 「下にまだ内容がある」スクロール指引(シート可視域の下端に sticky 表示) */
.dfm-scroll-hint {
  position: sticky;
  bottom: 0;
  height: 34px;
  margin-top: -34px;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 5px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--surface) 72%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
  z-index: 2;
}
.dfm-scroll-hint.show { opacity: 1; }
.dfm-scroll-hint svg {
  color: var(--ink-3);
  animation: dfm-hint-bob 1.6s ease-in-out infinite;
}
@keyframes dfm-hint-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .dfm-scroll-hint svg { animation: none; } }

/* 条例行の「要確認」バッジ(2026-07-11 上長要望: 小さい注記を読まなくても目に入るように) */
.dfm-badge-check {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #DC2626;
  border-radius: 999px;
  vertical-align: 1px;
  letter-spacing: .04em;
  white-space: nowrap;
}
/* 撮影できるまでの目安カード(2026-07-11) */
.dfm-leadtime {
  margin: 2px 0;
  background: #F7F7F7;
  border-radius: 12px;
  padding: 14px 16px;
}
.dfm-leadtime-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.dfm-leadtime-main { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.dfm-leadtime-foot { margin-top: 6px; font-size: 12px; color: var(--ink-2); font-weight: 400; }
.dfm-leadtime.lt-ng { background: #FEF2F2; }
.dfm-leadtime.lt-ng .dfm-leadtime-main { color: #991B1B; }
.dfm-leadtime.lt-ok { background: #F0FDF4; }
.dfm-leadtime.lt-ok .dfm-leadtime-main { color: #15803D; }
/* DROLIEN 導線(さらに控えめ版 2026-07-11: 淡い背景のみの通常テキスト) */
.dfm-drolien-cta {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0 2px;
  padding: 8px 10px;
  background: #FFF7ED;
  border: none;
  border-radius: 8px;
  color: #9A3412;
  text-decoration: none;
  transition: background .12s ease;
}
.dfm-drolien-cta:hover { background: #FFEDD5; }
.dfm-drolien-cta:active { background: #FFEDD5; }
.dfm-drolien-cta-bolt { display: none; }
.dfm-drolien-cta-text { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dfm-drolien-cta-text strong { font-size: 12px; font-weight: 600; letter-spacing: -.01em; }
.dfm-drolien-cta-text small { font-size: 10.5px; font-weight: 400; color: #B45309; }
.dfm-drolien-cta-arrow { font-weight: 600; font-size: 12px; flex-shrink: 0; color: #C2703D; }
/* 公式LINE 導線(高さ制限カード内。2026-07-16 17:38 上長判断: 推し色を使わない控えめ版) */
.dfm-line-cta {
  display: inline-block;
  margin: 8px 0 2px;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: background .12s ease;
}
.dfm-line-cta:hover { background: #F2F2F2; }
.dfm-line-cta:active { background: #ECECEC; }
/* 飛行禁止(RZ)判定の受け皿導線(2026-08-19 サイト監査対応。控えめトーン) */
.dfm-ng-next { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #FECACA; display: flex; flex-direction: column; gap: 5px; }
.dfm-ng-next-title { font-size: 11.5px; font-weight: 600; color: #7F1D1D; }
.dfm-ng-next-link { display: block; font-size: 12px; color: #9A3412; text-decoration: underline; text-underline-offset: 2px; }
.dfm-ng-next-link:hover { color: #C2410C; }
.dfm-heights:empty { display: none; }
.dfm-heights-loading { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.dfm-heights-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.dfm-height-main { font-size: 13px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.dfm-height-main strong { font-size: 24px; color: var(--ink); font-weight: 700; letter-spacing: -.02em; }
.dfm-height-amsl { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.dfm-heights-foot { margin-top: 6px; font-size: 12px; color: var(--ink-2); font-weight: 400; }

/* 広域ズーム時の概算注意行(map.js が #resultBody 内に注入) */
.dfm-result-approx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 24px 0;
  padding: 10px 12px 10px 14px;
  background: #F7F7F7;
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
  line-height: 1.5;
}
.dfm-result-approx button {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.dfm-result-approx button:hover { background: #F7F7F7; }
.dfm-result-approx button:active { transform: scale(.97); }

.dfm-result-note {
  margin: 12px 24px 20px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2); font-weight: 400; line-height: 1.7;
  line-height: 1.55;
}
.dfm-result-note a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.dfm-result-note a:hover { text-decoration: underline; }

/* ---- 緊急用務空域 警告バナー ---- */
.dfm-emergency-bar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  top: calc(max(env(safe-area-inset-top), 10px) + 52px);
  z-index: 30;
  max-width: min(680px, calc(100vw - 24px));
  padding: 10px 16px;
  border-radius: 12px;
  background: #C13515;
  color: #fff;
  font-size: 13px; line-height: 1.55;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(193, 53, 21, .45);
}
.dfm-emergency-bar strong { font-weight: 800; }

/* ---- 出典 ---- */
.dfm-attribution {
  position: fixed;
  bottom: 2px; left: 4px;
  z-index: 5;
  font-size: 9px; color: var(--ink-3);
  background: rgba(255,255,255,.7);
  padding: 1px 6px; border-radius: 4px;
  pointer-events: none;
}
/* YOLP 規約必須のクレジット(出典行に常駐)。リンクだけクリック可能にする */
.dfm-attribution a { pointer-events: auto; color: #0033cc; text-decoration: none; }
.dfm-attribution a:hover { text-decoration: underline; }
/* モバイルでは Mapbox の attribution と同じ折りたたみ式: 既定は ⓘ のみ、タップで展開 */
.dfm-attr-toggle {
  display: none;
  width: 18px; height: 18px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--ink-3);
  font: italic bold 11px Georgia, 'Times New Roman', serif;
  padding: 0; vertical-align: middle;
  pointer-events: auto; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06);
  position: relative;
}
/* 18px の見た目のままタップ領域だけ 44px 級へ拡大(指で押せない報告対応) */
.dfm-attr-toggle::after {
  content: '';
  position: absolute;
  inset: -13px;
}
@media (max-width: 640px) {
  .dfm-attribution { background: none; padding: 0; }
  .dfm-attribution .dfm-attr-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .dfm-attribution .dfm-attr-text { display: none; }
  .dfm-attribution.open { background: rgba(255,255,255,.85); padding: 1px 6px; }
  .dfm-attribution.open .dfm-attr-text { display: inline; }
}

.mapboxgl-ctrl-bottom-right { bottom: 8px; }
.mapboxgl-ctrl-bottom-left { margin-bottom: 14px; }

/* ============================================================
   選点モード(?picker=1 — ドロノートアプリの WKWebView 埋め込み専用)
   通常ブラウザでは body に .dfm-picker が付かないため、
   このブロックは一切影響しない(map.js 側で query 検出時のみ付与)。
   ============================================================ */
body.dfm-picker .dfm-topleft,           /* 左上一式(ロゴ・マイ地点・モード切替) — native シート側にタイトルがあるため冗長 */
body.dfm-picker .dfm-layer-row.dfm-review-row,  /* みんなの飛行情報チェック行(map.js が起動時にこの class を付与) */
body.dfm-picker #checkHereBtn {         /* 検索カード内「現在地で判定」— 独立の現在地円ボタンが #checkHereBtn.click() を
                                           代理起動するため表示は冗長。display:none でもプログラム的 click は発火し、
                                           回調側にも可視性依存なし(検証済み)。検索欄と凡例は残す */
  display: none !important;
}

/* 選点モード時は pickerBar を最下段の最前面固定バーとして敷く。
   iPhone の home indicator を避けるため bottom は 12px + safe-area
   (index.html は viewport-fit=cover 済み)。コンパクト設計: 実高 ≈ 56px */
.dfm-picker-bar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
  width: min(560px, calc(100vw - 20px));
  display: flex; align-items: center; gap: 10px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-card);
  padding: 10px 12px 10px 14px;
  box-shadow: var(--shadow);
}
.dfm-picker-info { flex: 1; min-width: 0; }
.dfm-picker-name {
  font-size: 12.5px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dfm-picker-coord {
  margin-top: 2px;
  font-size: 10.5px; font-weight: 500; color: rgba(255,255,255,.62);
  font-variant-numeric: tabular-nums;
}
.dfm-picker-coord:empty { display: none; }
.dfm-picker-confirm {
  flex-shrink: 0;
  height: 36px; padding: 0 14px;
  border: none; border-radius: var(--r-pill);
  background: #fff; color: var(--ink);
  font-size: 12.5px; font-weight: 700;
  cursor: pointer;
  transition: opacity .12s, background .12s;
}
.dfm-picker-confirm:disabled {
  opacity: .38;
  cursor: default;
}
.dfm-picker-confirm:not(:disabled):hover { background: #F0F0F0; }

/* display:flex の作者スタイルは UA の [hidden]{display:none} に勝ってしまうため、
   hidden 属性時は明示的に非表示へ(通常モードで pickerBar が出ないための必須規則) */
.dfm-picker-bar[hidden],
.dfm-picker-locate[hidden] { display: none !important; }

/* ---- 現在地フローティングボタン(picker モード専用) ----
   右列スタック(下から): mapbox帰属(i) = ctrl bottom 74 + 自前 margin 10 + 高さ24 ≈ 84〜108px
   → 本ボタン 118〜162px((i) と 10px 間隔) → レイヤー群 172px〜(本ボタンと 10px 間隔) */
.dfm-picker-locate {
  position: fixed;
  right: 12px;
  bottom: calc(118px + env(safe-area-inset-bottom));
  z-index: 13;
  width: 44px; height: 44px;
  border: none; border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color .12s, box-shadow .12s, opacity .12s;
}
.dfm-picker-locate:hover { box-shadow: var(--shadow); }
.dfm-picker-locate:active { transform: scale(.94); }
.dfm-picker-locate.busy { opacity: .55; pointer-events: none; }
.dfm-picker-locate.shake { animation: dfm-picker-shake .4s ease; }
@keyframes dfm-picker-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* 初期ヒント文言: 狭幅(スマホ)では短文に切替(選点後は JS が実地名で上書き) */
.dfm-picker-hint-short { display: none; }
@media (max-width: 430px) {
  .dfm-picker-hint-long { display: none; }
  .dfm-picker-hint-short { display: inline; }
}

/* ---- 選点モードの下部スタック再配置 ----
   pickerBar(高さ≈56px)が最下段に常駐するため、picker モード時のみ
   下から pickerBar → 出典 → 検索FAB/操作カード/判定結果 → レイヤー・ベースマップ
   の順に積み上げる。各要素の position/z-index/表示ロジックは変更せず
   bottom オフセットだけを上書きする。出典(法的表示)は遮蔽厳禁。 */

/* 出典: pickerBar の直上(左寄せのまま) */
body.dfm-picker .dfm-attribution {
  bottom: calc(74px + env(safe-area-inset-bottom));
  left: 10px;
}

/* 検索・判定 FAB / 操作カード / 判定結果シート: 出典の上 */
body.dfm-picker .dfm-result,
body.dfm-picker .dfm-sheet,
body.dfm-picker .dfm-sheet-fab {
  bottom: calc(98px + env(safe-area-inset-bottom));
}

/* レイヤー・ベースマップ切替: FAB(高さ50px・〜148px)と現在地円ボタン(〜162px)のさらに上。
   通常モードの @media 480px 規則(+62px)より特異性が高いため常に勝つ */
body.dfm-picker .dfm-controls {
  bottom: calc(172px + env(safe-area-inset-bottom));
}

/* Mapbox スケール(左)・帰属 (i)(右)も pickerBar と重なるため同じ 74px 層へ退避。
   左のスケールは既存の margin-bottom:14px が加算され出典(高さ≈15px)の真上に載る */
body.dfm-picker .mapboxgl-ctrl-bottom-left,
body.dfm-picker .mapboxgl-ctrl-bottom-right {
  bottom: calc(74px + env(safe-area-inset-bottom));
}

@media (max-width: 480px) {
  /* スマホはピンチズームで足りるため +/- コントロールを非表示(上部の混雑解消) */
  .mapboxgl-ctrl-top-right { display: none; }

  /* 上部を2段構成に固定:
     1段目 = ブランド(左) + マイ地点アイコン(右端)
     2段目 = モード切替
     ::after を全幅ブレーク(order:1)として挿入し、.dfm-mode(order:2)を強制改行 */
  .dfm-topleft { left: 10px; right: 10px; gap: 8px; flex-wrap: nowrap; }
  /* R3-4: 1行整列 [ロゴ][モード(通常は⇄に折りたたみ)]……[マイ地点][全国] */
  .dfm-mode { order: 1; }

  .dfm-brand { height: 38px; padding: 0 14px 0 12px; }
  .dfm-logo { font-size: 13px; }
  /* 「飛行制限マップ」はモード切替の「制限マップ」と重複するため非表示 */
  .dfm-brand-sub { display: none; }

  /* マイ地点は星アイコンのみの円形ボタンにして右端へ */
  .dfm-mypl-label { display: none; }
  .dfm-mypl-btn {
    position: absolute; right: 0; top: 0; /* 全国(right:10,W約46)の左隣・ロゴ行と天地揃え */
    margin: 0;
    width: 38px; height: 38px; padding: 0;
    justify-content: center;
    transition: opacity .25s ease;
  }
  /* モード展開中(初期3秒/再展開時)は右側を退避して幅を譲る */
  body.dfm-mode-open .dfm-mypl-btn,
  body.dfm-mode-open .dfm-reset-btn { opacity: 0; pointer-events: none; }

  /* spot.css(後読み)の .dfm-mode button に勝つため親付きセレクタで特異性を上げる */
  .dfm-topleft .dfm-mode button { height: 30px; padding: 0 14px; font-size: 12px; }

  /* レイヤー/ベースマップは「検索・判定」FAB(高さ50px)の上に退避して重なり解消 */
  .dfm-controls { bottom: calc(max(env(safe-area-inset-bottom), 12px) + 62px); }

  /* 全国ボタンのtopはファイル末尾の@mediaで上書き(基礎規則 top:88px との後勝ち競合を避けるため) */
  .dfm-reset-btn { transition: opacity .25s ease; }

  .dfm-legend { gap: 8px 12px; }
}

/* iOS: font-size<16px の input は focus 時にページ全体が自動ズームされるため 16px に統一(全モード共通) */
.dfm-search-wrap input { font-size: 16px; }

/* 選点モード: ログイン導線を全て隠す(お気に入り保存・ログインモーダル)。
   アプリ内選点でドロマップ単独のログインを見せない。ログイン連携は dlsess ブリッジ(Phase2.5)側で行う */
body.dfm-picker #resultFav { display: none !important; }
body.dfm-picker .dfm-auth-overlay { display: none !important; }

/* ============================================================
 * マイマップ / 共有マップ(dromap-mymap.js が追加する要素のスタイル)
 * 命名は dmm- プレフィックスで既存の dfm-/dspot- と衝突しないようにする。
 * ============================================================ */

/* --- マーカー(マイマップ・共有マップ共通) --- */
.dmm-marker {
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  border: 2px solid #fff;
  cursor: pointer;
}
.dmm-marker-spot { background: #7C3AED; } /* 紫系 = スポット */
.dmm-marker-log {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: none;
  background: #64748B; /* 灰蓝系 = 履歴 */
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  border: 2px solid #fff;
}

/* --- 軽量詳細シート(マイマップ・共有マップの地点タップ時) --- */
.dmm-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(420px, 100vw);
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface, #fff);
  border-radius: var(--r-card, 16px) var(--r-card, 16px) 0 0;
  box-shadow: var(--shadow, 0 6px 16px rgba(0, 0, 0, .12));
  padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
  z-index: 60;
  box-sizing: border-box;
}
.dmm-sheet[hidden] { display: none; }
.dmm-sheet-drag {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong, #ddd);
  margin: 0 auto 10px;
}
.dmm-sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--bg, #f5f5f5);
  color: var(--ink-2, #717171);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.dmm-name { font-weight: 800; font-size: 16px; color: var(--ink, #222); margin-right: 30px; }
.dmm-meta { font-size: 12px; color: var(--ink-2, #717171); margin-top: 2px; }
.dmm-desc { font-size: 13px; color: var(--ink, #222); line-height: 1.5; margin-top: 8px; white-space: pre-wrap; }
.dmm-photos {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 10px;
  -webkit-overflow-scrolling: touch;
}
.dmm-photo {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--bg, #f5f5f5);
}
.dmm-cta-row { margin-top: 12px; }
.dmm-cta-primary {
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 11px 16px;
  border-radius: var(--r-pill, 999px);
  background: var(--pop, #FF7A1A);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

/* --- スポット詳細シート内「この地点で飛行計画を作成」ボタン(spot.js の既存 CTA に揃える) --- */
.dmm-plan-cta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  margin-top: 8px;
  padding: 11px 16px;
  border-radius: var(--r-pill, 999px);
  background: var(--sky, #222);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

/* --- 共有マップモード(?share=<token>) --- */
.dmm-share-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 55;
  background: var(--surface, #fff);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.08));
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dmm-share-title { font-weight: 800; font-size: 14px; color: var(--ink, #222); }
.dmm-share-note { font-size: 11.5px; color: var(--ink-2, #717171); }
.dmm-share-banner-error {
  color: #B42318;
  font-weight: 700;
  font-size: 13px;
}
.dmm-share-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  background: var(--ink, #222);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  text-align: center;
}
.dmm-share-footer a {
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}

/* 共有マップモードでは自分の地点編集・モード切替・評価まわりの導線を隠す(picker と同じ手法) */
body.dfm-share .dfm-topleft { display: none !important; }
body.dfm-share .dfm-panel-backdrop,
body.dfm-share .dfm-panel { display: none !important; }
body.dfm-share .dfm-auth-overlay { display: none !important; }
body.dfm-share .dmm-layer-row { display: none !important; } /* 共有マップ自体がマイマップの読み取り専用ビューのため */
/* 上部バナー・下部フッターの分だけ操作カード/コントロールを避ける */
body.dfm-share .dfm-controls { bottom: calc(max(env(safe-area-inset-bottom), 12px) + 46px); }

/* ---- 日の出・日の入り+夜間飛行注意 ---- */
.dfm-sun { margin: 0 0 10px; padding: 12px 14px; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; }
.dfm-sun-times { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; font-size: 13.5px; color: #0F172A; }
.dfm-sun-times strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.dfm-sun-day { font-size: 11px; color: #94A3B8; margin-left: auto; }
.dfm-sun small { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.55; color: #64748B; }
.dfm-sun.night { background: #FFF7ED; border-color: #FED7AA; }
.dfm-sun.night small strong { color: #C2410C; }

/* ---- 天気・風の予報 ---- */
.dfm-weather { margin: 0; }
.dfm-weather:empty { margin: 0; }
.dfm-wx-loading { font-size: 12px; color: #94A3B8; padding: 8px 0; }
.dfm-wx-head { font-size: 12.5px; font-weight: 700; color: #0F172A; margin-bottom: 2px; display: flex; align-items: baseline; gap: 8px; }
.dfm-wx-head span { font-size: 11px; font-weight: 500; color: #94A3B8; }
.dfm-wx-row { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-top: 1px solid #F1F5F9; font-size: 13px; }
.dfm-wx-row:first-of-type { border-top: none; }
.dfm-wx-day { flex: 0 0 54px; font-weight: 600; color: #0F172A; font-size: 12.5px; }
.dfm-wx-cond { flex: 1 1 auto; min-width: 0; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dfm-wx-temp { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: #0F172A; }
.dfm-wx-temp em { font-style: normal; color: #94A3B8; font-size: 11.5px; }
.dfm-wx-pop { flex: 0 0 36px; text-align: right; font-variant-numeric: tabular-nums; color: #0369A1; font-size: 12px; }
.dfm-wx-wind { flex: 0 0 auto; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: #0F172A; }
.dfm-wx-wind small { font-weight: 500; font-size: 10px; color: #64748B; margin-left: 1px; }
.dfm-wx-wind em { font-style: normal; font-weight: 500; font-size: 10px; color: #94A3B8; margin-left: 3px; }
.dfm-wx-wind.wx-warn { color: #B45309; }
.dfm-wx-wind.wx-danger { color: #DC2626; }
.dfm-wx-lock { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; padding: 9px 12px; border: 1.5px dashed #CBD5E1; border-radius: 10px; background: #F8FAFC; color: #475569; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.dfm-wx-lock:hover { border-color: #94A3B8; color: #0F172A; }
.dfm-wx-foot { margin-top: 7px; font-size: 10.5px; color: #94A3B8; line-height: 1.5; }
.dfm-wx-foot a { color: inherit; }

/* ---- マイ地点: 未登録クォータ表示 ---- */
.dfm-pl-quota { margin: 10px 4px 2px; padding: 10px 12px; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 10px; font-size: 12px; color: #64748B; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dfm-pl-quota button { border: none; background: #0F172A; color: #fff; font-size: 11.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.dfm-panel-empty-note { font-size: 11px; color: #94A3B8; }

/* ---- 天気パネル(右下・独立UI) ---- */
.dfm-wx-body {
  background: var(--surface);
  border: none;
  border-radius: var(--r-card);
  padding: 14px;
  box-shadow: var(--shadow);
  width: min(324px, calc(100vw - 24px));
  max-height: calc(100vh - 170px);
  max-height: calc(100dvh - 170px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.dfm-wx-place-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.dfm-wx-place { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-right: auto; }
/* 3D日照の「終了」(×はパネル収納なので、モード終了は明示ボタンで) */
.dfm-s3-exit {
  height: 26px; padding: 0 12px;
  border: none; border-radius: var(--r-pill);
  background: #F1F5F9; color: #64748B;
  font-size: 12px; font-weight: 700; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  position: relative;
}
.dfm-s3-exit:hover { background: #E2E8F0; color: var(--ink); }
.dfm-s3-exit::after { content: ""; position: absolute; inset: -8px; }
.dfm-wx-close { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: none; border-radius: 50%; background: #F1F5F9; color: #64748B; cursor: pointer; }
.dfm-wx-close:hover { background: #E2E8F0; color: var(--ink); }
.dfm-wx-body .dfm-wx-row { gap: 6px; }

/* ---- 3D日照シミュレーション(建物の影) ---- */
.dfm-layers-btn.active { background: var(--accent); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 38%, transparent); }
.dfm-layers-btn.active svg { color: #fff; }
.dfm-s3-hud { padding: 11px 12px; border-radius: 12px; background: linear-gradient(135deg, #FFF6E5 0%, #FFEFD6 100%); border: 1px solid #FCD9A0; }
.dfm-s3-hud.night { background: linear-gradient(135deg, #EEF2FB 0%, #E4EAF7 100%); border-color: #CBD5E1; }
.dfm-s3-time { display: flex; align-items: center; gap: 8px; }
.dfm-s3-time strong { font-size: 24px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.5px; line-height: 1.1; }
.dfm-s3-badge { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.85); color: #B06000; }
.dfm-s3-hud.night .dfm-s3-badge { color: #475569; }
.dfm-s3-pos { margin-top: 5px; font-size: 12.5px; color: #6B4A12; line-height: 1.5; }
.dfm-s3-hud.night .dfm-s3-pos { color: #475569; }
.dfm-s3-pos b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.dfm-s3-sun { margin-top: 4px; font-size: 11.5px; color: #94794A; font-variant-numeric: tabular-nums; }
.dfm-s3-hud.night .dfm-s3-sun { color: #7C8AA6; }
.dfm-s3-sun b { color: var(--ink); font-weight: 700; }
/* スライダー: 素の input[range] は軌道が細く thumb も小さくて掴めない(実機指摘)
   → 自前描画で当たり判定 36px・thumb 26px に拡大。進捗色は --p(JS が更新) */
.dfm-s3-slider {
  display: block; width: 100%; margin: 8px 0 0;
  height: 36px;
  -webkit-appearance: none; appearance: none;
  background: transparent;
}
.dfm-s3-slider::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, #E8860C var(--p, 0%), #E2E8F0 var(--p, 0%));
}
.dfm-s3-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: #E8860C; border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
  margin-top: -10px;
}
.dfm-s3-slider::-moz-range-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, #E8860C var(--p, 0%), #E2E8F0 var(--p, 0%));
}
.dfm-s3-slider::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: #E8860C; border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
}
.dfm-s3-ticks { display: flex; justify-content: space-between; margin-top: 2px; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dfm-s3-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.dfm-s3-date { flex: 1 1 auto; min-width: 0; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-input); font-family: inherit; font-size: 12.5px; color: var(--ink); background: #fff; }
.dfm-s3-now { flex: 0 0 auto; padding: 8px 14px; border: none; border-radius: var(--r-input); background: var(--ink); color: #fff; font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.dfm-s3-now:hover { background: #000; }
.dfm-s3-foot { margin-top: 9px; font-size: 10.5px; line-height: 1.55; color: var(--ink-3); }
.dfm-s3-warn { color: var(--warn); font-weight: 600; }

/* ---- この地点で飛行する(アプリへ計画引き継ぎ) ---- */
.dfm-fly-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: calc(100% - 48px); margin: 14px 24px 0;
  padding: 13px 16px; border: none; border-radius: 999px;
  background: #0F172A; color: #fff; font-size: 13.5px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
  transition: background .12s;
}
.dfm-fly-cta:hover { background: #1E293B; }

/* 判定行のチップと本文1行目の縦位置合わせ(2026-07-09 指摘対応):
   チップ実高をタイトル行高(約21.7px)に揃え、上端マージンを撤去 */
.dfm-result-row .dfm-chip { margin-top: 0.5px; padding: 3px 10px; line-height: 15px; }

/* 全国リセットボタン(NavigationControl 直下・2026-07-09) */
.dfm-reset-btn {
  position: absolute; top: 88px; right: 10px; z-index: 5;
  padding: 8px 13px; background: #fff; border: none; border-radius: var(--r-pill, 999px);
  font-size: 12.5px; font-weight: 700; color: var(--ink, #222);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .14); cursor: pointer;
}
.dfm-reset-btn:active { transform: scale(.96); }
/* 選点・共有モードでは非表示(局所ビューが前提のため) */
body.dfm-picker .dfm-reset-btn, body.dfm-share .dfm-reset-btn { display: none; }

/* 検索実行ボタン(検索欄内の右端・2026-07-09) */
.dfm-search-wrap { position: relative; }
.dfm-search-wrap input { padding-right: 76px; }
.dfm-search-go {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  padding: 7px 14px; background: var(--ink, #222); color: #fff; border: none;
  border-radius: var(--r-pill, 999px); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.dfm-search-go:active { transform: translateY(-50%) scale(.96); }

/* ---- R3-2: スマホでモード切替を自動折りたたみ(2026-07-13) ----
   初期は展開表示→3秒後に38px円形「⇄」アイコンへ収納。タップで再展開。
   デスクトップ(>480px)は常時展開(発見性優先)。 */
.dfm-mode { position: relative; }
.dfm-mode-foldicon { display: none; }
@media (max-width: 480px) {
  .dfm-topleft .dfm-mode {
    max-width: 320px;
    transition: max-width .35s ease;
    overflow: hidden;
    flex-wrap: nowrap;
  }
  .dfm-topleft .dfm-mode button { transition: opacity .22s ease; }
  .dfm-topleft .dfm-mode.dfm-mode-folded { max-width: 38px; }
  .dfm-topleft .dfm-mode.dfm-mode-folded > button:not(.dfm-mode-foldicon) { opacity: 0; pointer-events: none; }
  .dfm-mode.dfm-mode-folded .dfm-mode-foldicon {
    display: flex; align-items: center; justify-content: center;
    position: absolute; inset: 0;
    height: auto; width: auto; padding: 0; margin: 0; /* .dfm-mode button のH30規則を打ち消して天地中央に */
    border: none; background: none; cursor: pointer;
    color: var(--accent);
  }
  .dfm-mode-foldicon svg { width: 16px; height: 16px; flex-shrink: 0; }
}

/* ---- R3-5: 全国ボタンは廃止(2026-07-13 ユーザー指示。ロゴタップに同機能があるため) ---- */
.dfm-reset-btn { display: none !important; }

/* ============ モバイル操作性改善(2026-08-01 ユーザー指摘「手机网页版操作性太差」) ============ */
@media (max-width: 640px) {
  /* 1) シート展開中に右下コントロール(レイヤー/天気/3D/底図)が覆われて押せない問題:
        シート実高(--dfm-sheet-h、map.js が ResizeObserver で計測)ぶん上へ退避する。
        シートが高すぎる場合は 52vh で頭打ち(そのときはシート内容に集中している) */
  .dfm-controls {
    bottom: min(calc(max(env(safe-area-inset-bottom), 12px) + 24px + var(--dfm-sheet-h, 0px)), 52vh);
    transition: bottom .18s ease;
    /* 判定シート(z:11)より上に: レイヤーパネルが結果シートの下に潜って読めない問題 */
    z-index: 12;
  }
  /* レイヤー/天気/3D パネル展開中はコントロール群を退避させない:
     パネル+ボタン列の総高が画面からはみ出し、上端のボタンが画面外へ追い出される。
     パネル自体は z:12 で判定シートの上に被さるので退避不要(操作対象はパネル) */
  .dfm-controls:has(.dfm-layers-body:not([hidden])),
  .dfm-controls:has(.dfm-wx-body:not([hidden])) {
    bottom: calc(max(env(safe-area-inset-bottom), 12px) + 24px);
  }
  /* パネルの内部スクロール上限: 基底の calc(100dvh - 170px) はボタン列自身の高さ
     (約170px)を見込んでおらず、モバイルでは天気ボタンが画面上端へ追い出される */
  .dfm-layers-body, .dfm-wx-body {
    max-height: calc(100dvh - 330px);
  }

  /* 2) タッチターゲットを 44px 目安へ(見た目は変えず当たり判定だけ広げる) */
  .dfm-result-fav::before, .dfm-result-share::before, .dfm-result-close::before { inset: -8px; }
  .dfm-panel-close, .dfm-wx-close, .dfm-mode-foldicon, .dfm-auth-close { position: relative; }
  .dfm-panel-close::after, .dfm-wx-close::after, .dfm-mode-foldicon::after, .dfm-auth-close::after {
    content: ""; position: absolute; inset: -9px;
  }
  .dfm-mypl-btn { width: 42px; height: 42px; }
  .dfm-basemap button { height: 38px; }
  /* 出典 ⓘ は 18px では小さすぎた: 視覚 24px + 当たり判定 44px */
  .dfm-attr-toggle { width: 24px; height: 24px; position: relative; }
  .dfm-attr-toggle::after { content: ""; position: absolute; inset: -10px; }

  /* 4) 地図ツールの折りたたみ(機能ボタンが多すぎる指摘):
        既定は折りたたみボタン1個だけ。タップで 3D日照/天気/レイヤー/底図を展開 */
  .dfm-ctrl-fold {
    display: flex; align-items: center; justify-content: center;
    width: 46px; height: 46px;
    border: none; border-radius: var(--r-pill);
    background: var(--surface); color: var(--ink-2);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
  }
  .dfm-ctrl-fold .dfm-fold-close { display: none; }
  .dfm-controls.dfm-ctrl-open .dfm-ctrl-fold .dfm-fold-open { display: none; }
  .dfm-controls.dfm-ctrl-open .dfm-ctrl-fold .dfm-fold-close { display: block; }
  .dfm-controls:not(.dfm-ctrl-open) .dfm-layers-btn,
  .dfm-controls:not(.dfm-ctrl-open) .dfm-basemap,
  /* localStorage(dfm-layers-open)で復元されたパネルも折りたたみ中は出さない */
  .dfm-controls:not(.dfm-ctrl-open) .dfm-layers-body,
  .dfm-controls:not(.dfm-ctrl-open) .dfm-wx-body { display: none; }
  /* Mapbox 標準の ⓘ は非表示: 文言は出典ⓘのダイアログに集約(ⓘ二重の指摘)。
     ロゴ(左下 mapbox ワードマーク)は規約上そのまま残す */
  .mapboxgl-ctrl-attrib { display: none; }

  /* 5) 3D日照の没入モード(2026-08-01 指摘「3Dに入ったら他のUIを出さない」):
        他 UI を全部隠し、下部フル幅の時間バーだけを出す。終了で全て復帰。
        PC は従来のパネル型のまま(ユーザー判断)。mapbox ロゴは規約上残す */
  body.dfm-s3-mode .dfm-topleft,
  body.dfm-s3-mode .dfm-sheet,
  body.dfm-s3-mode .dfm-sheet-fab,
  body.dfm-s3-mode .dfm-attribution,
  body.dfm-s3-mode #resultSheet,
  body.dfm-s3-mode .mapboxgl-ctrl-scale,
  body.dfm-s3-mode .dfm-controls > *:not(#sun3dBody):not(#sun3dMiniBar) { display: none; }
  /* :not([hidden]) 必須 — 無条件 display:block だと hidden 属性(UA の display:none)を
     上書きしてしまい、極小バーと詳細カードが同時に出る */
  body.dfm-s3-mode #sun3dBody:not([hidden]) {
    display: block;
    position: fixed;
    left: 10px; right: 10px;
    bottom: calc(max(env(safe-area-inset-bottom), 12px));
    width: auto;
    max-height: none;
    z-index: 20;
  }
  /* 詳細カード(sun3dBody)側: 注記(影の計算方法)は畳んで薄くする */
  body.dfm-s3-mode #sun3dFoot { display: none; }

  /* 3D日照の極小バー(没入モードの既定): [∧][時刻]──スライダー──[終了] */
  body.dfm-s3-mode .dfm-s3-minibar:not([hidden]) {
    display: flex; align-items: center; gap: 8px;
    position: fixed; left: 10px; right: 10px;
    bottom: calc(max(env(safe-area-inset-bottom), 12px));
    z-index: 20;
    background: var(--surface);
    border-radius: var(--r-pill);
    padding: 6px 8px;
    box-shadow: var(--shadow);
  }
  .dfm-s3-minibar .dfm-s3-slider { flex: 1 1 auto; min-width: 0; margin: 0; }
  .dfm-s3-minitime {
    flex: 0 0 auto;
    font-size: 14px; font-weight: 800; color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .dfm-s3-expand {
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 auto; width: 34px; height: 34px;
    border: none; border-radius: 50%;
    background: var(--bg); color: var(--ink-2);
    cursor: pointer; position: relative;
  }
  .dfm-s3-expand::after { content: ""; position: absolute; inset: -6px; }
  .dfm-s3-minibar .dfm-s3-exit { flex: 0 0 auto; height: 34px; }

  /* 3) 検索入力中(キーボード表示中)の不快感対策(2026-08-01 実機指摘):
     - 入力欄 16px 未満だと iOS がフォーカス時に画面全体を拡大してしまう
     - キーボードで可視域が半減し、判定ボタン+凡例+ガイド行のぶん入力欄が
       画面外へ押し出される → 入力中は入力欄と候補だけの検索専用表示に畳む */
  .dfm-search-wrap input { font-size: 16px; }
  .dfm-sheet.dfm-typing .dfm-sheet-handle,
  .dfm-sheet.dfm-typing .dfm-check-btn,
  .dfm-sheet.dfm-typing .dfm-legend,
  .dfm-sheet.dfm-typing .dfm-guide-link { display: none; }
  .dfm-sheet.dfm-typing .dfm-search-results { max-height: 33vh; }
}

/* ---- 公式X告知ピル(2026-08-19) ----
   ドロスポッ!モードの β補足(spot.css .dspot-beta-note)と同じ見た目・位置の
   常設ピル。spot モードでは catbar と重なるため非表示。 */
.dfm-x-note {
  position: fixed;
  top: calc(max(env(safe-area-inset-top), 10px) + 52px);
  left: 12px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  max-width: calc(100vw - 110px); /* 右上の全国ボタンと重ねない(catbar と同基準) */
}
body.mode-spot .dfm-x-note { display: none; }
body.dfm-picker .dfm-x-note { display: none; } /* 選点モード中はヘッダー同様に隠す */
.dfm-x-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: inherit; text-decoration: none;
  overflow: hidden;
}
.dfm-x-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px;
  border-radius: 999px;
  background: #0F1419; color: #fff; /* X ブランドの黒 */
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  flex-shrink: 0;
}
.dfm-x-follow {
  color: var(--ink); font-weight: 800;
  text-decoration: underline; text-underline-offset: 2px;
  flex-shrink: 0;
}
.dfm-x-link:hover .dfm-x-follow { opacity: .75; }
/* スマホは短文版(横幅に収める) */
.dfm-x-note .dfm-x-short { display: none; }
@media (max-width: 480px) {
  .dfm-x-note { top: calc(max(env(safe-area-inset-top), 10px) + 50px); left: 10px; font-size: 11.5px; }
  .dfm-x-note .dfm-x-long { display: none; }
  .dfm-x-note .dfm-x-short { display: inline; }
}
/* 閉じるボタン(β補足 .dspot-beta-x と同意匠) */
.dfm-x-close {
  width: 20px; height: 20px;
  border: none; border-radius: 50%;
  background: #F2F3F5; color: #888;
  font-size: 10px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; margin-left: 4px; padding: 0;
  flex-shrink: 0;
  font-family: inherit;
}
.dfm-x-close:hover { background: #E4E6EA; color: #555; }

/* ---- 問題レポート導線(2026-08-19) ---- */
.dfm-report-link {
  margin-top: 7px; padding-top: 0; border-top: none;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
}
.dfm-report-link:hover { color: var(--ink-2); }
