/**
 * TERRA // FIELD NOTES — Complete Design System & Stylesheet
 * Faithfully reproduces the visual authority of the TERRA and Field Notes reference images:
 * - Warm limestone/parchment canvas (#F2EDE2), torn paper edges, terracotta sun (#C86D44),
 *   deep forest charcoal ink (#1C2820), sage olive (#5D6B52)
 * - Kraft paper notes (#DEC8A8), blush notes (#EFC4B0), lined yellow checklist (#F4DF87),
 *   washi tape strips, polaroid frames, typewriter metadata, and editorial serif headings.
 */

@font-face {
  font-family: 'TerraSerif';
  src: url('/assets/fonts/NotoSerifDisplay-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TerraSerif';
  src: url('/assets/fonts/NotoSerifDisplay-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'TerraSerif';
  src: url('/assets/fonts/NotoSerifDisplay-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TerraSans';
  src: url('/assets/fonts/Inter-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TerraSans';
  src: url('/assets/fonts/Inter-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TerraSans';
  src: url('/assets/fonts/Inter-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TerraMono';
  src: url('/assets/fonts/NotoSansMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TerraScript';
  src: url('/assets/fonts/Z003-MediumItalic.otf') format('opentype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg-canvas: #F2EDE2;
  --bg-paper: #FAF7F0;
  --bg-paper-elevated: #FFFDF9;
  --bg-kraft: #DBC3A0;
  --bg-blush: #EFC6B2;
  --bg-yellow-note: #F3DF89;
  --bg-sage-soft: #E3E6DC;
  --ink-primary: #1C2820;
  --ink-secondary: #434E46;
  --ink-muted: #6A726A;
  --accent-terracotta: #C86D44;
  --accent-terracotta-dark: #A9542E;
  --accent-forest: #1C2820;
  --accent-sage: #5D6B52;
  --border-hairline: #D6CEBE;
  --border-ink: #253129;
  --washi-tape: rgba(235, 224, 198, 0.82);
  --shadow-paper: 0 8px 26px rgba(28, 40, 32, 0.07), 0 2px 6px rgba(28, 40, 32, 0.04);
  --shadow-polaroid: 0 12px 28px rgba(28, 40, 32, 0.12);
  --font-serif: 'TerraSerif', 'Playfair Display', Georgia, serif;
  --font-sans: 'TerraSans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'TerraMono', 'Courier Prime', ui-monospace, monospace;
  --font-script: 'TerraScript', 'Caveat', cursive, serif;
  --radius-pill: 999px;
  --radius-card: 6px;
  --radius-composer: 8px;
}

[data-theme="dark"] {
  --bg-canvas: #141C17;
  --bg-paper: #1C2620;
  --bg-paper-elevated: #232F28;
  --bg-kraft: #2D2820;
  --bg-blush: #33241F;
  --bg-yellow-note: #2E2B1C;
  --bg-sage-soft: #212B24;
  --ink-primary: #F2EDE2;
  --ink-secondary: #C6C1B5;
  --ink-muted: #93988E;
  --accent-terracotta: #D97B52;
  --accent-terracotta-dark: #E88E67;
  --accent-forest: #E8E2D4;
  --accent-sage: #8A9A7E;
  --border-hairline: #2F3C33;
  --border-ink: #4A5A4E;
  --washi-tape: rgba(65, 76, 66, 0.78);
  --shadow-paper: 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-polaroid: 0 14px 32px rgba(0, 0, 0, 0.45);
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle tactile paper texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: radial-gradient(#1C2820 0.75px, transparent 0.75px);
  background-size: 12px 12px;
}

a {
  color: var(--accent-terracotta-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--ink-primary);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent-terracotta);
  outline-offset: 2px;
}

/* ============================================================================
   TOP EDITORIAL HEADER & NAVIGATION (Matching TERRA + Field Notes Header)
   ============================================================================ */
.terra-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 237, 226, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--border-hairline);
}
[data-theme="dark"] .terra-header {
  background: rgba(20, 28, 23, 0.94);
}

.terra-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.terra-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink-primary);
  border: none;
  background: none;
  padding: 0;
}

.terra-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.terra-logo-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.terra-logo-journal {
  font-family: var(--font-script);
  font-size: 21px;
  color: var(--accent-terracotta);
  letter-spacing: 0.02em;
  font-weight: 500;
}

.terra-logo-sub {
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 2px;
}

.terra-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.terra-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-serif);
  font-size: 13.5px;
  white-space: nowrap;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.terra-nav-btn:hover {
  color: var(--ink-primary);
  background: rgba(28, 40, 32, 0.05);
}

.terra-nav-btn.is-active {
  color: var(--ink-primary);
  font-weight: 700;
  border-color: var(--border-ink);
  background: var(--bg-paper);
}

.terra-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-forest-pill {
  background: #1C2820;
  color: #F2EDE2;
  border: 1px solid #1C2820;
  border-radius: var(--radius-pill);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, background 0.15s ease;
}
[data-theme="dark"] .btn-forest-pill {
  background: var(--accent-terracotta);
  color: #141C17;
  border-color: var(--accent-terracotta);
  font-weight: 600;
}
.btn-forest-pill:hover {
  transform: translateY(-1px);
  background: #28382D;
}

.btn-ink-stamp {
  background: #1C2820;
  color: #F2EDE2;
  border: 1.5px solid #1C2820;
  border-radius: 3px;
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 2px 2px 0 var(--accent-terracotta);
  transition: transform 0.14s ease;
}
.btn-ink-stamp:hover {
  transform: translate(-1px, -1px);
}

.btn-outline-paper {
  background: var(--bg-paper);
  color: var(--ink-primary);
  border: 1px solid var(--border-ink);
  border-radius: var(--radius-pill);
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}
.btn-outline-paper:hover {
  background: var(--bg-sage-soft);
}

.btn-circle-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-ink);
  background: transparent;
  color: var(--ink-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
}
.btn-circle-arrow:hover {
  background: var(--ink-primary);
  color: var(--bg-canvas);
}

/* ============================================================================
   MAIN SCREEN — HERO COLLAGE & DEFINING AI COMPOSER (Section 3)
   ============================================================================ */
.terra-main-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 28px 64px;
}

.terra-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 36px;
  align-items: start;
  padding: 18px 0 36px;
  border-bottom: 1.5px solid var(--border-hairline);
}

