:root {
  --ink: #24352f;
  --muted: #63736d;
  --moss: #405c52;
  --rust: #b66443;
  --paper: #f4efe3;
  --paper-deep: #e6ddcb;
  --line: rgba(64, 92, 82, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.75), transparent 30%),
    linear-gradient(135deg, #d6d3c5, #b8c1b8);
  font-family: Inter, system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}

a { color: inherit; }

.site-header,
footer,
#app {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 8px 18px;
  color: #f8f3e9;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.15rem;
}

.brand-mark { color: #e3a16e; }
.trip-label { margin: 0; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.edit-link {
  padding: 9px 13px;
  border: 1px solid rgba(248, 243, 233, .45);
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background .2s ease, color .2s ease;
}
.edit-link:hover { color: var(--ink); background: #f8f3e9; }

#app {
  min-height: 76vh;
  overflow: hidden;
  border-radius: 5px 5px 2px 2px;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, var(--line) 32px);
  box-shadow: 0 24px 65px rgba(32, 45, 40, .3), inset 0 0 70px rgba(107, 88, 55, .08);
}

.cover {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  min-height: 76vh;
}

.cover-copy { padding: clamp(44px, 8vw, 100px); }

.eyebrow,
.entry-date {
  display: inline-block;
  margin: 0 0 18px;
  color: var(--rust);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  line-height: .96;
}

h1 { max-width: 620px; font-size: clamp(4rem, 10vw, 8rem); }
h2 { font-size: clamp(3rem, 7vw, 6rem); }

.intro {
  max-width: 540px;
  margin: 30px 0;
  color: var(--muted);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.65;
}

.cover-art {
  position: relative;
  min-height: 480px;
  overflow: hidden;
  background: linear-gradient(170deg, #91a59e 0 35%, #587268 35% 57%, #2f4f46 57% 72%, #d6d7c9 72%);
}

.cover-art::before,
.cover-art::after {
  content: "";
  position: absolute;
  width: 125%;
  height: 42%;
  left: -10%;
  bottom: 10%;
  transform: rotate(-7deg);
  clip-path: polygon(0 95%, 12% 35%, 25% 68%, 42% 8%, 54% 66%, 72% 24%, 88% 70%, 100% 40%, 100% 100%, 0 100%);
  background: #314b43;
}

.cover-art::after {
  bottom: -8%;
  transform: rotate(4deg);
  background: #83968c;
}

.art-note {
  position: absolute;
  z-index: 2;
  right: 12%;
  bottom: 12%;
  max-width: 190px;
  color: #fbf4e7;
  font-family: Caveat, cursive;
  font-size: 1.8rem;
  transform: rotate(-4deg);
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 30px;
  margin-top: 46px;
}

.day-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid rgba(64, 92, 82, .3);
  text-decoration: none;
  transition: transform .2s ease, color .2s ease;
}

.day-card:hover { color: var(--rust); transform: translateX(5px); }
.day-number { font-family: Caveat, cursive; font-size: 1.8rem; line-height: 1; }
.day-place { display: block; font-family: "DM Serif Display", serif; font-size: 1.08rem; }
.day-route { color: var(--muted); font-size: .76rem; }

.trip-map-section {
  margin-top: 58px;
  padding-top: 30px;
  border-top: 1px solid rgba(64, 92, 82, .3);
}
.map-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 16px; }
.map-heading.compact { align-items: center; }
.map-kicker { margin: 0 0 7px; color: var(--rust); font-size: .65rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.map-heading h2 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
.map-heading h3 { margin: 0; font: 400 clamp(1.8rem, 4vw, 3rem)/1 "DM Serif Display", Georgia, serif; }
.map-total { display: grid; flex: none; margin: 0; color: var(--muted); text-align: right; }
.map-total strong { color: var(--ink); font: 400 1.35rem/1.1 "DM Serif Display", Georgia, serif; }
.map-total span { margin-top: 3px; font-size: .58rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.journal-map {
  position: relative;
  display: grid;
  width: 100%;
  height: 360px;
  overflow: hidden;
  border: 1px solid rgba(64, 92, 82, .22);
  border-radius: 4px;
  color: var(--muted);
  background: #d8ded9;
  font-size: .75rem;
  place-items: center;
}
.journal-map.leaflet-container { display: block; font-family: Inter, system-ui, sans-serif; }
.map-unavailable { max-width: 290px; padding: 24px; text-align: center; line-height: 1.5; }
.map-legend { display: grid; gap: 7px; margin-top: 14px; }
.map-legend a { display: grid; grid-template-columns: 12px 1fr auto; gap: 9px; align-items: center; color: var(--muted); font-size: .7rem; text-decoration: none; }
.map-legend a:hover { color: var(--rust); }
.map-legend-swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--route-color); }
.map-legend strong { color: var(--ink); font-size: .68rem; }
.day-map-section { margin: clamp(56px, 8vw, 92px) 0; }
.day-map { height: min(55vh, 480px); }
.leaflet-popup-content { line-height: 1.5; }
.journal-marker {
  --marker-scale: 1;
  background: transparent;
  border: 0;
}
.journal-marker-pin {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 42px;
  transform: scale(var(--marker-scale));
  transform-origin: 50% 100%;
  transition: transform .18s ease-out;
}
.journal-marker-pin span {
  position: absolute;
  top: 13px;
  left: 3px;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 50% 50% 50% 0;
  background: var(--marker-color, var(--rust));
  box-shadow: 0 2px 5px rgba(28, 36, 32, .32);
  transform: rotate(-45deg);
}
.journal-marker-pin span::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  content: "";
  transform: translate(-50%, -50%);
}
.journal-marker--camp .journal-marker-pin span::after,
.journal-marker--airplane .journal-marker-pin span::after {
  width: auto;
  height: auto;
  border-radius: 0;
  color: white;
  background: transparent;
  content: attr(data-marker-symbol);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transform: translate(-50%, -50%) rotate(45deg);
}
.journal-marker--airplane .journal-marker-pin span::after {
  font-size: 13px;
}
.route-number-tooltip {
  border: 0 !important;
  color: white !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: .62rem !important;
  font-weight: 700 !important;
}
.route-number-tooltip::before { display: none !important; }

