/* ============================================================
   trips.1415llc.com — coastal magazine
   Stage 1: type + palette + texture + reframed hero
   ============================================================ */

:root {
  /* Paper / ink foundation */
  --paper:        #F1E8D6;
  --paper-soft:   #EADEC4;
  --paper-deep:   #E2D2B0;
  --paper-card:   #FBF6E9;
  --ink:          #1A2A2E;
  --ink-soft:     #3F5258;
  --ink-mute:     #7E7460;
  --rule:         #C9BFA8;
  --rule-soft:    #DDD3BC;

  /* Coastal accents */
  --tide:         #2C5760;
  --tide-deep:    #1F4048;
  --tide-soft:    rgba(44, 87, 96, 0.10);
  --coral:        #D96846;
  --coral-soft:   rgba(217, 104, 70, 0.12);
  --sun:          #E8B547;
  --seafoam:      #8FAE9F;

  /* Per-trip theme — set by JS from trip.json. Defaults to tide. */
  --theme:        var(--tide);
  --theme-soft:   var(--tide-soft);
  --theme-dark:   var(--tide-deep);

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body:    'Hanken Grotesk', -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Geometry */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --gap: 20px;

  /* Subtle paper shadow (rarely used — hairlines do the work) */
  --shadow:       0 1px 0 rgba(26, 42, 46, 0.04);
  --shadow-hover: 0 6px 22px rgba(26, 42, 46, 0.08);
}

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  background-color: var(--paper);
  /* Layered: a low-frequency coastal warmth wash + a fine paper-grain noise */
  background-image:
    radial-gradient(ellipse 90% 60% at 75% 0%, rgba(232, 181, 71, 0.16), transparent 60%),
    radial-gradient(ellipse 70% 50% at 5% 100%, rgba(44, 87, 96, 0.10), transparent 65%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10 0 0 0 0 0.16 0 0 0 0 0.18 0 0 0 0.55 0'/></filter><rect width='240' height='240' filter='url(%23n)' opacity='0.35'/></svg>");
  background-attachment: fixed, fixed, fixed;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--theme-dark); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
a:hover { color: var(--coral); }

img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--ink-mute); }
.error { color: var(--coral); }
.loading, .empty { padding: 72px 20px; text-align: center; color: var(--ink-mute); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }

::selection { background: var(--coral); color: var(--paper); }

/* Headings — Fraunces with optical sizing */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 96, 'SOFT' 80, 'wght' 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
}

/* ============================================================
   Grandparent mode — gentle scaling, recalibrated for serif
   ============================================================ */
body.gp-mode { font-size: 18px; line-height: 1.7; }
body.gp-mode h1 { font-size: clamp(48px, 8vw, 80px); }
body.gp-mode h2 { font-size: 1.8rem; }
body.gp-mode h3 { font-size: 1.35rem; }
body.gp-mode .pill,
body.gp-mode .badge { font-size: 14px; }

/* ============================================================
   Index page (trips list) — magazine cover feel
   ============================================================ */
.index-body { background: transparent; }

