/* ============================================
   ZEN PLANNER — Japan Trip Planning App
   Refined Japanese minimalism with warmth
   ============================================ */

:root {
  --bg-deep: #1a1a2e;
  --bg-dark: #16213e;
  --bg-card: rgba(245, 240, 232, 0.06);
  --bg-card-solid: #1e1e36;
  --cream: #f5f0e8;
  --cream-soft: rgba(245, 240, 232, 0.85);
  --pink: #e8a0bf;
  --pink-glow: rgba(232, 160, 191, 0.3);
  --gold: #c4a265;
  --gold-soft: rgba(196, 162, 101, 0.2);
  --text: #e8e2d8;
  --text-dim: rgba(232, 226, 216, 0.5);
  --text-muted: rgba(232, 226, 216, 0.35);
  --border: rgba(245, 240, 232, 0.08);
  --border-light: rgba(245, 240, 232, 0.15);
  --success: #7ec699;
  --danger: #e87474;
  --warning: #e8c574;
  --info: #74b4e8;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass: rgba(30, 30, 54, 0.7);
  --glass-border: rgba(245, 240, 232, 0.1);
  --nav-height: 60px;
  --mobile-nav-height: 70px;
  --app-dvh: 100dvh;
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-safe-right: env(safe-area-inset-right, 0px);
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-safe-left: env(safe-area-inset-left, 0px);
  --app-keyboard-inset: 0px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body {
  min-height: 100%;
}

body {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-dvh);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  scroll-padding-top: calc(var(--nav-height) + var(--app-safe-top) + 12px);
  scroll-padding-bottom: calc(var(--mobile-nav-height) + var(--app-safe-bottom) + 24px);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

.hidden { display: none !important; }

/* ============================================
   AUTH GATE
   ============================================ */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-dvh);
  padding:
    calc(var(--app-safe-top) + 16px)
    calc(var(--app-safe-right) + 16px)
    calc(var(--app-safe-bottom) + 16px)
    calc(var(--app-safe-left) + 16px);
}

.auth-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-blossom-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, var(--pink-glow) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, var(--gold-soft) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(116, 180, 232, 0.1) 0%, transparent 40%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.auth-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 48px 40px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 90%;
  max-height: min(720px, calc(var(--app-dvh) - var(--app-safe-top) - var(--app-safe-bottom) - 32px));
  overflow-y: auto;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-kanji {
  font-family: 'Noto Serif JP', serif;
  font-size: 72px;
  color: var(--pink);
  display: block;
  margin-bottom: 8px;
  text-shadow: 0 0 40px var(--pink-glow);
  line-height: 1;
}

.auth-content h1 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-family: 'Noto Serif JP', serif;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 36px;
  letter-spacing: 2px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(245, 240, 232, 0.06);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 16px;
  outline: none;
  transition: var(--transition);
  text-align: center;
  letter-spacing: 4px;
}

.auth-form input::placeholder {
  letter-spacing: 1px;
  color: var(--text-muted);
}

.auth-form input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-glow);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--pink), #d48aad);
  color: var(--bg-deep);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--pink-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-error {
  color: var(--danger);
  font-size: 14px;
  min-height: 20px;
}

/* Floating Petals */
.petal {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--pink);
  border-radius: 50% 0 50% 50%;
  opacity: 0.15;
  pointer-events: none;
}

.petal-1 { top: 10%; left: 15%; animation: floatPetal 12s ease-in-out infinite; }
.petal-2 { top: 20%; right: 20%; animation: floatPetal 15s ease-in-out infinite 2s; width: 8px; height: 8px; }
.petal-3 { bottom: 30%; left: 10%; animation: floatPetal 10s ease-in-out infinite 4s; width: 16px; height: 16px; }
.petal-4 { top: 60%; right: 15%; animation: floatPetal 14s ease-in-out infinite 1s; }
.petal-5 { bottom: 15%; right: 30%; animation: floatPetal 11s ease-in-out infinite 3s; width: 10px; height: 10px; }

@keyframes floatPetal {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(20px, -30px) rotate(90deg); }
  50% { transform: translate(-10px, -50px) rotate(180deg); }
  75% { transform: translate(30px, -20px) rotate(270deg); }
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-dvh);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding:
    calc(8px + var(--app-safe-top))
    calc(24px + var(--app-safe-right))
    8px
    calc(24px + var(--app-safe-left));
  min-height: calc(var(--nav-height) + var(--app-safe-top));
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-kanji {
  font-family: 'Noto Serif JP', serif;
  font-size: 28px;
  color: var(--pink);
  line-height: 1;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: -0.3px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--cream);
  border-color: var(--border-light);
  background: var(--bg-card);
}

/* Desktop Nav */
.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 24px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--cream);
  background: var(--bg-card);
}

.nav-link.active {
  color: var(--pink);
  background: rgba(232, 160, 191, 0.1);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--mobile-nav-height);
  height: calc(var(--mobile-nav-height) + var(--app-safe-bottom));
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 0 calc(8px + var(--app-safe-right)) var(--app-safe-bottom) calc(8px + var(--app-safe-left));
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  padding: 8px 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: var(--transition);
  min-height: 44px;
}

.mobile-nav-link.active {
  color: var(--pink);
}

.mobile-nav-link svg {
  transition: var(--transition);
}

.mobile-nav-link.active svg {
  filter: drop-shadow(0 0 6px var(--pink-glow));
}

/* ============================================
   PAGE CONTAINER
   ============================================ */
.page-container {
  flex: 1;
  padding: 24px calc(24px + var(--app-safe-right)) 40px calc(24px + var(--app-safe-left));
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 40px;
}

.page {
  display: none;
  animation: pageFadeIn 0.4s ease-out;
}

.page.active { display: block; }

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--cream);
}

.section-header .jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Cards */
.card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  animation: cardSlideIn 0.4s ease-out both;
}

.card:hover {
  border-color: rgba(245, 240, 232, 0.15);
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Input Groups */
.input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.input-group input,
.input-group textarea {
  flex: 1;
  padding: 14px 18px;
  background: rgba(245, 240, 232, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 16px;
  outline: none;
  transition: var(--transition);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--text-muted);
}

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

.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--pink), #d48aad);
  color: var(--bg-deep);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  min-width: 44px;
  min-height: 48px;
}

.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--pink-glow);
}

.btn-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: rgba(245, 240, 232, 0.05);
  color: var(--cream);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--pink);
  color: var(--cream);
  background: rgba(232, 160, 191, 0.12);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   EXPENSES PAGE
   ============================================ */
.expense-totals {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.total-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.total-card .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.total-card .amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.total-card .currency {
  font-size: 14px;
  color: var(--text-dim);
  margin-left: 4px;
}

.total-card.pink { border-color: rgba(232, 160, 191, 0.3); }
.total-card.pink .amount { color: var(--pink); }
.total-card.gold { border-color: rgba(196, 162, 101, 0.3); }
.total-card.gold .amount { color: var(--gold); }
.total-card.kaveen-card { border-color: rgba(116, 180, 232, 0.3); }
.total-card.kaveen-card .amount { color: var(--info); }
.total-card.mason-card { border-color: rgba(126, 198, 153, 0.3); }
.total-card.mason-card .amount { color: var(--success); }

/* Payer Selector */
.payer-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.payer-label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  margin-right: 4px;
}

.payer-btn {
  padding: 8px 18px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  min-height: 38px;
}

.payer-btn:hover {
  border-color: var(--pink);
  color: var(--cream);
}

.payer-btn.active {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--bg-deep);
}

.payer-btn[data-payer="kaveen"].active {
  background: var(--info);
  border-color: var(--info);
}

.payer-btn[data-payer="mason"].active {
  background: var(--success);
  border-color: var(--success);
}

/* Split Slider */
.split-slider-wrap {
  margin-bottom: 16px;
  padding: 14px 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.split-slider-wrap.hidden { display: none !important; }

.split-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.split-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.split-name span {
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.split-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--info) 0%, var(--info) var(--val, 50%), var(--success) var(--val, 50%), var(--success) 100%);
  outline: none;
  cursor: pointer;
}

.split-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--bg-deep);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
}

.split-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--bg-deep);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  cursor: pointer;
}

/* Payer Tags on expense items */
.payer-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payer-kaveen {
  background: rgba(116, 180, 232, 0.15);
  color: var(--info);
}

.payer-mason {
  background: rgba(126, 198, 153, 0.15);
  color: var(--success);
}

.payer-split {
  background: rgba(232, 160, 191, 0.15);
  color: var(--pink);
}

.expense-split-detail {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.expense-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  animation: cardSlideIn 0.3s ease-out both;
}

.expense-info {
  flex: 1;
  min-width: 0;
}

.expense-desc {
  font-size: 15px;
  font-weight: 500;
  color: var(--cream);
  margin-bottom: 4px;
}

.expense-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.expense-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.badge-food { background: rgba(126, 198, 153, 0.15); color: var(--success); }
.badge-transport { background: rgba(116, 180, 232, 0.15); color: var(--info); }
.badge-accommodation { background: rgba(196, 162, 101, 0.15); color: var(--gold); }
.badge-activity { background: rgba(232, 160, 191, 0.15); color: var(--pink); }
.badge-shopping { background: rgba(232, 197, 116, 0.15); color: var(--warning); }
.badge-general { background: rgba(232, 226, 216, 0.1); color: var(--text-dim); }

.expense-amounts {
  text-align: right;
  margin-left: 16px;
  flex-shrink: 0;
}

.expense-total {
  font-size: 16px;
  font-weight: 600;
  color: var(--cream);
}

.expense-split {
  font-size: 12px;
  color: var(--gold);
  margin-top: 2px;
}

.expense-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 12px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.expense-delete:hover {
  color: var(--danger);
  border-color: rgba(232, 116, 116, 0.3);
  background: rgba(232, 116, 116, 0.1);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 15px;
  line-height: 1.6;
}

/* ============================================
   ITINERARY PAGE
   ============================================ */
.day-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.day-btn {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  min-height: 36px;
}

.day-btn:hover { border-color: var(--border-light); color: var(--cream); }
.day-btn.active { background: rgba(232, 160, 191, 0.15); border-color: var(--pink); color: var(--pink); }

.itinerary-item {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  animation: cardSlideIn 0.3s ease-out both;
  transition: var(--transition);
}

.itinerary-item:hover {
  border-color: rgba(245, 240, 232, 0.15);
}

.itinerary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.itinerary-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--cream);
}

.itinerary-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.itinerary-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.itinerary-action-btn:hover {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--cream);
}

.itinerary-action-btn.delete:hover {
  color: var(--danger);
  border-color: rgba(232, 116, 116, 0.3);
}

.itinerary-edit-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 10, 20, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2000;
}

.itinerary-edit-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.itinerary-edit-dialog {
  width: min(760px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 24px;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(245, 240, 232, 0.12);
  background: linear-gradient(180deg, rgba(17, 23, 43, 0.98), rgba(10, 14, 28, 0.96));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.itinerary-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.itinerary-edit-header h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.itinerary-edit-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
}

.itinerary-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.itinerary-edit-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.itinerary-edit-field-full {
  grid-column: 1 / -1;
}

.itinerary-edit-field span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.itinerary-edit-field input,
.itinerary-edit-field select,
.itinerary-edit-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  padding: 11px 12px;
  font: inherit;
}

.itinerary-edit-field textarea {
  resize: vertical;
  min-height: 88px;
}

.itinerary-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.itinerary-edit-save-btn {
  min-width: 150px;
}

.itinerary-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 16px;
}

.itinerary-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
}

.detail-item svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--gold);
}

.detail-item .detail-label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-item .detail-value {
  color: var(--text);
  line-height: 1.4;
}

.itinerary-day-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 12px;
}

.day-assign-select {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--cream);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  min-height: 36px;
}

.day-assign-select:focus {
  border-color: var(--pink);
}

/* Day colors */
.day-0 { background: rgba(232, 226, 216, 0.1); color: var(--text-dim); }
.day-1 { background: rgba(232, 160, 191, 0.15); color: var(--pink); }
.day-2 { background: rgba(116, 180, 232, 0.15); color: var(--info); }
.day-3 { background: rgba(126, 198, 153, 0.15); color: var(--success); }
.day-4 { background: rgba(196, 162, 101, 0.15); color: var(--gold); }
.day-5 { background: rgba(232, 197, 116, 0.15); color: var(--warning); }
.day-6 { background: rgba(178, 132, 232, 0.15); color: #b284e8; }
.day-7 { background: rgba(232, 152, 116, 0.15); color: #e89874; }

/* ============================================
   MAP PAGE
   ============================================ */
.map-nearby-shell {
  margin-bottom: 16px;
  padding: 18px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.map-nearby-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.map-nearby-header h3 {
  font-size: 20px;
  margin: 4px 0 6px;
}

.map-nearby-header p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
  max-width: 780px;
}

.map-nearby-btn {
  width: auto;
  min-width: 180px;
  white-space: nowrap;
}

.map-nearby-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.map-nearby-status.success {
  color: var(--success);
}

.map-nearby-status.error {
  color: #ff8b8b;
}

.nearby-attractions-results {
  margin-top: 16px;
}

.nearby-overview-card {
  padding: 14px 16px;
  background: rgba(91, 192, 190, 0.08);
  border: 1px solid rgba(91, 192, 190, 0.18);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.nearby-overview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.nearby-overview-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--info);
  margin-bottom: 6px;
}

.nearby-overview-card p,
.nearby-overview-copy {
  color: var(--cream);
  line-height: 1.5;
}

.nearby-expandable {
  margin-top: 8px;
}

.nearby-expandable:first-child {
  margin-top: 0;
}

.nearby-expand-full {
  display: none;
}

.nearby-expandable[data-expanded='true'] .nearby-expand-preview {
  display: none;
}

.nearby-expandable[data-expanded='true'] .nearby-expand-full {
  display: block;
}

.nearby-expand-btn {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--info);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.nearby-expand-btn:hover {
  text-decoration: underline;
}

.nearby-weather-summary,
.nearby-weather-guidance {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-dim);
}

