* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, sans-serif; background: #1a1a2e; color: #fff; margin: 0; }

/* 従来#appellだった単一画面レイアウト（地図・タブ切替UI）をラッパーに分離。
   bodyはこのラッパーの下に#seo-summaryが続く形でスクロール可能にする
   （SEO静的コンテンツ埋め込み、2026-07-25） */
#app-shell { position: relative; display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }

#header {
    background: linear-gradient(135deg, #16213e, #0f3460);
    border-bottom: 2px solid #e94560;
  }
  #top-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
  }
  #title {
    color: #e94560;
    font-size: 19px;
    font-weight: bold;
    letter-spacing: 1px;
    white-space: nowrap;
  }
  #top-bar select {
    flex: 1;
    background: #0f3460;
    color: white;
    border: 1px solid #e94560;
    border-radius: 6px;
    padding: 6px 4px;
    font-size: 15px;
  }
  #mode-toggle {
    background: #0f3460;
    border: 1px solid #e94560;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 19px;
    cursor: pointer;
    white-space: nowrap;
  }

  #header h1 { font-size: 27px; color: #e94560; letter-spacing: 2px; }
  #header p { font-size: 15px; color: #a0a0b0; margin-top: 4px; }

#filter-bar {
    background: #16213e;
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid #0f3460;
  }

  .filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .filter-label {
    font-size: 15px;
    color: #a0a0b0;
    white-space: nowrap;
  }

  select {
    background: #0f3460;
    color: #fff;
    border: 1px solid #e94560;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 17px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e94560' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
  }

  .legend-item { display: flex; align-items: center; gap: 4px; }
  .legend-dot {
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: inline-block;
    flex-shrink: 0;
  }

  #map { flex: 1; width: 100%; min-height: 0; }
  #schedule { flex: 1; width: 100%; overflow-y: auto; background: #0f1b30; display: none; }
  #tab-bar { background: #16213e; display: flex; border-bottom: 1px solid #0f3460; flex-shrink: 0; }
  .tab-btn {
    flex: 1; padding: 9px 0; font-size: 16px; font-weight: bold;
    background: none; border: none; color: #a0a0b0; cursor: pointer;
    border-bottom: 3px solid transparent; transition: all 0.15s;
  }
  .tab-btn.active { color: #e94560; border-bottom-color: #e94560; }
  .sch-date-header {
    background: #16213e; padding: 6px 12px; font-size: 15px;
    color: #a0a0b0; border-bottom: 1px solid #0f3460;
    display: flex; align-items: center; gap: 8px;
  }
  .sch-date-today { background: #e94560; color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 3px; }
  .sch-date-count { margin-left: auto; font-size: 13px; color: #555; }
  .sch-card {
    margin: 8px 10px; padding: 10px 12px;
    background: #16213e; border-radius: 8px;
    border-left: 4px solid #e94560; display: flex; gap: 10px; align-items: baseline;
  }
  .sch-time { min-width: 48px; text-align: center; }
  .sch-time-start { font-size: 18px; font-weight: bold; color: #fff; line-height: 1; }
  .sch-time-end { font-size: 14px; color: #888; margin-top: 2px; }
  .sch-info { flex: 1; min-width: 0; }
  .sch-name { font-size: 18px; font-weight: bold; color: #ffffff; margin-bottom: 3px; }
  .sch-datetime { font-size: 14px; color: #5dade2; margin-bottom: 4px; line-height: 1.4; }
  .sch-loc { font-size: 14px; color: #a0a0b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sch-pref-badge { font-size: 13px; padding: 2px 6px; border-radius: 3px; flex-shrink: 0; font-weight: bold; }
  .pref-tokyo { background: #1a3a5c; color: #5ab4ff; }
  .pref-saitama { background: #3a2a00; color: #ffc844; }
  .pref-kanagawa { background: #0a3a1a; color: #44cc88; }
  .pref-chiba { background: #3a1a2a; color: #ff88bb; }

  #count-bar {
    background: #16213e;
    padding: 6px 16px;
    font-size: 16px;
    color: #a0a0b0;
    border-top: 1px solid #0f3460;
    text-align: center;
  }

  .popup-box { font-family: -apple-system, sans-serif; min-width: 220px; display: flex; flex-direction: column; overflow: hidden; }
  .popup-badge {
    display: inline-block;
    max-width: calc(100% - 48px);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 6px;
  }
  .popup-name { font-size: 19px; font-weight: bold; color: #1a1a2e; margin-bottom: 4px; }
  .popup-facility { font-size: 17px; color: #444; margin-bottom: 3px; }
  .popup-address { font-size: 16px; color: #666; margin-bottom: 3px; }
  .popup-date { font-size: 17px; font-weight: bold; margin-bottom: 3px; }
  .popup-schedule { font-size: 16px; color: #555; margin-bottom: 3px; }
  .popup-recurrence { font-size: 15px; color: #888; margin-bottom: 3px; }
  .popup-phone { font-size: 17px; font-weight: bold; color: #e94560; }
  .popup-verify {
    margin-top: 8px; padding: 8px 10px;
    background: #FFF3CD; border: 1px solid #FFE08A; border-radius: 6px;
    font-size: 16px; color: #7A5D00; line-height: 1.6;
  }
  .verify-link { color: #1a6fb3; word-break: break-all; text-decoration: underline; }
  .popup-links { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .popup-link { flex: 1; min-width: calc(50% - 3px);
    display: block; text-align: center; padding: 6px 10px;
    border-radius: 6px; font-size: 20px; font-weight: bold;
    text-decoration: none; transition: opacity 0.2s;
  }
  .popup-link:hover { opacity: 0.8; }
  .cal-link { background: #4285F4; color: #fff; }
  .map-link { background: #E67E22; color: #000; }

  @keyframes pulse {
    0% { transform: rotate(-45deg) scale(1); }
    50% { transform: rotate(-45deg) scale(1.35); }
    100% { transform: rotate(-45deg) scale(1); }
  }
  .pin-today { animation: pulse 1.2s ease-in-out infinite; }

/* 免責同意オーバーレイ */
#disclaimer-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#disclaimer-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

#disclaimer-box h2 {
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 16px;
  color: #2C3E50;
}

#disclaimer-box p {
  font-size: 0.95em;
  color: #2C3E50;
  margin: 8px 0;
  text-align: left;
  line-height: 1.5;
}

.disclaimer-confirm {
  font-weight: bold;
  color: #C0392B !important;
  margin-top: 16px !important;
  text-align: center !important;
}

#disclaimer-btn {
  margin-top: 20px;
  background: #2C3E50;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}

#disclaimer-btn:active {
  background: #1A252F;
}

/* 要確認ノート */
.popup-exception-note {
  font-size: 19px;
  font-weight: bold;
  color: #7D3C00;
  margin: 8px 0;
  padding: 8px 10px;
  background: #FEF9E7;
  border-left: 4px solid #E67E22;
  border-radius: 4px;
  line-height: 1.5;
}

/* ── v6 複数例会カード ── */

.meeting-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f9f9f9;
}

.meeting-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.meeting-card-name {
  font-size: 15px;
  font-weight: bold;
  color: #1a1a2e;
}

/* ── v6 ポップアップ スクロール構造 ── */
.leaflet-popup-content {
  margin: 8px !important;
  max-height: 55vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.meetings-list {
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meeting-count-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: #1A5276;
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: bold;
  vertical-align: middle;
}

/* 閉じるボタン大型化 */
.leaflet-popup-close-button {
  font-size: 32px !important;
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  top: 2px !important;
  right: 2px !important;
  color: #333 !important;
}

/* ボトムナビ（常にfooter/map-attribution=16px分の直上に固定） */
#bottom-nav {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  height: 60px;
  background: #16213e;
  border-top: 1px solid #0f3460;
  display: flex;
  align-items: stretch;
  z-index: 1000;
  align-items: flex-start;
}

.bottom-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  font-family: inherit;
  gap: 2px;
  transition: color 0.2s, background 0.2s;
  height: 60px;
  -webkit-tap-highlight-color: transparent;
  padding: 6px 0;
}

.bottom-btn.active {
  color: #e94560;
}

.bottom-btn:active {
  background: rgba(255,255,255,0.08);
}

.bottom-icon {
  font-size: 22px;
  line-height: 1;
}

.bottom-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* 旧タブバー非表示 */
#tab-bar { display: none !important; }

/* フローティングメニューボタン非表示 */
#menu-toggle-float { display: none !important; }
#menu-panel { bottom: 65px !important; }

/* コンテンツエリアのボトム余白（60px=ボトムナビ + 16px=最下部の著作権表示帯/footer、合計は変わらず76px） */
#map { height: calc(100dvh - 76px) !important; }
/* 日程・お知らせタブは#footer(16px)の分だけ余白を追加確保 */
#schedule-view { padding-bottom: 76px; }
#news-view { padding-bottom: 76px; }

/* 画面下部フッター（©表記・開発ノートリンク）：
   マップタブでは非表示、日程・お知らせタブでは画面最下部（ボトムナビより下）に固定表示 */
#footer {
  display: none;
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  height: 16px;
  line-height: 16px;
  padding: 0 8px !important;
  padding-bottom: env(safe-area-inset-bottom) !important;
  font-size: 10px !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  z-index: 1001;
}

/* 地図外の著作権表示帯（画面最下部・ボトムナビより下・地図の可視領域は一切侵食しない） */
#map-attribution {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  height: 16px;
  background: #16213e;
  border-top: 1px solid #0f3460;
  color: rgba(255,255,255,0.4);
  font-size: 9px;
  line-height: 16px;
  text-align: center;
  z-index: 1001;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
}
#map-attribution a { color: rgba(255,255,255,0.5); }

/* 日程タブの日付文字を白に */
.sch-date-header { color: #ffffff !important; }
.sch-date-today { color: #e94560 !important; }

.locate-btn {
  width: 36px; height: 36px;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.2);
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 5px rgba(0,0,0,0.3);
}
.locate-btn:active { background: #f0f0f0; }


/* 位置情報ボタン */
.locate-btn {
  width: 36px; height: 36px;
  background: #fff;
  border: 2px solid rgba(0,0,0,0.2);
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 5px rgba(0,0,0,0.3);
  -webkit-tap-highlight-color: transparent;
}
.locate-btn:active { background: #f0f0f0; }

/* Leafletコントロール（ズーム等）を地図外バー＋ボトムナビの上に */
.leaflet-control-zoom { bottom: 86px !important; }

/* ヘッダー1行に */
#total-count { white-space: nowrap; font-size: 13px !important; }

/* Leaflet帰属（著作権表示）は地図内蔵版を無効化し、
   #map-attribution（地図外・ボトムナビ直上の独立バー）に置き換え済み */

/* 位置情報マーカーアイコン非表示 */
.leaflet-control-locate { display: none !important; }
/* ============================================================
   お知らせタブ スタイル
   style.css の末尾に追記する
   ============================================================ */

/* ── セクション共通 ────────────────────────────────────── */
#news {
  padding: 8px 0 80px;
  overflow-y: auto;
  height: 100%;
  background: var(--bg, #f5f5f5);
}

.news-section-title {
  font-size: 13px;
  font-weight: bold;
  color: #666;
  padding: 12px 12px 4px;
  margin: 0;
  border-top: 1px solid #ddd;
  letter-spacing: 0.05em;
}

.news-section-title:first-child {
  border-top: none;
}

/* ── カード本体 ─────────────────────────────────────────── */
.news-card {
  background: #fff;
  border-radius: 8px;
  margin: 6px 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-left: 4px solid #4a90d9;
}

.news-card-pdf {
  border-left-color: #e67e22;  /* PDF はオレンジ */
}

/* ── カードヘッダー（バッジ＋都道府県） ─────────────────── */
.news-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

/* ── バッジ ─────────────────────────────────────────────── */
.news-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.news-badge-event { background: #d0e8ff; color: #1a5fa8; }
.news-badge-pdf   { background: #fde5c8; color: #a04a00; }
.news-badge-news  { background: #d4edda; color: #155724; }

/* ── 都道府県ラベル ─────────────────────────────────────── */
.news-pref {
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}

/* ── タイトルリンク ─────────────────────────────────────── */
.news-card-title {
  display: block;
  font-size: 16px;
  font-weight: bold;
  color: #1a73e8;
  text-decoration: none;
  line-height: 1.4;
  margin-bottom: 5px;
  word-break: break-all;
}

.news-card-title:active {
  opacity: 0.7;
}

/* ── メタ情報（日付・会場） ─────────────────────────────── */
.news-card-meta {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

/* ── 出典 ───────────────────────────────────────────────── */
.news-card-source {
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
  text-align: right;
}

/* ── ステータスメッセージ ────────────────────────────────── */
.news-loading,
.news-empty,
.news-error {
  text-align: center;
  padding: 40px 16px;
  color: #888;
  font-size: 14px;
}

.news-error { color: #c0392b; }

/* ── 更新日時フッター ────────────────────────────────────── */
.news-updated {
  text-align: center;
  font-size: 11px;
  color: #bbb;
  padding: 16px 0 8px;
  margin: 0;
}

/* 近隣都道府県 折りたたみ */
.sch-section-header {
  padding: 10px 14px 6px;
  font-size: 13px;
  font-weight: bold;
  color: #a0a0b0;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #0f3460;
}
.sch-adj-details {
  border-bottom: 1px solid #0f3460;
}
.sch-adj-summary {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  color: #ccc;
  font-size: 15px;
}
.sch-adj-summary::-webkit-details-marker { display: none; }
.sch-adj-summary::before {
  content: '▶';
  font-size: 11px;
  margin-right: 8px;
  color: #888;
  transition: transform 0.2s;
}
details[open] .sch-adj-summary::before {
  transform: rotate(90deg);
}
.sch-adj-body {
  background: #12122a;
}

/* ============================================================
   会場詳細ボトムシート（ピンタップ用、ポップアップの置き換え）
   ============================================================ */
#sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#sheet-overlay.active { opacity: 1; pointer-events: auto; }

#bottom-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.75);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  z-index: 1201;
  max-height: 92vh;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
}
#bottom-sheet.open { transform: translateY(0); }

/* シート表示中はボトムナビ・Leafletコントロール（現在地ボタン等）を隠し、
   ボタンの取り合い・z-index競合を避ける */
body.sheet-active #bottom-nav,
body.sheet-active .leaflet-control-container {
  display: none !important;
}

.sheet-handle {
  width: 40px; height: 5px;
  background: #ddd;
  border-radius: 3px;
  margin: 10px auto 2px;
  flex-shrink: 0;
}

.sheet-close {
  position: absolute;
  top: 8px; right: 12px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  border: none;
  font-size: 16px;
  color: #666;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 1;
}

.sheet-scroll {
  overflow-y: auto;
  padding: 0.3rem 1.1rem calc(1.6rem + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  color: #222;
}

.sheet-venue-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f0f0f5; color: #c0392b;
  font-size: 15px; font-weight: 700;
  padding: 4px 11px; border-radius: 20px; margin-bottom: 8px;
}
.sheet-title { font-size: 24px; font-weight: 800; color: #16213e; margin: 0 0 4px; }
.sheet-address { font-size: 15px; color: #666; margin: 0 0 14px; }

.sheet-meeting-group {
  border: 1px solid #e0e0e8; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; background: rgba(250,250,253,0.65);
}
.sheet-meeting-group:last-child { margin-bottom: 0; }
.sheet-meeting-name { font-weight: 700; font-size: 24px; color: #16213e; }
.sheet-meeting-recurrence { font-size: 15px; color: #666; margin: 3px 0 8px; }
.sheet-upcoming-list { display: flex; flex-direction: column; gap: 6px; }
.sheet-upcoming-item {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 10px; background: rgba(255,255,255,0.6); border: 1px solid #ececf2; border-radius: 6px; font-size: 19px;
}
.sheet-date-badge {
  display: inline-block; font-size: 15px; font-weight: 700; color: #fff;
  padding: 2px 10px; border-radius: 11px; white-space: nowrap;
}
.sheet-upcoming-time { color: #666; font-size: 15px; }
.sheet-exception-note { font-size: 15px; color: #c0392b; margin-top: 4px; width: 100%; }

.sheet-section-title {
  font-size: 19px; font-weight: 700; color: #16213e;
  margin: 16px 0 8px; display: flex; align-items: center; gap: 6px;
}
.sheet-section-title::before {
  content: ''; width: 3px; height: 1em; background: #e94560; border-radius: 2px;
}

.sheet-btn-line, .sheet-btn-map, .sheet-btn-cal, .sheet-btn-official {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 10px; font-size: 19px; font-weight: 700;
  margin: 6px 0; text-decoration: none;
}
.sheet-btn-line { background: #06C755; color: #fff; }
.sheet-btn-map { background: #fff; color: #16213e; border: 1.5px solid #16213e; }
.sheet-btn-cal { background: #27AE60; color: #fff; }
.sheet-btn-official { background: #8E44AD; color: #fff; }

.sheet-verify-banner {
  background: #fff4e5; border: 1px solid #e0a030; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 19px; color: #8a5a00;
  display: flex; align-items: flex-start; gap: 6px; line-height: 1.6;
}
.sheet-verify-banner a { color: #8a5a00; text-decoration: underline; font-weight: 700; }

/* SEOサマリー（#app-shellの下に常時表示、generate_seo_summary.pyが自動生成） */
#seo-summary {
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 28px 16px 40px;
  line-height: 1.7;
}
#seo-summary h1 {
  font-size: 20px;
  color: #f0e8d0;
  margin: 0 0 12px;
}
#seo-summary > p {
  font-size: 14px;
  color: #b0b0c0;
  margin: 0 0 20px;
}
#seo-summary h2 {
  font-size: 16px;
  color: #e94560;
  border-bottom: 1px solid #0f3460;
  padding-bottom: 4px;
  margin: 24px 0 8px;
}
#seo-summary ul {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
#seo-summary li {
  font-size: 13px;
  color: #c8c8d8;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
#seo-summary li strong { color: #f0e8d0; }