.index-header {
  background: transparent;
  color: var(--ink);
  padding: 88px 24px 56px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.index-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 70% at 85% 30%, rgba(44, 87, 96, 0.14), transparent 60%),
    radial-gradient(40% 60% at 10% 90%, rgba(217, 104, 70, 0.10), transparent 65%);
  pointer-events: none;
}
.index-header-inner { max-width: 1100px; margin: 0 auto; position: relative; z-index: 1; }
.index-header h1 {
  margin: 0 0 18px;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'wght' 400;
  font-size: clamp(48px, 9vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  text-shadow: none;
  color: var(--ink);
  font-weight: 400;
}
.index-header h1::after {
  content: ' ✦';
  color: var(--coral);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}
.index-header .tagline {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 44ch;
  font-weight: 400;
}

.index-main { max-width: 1100px; margin: 0 auto; padding: 48px 24px 80px; }

.trip-section { margin-bottom: 56px; }
.section-title {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  font-weight: 500;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.trip-card {
  display: block;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s;
  color: var(--ink);
  text-decoration: none;
  position: relative;
}
.trip-card { border-bottom: none; }
.trip-card { border-bottom: 1px solid var(--rule); }
.trip-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}

.trip-card-hero {
  background:
    radial-gradient(60% 80% at 70% 30%, color-mix(in srgb, var(--theme) 30%, transparent), transparent 65%),
    linear-gradient(180deg, color-mix(in srgb, var(--theme) 15%, var(--paper-soft)) 0%, var(--paper-card) 100%);
  color: var(--ink);
  padding: 44px 22px 32px;
  font-size: 92px;
  line-height: 1;
  text-align: left;
  position: relative;
  border-bottom: 1px solid var(--rule);
  min-height: 140px;
}
.trip-card-emoji {
  display: inline-block;
  transform: rotate(-6deg) translateY(4px);
  filter: drop-shadow(0 4px 8px rgba(26, 42, 46, 0.12));
}
.trip-card-countdown {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.trip-card-body { padding: 18px 22px 22px; }
.trip-card-body h3 {
  margin: 0 0 6px;
  font-size: 26px;
  font-variation-settings: 'opsz' 60, 'SOFT' 80, 'wght' 500;
  line-height: 1.05;
}
.trip-card-tagline {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
  max-width: 32ch;
}
.trip-card-meta {
  margin: 0;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
}
.trip-card-meta span:not(:first-child)::before { content: ' · '; padding: 0 6px; color: var(--rule); }

.index-footer {
  text-align: left;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border-top: 1px solid var(--rule);
}

/* ============================================================
   Trip page
   ============================================================ */
.back-link {
  display: inline-block;
  padding: 18px 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border-bottom: none;
}
.back-link:hover { color: var(--coral); text-decoration: none; }

.trip-hero {
  background:
    radial-gradient(60% 80% at 78% 28%, color-mix(in srgb, var(--theme) 35%, transparent), transparent 60%),
    radial-gradient(45% 60% at 12% 90%, var(--coral-soft), transparent 65%);
  color: var(--ink);
  padding: 56px 24px 64px;
  text-align: left;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.trip-hero::before {
  /* Thin top rule like a magazine masthead */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--rule);
}

.trip-hero-emoji {
  position: absolute;
  right: -8px;
  top: 12px;
  font-size: clamp(140px, 26vw, 240px);
  line-height: 1;
  opacity: 0.85;
  transform: rotate(-8deg);
  filter: drop-shadow(0 12px 24px rgba(26, 42, 46, 0.12));
  pointer-events: none;
  z-index: 0;
}

.trip-hero h1 {
  margin: 0 0 12px;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'wght' 400;
  font-size: clamp(48px, 10vw, 112px);
  line-height: 0.9;
  letter-spacing: -0.025em;
  position: relative;
  z-index: 1;
  max-width: 14ch;
}

.trip-hero .tagline {
  margin: 0 0 24px;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--ink-soft);
  font-style: italic;
  position: relative;
  z-index: 1;
  max-width: 38ch;
  line-height: 1.45;
}

.trip-hero .dates {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
  position: relative;
  z-index: 1;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: inline-block;
  padding-right: 24px;
}
.trip-hero .location {
  display: block;
  font-size: 11px;
  opacity: 0.7;
  margin-top: 6px;
  letter-spacing: 0.10em;
  color: var(--ink-soft);
}

.gp-toggle {
  position: absolute;
  top: 20px;
  right: 24px;
  background: var(--paper-card);
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 7px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 500;
  z-index: 2;
}
.gp-toggle:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.countdown-band {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.trip-main { max-width: 980px; margin: 0 auto; padding: 32px 24px 80px; }

.card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 28px 28px 26px;
  margin-bottom: 20px;
  position: relative;
}
.card h2 {
  margin: 0 0 20px;
  font-size: 30px;
  font-variation-settings: 'opsz' 60, 'SOFT' 80, 'wght' 500;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.card h2 .card-icon { font-size: 22px; }
.card h3 {
  font-size: 18px;
  font-variation-settings: 'opsz' 36, 'SOFT' 80, 'wght' 500;
  margin: 22px 0 10px;
  color: var(--ink);
}
.card p { margin: 0 0 10px; color: var(--ink-soft); }
.card p:last-child { margin-bottom: 0; }
.card p strong, .card p b { color: var(--ink); font-weight: 600; }

/* People */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
}
.person {
  text-align: center;
  padding: 14px 8px;
  background: transparent;
  border: 1px solid var(--rule-soft);
}
.person-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--theme);
  color: #fff;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 36, 'SOFT' 50, 'wght' 600;
  font-size: 19px;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.person-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.person-role {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* Itinerary */
.day {
  border-left: 2px solid var(--theme);
  padding: 6px 0 6px 20px;
  margin-bottom: 24px;
}
.day-label {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 36, 'SOFT' 80, 'wght' 500;
  font-size: 22px;
  margin: 0 0 4px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.day-date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 14px;
}
.event {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.event:last-child { border-bottom: none; }
.event-time {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  padding-top: 3px;
}
.event-title { font-weight: 600; margin: 0 0 4px; color: var(--ink); font-size: 16px; }
.event-notes { color: var(--ink-soft); font-size: 14px; margin: 0; line-height: 1.55; }

/* Logistics */
.logistics-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 18px;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--rule-soft);
}
.logistics-row:last-child { border-bottom: none; }
.logistics-row dt {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 2px;
}
.logistics-row dd { margin: 0; color: var(--ink); }
.logistics-row dd a { color: var(--theme-dark); }