.nearby-weather-summary {
  color: var(--cream);
  font-weight: 600;
}

.nearby-overview-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nearby-cached-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(91, 192, 190, 0.22);
  color: var(--text-dim);
  font-size: 11px;
}

.nearby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.nearby-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nearby-card:hover {
  border-color: rgba(91, 192, 190, 0.3);
  transform: translateY(-1px);
}

.nearby-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.nearby-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nearby-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--cream);
}

.nearby-rank-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(91, 192, 190, 0.14);
  color: var(--info);
  font-size: 11px;
  font-weight: 700;
}

.nearby-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.nearby-score-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.nearby-rank-score {
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 10px;
  background: rgba(91, 192, 190, 0.12);
  color: var(--cream);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.nearby-rating {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.nearby-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.nearby-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(232, 160, 191, 0.12);
  color: var(--pink);
  font-size: 11px;
  font-weight: 600;
}

.nearby-badge.nearby-distance {
  background: rgba(91, 192, 190, 0.12);
  color: var(--info);
}

.nearby-description,
.nearby-why,
.nearby-weather-fit,
.nearby-opinion-summary,
.nearby-rank-reason {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.nearby-weather-fit,
.nearby-opinion-summary,
.nearby-why,
.nearby-rank-reason {
  margin-top: 8px;
}

.nearby-expandable .nearby-weather-fit,
.nearby-expandable .nearby-opinion-summary,
.nearby-expandable .nearby-why,
.nearby-expandable .nearby-rank-reason,
.nearby-expandable .nearby-description,
.nearby-expandable .nearby-overview-copy,
.nearby-expandable .nearby-weather-guidance {
  margin-top: 0;
}

.nearby-opinion-summary {
  color: var(--cream);
}

.nearby-rank-reason {
  color: var(--text-muted);
}

.nearby-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--text-muted);
}

.nearby-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.nearby-source-link {
  color: var(--info);
  text-decoration: none;
  font-weight: 600;
}

.nearby-source-link:hover {
  text-decoration: underline;
}

.nearby-empty {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--glass-border);
  color: var(--text-dim);
  font-size: 13px;
}

.map-container {
  width: 100%;
  height: 500px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  margin-bottom: 16px;
}

#leaflet-map {
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.legend-dot-nearby {
  color: #5bc0be;
  background: rgba(91, 192, 190, 0.3);
}

/* Custom Leaflet popup */
.leaflet-popup-content-wrapper {
  background: var(--bg-card-solid) !important;
  color: var(--cream) !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-tip {
  background: var(--bg-card-solid) !important;
  border: 1px solid var(--glass-border) !important;
  border-top: none !important;
  border-left: none !important;
}

.leaflet-popup-content {
  margin: 14px 16px !important;
  font-family: 'Instrument Sans', sans-serif !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.leaflet-popup-content h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--pink);
}

.leaflet-popup-content .popup-detail {
  color: var(--text-dim);
  margin-bottom: 4px;
}

.leaflet-popup-close-button {
  color: var(--text-dim) !important;
}

/* ============================================
   WEATHER PAGE
   ============================================ */
.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.weather-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  animation: cardSlideIn 0.4s ease-out both;
}

.weather-city {
  font-size: 20px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.weather-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.weather-temp {
  font-size: 36px;
  font-weight: 700;
  color: var(--cream);
}

.weather-temp .unit {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-dim);
}

.weather-condition {
  font-size: 36px;
}

.weather-details {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.weather-forecast {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
}

.forecast-day {
  flex-shrink: 0;
  text-align: center;
  padding: 10px 12px;
  background: rgba(245, 240, 232, 0.04);
  border-radius: var(--radius-xs);
  min-width: 64px;
}

.forecast-day .day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.forecast-day .day-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.forecast-day .day-temps {
  font-size: 12px;
  color: var(--text);
}

.forecast-day .day-temps .low {
  color: var(--text-muted);
}

/* ============================================
   GUIDE PAGE
   ============================================ */

.guide-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.guide-research-shell,
.guide-library-shell {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.guide-research-shell {
  display: flex;
  flex-direction: column;
  min-height: 720px;
  overflow: hidden;
}

.guide-library-shell {
  padding: 18px;
}

#guide-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.guide-research-header,
.guide-library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.guide-research-header h3,
.guide-library-header h3 {
  font-size: 22px;
  color: var(--cream);
  margin-top: 4px;
}

.guide-research-header p,
.guide-library-header p {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  max-width: 640px;
}

.guide-research-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}

.guide-mode-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: rgba(245, 240, 232, 0.04);
  cursor: pointer;
}

.guide-mode-copy {
  display: grid;
  gap: 4px;
}

.guide-mode-title {
  color: var(--cream);
  font-size: 13px;
  font-weight: 800;
}

.guide-mode-caption {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.guide-mode-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.guide-mode-switch {
  position: relative;
  width: 48px;
  height: 28px;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(245, 240, 232, 0.16);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.guide-mode-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cream);
  transition: var(--transition);
}

.guide-mode-input:checked + .guide-mode-switch {
  background: rgba(232, 160, 191, 0.26);
  border-color: rgba(232, 160, 191, 0.55);
}

.guide-mode-input:checked + .guide-mode-switch::after {
  transform: translateX(20px);
  background: var(--pink);
}

.guide-mode-input:disabled + .guide-mode-switch {
  opacity: 0.55;
}

.guide-research-eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.guide-chat-clear {
  flex-shrink: 0;
}

.guide-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 360px;
}

.guide-chat-empty {
  margin: auto 0;
  text-align: center;
  padding: 28px 18px;
  color: var(--text-dim);
}

.guide-chat-empty-icon {
  font-size: 46px;
  margin-bottom: 12px;
}

.guide-chat-empty h4 {
  font-size: 18px;
  color: var(--cream);
  margin-bottom: 8px;
}

.guide-chat-empty p {
  font-size: 14px;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto;
}

.guide-chat-message {
  display: flex;
}

.guide-chat-message-user {
  justify-content: flex-end;
}

.guide-chat-message-assistant {
  justify-content: flex-start;
}

@media (max-width: 900px) {
  .guide-research-header {
    flex-direction: column;
  }

  .guide-research-controls {
    width: 100%;
    justify-content: space-between;
  }

  .guide-mode-control {
    min-width: 0;
    flex: 1;
  }
}

@media (max-width: 640px) {
  .guide-research-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .guide-chat-clear {
    align-self: flex-end;
  }

  .guide-progress-stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================
   LANGUAGE PAGE
   ============================================ */

.language-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.language-tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  background: rgba(245, 240, 232, 0.04);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.language-tab:hover {
  color: var(--cream);
  border-color: var(--pink);
}

.language-tab.active {
  color: var(--bg-deep);
  background: var(--pink);
  border-color: var(--pink);
}

.language-direction {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 18px;
}

.language-direction-btn,
.language-swap-btn,
.language-file-picker {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  background: rgba(245, 240, 232, 0.05);
  color: var(--cream);
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.language-direction-btn {
  min-height: 58px;
  padding: 10px 14px;
  text-align: left;
}

.language-direction-btn span {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 3px;
}

.language-direction-btn strong {
  display: block;
  color: var(--cream);
  font-size: 15px;
}

.language-direction-btn.active {
  border-color: var(--pink);
  background: rgba(232, 160, 191, 0.14);
}

.language-swap-btn {
  width: 48px;
  min-height: 48px;
  font-size: 20px;
  color: var(--gold);
}

.language-panel {
  display: none;
}

.language-panel.active {
  display: block;
  animation: pageFadeIn 0.25s ease-out;
}

#page-language .section-header,
#page-language .language-tabs,
#page-language .language-panel.active {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.language-tool-shell {
  padding: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow);
}

.language-textarea {
  resize: vertical;
  min-height: 128px;
  margin-bottom: 12px;
}

.language-actions,
.language-live-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.language-result {
  display: grid;
  gap: 12px;
  min-height: 120px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: rgba(245, 240, 232, 0.04);
}

.language-result.empty,
.language-result.loading {
  place-items: center;
  color: var(--text-dim);
  text-align: center;
}

