/**
 * Hokkaido Trip Planner 2026 - Master Luxury Stylesheet
 * High-Aesthetic Japanese Travel Theme: Autumn Foliage, Snow Slate & Google Maps Integration
 */

:root {
  --font-sans: 'Plus Jakarta Sans', 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --color-primary: #ea580c;
  --color-primary-hover: #c2410c;
  --color-primary-light: #ffedd5;
  --color-primary-glow: rgba(234, 88, 12, 0.2);

  --color-emerald: #10b981;
  --color-emerald-light: #d1fae5;
  --color-sky: #0284c7;
  --color-sky-light: #e0f2fe;
  --color-rose: #e11d48;
  --color-rose-light: #ffe4e6;
  --color-indigo: #6366f1;
  --color-indigo-light: #e0e7ff;
  --color-amber: #f59e0b;
  --color-amber-light: #fef3c7;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.1), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  --shadow-float: 0 20px 35px -5px rgba(15, 23, 42, 0.15), 0 10px 15px -5px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-fluid {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =========================================================
   HEADER & BRAND
   ========================================================= */
.app-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  gap: 1rem;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  font-size: 2.25rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(234, 88, 12, 0.3));
}

.brand-title {
  font-weight: 800;
  font-size: 1.35rem;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: #fff;
  border-color: #ea580c;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #c2410c, #9a3412);
  box-shadow: 0 6px 14px rgba(234, 88, 12, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border-strong);
  color: #334155;
}

.btn-outline:hover {
  background: var(--bg-page);
  border-color: var(--text-muted);
}

.btn-outline-danger {
  background: #ffffff;
  border-color: #fecdd3;
  color: #e11d48;
}

.btn-outline-danger:hover {
  background: #fff1f2;
  border-color: #fda4af;
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-focus-on-map {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  font-weight: 700;
}

.btn-focus-on-map:hover {
  background: #dcfce7;
  border-color: #86efac;
}

.btn-outline-map {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 600;
}

.btn-outline-map:hover {
  background: #dbeafe;
}

.btn-outline-edit {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  color: #475569;
}

.btn-outline-edit:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn-outline-delete {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
}

.btn-outline-delete:hover {
  background: #ffe4e6;
}

.btn-icon {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.45rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: #f8fafc;
  border-color: var(--border-strong);
}

/* =========================================================
   HERO BANNER & STATS DOCK
   ========================================================= */
.trip-hero-section {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 40%, #fee2e2 100%);
  border-bottom: 1px solid #fed7aa;
  padding: 2rem 0;
  position: relative;
  overflow: hidden;
}

.trip-hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 450px;
  height: 100%;
  background: radial-gradient(circle at 80% 20%, rgba(234, 88, 12, 0.12), transparent 70%);
  pointer-events: none;
}

.header-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.trip-tag {
  background: #ffffff;
  border: 1px solid #fdba74;
  color: #c2410c;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.trip-tag.date-tag {
  color: #0369a1;
  border-color: #7dd3fc;
}

.trip-tag.flight-tag {
  color: #4338ca;
  border-color: #a5b4fc;
}

.trip-title {
  font-size: 2.15rem;
  font-weight: 800;
  color: #7c2d12;
  letter-spacing: -0.025em;
  margin-bottom: 0.35rem;
}

.trip-subtitle {
  color: #9a3412;
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.header-quick-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.quick-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(253, 186, 116, 0.7);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.quick-text {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.5;
}

/* Stats Bar */
.stats-bar-section {
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 0;
}

#trip-stats-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.stat-pill {
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.95rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
}

.stat-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.stat-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-pill.highlight-warn {
  background: #fffbeb;
  border-color: #fde68a;
}
.stat-pill.highlight-warn .stat-num { color: #d97706; }

.stat-pill.highlight-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.stat-pill.highlight-ok .stat-num { color: #059669; }

.stat-progress-bar-wrap {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 0.3s ease;
}

/* =========================================================
   NAVIGATION TABS
   ========================================================= */
.main-view-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-tabs-wrap {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-top: 0.65rem;
  scrollbar-width: none;
}

.main-nav-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.main-nav-tab:hover {
  color: var(--text-main);
}

.main-nav-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Day Selection Bar */
.day-selection-bar {
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0;
}

.day-nav-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.day-tab-btn {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 150px;
  flex-shrink: 0;
}

.day-tab-btn:hover {
  border-color: var(--color-primary);
  background: #fffaf5;
}

.day-tab-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.25);
}

