/* ============================================================================
 * Cairn — styles
 * Consolidated from the locked Round 5 design cascade:
 *   tokens.css → cairn-styles.css → -v2 → -v3 → -v4 → -v5
 * Only the rules used by the Round 5 page (PageEditorialV5, the `.ed-*` editorial
 * voice) are kept; round-1 classes and design-canvas scaffolding are dropped.
 * v3/v4/v5 deltas are folded into their base rules as final values.
 *
 * Translation, not invention. The two additions beyond the locked mock are
 * called out inline: (1) max-width centering + responsive type clamps, since the
 * mock was a fixed 640px artboard and Cairn is used mostly on phones; (2) the
 * card-corner sizing for the capybara static render.
 * ========================================================================== */

/* Newsreader requests both axes: roman (0) 300–600 and italic (1) 300–500. v1
   uses font-style:italic heavily; without the ital axis the browser synthesised
   a faux slant — the true italic axis (added in v1.1 for the Atlas) renders the
   real glyphs everywhere. No italic 600 is used in the app, so it's omitted. */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,300;1,6..72,400;1,6..72,500&family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ─── Tokens ──────────────────────────────────────────────────────────────── */

:root {
  /* Surfaces — all warm, all desaturated */
  --paper:      #F2ECDF;
  --paper-2:    #ECE4D2;
  --card:       #F7F1E4;
  --card-2:     #FBF6EB;

  /* Ink */
  --ink:        #2A241D;
  --ink-2:      #4A4137;
  --ink-3:      #6E6356;
  --ink-4:      #9B907F;

  /* Lines */
  --rule:       #D9CFBE;
  --rule-soft:  #E5DCC9;

  /* Accent — quiet burnt ochre, used sparingly */
  --ochre:      #A6562C;
  --ochre-soft: #C7855A;
  --ochre-bg:   #EDDFCB;

  /* Type */
  --serif:  'Newsreader', 'Source Serif Pro', Georgia, serif;
  --sans:   'IBM Plex Sans', system-ui, sans-serif;
  --mono:   'IBM Plex Mono', ui-monospace, monospace;

  /* Spacing scale (4-base) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px;
}

/* ─── Base reset / scope ─────────────────────────────────────────────────── */

html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}
.cairn * { box-sizing: border-box; }
.cairn {
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ─── Page frame ─────────────────────────────────────────────────────────── */

.ed-page {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 48px;
  /* Addition: centre the locked 640px artboard column on wide screens. */
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 0 56px;
}
.ed-page > * { padding-left: 28px; padding-right: 28px; }

/* Paper depth: warm dark grain at ~5% over the page. */
.ed-page--v4 {
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.15  0 0 0 0 0.11  0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-blend-mode: multiply;
  padding-top: 0;   /* masthead band carries its own top padding */
}

/* Full-bleed masthead band — a different, deeper "paper stock". */
.ed-page--v4 > .ed-mast-band { padding-left: 0; padding-right: 0; }
.ed-mast-band {
  background-color: #ECE3CE;
  background-image:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.12  0 0 0 0 0.07  0 0 0 0.20 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n2)' opacity='0.6'/%3E%3C/svg%3E");
  background-blend-mode: multiply;
  border-bottom: 1px solid rgba(120, 95, 60, 0.18);
  position: relative;
}
.ed-mast-band::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 3px;
  background: linear-gradient(to bottom, rgba(80,60,30,0.04), transparent);
  pointer-events: none;
}
.ed-mast-band__inner { padding: 40px 28px 32px; }

/* ─── Masthead — hero italic ─────────────────────────────────────────────── */

.ed-mast {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 16px;
  border-bottom: none;
  padding-bottom: 0;
}
.ed-mast__overline {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  grid-column: 1 / -1;
  margin-bottom: -6px;
}
.ed-mast__title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 92px;
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0 0 0 -3px;
  font-variation-settings: "opsz" 72;
}
.ed-mast__title .amp {
  display: inline-block;
  color: var(--ochre);
  font-style: italic;
  font-weight: 400;
  font-size: 0.42em;
  vertical-align: 0.06em;
  margin-left: 6px;
}
.ed-mast__tag {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-3);
  text-align: right;
  max-width: 18ch;
  padding-bottom: 12px;
  font-variation-settings: "opsz" 18;
}

