/* ==========================================================================
   Journey Archive - 人生の旅の軌跡
   DESIGN: Unisex & Timeless Elegance (中性的・男女問わず愛される上質な黒の地図)
   ========================================================================== */

:root {
  /* シックで深みのある黒とチャコール（冷たすぎず、品格あるダークトーン） */
  --bg-dark: #0a0c10;
  --surface-canvas: #12151d;
  --surface-card: rgba(18, 21, 29, 0.88);
  --surface-elevated: #1a1e28;
  --surface-input: #151822;

  /* ボーダー・境界線（繊細ですっきりした細線） */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-focus: #e2e8f0;

  /* 文字色（高い可読性と柔らかなコントラスト） */
  --text-main: #f8fafc;
  --text-body: #e2e8f0;
  --text-muted: #94a3b8;
  --text-soft: #64748b;

  /* アクセントカラー（男女問わず好まれるシャンパンゴールド ＆ パールホワイト） */
  --accent-gold: #f59e0b;
  --accent-gold-soft: #fbbf24;
  --accent-gold-glow: rgba(245, 158, 11, 0.35);
  --accent-pearl: #ffffff;
  --accent-sage: #34d399;       /* 国内の旅 */
  --accent-coral: #fb7185;      /* 海外の旅 */

  /* タイポグラフィ（知的で優しい中性的フォントスタック） */
  --font-family: "Plus Jakarta Sans", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fs-h1: 22px;
  --fs-title: 16px;
  --fs-body: 14px;
  --fs-small: 12px;
  --fs-note: 11px;

  /* 角丸（自然で手に馴染むスムースカーブ） */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* 余白 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;

  /* 影 */
  --shadow-device: 0 25px 60px -10px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-sheet: 0 -15px 40px rgba(0, 0, 0, 0.85);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: var(--fs-body);
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* PC時のアンビエント背景 */
.ambient-bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, #181d28 0%, #0a0c10 80%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   デバイスコンテナ（PC: 9:16フレーム / モバイル: 全画面）
   ========================================================================== */
.device-container {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 420px;
  max-height: 890px;
  margin: 0 auto;
  background-color: #07090d;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

@media (min-width: 501px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-2);
  }

  .device-container {
    height: 94vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-device);
    border: 2px solid #252b3b;
    transition: max-width 0.3s ease, border-radius 0.3s ease;
  }

  .device-container.fullscreen-mode {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
  }
}

@media (max-width: 500px) {
  .device-container {
    max-width: 100%;
    max-height: 100%;
    border: none;
  }
}

/* ==========================================================================
   ナビゲーションヘッダー
   ========================================================================== */
.app-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  z-index: 5;
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-sparkle {
  color: var(--accent-gold);
  font-size: 13px;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.header-btn {
  height: 28px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-body);
  font-size: var(--fs-small);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.share-btn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent-gold-soft);
}

.share-btn:hover {
  background: rgba(245, 158, 11, 0.22);
  color: #fff;
}

/* ==========================================================================
   Leaflet 地図領域（上品な黒の地図）
   ========================================================================== */
.map-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #07090d;
  z-index: 1;
}

.leaflet-control-zoom {
  display: none !important;
}

.leaflet-control-attribution {
  background: rgba(10, 12, 16, 0.7) !important;
  color: #64748b !important;
  font-size: 9px !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
}

.leaflet-control-attribution a {
  color: #94a3b8 !important;
  text-decoration: none;
}

/* ==========================================================================
   上部オーバーレイ：旅の思い出カード (STORY CARD)
   ========================================================================== */
.story-card {
  position: absolute;
  top: 96px;
  left: 12px;
  right: 12px;
  z-index: 4;
  background: var(--surface-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-date {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.2px;
}

.chip-tag {
  font-size: var(--fs-note);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(251, 113, 133, 0.14);
  color: #fca5a5;
}

.chip-tag.domestic {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
}

.phase-state {
  font-size: var(--fs-note);
  color: var(--text-muted);
}

.meta-counter {
  font-size: var(--fs-small);
  color: var(--text-muted);
  font-weight: 600;
}

.destination-head {
  display: flex;
  flex-direction: column;
}

.destination-name {
  font-size: var(--fs-h1);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.destination-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* Googleマップリンク（自然で優しいピルボタン） */
.gmap-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-body);
  font-size: 11px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.gmap-pill:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.story-memo {
  font-size: var(--fs-small);
  color: var(--text-body);
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border-left: 2.5px solid var(--accent-gold);
}

/* 進行ゲージ */
.story-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 2px;
}

.story-progress-glow {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), #ffffff);
  box-shadow: 0 0 8px var(--accent-gold-glow);
  transition: width 0.1s linear;
}

