/* ============================================================
   地域課題解決マップ 共通レイアウト・コンポーネント
   視覚正本: 地域課題解決マップ_触れるプロトタイプ_v4.html
   規則: v30 8-8〜8-11・28章
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overscroll-behavior: none; }
body {
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; border: 0; background: none; cursor: pointer; }

/* ---- タイポユーティリティ（8-7） ---- */
.h1 { font-family: var(--font-heading); font-weight: 700; font-size: 24px; }
.h2 { font-family: var(--font-heading); font-weight: 700; font-size: 20px; }
.btn-tx { font-family: var(--font-heading); font-weight: 700; font-size: 16px; }
.body-tx { font-family: var(--font-body); font-weight: 400; font-size: 16px; }
.cap { font-family: var(--font-body); font-weight: 400; font-size: 13px; }
.capM { font-family: var(--font-body); font-weight: 500; font-size: 13px; }

/* ---- アプリシェル（28-2: 固定ヘッダー＋固定ナビ＋中央のみ可変） ---- */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; height: 100dvh; }
#appHeader {
  flex: 0 0 var(--header-h);
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
#appHeader .title { font-family: var(--font-heading); font-weight: 700; font-size: 16px; color: var(--primary); }
#appHeader .backbtn { position: absolute; left: 4px; top: 0; height: var(--header-h); width: 48px; display: flex; align-items: center; justify-content: center; }
#appMain { flex: 1 1 auto; position: relative; overflow: hidden; }
#bottomNav {
  flex: 0 0 var(--nav-h);
  background: var(--card-bg); border-top: 1px solid var(--border);
  display: flex; z-index: 50;
}
#bottomNav .tab {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
#bottomNav .tab .cap { color: var(--text-secondary); }
#bottomNav .tab.active .cap { color: var(--primary); }
body.no-nav #bottomNav { display: none; }
body.no-header #appHeader { display: none; }

/* ---- 画面切替 ---- */
.screen { position: absolute; inset: 0; overflow-y: auto; background: var(--page-bg); }
.screen.hidden { display: none; }
#screen-map { overflow: hidden; }

/* ---- マップ画面 ---- */
#mapCanvas { position: absolute; inset: 0; background: var(--page-bg); }
#mapCanvas .maplibregl-ctrl-attrib { display: none; }
.map-overlay { position: absolute; z-index: 10; }
.chiprow { top: 12px; left: 16px; right: 16px; display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.chiprow::-webkit-scrollbar { display: none; }
.fchip {
  height: 40px; border-radius: var(--radius-md); background: var(--card-bg);
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 0 16px; white-space: nowrap; flex: 0 0 auto; color: var(--text-primary);
}
.fchip.applied { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.legendcard {
  left: 16px; bottom: 152px; border-radius: var(--radius-md);
  background: var(--card-bg); box-shadow: var(--shadow-card); padding: 12px;
}
.legendrow { height: 28px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.legenddot { width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 16px; }

.fab {
  left: 50%; transform: translateX(-50%); bottom: 72px;
  height: 56px; padding: 0 24px; border-radius: var(--radius-md);
  background: var(--primary); box-shadow: var(--shadow-fab);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.fab:active { background: var(--primary-pressed); }
.fab .btn-tx { color: #FFFFFF; }

.sheet-open-btn {
  left: 50%; transform: translateX(-50%); bottom: 30px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.16); padding: 8px 18px;
  font-family: var(--font-heading); font-size: 13px; font-weight: 700; color: var(--primary); white-space: nowrap;
}
.myloc {
  right: 16px; bottom: 32px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--card-bg); box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center;
}
.attr {
  left: 16px; bottom: 4px; height: 24px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.85); padding: 0 8px;
  display: flex; align-items: center; white-space: nowrap;
}

/* ---- ピン（StatusPin: 色×進行段階アイコンの二重符号化 8-3） ---- */
.pin { cursor: pointer; position: relative; }
.pincircle {
  border-radius: 50%; border: 3px solid #FFFFFF; box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center; position: relative; z-index: 2;
}
.pintail {
  position: absolute; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent; z-index: 1;
}

/* ---- ボトムシート（この地域の投稿） ---- */
.local-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--card-bg); border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.2);
  transform: translateY(115%); transition: transform 0.3s; display: flex; flex-direction: column; max-height: 66%;
}
.local-sheet.on { transform: translateY(0); }
.sheet-head { flex: 0 0 auto; padding: 6px 16px 10px; border-bottom: 1px solid var(--border); }
.sheet-bar { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 6px auto 8px; }
.sheet-titlerow { display: flex; align-items: center; justify-content: space-between; }
.sheet-titlerow b { font-family: var(--font-heading); font-weight: 700; font-size: 15px; }
.sheet-close { color: var(--primary); font-weight: 700; font-size: 13px; font-family: var(--font-heading); }
.sheet-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); }