.language-result-block span {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.language-result-block p {
  color: var(--cream);
  font-size: 18px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.language-result-block.translated p {
  font-size: 22px;
  font-weight: 700;
}

.language-result-block[data-result-role$="pronunciation"] p {
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  line-height: 1.85;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: rgba(245, 240, 232, 0.9);
}

.language-result-block .language-pronunciation-track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  margin-top: 14px;
}

.language-result-block .language-pronunciation-track .language-pronunciation-word {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.12rem;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid rgba(245, 240, 232, 0.08);
  border-radius: 999px;
  background: rgba(245, 240, 232, 0.04);
}

.language-result-block .language-pronunciation-track .language-pronunciation-chunk {
  display: inline-block;
  margin: 0;
  padding: 0.02em 0.04em;
  border-radius: 0.32em;
  color: rgba(245, 240, 232, 0.72);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.language-pronunciation-chunk.is-complete {
  color: rgba(245, 240, 232, 0.94);
}

.language-pronunciation-chunk.is-active {
  color: #221914;
  background: linear-gradient(135deg, rgba(255, 214, 126, 0.96), rgba(255, 168, 124, 0.92));
  box-shadow: 0 0 0 1px rgba(255, 214, 126, 0.18);
  transform: translateY(-1px);
}

.language-tts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.language-tts-row-compact {
  gap: 8px;
}

.language-tts-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.language-tts-btn {
  min-height: 42px;
}

.language-tts-audio {
  width: min(100%, 320px);
}

.language-tts-audio-compact {
  width: min(100%, 260px);
}

.language-file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.language-file-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.language-file-picker:hover {
  border-color: var(--pink);
  background: rgba(232, 160, 191, 0.12);
}

.language-file-selected {
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.language-file-selected.error {
  color: #ffd6d6;
}

.language-phrasebook-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.language-search-shell {
  display: grid;
  gap: 6px;
  flex: 1 1 280px;
}

.language-search-shell span {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.language-search-input {
  min-height: 46px;
}

.language-search-clear {
  min-height: 46px;
}

.language-phrasebook-meta {
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.language-phrasebook-builder {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  background: rgba(245, 240, 232, 0.04);
}

.language-phrase-builder-main {
  flex-basis: 100%;
}

.language-phrasebook-empty {
  grid-column: 1 / -1;
  padding: 20px;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  text-align: center;
  background: rgba(245, 240, 232, 0.03);
}

.language-phrasebook {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.language-phrase-section {
  align-content: start;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  background: rgba(245, 240, 232, 0.035);
}

.language-phrase-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--cream);
  cursor: pointer;
  list-style: none;
}

.language-phrase-section summary::-webkit-details-marker {
  display: none;
}

.language-phrase-section summary::after {
  content: '+';
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.language-phrase-section[open] summary::after {
  content: '−';
}

.language-phrase-section summary span {
  color: var(--cream);
  font-size: 16px;
  font-weight: 800;
}

.language-phrase-section summary small {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}

.language-phrase-items {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.language-phrase-section.prominent {
  grid-column: 1 / -1;
  border: 1px solid rgba(232, 116, 116, 0.38);
  background: rgba(232, 116, 116, 0.08);
}

.language-phrase-section.prominent summary span {
  color: var(--danger);
}

.language-phrase-section.prominent .language-phrase-items {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.language-phrase-card {
  padding: 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  background: rgba(245, 240, 232, 0.04);
}

.language-phrase-card.custom {
  border-color: rgba(91, 192, 190, 0.35);
  background: rgba(91, 192, 190, 0.07);
}

.language-phrase-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.language-phrase-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(232, 160, 191, 0.14);
  color: var(--pink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.language-phrase-badge.custom {
  background: rgba(91, 192, 190, 0.16);
  color: var(--info);
}

.language-phrase-romaji {
  color: var(--pink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.language-phrase-english {
  margin-top: 5px;
  color: var(--cream-soft);
  font-size: 14px;
  line-height: 1.5;
}

.language-phrase-japanese {
  margin-top: 8px;
  color: var(--cream);
  font-family: 'Noto Serif JP', serif;
  font-size: 18px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.language-phrase-audio {
  margin-top: 10px;
}

.language-phrase-reading {
  margin-top: 6px;
  color: var(--text-dim);
  font-family: 'Noto Serif JP', serif;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.language-phrase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.language-phrase-actions .btn-secondary,
.language-phrase-actions .btn-danger-soft {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.btn-danger-soft {
  border: 1px solid rgba(232, 116, 116, 0.28);
  background: rgba(232, 116, 116, 0.08);
  color: #ffd6d6;
}

.btn-danger-soft:hover {
  background: rgba(232, 116, 116, 0.14);
  border-color: rgba(232, 116, 116, 0.4);
}

.language-phrase-audio .language-tts-btn {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.language-flashcard {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: max(18px, var(--app-safe-top)) max(16px, var(--app-safe-right)) max(18px, var(--app-safe-bottom)) max(16px, var(--app-safe-left));
  background: rgba(7, 9, 18, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.language-flashcard.hidden {
  display: none;
}

.language-flashcard-inner {
  width: min(100%, 920px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
  border-radius: 28px;
  border: 1px solid rgba(245, 240, 232, 0.12);
  background: linear-gradient(180deg, rgba(18, 22, 40, 0.98), rgba(11, 14, 28, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.language-flashcard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.language-flashcard-label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.language-flashcard-close {
  min-width: 44px;
}

.language-flashcard-script {
  margin: 0;
  color: var(--cream);
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(40px, 7vw, 82px);
  line-height: 1.18;
  text-align: center;
  overflow-wrap: anywhere;
}

.language-flashcard-hiragana {
  margin: 0;
  color: var(--cream-soft);
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

.language-flashcard-english,
.language-flashcard-romaji {
  margin: 0;
  color: var(--text-dim);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
  text-align: center;
}

.language-flashcard-audio {
  display: flex;
  justify-content: center;
}

.language-flashcard-audio .language-tts-row {
  align-items: center;
}

.language-flashcard-audio .language-tts-note {
  text-align: center;
}

body.flashcard-open {
  overflow: hidden;
}

.language-live-results {
  display: grid;
  gap: 10px;
}

.language-live-row {
  padding: 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  background: rgba(245, 240, 232, 0.04);
}

.language-live-row.loading {
  color: var(--text-dim);
}

.language-live-row.error {
  color: var(--danger);
  border-color: rgba(232, 116, 116, 0.3);
}

.guide-chat-bubble {
  max-width: min(84%, 680px);
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.7;
  animation: bubbleIn 0.25s ease-out;
}

.guide-chat-bubble-user {
  background: linear-gradient(135deg, var(--pink), #d48aad);
  color: var(--bg-deep);
  border-bottom-right-radius: 6px;
}

.guide-chat-bubble-assistant {
  background: rgba(245, 240, 232, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--cream);
  border-bottom-left-radius: 6px;
}

.guide-chat-bubble-error {
  border-color: rgba(232, 116, 116, 0.35);
  color: #ffd8d8;
}

.guide-chat-suggestions {
  display: flex;
  gap: 10px;
  padding: 0 20px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.guide-chat-suggestions::-webkit-scrollbar {
  display: none;
}

.guide-chat-suggestions.used {
  display: none;
}

.guide-chat-chip {
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  background: rgba(245, 240, 232, 0.03);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.guide-chat-chip:hover {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(232, 160, 191, 0.08);
}

.guide-chat-form {
  border-top: 1px solid var(--border);
  padding: 16px 20px 20px;
  background: rgba(20, 20, 34, 0.45);
}

.guide-chat-input {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  max-height: 180px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(245, 240, 232, 0.05);
  color: var(--cream);
  padding: 14px 16px;
  font: inherit;
  line-height: 1.6;
  outline: none;
  transition: var(--transition);
}

.guide-chat-input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-glow);
}

.guide-chat-input::placeholder {
  color: var(--text-muted);
}

.guide-chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.guide-chat-hint {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  max-width: 360px;
}

.guide-chat-send {
  min-width: 116px;
}

.guide-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.guide-answer-card {
  width: min(100%, 720px);
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 18px;
  animation: bubbleIn 0.25s ease-out;
}

.guide-answer-card-live {
  border-style: dashed;
}

.guide-answer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.guide-answer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(126, 198, 153, 0.15);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.guide-answer-badge.live {
  background: rgba(196, 162, 101, 0.16);
  color: var(--gold);
}

.guide-answer-badge.mode {
  background: rgba(232, 160, 191, 0.16);
  color: var(--pink);
}

.guide-answer-badge.degraded {
  background: rgba(232, 116, 116, 0.14);
  color: #ffb3b3;
}

.guide-answer-meta-text {
  font-size: 12px;
  color: var(--text-muted);
}

.guide-progress-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.guide-progress-stage {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  text-align: center;
}

.guide-progress-stage.active {
  color: var(--bg-deep);
  background: var(--pink);
  border-color: var(--pink);
}

.guide-progress-stage.done {
  color: var(--success);
  border-color: rgba(126, 198, 153, 0.45);
  background: rgba(126, 198, 153, 0.12);
}

.guide-answer-title {
  font-size: 20px;
  color: var(--cream);
  margin-bottom: 10px;
}

.guide-answer-summary,
.guide-answer-section-body,
.guide-validation-note {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.75;
}

.guide-answer-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(245, 240, 232, 0.08);
}

.guide-answer-block-muted {
  opacity: 0.92;
}

.guide-answer-disclosure {
  border-top: 1px solid rgba(245, 240, 232, 0.08);
}

.guide-answer-disclosure-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.guide-answer-disclosure-summary::-webkit-details-marker {
  display: none;
}

.guide-answer-disclosure-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.guide-answer-disclosure-chevron {
  color: var(--text-muted);
  font-size: 16px;
  transition: transform 0.2s ease;
}

.guide-answer-disclosure[open] .guide-answer-disclosure-chevron {
  transform: rotate(180deg);
}

.guide-answer-disclosure .guide-validation-list {
  margin-top: 14px;
}

.guide-answer-block-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--gold);
}

.guide-answer-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.guide-answer-list {
  margin: 10px 0 0 18px;
  color: var(--text);
  display: grid;
  gap: 8px;
}

.guide-citation-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.guide-citation-pill,
.guide-source-preview-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(116, 180, 232, 0.12);
  color: var(--info);
}

.guide-source-preview-pill.official {
  border: 1px solid rgba(126, 198, 153, 0.35);
  color: var(--success);
}

.guide-progress-list {
  display: grid;
  gap: 10px;
}

.guide-progress-step {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.guide-progress-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guide-progress-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--pink));
  box-shadow: 0 0 0 4px rgba(196, 162, 101, 0.12);
}

.guide-progress-label {
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
}

.guide-progress-count {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245, 240, 232, 0.06);
  border: 1px solid rgba(245, 240, 232, 0.12);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.guide-progress-detail,
.guide-progress-note,
.guide-source-preview-label {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.guide-progress-note,
.guide-source-preview {
  margin-top: 14px;
}

.guide-source-preview-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.guide-validation-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.guide-validation-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(245, 240, 232, 0.03);
  border: 1px solid rgba(245, 240, 232, 0.08);
}

.guide-validation-item.verified {
  border-color: rgba(126, 198, 153, 0.25);
}

.guide-validation-item.mixed,
.guide-validation-item.partial {
  border-color: rgba(232, 197, 116, 0.25);
}

.guide-validation-item.uncertain {
  border-color: rgba(232, 116, 116, 0.25);
}

.guide-validation-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.guide-validation-status {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.guide-validation-claim {
  color: var(--cream);
  font-size: 14px;
  line-height: 1.6;
}

.guide-source-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.guide-source-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 12px;
  border-radius: 14px;
  background: rgba(245, 240, 232, 0.03);
  border: 1px solid rgba(245, 240, 232, 0.08);
  transition: var(--transition);
}

.guide-source-item:hover {
  border-color: var(--pink);
  background: rgba(232, 160, 191, 0.05);
}

.guide-source-id {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  border-radius: 999px;
  background: rgba(116, 180, 232, 0.12);
  color: var(--info);
  font-size: 11px;
  font-weight: 700;
}

.guide-source-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.guide-source-title {
  color: var(--cream);
  font-size: 14px;
  line-height: 1.5;
}

.guide-source-domain {
  color: var(--text-muted);
  font-size: 12px;
}

.alert-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 0;
  height: 100%;
  animation: cardSlideIn 0.4s ease-out both;
}

.alert-card .alert-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.alert-type-info { background: rgba(116, 180, 232, 0.15); color: var(--info); }
.alert-type-tip { background: rgba(126, 198, 153, 0.15); color: var(--success); }
.alert-type-etiquette { background: rgba(232, 160, 191, 0.15); color: var(--pink); }
.alert-type-phrase { background: rgba(196, 162, 101, 0.15); color: var(--gold); }
.alert-type-safety { background: rgba(232, 197, 116, 0.15); color: var(--warning); }

.alert-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 10px;
}

.alert-card .alert-content {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
  white-space: pre-line;
}

.alert-bullet-list {
  margin: 14px 0 0 18px;
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.alert-footnote {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.alert-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.alert-link-list .guide-inline-link {
  margin-top: 0;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  color: var(--text-dim);
  font-size: 14px;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  padding: 14px 20px;
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  color: var(--cream);
  animation: toastIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ============================================
   VIEW TOGGLE & TRIP DATES
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.view-toggle {
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 3px;
  scrollbar-width: none;
}

.view-toggle::-webkit-scrollbar {
  display: none;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: max-content;
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.view-btn:hover { color: var(--cream); }
.view-btn.active {
  background: var(--pink);
  color: var(--bg-deep);
}

.trip-dates {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.trip-range {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
}

.trip-duration {
  font-size: 12px;
  font-weight: 600;
  color: var(--pink);
  background: rgba(232, 160, 191, 0.15);
  padding: 3px 10px;
  border-radius: 12px;
}

.trip-timezone-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--cream);
  background: rgba(91, 192, 190, 0.16);
  border: 1px solid rgba(91, 192, 190, 0.32);
  padding: 3px 10px;
  border-radius: 12px;
}

/* Day filter scroll */
.filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.filter-row::-webkit-scrollbar { height: 3px; }
.filter-row::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

/* ============================================
   CALENDAR VIEW
   ============================================ */
.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.calendar-header-cell {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 8px 0;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.calendar-cell {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  padding: 8px;
  min-width: 0;
  min-height: 100px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.calendar-cell.empty {
  background: transparent;
  border-color: transparent;
}

.calendar-cell.today {
  border-color: var(--pink);
  box-shadow: 0 0 12px rgba(232, 160, 191, 0.2);
}

.calendar-cell.has-items {
  border-color: var(--border-light);
}

.calendar-cell.selected {
  border-color: rgba(91, 192, 190, 0.65);
  box-shadow: 0 0 0 1px rgba(91, 192, 190, 0.28), 0 10px 24px rgba(0, 0, 0, 0.2);
}

.calendar-cell:focus-visible {
  outline: 2px solid rgba(91, 192, 190, 0.9);
  outline-offset: 2px;
}

.calendar-date {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  margin-bottom: 6px;
}

.calendar-day-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.calendar-day-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.calendar-item {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 11px;
  color: var(--cream-soft);
  padding: 3px 6px;
  background: rgba(245, 240, 232, 0.04);
  border-radius: 4px;
  cursor: default;
  overflow: hidden;
}

.calendar-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--pink);
}

.calendar-item-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-item-meta {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: auto;
}

.calendar-item-more {
  justify-content: center;
  border: 1px dashed rgba(245, 240, 232, 0.14);
  color: var(--text-dim);
  background: rgba(245, 240, 232, 0.02);
}

.calendar-reservation-item {
  border-left: 2px solid rgba(232, 160, 191, 0.45);
}

.calendar-reservation-item .reservation-dot {
  background: transparent;
  border: 1.5px solid currentColor;
}

.calendar-reservation-item.status-booked {
  color: #ffd6a8;
}

.calendar-reservation-item.status-need_to_book {
  color: #ffd8f4;
}

.calendar-reservation-item.status-idea {
  color: #cdd6ff;
}

.calendar-reservation-item.status-used {
  color: #b9f0c9;
}

/* Day dot colors */
.day-dot-1 { background: #e8a0bf; }
.day-dot-2 { background: #74b4e8; }
.day-dot-3 { background: #7ec699; }
.day-dot-4 { background: #c4a265; }
.day-dot-5 { background: #e8c574; }
.day-dot-6 { background: #b284e8; }
.day-dot-7 { background: #e89874; }
.day-dot-8 { background: #74d4c8; }
.day-dot-9 { background: #e87474; }
.day-dot-10 { background: #a8c8e8; }
.day-dot-11 { background: #d4a8e8; }
.day-dot-12 { background: #e8d074; }
.day-dot-13 { background: #74e8a0; }
.day-dot-14 { background: #e8a074; }
.day-dot-15 { background: #8ea8e8; }

.calendar-day-detail-shell {
  margin-top: 16px;
  padding: 18px;
  background: var(--glass);
  border: 1px solid rgba(91, 192, 190, 0.24);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calendar-day-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.calendar-day-detail-header h3 {
  margin-top: 4px;
  color: var(--cream);
}

.calendar-day-detail-header p {
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 14px;
}

.calendar-day-detail-date {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(91, 192, 190, 0.12);
  color: var(--info);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.calendar-day-detail-sections {
  display: grid;
  gap: 14px;
}

.calendar-day-detail-section {
  display: grid;
  gap: 10px;
}

.calendar-day-detail-section-title {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-day-detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.calendar-day-detail-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 240, 232, 0.08);
  background: rgba(245, 240, 232, 0.03);
}

.calendar-day-detail-card.status-booked {
  border-color: rgba(255, 214, 168, 0.22);
}

.calendar-day-detail-card.status-need_to_book {
  border-color: rgba(255, 216, 244, 0.22);
}

.calendar-day-detail-card.status-used {
  border-color: rgba(185, 240, 201, 0.22);
}

.calendar-day-detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.calendar-day-detail-kicker {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-day-detail-top h4 {
  margin-top: 4px;
  color: var(--cream);
  font-size: 16px;
}

.calendar-day-detail-status {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(245, 240, 232, 0.06);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.calendar-day-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.calendar-day-detail-meta span {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(245, 240, 232, 0.05);
  color: var(--cream-soft);
  font-size: 11px;
}

.calendar-day-detail-copy,
.calendar-day-detail-empty,
.calendar-day-place-item span {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

.calendar-day-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.calendar-day-place-list {
  display: grid;
  gap: 10px;
}

.calendar-day-place-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 240, 232, 0.08);
  background: rgba(245, 240, 232, 0.03);
}

.calendar-day-place-item strong {
  color: var(--cream);
  font-size: 14px;
}

.calendar-unassigned {
  margin-top: 16px;
  padding: 16px;
  background: var(--glass);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
}

.calendar-unassigned-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.calendar-unassigned-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--cream-soft);
}

.calendar-unassigned-item:last-child { border-bottom: none; }

.calendar-unassigned-item.reservation {
  align-items: flex-start;
}

.calendar-unassigned-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.calendar-unassigned-hint {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}

.day-assign-select.compact {
  padding: 4px 8px;
  font-size: 11px;
}

/* ============================================
   WRAPPED
   ============================================ */
.wrapped-shell {
  position: relative;
}

.wrapped-panel,
.wrapped-deck-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(232, 160, 191, 0.16);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(232, 160, 191, 0.2), transparent 34%),
    radial-gradient(circle at top right, rgba(116, 180, 232, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(26, 26, 46, 0.98), rgba(11, 15, 31, 0.98));
  box-shadow: 0 30px 90px rgba(3, 6, 16, 0.4);
}

.wrapped-loading-state,
.wrapped-empty-state {
  min-height: 340px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px;
}

.wrapped-loading-copy,
.wrapped-empty-state {
  max-width: 420px;
}

.wrapped-empty-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.wrapped-deck-shell {
  padding: 22px;
}

.wrapped-deck-topbar,
.wrapped-deck-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wrapped-deck-topbar {
  margin-bottom: 18px;
}

.wrapped-deck-counter {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(245, 240, 232, 0.08);
  color: var(--cream);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.wrapped-eyebrow,
.wrapped-kicker,
.wrapped-callout-label,
.wrapped-mini-label,
.wrapped-finale-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(232, 226, 216, 0.66);
}

.wrapped-deck-topbar h3,
.wrapped-slide h3 {
  margin-top: 8px;
  font-size: clamp(28px, 4.3vw, 48px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.wrapped-deck-topbar h3 {
  font-size: clamp(22px, 3.2vw, 34px);
}

.wrapped-slide p,
.wrapped-loading-state p,
.wrapped-empty-state p {
  margin-top: 12px;
  color: rgba(232, 226, 216, 0.72);
  line-height: 1.55;
}

.wrapped-deck-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  padding-bottom: 8px;
}

.wrapped-deck-track::-webkit-scrollbar {
  display: none;
}

.wrapped-slide {
  position: relative;
  min-height: 520px;
  scroll-snap-align: start;
  padding: 28px;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(245, 240, 232, 0.04), rgba(245, 240, 232, 0.02)),
    rgba(8, 12, 24, 0.76);
  border: 1px solid rgba(245, 240, 232, 0.08);
}

.wrapped-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232, 160, 191, 0.14), transparent 45%, rgba(116, 180, 232, 0.12) 100%);
  pointer-events: none;
}

.wrapped-slide-noise {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.35) 0 1px, transparent 1px),
    radial-gradient(circle at 75% 35%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px);
  background-size: 18px 18px, 26px 26px, 22px 22px;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.wrapped-slide-copy,
.wrapped-category-list,
.wrapped-hero-metric,
.wrapped-day-hero,
.wrapped-callout-card,
.wrapped-reservation-stats,
.wrapped-timeline,
.wrapped-planner-grid,
.wrapped-bullet-stack,
.wrapped-note-quote,
.wrapped-finale-panel,
.wrapped-highlight-slab {
  position: relative;
  z-index: 1;
}

.wrapped-slide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 22px;
  align-items: end;
}

.wrapped-chip-row,
.wrapped-city-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.wrapped-chip,
.wrapped-city-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(245, 240, 232, 0.12);
  background: rgba(245, 240, 232, 0.06);
  color: var(--cream-soft);
  font-size: 13px;
}

.wrapped-hero-metric,
.wrapped-day-hero,
.wrapped-highlight-slab,
.wrapped-finale-panel {
  display: grid;
  gap: 8px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(232, 160, 191, 0.16), rgba(116, 180, 232, 0.08));
  border: 1px solid rgba(232, 160, 191, 0.14);
}

.wrapped-hero-label,
.wrapped-hero-subcopy {
  color: rgba(232, 226, 216, 0.7);
}

.wrapped-hero-metric strong,
.wrapped-day-hero strong,
.wrapped-highlight-slab strong,
.wrapped-finale-panel strong {
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.wrapped-category-list,
.wrapped-timeline,
.wrapped-bullet-stack {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.wrapped-category-row,
.wrapped-callout-card,
.wrapped-mini-card,
.wrapped-timeline-item,
.wrapped-note-quote {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(245, 240, 232, 0.05);
  border: 1px solid rgba(245, 240, 232, 0.08);
}

.wrapped-category-row-top,
.wrapped-category-row-meta,
.wrapped-reservation-stats,
.wrapped-planner-grid,
.wrapped-finale-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.wrapped-category-row-top strong,
.wrapped-reservation-stats strong,
.wrapped-mini-card strong {
  font-size: 24px;
  letter-spacing: -0.04em;
}

.wrapped-category-bar {
  position: relative;
  height: 10px;
  margin: 12px 0 10px;
  border-radius: 999px;
  background: rgba(245, 240, 232, 0.08);
  overflow: hidden;
}

.wrapped-category-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), #f3c06a);
}

.wrapped-category-row-meta,
.wrapped-callout-meta,
.wrapped-timeline-meta,
.wrapped-note-quote {
  color: rgba(232, 226, 216, 0.68);
  font-size: 13px;
}

.wrapped-callout-card {
  margin-top: 18px;
}

.wrapped-callout-title {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.wrapped-callout-card-cool {
  background: rgba(116, 180, 232, 0.08);
}

.wrapped-callout-card-warm {
  background: rgba(196, 162, 101, 0.1);
}

.wrapped-reservation-stats {
  margin-top: 20px;
}

.wrapped-reservation-stats > div,
.wrapped-mini-card,
.wrapped-finale-panel > div {
  flex: 1;
  display: grid;
  gap: 6px;
}

.wrapped-reservation-stats span,
.wrapped-mini-card span,
.wrapped-finale-panel span {
  color: rgba(232, 226, 216, 0.64);
  font-size: 13px;
}

.wrapped-timeline-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  align-items: start;
}

.wrapped-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--pink), #f3c06a);
  box-shadow: 0 0 18px rgba(232, 160, 191, 0.45);
}

.wrapped-timeline-title {
  font-weight: 600;
}

.wrapped-planner-grid {
  margin-top: 20px;
}

.wrapped-bullet-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--cream-soft);
}

.wrapped-note-quote {
  margin-top: 18px;
  font-family: 'Noto Serif JP', serif;
  font-size: 18px;
  line-height: 1.55;
}

.wrapped-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wrapped-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: rgba(245, 240, 232, 0.18);
  cursor: pointer;
  transition: var(--transition);
}

.wrapped-dot.active {
  width: 24px;
  background: linear-gradient(90deg, var(--pink), #f3c06a);
}

.wrapped-nav-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wrapped-nav-btn {
  min-width: 110px;
}

.wrapped-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wrapped-refresh-btn {
  white-space: nowrap;
}

body[data-route="wrapped"] {
  background:
    radial-gradient(circle at top, rgba(232, 160, 191, 0.09), transparent 34%),
    linear-gradient(180deg, #16182c, #0a0d18 65%);
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .mobile-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .mobile-nav::-webkit-scrollbar {
    display: none;
  }
  
  .page-container {
    padding: 16px calc(16px + var(--app-safe-right)) calc(var(--mobile-nav-height) + 24px + var(--app-safe-bottom) + var(--app-keyboard-inset)) calc(16px + var(--app-safe-left));
  }
  
  .section-header h2 { font-size: 20px; }
  .section-header { flex-wrap: wrap; gap: 8px; }
  
  .calendar-cell { min-height: 78px; padding: 6px 5px; }
  .calendar-date {
    align-items: flex-start;
    gap: 3px;
  }
  .calendar-day-num { font-size: 14px; }
  .calendar-item { font-size: 10px; padding: 2px 4px; }
  .calendar-item-name { max-width: none; }
  .calendar-item-meta { display: none; }
  .calendar-day-detail-header {
    flex-direction: column;
  }
  .calendar-day-detail-date {
    white-space: normal;
  }

  .itinerary-edit-modal {
    padding: 0;
    align-items: flex-end;
  }

  .itinerary-edit-dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px calc(24px + var(--app-safe-bottom));
  }

  .itinerary-edit-form {
    grid-template-columns: 1fr;
  }
  
  .trip-dates { flex-wrap: wrap; gap: 8px; }
  
  .expense-totals { grid-template-columns: 1fr; gap: 10px; }
  .expense-totals .total-card .amount { font-size: 22px; }
  .total-card .amount { font-size: 22px; }
  
  .itinerary-details { grid-template-columns: 1fr; }
  
  .packing-bar { width: 60px; }
  .packing-header { flex-wrap: wrap; }
  
  .day-group-header { flex-wrap: wrap; gap: 8px; }
  .weather-rain-badge { font-size: 9px; padding: 1px 6px; }
  
  .map-container { height: 400px; }
  
  .weather-grid { grid-template-columns: 1fr; }
  
  .input-group {
    flex-direction: column;
  }
  
  .btn-add { width: 100%; }

  .mobile-nav-link {
    flex: 0 0 74px;
    font-size: 10px;
    padding-left: 2px;
    padding-right: 2px;
  }

  .mobile-nav-link svg {
    width: 20px;
    height: 20px;
  }

  .language-direction {
    grid-template-columns: 1fr;
  }

  .language-swap-btn {
    width: 100%;
  }

  .language-file-grid {
    grid-template-columns: 1fr;
  }

  .wrapped-deck-shell {
    padding: 16px;
  }

  .wrapped-deck-topbar,
  .wrapped-deck-footer,
  .wrapped-reservation-stats,
  .wrapped-planner-grid,
  .wrapped-finale-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .wrapped-slide-hero {
    grid-template-columns: 1fr;
  }

  .wrapped-slide {
    min-height: 480px;
    padding: 20px;
  }

  .wrapped-slide h3 {
    font-size: clamp(24px, 8vw, 38px);
  }

  .wrapped-nav-buttons {
    width: 100%;
    justify-content: stretch;
  }

  .wrapped-nav-buttons .wrapped-nav-btn {
    flex: 1;
  }

  .language-result-block.translated p {
    font-size: 20px;
  }

  .language-phrasebook {
    grid-template-columns: 1fr;
  }

  .language-pronunciation-track {
    gap: 8px 6px;
  }
  
  .toast-container {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 640px) {
  .calendar-header-cell {
    font-size: 10px;
    padding: 6px 0;
  }

  .wrapped-deck-counter {
    align-self: flex-start;
  }

  .wrapped-chip-row,
  .wrapped-city-row,
  .wrapped-dots {
    gap: 8px;
  }

  .calendar-cell {
    min-height: 72px;
    padding: 5px 4px;
  }

  .calendar-day-name,
  .calendar-weather {
    display: none;
  }

  .calendar-day-num {
    font-size: 13px;
  }

  .calendar-items {
    gap: 2px;
  }

  .calendar-item {
    padding: 2px 3px;
  }

  .calendar-item:nth-child(n+3):not(.calendar-item-more) {
    display: none;
  }
}

@media (max-width: 480px) {
  .auth-content {
    padding: 36px 24px;
    border-radius: 20px;
  }

  .wrapped-slide {
    min-height: 440px;
    padding: 18px;
  }

  .wrapped-category-row-top,
  .wrapped-category-row-meta,
  .wrapped-timeline-item {
    gap: 10px;
  }

  .wrapped-nav-buttons {
    flex-direction: column;
  }
  
  .auth-kanji { font-size: 56px; }
  .auth-content h1 { font-size: 26px; }
  
  .page-container { padding: 12px calc(12px + var(--app-safe-right)) calc(var(--mobile-nav-height) + 20px + var(--app-safe-bottom) + var(--app-keyboard-inset)) calc(12px + var(--app-safe-left)); }
  
  .card { padding: 16px; }
  
  .expense-item {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .expense-amounts {
    margin-left: 0;
    text-align: left;
  }
  
  .expense-delete {
    margin-left: auto;
  }
  
  .total-card { padding: 14px; }
  .total-card .amount { font-size: 20px; }
  .total-card .label { font-size: 10px; }
  
  .map-container { height: 320px; }
  
  .itinerary-name { font-size: 16px; }

  .calendar-day-detail-shell {
    padding: 14px;
  }

  .calendar-day-detail-grid {
    grid-template-columns: 1fr;
  }
  
  .header-title { font-size: 16px; }
  .header-kanji { font-size: 24px; }

  .language-tool-shell {
    padding: 14px;
  }

  .language-result {
    padding: 12px;
  }

  .language-result-block p {
    font-size: 16px;
    line-height: 1.55;
  }

  .language-pronunciation-word {
    padding: 5px 7px;
  }

  .language-search-shell,
  .language-search-clear {
    width: 100%;
  }
}

/* ============================================
   DAY NOTES
   ============================================ */
.day-group {
  margin-bottom: 8px;
}

.day-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}

.day-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.day-group-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--cream);
}

.day-group-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.day-group-weather {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.day-notes-section {
  margin-bottom: 8px;
}

.day-notes-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 16px;
  background: rgba(245, 240, 232, 0.03);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
  color: var(--text-muted);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.day-notes-toggle:hover {
  color: var(--cream);
  background: rgba(245, 240, 232, 0.06);
}

.day-notes-toggle.has-notes {
  color: var(--gold);
}

.notes-toggle-icon {
  font-size: 14px;
}

.notes-toggle-label {
  flex: 1;
  text-align: left;
}

.notes-toggle-arrow {
  transition: transform 0.2s ease;
  font-size: 10px;
}

.day-notes-toggle.open .notes-toggle-arrow,
#notes-toggle-open .notes-toggle-arrow {
  transform: rotate(90deg);
}

.day-notes-area {
  overflow: hidden;
  max-height: 200px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.day-notes-area.collapsed {
  max-height: 0;
  opacity: 0;
}

.day-note-textarea {
  width: 100%;
  min-height: 80px;
  max-height: 160px;
  padding: 12px 16px;
  background: rgba(26, 26, 46, 0.6);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
  color: var(--cream);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
}

.day-note-textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.day-note-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(196, 162, 101, 0.15);
}

.note-saved-indicator {
  display: block;
  text-align: right;
  font-size: 11px;
  color: var(--success);
  padding: 2px 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.note-saved-indicator.visible {
  opacity: 1;
}

/* ============================================
   WEATHER PILLS (Itinerary)
   ============================================ */
.weather-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: rgba(116, 180, 232, 0.12);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--info);
  white-space: nowrap;
}

.weather-pill.rain-likely {
  background: rgba(232, 197, 116, 0.15);
  color: var(--warning);
}

.weather-rain-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: rgba(232, 197, 116, 0.12);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--warning);
  margin-left: 4px;
}

.calendar-weather {
  margin-left: auto;
  max-width: 100%;
}

.calendar-weather .weather-pill {
  font-size: 9px;
  padding: 1px 5px;
}

.calendar-weather .weather-rain-badge {
  display: none; /* too small for calendar cells */
}

/* ============================================
   PACKING LIST
   ============================================ */
.packing-section {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  animation: cardSlideIn 0.4s ease-out both;
}

.packing-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.packing-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
  flex: 1;
}

.packing-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.packing-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.packing-bar {
  width: 80px;
  height: 6px;
  background: rgba(245, 240, 232, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.packing-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.btn-regen-packing {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}

.btn-regen-packing:hover {
  border-color: var(--pink);
  background: rgba(232, 160, 191, 0.1);
}

.packing-empty {
  text-align: center;
  padding: 24px 16px;
}

.packing-empty p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.btn-generate-packing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--pink), #d48aad);
  color: var(--bg-deep);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
}

.btn-generate-packing:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--pink-glow);
}

.btn-generate-packing:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.packing-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.packing-category {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.packing-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(245, 240, 232, 0.04);
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
}

.packing-cat-count {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.packing-items {
  padding: 6px 8px;
}

.packing-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 14px;
}

.packing-item:hover {
  background: rgba(245, 240, 232, 0.04);
}

.packing-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  position: relative;
}

.packing-item input[type="checkbox"]:checked {
  background: var(--pink);
  border-color: var(--pink);
}

.packing-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--bg-deep);
}

.packing-item-text {
  flex: 1;
  color: var(--cream);
  transition: var(--transition);
}

.packing-item.checked .packing-item-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.packing-tip {
  font-size: 14px;
  cursor: help;
  flex-shrink: 0;
}

.packing-tip-text {
  padding: 4px 14px 8px 44px;
  font-size: 12px;
  color: var(--gold);
  line-height: 1.4;
  opacity: 0.8;
}

.packing-tip-text.checked {
  opacity: 0.4;
  text-decoration: line-through;
}

/* ============================================
   CHAT ASSISTANT — FAB + PANEL
   ============================================ */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), #d48aad);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--pink-glow), 0 2px 8px rgba(0,0,0,0.3);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: chatFabPulse 2s ease-in-out infinite;
}

.chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px var(--pink-glow), 0 4px 12px rgba(0,0,0,0.4);
}

.chat-fab.hidden,
.chat-fab.route-hidden { display: none; }

.chat-fab-icon { font-size: 24px; line-height: 1; }

@media (min-width: 1024px) {
  .chat-fab,
  .camera-fab,
  .egg-scan-fab {
    right: max(24px, calc((100vw - 1000px) / 2 + 24px));
  }
}

@keyframes chatFabPulse {
  0%, 100% { box-shadow: 0 4px 20px var(--pink-glow), 0 2px 8px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 4px 30px rgba(232, 160, 191, 0.5), 0 2px 8px rgba(0,0,0,0.3); }
}

/* Chat Overlay (mobile backdrop) */
.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.chat-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Chat Panel */
.chat-panel {
  position: fixed;
  top: 0;
  right: -420px;
  z-index: 1000;
  width: 400px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  border-left: 1px solid var(--glass-border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-panel.open {
  right: 0;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-icon {
  font-size: 28px;
}

.chat-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--cream);
}

.chat-header-subtitle {
  font-family: 'Noto Serif JP', serif;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.chat-header-actions {
  display: flex;
  gap: 4px;
}

.chat-clear-btn,
.chat-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.chat-clear-btn:hover,
.chat-close-btn:hover {
  color: var(--cream);
  background: var(--bg-card);
  border-color: var(--border);
}

/* Chat Mode */
.chat-mode-bar {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(20, 20, 34, 0.55);
}

.chat-mode-control {
  min-width: 0;
  width: 100%;
}

.chat-mode-hint {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-message-row {
  display: flex;
}

.chat-message-row-user {
  justify-content: flex-end;
}

.chat-message-row-assistant {
  justify-content: flex-start;
}

.chat-welcome {
  margin: auto 0;
  text-align: center;
  padding: 32px 18px;
  color: var(--text-dim);
}

.chat-welcome-icon {
  font-size: 44px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.chat-welcome h4 {
  color: var(--cream);
  font-size: 18px;
  margin-bottom: 8px;
}

.chat-welcome p {
  font-size: 14px;
  line-height: 1.6;
}

.chat-panel .guide-answer-card {
  width: 100%;
  padding: 16px;
  border-radius: 18px;
}

.chat-panel .guide-answer-title {
  font-size: 18px;
}

.chat-panel .guide-answer-summary,
.chat-panel .guide-answer-section-body,
.chat-panel .guide-validation-note,
.chat-panel .guide-answer-list,
.chat-panel .guide-source-title {
  font-size: 13px;
}

.chat-panel .guide-progress-stage {
  font-size: 10px;
  padding: 7px 8px;
}

.chat-panel .guide-progress-label {
  font-size: 13px;
}

.chat-panel .guide-progress-detail,
.chat-panel .guide-progress-note,
.chat-panel .guide-source-preview-label {
  font-size: 11px;
}

.chat-panel .guide-source-item {
  padding: 10px 12px;
}

/* Chat Bubbles */
.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  animation: bubbleIn 0.25s ease-out;
  word-wrap: break-word;
}

.chat-bubble code {
  background: rgba(245, 240, 232, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--pink), #d48aad);
  color: var(--bg-deep);
  border-bottom-right-radius: 4px;
}

.chat-assistant {
  align-self: flex-start;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--cream);
  border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.chat-typing-bubble {
  padding: 14px 20px;
}

.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick Suggestion Chips */
.chat-chips {
  display: flex;
  gap: 8px;
  padding: 8px 20px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

.chat-chips::-webkit-scrollbar { display: none; }

.chat-chips.used {
  display: none;
}

.chat-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  color: var(--text-dim);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.chat-chip:hover {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(232, 160, 191, 0.1);
}

/* Chat Input */
.chat-input-form {
  padding: 14px 16px 16px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  max-height: 180px;
  padding: 13px 15px;
  background: rgba(245, 240, 232, 0.06);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--cream);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  transition: var(--transition);
}

.chat-input::placeholder { color: var(--text-muted); }

.chat-input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px var(--pink-glow);
}

.chat-input-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.chat-input-tip {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), #d48aad);
  border: none;
  color: var(--bg-deep);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px var(--pink-glow);
}

.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-error-bubble {
  border-color: rgba(232, 116, 116, 0.35);
  color: #ffd8d8;
}

/* ============================================
   DRAG & DROP (SortableJS)
   ============================================ */
.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  font-size: 20px;
  color: var(--text-muted);
  cursor: grab;
  user-select: none;
  border-radius: var(--radius-xs);
  transition: color 0.2s ease, background 0.2s ease;
  margin-right: 4px;
  letter-spacing: 2px;
}

.drag-handle:hover {
  color: var(--cream);
  background: rgba(245, 240, 232, 0.08);
}

.drag-handle:active {
  cursor: grabbing;
}

.sortable-day {
  min-height: 40px;
  padding: 4px 0;
  border-radius: var(--radius-xs);
  transition: background 0.2s ease, min-height 0.2s ease;
}

.sortable-day:empty {
  min-height: 60px;
}

.sortable-empty-hint {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  margin: 4px 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

/* Ghost element while dragging */
.drag-ghost {
  opacity: 0.45;
  border: 2px dashed var(--pink) !important;
  background: rgba(232, 160, 191, 0.08) !important;
  backdrop-filter: blur(8px);
  border-radius: var(--radius) !important;
}

/* The chosen (picked-up) element */
.drag-chosen {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(232, 160, 191, 0.3), 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  border-color: var(--pink) !important;
  z-index: 100;
}

/* Active dragging cursor */
.drag-active {
  cursor: grabbing !important;
  opacity: 0.9;
}

/* When SortableJS adds a placeholder */
.sortable-fallback {
  opacity: 0.6;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
}

/* ============================================
   FOOD FINDER PANEL
   ============================================ */
.itinerary-action-btn.food-btn {
  font-size: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.itinerary-action-btn.food-btn:hover {
  border-color: var(--gold);
  background: rgba(196, 162, 101, 0.1);
}

.itinerary-item {
  position: relative;
}

.food-panel {
  margin-top: 16px;
  padding: 16px;
  background: rgba(196, 162, 101, 0.06);
  border: 1px solid rgba(196, 162, 101, 0.2);
  border-radius: var(--radius-sm);
  animation: foodPanelIn 0.3s ease-out;
}

@keyframes foodPanelIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.food-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
}

.food-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.food-panel-close:hover {
  color: var(--cream);
  background: var(--bg-card);
}

.food-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: var(--text-dim);
  font-size: 13px;
}

.food-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.food-rec {
  padding: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.food-rec:hover {
  border-color: var(--border-light);
}

.food-rec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.food-rec-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
}

.food-rec-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

.food-rec-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.food-cuisine-badge {
  display: inline-flex;
  padding: 2px 8px;
  background: rgba(232, 160, 191, 0.12);
  color: var(--pink);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.food-rec-distance {
  font-size: 12px;
  color: var(--text-dim);
}

.food-rec-tip {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.4;
}

.food-cached-tag {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.food-error, .food-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* ============================================
   ROUTE OPTIMIZER
   ============================================ */
.day-group-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.optimize-route-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--gold), #d4b36a);
  border: none;
  border-radius: 20px;
  color: var(--bg-deep);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  min-height: 32px;
}

.optimize-route-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(196, 162, 101, 0.4);
}

.optimize-route-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.optimize-route-btn .optimize-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
  border-top-color: var(--bg-deep);
}

.optimize-preview {
  background: rgba(196, 162, 101, 0.08);
  border: 1px solid rgba(196, 162, 101, 0.25);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  animation: foodPanelIn 0.3s ease-out;
}

.optimize-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.optimize-preview-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}

.optimize-walk-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: rgba(126, 198, 153, 0.15);
  color: var(--success);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
}

.optimize-order-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.optimize-order-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
}

.optimize-position {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--gold);
  color: var(--bg-deep);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.optimize-order-info {
  flex: 1;
  min-width: 0;
}

.optimize-order-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 2px;
}

.optimize-order-reason {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.optimize-tips {
  margin-bottom: 12px;
}

.optimize-tip {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 0;
  line-height: 1.5;
}

.optimize-actions {
  display: flex;
  gap: 10px;
}

.optimize-apply-btn {
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--gold), #d4b36a);
  border: none;
  border-radius: 20px;
  color: var(--bg-deep);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.optimize-apply-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(196, 162, 101, 0.4);
}

.optimize-dismiss-btn {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  color: var(--text-dim);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.optimize-dismiss-btn:hover {
  color: var(--cream);
  border-color: var(--cream);
}

/* ============================================
   TRANSIT CONNECTOR & CARDS
   ============================================ */
.transit-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  position: relative;
}

.transit-line-vert {
  width: 2px;
  height: 12px;
  background: var(--border-light);
  margin-bottom: 4px;
}

.transit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(116, 180, 232, 0.08);
  border: 1px dashed rgba(116, 180, 232, 0.3);
  border-radius: 16px;
  color: var(--info);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.transit-btn:hover {
  background: rgba(116, 180, 232, 0.15);
  border-color: var(--info);
  color: #8ec8f0;
}

.transit-card {
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}

.transit-card.open {
  max-height: 400px;
  opacity: 1;
  margin-top: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.transit-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  color: var(--text-dim);
  font-size: 13px;
}

.transit-error {
  padding: 8px;
  text-align: center;
  color: var(--danger);
  font-size: 13px;
}

.transit-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.transit-method-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}