.family-info {
  background: var(--paper-soft);
  border: 1px dashed var(--rule);
  border-radius: 0;
  padding: 18px 20px;
  margin-top: 18px;
}
.family-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink);
}
.family-info-header .lock-icon { font-size: 14px; }
.family-info-body { padding-top: 14px; }
.family-info-body.hidden { display: none; }
.family-info-pin {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.family-info-pin input {
  font-family: var(--font-mono);
  font-size: 18px;
  padding: 8px 12px;
  width: 110px;
  letter-spacing: 8px;
  text-align: center;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper-card);
  color: var(--ink);
}
.family-info-pin button {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 8px 18px;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.family-info-pin button:hover { background: var(--coral); }
.family-info-hint {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  margin: 6px 0 0;
  line-height: 1.5;
  font-style: italic;
}

/* Phone book */
.phone-list { list-style: none; padding: 0; margin: 0; }
.phone-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.phone-list li:last-child { border-bottom: none; }
.phone-name { font-weight: 600; color: var(--ink); }
.phone-role {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  display: block;
  margin-top: 2px;
}
.phone-number {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--theme-dark);
  white-space: nowrap;
  letter-spacing: 0.02em;
  border-bottom: none;
}
.phone-number:hover { color: var(--coral); text-decoration: none; }

/* Packing list */
.packing-section { margin-bottom: 22px; }
.packing-section h3 { margin: 0 0 10px; }
.packing-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--rule-soft);
}
.packing-item:last-child { border-bottom: none; }
.packing-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--theme);
}
.packing-item.packed .packing-label {
  text-decoration: line-through;
  color: var(--ink-mute);
}
.packing-label { font-size: 15px; color: var(--ink); }

/* Weather */
.weather-line {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.weather-temp {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 96, 'SOFT' 80, 'wght' 500;
  font-size: 48px;
  color: var(--theme-dark);
  line-height: 1;
}
.weather-desc { font-size: 15px; color: var(--ink-soft); }
.weather-source {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 12px;
}

.trip-footer {
  text-align: center;
  padding: 40px 20px 60px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-top: 1px solid var(--rule);
  margin-top: 32px;
}
.trip-footer p { margin: 6px 0; }

/* ============================================================
   Sticky tab nav — paper-band, refined typography
   ============================================================ */
.trip-tabs {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
}
.trip-tabs-inner {
  display: flex;
  gap: 0;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent 100%);
}
.trip-tabs-inner::-webkit-scrollbar { display: none; }

.tab-button {
  background: transparent;
  border: none;
  padding: 16px 16px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border-top: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}
.tab-button:hover { color: var(--ink); }
.tab-button.active {
  color: var(--ink);
  border-bottom-color: var(--theme);
}
.tab-button:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: -2px;
}