/* ---- 投稿カード（PostCard.sheetPreview 28-7準拠） ---- */
.mcard {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); padding: 12px 14px; margin: 8px 4px; cursor: pointer;
}
.mchips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.mchip {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px;
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.mmem {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px;
  border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.mtitle { font-family: var(--font-heading); font-weight: 700; font-size: 15px; line-height: 1.35; margin-bottom: 4px; }
.mmeta { font-size: 12px; color: var(--text-secondary); }
.mfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.memp { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-secondary); }
.mdet { display: inline-flex; align-items: center; gap: 2px; color: var(--primary); font-weight: 700; font-size: 13px; }

/* ---- オーバーレイ状態（読込中・空・0件・エラー） ---- */
.state-overlay {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center; padding: 24px;
}
.state-overlay.dim { background: rgba(248, 250, 252, 0.92); }
.state-card {
  background: var(--card-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 24px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 300px;
}
.state-icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
}
/* 空状態イラスト（unDraw・illustrations.js。empty=空状態／searching=フィルター0件） */
.illust svg { width: 148px; height: auto; display: block; }
.illust.small svg { width: 120px; }
.illust { margin-bottom: 2px; }
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 4px solid var(--border); border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.primary-btn {
  min-height: 44px; padding: 10px 20px; border-radius: var(--radius-md);
  background: var(--primary); color: #FFFFFF;
  font-family: var(--font-heading); font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.primary-btn:active { background: var(--primary-pressed); }
.ghost-btn {
  min-height: 44px; padding: 10px 16px; border-radius: var(--radius-md);
  background: var(--card-bg); border: 1px solid var(--border); color: var(--primary);
  font-family: var(--font-heading); font-weight: 700; font-size: 15px;
}

/* ---- バナー（非モーダル: M5/M6/オフライン 6-1原則） ---- */
.banner {
  position: absolute; left: 12px; right: 12px; top: 64px; z-index: 45;
  background: var(--notice-bg); color: var(--notice-tx);
  border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  padding: 12px 14px; font-size: 13px;
}
.banner.error { background: var(--error-bg); color: var(--error-tx); border-color: #FECACA; }
.banner .banner-actions { display: flex; gap: 12px; margin-top: 8px; }
.banner .banner-actions button { font-weight: 700; font-size: 13px; color: var(--primary); font-family: var(--font-heading); min-height: 32px; }

/* ---- ダイアログ（モーダル: 背面操作不可＝遷移仕様1-1規約） ---- */
.dialog-scrim {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.dialog-card {
  background: var(--card-bg); border-radius: var(--radius-lg); padding: 24px 20px 16px;
  width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 8px;
}
.dialog-card .dlg-title { font-family: var(--font-heading); font-weight: 700; font-size: 18px; }
.dialog-card .dlg-body { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.dialog-card .dlg-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.dialog-card .dlg-secondary {
  min-height: 44px; color: var(--text-secondary);
  font-family: var(--font-heading); font-weight: 700; font-size: 15px;
}

/* ---- 選択シート（フィルター用・U4仮実装） ---- */
.option-row {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 8px;
  border-bottom: 1px solid var(--border); font-size: 15px; cursor: pointer; white-space: nowrap;
}
.option-row:last-child { border-bottom: 0; }
.option-row.selected { color: var(--primary); font-weight: 700; }
.option-ic { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex: 0 0 32px; }

/* ---- トースト（6-4: 画面下部に数秒表示） ---- */
#toastRoot { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 16px); z-index: 120; display: flex; justify-content: center; pointer-events: none; }
.toast {
  background: rgba(15, 23, 42, 0.88); color: #FFFFFF; border-radius: var(--radius-md);
  padding: 10px 18px; font-size: 14px; max-width: 86%;
  animation: toastin 0.2s ease-out;
}
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- プレースホルダー画面 ---- */
.placeholder-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; gap: 12px; padding: 24px; text-align: center; }

/* ============================================================
   画面③ 投稿詳細（2026-07-15追加）
   視覚正本: 触れるプロトタイプv4 画面③（D1）。D2/D3/プロセスカード/本人ビューは
   v30 5-4・8-11・16章＋実装要件v2 5章に基づく新設（プロトタイプ未実装分）
   ============================================================ */
.detail-wrap { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.dcard {
  background: var(--card-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 20px 16px; margin-bottom: 12px;
}

/* 写真枠（フェーズL: プレースホルダー。実写真は党許可後=v30 14-3） */
.photo-row { display: flex; gap: 8px; }
.photo-box {
  flex: 1 1 0; height: 118px; background: #F1F5F9; border: 1px solid var(--border);
  border-radius: var(--radius-md); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; padding: 6px;
}
.photo-subcap { font-size: 10px; color: var(--text-secondary); text-align: center; }
.photo-cap { color: var(--text-secondary); margin-top: 8px; }

/* 対応コメント（「〇〇課より」ブロック=プロトタイプv4） */
.resp-block { background: var(--notice-bg); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px; }
.dept-line { color: var(--text-secondary); margin: 4px 2px 16px; }

/* 共感ボタン（EmpathyButton=プロトタイプv4: 156x44・Primary・カウントバッジ） */
.empathy-row { display: flex; justify-content: center; margin: 8px 0 4px; }
.empathy-btn {
  min-width: 156px; height: 44px; padding: 0 18px; border-radius: var(--radius-md);
  background: var(--primary); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.empathy-btn:active { background: var(--primary-pressed); }
.emp-count {
  font-family: var(--font-body); font-weight: 500; font-size: 13px; color: #FFFFFF;
  background: var(--primary-hover); border-radius: var(--radius-sm); padding: 0 8px; height: 20px; line-height: 20px;
}

/* プロセスカード（R10: 対応済に常設。受付→対応→完了の流れ+施工完了日） */
.process-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 16px; margin-bottom: 12px;
}
.pc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pc-title { font-family: var(--font-heading); font-weight: 700; font-size: 16px; color: var(--text-primary); }
.flow-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding: 0 6px; }
.flow-step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 0 0 auto; }
.flow-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.flow-cap { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.flow-arrow { flex: 1 1 auto; display: flex; justify-content: center; }

/* 本人ビュー（R2）: 保護編集ありバッジ＋公開版切替（8-10のバッジ様式） */
.owner-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.protect-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700; color: var(--text-secondary); background: var(--card-bg);
}
.preview-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--primary); font-family: var(--font-heading); font-weight: 700; font-size: 13px; min-height: 26px;
}

/* 差し戻し理由（③本人ビュー・R13連動の理由表示のみ。導線は⑥） */
.reject-band {
  background: var(--chip-rejected-bg); border: 1px solid #FECACA; border-radius: var(--radius-md);
  padding: 12px 14px; margin-bottom: 12px;
}

/* 保護表示（D2）の注記バンド */
.notice-band {
  display: flex; align-items: flex-start; gap: 6px;
  background: var(--notice-bg); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 4px;
}

/* 公開版プレビュー（本人ビュー・論点R8仮実装）・フィルター選択シート（U4仮実装）共用 */
.msheet-scrim { position: fixed; inset: 0; z-index: 104; background: rgba(15, 23, 42, 0.45); }
.modal-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 105;
  background: var(--card-bg); border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.2);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 70%; overflow-y: auto;
}
.modal-sheet .sheet-bar { margin: 4px auto 10px; }
.msheet-title { font-family: var(--font-heading); font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.preview-box { background: var(--page-bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; }

/* ============================================================
   画面② 一覧TOP（2026-07-15追加）
   視覚正本: 触れるプロトタイプv4 画面②。カード=共通テンプレート（28-7）・
   角丸24px（v30 5-7）・メタはサムネ列と重ねない（8-10）。
   制限カード=画面②JSON v5 postCardRestricted
   ============================================================ */
.list-head {
  position: sticky; top: 0; z-index: 20;
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  padding: 10px 16px; display: flex; flex-direction: column; gap: 10px;
}
.list-chiprow { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.list-chiprow::-webkit-scrollbar { display: none; }
.list-chiprow .fchip { height: 36px; box-shadow: none; }

/* 並び替えセグメント（SortSegment: new/emp。プロトタイプv4準拠のピル型） */
.seg-row { display: flex; gap: 6px; }
.seg-btn {
  flex: 1 1 0; height: 34px; border-radius: 17px;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text-secondary);
  font-family: var(--font-heading); font-weight: 700; font-size: 13px;
}
.seg-btn.on { background: var(--primary); color: #FFFFFF; border-color: var(--primary); }

#listBody { padding: 4px 0 calc(16px + env(safe-area-inset-bottom)); }

/* 投稿カード（PostCard.list: 左テキスト列＋右サムネイル96px） */
.lcard {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); margin: 8px 16px; padding: 12px 14px;
  display: flex; gap: 12px; cursor: pointer;
}
.lmain { flex: 1 1 auto; min-width: 0; }
.ltitle { font-family: var(--font-heading); font-weight: 700; font-size: 15px; line-height: 1.4; margin: 2px 0 4px; }
.lmeta { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }
.lemp { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-secondary); }
.lthumb {
  flex: 0 0 96px; width: 96px; height: 96px; border-radius: 12px;
  background: #F1F5F9; border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #94A3B8; font-size: 11px; text-align: center; padding: 4px; align-self: center;
}

/* 保護カード（対人トラブル系・公開版あり: タイトル非表示・publicText先頭2行=16-2） */
.lprotected {
  font-size: 14px; line-height: 1.5; color: var(--text-primary); margin: 2px 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 制限カード（内容確認中: チップ＋案内ボックスのみ=postCardRestricted） */
.lcard.restricted .notice-box {
  background: var(--notice-bg); border-radius: var(--radius-sm); padding: 10px;
  color: var(--text-secondary); line-height: 1.5; margin-top: 6px;
}

/* 一覧末尾の注意バナー（16-2・非モーダル） */
.list-banner {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--notice-bg); border-radius: 12px; padding: 10px 12px;
  margin: 8px 16px; font-size: 12px; color: var(--text-secondary); line-height: 1.5;
}

/* ============================================================
   画面④ 投稿フロー（2026-07-16追加）
   視覚正本: 触れるプロトタイプv4 画面④（4画面構成・進捗バー・フッター2ボタン）
   状態機械: 遷移仕様v2 6章。J2確定: 未充足の「次へ」=灰色#CBD5E1のままタップ可
   ============================================================ */
.p4 { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--page-bg); }