.transit-details {
  flex: 1;
  min-width: 0;
}

.transit-main-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.transit-duration {
  font-size: 16px;
  font-weight: 700;
  color: var(--cream);
}

.transit-line {
  font-size: 12px;
  color: var(--info);
  background: rgba(116, 180, 232, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.transit-transfers {
  font-size: 11px;
  color: var(--text-dim);
}

.transit-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.transit-cost {
  font-size: 13px;
  font-weight: 600;
  color: var(--cream);
}

.transit-cost.free {
  color: var(--success);
}

.jr-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.jr-badge.jr-covered {
  background: rgba(126, 198, 153, 0.2);
  color: var(--success);
}

.jr-badge.jr-extra {
  background: rgba(232, 116, 116, 0.15);
  color: var(--danger);
}

.transit-steps-toggle {
  display: block;
  margin-top: 8px;
  padding: 4px 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.transit-steps-toggle:hover {
  color: var(--cream);
}

.transit-steps {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.transit-steps.expanded {
  max-height: 400px;
  margin-top: 8px;
}

.transit-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}

.transit-step:last-child {
  border-bottom: none;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(116, 180, 232, 0.15);
  color: var(--info);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Transit responsive */
@media (max-width: 768px) {
  .transit-card.open {
    padding: 10px 12px;
  }
  
  .transit-method-icon {
    font-size: 22px;
  }
  
  .transit-duration {
    font-size: 14px;
  }
  
  .optimize-route-btn {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  .optimize-preview {
    padding: 12px;
  }
  
  .optimize-order-item {
    padding: 8px;
  }
  
  .day-group-right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* ============================================
   CHAT RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }

  #guide-content {
    grid-template-columns: 1fr;
  }

  .guide-research-shell {
    min-height: 0;
  }
}

@media (max-width: 768px) {
  .guide-research-header,
  .guide-library-header,
  .guide-chat-form,
  .guide-chat-messages,
  .guide-chat-suggestions,
  .guide-library-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .guide-research-header,
  .guide-library-header {
    flex-direction: column;
    align-items: stretch;
  }

  .guide-chat-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .guide-chat-send {
    width: 100%;
  }

  .guide-chat-bubble,
  .guide-answer-card {
    max-width: 100%;
  }

  .chat-fab {
    bottom: calc(var(--mobile-nav-height) + 16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
  }

  .chat-panel {
    width: 100%;
    right: -100%;
    border-left: none;
  }

  .chat-panel.open {
    right: 0;
  }

  .chat-input-form {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .chat-input-meta {
    align-items: flex-end;
  }
}

/* ============================================
   CAMERA VISION — FAB + MODAL
   ============================================ */
.camera-fab {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 899;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #b8953d);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(196, 162, 101, 0.4), 0 2px 6px rgba(0,0,0,0.3);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(196, 162, 101, 0.5), 0 4px 10px rgba(0,0,0,0.4);
}

.camera-fab-icon { font-size: 20px; line-height: 1; }

/* Camera overlay */
.camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 960;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.camera-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Camera modal */
.camera-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 970;
  width: 480px;
  max-width: 94vw;
  max-height: 90vh;
  background: var(--bg-deep);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.camera-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.camera-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.camera-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.camera-modal-title > span {
  font-size: 28px;
}

.camera-title-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--cream);
}

.camera-title-sub {
  font-family: 'Noto Serif JP', serif;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.camera-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.camera-close-btn:hover {
  color: var(--cream);
  background: var(--bg-card);
  border-color: var(--border);
}

.camera-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
}

.camera-step { animation: pageFadeIn 0.3s ease-out; }

/* Step 1: Choose source */
.camera-choose-icon {
  font-size: 56px;
  text-align: center;
  margin-bottom: 12px;
  opacity: 0.8;
}

.camera-choose-text {
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 24px;
}

.camera-choose-buttons {
  display: flex;
  gap: 12px;
}

.camera-choose-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: 100px;
}

.camera-choose-btn:hover {
  border-color: var(--gold);
  background: rgba(196, 162, 101, 0.08);
}

.camera-choose-btn svg {
  color: var(--gold);
}

/* Step 2: Preview + Ask */
.camera-preview-wrap {
  position: relative;
  margin-bottom: 16px;
}

.camera-preview {
  width: 100%;
  max-height: 40vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.3);
}

.camera-change-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.camera-change-btn:hover {
  background: rgba(232, 116, 116, 0.8);
}

.camera-question-wrap {
  display: flex;
  gap: 8px;
}

.camera-question-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(245, 240, 232, 0.06);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--cream);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.camera-question-input::placeholder { color: var(--text-muted); }