.tab-section { display: none; padding-top: 8px; }
.tab-section.active { display: block; animation: tabIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes tabIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* What's next widget (Overview tab) */
.whats-next .whats-next-main {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 60, 'SOFT' 80, 'wght' 500;
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.2;
}
.whats-next .whats-next-detail {
  margin: 8px 0 6px;
  font-size: 15px;
  color: var(--ink-soft);
}
.whats-next .whats-next-notes {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-style: italic;
}
.whats-next .whats-next-cta {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.whats-next-event {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--rule-soft);
  font-size: 14px;
}
.whats-next-event:first-of-type { border-top: none; padding-top: 12px; }
.whats-next-time {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  padding-top: 3px;
}

/* Highlights teasers (Overview tab) */
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.teaser {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: transparent;
  padding: 16px 18px;
  border-radius: 0;
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.18s, transform 0.18s;
}
.teaser:hover {
  background: var(--paper-soft);
  transform: translateY(-1px);
  text-decoration: none;
}
.teaser-icon { font-size: 24px; line-height: 1; }
.teaser-kind {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.teaser-name {
  margin: 4px 0 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.teaser-meta { margin: 3px 0 0; color: var(--ink-mute); font-size: 12px; }

body.gp-mode .tab-button { padding: 18px 20px 16px; font-size: 13px; }
body.gp-mode .whats-next .whats-next-main { font-size: 26px; }
body.gp-mode .teaser-name { font-size: 17px; }

/* ============================================================
   Recommendations, rainy day, map, grocery
   ============================================================ */

.rec-section { margin-bottom: 26px; }
.rec-section:last-child { margin-bottom: 0; }
.rec-section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.rec-card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 16px 18px;
  transition: transform 0.18s, border-color 0.18s;
}
.rec-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-mute);
}
.rec-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.rec-icon { font-size: 22px; line-height: 1; padding-top: 2px; }
.rec-card-title-block { flex: 1; min-width: 0; }
.rec-card-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 36, 'SOFT' 80, 'wght' 500;
  font-size: 18px;
  word-break: break-word;
  line-height: 1.2;
  color: var(--ink);
}
.rec-category {
  margin: 4px 0 0;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.rec-tier {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.rec-tier.must-try { background: var(--sun); color: #5C3E00; border: 1px solid color-mix(in srgb, var(--sun) 70%, var(--ink)); }
.rec-tier.solid    { background: var(--seafoam); color: var(--ink); border: 1px solid color-mix(in srgb, var(--seafoam) 70%, var(--ink)); }
.rec-tier.backup   { background: var(--paper-deep); color: var(--ink-mute); border: 1px solid var(--rule); }
.rec-meta {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.rec-notes {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.rec-links {
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.rec-links a {
  white-space: nowrap;
  text-transform: uppercase;
}

/* Rainy day */
.rainy-list { list-style: none; padding: 0; margin: 0; }
.rainy-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.rainy-item:last-child { border-bottom: none; }
.rainy-item strong { color: var(--ink); font-weight: 600; }

/* Map */
.trip-map {
  height: 480px;
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  z-index: 1;
  filter: saturate(0.85) contrast(1.02);
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.legend-rental   { background: var(--tide); }
.legend-food     { background: var(--coral); }
.legend-coffee   { background: #7a5a48; }
.legend-activity { background: var(--seafoam); }

/* Leaflet custom pin */
.map-pin-wrap { background: transparent; border: none; }
.map-pin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(26, 42, 46, 0.30);
  border: 2px solid var(--paper);
  font-size: 14px;
  line-height: 1;
}
.map-pin span { transform: translateY(-1px); }

/* Grocery */
.grocery-section { margin-bottom: 18px; }
.grocery-section:last-child { margin-bottom: 0; }
.grocery-section h4 {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-mute);
  font-weight: 500;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-soft);
}
.grocery-list { list-style: none; padding: 0; margin: 0; }
.grocery-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.grocery-item:last-child { border-bottom: none; }
.grocery-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule);
  flex-shrink: 0;
}
.grocery-status-dot[data-status="purchased"] { background: var(--seafoam); }
.grocery-status-dot[data-status="skipped"]   { background: var(--ink-mute); }
.grocery-name { flex: 1; color: var(--ink); }
.grocery-qty {
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.grocery-item.purchased .grocery-name { text-decoration: line-through; color: var(--ink-mute); }
.grocery-item.skipped .grocery-name   { color: var(--ink-mute); font-style: italic; }

/* Grandparent mode tunings */
body.gp-mode .rec-card { padding: 20px 22px; }
body.gp-mode .rec-card-head h4 { font-size: 22px; }
body.gp-mode .rec-meta,
body.gp-mode .rec-notes,
body.gp-mode .rec-category { font-size: 15px; }
body.gp-mode .grocery-item { padding: 12px 0; font-size: 17px; }
body.gp-mode .trip-map { height: 540px; }

/* ============================================================
   Stories — book-page typography
   ============================================================ */
.story-form { display: flex; flex-direction: column; gap: 16px; }
.story-form select,
.story-form input[type="text"],
.story-form input[type="password"] {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 13px;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--ink);
}
.story-form select:focus,
.story-form input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--theme-soft);
}

.story-vibe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.story-vibe {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 12px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, background 0.15s;
  color: var(--ink);
}
.story-vibe:hover { border-color: var(--ink-mute); }
.story-vibe.selected {
  border-color: var(--ink);
  border-width: 2px;
  padding: 11px 13px;
  background: var(--paper-soft);
}
.story-vibe strong {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 24, 'SOFT' 80, 'wght' 500;
  font-size: 16px;
  color: var(--ink);
}
.story-vibe .muted { font-size: 12px; font-style: italic; }

/* Library */
.story-entry {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 0;
  margin-bottom: 12px;
  overflow: hidden;
}
.story-entry:last-child { margin-bottom: 0; }
.story-entry[open] { border-color: var(--ink-mute); }
.story-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.story-summary::-webkit-details-marker { display: none; }
.story-summary::before {
  content: "▸";
  color: var(--ink-mute);
  display: inline-block;
  transition: transform 0.2s;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.story-entry[open] .story-summary::before { transform: rotate(90deg); }
.story-summary-main {
  flex: 1;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 24, 'SOFT' 80, 'wght' 500;
  font-size: 17px;
}
.story-summary-main strong { color: var(--ink); }
.story-summary-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.story-delete {
  background: transparent;
  border: none;
  color: var(--ink-mute);
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.story-delete:hover { background: rgba(26, 42, 46, 0.06); color: var(--coral); }

.story-body {
  padding: 6px 22px 22px;
  border-top: 1px solid var(--rule-soft);
}
.story-content {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 18, 'SOFT' 100, 'wght' 400;
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink);
  padding: 20px 4px 22px;
  max-width: 60ch;
  letter-spacing: 0.005em;
}
.story-content p { margin: 0 0 1em; text-indent: 1.6em; }
.story-content p:first-of-type { text-indent: 0; }
.story-content p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'wght' 500;
  font-size: 3.4em;
  float: left;
  line-height: 0.85;
  padding-right: 0.08em;
  padding-top: 0.05em;
  color: var(--coral);
}
.story-content strong { color: var(--ink); font-weight: 600; }
.story-content em { color: var(--ink); font-style: italic; }
.story-actions {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
  margin-top: 8px;
}
.story-print, .story-copy {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.story-print:hover, .story-copy:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

body.gp-mode .story-content { font-size: 21px; line-height: 1.85; }
body.gp-mode .story-vibe strong { font-size: 18px; }

@media (max-width: 540px) {
  .story-vibe-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Wall (highlights + photos) — magazine spread
   ============================================================ */
.wall-form { display: flex; flex-direction: column; gap: 14px; }
.wall-form-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.wall-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}
.wall-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  font-weight: 500;
}
.wall-form select,
.wall-form input[type="file"],
.wall-form input[type="password"],
.wall-text {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 12px;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--ink);
}
.wall-text {
  resize: vertical;
  min-height: 64px;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.5;
}
.wall-form select:focus,
.wall-form input:focus,
.wall-text:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--theme-soft);
}
.wall-photo-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.wall-field-photo input[type="file"] { padding: 7px 9px; font-size: 13px; }
.wall-photo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--paper-soft);
  border: 1px dashed var(--rule);
  border-radius: 0;
}
.wall-photo-preview img {
  max-height: 80px;
  max-width: 120px;
  border-radius: 0;
  object-fit: cover;
}
.wall-photo-clear {
  background: transparent;
  border: none;
  color: var(--ink-mute);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: underline;
}