.day-tab-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
}

.day-tab-sub {
  display: block;
  font-size: 0.72rem;
  opacity: 0.9;
}

/* =========================================================
   SPLIT PLANNER GRID (Wanderlog / Google Maps Style)
   ========================================================= */
.app-main {
  padding-top: 1.5rem;
  padding-bottom: 4rem;
}

.split-planner-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.15fr) minmax(440px, 0.85fr);
  gap: 1.5rem;
  align-items: start;
}

.split-stream-pane {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.split-map-pane {
  position: sticky;
  top: 75px;
  height: calc(100vh - 95px);
  min-height: 600px;
}

.sticky-map-card {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
}

#map-canvas-container {
  width: 100%;
  height: 100%;
}

/* =========================================================
   FILTER TOOLBAR
   ========================================================= */
.filter-toolbar {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  flex: 1;
  min-width: 250px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  width: 100%;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.select-wrapper select {
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
}

/* =========================================================
   TIMELINE PLACE CARDS
   ========================================================= */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.day-section-divider {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-subtle);
}

.day-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
}

.day-badge-pill.day-1 { background: #f97316; }
.day-badge-pill.day-2 { background: #10b981; }
.day-badge-pill.day-3 { background: #0ea5e9; }
.day-badge-pill.day-4 { background: #f43f5e; }
.day-badge-pill.day-5 { background: #8b5cf6; }
.day-badge-pill.day-6 { background: #14b8a6; }

.day-section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.day-alert-banner {
  margin-top: 0.65rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.45;
}

.alert-luggage {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.alert-critical {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Place Card */
.place-timeline-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.place-timeline-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.place-timeline-card.highlight-glow {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.25), var(--shadow-md);
}

.place-timeline-card.day-border-1 { border-left: 6px solid #f97316; }
.place-timeline-card.day-border-2 { border-left: 6px solid #10b981; }
.place-timeline-card.day-border-3 { border-left: 6px solid #0ea5e9; }
.place-timeline-card.day-border-4 { border-left: 6px solid #f43f5e; }
.place-timeline-card.day-border-5 { border-left: 6px solid #8b5cf6; }
.place-timeline-card.day-border-6 { border-left: 6px solid #14b8a6; }

.place-timeline-card.is-completed {
  opacity: 0.65;
  background: #f8fafc;
}

.place-timeline-card.is-completed .place-name {
  text-decoration: line-through;
  color: #64748b;
}

.place-timeline-card.is-amano-highlight {
  border-color: #fca5a5;
  background: #fffbfb;
}

/* Card Left Time */
.card-left-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  border-right: 1px solid var(--border-subtle);
  padding-right: 1rem;
}

.time-main {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.time-end {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.duration-chip {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  margin-top: 0.45rem;
  white-space: nowrap;
}

.completion-toggle {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.chk-completed {
  cursor: pointer;
  accent-color: #10b981;
}

/* Card Main Details */
.card-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.cat-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.cat-food { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.cat-sightseeing { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.cat-shopping { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.cat-hotel { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.cat-transport { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }

.area-chip {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Badges */
.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-success { background: #d1fae5; color: #047857; }
.badge-neutral { background: #f1f5f9; color: #475569; }

.place-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
  cursor: pointer;
  transition: color 0.15s ease;
}

.place-name:hover {
  color: var(--color-primary);
}

.place-order-num {
  color: var(--color-primary);
  font-weight: 800;
}

.place-jp {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.place-meta-details {
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.meta-row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.meta-label {
  font-weight: 700;
  color: #475569;
}

.meta-closed {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.opening-status-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.status-open { background: #dcfce7; color: #166534; }
.status-warning { background: #fef3c7; color: #92400e; }
.status-unknown { background: #e2e8f0; color: #475569; }

.sunset-alert-chip {
  background: #fff7ed;
  border: 1px solid #ffedd5;
  color: #c2410c;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.btn-toggle-booking {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  margin-left: 0.35rem;
  transition: all 0.15s ease;
}

.btn-toggle-booking.is-booked {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.place-notes-box {
  background: #ffffff;
  border-left: 3px solid #cbd5e1;
  padding: 0.45rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.825rem;
  color: #334155;
  line-height: 1.45;
}

.card-footer-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* Card Right Photo Thumbnail */
.card-right-photo {
  width: 140px;
  height: 110px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.card-right-photo:hover {
  transform: scale(1.04);
}

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

.photo-map-chip {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

/* Transit Connector Card */
.transit-connector-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: 2rem;
  padding: 0.75rem 1.15rem;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  position: relative;
}

.transit-line-dot {
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px var(--color-primary);
  border-radius: 50%;
  flex-shrink: 0;
}

.transit-details {
  flex: 1;
}

.transit-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.transit-mode-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.mode-car { background: #fee2e2; color: #be123c; }
.mode-jr { background: #dbeafe; color: #1d4ed8; }
.mode-subway { background: #e0e7ff; color: #4338ca; }
.mode-bus { background: #fef3c7; color: #b45309; }
.mode-walk { background: #dcfce7; color: #15803d; }
.mode-ropeway { background: #ede9fe; color: #6d28d9; }
.mode-flight { background: #fae8ff; color: #86198f; }

.transit-time {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
}

.transit-dist {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.transit-desc {
  font-size: 0.825rem;
  color: #475569;
  margin-top: 0.2rem;
}

.transit-toll {
  font-size: 0.78rem;
  font-weight: 600;
  color: #d97706;
  margin-top: 0.15rem;
}

/* =========================================================
   GOOGLE MAP STYLES & CONTROLS
   ========================================================= */
.google-map-app-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #ffffff;
}

.map-toolbar-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  z-index: 10;
}

.map-brand-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gmap-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.map-brand-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.map-brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.map-actions-dock {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.map-layer-selector {
  display: flex;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.layer-pill {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
}

.layer-pill:hover {
  color: #0f172a;
}

.layer-pill.active {
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.map-city-presets {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.preset-pill {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-pill:hover {
  background: #fff7ed;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.leaflet-map-canvas {
  width: 100%;
  flex: 1;
  min-height: 480px;
  z-index: 1;
}

.map-bottom-legend {
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  z-index: 10;
}

.legend-pills {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.l-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
}

.l-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c, #ea580c);
}

.btn-open-google-dir {
  color: #047857;
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: none;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  transition: all 0.15s ease;
}

.btn-open-google-dir:hover {
  background: #d1fae5;
}

/* Custom Google Maps Teardrop Pins */
.gmap-custom-marker {
  background: transparent;
  border: none;
}

.gmap-pin-container {
  position: relative;
  width: 36px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gmap-pin-shadow {
  position: absolute;
  bottom: 0;
  left: 10px;
  width: 16px;
  height: 6px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  filter: blur(1.5px);
}

.gmap-pin-body {
  position: absolute;
  top: 0;
  left: 2px;
  width: 32px;
  height: 32px;
  background: var(--pin-color, #ea580c);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid #ffffff;
}

.gmap-pin-order {
  transform: rotate(45deg);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  font-family: var(--font-sans);
}

.gmap-pin-container:hover .gmap-pin-body,
.gmap-pin-body.bounce-active {
  transform: rotate(-45deg) scale(1.3) translateY(-6px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.45);
}

/* Google Maps Luxury Popup */
.gmap-luxury-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-float);
  border: 1px solid var(--border-subtle);
}

.gmap-luxury-popup .leaflet-popup-content {
  margin: 0;
  line-height: 1.4;
}

.gmap-popup-card {
  width: 290px;
  font-family: var(--font-sans);
}

.popup-photo-wrap {
  position: relative;
  width: 100%;
  height: 125px;
  background: #f1f5f9;
}

.popup-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-day-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.popup-inner-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.popup-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.popup-jp-name {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.popup-meta-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.75rem;
  font-weight: 700;
}

.time-pill {
  color: #0369a1;
}

.duration-pill {
  color: #475569;
}

.popup-hours-box {
  font-size: 0.75rem;
  color: #475569;
  background: var(--bg-page);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
}

.popup-notes-snip {
  font-size: 0.75rem;
  color: #334155;
  line-height: 1.4;
}

.popup-cta-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.btn-gmap-direct {
  flex: 1;
  background: #10b981;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.btn-gmap-direct:hover {
  background: #059669;
}

.btn-gmap-street {
  background: #f1f5f9;
  border: 1px solid var(--border-strong);
  color: #334155;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
}

.btn-gmap-street:hover {
  background: #e2e8f0;
}

/* =========================================================
   STRATEGY SECTION
   ========================================================= */
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.strategy-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.strategy-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.strategy-icon {
  font-size: 2.25rem;
  line-height: 1;
}

.strategy-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.strategy-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.step-card {
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem;
  margin-bottom: 0.75rem;
}

.step-card.highlight-step {
  background: #fff7ed;
  border-color: #fed7aa;
}

.step-badge {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.35rem;
}

.car-spec-banner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.car-spec-banner h4 {
  color: #065f46;
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.spec-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #047857;
}

.rental-details-table {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.85rem;
}

.r-row {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.45rem;
}

.r-label {
  font-weight: 700;
  color: #475569;
  width: 140px;
  flex-shrink: 0;
}

.r-val {
  color: var(--text-main);
  flex: 1;
}

/* =========================================================
   RECOMMENDATIONS SECTION
   ========================================================= */
.rec-section-header {
  margin-bottom: 1.5rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.5rem;
}

.rec-place-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rec-place-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
  transform: translateY(-3px);
}

.rec-photo-wrap {
  width: 100%;
  height: 160px;
  position: relative;
  background: #f1f5f9;
}

.rec-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-badge-area {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

.rec-body-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

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

.rec-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.booking-badge-mini {
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1f5f9;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.rec-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.rec-jp {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rec-desc {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
  flex: 1;
}

.rec-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.rec-hl-tag {
  background: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.rec-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
  margin-top: 0.65rem;
}

.rec-open-info {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* =========================================================
   WARNINGS SECTION
   ========================================================= */
.warnings-container {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.alert-box {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.alert-box .alert-icon {
  font-size: 2.25rem;
  line-height: 1;
}

.alert-box h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.alert-box p {
  font-size: 0.925rem;
  line-height: 1.55;
}

.alert-box.alert-critical {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-box.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-box.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

/* =========================================================
   DIALOG MODALS
   ========================================================= */
.app-dialog {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
  padding: 0;
  width: 90%;
  max-width: 660px;
  margin: auto;
}

.app-dialog.dialog-sm {
  max-width: 480px;
}

.app-dialog::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
}

.dialog-content {
  background: #ffffff;
  padding: 1.75rem;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.dialog-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-close-dialog {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.95rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.rec-dialog-target-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-bottom: 0.85rem;
}

/* =========================================================
   EMPTY STATE & FOOTER
   ========================================================= */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: #ffffff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 0.85rem;
}

.empty-state h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.app-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  padding: 2.25rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-sub {
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

/* =========================================================
   RESPONSIVE DESIGN (Mobile & Tablets)
   ========================================================= */
@media (max-width: 1024px) {
  .split-planner-grid {
    grid-template-columns: 1fr;
  }

  .split-map-pane {
    position: static;
    height: 500px;
    min-height: 500px;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    overflow-x: auto;
  }

  .place-timeline-card {
    flex-direction: column;
    gap: 0.85rem;
  }

  .card-left-time {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-right: 0;
    padding-bottom: 0.65rem;
  }

  .card-right-photo {
    width: 100%;
    height: 180px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .transit-connector-card {
    margin-left: 0.5rem;
  }
}

/* =========================================================
   PRINT STYLESHEET (Clean PDF export)
   ========================================================= */
@media print {
  .app-header,
  .main-view-nav,
  .day-selection-bar,
  .filter-toolbar,
  .card-reorder-actions,
  .card-footer-actions,
  .app-footer,
  .btn,
  .split-map-pane {
    display: none !important;
  }

  .split-planner-grid {
    grid-template-columns: 1fr !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .container, .container-fluid {
    max-width: 100%;
    padding: 0;
  }

  .place-timeline-card {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    margin-bottom: 0.75rem;
  }

  .day-section-divider {
    page-break-before: auto;
  }
}