.camera-question-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(196, 162, 101, 0.2);
}

.camera-ask-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--gold), #b8953d);
  color: var(--bg-deep);
  border: none;
  border-radius: 24px;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  min-height: 44px;
}

.camera-ask-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 162, 101, 0.4);
}

.camera-ask-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Step 3: Result */
.camera-result-image-wrap {
  margin-bottom: 16px;
}

.camera-result-img {
  width: 100%;
  max-height: 35vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.3);
}

.camera-result-question {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(245, 240, 232, 0.04);
  border-radius: var(--radius-xs);
}

.camera-result-answer {
  font-size: 14px;
  color: var(--cream);
  line-height: 1.7;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  max-height: 30vh;
  overflow-y: auto;
}

.camera-result-answer strong { color: var(--gold); }
.camera-result-answer code {
  background: rgba(245, 240, 232, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}

.camera-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.camera-again-btn,
.camera-rephrase-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  color: var(--cream);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.camera-again-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.camera-rephrase-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
}

/* Camera mobile responsive */
@media (max-width: 768px) {
  .camera-fab {
    bottom: calc(var(--mobile-nav-height) + 72px + env(safe-area-inset-bottom, 0px));
    right: 16px;
  }

  .camera-modal {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    transform: translateY(20px);
    padding-top: var(--app-safe-top);
    padding-bottom: var(--app-safe-bottom);
  }

  .camera-modal.open {
    transform: translateY(0);
  }

  .camera-choose-buttons {
    flex-direction: column;
  }

  .camera-choose-btn {
    flex-direction: row;
    padding: 18px 20px;
    min-height: auto;
  }

  .camera-question-wrap {
    flex-direction: column;
  }

  .camera-ask-btn {
    width: 100%;
  }

  .camera-result-actions {
    flex-direction: column;
  }

  .camera-again-btn,
  .camera-rephrase-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   EGG SCAN
   ============================================ */
.egg-scan-fab {
  position: fixed;
  bottom: 146px;
  right: 24px;
  z-index: 898;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f6d878, #e7b94a);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(231, 185, 74, 0.35), 0 2px 6px rgba(0,0,0,0.3);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.egg-scan-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(231, 185, 74, 0.45), 0 4px 10px rgba(0,0,0,0.35);
}

.egg-scan-fab-icon {
  font-size: 22px;
  line-height: 1;
}

.egg-scan-modal-header {
  border-bottom-color: rgba(231, 185, 74, 0.18);
}

.egg-scan-helper {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(231, 185, 74, 0.08);
  border: 1px solid rgba(231, 185, 74, 0.18);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

.egg-scan-helper strong {
  color: var(--cream);
}

.egg-scan-helper-tight {
  margin-bottom: 16px;
}

.egg-scan-thumb-strip {
  display: flex;
  gap: 10px;
  margin: 14px 0 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.egg-scan-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(245, 240, 232, 0.14);
  background: rgba(245, 240, 232, 0.03);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.egg-scan-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.egg-scan-thumb.is-active {
  border-color: rgba(231, 185, 74, 0.65);
  box-shadow: 0 0 0 2px rgba(231, 185, 74, 0.18);
}

.egg-scan-selection-note {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.egg-scan-submit-btn {
  width: 100%;
}

.egg-scan-result-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  margin-bottom: 14px;
}

.egg-scan-result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.egg-scan-badges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.egg-scan-verdict,
.egg-scan-phase {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.egg-scan-verdict.is-danger {
  background: rgba(232, 116, 116, 0.18);
  color: #ffb0b0;
  border: 1px solid rgba(232, 116, 116, 0.3);
}

.egg-scan-verdict.is-safe {
  background: rgba(101, 196, 138, 0.16);
  color: #b4f0c8;
  border: 1px solid rgba(101, 196, 138, 0.28);
}

.egg-scan-verdict.is-unknown {
  background: rgba(231, 185, 74, 0.18);
  color: #f6d878;
  border: 1px solid rgba(231, 185, 74, 0.28);
}

.egg-scan-phase {
  background: rgba(91, 192, 190, 0.14);
  color: #a8f0ee;
  border: 1px solid rgba(91, 192, 190, 0.28);
}

.egg-scan-confidence {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.egg-scan-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 8px;
}

.egg-scan-summary {
  font-size: 14px;
  line-height: 1.7;
  color: var(--cream);
}

.egg-scan-meta {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.egg-scan-progress-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  background: rgba(91, 192, 190, 0.09);
  border: 1px solid rgba(91, 192, 190, 0.18);
  color: #c6f4f0;
  font-size: 13px;
  line-height: 1.6;
}

.egg-scan-caution {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(232, 116, 116, 0.08);
  border: 1px solid rgba(232, 116, 116, 0.16);
  color: #ffd5d5;
  font-size: 13px;
  line-height: 1.6;
}

.egg-scan-detail-block {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid rgba(245, 240, 232, 0.08);
}

.egg-scan-detail-title {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.egg-scan-list {
  margin: 0;
  padding-left: 18px;
  color: var(--cream);
  font-size: 14px;
  line-height: 1.7;
}

.egg-scan-visible-text {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
  white-space: normal;
}

.egg-scan-source-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.egg-scan-source-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--cream);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(245, 240, 232, 0.08);
  background: rgba(245, 240, 232, 0.03);
  transition: var(--transition);
}

.egg-scan-source-link:hover {
  border-color: rgba(231, 185, 74, 0.35);
  background: rgba(231, 185, 74, 0.08);
}

.egg-scan-source-meta {
  color: var(--text-muted);
  font-size: 12px;
}

@media (max-width: 768px) {
  .egg-scan-fab {
    bottom: calc(var(--mobile-nav-height) + 130px + env(safe-area-inset-bottom, 0px));
    right: 16px;
  }

  .egg-scan-result-topline {
    align-items: flex-start;
  }
}

/* ============================================
   DAILY BRIEFING CARD
   ============================================ */
.briefing-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(196, 162, 101, 0.25);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  animation: cardSlideIn 0.4s ease-out both;
}

.briefing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.briefing-header:hover {
  background: rgba(245, 240, 232, 0.04);
}

.briefing-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.briefing-icon { font-size: 22px; }

.briefing-header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--cream);
}