.entry { min-height: 76vh; padding: clamp(36px, 7vw, 82px); }
.entry-top { display: grid; grid-template-columns: 1fr minmax(270px, .55fr); gap: 70px; }
.entry-title em { color: var(--rust); font-weight: 400; }

.entry-body {
  max-width: 680px;
  margin-top: 44px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.75;
}

.entry-body p:first-child::first-letter {
  float: left;
  padding: 7px 8px 0 0;
  color: var(--rust);
  font-size: 4.6rem;
  line-height: .7;
}

.note-card {
  align-self: start;
  padding: 30px;
  background: #e8d7a9;
  box-shadow: 4px 7px 16px rgba(57, 58, 42, .15);
  transform: rotate(2deg);
}

.note-card p { margin: 0; font-family: Caveat, cursive; font-size: 1.65rem; line-height: 1.15; }
.facts { margin: 22px 0 0; padding: 0; list-style: none; font-size: .8rem; }
.facts li { padding: 8px 0; border-top: 1px solid rgba(36,53,47,.2); }
.facts strong { display: inline-block; width: 72px; text-transform: uppercase; font-size: .65rem; letter-spacing: .1em; }

.photo-storyboard {
  display: grid;
  gap: clamp(34px, 6vw, 72px);
  margin: clamp(60px, 9vw, 110px) 0;
}

.story-photo {
  position: relative;
  width: min(78%, 760px);
  margin: 0;
  padding: clamp(8px, 1.4vw, 14px);
  background: #fbf7ed;
  box-shadow: 5px 12px 28px rgba(36, 53, 47, .18);
  transform: rotate(-1.2deg);
}