/* ヘッダー（×＋タイトル＋ProgressBar 33/33/66/100%） */
.p4-hd { flex: 0 0 auto; background: var(--card-bg); border-bottom: 1px solid var(--border); }
.p4-top { height: 52px; display: flex; align-items: center; position: relative; }
.p4-close { position: absolute; left: 4px; top: 0; width: 48px; height: 52px; display: flex; align-items: center; justify-content: center; }
.p4-ttl { width: 100%; text-align: center; font-family: var(--font-heading); font-weight: 700; font-size: 17px; }
.p4-sb { padding: 8px 16px 12px; }
.p4-sbrow { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.p4-stname { font-family: var(--font-heading); font-weight: 700; font-size: 15px; }
.p4-stnum { font-size: 12px; color: var(--primary); font-weight: 700; }
.p4-track { height: 5px; background: var(--border); border-radius: 5px; overflow: hidden; }
.p4-fill { height: 5px; background: var(--primary); border-radius: 5px; transition: width 0.3s; }

/* 本文（ステップ切替。display切替で入力DOMを保持=6-1入力保持） */
.p4-bd { flex: 1 1 auto; overflow-y: auto; }
.p4-step { display: none; }
.p4-step.on { display: block; }

/* フッター（戻る=ghost 120px固定・次へ/投稿する） */
.p4-ft {
  flex: 0 0 auto; background: var(--card-bg); border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 12px;
}
.p4-back { flex: 0 0 120px; }
.p4-next {
  flex: 1; min-height: 52px; border-radius: var(--radius-md);
  font-family: var(--font-heading); font-weight: 700; font-size: 16px; color: #FFFFFF;
  background: #CBD5E1; /* J2確定値（遷移仕様6-1: 未充足時も灰色のままタップ可能） */
  display: flex; align-items: center; justify-content: center;
}
.p4-next.ready { background: var(--primary); }
.p4-next.ready:active { background: var(--primary-pressed); }
.p4-next.busy { background: var(--primary-hover); }

/* --- P0: ミニ地図＋位置ボックス＋大分類タイル --- */
.p4-map { height: 250px; position: relative; overflow: hidden; background: #EAF0F6; border-bottom: 1px solid var(--border); }
#p4Map { position: absolute; inset: 0; }
#p4Map .maplibregl-ctrl-attrib { display: none; }
.p4-mapfallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 16px; color: var(--text-secondary); line-height: 1.6;
}
.p4-cross { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none; }
.p4-cross::before, .p4-cross::after { content: ""; position: absolute; background: rgba(37, 99, 235, 0.35); }
.p4-cross::before { width: 90px; height: 2px; left: -45px; top: 0; }
.p4-cross::after { height: 70px; width: 2px; top: -35px; left: 0; }
.p4-cpin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); z-index: 4; pointer-events: none; }
.p4-cpin .c { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); border: 3px solid #FFFFFF; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4); }
.p4-cpin .t { width: 0; height: 0; margin: -2px auto 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--primary); }
.p4-myloc {
  position: absolute; right: 10px; bottom: 34px; z-index: 5; width: 40px; height: 40px; border-radius: 50%;
  background: var(--card-bg); box-shadow: var(--shadow-card); display: flex; align-items: center; justify-content: center;
}
.p4-attr {
  /* 出典は常時表示（10-1・GSI利用条件）。プロトタイプの右下配置は位置ボックスの
     裏に隠れるため、①と同じ「左下」（locboxより上）に調整（2026-07-16） */
  position: absolute; left: 8px; bottom: 34px; z-index: 5; background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm); padding: 2px 7px; color: var(--text-secondary);
}
/* 地図フォールバック時（ライブラリ不達）: ピン・十字・出典を出さない */
.p4-map.fallback .p4-cross, .p4-map.fallback .p4-cpin, .p4-map.fallback .p4-attr { display: none; }
.p4-banner { position: absolute; top: 8px; left: 8px; right: 8px; z-index: 6; }
.p4-locbox {
  margin: -28px 16px 0; position: relative; z-index: 7; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
}
.p4-locmain { min-width: 0; }
.p4-loclb { color: var(--text-secondary); }
.p4-locv { font-family: var(--font-heading); font-weight: 700; font-size: 15px; line-height: 1.4; }
.p4-addr-sub { font-family: var(--font-body); font-weight: 400; font-size: 12px; color: var(--text-secondary); }
.p4-q { padding: 14px 16px 4px; font-weight: 700; font-size: 14px; }
.p4-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 8px 16px 16px; }
.p4-tile {
  aspect-ratio: 1 / 1; border-radius: var(--radius-md); border: 2px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 700; text-align: center; padding: 4px; position: relative;
}
.p4-tile.sel { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.p4-tile.empty { background: transparent !important; cursor: default; border-color: transparent; }
.p4-ck { position: absolute; right: 6px; top: 6px; display: none; }
.p4-tile.sel > .p4-ck, .p4-srow.sel > .p4-ck, .p4-slot .p4-ck.on { display: block; }
.p4-ci { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }

/* --- P1: 小分類縦リスト --- */
.p4-subq { padding: 16px 16px 6px; font-family: var(--font-heading); font-weight: 700; font-size: 18px; }
.p4-sub { margin: 0 16px; }
.p4-srow {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 56px;
  border: 1.5px solid var(--border); border-radius: 14px; margin-bottom: 10px;
  font-size: 15px; background: var(--card-bg); text-align: left; position: relative; line-height: 1.4;
}
.p4-srow .p4-ck { position: static; margin-left: auto; flex: 0 0 auto; }
.p4-srow span:nth-child(2) { padding: 8px 0; }
.p4-srow.sel { border-color: var(--primary); background: var(--primary-light); font-weight: 700; color: var(--primary); }

/* --- P2: 写真スロット＋影響度＋補足 --- */
.p4-lbl { padding: 14px 16px 6px; font-weight: 700; font-size: 14px; }
.p4-slots { display: flex; gap: 12px; padding: 0 16px; }
.p4-slot {
  flex: 1; height: 120px; border-radius: var(--radius-md); border: 1.5px dashed var(--border);
  background: var(--page-bg); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: #94A3B8; font-size: 12px; text-align: center; position: relative; overflow: hidden;
}
.p4-slot.uploading { opacity: 0.5; }
.p4-slot.on { border-style: solid; border-color: var(--cat-park-ic); background: #EAF7EE; color: var(--cat-park-ic); }
.p4-slotimg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.p4-slotdone {
  position: absolute; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.55);
  color: #FFFFFF; padding: 3px 6px; font-size: 11px;
}
.p4-slot .p4-ck { z-index: 2; background: #FFFFFF; border-radius: 50%; line-height: 0; }
.p4-file { display: none; }
.p4-photoerr { margin: 8px 16px 0; color: var(--error-tx); background: var(--error-bg); border-radius: var(--radius-sm); padding: 8px 10px; line-height: 1.5; }
.p4-imp { display: flex; gap: 10px; padding: 0 16px; }
.p4-ib {
  flex: 1; height: 46px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--card-bg);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: var(--text-secondary);
}
.p4-ib.sel { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.p4-cmt {
  display: block; width: calc(100% - 32px); margin: 0 16px; min-height: 70px;
  border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font: inherit; font-size: 14px; background: var(--card-bg); resize: vertical;
}
.p4-cmt:focus, .p4-tbox:focus { outline: none; border-color: var(--primary); }
.p4-count { text-align: right; margin: 4px 18px 0; color: var(--text-secondary); }

/* --- P3: タイトル＋匿名トグル＋確認サマリー＋事前告知（16-3） --- */
.p4-tbox {
  display: block; width: calc(100% - 32px); margin: 0 16px; height: 52px;
  border: 1.5px solid var(--border); border-radius: 12px; padding: 0 14px;
  font: inherit; font-size: 15px; background: var(--card-bg);
}
.p4-anon { width: 100%; display: flex; align-items: center; padding: 14px 16px; font-size: 15px; text-align: left; }
.p4-tg { margin-left: auto; width: 46px; height: 26px; border-radius: 26px; background: var(--border); position: relative; transition: 0.2s; flex: 0 0 46px; }
.p4-tg.on { background: var(--primary); }
.p4-tg .k { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #FFFFFF; transition: 0.2s; }
.p4-tg.on .k { left: 23px; }
.p4-sum { margin: 6px 16px 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card-bg); }
.p4-sr { display: flex; align-items: center; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.p4-sr:last-child { border-bottom: 0; }
.p4-sr .k { color: var(--text-secondary); width: 52px; flex: 0 0 52px; }
.p4-sr .v { font-weight: 700; flex: 1; line-height: 1.45; min-width: 0; }
.p4-sr .v.ph { color: #94A3B8; font-weight: 400; }
.p4-edit { flex: 0 0 auto; color: var(--primary); font-family: var(--font-heading); font-weight: 700; font-size: 13px; min-height: 28px; padding: 0 4px; }
.p4-sensnote {
  display: flex; align-items: flex-start; gap: 6px; margin: 10px 16px 0;
  background: var(--notice-bg); border-radius: var(--radius-sm); padding: 8px 10px;
}
/* 地域ゲート案内（S10・2026-07-18 C-2。様式はsensnoteと同系の注意トーン） */
.p4-gatenote {
  display: flex; align-items: flex-start; gap: 6px; margin: 10px 16px 0;
  background: var(--notice-bg); border-radius: var(--radius-sm); padding: 8px 10px;
}

/* ④は下部ナビ非表示のためトースト位置をフッター上に調整 */
body.no-nav #toastRoot { bottom: 96px; }

/* ============================================================
   画面⑥ マイページ（2026-07-16実装）
   視覚正本: 触れるプロトタイプv4 画面⑥（ユーザー行・sec見出し=8-10・hcard・
   進捗ドット28px・バッジ64px円・通知トグル）。差し戻しカード・Y7は
   遷移仕様8-1/8-2＋8-11トークンに基づく新設（プロトタイプ未実装分）
   ============================================================ */
.y-wrap { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.y-user { display: flex; align-items: center; gap: 10px; padding: 16px; }
.y-name { font-family: var(--font-heading); font-weight: 700; font-size: 17px; }

/* セクション見出し（8-10: アクセントバー4px＋区切り線＋背景バンド） */
.sec {
  border-top: 1px solid var(--border); background: var(--page-bg);
  padding: 14px 16px 6px; display: flex; align-items: center; gap: 8px; margin-top: 6px;
}
.sec .bar { width: 4px; height: 16px; border-radius: 4px; background: var(--primary); }
.sec .tx { font-family: var(--font-heading); font-weight: 700; font-size: 15px; }

/* 履歴カード（PostCard.history/rejected: 28-7テンプレ） */
.hcard {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); margin: 10px 16px; padding: 14px 16px; cursor: pointer;
}
.y-title { font-family: var(--font-heading); font-weight: 700; font-size: 15px; line-height: 1.35; margin-bottom: 8px; }
.hcard .mchips { margin-bottom: 14px; }
.y-protect {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card-bg); font-size: 12px; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap;
}

/* 進捗ドット（ProgressDots: 3/4段flex等間隔=28-7。達成色8-3・未達#E2E8F0） */
.pdots { display: flex; align-items: center; padding: 0 6px; }
.pdot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.pconn { flex: 1 1 auto; height: 3px; border-radius: 3px; margin: 0 4px; }

/* カード内注記（16-3/6-4/1-2ラベル・R13理由1行） */
.y-note { font-size: 12px; color: var(--text-secondary); line-height: 1.55; margin-top: 10px; }
.y-pending { font-weight: 700; color: var(--status-received-dot); } /* 「事務局確認中」ラベル（1-2） */
.y-reject-line { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.y-reject-tx {
  flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--chip-rejected-tx); line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; /* R13: 理由先頭1行 */
}
.y-reject-full {
  background: var(--chip-rejected-bg); border: 1px solid #FECACA; border-radius: var(--radius-md);
  padding: 12px 14px; font-size: 14px; line-height: 1.7; color: var(--text-primary);
}

/* 履歴0件（Y2: イラスト＋6-4文言＋R9ボタン） */
.y-histempty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; padding: 20px 24px 16px;
}

/* 実績バッジ（AchievementBadge: 獲得=グラデ8-4／未獲得=#F1F5F9濃淡） */
.badges { display: flex; padding: 12px 16px 4px; gap: 10px; }
.bdg { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bcircle { width: 64px; height: 64px; border-radius: 50%; background: #F1F5F9; display: flex; align-items: center; justify-content: center; }
.bcircle.on { background: linear-gradient(135deg, var(--badge-grad-from), var(--badge-grad-to)); }
.blabel { font-size: 12px; color: var(--text-secondary); text-align: center; line-height: 1.3; }
.y-empty { text-align: center; color: var(--text-secondary); padding: 4px 24px 10px; }

/* 共感した投稿カード */
.y-emp-title { display: flex; align-items: center; gap: 6px; }

/* 通知設定トグル行（p4-tgトグルを共用=AnonToggle/NotifyToggle共通実装） */
.y-tgrow {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; margin: 8px 16px 0;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card-bg); font-size: 14px;
}
.y-tgrow .p4-tg { margin-left: auto; }

/* ログアウト（論点⑤=A: 通知設定の下・最下部。中立トーン） */
.y-logout { display: block; width: calc(100% - 32px); margin: 20px 16px 8px; color: var(--text-secondary); }

/* Y6通知バナー（非モーダル・Y1/Y2の上に併存=8-1。×=明示的に閉じる） */
.y-banner { position: absolute; top: 8px; }
.y-banner-x { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }

/* Y3シート見出し（shield付き） */
.y-sheet-title { display: flex; align-items: center; gap: 6px; }

/* ③実写真（photoDataUrls・2026-07-16配線） */
.photo-real { background-size: cover; background-position: center; position: relative; justify-content: flex-end; align-items: stretch; padding: 0; overflow: hidden; }
.photo-reallabel {
  background: rgba(15, 23, 42, 0.55); color: #FFFFFF; padding: 3px 8px; font-size: 11px; text-align: left;
}

/* ============================================================
   画面⑤ ログイン（2026-07-16実装）
   視覚正本: 触れるプロトタイプv4 画面⑤（構造化JSON=画面⑤ログイン_JSON_v2）
   寸法・配色はJSONの指定値（トークンと同値）: 入力欄・ボタン高さ56/角丸16、
   非活性プロバイダ=#F1F5F9/#475569、インラインエラー=state色/角丸8
   ============================================================ */
.lg-wrap {
  min-height: 100%; background: var(--page-bg);
  padding: 0 24px 32px; position: relative;
}
.lg-wrap.busy { pointer-events: auto; }
.lg-close {
  position: absolute; left: 24px; top: 16px; width: 44px; height: 44px; /* タップ目標44px（10-1） */
  display: flex; align-items: center; justify-content: center; margin-left: -10px;
}
.lg-title {
  font-family: var(--font-heading); font-weight: 700; font-size: 20px;
  color: var(--primary); text-align: center; padding-top: 76px;
}
.lg-guide {
  font-size: 15px; line-height: 1.6; color: var(--text-secondary);
  text-align: center; margin: 12px 0 24px;
}
.lg-label { display: block; font-size: 13px; color: var(--text-secondary); margin: 14px 0 4px; }
.lg-field {
  display: block; width: 100%; height: 56px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 0 16px;
  font: inherit; font-size: 16px; color: var(--text-primary);
}
.lg-field:focus { outline: none; border-color: var(--primary); }
.lg-field:disabled { opacity: 0.6; }
.lg-passwrap { position: relative; }
.lg-passfield { padding-right: 48px; }
.lg-vis {
  position: absolute; right: 4px; top: 6px; width: 44px; height: 44px; /* タップ目標44px */
  display: flex; align-items: center; justify-content: center;
}
.lg-banner {
  border-radius: var(--radius-sm); padding: 11px 12px; margin-top: 14px;
  font-size: 13px; font-weight: 500; line-height: 1.5;
}
.lg-banner.error { background: var(--error-bg); color: var(--error-tx); }       /* A2/A3（JSON inlineErrorBanner） */
.lg-banner.warning { background: var(--warning-bg); color: var(--warning-tx); } /* R7インライン警告 */
.lg-banner.notice { background: var(--notice-bg); color: var(--notice-tx); }    /* 6-6セッション切れ */
.lg-login { width: 100%; height: 56px; margin-top: 18px; }
.lg-login:disabled { opacity: 0.7; }
.lg-divider { display: flex; align-items: center; gap: 12px; margin: 26px 0 24px; }
.lg-divline { flex: 1; height: 1px; background: var(--border); }
.lg-divtext { font-size: 13px; color: var(--text-secondary); }
.lg-provider {
  display: block; width: 100%; height: 56px; margin-bottom: 12px;
  background: var(--notice-bg); color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-family: var(--font-heading); font-weight: 700; font-size: 16px;
}
.lg-note { font-size: 13px; color: var(--text-secondary); text-align: center; margin-top: 20px; }