.briefing-header-right {
  display: flex;
  align-items: center;
}

.briefing-arrow {
  color: var(--text-dim);
  transition: transform 0.3s ease;
}

.briefing-body {
  padding: 0 20px 16px;
  max-height: 600px;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
  opacity: 1;
}

.briefing-body.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 20px;
}

.briefing-content {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}

.briefing-full {
  white-space: pre-line;
}

.briefing-line {
  margin-bottom: 6px;
}

.briefing-greeting {
  font-weight: 600;
  font-size: 15px;
  color: var(--cream);
}

.briefing-tip {
  color: var(--gold);
  font-style: italic;
}

.briefing-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.briefing-refresh-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  color: var(--cream);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.briefing-refresh-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.briefing-refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.briefing-cached {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* Countdown style */
.briefing-countdown {
  text-align: center;
  padding: 28px 20px;
}

.briefing-countdown-number {
  font-size: 56px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 4px;
  text-shadow: 0 0 30px rgba(196, 162, 101, 0.3);
}

.briefing-countdown-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 8px;
}

.briefing-countdown-dates {
  font-size: 13px;
  color: var(--text-dim);
}

/* ============================================
   RATE TICKER
   ============================================ */
.rate-ticker {
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 14px;
  background: rgba(245, 240, 232, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 0.3px;
}

.rate-ticker .rate-updated {
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   BUDGET DASHBOARD
   ============================================ */
#budget-dashboard {
  margin-bottom: 24px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.dashboard-header:hover {
  background: rgba(245, 240, 232, 0.08);
}

.dashboard-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-header .jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 400;
}

.dashboard-toggle-icon {
  color: var(--text-dim);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.dashboard-body {
  border: 1px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(30, 30, 54, 0.5);
  overflow: hidden;
  max-height: 800px;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 16px;
  opacity: 1;
}

.dashboard-body.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.dashboard-card h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.empty-chart {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 30px 0;
}

/* Donut Chart */
.donut-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.donut-svg {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}

.donut-segment {
  transition: opacity 0.2s;
}

.donut-segment:hover {
  opacity: 0.8;
}

.donut-total-label {
  font-size: 10px;
  fill: var(--text-dim);
  font-family: 'Instrument Sans', sans-serif;
  transform: rotate(90deg);
  transform-origin: center;
}

.donut-total-amount {
  font-size: 14px;
  fill: var(--cream);
  font-weight: 700;
  font-family: 'Instrument Sans', sans-serif;
  transform: rotate(90deg);
  transform-origin: center;
}

.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-label {
  color: var(--cream-soft);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-value {
  color: var(--cream);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.legend-pct {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  width: 32px;
  text-align: right;
}

/* Bar Chart */
.bar-chart {
  display: flex;
  gap: 8px;
  height: 120px;
}

.bar-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  padding: 0 0 18px 0;
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  flex: 1;
  padding-bottom: 18px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  cursor: default;
}

.bar-fill {
  width: 100%;
  max-width: 18px;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: height 0.4s ease;
  min-height: 0;
}

.bar-fill-total {
  background: linear-gradient(to top, var(--pink), rgba(232, 160, 191, 0.6));
}

.bar-label {
  font-size: 9px;
  color: var(--text-muted);
  position: absolute;
  bottom: -16px;
  font-variant-numeric: tabular-nums;
}

/* Dashboard responsive */
@media (max-width: 640px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .donut-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .donut-svg {
    width: 120px;
    height: 120px;
  }

  .donut-legend {
    width: 100%;
  }

  .bar-chart {
    height: 100px;
  }

  .bar-y-axis {
    min-width: 28px;
    font-size: 9px;
  }
}

/* ============================================
   EXPENSE PAYMENT TRACKING
   ============================================ */
.expense-paid-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.paid-check {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 12px;
}

.paid-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--success);
  cursor: pointer;
}

.paid-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}