.wall-submit-row {
  align-items: flex-end;
  gap: 14px;
}
.wall-pin-field { max-width: 160px; }
.wall-pin-field input {
  letter-spacing: 6px;
  text-align: center;
  font-family: var(--font-mono);
}
.wall-unlocked {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--seafoam);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex: 1;
}
.wall-submit {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 12px 22px;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.18s;
}
.wall-submit:hover:not(:disabled) { background: var(--coral); }
.wall-submit:disabled { background: var(--rule); color: var(--paper-card); cursor: not-allowed; }
.wall-form-error {
  background: var(--coral-soft);
  color: var(--coral);
  border: 1px solid var(--coral);
  padding: 10px 14px;
  border-radius: 0;
  font-size: 13px;
  margin: 0;
}

/* Feed */
.wall-day { margin-bottom: 32px; }
.wall-day:last-child { margin-bottom: 0; }
.wall-day-header {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.wall-entry {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 16px 18px;
  margin-bottom: 14px;
  position: relative;
}
.wall-entry:last-child { margin-bottom: 0; }
.wall-entry-agent {
  background: var(--paper-soft);
  border-color: var(--ink-mute);
  border-left: 3px solid var(--theme);
  padding-left: 16px;
}
.wall-entry-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.wall-author-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 24, 'SOFT' 50, 'wght' 600;
  font-size: 15px;
  flex-shrink: 0;
}
.wall-entry-meta { flex: 1; font-size: 14px; color: var(--ink); }
.wall-entry-meta strong { color: var(--ink); font-weight: 600; }
.wall-entry-meta .muted {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.wall-agent-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
}
.wall-delete {
  background: transparent;
  border: none;
  color: var(--ink-mute);
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.wall-delete:hover { background: rgba(26, 42, 46, 0.06); color: var(--coral); }

.wall-entry-text {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  word-wrap: break-word;
}
.wall-entry-text:last-child { margin-bottom: 0; }
.wall-entry-text strong { color: var(--ink); font-weight: 600; }
.wall-entry-text a { color: var(--theme-dark); }

.wall-entry-photo { margin-top: 8px; margin-left: -18px; margin-right: -18px; margin-bottom: -16px; }
.wall-entry-photo img {
  width: 100%;
  max-width: none;
  max-height: 480px;
  cursor: zoom-in;
  display: block;
  background: var(--ink);
  border-top: 1px solid var(--rule);
  object-fit: cover;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 30, 0.94);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: chatFade 0.2s ease-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 20px 60px rgba(0, 0, 0, 0.5));
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(255,255,255,0.25);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  font-family: var(--font-mono);
}
.lightbox-close:hover { background: rgba(255,255,255,0.10); border-color: var(--paper); }