.terra-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}

.terra-hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(40px, 5vw, 66px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink-primary);
}

.terra-hero-sub {
  font-size: 15.5px;
  color: var(--ink-secondary);
  max-width: 540px;
  margin: 0 0 22px;
}

/* The Prominent Rectangular AI Conversation & Trip Composer */
.terra-composer-card {
  position: relative;
  background: var(--bg-paper-elevated);
  border: 1.5px solid var(--border-ink);
  border-radius: var(--radius-composer);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-paper);
  margin-top: 8px;
}

/* Washi Tape Strip at Top of Composer (Field Notes Reference) */
.terra-composer-card::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 36px;
  width: 118px;
  height: 22px;
  background: var(--washi-tape);
  border: 1px solid rgba(28, 40, 32, 0.1);
  transform: rotate(-1.5deg);
  pointer-events: none;
}

.composer-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.terra-composer-textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid var(--border-hairline);
  border-radius: 5px;
  background: var(--bg-paper);
  padding: 13px 15px;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink-primary);
  transition: border-color 0.15s ease;
}

.terra-composer-textarea:focus {
  border-color: var(--accent-terracotta);
  background: var(--bg-paper-elevated);
}

.composer-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-hairline);
}

.composer-pills-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.composer-mini-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.composer-mini-field select,
.composer-mini-field input {
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--ink-primary);
  padding: 1px 2px;
  cursor: pointer;
}

.example-prompts-section {
  margin-top: 16px;
}

.example-prompts-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
  display: block;
}

.example-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.example-prompt-chip {
  background: var(--bg-paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 6px 13px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}
.example-prompt-chip:hover {
  border-color: var(--accent-terracotta);
  color: var(--ink-primary);
  background: var(--bg-kraft);
}

/* Right Column: TERRA Sun + Torn Paper Collage + Polaroid Field Note */
.terra-hero-collage {
  position: relative;
  min-height: 460px;
  padding: 12px;
}

.terracotta-sun-disc {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #D67A50 0%, #C4663E 58%, #A8512C 100%);
  position: absolute;
  top: 4px;
  left: 24px;
  z-index: 1;
  box-shadow: inset 0 0 30px rgba(28, 40, 32, 0.18);
}

.hero-pillars-list {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  line-height: 1.85;
  text-transform: uppercase;
  color: var(--ink-secondary);
  text-align: left;
  border-bottom: 1px solid var(--ink-secondary);
  padding-bottom: 6px;
}

.hero-polaroid-card {
  position: relative;
  z-index: 2;
  margin-top: 56px;
  margin-left: 44px;
  background: #FAF7F0;
  padding: 12px 12px 26px;
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-polaroid);
  transform: rotate(1.4deg);
  max-width: 440px;
}

