/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

/* CSS変数 - デザインシステム */
:root {
  /* カラーパレット - クリアスカイ・モダン（Clear Sky Modern） */
  --bg-primary: #F8FAFC;
  /* ほんのり青みがかった爽やかなクリア・オフホワイト */
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #F1F5F9;
  /* ホバー時に淡いスレートブルーへ */

  --text-primary: #334155;
  /* スレート・ネイビー（深く引き締まった青灰色） */
  --text-secondary: #64748B;
  --text-muted: #94A3B8;

  --accent-primary: #0284C7;
  /* クリアスカイ・ブルー（新幹線や青空を思わせる爽快な青） */
  --accent-secondary: #38BDF8;
  /* 明るいライトブルー */
  --accent-mustard: #F59E0B;
  /* 暖かみのあるアンバー（黄色） */
  --accent-silver: #CBD5E1;
  --accent-danger: #EA580C;
  /* サンセット・オレンジ（夕日のような温かい赤みのオレンジ） */
  --accent-success: #10B981;
  /* エメラルドグリーン */
  --accent-warning: #F59E0B;

  /* グラデーション */
  --gradient-primary: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  --gradient-silver: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
  --gradient-danger: linear-gradient(135deg, #EA580C 0%, #C2410C 100%);
  --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);

  /* スペーシング */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* ボーダー（インダストリアルからポップに、少し丸みを強める） */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* シャドウ（フラットでモダンな、ごく僅かな影のみ） */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);

  /* トランジション */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* リセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ページ上部のふんわりとしたグラデーションメッシュ（背景と溶け込むヘッダー用） */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 600px;
  /* グラデーションの高さ */
  /* グラデーションの高さ */
  background:
    radial-gradient(circle at 15% 0%, rgba(2, 132, 199, 0.05), transparent 60%),
    radial-gradient(circle at 85% 0%, rgba(56, 189, 248, 0.05), transparent 60%),
    linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, var(--bg-primary) 100%);
  z-index: -1;
  pointer-events: none;
  animation: backgroundPulse 10s ease-in-out infinite;
}

@keyframes backgroundPulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 0.8;
  }
}

/* ========== サイト共通 ピル型ヘッダー ========== */
.site-header {
  padding: var(--spacing-md) var(--spacing-md) 0;
  display: flex;
  justify-content: center;
  /* 中央寄せ */
  align-items: center;
  flex-wrap: wrap;
  /* 折り返しを許可 */
  gap: var(--spacing-md);
  /* バッジとの間隔 */
  position: relative;
  z-index: 10;
}

.site-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: var(--bg-card);
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  /* ピル型（完全な角丸） */
  box-shadow: var(--shadow-sm);
  /* 控えめな影 */
  border: 1px solid rgba(0, 0, 0, 0.03);
  /* 輪郭をわずかに際立たせる */
}

.brand-title {
  font-size: 1.25rem;
  /* 参考画像よりは読めるよう、大きめのフォントサイズ */
  font-weight: 800;
  color: var(--accent-primary);
  margin: 0;
  letter-spacing: -0.01em;
  white-space: nowrap;
  /* 折返し禁止 */
}

/* スマホ用タイトルはデフォで隠す */
.title-mobile {
  display: none;
}

.brand-divider {
  color: var(--text-muted);
  font-weight: 300;
  font-size: 1rem;
}

.brand-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* TIPSページで、ヘッダーに少し余白をもたせる用 */
.site-header-tips {
  margin-bottom: var(--spacing-sm);
}

/* フィルタセクション */
.filter-section {
  max-width: 1400px;
  margin: var(--spacing-lg) auto;
  padding: 0 var(--spacing-md);
}

/* 統合コントロールパネル（タブと検索バーの一体感） */
.unified-filter-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  /* 四角めの角丸に */
  padding: 1rem 1.2rem;
  /* 全体的な余白 */
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  border: 1px solid rgba(0, 0, 0, 0.06);
  gap: 0.5rem;
  /* タブと下のフィルターバーとの隙間 */
  margin-bottom: var(--spacing-lg);
}