.paid-label.paid-k { color: var(--info); }
.paid-label.paid-m { color: var(--success); }

.settled-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  background: rgba(126, 198, 153, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

.expense-settled {
  opacity: 0.6;
  border-left: 3px solid var(--success);
}

.expense-settled .expense-desc {
  text-decoration: line-through;
  text-decoration-color: var(--text-dim);
}

.paid-note {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
}

/* ============================================
   NOTES / NOTEBOOK PAGE
   ============================================ */
.notes-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 18px;
  align-items: start;
}

.notes-shell {
  min-width: 0;
  padding: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notes-notebook-shell {
  order: 1;
}

.notes-packing-shell {
  order: 2;
}

.notes-recovery-shell {
  order: 3;
  grid-column: 1 / -1;
  padding: 0;
  background: rgba(245, 240, 232, 0.025);
  border-style: dashed;
}

.notes-composer {
  margin-bottom: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.notes-add-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.notes-control-input,
.notes-add-bar input {
  width: 100%;
  min-width: 0;
  padding: 12px 16px;
  background: rgba(245, 240, 232, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--cream);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.notes-control-input::placeholder,
.notes-add-bar input::placeholder {
  color: var(--text-muted);
}

.notes-control-input:focus,
.notes-add-bar input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-glow);
}

.notes-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.notes-filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.notes-filter-btn:hover { border-color: var(--pink); color: var(--cream); }
.notes-filter-btn.active { background: var(--pink); border-color: var(--pink); color: var(--bg-deep); }

.notes-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.notes-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

.notes-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.notes-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.note-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  animation: slideInCard 0.3s ease-out both;
  transition: var(--transition);
}

.note-item:hover { border-color: var(--border-light); }

.note-checkbox {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid var(--border-light);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-top: 1px;
  color: var(--success);
}

.note-checkbox:hover { border-color: var(--success); }
.note-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg-deep);
}

.note-icon {
  font-size: 16px;
  margin-top: 2px;
  min-width: 22px;
  text-align: center;
}

.note-content {
  flex: 1;
  font-size: 14px;
  color: var(--cream);
  line-height: 1.5;
  word-break: break-word;
  cursor: default;
  padding: 2px 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.note-content.editing {
  background: rgba(245, 240, 232, 0.06);
  outline: 1px solid var(--pink);
  cursor: text;
}

.note-checked .note-content {
  text-decoration: line-through;
  color: var(--text-dim);
}

.note-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
}

.note-item:hover .note-actions { opacity: 1; }

/* Always visible on mobile */
@media (max-width: 768px) {
  .note-actions { opacity: 0.6; }
}

.note-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}

.note-action-btn:hover { background: rgba(245, 240, 232, 0.08); color: var(--cream); }
.note-action-btn.delete:hover { color: var(--danger); }

/* ============================================
   UX MERGE ADDITIONS
   ============================================ */

.itinerary-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.itinerary-toolbar-side {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.calendar-timezone-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  min-height: 46px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.calendar-timezone-toggle-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.calendar-timezone-buttons {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(245, 240, 232, 0.06);
}

.calendar-timezone-btn {
  min-width: 56px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition);
}

.calendar-timezone-btn:hover {
  color: var(--cream);
}

.calendar-timezone-btn.active {
  background: var(--pink);
  color: var(--bg-deep);
}

.itinerary-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}

.itinerary-search:focus-within {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-glow);
}