/* ─── Counter bar — hero stat + supporting column ────────────────────────── */

.ed-counter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
}
.ed-counter__supports {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--rule);
}
.ed-counter__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 0 9px;
  border-bottom: 1px solid var(--rule);
  gap: 16px;
}
.ed-counter__rowlabel {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ed-counter__rownum {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 22px;
  color: var(--ink);
  font-feature-settings: 'lnum','tnum';
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 24;
}
.ed-counter__rownum .small { font-size: 13px; color: var(--ink-3); margin-left: 2px; }

.ed-counter__hero {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding-right: 4px;
}
.ed-counter__heronum {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 140px;
  line-height: 0.85;
  letter-spacing: -0.045em;
  color: var(--ink);
  font-variation-settings: "opsz" 72;
  margin-right: -3px;
}
.ed-counter__herolabel {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ed-counter__herolabel::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--ochre);
}

/* ─── Section dateline (above / below the timeline) ──────────────────────── */

.ed-dateline {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding-top: 4px;
}
.ed-dateline__label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ed-dateline__rule { height: 1px; background: var(--rule); }
.ed-dateline__caption {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 12px;
  color: var(--ink-3);
}

/* ─── Timeline column + spine ────────────────────────────────────────────── */

.ed-timeline {
  position: relative;
  padding-left: 60px;
}
.ed-timeline::before {
  content: "";
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--rule);
}

/* Stylised stone silhouette on the spine. */
.ed-stone-svg {
  position: absolute;
  left: -47px;
  top: 50px;
  z-index: 1;
  pointer-events: none;
  transition: transform .25s ease;
}
.ed-stone-svg.is-latest {
  left: -51px;
  top: 46px;
}

/* ─── Trip card — editorial spread ───────────────────────────────────────── */

.ed-card {
  position: relative;
  padding: 52px 0;
  min-height: 280px;
  border-bottom: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 8px 20px;
  transition: background .18s ease;
}
.ed-card:last-of-type { border-bottom: none; }
/* Alternating asymmetric breath — every other card indents right slightly. */
.ed-card.is-offset { padding-left: 28px; }

.ed-city {
  grid-column: 1 / 2;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 60px;
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: "opsz" 60;
  text-wrap: balance;
}
.ed-city--small { font-size: 48px; }

.ed-country {
  grid-column: 1 / 2;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.ed-country__badge {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ochre);
  padding-left: 14px;
  border-left: 1px solid var(--rule);
  line-height: 1.1;
}
.ed-country__badge--return { color: var(--ink-3); }

.ed-rating {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-top: 14px;
}
.ed-rating__num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 34px;
  line-height: 1;
  color: var(--ochre);
  letter-spacing: -0.02em;
}
.ed-rating__num .denom {
  font-size: 16px;
  color: var(--ink-4);
  font-style: italic;
  margin-left: 2px;
}

.ed-meta {
  grid-column: 1 / 2;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ed-dateline-row {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 18px;
  color: var(--ink-2);
  letter-spacing: -0.005em;
  font-feature-settings: 'lnum';
  font-variation-settings: "opsz" 18;
}
.ed-dateline-row .yr { color: var(--ink-4); margin-left: 4px; }
.ed-duration {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  color: var(--ink-3);
  letter-spacing: -0.005em;
}

.ed-note {
  grid-column: 1 / 2;
  margin-top: 20px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: -0.005em;
  text-wrap: pretty;
  max-width: 32ch;
  font-variation-settings: "opsz" 20;
}

.ed-lang {
  grid-column: 1 / 2;
  margin-top: 16px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink-3);
  padding-left: 18px;
  border-left: 1px solid var(--rule);
  max-width: 36ch;
}

/* Capybara — bottom right, lives in the right column. */
.ed-capy {
  grid-column: 2 / 3;
  align-self: end;
  justify-self: end;
  margin-top: 8px;
}
/* Addition: size capyjonny's static render for the card corner. The pixel art
   is drawn by capyjonny.js (the same CAPY_SVG as Food Decider's easter egg).
   The walk-bob entrance animation is suppressed here (this is a static marker,
   not an ambling visitor); the idle eye-blink from capyjonny.js stays. */
.ed-capy .capyjonny-art {
  width: 52px;
  animation: none;
}