/* サブフィルター（小カテゴリやドロップダウン） */
.sub-filters {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

/* メインタブ（独立した大きなセグメントコントロール） */
.main-tabs {
  display: flex;
  background: rgba(226, 232, 240, 0.6);
  /* 薄いグレーブルー系 */
  padding: 0.4rem;
  border-radius: 999px;
  /* 全体をカプセル型に */
  margin-bottom: 0;
  /* パネルに内包するため余白を消す */
  gap: 0.2rem;
}

.main-tab {
  flex: 1;
  padding: 0.7rem 1.2rem;
  /* しっかりと押しやすい大きなサイズに復元 */
  background: transparent;
  border: none;
  border-radius: 999px;
  /* 個別のタブもピル型 */
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  font-family: 'Noto Sans JP', sans-serif;
  text-align: center;
}

.main-tab.active {
  background: var(--bg-card);
  /* アクティブ時は白 */
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  /* 浮き上がる影 */
}

.main-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.4);
  color: var(--text-primary);
}

/* フィルタードロップダウン群 */
.filter-dropdowns {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  /* 画面が狭いときは折り返す */
  justify-content: center;
  /* 中央寄せ */
}

/* 事業者ドロップダウン */
.operator-select {
  padding: var(--spacing-xs) var(--spacing-md);
  background: #e8edf2;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  min-width: 200px;
  appearance: auto;
  transition: all var(--transition-fast);
}

.operator-select:hover {
  border-color: var(--accent-primary);
}

.operator-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(45, 159, 95, 0.15);
}

.filter-group {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
  justify-content: center;
  /* 中央寄せ */
}

.filter-btn {
  padding: var(--spacing-xs) var(--spacing-md);
  background: #e8edf2;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: 'Noto Sans JP', sans-serif;
  /* white-space: nowrap をここで設定するとラップしなくなるので、TIPSフィルターのみ解除する方針でいくか、
     ここでは nowrap を維持しつつ、レスポンシブ側で normal に直す */
  white-space: nowrap;
}

.filter-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.filter-btn.active {
  background: var(--gradient-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* メインコンテンツ */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-md) var(--spacing-xl);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
}

/* カウントダウンリスト */
.countdown-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 各セクションのドット色を定義（JS側のクラス付与に合わせる） */
.section-title::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  /* デフォルト色 */
}

/* 廃止セクション用 */
.section-title[data-cat="abolition"]::before {
  background: var(--accent-danger);
}

/* 減便セクション用 */
.section-title[data-cat="genben"]::before {
  background: #f59e0b;
  /* アクセントオレンジ */
}

/* 運休セクション用 */
.section-title[data-cat="unkyu"]::before {
  background: #8b5cf6;
  /* アクセントパープル */
}

.countdown-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* TIPSページ用グリッド設定を上書きして1カラムに戻す */
.tips-cat .countdown-cat-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.countdown-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  /* ごく淡い影 */
  border: 1px solid rgba(0, 0, 0, 0.04);
  /* 極細のグレー境界線 */
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.countdown-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(45, 159, 95, 0.1), transparent);
  transition: left 0.5s;
}

.countdown-card:hover::before {
  left: 100%;
}

.countdown-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  /* 大きく拡散する柔らかい影 */
  border-color: rgba(0, 0, 0, 0.08);
}

.countdown-card.abolished {
  border-color: var(--text-muted);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-sm);
}

.line-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.operator-badge {
  padding: 0.25rem 0.75rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  color: white;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  color: white;
}

.status-badge.badge-abolition {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.status-badge.badge-genben {
  background: linear-gradient(135deg, #e67e22, #d35400);
}

.status-badge.badge-unkyu {
  background: linear-gradient(135deg, #8e44ad, #7d3c98);
}

.section-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-xs);
}

.countdown-display {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: var(--spacing-sm) 0;
}

.days-remaining {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.days-remaining.urgent {
  background: var(--gradient-danger);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.days-remaining.abolished {
  background: var(--text-muted);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.abolition-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.description {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: var(--spacing-xs);
  line-height: 1.5;
}

/* 共有ボタンのアクションエリア */
.card-actions {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-sm);
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: flex-end;
}

.share-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background-color: #0f1419;
  /* Xのブランドカラー */
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(15, 20, 25, 0.2);
}

.share-action-btn:hover {
  background-color: #272c30;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(15, 20, 25, 0.3);
}

.share-action-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* 地図セクション */
.map-section {
  position: sticky;
  top: var(--spacing-md);
  height: fit-content;
}

#map {
  width: 100%;
  height: 600px;
  border-radius: 16px;
  /* マップ全体を角丸にする */
  border: 1px solid rgba(0, 0, 0, 0.05);
  /* 極細の境界線 */
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06);
  /* 内側に落ちる影で窓枠のように */
  overflow: hidden;
  /* 角丸からはみ出る部分をクリップする */
  z-index: 1;
  /* z-indexを明示して前面のUI要素と干渉しないようにする */
}

/* Leafletカスタムスタイル */
.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.leaflet-popup-tip {
  background: var(--bg-card);
}