.story-photo:nth-child(even) { justify-self: end; transform: rotate(1.4deg); }
.story-photo:nth-child(3n) { width: min(68%, 650px); margin-left: 9%; transform: rotate(-.4deg); }
.story-photo img { display: block; width: auto; max-width: 100%; height: auto; max-height: 72vh; margin-inline: auto; }
.story-photo figcaption { padding: 12px 8px 5px; color: var(--ink); font-family: Caveat, cursive; font-size: 1.45rem; line-height: 1.1; }
.photo-metadata {
  display: block;
  padding: 8px 8px 4px;
  color: var(--muted);
  font-size: .62rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .035em;
}
.photo-metadata-missing { opacity: .72; font-style: italic; }
.story-photo figcaption + .photo-metadata { padding-top: 3px; }
.full-image-link {
  display: inline-block;
  margin: 3px 8px 5px;
  color: var(--moss);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .035em;
  text-decoration: none;
}
.full-image-link:hover { color: var(--rust); }
.story-number {
  position: absolute;
  z-index: 1;
  top: -18px;
  left: -16px;
  display: grid;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fbf7ed;
  background: var(--rust);
  font: 600 1.25rem/1 Caveat, cursive;
  place-items: center;
  transform: rotate(7deg);
}
.story-photo:nth-child(even) .story-number { right: -16px; left: auto; transform: rotate(-7deg); }