/* Card actions (edit · remove) — quiet, editorial; revealed on hover. */
.ed-actions {
  position: absolute;
  top: 36px;
  right: 0;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .15s;
}
.ed-edit,
.ed-del {
  background: transparent;
  border: none;
  color: var(--ink-4);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 2px;
  transition: color .15s;
}
.ed-card:hover .ed-actions { opacity: 1; }
.ed-edit:hover,
.ed-del:hover { color: var(--ochre); }
/* Keyboard focus + touch: keep the controls reachable without hover. */
.ed-actions:focus-within { opacity: 1; }
.ed-edit:focus-visible,
.ed-del:focus-visible { outline: 1px solid var(--ochre); outline-offset: 2px; }

/* Confirm state: card body warms, italic line slides in. */
.ed-card.is-confirming {
  background: linear-gradient(to right, rgba(166,86,44,0.045), rgba(166,86,44,0.025) 60%, transparent);
}
.ed-card.is-confirming .ed-del { opacity: 1; color: var(--ochre); }
.ed-confirm-line {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dotted var(--ochre);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  color: var(--ochre);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.ed-confirm-line__action {
  font-family: var(--sans);
  font-style: normal;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ochre);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.ed-confirm-line__cancel {
  font-family: var(--sans);
  font-style: normal;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-left: 14px;
}

/* ─── Add-entry form ─────────────────────────────────────────────────────── */

.ed-add-collapsed {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 22px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-left: 0;
  border-right: 0;
  background: transparent;
  width: 100%;
  cursor: pointer;
  text-align: left;
}
.ed-add-collapsed__cta {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variation-settings: "opsz" 32;
}
.ed-add-collapsed__cta .mark {
  color: var(--ochre);
  font-style: normal;
  margin-right: 10px;
  font-weight: 400;
}
.ed-add-collapsed__hint {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-4);
  flex-shrink: 0;
}
.ed-add-collapsed:hover .ed-add-collapsed__cta { color: var(--ochre); }

.ed-form {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 32px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 32px;
}
.ed-form__eyebrow {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.ed-form__eyebrow-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ochre);
}
.ed-form__heading {
  grid-column: 1 / -1;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: -8px 0 12px;
  font-variation-settings: "opsz" 48;
}

.ed-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ed-field--full { grid-column: 1 / -1; }
.ed-field__label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ed-field__label .req { color: var(--ochre); margin-left: 2px; }
.ed-field__label .hint {
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-4);
  font-family: var(--serif);
  font-size: 12px;
  margin-left: 6px;
}
.ed-form input[type="text"],
.ed-form input[type="date"] {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 4px 0 8px;
  outline: none;
  border-radius: 0;
  transition: border-color .12s;
  font-variation-settings: "opsz" 22;
  width: 100%;
}
.ed-form input::placeholder { color: var(--ink-4); font-style: italic; font-weight: 300; }
.ed-form input:focus { border-bottom-color: var(--ochre); }

.ed-seg {
  display: flex;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.ed-seg__opt {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  color: var(--ink-4);
  font-variation-settings: "opsz" 18;
  transition: color .12s;
}
.ed-seg__opt--on { color: var(--ink); font-weight: 400; }

.ed-rating-input {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--rule);
}
.ed-rating-input__num { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--ochre); }
/* The star row is interactive here — make the hit target comfortable. */
.ed-rating-input .star-row { cursor: pointer; }

.ed-check {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  color: var(--ink-2);
  margin-top: 4px;
}
.ed-check input { position: absolute; opacity: 0; pointer-events: none; }
.ed-check__box {
  width: 18px;
  height: 18px;
  border: 1px solid var(--rule);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 1px;
}
.ed-check input:checked + .ed-check__box {
  background: var(--ochre);
  border-color: var(--ochre);
}
.ed-check input:checked + .ed-check__box::after {
  content: "";
  width: 9px;
  height: 4px;
  border-left: 1.5px solid var(--paper);
  border-bottom: 1.5px solid var(--paper);
  transform: rotate(-45deg) translate(1px, -1px);
}
.ed-check input:focus-visible + .ed-check__box { outline: 1px solid var(--ochre); outline-offset: 2px; }