.hero-polaroid-card::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 40%;
  width: 96px;
  height: 24px;
  background: var(--washi-tape);
  transform: rotate(-3deg);
}

.hero-polaroid-card img {
  width: 100%;
  height: 255px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(28, 40, 32, 0.1);
}

.hero-polaroid-caption {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: #1C2820;
}

.hero-script-callout {
  font-family: var(--font-script);
  font-size: 27px;
  color: #1C2820;
  transform: rotate(-4deg);
  display: inline-block;
}

.hero-index-counter {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.15em;
  color: var(--ink-secondary);
}

/* ============================================================================
   POPULAR DESTINATIONS GRID ("Places That Inspire" from TERRA Reference)
   ============================================================================ */
.terra-section {
  padding: 40px 0;
  border-bottom: 1.5px solid var(--border-hairline);
}

.terra-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.terra-section-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 400;
  margin: 4px 0 0;
  line-height: 1.12;
}

.terra-destinations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.terra-dest-card {
  background: var(--bg-paper);
  border: 1px solid var(--border-hairline);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.terra-dest-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-paper);
  border-color: var(--accent-terracotta);
}

.terra-dest-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--bg-kraft);
  position: relative;
}

.terra-dest-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.terra-dest-card:hover .terra-dest-img-wrap img {
  transform: scale(1.04);
}

.terra-dest-country {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.terra-dest-name {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 0 0 4px;
  color: var(--ink-primary);
}

.terra-dest-tags {
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

.terra-dest-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-hairline);
}

/* ============================================================================
   FIELD NOTES COLLAGE CARDS (Kraft Note, Lined Checklist, Blush Card)
   ============================================================================ */
.field-notes-trio {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr;
  gap: 24px;
  margin-top: 20px;
}

.kraft-note-card {
  position: relative;
  background: var(--bg-kraft);
  padding: 26px 24px;
  border: 1px solid rgba(28, 40, 32, 0.18);
  box-shadow: var(--shadow-paper);
}

.kraft-note-card::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 28%;
  width: 100px;
  height: 20px;
  background: var(--washi-tape);
}

.blush-note-card {
  position: relative;
  background: var(--bg-blush);
  padding: 24px;
  border: 1px solid rgba(28, 40, 32, 0.15);
  box-shadow: var(--shadow-paper);
}

.lined-checklist-card {
  position: relative;
  background: var(--bg-paper-elevated);
  background-image: repeating-linear-gradient(
    transparent,
    transparent 29px,
    rgba(28, 40, 32, 0.11) 29px,
    rgba(28, 40, 32, 0.11) 30px
  );
  padding: 22px 22px 22px 26px;
  border: 1px solid var(--border-ink);
  box-shadow: var(--shadow-paper);
}

.lined-checklist-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink-primary);
  display: inline-block;
  margin-bottom: 12px;
  padding-bottom: 2px;
}

/* ============================================================================
   RESEARCH WORKSPACE & SUB-NAVIGATION TABS (Section 4 & 5)
   ============================================================================ */
.research-banner {
  position: relative;
  background: var(--bg-paper);
  border: 1.5px solid var(--border-ink);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  box-shadow: var(--shadow-paper);
}

.research-banner-content {
  padding: 26px 28px;
}

.research-banner-image {
  position: relative;
  min-height: 220px;
}

.research-banner-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mode-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-sage-soft);
  border: 1px solid var(--border-ink);
  border-radius: 5px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.subtabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 22px;
  border-bottom: 1.5px solid var(--border-hairline);
}

.subtab-btn {
  background: var(--bg-paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subtab-btn:hover {
  border-color: var(--ink-primary);
}

.subtab-btn.is-active {
  background: var(--ink-primary);
  color: var(--bg-canvas);
  border-color: var(--ink-primary);
}

/* Cards & Grids inside Research */
.cards-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.field-card {
  background: var(--bg-paper);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg-sage-soft);
  color: var(--ink-primary);
  border: 1px solid var(--border-hairline);
}

.badge-verified {
  background: rgba(93, 107, 82, 0.18);
  border-color: var(--accent-sage);
  color: var(--ink-primary);
}

.badge-terracotta {
  background: rgba(200, 109, 68, 0.16);
  border-color: var(--accent-terracotta);
  color: var(--accent-terracotta-dark);
}

/* ============================================================================
   INTERACTIVE MAP EXPLORER SPLIT LAYOUT (Section 6)
   ============================================================================ */
.map-explorer-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  align-items: start;
}