.entry-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 58px; padding-top: 18px; border-top: 1px solid rgba(64, 92, 82, .3); }
.entry-nav a { color: var(--moss); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.entry-nav a:hover { color: var(--rust); }

body.edit-mode #app { width: min(1500px, calc(100% - 32px)); background: #e8e4da; }
.editor-shell { display: grid; grid-template-columns: 245px 1fr; min-height: 78vh; }
.editor-sidebar { display: flex; flex-direction: column; padding: 28px 20px; color: #f7f1e7; background: var(--ink); }
.editor-sidebar-top { padding: 4px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.13); }
.editor-kicker { margin: 0 0 8px; color: var(--rust); font-size: .67rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.editor-sidebar h1 { font-size: 2rem; }
.save-status { margin: 12px 0 0; color: #aebdb7; font-size: .68rem; }
.save-button {
  flex: none; padding: 11px 16px; border: 0; border-radius: 4px; color: white; background: var(--moss);
  font: 600 .7rem Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
.save-button:hover:not(:disabled) { background: var(--ink); }
.save-button:disabled { opacity: .42; cursor: default; }
.editor-nav { display: grid; gap: 4px; max-height: 50vh; margin: 18px 0; overflow: auto; }
.editor-nav button {
  width: 100%; padding: 10px 12px; border: 0; border-radius: 4px; color: inherit; background: transparent;
  font: inherit; text-align: left; cursor: pointer;
}
.editor-nav button:hover, .editor-nav button.active { background: rgba(255,255,255,.1); }
.editor-nav button.active { box-shadow: inset 3px 0 var(--rust); }
.editor-nav span, .editor-nav small { display: block; }
.editor-nav span { font-family: "DM Serif Display", serif; font-size: 1rem; }
.editor-nav small { margin-top: 2px; color: #aebdb7; font-size: .66rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-day { padding: 11px; border: 1px dashed rgba(255,255,255,.3); border-radius: 4px; color: #f7f1e7; background: transparent; cursor: pointer; }
.add-day:hover { background: rgba(255,255,255,.08); }
.editor-tools { display: flex; gap: 14px; margin-top: auto; padding: 20px 8px 0; }
.text-button { padding: 0; border: 0; color: var(--moss); background: transparent; font: 600 .7rem Inter, sans-serif; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.editor-sidebar .text-button { color: #c9d3cf; }
.text-button.danger { color: var(--rust); }
.editor-workspace { display: grid; grid-template-columns: minmax(330px, .72fr) minmax(420px, 1.28fr); min-width: 0; }
.editor-panel { padding: clamp(28px, 4vw, 54px); overflow: auto; background: var(--paper); }
.editor-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 34px; }
.editor-heading h2 { font-size: clamp(2.2rem, 4vw, 3.7rem); line-height: 1; }
.editor-heading-actions { display: flex; align-items: center; gap: 18px; }
.edit-form { display: grid; gap: 20px; }
.edit-field { display: grid; gap: 7px; }
.edit-field span { color: var(--muted); font-size: .67rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.edit-field input, .edit-field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid rgba(64,92,82,.25); border-radius: 3px; color: var(--ink);
  outline: none; background: rgba(255,255,255,.42); font: .9rem/1.5 Inter, sans-serif; resize: vertical;
}
.edit-field textarea { min-height: 92px; }
.edit-field[data-field="paragraphs"] textarea, .edit-field:last-child textarea { min-height: 155px; }
.edit-field input:focus, .edit-field textarea:focus { border-color: var(--rust); box-shadow: 0 0 0 3px rgba(182,100,67,.1); }
.route-editor { display: grid; gap: 14px; padding: 16px; border: 1px solid rgba(64,92,82,.22); border-radius: 4px; background: rgba(255,255,255,.28); }
.route-editor-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.edit-section-label { color: var(--muted); font-size: .67rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.route-editor h3 { margin: 4px 0 0; font: 400 1.8rem/1 "DM Serif Display", Georgia, serif; }
.route-color { display: grid; gap: 5px; color: var(--muted); font-size: .6rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.route-color input { width: 54px; height: 30px; padding: 2px; border: 1px solid rgba(64,92,82,.25); border-radius: 3px; background: white; cursor: pointer; }
.route-editor-map { height: 310px; cursor: crosshair; }
.photo-route-assistant {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(182,100,67,.22);
  border-radius: 4px;
  background: linear-gradient(120deg, rgba(232,215,169,.48), rgba(255,255,255,.5));
}
.photo-route-icon { display: grid; width: 34px; height: 34px; border-radius: 50%; color: white; background: var(--rust); font-size: 1rem; place-items: center; }
.photo-route-copy { display: grid; gap: 3px; min-width: 0; }
.photo-route-copy strong { font: 400 .92rem/1.2 "DM Serif Display", Georgia, serif; }
.photo-route-copy span { color: var(--muted); font-size: .62rem; line-height: 1.4; }
.photo-route-button { padding: 8px 10px; border: 1px solid var(--rust); border-radius: 3px; color: var(--rust); background: rgba(255,255,255,.55); font: 600 .61rem Inter, sans-serif; cursor: pointer; white-space: nowrap; }
.photo-route-button:hover:not(:disabled) { color: white; background: var(--rust); }
.photo-route-button:disabled { opacity: .42; cursor: default; }
.route-editor-help, .route-empty, .route-status { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.route-stop-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.route-stop-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 7px 10px;
  align-items: center;
  padding: 10px;
  border-radius: 3px;
  background: rgba(255,255,255,.55);
}
.route-stop-number { display: grid; grid-row: span 2; width: 25px; height: 25px; border-radius: 50%; color: white; background: var(--moss); font-size: .68rem; font-weight: 700; place-items: center; }
.route-stop-number.photo-derived { background: var(--rust); }
.route-stop-item > label { display: grid; gap: 4px; }
.route-stop-item > label > span { color: var(--muted); font-size: .58rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.route-stop-item input[type="text"], .route-stop-item input:not([type]) { min-width: 0; padding: 7px 8px; border: 1px solid rgba(64,92,82,.2); border-radius: 3px; color: var(--ink); background: white; font: .75rem Inter, sans-serif; }
.route-pin-options { display: grid; gap: 5px; }
.route-pin-toggle { display: flex; gap: 5px; align-items: center; color: var(--muted); font-size: .62rem; white-space: nowrap; }
.route-pin-toggle input { accent-color: var(--moss); }
.route-stop-coordinates { grid-column: 2; color: var(--muted); font-size: .58rem; font-variant-numeric: tabular-nums; }
.route-stop-actions { display: flex; grid-column: 3; grid-row: 2; gap: 6px; align-items: center; }
.route-editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.route-editor-buttons { display: flex; gap: 12px; align-items: center; }
.route-button { padding: 9px 12px; border: 0; border-radius: 3px; color: white; background: var(--moss); font: 600 .65rem Inter, sans-serif; cursor: pointer; }
.route-button:hover:not(:disabled) { background: var(--ink); }
.route-button:disabled { opacity: .4; cursor: default; }
.route-status { text-align: right; }
.photo-editor { padding: 16px; border: 1px solid rgba(64,92,82,.18); border-radius: 4px; background: rgba(255,255,255,.25); }
.photo-editor-grid { display: grid; gap: 12px; }
.photo-editor-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 3px;
  background: rgba(255,255,255,.48);
}
.photo-editor-preview { display: block; width: 96px; height: 74px; object-fit: contain; background: var(--paper-deep); }
.photo-editor-copy, .photo-editor-item label { display: grid; gap: 5px; }
.photo-editor-item label { color: var(--muted); font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.photo-editor-item label input { padding: 8px 9px; font-size: .78rem; letter-spacing: 0; text-transform: none; }
.photo-editor-metadata { color: var(--muted); font-size: .58rem; font-variant-numeric: tabular-nums; line-height: 1.4; }
.photo-editor-full-link { justify-self: start; color: var(--moss); font-size: .6rem; font-weight: 600; text-decoration: none; }
.photo-editor-full-link:hover { color: var(--rust); }
.photo-editor-actions { display: flex; align-items: center; gap: 8px; }
.photo-replace-button {
  display: block !important;
  padding: 7px 8px;
  border: 1px solid rgba(64,92,82,.3);
  border-radius: 3px;
  color: var(--moss) !important;
  background: rgba(255,255,255,.5);
  font-size: .58rem !important;
  line-height: 1 !important;
  cursor: pointer;
}
.photo-replace-button:hover { color: white !important; background: var(--moss); }
.photo-replace-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.photo-order-button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(64,92,82,.3);
  border-radius: 3px;
  color: var(--moss);
  background: rgba(255,255,255,.5);
  font: 600 .9rem/1 Inter, sans-serif;
  cursor: pointer;
  place-items: center;
}
.photo-order-button:hover:not(:disabled) { color: white; background: var(--moss); }
.photo-order-button:focus-visible { outline: 3px solid rgba(182,100,67,.2); border-color: var(--rust); }
.photo-order-button:disabled { opacity: .3; cursor: default; }
.photo-placeholder { margin: 2px 0; color: var(--muted); font-size: .8rem; }
.photo-upload-button {
  justify-self: start;
  padding: 9px 12px;
  border: 1px solid var(--moss);
  border-radius: 3px;
  color: var(--moss);
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
}
.photo-upload-button:hover { color: white; background: var(--moss); }
.photo-upload-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.photo-upload-status, .photo-editor > small { color: var(--muted); font-size: .67rem; line-height: 1.4; }
.preview-panel { min-width: 0; padding: 22px; overflow: hidden; background: #d5d1c7; }
.preview-label { display: flex; justify-content: space-between; padding: 0 2px 12px; color: var(--muted); font-size: .65rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.preview-label a { text-decoration: none; }
.preview-canvas { height: calc(78vh - 56px); overflow: auto; border-radius: 3px; background-color: var(--paper); background-image: repeating-linear-gradient(0deg, transparent 0 31px, var(--line) 32px); box-shadow: 0 14px 34px rgba(36,53,47,.16); }
.preview-canvas .cover, .preview-canvas .entry { min-height: 100%; }
.preview-canvas .cover { grid-template-columns: 1fr; }
.preview-canvas .cover-copy, .preview-canvas .entry { padding: clamp(30px, 5vw, 58px); }
.preview-canvas .cover-art { min-height: 280px; }
.preview-canvas h1 { font-size: clamp(3.2rem, 7vw, 6rem); }
.preview-canvas h2 { font-size: clamp(2.8rem, 5vw, 4.5rem); }
.preview-canvas .entry-top { grid-template-columns: 1fr; gap: 34px; }
.preview-canvas .note-card { max-width: 360px; }

footer { display: flex; justify-content: space-between; padding: 18px 8px 30px; color: #f8f3e9; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 760px) {
  .trip-label { display: none; }
  .cover { grid-template-columns: 1fr; }
  .cover-art { min-height: 300px; }
  .day-grid { grid-template-columns: 1fr; }
  .entry-top { grid-template-columns: 1fr; gap: 34px; }
  .note-card { max-width: 360px; }
  .story-photo, .story-photo:nth-child(3n) { width: 92%; margin-left: 0; }
  .map-heading { align-items: start; }
  .journal-map { height: 320px; }
  .map-legend a { grid-template-columns: 12px 1fr; }
  .map-legend strong { grid-column: 2; }
  footer { display: block; line-height: 1.8; }
  footer span { display: block; }
}

@media (max-width: 1100px) {
  .editor-workspace { grid-template-columns: 1fr; }
  .preview-panel { display: none; }
}

@media (max-width: 820px) {
  body.edit-mode {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  body.edit-mode .site-header,
  body.edit-mode footer { width: calc(100% - 24px); }
  body.edit-mode .site-header { padding-block: 14px 12px; }
  body.edit-mode .brand { min-width: 0; font-size: 1rem; }
  body.edit-mode .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.edit-mode #app {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    overflow: clip visible;
    border-radius: 0;
  }
  .editor-shell,
  .editor-workspace { grid-template-columns: minmax(0, 1fr); width: 100%; min-width: 0; max-width: 100%; }
  .editor-sidebar {
    position: sticky;
    z-index: 1000;
    top: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: none;
    padding: 12px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
    box-shadow: 0 8px 22px rgba(25, 40, 35, .22);
  }
  .editor-sidebar-top { display: flex; align-items: center; gap: 10px; padding: 0 2px 9px; }
  .editor-sidebar-top .editor-kicker { margin: 0; }
  .editor-sidebar h1 { font: 400 1.15rem/1 "DM Serif Display", Georgia, serif; }
  .save-status { margin: 0 0 0 auto; font-size: .64rem; white-space: nowrap; }
  .editor-nav {
    display: flex;
    gap: 6px;
    max-height: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0 0 3px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .editor-nav::-webkit-scrollbar { display: none; }
  .editor-nav button {
    flex: 0 0 auto;
    width: auto;
    min-width: 94px;
    min-height: 46px;
    padding: 7px 10px;
    scroll-snap-align: start;
  }
  .editor-nav button.active { box-shadow: inset 0 -3px var(--rust); }
  .editor-nav span { font-size: .92rem; }
  .editor-nav small { max-width: 105px; font-size: .61rem; }
  .add-day { align-self: flex-start; min-height: 44px; margin-top: 7px; padding: 8px 12px; }
  .editor-tools { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: 18px; gap: 12px; margin: 0; padding: 0; }
  .editor-tools .text-button { min-height: 28px; }
  .header-actions { gap: 10px; }
  .editor-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 70vh;
    padding: 24px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overflow-x: clip;
    overflow-y: visible;
  }
  .editor-heading { align-items: center; gap: 12px; margin-bottom: 24px; }
  .editor-heading > div,
  .editor-heading-actions { min-width: 0; }
  .editor-heading h2 { overflow-wrap: anywhere; font-size: clamp(2rem, 11vw, 3rem); }
  .editor-heading-actions { gap: 10px; }
  .editor-heading .save-button {
    position: fixed;
    z-index: 1100;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    min-width: 138px;
    min-height: 50px;
    padding: 12px 18px;
    box-shadow: 0 8px 24px rgba(25, 40, 35, .3);
  }
  .editor-heading .save-button:disabled { visibility: hidden; }
  .edit-form { width: 100%; min-width: 0; max-width: 100%; gap: 18px; }
  .edit-field { width: 100%; min-width: 0; max-width: 100%; }
  .edit-field input, .edit-field textarea { min-height: 46px; padding: 12px; font-size: 1rem; }
  .text-button, .save-button, .add-day, .route-button, .photo-route-button, .photo-upload-button, .photo-replace-button { touch-action: manipulation; }
  .route-editor,
  .photo-editor {
    width: calc(100% + 8px);
    min-width: 0;
    max-width: calc(100% + 8px);
    margin-inline: -4px;
    padding: 12px;
  }
  .route-editor-heading { align-items: center; }
  .journal-map,
  .route-editor-map { width: 100%; min-width: 0; max-width: 100%; }
  .route-editor-map { height: min(62vh, 360px); }
  .leaflet-control-container .leaflet-bottom { max-width: 100%; }
  .leaflet-control-attribution { max-width: calc(100vw - 48px); white-space: normal; }
  .photo-editor-grid,
  .route-stop-list { width: 100%; min-width: 0; max-width: 100%; }
  .photo-editor-item { grid-template-columns: 76px minmax(0, 1fr); width: 100%; min-width: 0; max-width: 100%; }
  .photo-editor-copy { min-width: 0; }
  .photo-editor-preview { width: 76px; height: 64px; }
  .photo-editor-actions { grid-column: 1 / -1; flex-wrap: wrap; justify-self: stretch; }
  .photo-editor-item label input, .route-stop-item input[type="text"], .route-stop-item input:not([type]) { min-height: 44px; font-size: 1rem; }
  .photo-order-button { width: 44px; height: 44px; }
  .photo-replace-button { display: grid !important; min-height: 44px; padding-inline: 12px; place-items: center; }
  .photo-editor-actions .text-button { min-height: 44px; padding-inline: 6px; }
  .photo-upload-button { display: grid; min-height: 46px; padding-inline: 14px; place-items: center; }
  .route-stop-item { grid-template-columns: 28px minmax(0, 1fr); width: 100%; min-width: 0; max-width: 100%; }
  .photo-route-assistant { grid-template-columns: 34px minmax(0, 1fr); width: 100%; min-width: 0; max-width: 100%; }
  .photo-route-button { grid-column: 1 / -1; min-height: 44px; justify-self: stretch; }
  .route-pin-options { grid-column: 2; justify-self: start; }
  .route-pin-toggle input { width: 22px; height: 22px; }
  .route-stop-coordinates { grid-column: 2; }
  .route-stop-actions { grid-column: 1 / -1; grid-row: auto; flex-wrap: wrap; }
  .route-stop-actions .text-button { min-height: 44px; padding-inline: 6px; }
  .route-editor-footer { display: grid; }
  .route-editor-buttons { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; min-width: 0; align-items: stretch; }
  .route-button { min-height: 46px; flex: 1; padding-inline: 10px; }
  .route-button, .route-editor-buttons .text-button { white-space: normal; }
  .route-editor-buttons .text-button { min-height: 46px; padding-inline: 4px; }
  .route-status { text-align: left; }
}

@media (max-width: 390px) {
  body.edit-mode .edit-link { padding-inline: 10px; }
  .editor-sidebar-top { gap: 7px; }
  .editor-sidebar h1 { display: none; }
  .editor-tools { gap: 9px; }
  .editor-panel {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }
  .editor-heading-actions { align-items: flex-end; flex-direction: column-reverse; }
  .route-editor-buttons { grid-template-columns: minmax(0, 1fr); }
  .photo-editor-item { grid-template-columns: 64px minmax(0, 1fr); padding: 8px; }
  .photo-editor-preview { width: 64px; height: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .day-card,
  .journal-marker-pin { transition: none; }
}
