/* ============================================================
   Japan Babymoon 2026 — V2 Complete Design System
   Warm Editorial Minimalism × Kinfolk × Apple Design
   ============================================================ */

/* ── Tokens ── */
:root {
  --bg-primary: #FDF8F3;
  --bg-secondary: #F5EDE4;
  --bg-card: #FFFFFF;
  --text-primary: #2D2A26;
  --text-secondary: #6B6560;
  --text-tertiary: #9B9590;
  --accent-sakura: #E8A5A5;
  --accent-gold: #C9A86C;
  --accent-slate: #8FA8A8;
  --accent-matcha: #7A9E7E;
  --color-p0: #C97B7B;
  --color-warning: #D4A574;
  --border-light: rgba(45,42,38,0.08);
  --border-medium: rgba(45,42,38,0.15);
  --shadow-card: 0 1px 3px rgba(45,42,38,0.06), 0 4px 12px rgba(45,42,38,0.04);
  --shadow-elevated: 0 8px 24px rgba(45,42,38,0.10);
  --font-handwriting: 'Caveat', cursive;
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;
  --font-serif: 'Newsreader', Georgia, 'Noto Serif SC', serif;
  --font-cjk: 'Noto Sans JP', 'Noto Serif SC', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --touch-min: 48px;
  --touch-comfort: 56px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font: inherit; border: none; outline: none; background: none; }
ul, ol { list-style: none; }

/* ── SVG Icon System ── */
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 32px; height: 32px; }
.icon--sakura { fill: var(--accent-sakura); stroke: none; }
.icon--matcha { color: var(--accent-matcha); }
.icon--p0 { color: var(--color-p0); }
.icon--gold { color: var(--accent-gold); }

/* ── Login Screen ── */
  color: var(--color-p0);
  font-size: 0.875rem;
  margin-top: var(--space-md);
  min-height: 1.25rem;
}

/* ── App Shell ── */
.app { display: none; min-height: 100dvh; flex-direction: column; }
.app.active { display: flex; }

/* ── Top Bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253,248,243,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--touch-min);
}

.topbar-left { display: flex; align-items: center; gap: var(--space-sm); }

.topbar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: background 0.2s;
}
.topbar-back:hover { background: var(--border-light); }

.topbar-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
}

.topbar-right {
  font-family: var(--font-handwriting);
  font-size: 1.125rem;
  color: var(--text-tertiary);
}

/* ── Content Area ── */
.content {
  flex: 1;
  padding: var(--space-md) var(--space-lg) calc(var(--touch-min) + var(--space-lg) + 60px);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* ── Timeline View ── */
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.tag--p0 {
  background: rgba(201,123,123,0.12);
  color: var(--color-p0);
}

.tag--gdm {
  background: rgba(122,158,126,0.12);
  color: var(--accent-matcha);
}

.tag--shopping {
  background: rgba(201,168,108,0.12);
  color: var(--accent-gold);
}

/* ── Day Detail View ── */
.day-detail { display: none; }
.day-detail.active { display: block; }

.detail-header {
  margin-bottom: var(--space-xl);
}

.detail-date {
  font-family: var(--font-handwriting);
  font-size: 1.5rem;
  color: var(--accent-sakura);
}

.detail-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Event cards in detail */
.event-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-light);
}

.event-time {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-tertiary);
  min-width: 52px;
  padding-top: 3px;
}

.event-body { flex: 1; }

.event-summary {
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

/* Event link (shop name as clickable link) */
.event-link {
  color: var(--accent-sakura);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline;
  opacity: 1 !important;
}
.event-link:hover {
  color: var(--accent-gold);
  text-decoration-thickness: 2px;
  opacity: 1 !important;
}
.event-link:active {
  opacity: 1 !important;
}
.event-link:visited {
  color: var(--accent-sakura);
  opacity: 1 !important;
}
/* Ensure event-link never affects parent card */
.event-card .event-summary .event-link,
.event-card .event-summary .event-link:hover,
.event-card .event-summary .event-link:active,
.event-card .event-summary .event-link:visited {
  opacity: 1 !important;
  filter: none !important;
}

.event-location {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.map-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-sakura);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.map-link:hover { background: rgba(232,165,165,0.1); }

/* ── Brand Cards (Shopping) ── */
.brand-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-md);
  transition: transform 0.3s var(--ease-out);
}
.brand-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-elevated); }

.brand-visual {
  height: 200px;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.05em;
  background-size: cover;
  background-position: center;
}

.brand-info { padding: var(--space-md); }

.brand-product {
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.brand-price {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent-gold);
  margin-bottom: var(--space-sm);
}

.brand-store {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ── Restaurant Cards ── */
.restaurant-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-md);
  border-left: 4px solid transparent;
  transition: transform 0.3s var(--ease-out);
}
.restaurant-card:hover { transform: translateY(-2px); }
.restaurant-card.p0 { border-left-color: var(--color-p0); }
.restaurant-card.gdm { border-left-color: var(--accent-matcha); }

