/* ============================================================
   Japan Trip Map — Stylesheet
   ============================================================ */

:root {
  --bg: #FAF7F2;
  --bg-2: #FBEFE8;
  --bg-card: #FFFFFF;
  --bg-soft: #F4EFE6;
  --bg-accent: #EFE4D2;
  --line: #E5DDD0;
  --line-strong: #D4C7B0;
  --text: #2A1F12;
  --text-muted: #7A6A55;
  --text-soft: #A89A82;
  --brand: #7B3F1A;
  --brand-soft: #C68A5A;
  --sakura: #E8B4B8;
  --sun: #D9533F;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(232,180,184,0.35), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(198,138,90,0.18), transparent 60%),
    linear-gradient(180deg, #FBEFE8 0%, var(--bg) 40%, var(--bg) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.49 0 0 0 0 0.39 0 0 0 0 0.27 0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.25;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 0;
}

/* ============================================================
   Background scene — animated Japan ambience
   ============================================================ */
.bg-scene {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Seigaiha wave pattern band at top */
.bg-seigaiha {
  position: absolute;
  top: 0; left: 0; right: 0;
  width: 100%; height: 140px;
  opacity: 0.55;
}

/* Mt. Fuji silhouette fixed at bottom */
.bg-fuji {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  width: 100%; height: 320px;
  filter: blur(0.4px);
}

/* Pulsing sun top-right */
.bg-sun {
  position: absolute;
  top: 70px; right: 8%;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgba(217, 83, 63, 0.45) 0%,
    rgba(217, 83, 63, 0.28) 35%,
    rgba(217, 83, 63, 0.12) 60%,
    transparent 75%);
  animation: sunPulse 5s ease-in-out infinite;
  filter: blur(1px);
}
@keyframes sunPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.08); opacity: 1; }
}

/* Drifting clouds */
.bg-cloud {
  position: absolute;
  width: 240px;
  opacity: 0.85;
  will-change: transform;
}
.bg-cloud svg { width: 100%; height: auto; display: block; }
.bg-cloud-1 {
  top: 12%;
  animation: cloudDrift 90s linear infinite;
  animation-delay: -10s;
}
.bg-cloud-2 {
  top: 24%;
  width: 180px;
  animation: cloudDrift 130s linear infinite;
  animation-delay: -45s;
}
.bg-cloud-3 {
  top: 6%;
  width: 300px;
  animation: cloudDrift 110s linear infinite;
  animation-delay: -70s;
}
@keyframes cloudDrift {
  from { transform: translateX(-300px); }
  to   { transform: translateX(calc(100vw + 300px)); }
}

/* Sakura petals layer */
.bg-sakura {
  position: absolute; inset: 0;
}
.petal {
  position: absolute;
  top: -40px;
  width: 18px; height: 18px;
  will-change: transform;
  pointer-events: none;
}
.petal svg { width: 100%; height: 100%; display: block; }
.petal.fall {
  animation:
    petalFall var(--fall-dur, 18s) linear infinite,
    petalSway var(--sway-dur, 4s) ease-in-out infinite alternate,
    petalSpin var(--spin-dur, 6s) linear infinite;
  animation-delay: var(--fall-delay, 0s), var(--sway-delay, 0s), 0s;
}
@keyframes petalFall {
  from { transform: translateY(-40px); }
  to   { transform: translateY(calc(100vh + 60px)); }
}
@keyframes petalSway {
  from { margin-left: calc(var(--sway-amp, 40px) * -1); }
  to   { margin-left: var(--sway-amp, 40px); }
}
@keyframes petalSpin {
  from { rotate: 0deg; }
  to   { rotate: 360deg; }
}

/* Reduced motion: keep scene but freeze animations */
@media (prefers-reduced-motion: reduce) {
  .bg-cloud, .bg-sun, .petal.fall { animation: none !important; }
  .bg-sakura { display: none; }
}

/* Mobile: trim scene density */
@media (max-width: 640px) {
  .bg-cloud-3 { display: none; }
  .bg-fuji { height: 220px; }
  .bg-sun { width: 100px; height: 100px; top: 50px; }
}
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 28px 64px;
  position: relative;
  z-index: 1;
}