/* ==========================================================================
   右側クイックツール
   ========================================================================== */
.map-quick-tools {
  position: absolute;
  top: 230px;
  right: var(--sp-3);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.tool-btn {
  width: 38px;
  height: 38px;
  background: var(--surface-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.tool-btn:hover {
  background: var(--surface-elevated);
  color: var(--text-main);
  transform: scale(1.05);
}

.tool-btn:active {
  transform: scale(0.95);
}

/* ==========================================================================
   下部コントロールバー
   ========================================================================== */
.app-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  background: linear-gradient(to top, rgba(7, 9, 13, 0.98) 65%, rgba(7, 9, 13, 0.6) 90%, transparent 100%);
  padding: var(--sp-4) var(--sp-3) calc(var(--sp-4) + env(safe-area-inset-bottom, 8px));
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
}

.timeline-year {
  font-size: var(--fs-small);
  color: var(--text-muted);
  font-weight: 600;
  min-width: 48px;
}

.timeline-step {
  font-size: var(--fs-small);
  color: var(--text-muted);
  font-weight: 500;
  min-width: 40px;
  text-align: right;
}

.slider-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
}

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border: 2px solid var(--accent-gold);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
  cursor: pointer;
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* 操作ボタン */
.action-buttons-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.btn-sub {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sub:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-sub:active {
  transform: scale(0.93);
}

.btn-play-pause {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: none;
  color: #0f1218;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-play-pause:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.35);
}

.btn-play-pause:active {
  transform: scale(0.94);
}

.btn-speed {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--accent-gold-soft);
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-speed:hover {
  background: rgba(245, 158, 11, 0.15);
}

.btn-open-log {
  height: 42px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-open-log:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ==========================================================================
   ボトムシート（旅の引き出し）
   ========================================================================== */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 84%;
  background: var(--surface-canvas);
  border-top: 1px solid var(--border-medium);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-sheet);
  z-index: 10;
  display: flex;
  flex-direction: column;
  transform: translateY(105%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-sheet.active {
  transform: translateY(0%);
}

.drawer-grab-bar {
  width: 100%;
  padding: 10px 0 6px;
  display: flex;
  justify-content: center;
  cursor: grab;
}

.drawer-pill {
  width: 38px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--sp-4) var(--sp-2);
}

.drawer-title {
  font-size: var(--fs-title);
  font-weight: 700;
  color: var(--text-main);
}

.drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2) var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom, 12px));
  -webkit-overflow-scrolling: touch;
}

/* タブ切替 */
.tab-switcher {
  display: flex;
  gap: 4px;
  margin-bottom: var(--sp-4);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.tab-link {
  flex: 1;
  padding: 9px var(--sp-2);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.tab-link.active {
  background: var(--surface-elevated);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* フォーム */
.nice-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.field-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--text-body);
}

.date-pickers {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.select-box {
  flex: 1;
}

.select-box select {
  width: 100%;
  height: 42px;
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0 var(--sp-3);
  font-size: var(--fs-body);
  font-family: var(--font-family);
  outline: none;
  cursor: pointer;
}

.select-box select:focus {
  border-color: var(--border-focus);
}

.date-unit {
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.input-inline-btn {
  display: flex;
  gap: var(--sp-2);
}

.input-inline-btn input,
.field-item textarea {
  width: 100%;
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px var(--sp-3);
  font-size: var(--fs-body);
  font-family: var(--font-family);
  outline: none;
}

.input-inline-btn input:focus,
.field-item textarea:focus {
  border-color: var(--border-focus);
}

.btn-location-search {
  padding: 0 var(--sp-3);
  min-width: 86px;
  height: 42px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-location-search:hover {
  background: rgba(255, 255, 255, 0.16);
}

.location-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 6px var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  color: #6ee7b7;
}

.location-status.error {
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.25);
  color: #fca5a5;
}

.loc-flag {
  font-size: 18px;
  line-height: 1;
}

/* 複数都市周遊入力コンポーネント */
.field-label-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.field-help-tip {
  font-size: 11px;
  color: var(--accent-gold-soft);
  font-weight: 500;
}

.multi-city-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.city-row-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: border-color 0.2s ease;
}

.city-row-card:focus-within {
  border-color: var(--accent-gold);
}

.city-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.city-stop-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-remove-city {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-remove-city:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.city-add-actions {
  margin-top: 6px;
  margin-bottom: 6px;
}

.btn-add-city-stop {
  width: 100%;
  height: 36px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  color: var(--accent-gold);
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-add-city-stop:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--accent-gold);
}

/* フライト航路プレビュー */
.route-preview-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 6px;
}