.itinerary-search input {
  flex: 1;
  min-width: 0;
  height: 46px;
  background: transparent;
  border: none;
  color: var(--cream);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.itinerary-search input::placeholder {
  color: var(--text-muted);
}

.search-clear-btn {
  border: none;
  background: rgba(245, 240, 232, 0.08);
  color: var(--cream);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.search-clear-btn:hover {
  background: rgba(232, 160, 191, 0.16);
  color: var(--pink);
}

.itinerary-summary {
  min-width: 220px;
  padding: 10px 14px;
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.itinerary-export-btn {
  min-width: 148px;
  white-space: nowrap;
}

.itinerary-summary-primary {
  font-size: 13px;
  font-weight: 700;
  color: var(--cream);
}

.itinerary-summary-secondary {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
}

.day-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.day-btn-day {
  align-items: flex-start;
  justify-content: space-between;
  min-width: 124px;
  text-align: left;
}

.day-btn-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.day-btn-primary {
  color: var(--cream);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.day-btn-secondary {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
}

.day-btn.active .day-btn-primary,
.day-btn.active .day-btn-secondary {
  color: inherit;
}

.day-btn-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(245, 240, 232, 0.08);
  border-radius: 999px;
  color: var(--cream);
  font-size: 11px;
  font-weight: 700;
}

.day-btn.active .day-btn-count {
  background: rgba(26, 26, 46, 0.18);
  color: inherit;
}

.itinerary-inline-note,
.flat-view-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.flat-view-intro strong {
  display: block;
  color: var(--cream);
  margin-bottom: 2px;
}

.flat-view-intro span {
  display: block;
}

.itinerary-title-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.itinerary-title-block > div {
  min-width: 0;
}

.itinerary-name {
  word-break: break-word;
}

.itinerary-day-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-8 { background: rgba(116, 212, 200, 0.15); color: #74d4c8; }
.day-9 { background: rgba(232, 116, 116, 0.15); color: #e87474; }
.day-10 { background: rgba(168, 200, 232, 0.15); color: #a8c8e8; }
.day-11 { background: rgba(212, 168, 232, 0.15); color: #d4a8e8; }
.day-12 { background: rgba(232, 208, 116, 0.15); color: #e8d074; }
.day-13 { background: rgba(116, 232, 160, 0.15); color: #74e8a0; }
.day-14 { background: rgba(232, 160, 116, 0.15); color: #e8a074; }
.day-15 { background: rgba(142, 168, 232, 0.15); color: #8ea8e8; }

.itinerary-tips-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.notes-composer {
  margin-bottom: 14px;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notes-compose-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.notes-type-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.notes-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 10px 14px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.notes-type-btn:hover {
  color: var(--cream);
  background: rgba(245, 240, 232, 0.06);
}

.notes-type-btn.active {
  background: linear-gradient(135deg, var(--pink), #d48aad);
  color: var(--bg-deep);
  box-shadow: 0 6px 18px rgba(232, 160, 191, 0.18);
}

.notes-type-icon {
  font-size: 14px;
}

.notes-compose-hint {
  flex: 1;
  font-size: 13px;
  color: var(--text-dim);
  text-align: right;
  line-height: 1.5;
}

.notes-filters {
  flex-wrap: wrap;
}

.notes-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notes-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(245, 240, 232, 0.08);
  color: currentColor;
  font-size: 11px;
  font-weight: 700;
}

.note-content-wrap {
  flex: 1;
  min-width: 0;
}

.note-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.note-kind-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.note-kind-badge.note {
  background: rgba(116, 180, 232, 0.14);
  color: var(--info);
}

.note-kind-badge.todo {
  background: rgba(126, 198, 153, 0.14);
  color: var(--success);
}

.notes-empty-state {
  padding-top: 48px;
}

.notes-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.notes-section-header h3 {
  margin: 4px 0 6px;
  font-size: 22px;
}

.notes-section-header p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.notes-section-header-stacked {
  align-items: flex-start;
}

.rollback-disclosure {
  display: block;
}

.rollback-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

.rollback-summary::-webkit-details-marker {
  display: none;
}

.rollback-summary-copy {
  flex: 1;
  min-width: 0;
}

.rollback-summary-copy h3 {
  margin: 4px 0 6px;
  font-size: 18px;
  color: var(--cream-soft);
}

.rollback-summary-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.rollback-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.rollback-summary-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(245, 240, 232, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rollback-summary-caret {
  color: var(--text-dim);
  font-size: 16px;
  transition: transform 0.2s ease;
}

.rollback-disclosure[open] .rollback-summary-caret {
  transform: rotate(180deg);
}

.rollback-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--glass-border);
}

.rollback-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.rollback-card {
  min-width: 0;
  padding: 16px;
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

.rollback-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.rollback-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
}

.rollback-select {
  min-height: 48px;
}

.rollback-details,
.rollback-detail-list {
  display: grid;
  gap: 10px;
}

.rollback-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
}

.rollback-detail-row span {
  flex: 0 0 120px;
}

.rollback-detail-row strong {
  flex: 1;
  color: var(--cream);
  text-align: right;
  word-break: break-word;
}

.rollback-action-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rollback-warning {
  padding: 14px;
  background: rgba(232, 200, 116, 0.08);
  border: 1px solid rgba(232, 200, 116, 0.22);
  border-radius: var(--radius-sm);
}

.rollback-warning strong {
  display: block;
  color: #f4d27d;
  margin-bottom: 6px;
}

.rollback-warning p,
.rollback-empty-state p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.6;
}

.rollback-actions {
  display: flex;
}

.rollback-actions .btn-add {
  width: 100%;
  justify-content: center;
}

.rollback-meta {
  display: grid;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

.rollback-meta code {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: var(--cream);
}

.rollback-status {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(245, 240, 232, 0.04);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.rollback-status.tone-success {
  border-color: rgba(126, 198, 153, 0.28);
  background: rgba(126, 198, 153, 0.10);
  color: #b6e7c7;
}

.rollback-status.tone-warning {
  border-color: rgba(232, 200, 116, 0.24);
  background: rgba(232, 200, 116, 0.10);
  color: #f4d27d;
}

.rollback-status.tone-error {
  border-color: rgba(232, 116, 116, 0.24);
  background: rgba(232, 116, 116, 0.10);
  color: #f4b0b0;
}

.rollback-empty-state {
  padding: 14px;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(245, 240, 232, 0.03);
}

.rollback-empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--cream);
}

.notes-packing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.packing-add-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

#packing-item-input {
  grid-column: 1 / -1;
}

#packing-add-btn {
  grid-column: 1 / -1;
}

.notes-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notes-section-divider::before,
.notes-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.packing-notes-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 120px;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-align: center;
}

.packing-notes-empty .icon {
  font-size: 24px;
}

.packing-notes-progress {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.packing-notes-progress-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--cream);
}

.packing-notes-progress-subtext {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

.packing-notes-list {
  display: grid;
  gap: 10px;
}

.packing-note-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: rgba(245, 240, 232, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.packing-note-item.checked {
  opacity: 0.82;
}

.packing-note-main {
  flex: 1;
  min-width: 0;
}

.packing-note-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.packing-note-category {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(232, 160, 191, 0.12);
  color: var(--pink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.packing-note-category-count {
  color: var(--text-dim);
  font-size: 12px;
}

.packing-note-content,
.packing-note-tip {
  padding: 4px 0;
  border-radius: 6px;
  line-height: 1.5;
}

.packing-note-content {
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
}

.packing-note-tip {
  color: var(--text-dim);
  font-size: 13px;
}

.packing-note-tip.empty {
  color: var(--text-muted);
  font-style: italic;
}

[data-edit-field].editing {
  background: rgba(245, 240, 232, 0.06);
  outline: 1px solid var(--pink);
  padding-inline: 6px;
}

.guide-inline-link {
  display: inline-flex;
  margin-top: 12px;
  text-decoration: none;
}

.alert-card-packing-link {
  border-style: dashed;
}

/* ============================================
   RESERVATIONS
   ============================================ */
.reservations-compose-shell {
  display: grid;
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.reservations-compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 12px;
  align-items: start;
}

.reservation-input {
  min-height: 110px;
  resize: vertical;
}

.reservation-quick-fields {
  display: grid;
  gap: 10px;
}

.reservation-compose-files {
  display: grid;
  gap: 8px;
}

.reservation-file-picker {
  display: grid;
  gap: 2px;
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
}

.reservation-file-picker-subtext,
.reservation-attachments-subtext,
.reservation-meta-text {
  color: var(--text-dim);
  font-size: 12px;
}

.reservation-files-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reservation-file-chip,
.reservation-meta-pill,
.itinerary-reservation-meta span,
.itinerary-reservation-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(245, 240, 232, 0.06);
  border: 1px solid rgba(245, 240, 232, 0.08);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}

.reservation-file-chip-meta {
  color: var(--text-muted);
}

.reservations-toolbar {
  margin-bottom: 16px;
}

.reservations-list-grid {
  display: grid;
  gap: 14px;
}

.reservation-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: rgba(245, 240, 232, 0.03);
  border: 1px solid var(--glass-border);
  border-left: 4px solid rgba(245, 240, 232, 0.12);
  border-radius: var(--radius-md);
}

.reservation-card.status-booked,
.itinerary-reservation-card.status-booked {
  border-left-color: rgba(113, 201, 137, 0.95);
}

.reservation-card.status-need_to_book,
.itinerary-reservation-card.status-need_to_book {
  border-left-color: rgba(240, 196, 107, 0.95);
}

.reservation-card.status-idea,
.itinerary-reservation-card.status-idea {
  border-left-color: rgba(122, 163, 255, 0.95);
}

.reservation-card.status-used,
.itinerary-reservation-card.status-used {
  border-left-color: rgba(187, 138, 255, 0.95);
}

.reservation-card-header,
.reservation-attachments-header,
.reservation-card-actions,
.itinerary-reservation-top,
.itinerary-reservations-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reservation-card-eyebrow {
  color: var(--pink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reservation-card-title {
  margin: 4px 0 0;
  color: var(--cream);
  font-size: 20px;
}

.reservation-meta-row,
.reservation-meta-text,
.reservation-attachments-list,
.itinerary-reservations-list,
.itinerary-reservation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reservation-meta-text span,
.itinerary-reservation-linked,
.itinerary-reservation-notes {
  color: var(--text-dim);
  font-size: 13px;
}

.reservation-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.reservation-field {
  display: grid;
  gap: 6px;
}

.reservation-field > span {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reservation-notes-field {
  grid-column: 1 / -1;
}

.reservation-notes-input {
  min-height: 92px;
  resize: vertical;
}

.reservation-attachments-shell {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(245, 240, 232, 0.06);
  border-radius: var(--radius-sm);
}

.reservation-attachments-list.empty {
  min-height: 32px;
  align-items: center;
}

.reservation-attachments-empty {
  color: var(--text-muted);
  font-size: 13px;
}

.reservation-attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(245, 240, 232, 0.05);
  border: 1px solid rgba(245, 240, 232, 0.08);
  border-radius: 999px;
}

.reservation-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cream);
  text-decoration: none;
}

.reservation-attachment-link:hover {
  color: var(--pink);
}

.reservation-attachment-remove {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.reservation-attachment-remove:hover {
  color: var(--danger);
}

.itinerary-reservations-strip {
  display: grid;
  gap: 10px;
  margin: 12px 0 16px;
  padding: 14px;
  background: rgba(245, 240, 232, 0.04);
  border: 1px solid rgba(245, 240, 232, 0.08);
  border-radius: var(--radius-sm);
}

.itinerary-reservations-strip-header {
  color: var(--cream);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.itinerary-reservation-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(245, 240, 232, 0.06);
  border-left: 4px solid rgba(245, 240, 232, 0.12);
  border-radius: var(--radius-sm);
}

.itinerary-reservation-name {
  color: var(--cream);
  font-size: 14px;
}

.reservation-delete-btn {
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .notes-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .section-header {
    align-items: stretch;
  }

  .view-toggle {
    width: 100%;
  }

  .view-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 0 10px;
  }

  .itinerary-toolbar {
    grid-template-columns: 1fr;
  }

  .itinerary-toolbar-side {
    flex-direction: column;
  }

  .calendar-timezone-toggle {
    justify-content: space-between;
    width: 100%;
  }

  .itinerary-summary {
    min-width: 0;
  }

  .itinerary-export-btn {
    width: 100%;
  }

  .itinerary-header {
    flex-direction: column;
    gap: 12px;
  }

  .itinerary-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .day-assign-select {
    flex: 1;
    min-width: 0;
  }

  .notes-layout {
    grid-template-columns: 1fr;
  }

  .notes-shell {
    padding: 16px;
  }

  .notes-section-header-stacked {
    flex-direction: column;
  }

  .notes-packing-actions {
    width: 100%;
  }

  .notes-packing-actions .btn-secondary {
    flex: 1;
    justify-content: center;
  }

  .packing-add-bar {
    grid-template-columns: 1fr;
  }

  .rollback-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .rollback-summary-actions {
    width: 100%;
    justify-content: space-between;
  }

  .rollback-body {
    padding: 0 14px 14px;
  }

  .rollback-grid {
    grid-template-columns: 1fr;
  }

  .rollback-toolbar,
  .rollback-actions {
    flex-direction: column;
  }

  .rollback-toolbar .btn-secondary,
  .rollback-actions .btn-add {
    width: 100%;
    justify-content: center;
  }

  .rollback-detail-row {
    flex-direction: column;
  }

  .rollback-detail-row strong {
    text-align: left;
  }

  #packing-item-input,
  #packing-add-btn {
    grid-column: auto;
  }

  .packing-note-item {
    padding: 12px;
  }

  .packing-note-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .notes-compose-top {
    flex-direction: column;
    align-items: stretch;
  }

  .notes-compose-hint {
    text-align: left;
  }

  .notes-type-toggle {
    width: 100%;
  }

  .notes-type-btn {
    flex: 1;
    justify-content: center;
  }

  .notes-add-bar {
    flex-direction: column;
  }

  .reservations-compose-grid,
  .reservation-edit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .view-btn span {
    font-size: 11px;
  }

  .day-btn {
    padding-inline: 12px;
  }

  .itinerary-search {
    padding-inline: 12px;
  }

  .search-clear-btn {
    padding-inline: 8px;
  }
}

/* ============================================
   SCENIC DRIVES PAGE
   ============================================ */
.section-header-stack-mobile {
  align-items: flex-end;
}

.section-subcopy {
  margin-top: 8px;
  max-width: 720px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.drives-sort-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.drives-sort-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  font: inherit;
}

.drives-hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.drives-hero-copy,
.drives-summary-card,
.drive-card,
.drive-detail-card,
.drive-waypoints-shell {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.drives-hero-copy {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at top right, rgba(91, 192, 190, 0.18), transparent 34%),
    radial-gradient(circle at left center, rgba(196, 162, 101, 0.14), transparent 30%),
    var(--glass);
}

.drives-hero-copy h3 {
  margin: 6px 0 10px;
  font-size: 26px;
  line-height: 1.15;
}

.drives-hero-copy p {
  max-width: 72ch;
  color: var(--text-dim);
  line-height: 1.7;
}

.drives-summary-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.drives-summary-card {
  padding: 18px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drives-summary-card strong {
  font-size: 22px;
  color: var(--cream);
}

.drives-summary-label {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.drives-filter-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.drives-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.drives-filter-chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(232, 160, 191, 0.2);
  background: rgba(232, 160, 191, 0.08);
  color: var(--cream-soft);
  font: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.drives-filter-chip:hover,
.drives-filter-chip.active {
  border-color: rgba(232, 160, 191, 0.5);
  background: rgba(232, 160, 191, 0.16);
  color: var(--cream);
}

.drives-filter-chip-soft {
  border-color: rgba(116, 180, 232, 0.22);
  background: rgba(116, 180, 232, 0.08);
}

.drives-filter-chip-soft:hover,
.drives-filter-chip-soft.active {
  border-color: rgba(116, 180, 232, 0.5);
  background: rgba(116, 180, 232, 0.16);
}

.drives-route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.drive-card {
  padding: 20px;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  animation: fadeInUp 0.45s ease both;
  animation-delay: var(--card-delay, 0ms);
}

.drive-card.expanded {
  border-color: rgba(245, 240, 232, 0.18);
}

.drive-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.drive-card-top h3 {
  margin: 8px 0 10px;
  font-size: 22px;
  line-height: 1.15;
}

.drive-card-summary {
  color: var(--text-dim);
  line-height: 1.65;
}

.drive-theme-pill,
.drive-meta-chip,
.drive-tag,
.drive-validation-pill,
.drive-waypoint-type {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
}

.drive-theme-pill {
  padding: 6px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
}

.drive-theme-mountain { background: rgba(126, 198, 153, 0.12); color: var(--success); border-color: rgba(126, 198, 153, 0.3); }
.drive-theme-countryside { background: rgba(196, 162, 101, 0.12); color: var(--gold); border-color: rgba(196, 162, 101, 0.3); }
.drive-theme-lakeside { background: rgba(116, 180, 232, 0.12); color: var(--info); border-color: rgba(116, 180, 232, 0.3); }
.drive-theme-oceanside { background: rgba(91, 192, 190, 0.12); color: #5bc0be; border-color: rgba(91, 192, 190, 0.3); }

.drive-meta-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
}

.drive-meta-chip,
.drive-tag,
.drive-validation-pill,
.drive-waypoint-type {
  padding: 7px 11px;
  font-size: 12px;
  color: var(--cream-soft);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.drive-preview-shell {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
}

.drive-preview-art {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 25 / 14;
  min-height: 0;
  background: rgba(255, 255, 255, 0.03);
}

.drive-preview-art-map {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.drive-preview-map {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.drive-preview-map .leaflet-container,
.drive-preview-map.leaflet-container {
  width: 100%;
  height: 100%;
  background: #dbe6ef;
}

.drive-preview-map .leaflet-control-container,
.drive-preview-map .leaflet-bottom,
.drive-preview-map .leaflet-top {
  display: none;
}

.drive-preview-copy {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
}

.drive-preview-label,
.drive-detail-eyebrow {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drive-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.drive-tag {
  color: var(--text);
}

.drive-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.drive-expand-btn,
.drive-copy-btn {
  flex: 1;
}

.drive-expanded-shell {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drive-expanded-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.drive-detail-card {
  padding: 16px;
  border-radius: var(--radius);
}

.drive-detail-card p + p {
  margin-top: 10px;
}

.drive-highlight-list {
  margin-top: 10px;
  display: grid;
  gap: 12px;
  list-style: none;
}

.drive-highlight-list li {
  display: grid;
  gap: 4px;
}

.drive-highlight-list strong {
  color: var(--cream);
}

.drive-highlight-list span {
  color: var(--text-dim);
  line-height: 1.55;
}

.drive-leaflet-frame {
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(10, 14, 28, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.drive-leaflet-map {
  width: 100%;
  height: 240px;
  border-radius: 14px;
  overflow: hidden;
}

.drive-waypoints-shell {
  padding: 18px;
  border-radius: var(--radius);
}

.drive-waypoints-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.drive-waypoints-header h4 {
  margin-top: 4px;
  font-size: 20px;
}

.drive-validation-pill.approved {
  color: var(--success);
  border-color: rgba(126, 198, 153, 0.35);
  background: rgba(126, 198, 153, 0.12);
}

.drive-waypoint-list {
  display: grid;
  gap: 12px;
  list-style: none;
}

.drive-waypoint-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.drive-waypoint-order {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 12px;
  background: rgba(232, 160, 191, 0.12);
  color: var(--pink);
  font-weight: 700;
}

.drive-waypoint-copy {
  min-width: 0;
}

.drive-waypoint-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.drive-waypoint-copy p {
  margin-top: 6px;
  color: var(--text-dim);
  line-height: 1.55;
}

.drive-waypoint-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.drive-waypoint-links a {
  color: var(--info);
  text-decoration: none;
}

.drives-empty-state {
  grid-column: 1 / -1;
  padding: 30px;
  border-radius: calc(var(--radius) + 4px);
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.1);
  text-align: center;
}

.drives-empty-state h3 {
  margin: 10px 0 8px;
}

.drives-empty-state p {
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0 auto;
  line-height: 1.65;
}

.drives-empty-icon {
  font-size: 28px;
}

@media (max-width: 980px) {
  .drives-hero-shell,
  .drives-summary-meta,
  .drives-route-grid,
  .drive-expanded-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .section-header-stack-mobile,
  .drive-card-top,
  .drive-waypoints-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .drives-sort-shell,
  .drive-meta-stack {
    width: 100%;
  }

  .drive-actions-row {
    flex-direction: column;
  }

  .drive-waypoint-item {
    grid-template-columns: 1fr;
  }
}