/* ===== Header ===== */
.header {
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 36px 32px 32px;
  background: linear-gradient(135deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.45) 100%);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.header-bg {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.header-bg svg { width: 100%; height: 100%; display: block; }
.header-kanji {
  position: absolute;
  right: -10px; top: -30px;
  font-family: 'Shippori Mincho', serif;
  font-size: 220px;
  font-weight: 700;
  color: rgba(123, 63, 26, 0.05);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
.header-content { position: relative; z-index: 2; }
.eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 0.22em;
  color: var(--brand); text-transform: uppercase; margin-bottom: 12px;
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: ''; width: 24px; height: 1px; background: var(--brand-soft);
}
.header h1 {
  font-size: 44px; font-weight: 600; letter-spacing: -0.025em;
  line-height: 1.1; margin-bottom: 10px;
}
.header h1 .jp {
  font-family: 'Shippori Mincho', serif;
  color: var(--brand); font-weight: 700;
  font-style: italic;
}
.header .sub {
  font-size: 15px; color: var(--text-muted);
  max-width: 620px;
}
.header .sub strong { color: var(--text); font-weight: 500; }

/* ===== Stats ===== */
.stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  margin-bottom: 28px;
}
.stat {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}
.stat:hover {
  transform: translateY(-2px);
  border-color: var(--brand-soft);
  box-shadow: 0 8px 24px -12px rgba(123, 63, 26, 0.25);
}
.stat-icon {
  position: absolute; right: 10px; top: 10px;
  width: 18px; height: 18px;
  color: var(--brand-soft); opacity: 0.6;
}
.stat-label {
  font-size: 11px; color: var(--text-soft); margin-bottom: 4px;
  letter-spacing: 0.06em;
}
.stat-value {
  font-size: 22px; font-weight: 600; letter-spacing: -0.015em;
  font-family: 'Shippori Mincho', serif;
}
.stat-value .unit {
  font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 4px;
  font-family: 'IBM Plex Sans Thai', sans-serif;
}

/* ===== Day tabs ===== */
.day-tabs {
  display: grid;
  grid-template-columns: minmax(90px, 0.85fr) repeat(10, 1fr);
  gap: 6px; margin-bottom: 16px;
  padding-bottom: 6px;
}
.day-tab {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 8px; cursor: pointer;
  transition: all 0.2s cubic-bezier(.4,0,.2,1); font-family: inherit; text-align: center;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.day-tab .tab-chip {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--line);
  transition: background 0.2s ease;
}
.day-tab:hover {
  border-color: var(--line-strong);
  background: var(--bg-soft);
  transform: translateY(-1px);
}
.day-tab .tab-label {
  font-size: 9px; letter-spacing: 0.16em; color: var(--text-soft);
  font-weight: 500; text-transform: uppercase; margin-bottom: 2px;
}
.day-tab .tab-num { font-size: 17px; font-weight: 600; line-height: 1.1; }
.day-tab .tab-date { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.day-tab.active {
  background: var(--brand); border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -8px rgba(123, 63, 26, 0.5);
}
.day-tab.active .tab-chip { background: var(--bg-accent); opacity: 0.5; }
.day-tab.active .tab-label,
.day-tab.active .tab-num,
.day-tab.active .tab-date { color: white; }
.day-tab.active .tab-label { opacity: 0.75; }
.day-tab.all { background: var(--bg-accent); border-color: var(--line-strong); }
.day-tab.all .tab-chip { display: none; }
.day-tab.all.active { background: var(--text); border-color: var(--text); }

/* ===== Main grid ===== */
.main-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  min-height: 640px;
  box-shadow: 0 12px 40px -20px rgba(42, 31, 18, 0.12);
}
.map-wrap { position: relative; }
#map {
  height: 640px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  z-index: 0;
}
.map-legend-box {
  position: absolute; right: 14px; bottom: 14px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  z-index: 500;
  max-width: 200px;
}
.map-legend-box .ml-title {
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 500; margin-bottom: 6px;
}
.ml-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
}
.ml-cell {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; cursor: pointer; padding: 2px; border-radius: 4px;
  transition: background 0.15s ease;
}
.ml-cell:hover { background: var(--bg-soft); }
.ml-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.ml-num { font-size: 9px; font-weight: 600; color: var(--text); }