.map-explorer-layout.mode-map-only {
  grid-template-columns: 1fr;
}

.map-explorer-layout.mode-list-only {
  grid-template-columns: 1fr;
}

.map-sidebar-list {
  max-height: 540px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.map-list-item {
  background: var(--bg-paper);
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-card);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-list-item.is-selected {
  border-color: var(--accent-terracotta);
  background: var(--bg-paper-elevated);
  box-shadow: 0 0 0 2px rgba(200, 109, 68, 0.2);
}

/* ============================================================================
   ITINERARY PLANNER TIMELINE CARDS (Section 7)
   ============================================================================ */
.itinerary-day-card {
  background: var(--bg-paper);
  border: 1.5px solid var(--border-ink);
  border-radius: var(--radius-card);
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-paper);
}

.itinerary-stop-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  padding: 16px;
  background: var(--bg-paper-elevated);
  border: 1px solid var(--border-hairline);
  border-left: 4px solid var(--accent-forest);
  border-radius: 5px;
  margin-bottom: 12px;
  align-items: start;
}

.itinerary-stop-row.is-locked {
  border-left-color: var(--accent-terracotta);
}

/* ============================================================================
   BUDGET LEDGER TABLE & METRIC CARDS (Section 8)
   ============================================================================ */
.budget-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.budget-kpi-card {
  background: var(--bg-paper);
  border: 1px solid var(--border-ink);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: var(--shadow-paper);
}

.budget-kpi-value {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  margin: 6px 0 2px;
}

.terra-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-paper);
  border: 1.5px solid var(--border-ink);
  border-radius: var(--radius-card);
}

.terra-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.terra-table th,
.terra-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-hairline);
  text-align: left;
  vertical-align: middle;
}

.terra-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg-sage-soft);
  color: var(--ink-primary);
}

.terra-table input[type="number"] {
  width: 100%;
  max-width: 110px;
  padding: 5px 8px;
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
  background: var(--bg-paper-elevated);
  font-family: var(--font-mono);
}
.terra-table input[type="text"] {
  width: 100%;
  max-width: 340px;
  padding: 5px 8px;
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
  background: var(--bg-paper-elevated);
  font-family: var(--font-mono);
}

/* ============================================================================
   PERSONAL AI TRAVEL ASSISTANT DRAWER (Section 9)
   ============================================================================ */
.ai-assistant-fab {
  position: fixed;
  bottom: 22px;
  right: 24px;
  z-index: 250;
  background: #1C2820;
  color: #F2EDE2;
  border: 1.5px solid var(--accent-terracotta);
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(28, 40, 32, 0.28);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-assistant-drawer {
  position: fixed;
  bottom: 78px;
  right: 24px;
  width: min(430px, calc(100vw - 32px));
  max-height: 76vh;
  z-index: 260;
  background: var(--bg-paper-elevated);
  border: 2px solid var(--border-ink);
  border-radius: 10px;
  box-shadow: var(--shadow-polaroid);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-drawer-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 390px;
}

.ai-msg-bubble {
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.5;
}

.ai-msg-user {
  background: var(--ink-primary);
  color: var(--bg-canvas);
  align-self: flex-end;
  max-width: 86%;
}

.ai-msg-assistant {
  background: var(--bg-paper);
  border: 1px solid var(--border-hairline);
  color: var(--ink-primary);
  align-self: flex-start;
  width: 100%;
}

/* ============================================================================
   TOAST NOTIFICATION & FOOTER STAMP
   ============================================================================ */
.terra-toast {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 400;
  background: #1C2820;
  color: #F2EDE2;
  border-left: 4px solid var(--accent-terracotta);
  padding: 11px 18px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  box-shadow: var(--shadow-polaroid);
}

.terra-footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 28px 48px;
  border-top: 1.5px solid var(--border-hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS (Section 15)
   ============================================================================ */
@media (max-width: 1024px) {
  .terra-hero-grid,
  .research-banner,
  .map-explorer-layout,
  .field-notes-trio {
    grid-template-columns: 1fr;
  }
  .terra-destinations-grid,
  .cards-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .budget-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-polaroid-card {
    margin-left: 0;
    max-width: 100%;
  }
}

@media (max-width: 680px) {
  .terra-header-inner {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .terra-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .terra-main-container {
    padding: 16px 16px 64px;
  }
  .terra-destinations-grid,
  .cards-grid-2,
  .cards-grid-3,
  .budget-kpi-grid {
    grid-template-columns: 1fr;
  }
  .itinerary-stop-row {
    grid-template-columns: 1fr;
  }
}

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