.route-preview-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.route-preview-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
}

.route-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.route-chip.home {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.route-chip.via {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.route-arrow {
  color: var(--text-muted);
  font-size: 10px;
}

/* 周遊旅行バッジ・グループヘッダー */
.card-item-badge.multi-city {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.journey-group-header {
  margin: 12px 0 4px 0;
  padding: 4px 8px;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 4px 4px 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.03em;
}

.form-submit-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.btn-submit-main {
  height: 46px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: var(--fs-body);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  transition: all 0.15s ease;
}

.btn-submit-main:hover {
  filter: brightness(1.08);
}

.btn-cancel-edit {
  height: 38px;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-small);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cancel-edit:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

/* 周遊・帰還セレクター */
.round-trip-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-top: 4px;
}

.radio-option {
  cursor: pointer;
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  height: 100%;
}

.radio-card .radio-icon {
  font-size: 18px;
  line-height: 1.2;
}

.radio-card .radio-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-card .radio-text strong {
  font-size: var(--fs-small);
  color: var(--text-main);
  line-height: 1.3;
}

.radio-card .radio-text small {
  font-size: 10px;
  color: var(--text-soft);
  line-height: 1.2;
}

.radio-option input[type="radio"]:checked + .radio-card {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.radio-option input[type="radio"]:checked + .radio-card .radio-text strong {
  color: var(--accent-gold);
}

/* 履歴リスト */
.list-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-3);
  gap: 6px;
  flex-wrap: wrap;
}

.list-hint {
  font-size: var(--fs-note);
  color: var(--text-soft);
}

.list-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-text-sort {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  color: var(--accent-gold);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-text-sort:hover {
  background: var(--accent-gold);
  color: #fff;
}

.btn-text-clear {
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: var(--fs-note);
  cursor: pointer;
}

.btn-text-clear:hover {
  color: #fb7185;
}

.btn-text-reset {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--fs-note);
  text-decoration: underline;
  cursor: pointer;
}

.btn-text-reset:hover {
  color: var(--text-main);
}

.travel-cards-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.travel-card-item {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px var(--sp-3);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  user-select: none;
}

.travel-card-item:hover {
  border-color: rgba(245, 158, 11, 0.35);
  background: var(--surface-elevated);
}

/* 並び替え上下ボタン */
.card-order-controls {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 2px;
}

.btn-order-move {
  width: 22px;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
}

.btn-order-move:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.btn-order-move:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.card-item-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

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

.card-item-date {
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--accent-gold);
}

.card-item-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(251, 113, 133, 0.15);
  color: #fca5a5;
}

.card-item-badge.domestic {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
}