body.gp-mode .wall-entry-text { font-size: 17px; }
body.gp-mode .wall-author-chip { width: 40px; height: 40px; font-size: 17px; }
body.gp-mode .wall-submit { padding: 14px 26px; font-size: 13px; }

@media (max-width: 540px) {
  .wall-form-row { flex-direction: column; align-items: stretch; }
  .wall-field { min-width: 0; }
  .wall-pin-field { max-width: none; }
  .wall-submit { margin-left: 0; align-self: stretch; }
  .wall-entry-photo { margin-left: -16px; margin-right: -16px; }
}

/* ============================================================
   Chat drawer — same behavior, paper palette
   ============================================================ */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: var(--agent-color, var(--ink));
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 14px 20px 14px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(26, 42, 46, 0.22);
  transition: transform 0.18s, box-shadow 0.18s;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(26, 42, 46, 0.28); }
.chat-fab-icon { font-size: 16px; line-height: 1; }
.chat-fab-label { letter-spacing: 0.16em; }

body.chat-open .chat-fab { display: none; }

.chat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 30, 0.42);
  z-index: 300;
  animation: chatFade 0.2s ease-out;
}
@keyframes chatFade { from { opacity: 0; } to { opacity: 1; } }

.chat-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 440px;
  max-width: 100vw;
  background: var(--paper-card);
  z-index: 400;
  box-shadow: -12px 0 36px rgba(26, 42, 46, 0.22);
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  visibility: hidden;
  border-left: 1px solid var(--rule);
}
.chat-drawer[aria-hidden="false"] {
  transform: translateX(0);
  visibility: visible;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-soft);
  flex-shrink: 0;
}
.chat-agent-picker { position: relative; }
.chat-agent-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
}
.chat-agent-btn:hover { background: var(--paper); border-color: var(--ink-mute); }
.chat-agent-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--theme);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.chat-agent-info { display: flex; flex-direction: column; line-height: 1.15; }
.chat-agent-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.chat-agent-info strong {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 24, 'SOFT' 80, 'wght' 500;
  font-size: 16px;
  margin-top: 1px;
}
.chat-agent-chev { color: var(--ink-mute); margin-left: 4px; font-size: 12px; font-family: var(--font-mono); }