/* ===== Sidebar ===== */
.sidebar {
  display: flex; flex-direction: column;
  max-height: 640px;
  overflow-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

.sb-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.sb-eyebrow {
  font-size: 10px; letter-spacing: 0.18em; color: var(--brand);
  text-transform: uppercase; font-weight: 500; margin-bottom: 4px;
  display: inline-flex; align-items: center; gap: 6px;
}
.sb-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
}
.sb-title {
  font-size: 22px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2;
  font-family: 'Shippori Mincho', serif;
}
.sb-date { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.sb-description {
  font-size: 13px; color: var(--text); margin-top: 10px;
  padding: 10px 12px; background: var(--bg-soft);
  border-left: 3px solid var(--brand-soft);
  border-radius: 6px; line-height: 1.55;
}

.sb-meta {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.meta-pill {
  font-size: 11px; color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex; align-items: center; gap: 4px;
}
.meta-pill .l {
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-soft); margin-right: 2px;
}

/* ===== Steps ===== */
.sb-steps { display: flex; flex-direction: column; }
.sb-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px 10px 12px 8px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background 0.18s ease, transform 0.18s ease;
  border-left: 2px solid transparent;
}
.sb-step:hover {
  background: var(--bg-soft);
  transform: translateX(2px);
}
.sb-step.highlight {
  background: var(--bg-accent);
  border-left-color: var(--brand);
}
.sb-step::before {
  content: ''; position: absolute;
  left: 25px; top: 42px; bottom: -8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--line) 0%, var(--line) 50%, transparent 100%);
  z-index: 0;
}
.sb-step:last-child::before { display: none; }
.step-marker {
  width: 28px; height: 28px;
  background: var(--bg-card);
  border: 2px solid var(--brand);
  color: var(--brand);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
  z-index: 1; position: relative;
  margin-top: 4px;
  font-family: 'Shippori Mincho', serif;
}
.step-body { padding-top: 2px; min-width: 0; }
.step-period {
  font-size: 10px; color: var(--text-soft); letter-spacing: 0.12em;
  text-transform: uppercase; font-weight: 500; margin-bottom: 3px;
  display: inline-flex; align-items: center; gap: 5px;
}
.step-period svg { width: 11px; height: 11px; }
.step-time {
  font-size: 10px; color: var(--text-muted); letter-spacing: 0;
  text-transform: none; margin-left: 6px;
  padding-left: 6px; border-left: 1px solid var(--line);
}
.step-place {
  font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 3px;
}
.step-desc {
  font-size: 12px; color: var(--text); line-height: 1.55;
  margin-top: 4px; margin-bottom: 4px;
}
.step-note {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
}
.step-tags {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.step-tags .tag {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: var(--bg-accent); color: var(--brand);
  font-weight: 500;
}
.step-photos {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px; margin-top: 8px;
}
.step-photos img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line);
  cursor: zoom-in;
  transition: transform 0.2s ease;
}
.step-photos img:hover { transform: scale(1.04); }
.step-links {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px;
}
.step-links a {
  font-size: 11px; color: var(--brand); text-decoration: none;
  padding: 2px 8px; border: 1px solid var(--line);
  border-radius: 999px; transition: all 0.15s ease;
}
.step-links a:hover {
  background: var(--brand); color: white; border-color: var(--brand);
}
.step-distance {
  font-size: 10px; color: var(--text-soft); margin-top: 6px;
  letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(123, 63, 26, 0.05);
  padding: 2px 8px;
  border-radius: 999px;
}

/* ===== All-days panel ===== */
.all-summary {
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
.all-day-card {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.4,0,.2,1);
}
.all-day-card:hover {
  border-color: var(--brand-soft);
  background: var(--bg-soft);
  transform: translateX(2px);
  box-shadow: 0 4px 12px -6px rgba(123, 63, 26, 0.2);
}
.ad-num {
  width: 34px; height: 34px;
  background: var(--brand); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  font-family: 'Shippori Mincho', serif;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.ad-title { font-size: 13px; font-weight: 600; }
.ad-region { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ad-meta {
  font-size: 10px; color: var(--text-soft);
  text-align: right;
}
.ad-meta strong {
  color: var(--text); font-weight: 600; font-size: 12px;
  font-family: 'Shippori Mincho', serif;
}

/* ===== Hotels section ===== */
.sb-hotels {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.hotel-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  transition: border-color 0.2s ease;
}
.hotel-card:hover { border-color: var(--brand-soft); }
.hotel-card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px;
}
.hotel-name {
  font-size: 13px; font-weight: 600;
  font-family: 'Shippori Mincho', serif;
}
.hotel-area { font-size: 11px; color: var(--text-muted); }
.hotel-nights {
  font-size: 10px; color: var(--brand);
  margin-top: 4px; letter-spacing: 0.04em;
}
.hotel-note {
  font-size: 11px; color: var(--text-muted);
  margin-top: 4px; line-height: 1.5;
}
.hotel-link {
  font-size: 10px; color: var(--brand); text-decoration: none;
  margin-top: 4px;
}
.hotel-link:hover { text-decoration: underline; }

/* ===== Markers ===== */
.pin {
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  position: relative;
}
.pin::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}
.pin span {
  transform: rotate(45deg);
  color: white; font-weight: 600; font-size: 12px;
  font-family: 'Shippori Mincho', serif;
}
.pin-small {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
}
.pin-small:hover { transform: scale(1.2); }
.pin-small span {
  color: white; font-weight: 600; font-size: 10px;
  font-family: 'Shippori Mincho', serif;
}