.ed-form__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.ed-btn-cancel {
  background: none;
  border: none;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 0;
}
.ed-btn-cancel:hover { color: var(--ink); }
.ed-btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  font-weight: 400;
  padding: 12px 26px;
  cursor: pointer;
  border-radius: 1px;
  transition: background .15s;
  font-variation-settings: "opsz" 18;
}
.ed-btn-primary:hover { background: var(--ochre); }
.ed-btn-primary .mark { color: var(--ochre-soft); margin-right: 8px; }
.ed-btn-primary:hover .mark { color: var(--paper); }

/* Inline validation hint (build behaviour — the static mock had no errors). */
.ed-form__error {
  grid-column: 1 / -1;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ochre);
  margin: -8px 0 0;
}
.ed-form__error:empty { display: none; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.ed-foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.ed-foot__colophon {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  color: var(--ink-3);
}
.ed-foot__backup {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 11px 18px;
  border-radius: 1px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.ed-foot__backup:hover { color: var(--ochre); border-color: var(--ochre); }
.ed-foot__backup:disabled { opacity: 0.45; cursor: default; }
.ed-foot__backup:disabled:hover { color: var(--ink-2); border-color: var(--rule); }
.ed-foot__backup .hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
  text-transform: none;
}
.ed-foot__filed {
  justify-self: end;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}
/* Download + Import sit together in the footer's centre column. */
.ed-foot__data {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

/* ─── Import (v1.1) — inline confirmation panel, no modal ─────────────────── */

.ed-import__panel {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 26px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.ed-import__heading {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: "opsz" 26;
}
.ed-import__count {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 16px;
  color: var(--ink-2);
  margin: 0;
}
.ed-import__detail { color: var(--ink-4); }
.ed-import__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
}
/* The ochre treatment — the one ochre call-to-action while the panel is open. */
.ed-import__confirm {
  background: var(--ochre);
  color: var(--paper);
  border: none;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  padding: 11px 24px;
  cursor: pointer;
  border-radius: 1px;
  transition: background .15s;
  font-variation-settings: "opsz" 18;
}
.ed-import__confirm:hover { background: var(--ink); }
.ed-import__cancel {
  background: none;
  border: none;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 4px 0;
}
.ed-import__cancel:hover { color: var(--ink); }
.ed-import__error {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  color: var(--ochre);
  text-align: center;
  margin: 0;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}
.ed-import__summary {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  color: var(--ink-3);
  text-align: center;
  margin: 0;
  padding: 2px 0;
}

/* Ochre-once: while the import panel is open the Confirm button is the only
   ochre, so suppress the otherwise-ochre focal marks (newest stone + atlas
   hero). The CSS `fill` here overrides the SVG's fill="var(--ochre)" attribute. */
.is-importing .ed-stone-svg.is-latest path { fill: var(--ink-3); }
.is-importing .atlas__hero-floating .atlas__city { color: var(--ink-3); }

/* ─── Empty state (no entries yet) ───────────────────────────────────────── */
/* The static mock always had sample data; a fresh visitor needs a graceful
   blank. The two datelines and the timeline are hidden via [hidden] from JS;
   this styles the quiet prompt that remains. */
.ed-empty {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  color: var(--ink-3);
  text-align: center;
  padding: 8px 0 4px;
  line-height: 1.5;
}

/* ─── Responsive (addition) ──────────────────────────────────────────────────
   The locked mock was a fixed 640px artboard. Cairn is used mostly on phones,
   so the big editorial type is clamped down below 640px while the size
   hierarchy (hero > city > heading) is preserved. The spine geometry and card
   grid are left at their locked values. */

@media (max-width: 640px) {
  .ed-mast__title      { font-size: clamp(46px, 14.4vw, 92px); }
  .ed-counter__heronum { font-size: clamp(72px, 22vw, 140px); }
  .ed-city             { font-size: clamp(40px, 9.4vw, 60px); }
  .ed-city--small      { font-size: clamp(34px, 7.5vw, 48px); }
  .ed-form__heading    { font-size: clamp(32px, 7.5vw, 48px); }
  .ed-add-collapsed__cta { font-size: clamp(24px, 5vw, 32px); }
}

@media (max-width: 520px) {
  .ed-page > * { padding-left: 20px; padding-right: 20px; }
  .ed-mast-band__inner { padding: 28px 20px 24px; }
  .ed-timeline { padding-left: 52px; }
  .ed-timeline::before { left: 26px; }
  .ed-stone-svg { left: -43px; }
  .ed-stone-svg.is-latest { left: -46px; }
  .ed-foot {
    grid-template-columns: 1fr;
    gap: 14px;
    justify-items: center;
    text-align: center;
  }
  .ed-foot__filed { justify-self: center; }
}

@media (max-width: 420px) {
  .ed-form { grid-template-columns: 1fr; }
  .ed-add-collapsed { flex-wrap: wrap; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .ed-stone-svg,
  .ed-card,
  .ed-del,
  .ed-btn-primary,
  .ed-foot__backup,
  .ed-add-collapsed__cta { transition: none; }
}

/* ═════════════════════════════════════════════════════════════════════════
   ATLAS — v1.1 typographic mapfield
   Ported verbatim from the locked design (v1.1/atlas.css, everything below its
   "ATLAS SECTION" marker). The export-only :root / body / .export-* chrome was
   dropped; v1's tokens and body cascade in. The atlas is a full-column-width
   band (like the masthead) with its own paper grain + hair-rules, so its inner
   28px padding provides the inset rather than the page gutter.
   ═════════════════════════════════════════════════════════════════════════ */

/* Full-bleed within the centred 640px column — mirrors the masthead band. */
.ed-page--v4 > #atlas-mount { padding-left: 0; padding-right: 0; }

/* Empty atlas note — shown when there are no trips yet (mirrors .ed-empty). */
.atlas-empty {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  color: var(--ink-3);
  text-align: center;
  padding: 24px 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}

.atlas {
  position: relative;
  padding: 56px 28px 72px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n3'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.18  0 0 0 0 0.15  0 0 0 0 0.11  0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n3)' opacity='0.55'/%3E%3C/svg%3E");
  background-blend-mode: multiply;
  color: var(--ink);
  font-family: var(--sans);
}
.atlas *, .atlas *::before, .atlas *::after { box-sizing: border-box; }

/* ── header ────────────────────────────────────────────────────────────── */

.atlas__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 36px;
}
.atlas__overline {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ochre);
}
.atlas__title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: "opsz" 48;
}
.atlas__title .stop {
  color: var(--ochre);
  font-style: normal;
  margin-left: 2px;
  font-size: 0.6em;
  vertical-align: 0.18em;
}