.chat-agent-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: 0 12px 32px rgba(26, 42, 46, 0.18);
  min-width: 280px;
  z-index: 10;
  overflow: hidden;
  padding: 4px;
}
.chat-agent-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  border-radius: 0;
}
.chat-agent-menu button:hover { background: var(--paper-soft); }
.chat-agent-mavatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--theme-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.chat-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--ink-mute);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-family: var(--font-mono);
}
.chat-close:hover { background: var(--paper); color: var(--coral); }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-intro {
  text-align: center;
  color: var(--ink-soft);
  padding: 40px 16px;
  font-size: 15px;
  font-style: italic;
}
.chat-intro p { margin: 8px 0; }
.chat-intro p:last-child {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--ink-mute);
}

.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.chat-msg.user { justify-content: flex-end; }
.chat-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}
.chat-bubble {
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 86%;
  word-wrap: break-word;
}
.chat-bubble.user {
  background: var(--ink);
  color: var(--paper);
  border-bottom-right-radius: 4px;
}
.chat-bubble.agent {
  background: var(--paper-soft);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-bottom-left-radius: 4px;
}
.chat-bubble.agent strong { color: var(--ink); font-weight: 600; }
.chat-bubble.agent a { color: var(--theme-dark); }
.chat-bubble.agent code {
  background: rgba(26, 42, 46, 0.06);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.chat-bubble.agent pre {
  background: rgba(26, 42, 46, 0.06);
  padding: 10px 12px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
}
.chat-msg-from {
  margin: 0 0 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-mute);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.chat-msg-text { font-size: 14.5px; }

.chat-trip-updated {
  background: var(--paper-soft);
  border: 1px solid var(--theme);
  border-left: 3px solid var(--theme);
  border-radius: 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink);
  animation: chatFade 0.2s ease-out;
}
#chat-trip-refresh {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 7px 14px;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
#chat-trip-refresh:hover { background: var(--coral); }

.chat-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-mute);
  animation: chatDot 1s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.30s; }
@keyframes chatDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-3px); }
}

.chat-form {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--rule);
  background: var(--paper-card);
  align-items: flex-end;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  resize: none;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid var(--rule);
  border-radius: 0;
  line-height: 1.45;
  background: var(--paper);
  color: var(--ink);
  max-height: 140px;
  min-height: 44px;
}
.chat-input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--theme-soft);
}
.chat-send {
  background: var(--ink);
  color: var(--paper);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s;
}
.chat-send:hover { background: var(--coral); }
.chat-send:disabled { background: var(--rule); cursor: not-allowed; }

body.gp-mode .chat-fab { padding: 16px 26px 16px 22px; font-size: 13px; }
body.gp-mode .chat-msg-text { font-size: 16px; }
body.gp-mode .chat-input { font-size: 16px; }

/* Mobile: bottom sheet */
@media (max-width: 640px) {
  .chat-drawer {
    top: auto;
    width: 100vw;
    height: 88vh;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border-left: none;
    border-top: 1px solid var(--rule);
    transform: translateY(110%);
    box-shadow: 0 -12px 36px rgba(26, 42, 46, 0.22);
  }
  .chat-drawer[aria-hidden="false"] { transform: translateY(0); }
  .chat-fab { bottom: 16px; right: 16px; padding: 12px 16px 12px 14px; }
}

@media (max-width: 540px) {
  .trip-hero { padding: 44px 20px 56px; }
  .trip-hero-emoji { font-size: 160px; right: -16px; top: 22px; opacity: 0.6; }
  .card { padding: 22px 20px; }
  .card h2 { font-size: 24px; }
  .event { grid-template-columns: 80px 1fr; gap: 12px; }
  .logistics-row { grid-template-columns: 120px 1fr; }
  .rec-grid { grid-template-columns: 1fr; }
  .trip-map { height: 360px; }
  .trip-main { padding: 24px 16px 60px; }
  .index-main { padding: 32px 18px 60px; }
  .index-header { padding: 60px 18px 40px; }
}