.popup-content h3 {
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
}

.popup-content p {
  margin: 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* 空状態 */
.empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
}

/* ダイヤ改正バッジ（トップページ用）はヘッダー内でFlex配置されるため余白をリセット */
.tips-badge-wrap {
  display: flex;
  align-items: center;
}

.tips-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  background: linear-gradient(135deg, #1aa3ff, #005ce6);
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 92, 230, 0.25);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.tips-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: skewX(-20deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% {
    left: -100%;
  }

  20% {
    left: 200%;
  }

  100% {
    left: 200%;
  }
}

.tips-back-link:hover {
  opacity: 0.7;
}

.tips-page-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--spacing-md);
}

/* 概要カード (Glassmorphism) */
.tips-overview {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 3rem;
}

.tips-overview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.tips-overview-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.tips-overview-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tips-overview-divider {
  width: 1px;
  height: 40px;
  background: rgba(0, 0, 0, 0.08);
}

/* カテゴリフィルタ（スマホ向け） */
.tips-filter-container {
  margin-bottom: 2.5rem;
  position: relative;
}

.tips-filter-scroll {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Firefox */
}

.tips-filter-scroll::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari */
}

/* アニメーション */
.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* カテゴリセクション */
.tips-cat {
  margin-bottom: 3rem;
  position: relative;
}

.tips-cat-head {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--cat-color);
  background: linear-gradient(90deg, var(--cat-bg) 0%, transparent 100%);
  padding: 1rem;
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
  user-select: none;
}

.tips-cat-head:hover {
  background: linear-gradient(90deg, var(--cat-bg) 0%, rgba(255, 255, 255, 0.5) 100%);
}

.tips-cat-head-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.tips-cat-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.tips-cat-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.tips-cat-count {
  background: var(--cat-bg);
  color: var(--cat-color);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  margin-left: max(1rem, auto);
}

.tips-cat-toggle {
  color: var(--cat-color);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tips-cat-toggle svg {
  transition: transform 0.3s ease;
}

.toggle-vertical {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

/* アコーディオン開閉状態 */
.tips-cat.is-collapsed .tips-cat-body {
  display: none !important;
}

.tips-cat.is-collapsed .tips-cat-head {
  border-bottom-color: transparent;
  border-radius: 12px;
  margin-bottom: 0;
}

/* 閉じている時は[+]に見せるため、縦線を表示 (デフォルトは[-]なので縦線を隠すか回転する) */
/* 今回の実装はデフォルト[-] (水平線のみ)、.is-collapsed時に[+] (縦横線) にする想定だが、
   SVGは十字(+)として描画している前提でCSSを書く */
.tips-cat:not(.is-collapsed) .toggle-vertical {
  transform: rotate(90deg);
  opacity: 0;
}

/* カテゴリ内グリッド */
.tips-cat-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
}

/* 個別カード */
.tips-item {
  background: white;
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  /* ごく淡い影 */
  border: 1px solid rgba(0, 0, 0, 0.04);
  /* 極細のグレー境界線 */
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
}

.tips-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--cat-color);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tips-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  /* 大きく拡散する柔らかい影 */
  border-color: rgba(0, 0, 0, 0.08);
}

.tips-item:hover::before {
  opacity: 1;
}

/* カードヘッダー */
.tips-item-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.tips-item-icon {
  font-size: 1.2rem;
}

.tips-item-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.tips-item-date {
  font-size: 0.75rem;
  color: var(--cat-color);
  background: var(--cat-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin-left: auto;
  font-weight: 600;
}

/* カードリスト */
.tips-item-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.tips-item-list li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 1.2rem;
  position: relative;
}

.tips-item-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cat-color);
  opacity: 0.6;
}

/* 公式リンク */
.tips-item-link {
  font-size: 0.8rem;
  color: var(--cat-color);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  align-self: flex-end;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  background: var(--cat-bg);
  transition: all 0.2s ease;
}

.tips-item-link:hover {
  background: var(--cat-color);
  color: white;
}

/* 改正なしスタイル */
.tips-item.is-none {
  opacity: 0.7;
  background: #f9f9fb;
  box-shadow: none;
  border: 1px dashed #d1d9e6;
}

.tips-item.is-none:hover {
  transform: none;
  box-shadow: none;
}

.tips-item.is-none .tips-item-date {
  background: #e9ecef;
  color: var(--text-muted);
}

.tips-item.is-none .tips-item-list li {
  color: var(--text-muted);
  font-style: italic;
}