/* 周遊・帰還バッジ（ワンタップ切替） */
.btn-toggle-roundtrip {
  font-size: 10px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-toggle-roundtrip.return-home {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.btn-toggle-roundtrip.return-home:hover {
  background: rgba(245, 158, 11, 0.28);
}

.btn-toggle-roundtrip.via-next {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.btn-toggle-roundtrip.via-next:hover {
  background: rgba(56, 189, 248, 0.28);
}

.card-item-title {
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-country-flag {
  font-size: 15px;
  line-height: 1;
}

.card-item-memo {
  font-size: var(--fs-small);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.card-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-card-play {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-card-play:hover {
  background: var(--accent-gold);
  color: #fff;
  border-color: var(--accent-gold);
}

.btn-card-edit {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-card-edit:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: var(--border-medium);
}

.btn-card-delete {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-card-delete:hover {
  color: #fb7185;
}

/* ==========================================================================
   拠点設定モーダル ＆ トースト
   ========================================================================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.gentle-modal {
  position: absolute;
  top: 50%;
  left: var(--sp-4);
  right: var(--sp-4);
  transform: translateY(-50%) scale(0.96);
  background: var(--surface-canvas);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  z-index: 16;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

.gentle-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.modal-note {
  font-size: var(--fs-small);
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: var(--sp-3);
}

.home-base-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* トースト通知 */
.gentle-toast {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(26, 30, 40, 0.95);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  font-size: var(--fs-small);
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.gentle-toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Leaflet マーカー ＆ シャンパンゴールド光の軌跡
   ========================================================================== */
.hidden {
  display: none !important;
}

.mini-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 拠点マーカー（HOME BASE）- 上品なゴールドリング */
.kyoto-home-marker {
  position: relative;
  width: 22px;
  height: 22px;
}

.kyoto-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background-color: #d97706;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 10px #f59e0b;
  z-index: 2;
}

.kyoto-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(217, 119, 6, 0.3);
  animation: soft-pulse 2.2s infinite;
  z-index: 1;
}

/* 目的地マーカー（DESTINATION）- 鮮やかなルビー＆ホワイト */
.destination-marker {
  position: relative;
  width: 24px;
  height: 24px;
}

.destination-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background-color: #e11d48;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 12px rgba(225, 29, 72, 0.7);
  z-index: 2;
}

.destination-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(225, 29, 72, 0.25);
  animation: soft-pulse 1.8s infinite;
  z-index: 1;
}

@keyframes soft-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
  }
}

/* 進行中の光の粒子・飛行機マーカー */
.comet-head-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #d97706;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 12px #f59e0b;
}

/* 飛行機アイコン（機首が進行方向へ自動回転） */
.airplane-marker-wrapper {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.airplane-container {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s linear;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 8px rgba(245, 158, 11, 0.8));
}

.airplane-icon {
  width: 28px;
  height: 28px;
  transform-origin: center center;
}

.airplane-jet-pulse {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b, 0 0 14px #ffffff;
  animation: jet-engine-glow 0.6s infinite alternate;
}

@keyframes jet-engine-glow {
  0% { transform: translateX(-50%) scale(0.8); opacity: 0.7; }
  100% { transform: translateX(-50%) scale(1.4); opacity: 1.0; }
}

/* ==========================================================================
   iOS & ネイティブ拡張スタイル（カテゴリフィルター・新幹線・写真添付）
   ========================================================================== */

/* カテゴリフィルターバー */
.category-filter-nav {
  position: absolute;
  top: 54px;
  left: 12px;
  right: 12px;
  z-index: 950;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.category-filter-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 3px 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.filter-chip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-chip:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.filter-chip.active {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.45);
}

.filter-count {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.filter-chip.active .filter-count {
  background: rgba(245, 158, 11, 0.4);
  color: #fff;
}

/* 思い出カードの写真表示 */
.story-body-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.story-memo-wrap {
  flex: 1;
}

.story-photo-preview {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
  background: #000;
}

.overlay-photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 移動手段セレクター（飛行機・新幹線・車） */
.transport-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.btn-transport {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-transport .transport-icon {
  font-size: 16px;
}

.btn-transport .transport-text {
  font-size: 11px;
  font-weight: 600;
}

.btn-transport:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-transport.active {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--accent-gold);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

/* 写真添付ボックス */
.file-input-hidden {
  display: none;
}

.photo-upload-box {
  margin-top: 4px;
}

.btn-select-photo {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-select-photo:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-gold-soft);
  color: var(--text-main);
}

.photo-thumb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
}

.preview-thumb-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--accent-gold);
}

.btn-remove-photo {
  padding: 4px 10px;
  font-size: 11px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-remove-photo:hover {
  background: rgba(239, 68, 68, 0.35);
}

.card-item-photo-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* 新幹線・列車マーカー */
.train-marker-wrapper {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.train-container {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s linear;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 10px rgba(56, 189, 248, 0.9));
}

.train-icon-svg {
  width: 26px;
  height: 26px;
}

.train-rail-spark {
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 4px;
  border-radius: 2px;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8, 0 0 16px #ffffff;
  animation: train-sparkle 0.4s infinite alternate;
}

@keyframes train-sparkle {
  0% { opacity: 0.6; transform: translateX(-50%) scaleX(0.8); }
  100% { opacity: 1.0; transform: translateX(-50%) scaleX(1.4); }
}
