/* ============================================================
   避難ナウ - style.css
   モバイルファースト / ダークモード対応 / タップ44px+
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5a5a5a;
  --text-faint: #9a9a9a;
  --main: #1a3a5c;
  --main-strong: #0f2844;
  --warn: #d32f2f;
  --ok: #388e3c;
  --fail: #757575;
  --link: #1976d2;
  --border: #e2e6ea;
  --border-soft: #eef1f4;
  --shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 44px;
  --mono-font: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --bg-soft: #1a1a1a;
    --bg-card: #1e1e1e;
    --text: #f1f1f1;
    --text-muted: #c0c0c0;
    --text-faint: #808080;
    --main: #4c7fb0;
    --main-strong: #6ea0d0;
    --warn: #ef5350;
    --ok: #66bb6a;
    --fail: #9e9e9e;
    --link: #64b5f6;
    --border: #2a2a2a;
    --border-soft: #222;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.5);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover, a:focus {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

/* ヘッダー */
.app-header {
  background: var(--main);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: calc(12px + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.app-nav {
  display: flex;
  gap: 12px;
}
.nav-link {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  padding: 6px 4px;
}
.nav-link:hover { color: #fff; }

/* メイン */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 12px 24px;
}

/* タブ */
.tabs-wrap { margin-top: 8px; }
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  min-height: var(--tap);
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 14px;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.tab:hover { background: var(--bg-soft); }
.tab--active {
  background: var(--main);
  border-color: var(--main);
  color: #fff;
}
.tab--active:hover { background: var(--main-strong); }
.tab--add {
  border-style: dashed;
  color: var(--text-muted);
}
.tab-label { font-weight: 500; }

/* フィルタ（災害種別 - 緊迫感ある配色、大きめ） */
.filters-wrap { margin: 8px 0 16px; }
.filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.filter {
  min-height: 68px;
  padding: 8px 4px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.filter:active { transform: scale(0.97); }
.filter .filter-icon {
  font-size: 26px;
  line-height: 1;
  display: block;
}
.filter .filter-label { font-size: 14px; line-height: 1.1; }

/* 未選択: 白地 + 災害別カラーの枠＋文字 */
.filter--tsunami    { border-color: #0d47a1; color: #0d47a1; }
.filter--earthquake { border-color: #c62828; color: #c62828; }
.filter--flood      { border-color: #1565c0; color: #1565c0; }
.filter--landslide  { border-color: #ef6c00; color: #ef6c00; }

/* 選択中: ベタ塗り＋太枠＋薄影で強調 */
.filter[aria-pressed="true"] {
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(255,255,255,0.25);
}
.filter--tsunami[aria-pressed="true"]    { background: #0d47a1; border-color: #082c66; }
.filter--earthquake[aria-pressed="true"] { background: #c62828; border-color: #8e1a1a; }
.filter--flood[aria-pressed="true"]      { background: #1565c0; border-color: #0d3f7a; }
.filter--landslide[aria-pressed="true"]  { background: #ef6c00; border-color: #a74a00; }

@media (prefers-color-scheme: dark) {
  /* ダークでは未選択の視認性が落ちるため、文字を少し明るく */
  .filter--tsunami    { color: #7aa7dd; border-color: #5286c0; }
  .filter--earthquake { color: #ef8c8c; border-color: #d14a4a; }
  .filter--flood      { color: #82b3e3; border-color: #5a8fc7; }
  .filter--landslide  { color: #f4a762; border-color: #e08832; }
}

/* ステータスバナー */
.status-banner {
  margin: 6px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #fff3cd;
  color: #5c4a00;
  border: 1px solid #ffe28a;
  font-size: 14px;
}
@media (prefers-color-scheme: dark) {
  .status-banner {
    background: #3a2e00;
    color: #ffe28a;
    border-color: #6b5400;
  }
}
.status-banner--error {
  background: #fdecea;
  color: #7a1212;
  border-color: #f5b7b1;
}
@media (prefers-color-scheme: dark) {
  .status-banner--error {
    background: #4a1a18;
    color: #ffb4ab;
    border-color: #7a2c28;
  }
}

/* 最寄り避難所カード */
.nearest-wrap { margin-top: 10px; }
.nearest-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
}
.nearest-card.is-loading {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
}
.nearest-card.is-empty {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-muted);
}
.nearest-name {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
}
.nearest-type {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.nearest-distance {
  font-size: 18px;
  color: var(--main);
  font-weight: 600;
  margin: 0 0 10px;
}
.alert-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffe8e8;
  color: var(--warn);
  border: 1px solid #f2b5b5;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 10px 0;
  font-size: 14px;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .alert-banner {
    background: #4a1a1a;
    color: #ffb4ab;
    border-color: #7a2c28;
  }
}
.times {
  display: flex;
  gap: 16px;
  margin: 10px 0 8px;
  font-size: 18px;
}
.times span strong { font-weight: 700; }
.annotation {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0 0 10px;
}
.disaster-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
}
.disaster-mark {
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.disaster-mark--ok { color: var(--ok); border-color: var(--ok); }
.disaster-mark--ng { color: var(--fail); text-decoration: line-through; }
.elevation {
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0 14px;
}
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: var(--tap);
  background: var(--main);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.15s, opacity 0.15s;
}
.primary-btn:hover { background: var(--main-strong); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.travel-mode {
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
}
.travel-mode button {
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 13px;
  padding: 4px 8px;
}
.travel-mode button[aria-pressed="true"] {
  background: var(--main);
  color: #fff;
  border-color: var(--main);
}

/* 他の避難所リスト */
.others-wrap { margin-top: 18px; }
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 6px;
  letter-spacing: 0.03em;
}
.section-title--muted { color: var(--text-faint); }
.other-list, .excluded-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.other-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  margin-bottom: 6px;
  font-size: 15px;
  min-height: var(--tap);
}
.other-item:hover { background: var(--bg-soft); cursor: pointer; }
.other-name { flex: 1; display: flex; align-items: center; gap: 6px; }
.other-distance { color: var(--text-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.other-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 999px;
  font-size: 12px;
  background: transparent;
}
.other-flag--ng { color: var(--warn); }

/* 非対応避難所 */
.excluded-wrap { margin-top: 18px; }
.excluded-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-faint);
  font-size: 13px;
}
.excluded-list li {
  padding: 4px 10px;
  border: 1px dashed var(--border);
  border-radius: 999px;
}

/* フッター */
.app-footer {
  margin-top: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
}
.disclaimer {
  margin: 0 0 6px;
  line-height: 1.6;
}
.source { margin: 0; font-size: 11px; }

/* モーダル */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 600px) {
  .modal { align-items: center; }
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
  max-height: 92vh;
  overflow-y: auto;
}
@media (min-width: 600px) {
  .modal-dialog { border-radius: var(--radius); }
}
.modal-dialog--small { max-width: 360px; }
.modal-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
}
.field {
  display: block;
  margin-bottom: 14px;
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.field-sublabel {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 4px;
}
.field input[type="text"] {
  width: 100%;
  min-height: var(--tap);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}
.icon-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.icon-picker label {
  position: relative;
  cursor: pointer;
}
.icon-picker input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.icon-picker span {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  font-size: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color 0.15s, background-color 0.15s;
}
.icon-picker input[type="radio"]:checked + span {
  border-color: var(--main);
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 2px var(--main);
}
.icon-picker input[type="radio"]:focus-visible + span {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}
.position-choice { display: block; }
.secondary-btn {
  min-height: var(--tap);
  padding: 8px 14px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s;
}
.secondary-btn:hover { background: var(--border-soft); }
.secondary-btn--small {
  margin-top: 6px;
  font-size: 13px;
  min-height: 36px;
  padding: 6px 12px;
}
.divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin: 10px 0;
  position: relative;
}
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 22px);
  height: 1px;
  background: var(--border-soft);
}
.divider::before { left: 0; }
.divider::after { right: 0; }
.pos-status {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  min-height: 1.2em;
}
.pos-status--ok { color: var(--ok); }
.pos-status--err { color: var(--warn); }

.field-help {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}
.text-btn {
  min-height: var(--tap);
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
}
.text-btn:hover { color: var(--text); }
.danger-btn {
  min-height: var(--tap);
  padding: 8px 14px;
  background: var(--warn);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
}
.danger-btn:hover { filter: brightness(0.95); }

.edit-actions {
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
  margin-top: 14px;
}

.confirm-message {
  margin: 6px 0 12px;
  color: var(--text);
}

/* 読み込み中のスピナー風 */
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.loading-text { animation: pulse 1.4s ease-in-out infinite; margin: 0; }

/* ============================================================
   タイトルリンク / フッターナビ / 運営情報
   ============================================================ */
.app-title-link {
  color: #fff;
  text-decoration: none;
}
.app-title-link:hover, .app-title-link:focus { text-decoration: none; opacity: 0.9; }

.site-footer .footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 10px 0 6px;
  font-size: 12px;
}
.site-footer .footer-nav a { color: var(--link); }
.site-footer .footer-contact {
  font-size: 12px;
  margin: 4px 0 2px;
  color: var(--text-muted);
}
.site-footer .footer-copy {
  font-size: 11px;
  color: var(--text-faint);
  margin: 6px 0 0;
}

/* ============================================================
   アフィリエイトセクション（コンパクト版: 折りたたみ＋チップ）
   ============================================================ */
.affiliate-wrap {
  margin-top: 20px;
  padding: 0;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
}
.affiliate-details { width: 100%; }
.affiliate-summary {
  list-style: none;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.affiliate-summary::-webkit-details-marker { display: none; }
.affiliate-summary::after {
  content: '▸';
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  transition: transform 0.15s;
}
.affiliate-details[open] .affiliate-summary::after { transform: rotate(90deg); }
.pr-tag {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 2px;
}
.affiliate-body {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aff-bucket {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.aff-bucket--amazon   { border-left-color: #FF9900; }
.aff-bucket--rakuten  { border-left-color: #BF0000; }
.aff-bucket-label {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-muted);
}
.aff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.aff-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
}
.aff-chip:hover, .aff-chip:focus {
  background: var(--border-soft);
  text-decoration: none;
  color: var(--text);
}
.aff-chip:active { transform: scale(0.97); }
.aff-bucket--amazon .aff-chip:hover { border-color: #FF9900; }
.aff-bucket--rakuten .aff-chip:hover { border-color: #BF0000; }

/* キーワード検索フォーム */
.aff-search {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.aff-search-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.aff-search-input:focus {
  border-color: var(--main);
  box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.18);
}
.aff-search-btn {
  flex: 0 0 auto;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--main);
  border: 1px solid var(--main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, transform 0.05s;
}
.aff-search-btn:hover { filter: brightness(1.08); }
.aff-search-btn:active { transform: scale(0.97); }
.aff-bucket--amazon  .aff-search-btn { background: #FF9900; border-color: #FF9900; color: #1a1a1a; }
.aff-bucket--rakuten .aff-search-btn { background: #BF0000; border-color: #BF0000; color: #fff; }

.affiliate-note {
  margin: 4px 0 0;
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   位置情報プロンプト（ローディング／エラー時の再試行 UI）
   ============================================================ */
.geo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.geo-actions .secondary-btn {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
}
.geo-error-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--warn);
  text-align: center;
}
.geo-error-help {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 4px;
  text-align: left;
}

/* ============================================================
   この地域の情報カード
   ============================================================ */
.area-info-wrap {
  margin: 10px 0 0;
}
.area-info-card {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.area-info-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.area-info-address {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.area-info-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
@media (min-width: 420px) {
  .area-info-actions {
    grid-template-columns: 1fr 1fr;
  }
  .area-btn--map { grid-column: 1 / -1; }
}
.area-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
}
.area-btn:hover, .area-btn:focus {
  background: var(--border-soft);
  text-decoration: none;
  color: var(--text);
}
.area-btn:active { transform: scale(0.98); }
.area-btn[hidden] { display: none; }
.area-btn--map     { border-color: var(--main); color: var(--main); }
.area-btn--map:hover     { background: rgba(26,58,92,0.06); }
.area-btn--hospital      { border-color: #c62828; color: #c62828; }
.area-btn--hospital:hover { background: rgba(198,40,40,0.06); color: #c62828; }
.area-btn--city          { border-color: #2e7d32; color: #2e7d32; }
.area-btn--city:hover    { background: rgba(46,125,50,0.06); color: #2e7d32; }
.area-info-credit {
  margin: 10px 0 0;
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: right;
}
.area-info-credit a { color: inherit; text-decoration: underline; }

/* ============================================================
   プライバシーQ&A
   ============================================================ */
.privacy-qa {
  margin-top: 20px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
}
.privacy-qa-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--text);
  margin: 0 0 8px;
}
.privacy-qa-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.privacy-qa-controls .text-btn {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
}
.qa-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  margin-bottom: 6px;
  overflow: hidden;
}
.qa-item > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
}
.qa-item > summary::-webkit-details-marker { display: none; }
.qa-item > summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.15s;
}
.qa-item[open] > summary::before { transform: rotate(90deg); }
.qa-item > p {
  margin: 0;
  padding: 0 14px 12px 28px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}
.privacy-qa-footnote {
  margin: 10px 2px 2px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}
.privacy-qa-links {
  margin: 6px 2px 2px;
  font-size: 12px;
}

/* ============================================================
   初回免責バナー
   ============================================================ */
.disclaimer-banner {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.disclaimer-banner-inner {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius);
  padding: 20px 18px 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  max-height: 92vh;
  overflow-y: auto;
}
.disclaimer-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.disclaimer-body p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 8px;
  color: var(--text);
}
.disclaimer-body .disclaimer-warn {
  color: var(--warn);
  font-weight: 600;
}
.disclaimer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.disclaimer-actions .text-btn {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ============================================================
   同意モーダル (consent.js)
   ============================================================ */
.consent-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 600px) {
  .consent-modal { align-items: center; }
}
.consent-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.consent-dialog {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0,0,0,0.25);
}
@media (min-width: 600px) {
  .consent-dialog { border-radius: var(--radius); }
}
.consent-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 10px;
}
.consent-body p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 8px;
  color: var(--text);
}
.consent-body .consent-note {
  font-size: 12px;
  color: var(--text-muted);
}
.consent-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.consent-remember input { width: 18px; height: 18px; }
.consent-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}
.consent-actions .primary-btn { width: auto; min-width: 140px; }

/* ============================================================
   法的ページ共通 (about/privacy/terms/disclaimer)
   ============================================================ */
.legal-main {
  max-width: 740px;
}
.legal-heading {
  font-size: 22px;
  margin: 12px 0 6px;
}
.legal-updated {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0 0 12px;
}
.legal-section {
  margin: 14px 0 18px;
}
.legal-section h2 {
  font-size: 16px;
  margin: 18px 0 6px;
  color: var(--main);
  border-left: 3px solid var(--main);
  padding-left: 8px;
}
.legal-section h3 {
  font-size: 14px;
  margin: 12px 0 4px;
  color: var(--text);
}
.legal-section p,
.legal-section li {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}
.legal-section ul, .legal-section ol {
  padding-left: 22px;
  margin: 6px 0;
}
.legal-section code {
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--mono-font);
  font-size: 12px;
}
.legal-dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 12px;
  margin: 6px 0;
}
.legal-dl dt {
  font-weight: 600;
  color: var(--text-muted);
}
.legal-dl dd { margin: 0; }
.legal-xref {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
}