.tips-item.is-none .tips-item-list li::before {
  background: var(--text-muted);
  opacity: 0.4;
}

/* --- レスポンシブデザイン --- */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .map-section {
    position: relative;
    top: 0;
  }

  #map {
    height: 400px;
  }
}

@media (max-width: 768px) {
  header {
    padding: var(--spacing-md) var(--spacing-sm);
  }

  h1 {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  .subtitle {
    font-size: 0.85rem;
  }

  .filter-section {
    padding: 0 var(--spacing-sm);
    margin: var(--spacing-sm) auto;
  }

  .main-tab {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }

  .glass-toolbar {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius-lg);
    /* 縦積みの場合はピル型を弱める */
    padding: var(--spacing-sm);
  }

  .toolbar-divider {
    display: none;
    /* スマホでは区切り線を隠す */
  }

  .main-tabs {
    flex-direction: row;
    /* タブ自体は横並びを維持 */
    background: rgba(226, 232, 240, 0.4);
  }

  .filter-group {
    justify-content: center;
  }

  .operator-select {
    width: 100%;
    min-width: unset;
  }

  .filter-dropdowns {
    flex-direction: column;
  }

  .filter-group {
    gap: 0.35rem;
  }

  .filter-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    border-radius: 6px;
  }

  .main-content {
    padding: 0 var(--spacing-sm) var(--spacing-md);
    gap: var(--spacing-sm);
  }

  .section-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-align: center;
  }

  .countdown-list {
    gap: 0.75rem;
  }

  .countdown-card {
    padding: var(--spacing-sm);
  }

  #map {
    height: 350px;
  }

  /* TIPS Responsive */
  .tips-badge-wrap {
    padding: 0;
    justify-content: center;
  }

  .tips-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    background: rgba(26, 163, 255, 0.1);
    color: var(--accent-primary);
    box-shadow: none;
    border: 1px solid rgba(26, 163, 255, 0.3);
  }

  .tips-badge::before {
    display: none;
  }

  /* TIPSフィルタのスマホ最適化（折り返し表示） */
  .tips-filter-scroll {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
  }

  .tips-page-content {
    padding: var(--spacing-sm);
  }

  .tips-cat {
    margin-bottom: 2rem;
  }

  .tips-cat-body {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .tips-item {
    padding: 1rem;
    gap: 0.8rem;
  }

  .tips-item-top {
    gap: 0.6rem;
  }

  .tips-item-name {
    font-size: 1.05rem;
  }

  .tips-item-date {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
  }

  .tips-item-list {
    margin-bottom: 0.5rem;
  }

  .tips-item-list li {
    font-size: 0.85rem;
    padding-left: 1rem;
    margin-bottom: 0.3rem;
  }

  .tips-overview {
    padding: 1rem;
    margin-bottom: 2rem;
    gap: 0.5rem;
  }

  .tips-overview-divider {
    height: 30px;
  }

  .tips-overview-num {
    font-size: 1.8rem;
  }

  .tips-cat-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding: var(--spacing-md) var(--spacing-sm) var(--spacing-sm);
    flex-wrap: wrap;
    /* スタック（折り返し）を許可 */
    gap: var(--spacing-sm);
  }

  .site-header::-webkit-scrollbar {
    display: none;
    /* Chrome/Safariスクロールバー非表示 */
  }

  .site-brand-pill {
    padding: 0.8rem 1.2rem;
    /* カプセルの余白を確保 */
    gap: 0.6rem;
    flex-wrap: wrap;
    /* カプセル内の折り返しを許可 */
    border-radius: 999px;
    flex-direction: column;
    /* スマホでは縦並びベースに */
    align-items: center;
    /* 中央に揃える */
    width: 100%;
    /* 横幅いっぱいに使う */
  }

  .brand-title {
    font-size: 1.2rem;
    /* スマホでもしっかり読めるサイズに復元 */
    width: auto;
    text-align: center;
  }

  /* スマホの時は短いタイトルに切り替え */
  .title-desktop {
    display: none !important;
  }

  .title-mobile {
    display: inline !important;
  }

  .brand-divider {
    display: none;
    /* 縦積みになるため区切り線は非表示 */
  }

  .brand-subtitle {
    font-size: 0.85rem;
    /* サブタイトルも読めるサイズに */
    white-space: normal;
    /* 折り返しを許可 */
    width: auto;
    text-align: center;
  }

  /* ドロップダウンのスマホ最適化（横並び・固定長化） */
  .filter-dropdowns {
    width: 100%;
    flex-direction: row;
    /* 横並びを強制 */
    flex-wrap: nowrap;
    /* 折り返しを禁止して横並びに */
    gap: 8px;
    /* 隙間を固定 */
  }

  .operator-select {
    flex: 1 1 50%;
    /* 50%ずつに分割 */
    min-width: 0;
    /* フレックスアイテムが溢れないようにする */
    padding: 0.5rem 0.2rem;
    /* パディングを減らす */
    font-size: 0.85rem;
    /* スマホ向けにフォントサイズを微調整 */
    text-overflow: ellipsis;
    /* 文字があふれる場合は省略記号 */
  }

  .filter-btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
    white-space: normal;
    /* 折り返しを許可 */
  }

  .main-content {
    padding: 0 0.5rem var(--spacing-sm);
  }

  .section-title {
    font-size: 1.1rem;
  }

  .days-remaining {
    font-size: 1.3rem;
  }

  #map {
    height: 280px;
  }

  .tips-overview-num {
    font-size: 1.5rem;
  }

  .tips-overview-label {
    font-size: 0.7rem;
  }
}