/* ── the floating hero ─────────────────────────────────────────────────── */

.atlas__hero-floating {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 36px;
  border-bottom: none;
}
.atlas__hero-floating .atlas__city {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--hero-size, 88px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--ochre);
  font-variation-settings: "opsz" 72;
  text-align: center;
}
.atlas__hero-floating .atlas__country {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 8px;
  letter-spacing: 0;
}
.atlas__hero-phrase {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 14px;
  letter-spacing: 0;
  font-variation-settings: "opsz" 16;
}

/* ── the typographic field ─────────────────────────────────────────────── */

.atlas__field {
  position: relative;
  width: 100%;
  /* Height is set inline per density — sparse 460px, mid 560px, dense 760px. */
}

.atlas__entry {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap;
  line-height: 1;
}
.atlas__city {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--city-size, 30px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-variation-settings: "opsz" 40;
}
.atlas__country {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: var(--tag-size, 11px);
  line-height: 1.15;
  color: var(--ink-3);
  letter-spacing: 0;
  margin-top: 6px;
  font-variation-settings: "opsz" 14;
}
.atlas__country .visits { color: var(--ink-4); }

/* ── home (Singapore) — quietest mark on the page ──────────────────────── */

.atlas__entry.is-home .atlas__city {
  color: var(--ink-3);
  font-weight: 300;
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 16;
}
.atlas__entry.is-home .atlas__country {
  color: var(--ink-4);
  font-weight: 300;
}
.atlas__entry.is-home .atlas__country .home-mark {
  color: var(--ink-3);
}

/* ── dense (40+) ───────────────────────────────────────────────────────── */

.atlas--dense .atlas__entry .atlas__country { margin-top: 4px; }
.atlas--dense .atlas__entry { line-height: 0.94; }

/* ── footer ────────────────────────────────────────────────────────────── */

.atlas__foot {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 12.5px;
  color: var(--ink-3);
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.atlas__foot .right {
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}