/* Polyline draw animation */
.leaflet-overlay-pane path.route-anim {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 1.4s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }

/* ===== Popup ===== */
.leaflet-popup-content-wrapper {
  border-radius: 12px; padding: 4px 6px;
  background: var(--bg-card);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  border: 1px solid var(--line);
}
.leaflet-popup-tip { background: var(--bg-card); }
.leaflet-popup-content {
  font-family: 'IBM Plex Sans Thai', sans-serif;
  margin: 10px 14px; min-width: 200px;
}
.pop-photo {
  width: calc(100% + 16px); margin: -10px -14px 8px;
  height: 120px; object-fit: cover;
  border-top-left-radius: 8px; border-top-right-radius: 8px;
}
.pop-day {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brand); font-weight: 500; margin-bottom: 3px;
}
.pop-place {
  font-size: 15px; font-weight: 600; margin-bottom: 3px;
  font-family: 'Shippori Mincho', serif;
}
.pop-period { font-size: 11px; color: var(--text-muted); }

.leaflet-container {
  font-family: 'IBM Plex Sans Thai', sans-serif !important;
  background: #F4EFE6 !important;
}
.leaflet-control-attribution {
  font-size: 9px; background: rgba(255,255,255,0.85);
}
.leaflet-control-zoom a {
  background: rgba(255,255,255,0.95) !important;
  border: 1px solid var(--line) !important;
  color: var(--brand) !important;
  backdrop-filter: blur(8px);
}

/* ===== Geo (GPS tracking) ===== */
.geo-btn {
  position: absolute;
  top: 14px; right: 14px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition: all 0.2s ease;
  font-family: inherit;
}
.geo-btn svg { width: 20px; height: 20px; }
.geo-btn:hover {
  border-color: var(--brand-soft);
  color: var(--brand);
  transform: scale(1.05);
}
.geo-btn[data-state="requesting"] {
  color: var(--brand);
  animation: geoSpin 1.2s linear infinite;
}
.geo-btn[data-state="tracking"] {
  background: #1976D2;
  border-color: #1976D2;
  color: white;
}
.geo-btn[data-state="tracking"]:hover { background: #1565C0; }
.geo-btn[data-state="denied"],
.geo-btn[data-state="unavailable"],
.geo-btn.unsupported {
  color: #B85C3D;
  border-color: rgba(184, 92, 61, 0.4);
}
@keyframes geoSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.geo-status {
  position: absolute;
  bottom: 14px; left: 14px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-left: 3px solid #1976D2;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  z-index: 600;
  max-width: calc(100% - 28px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.geo-status.show {
  opacity: 1;
  transform: translateY(0);
}
.geo-status.warn {
  border-left-color: #B85C3D;
  background: #FFF4EE;
}
.geo-status strong {
  font-family: 'Shippori Mincho', serif;
  font-weight: 600;
  color: var(--brand);
}

/* User location dot on the map */
.user-dot {
  position: relative;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.user-dot::before {
  content: '';
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #1976D2;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(25, 118, 210, 0.5);
  z-index: 2;
}
.user-dot-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #1976D2;
  opacity: 0.4;
  animation: userPulse 1.6s ease-out infinite;
}
@keyframes userPulse {
  0%   { transform: scale(0.4); opacity: 0.5; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(20, 14, 8, 0.92);
  display: none; align-items: center; justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease-out;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 92vw; max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* ===== Animations ===== */
.sidebar-fade { animation: fadeIn 0.35s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Footer ===== */
.footer-hint {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.04em;
}
.footer-hint span { color: var(--brand); }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .main-grid { grid-template-columns: 1fr; min-height: 0; }
  #map { height: 420px; }
  .sidebar { max-height: none; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .header h1 { font-size: 34px; }
  .header-kanji { font-size: 160px; }
  .day-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .day-tab { flex-shrink: 0; min-width: 80px; }
}
@media (max-width: 640px) {
  .container { padding: 24px 14px 48px; }
  .header { padding: 24px 20px; }
  .header h1 { font-size: 26px; }
  .header-kanji { font-size: 110px; right: -5px; top: -10px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .map-legend-box { display: none; }
}

/* ===== Print ===== */
@media print {
  body::before, .header-bg, .header-kanji { display: none; }
  body { background: white; }
  .day-tabs, .leaflet-control-zoom, .map-legend-box { display: none; }
  .main-grid { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  #map { height: 400px; }
  .sidebar { max-height: none; overflow: visible; }
}