.restaurant-name {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.restaurant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.restaurant-gdm-notes {
  background: rgba(122,158,126,0.06);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  color: var(--accent-matcha);
  margin-top: var(--space-sm);
}

/* ── Flight Card ── */
.flight-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  position: relative;
}

.flight-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.flight-city {
  text-align: center;
}

.flight-city-code {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.flight-city-time {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.flight-line {
  flex: 1;
  height: 2px;
  background: var(--border-light);
  margin: 0 var(--space-md);
  position: relative;
}

.flight-line::after {
  content: '✈';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.875rem;
  color: var(--accent-sakura);
  background: var(--bg-card);
  padding: 0 var(--space-sm);
}

.flight-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-tertiary);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}

.flight-confirmation {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-gold);
  background: rgba(201,168,108,0.08);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ── Checklist ── */
.checklist-category {
  margin-bottom: var(--space-xl);
}

.checklist-category-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--border-light);
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: var(--touch-min);
  padding: var(--space-sm) 0;
  cursor: pointer;
}

.checklist-checkbox {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 2px solid var(--border-medium);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease-spring);
}

.checklist-item.checked .checklist-checkbox {
  background: var(--accent-matcha);
  border-color: var(--accent-matcha);
}

.checklist-checkbox svg { opacity: 0; transition: opacity 0.2s; }
.checklist-item.checked .checklist-checkbox svg { opacity: 1; }

.checklist-text { flex: 1; }
.checklist-item.checked .checklist-text { color: var(--text-tertiary); text-decoration: line-through; }

.checklist-progress {
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  height: 8px;
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

.checklist-progress-bar {
  height: 100%;
  background: var(--accent-matcha);
  border-radius: var(--radius-full);
  transition: width 0.5s var(--ease-out);
}

/* ── Journal ── */
.journal-date-section {
  margin-bottom: var(--space-xl);
}

.journal-date-label {
  font-family: var(--font-handwriting);
  font-size: 1.25rem;
  color: var(--accent-sakura);
  margin-bottom: var(--space-sm);
}

.journal-textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--space-md);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-card);
  resize: vertical;
  transition: border-color 0.3s;
}

.journal-textarea:focus {
  border-color: var(--accent-sakura);
}

.journal-save-indicator {
  font-family: var(--font-handwriting);
  font-size: 0.875rem;
  color: var(--accent-matcha);
  text-align: right;
  margin-top: var(--space-xs);
  opacity: 0;
  transition: opacity 0.3s;
}
.journal-save-indicator.show { opacity: 1; }

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(253,248,243,0.9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  padding: var(--space-xs) 0 var(--space-sm);
  padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom, 0px));
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  font-size: 0.6875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-item:active { transform: scale(0.92); }

.nav-item.active {
  color: var(--accent-sakura);
}

.nav-item svg { width: 22px; height: 22px; }

/* ── Section Headers ── */
.section-header {
  margin-bottom: var(--space-lg);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.section-subtitle {
  font-size: 0.9375rem;
  color: var(--text-tertiary);
}

/* ── Tier badges ── */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.tier-badge--jdm {
  background: rgba(201,123,123,0.1);
  color: var(--color-p0);
}

.tier-badge--global {
  background: rgba(122,158,126,0.1);
  color: var(--accent-matcha);
}

/* ── Sakura Rain ── */
.sakura-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 1.25rem;
  animation: sakura-fall linear forwards;
}

@keyframes sakura-fall {
  0% { opacity: 1; transform: translateY(0) translateX(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) translateX(var(--drift)) rotate(720deg); }
}

/* ── Responsive ── */
@media (min-width: 768px) {
  .content { padding-left: var(--space-xl); padding-right: var(--space-xl); }
  .brand-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
  .restaurant-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
}

@media (min-width: 1200px) {
  .brand-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Print ── */
@media print {
  .bottom-nav, .topbar { display: none; }
  .content { padding-bottom: 0; max-width: 100%; }
  .timeline-day-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Hotel Card ── */
.hotel-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-md);
}

.hotel-visual {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.05em;
}

.hotel-info { padding: var(--space-md); }
.hotel-name { font-family: var(--font-serif); font-weight: 600; margin-bottom: var(--space-xs); }
.hotel-dates { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent-gold); margin-bottom: var(--space-sm); }
.hotel-amenities { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.hotel-amenity { font-size: 0.75rem; padding: 2px 8px; border-radius: var(--radius-full); background: var(--bg-secondary); color: var(--text-tertiary); }

/* ── Shinkansen Card ── */
.shinkansen-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.shinkansen-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.shinkansen-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent-gold);
}

/* ── Taxi Table ── */
.taxi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.taxi-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.taxi-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.taxi-table td:first-child { font-weight: 500; }

.taxi-price {
  font-family: var(--font-mono);
  color: var(--accent-gold);
}

/* ── View transitions ── */
.view { display: none; }