/* スクロールバー */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #e8edf2;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* --- 路線の軌跡タイムライン --- */
.history-section {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 4px 6px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.history-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-main);
  border-bottom: 2px solid var(--accent-primary);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.history-timeline {
  position: relative;
  padding-left: 2.5rem;
}

.history-timeline::before {
  content: '';
  position: absolute;
  top: 5px;
  bottom: 0;
  left: 9px;
  width: 2px;
  background-color: #2b2b2b;
  /* Match user's black solid line */
  z-index: 0;
}

.history-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.history-item:last-child {
  margin-bottom: 0;
}

.history-dot {
  position: absolute;
  top: 2px;
  left: -2.5rem;
  width: 20px;
  height: 20px;
  background-color: #334155;
  border-radius: 50%;
  z-index: 10;
}

.history-content {
  display: flex;
  flex-direction: column;
}

.history-date {
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: bold;
  margin-bottom: 0.4rem;
}

.history-event {
  font-size: 1.1rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* --- 路線図 (ルートダイアグラム) --- */
.route-diagram-section {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 4px 6px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.route-diagram-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-main);
  border-bottom: 2px solid var(--accent-primary);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.route-diagram-container {
  display: flex;
  align-items: flex-start;
  /* top alignment for text */
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  margin-left: 1rem;
}

.route-station {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  position: relative;
  z-index: 2;
}

.station-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  box-sizing: border-box;
}

.station-dot.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  /* Add blue border to active nodes instead of white/bg-card */
}

.station-dot.abolished {
  background-color: #d1d5db;
  /* light gray */
  border-color: #d1d5db;
}

.station-name {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
}

.route-line {
  flex-grow: 1;
  min-width: 60px;
  height: 4px;
  margin: 0 -10px;
  /* 線の重なり調整 */
  margin-top: 8px;
  /* dotの中央に線を合わせる (20px/2) + border margin etc */
  align-self: flex-start;
  /* コンテナの先頭（上端）からの位置を基準とする */
  z-index: 1;
}

.route-line.active {
  background-color: var(--primary-color);
  border: none;
  height: 4px;
  margin-top: 8px;
}

.route-line.abolished {
  background-color: transparent;
  border-top: 4px dashed #d1d5db;
  /* light gray */
  height: 0;
  margin-top: 8px;
  /* same as above */
}

.route-seo-text {
  font-size: 0.95rem;
  color: var(--text-light);
  background: var(--bg-body);
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  line-height: 1.5;
}

/* --- 追加情報 (詳細・代替手段) --- */
.extended-info-section {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 4px 6px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.extended-info-block {
  margin-bottom: 2rem;
}

.extended-info-block:last-child {
  margin-bottom: 0;
}

.extended-info-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.extended-info-text {
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .route-diagram-container {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 20px;
  }

  .route-station {
    flex-direction: row;
    gap: 1.5rem;
    min-width: auto;
    margin-bottom: 2rem;
  }

  .station-name {
    margin-top: 0;
    font-size: 1rem;
  }

  .route-line {
    width: 4px;
    height: 3.5rem;
    /* depending on margin-bottom of station */
    flex-grow: 0;
    margin: -2.3rem 0 -1.5rem 8px;
    /* vertical line exactly below the dot */
    background-color: var(--primary-color);
  }

  .route-line.abolished {
    width: 0;
    height: 3.5rem;
    border-top: none;
    border-left: 4px dashed #d1d5db;
    /* light gray */
    margin: -2.3rem 0 -1.5rem 10px;
    background-color: transparent;
  }
}