/* Journey Studio — the canonical itinerary workspace.
 *
 * A premium, calm, travel-oriented planning canvas: one chronological
 * timeline with a real time rail, a coordinated sticky map, day tabs, and a
 * quiet Saved panel. Warm Eternal Roam materials (paper, limestone, clay,
 * ink), readable sizes (functional text 15px+, body 16px+), no microtype.
 */

.er-studio-page {
    --st-paper: var(--er-paper, #fbf7ec);
    --st-limestone: var(--er-limestone, #ece5d5);
    --st-ivory: var(--er-ivory, #f6f1e4);
    --st-white: #fffdf7;
    --st-ink: var(--er-ink, #1f1b14);
    --st-ink-2: var(--er-ink-2, #2e2922);
    --st-ink-3: var(--er-ink-3, #453e34);
    --st-clay: var(--er-clay, #b36a45);
    --st-clay-deep: var(--er-clay-deep, #8e4e2e);
    --st-olive: var(--er-olive, #6e724b);
    --st-rule: rgba(31, 27, 20, 0.14);
    --st-rule-soft: rgba(31, 27, 20, 0.08);
    --st-serif: var(--er-serif, "Spectral", Georgia, serif);
    --st-sans: var(--er-sans, "DM Sans", system-ui, sans-serif);
    --st-shadow: 0 1px 2px rgba(31, 27, 20, 0.05), 0 6px 22px -14px rgba(31, 27, 20, 0.28);
    --st-radius: 12px;

    /* Compatibility tokens for the compiler-drawer stylesheet
       (city-journey-compiler.css), which reads the er-journey-* set. */
    --er-journey-paper: var(--st-paper);
    --er-journey-limestone: var(--st-limestone);
    --er-journey-ivory: var(--st-ivory);
    --er-journey-ink: var(--st-ink);
    --er-journey-ink-2: var(--st-ink-2);
    --er-journey-ink-3: var(--st-ink-3);
    --er-journey-ink-4: #8c8472;
    --er-journey-clay: var(--st-clay);
    --er-journey-clay-deep: var(--st-clay-deep);
    --er-journey-olive: var(--st-olive);
    --er-journey-bluegray: #6e7b82;
    --er-journey-rule: var(--st-rule);
    --er-journey-rule-soft: var(--st-rule-soft);
    --er-journey-rule-hair: rgba(31, 27, 20, 0.2);
    --er-journey-serif: var(--st-serif);
    --er-journey-sans: var(--st-sans);
    --er-journey-mono: var(--er-mono, ui-monospace, Menlo, monospace);
    --er-fs-floor: 14px;

    background: var(--st-paper);
    color: var(--st-ink);
    font-family: var(--st-sans);
    font-size: 16px;
    line-height: 1.5;
    min-height: 72vh;
}

.er-studio-page,
.er-studio-page *,
.er-studio-page *::before,
.er-studio-page *::after { box-sizing: border-box; }

/* The hidden attribute always wins, even over display rules below. */
.er-studio-page [hidden] { display: none !important; }

.er-studio {
    width: min(1440px, calc(100% - 64px));
    margin: 0 auto;
    padding: 28px 0 96px;
}

.er-studio-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); clip-path: inset(50%);
    overflow: hidden; white-space: nowrap;
}

.er-studio-noscript {
    width: min(760px, calc(100% - 48px));
    margin: 48px auto;
    font-family: var(--st-sans);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.er-studio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--st-sans);
    font-size: 15.5px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.er-studio-btn--primary {
    background: var(--st-ink);
    color: var(--st-paper);
}
.er-studio-btn--primary:hover { background: var(--st-ink-2); }

.er-studio-btn--ghost {
    background: transparent;
    color: var(--st-ink);
    border-color: rgba(31, 27, 20, 0.35);
}
.er-studio-btn--ghost:hover { border-color: var(--st-ink); background: var(--st-ivory); }

.er-studio-btn--quiet {
    background: transparent;
    color: var(--st-ink-2);
    padding: 8px 12px;
    min-height: 40px;
    border-radius: 8px;
}
.er-studio-btn--quiet:hover { color: var(--st-ink); background: var(--st-ivory); }
.er-studio-btn--danger { color: #8e3b2e; }

.er-studio-page :focus-visible {
    outline: 2px solid var(--st-clay-deep);
    outline-offset: 2px;
    border-radius: 4px;
}

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

.er-studio__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand brand" "main actions";
    align-items: end;
    gap: 6px 24px;
    padding: 6px 0 20px;
    border-bottom: 2px solid var(--st-ink);
}

.er-studio-header__brandline {
    grid-area: brand;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.er-studio-header__eyebrow {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--st-clay-deep);
}

.er-studio-header__account {
    margin: 0;
    font-size: 15px;
    color: var(--st-ink-3);
}
.er-studio-header__account a { color: var(--st-clay-deep); text-decoration: underline; text-underline-offset: 2px; }

.er-studio-header__main { grid-area: main; min-width: 0; }

.er-studio-header__titlewrap {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
}

.er-studio-header__title {
    margin: 0;
    font-family: var(--st-serif);
    font-size: clamp(30px, 3.4vw, 42px);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.01em;
}

.er-studio-header__meta {
    margin: 6px 0 0;
    font-size: 16px;
    color: var(--st-ink-3);
}

.er-studio-header__actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.er-studio-header__menuwrap, .er-studio-header__switch { position: relative; }

/* Popover menus */
.er-studio-menu {
    position: absolute;
    z-index: 60;
    top: calc(100% + 8px);
    right: 0;
    min-width: 250px;
    max-width: 340px;
    background: var(--st-white);
    border: 1px solid var(--st-rule);
    border-radius: var(--st-radius);
    box-shadow: 0 14px 40px -12px rgba(31, 27, 20, 0.35);
    padding: 8px;
}
.er-studio-header__switch .er-studio-menu { left: 0; right: auto; }

.er-studio-menu__item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 8px;
    padding: 11px 12px;
    font-family: var(--st-sans);
    font-size: 15.5px;
    font-weight: 450;
    color: var(--st-ink);
    cursor: pointer;
}
.er-studio-menu__item:hover { background: var(--st-ivory); }
.er-studio-menu__item.is-active { font-weight: 600; color: var(--st-clay-deep); }
.er-studio-menu__item span { color: var(--st-ink-3); font-size: 14.5px; }
.er-studio-menu__rule { height: 1px; background: var(--st-rule-soft); margin: 6px 4px; }
.er-studio-menu__label {
    margin: 8px 12px 4px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--st-ink-3);
}
.er-studio-menu__seg {
    display: flex;
    gap: 4px;
    padding: 0 8px 8px;
}
.er-studio-menu__seg button {
    flex: 1;
    border: 1px solid var(--st-rule);
    background: transparent;
    border-radius: 8px;
    padding: 8px 6px;
    font-family: var(--st-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--st-ink-2);
    cursor: pointer;
}
.er-studio-menu__seg button.is-on {
    background: var(--st-ink);
    border-color: var(--st-ink);
    color: var(--st-paper);
}

.er-studio-popmenu {
    width: min(340px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
}
/* Preference labels never wrap: the menu grows enough for "Kilometers". */
.er-studio-menu--prefs { min-width: 292px; }
.er-studio-menu--prefs .er-studio-menu__seg button { white-space: nowrap; padding: 8px 10px; }

.er-studio-popmenu { position: absolute; }

/* ── Day navigation ──────────────────────────────────────────────────────── */

.er-studio__daynav { margin: 0 0 22px; }

.er-studio-daynav__scroll {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--st-rule);
}
.er-daytabs { display: flex; flex: 1 0 auto; }

.er-daytab {
    appearance: none;
    background: none;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 14px 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 112px;
    cursor: pointer;
    font-family: var(--st-sans);
    color: var(--st-ink-2);
    white-space: nowrap;
}
.er-daytab:hover { color: var(--st-ink); background: var(--st-ivory); }
.er-daytab.is-active {
    color: var(--st-ink);
    border-bottom-color: var(--st-clay-deep);
}
.er-daytab__label { font-size: 17px; font-weight: 600; }
.er-daytab.is-active .er-daytab__label { color: var(--st-clay-deep); }
.er-daytab__sub { font-size: 14.5px; font-weight: 450; }
.er-daytab--unscheduled { margin-left: auto; }
.er-daytab--new { min-width: 108px; color: var(--st-clay-deep); }
.er-studio--dragging .er-daytab { border-radius: 10px 10px 0 0; }
.er-studio--dragging .er-daytab:not(.er-daytab--new)::after {
    content: "Add here";
    font-size: 13px;
    font-weight: 600;
    color: var(--st-clay-deep);
}
.er-daytab.is-drag-target {
    background: var(--st-white);
    box-shadow: inset 0 0 0 2px var(--st-clay-deep);
}

/* ── Mobile view switcher (hidden on desktop) ───────────────────────────── */

.er-studio__views { display: none; }

/* ── Workspace body ──────────────────────────────────────────────────────── */

.er-studio__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(340px, 34vw, 500px);
    grid-template-areas: "plan map" "saved map";
    gap: 12px 36px;
    align-items: start;
}

.er-studio--map-empty .er-studio__body {
    grid-template-columns: minmax(0, 1fr);
}

.er-studio__plan { grid-area: plan; min-width: 0; }
.er-studio__mapcol { grid-area: map; min-width: 0; }
.er-studio__saved { grid-area: saved; min-width: 0; margin-top: 30px; }
.er-studio__tray { grid-area: tray; min-width: 0; }

.er-studio--tray-open .er-studio__body {
    grid-template-columns: minmax(0, 1fr) clamp(370px, 35vw, 480px);
    grid-template-areas: "plan tray" "plan map" "saved saved";
    gap: 20px 32px;
}
.er-studio--tray-open .er-studio__map { height: 260px; }
.er-studio--tray-open .er-studio__mapcard { position: sticky; top: 24px; }

.er-studio--recovery .er-studio__body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "plan";
}

.er-studio-recovery {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 22px;
    padding: 18px 20px;
    border: 1px solid var(--st-line);
    border-left: 3px solid var(--st-clay-deep);
    border-radius: 10px;
    background: var(--st-ivory);
}

.er-studio-recovery h1,
.er-studio-recovery h2,
.er-studio-recovery p { margin: 0; }
.er-studio-recovery h1 { margin-top: 5px; font-family: var(--st-serif); font-size: clamp(28px, 4vw, 42px); }
.er-studio-recovery h2 { font-family: var(--st-serif); font-size: 22px; }
.er-studio-recovery p { margin-top: 5px; color: var(--st-ink-3); }
.er-studio-recovery--full { min-height: 320px; align-items: flex-start; flex-direction: column; justify-content: center; }
.er-studio-recovery__actions { display: flex; flex-wrap: wrap; gap: 9px; }

.er-unsave-confirm {
    flex: 1 0 100%;
    padding-top: 7px;
    color: var(--st-ink-3);
    font-size: 14px;
    line-height: 1.45;
}
/* An open inline confirm takes its own full row under the item instead of
   growing the actions column and crushing the row title beside it. */
.er-saved-row:has(.er-unsave-confirm:not([hidden])) { flex-wrap: wrap; }
.er-saved-row .er-entry__actions:has(.er-unsave-confirm:not([hidden])) { flex: 1 0 100%; }

/* ── Day section ─────────────────────────────────────────────────────────── */

.er-day__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 4px 0 14px;
}

.er-day__title {
    margin: 0;
    font-family: var(--st-serif);
    font-size: 27px;
    font-weight: 600;
    line-height: 1.15;
}

.er-day__meta {
    margin: 4px 0 0;
    font-size: 15.5px;
    color: var(--st-ink-3);
}

.er-day__source {
    margin: 3px 0 0;
    font-size: 13.5px;
    color: var(--st-ink-3);
}
.er-day__source a { color: var(--st-clay-deep); text-decoration: none; }
.er-day__source a:hover { text-decoration: underline; }

.er-day__headactions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.er-day__date {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--st-ink-3);
    border: 1px dashed rgba(31, 27, 20, 0.3);
    border-radius: 999px;
    padding: 8px 16px;
    min-height: 40px;
    cursor: pointer;
}
.er-day__date:hover { color: var(--st-ink); border-color: var(--st-ink); }
.er-day__date input[type="date"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.er-day__advisory {
    margin: 0 0 14px;
    padding: 12px 16px;
    border-left: 3px solid var(--st-clay);
    background: var(--st-ivory);
    border-radius: 0 10px 10px 0;
    font-size: 15px;
    color: var(--st-ink-2);
}
.er-day__conflict {
    margin: 0 0 14px;
    padding: 12px 16px;
    border-left: 3px solid #8e3b2e;
    background: rgba(142, 59, 46, 0.1);
    border-radius: 0 10px 10px 0;
    font-size: 15px;
    color: #7c3324;
    font-weight: 500;
}

/* Times are optional in a pilgrimage day: a quiet affordance, not a warning
   band that repeats down the journey. */
.er-day__noclock {
    margin: 0 0 8px;
    padding: 2px 0 4px;
    font-size: 14px;
    color: var(--st-ink-3);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}
.er-day__noclock .er-entry__act {
    min-height: 0;
    padding: 3px 8px;
    font-size: 14px;
    color: var(--st-clay-deep);
}
.er-day__noclock .er-entry__act:hover { background: var(--st-ivory); }

.er-day__empty {
    margin: 8px 0 18px;
    font-size: 16px;
    color: var(--st-ink-3);
}

.er-day__travel {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 18px;
    padding: 18px 20px;
    border: 1px solid var(--st-rule);
    border-left: 4px solid var(--st-ink);
    border-radius: 0 var(--st-radius) var(--st-radius) 0;
    background: var(--st-white);
    box-shadow: var(--st-shadow);
}
.er-day__travel-kicker {
    margin: 0 0 3px;
    color: var(--st-ink-3);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.er-day__travel h3 { margin: 0; font-family: var(--st-serif); font-size: 22px; }
.er-day__travel p { margin: 5px 0 0; color: var(--st-ink-2); }

.er-day__why {
    margin: 20px 0 0;
    border-top: 1px solid var(--st-rule-soft);
    padding-top: 12px;
}
.er-day__why summary {
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--st-ink-2);
    padding: 6px 0;
}
.er-day__why summary:hover { color: var(--st-ink); }
.er-day__why div { padding: 6px 0 4px; }
.er-day__why ul { margin: 6px 0 12px; padding-left: 20px; }
.er-day__why li { font-size: 15px; color: var(--st-ink-2); margin: 5px 0; }
.er-day__why-label { margin: 10px 0 0; font-size: 14.5px; font-weight: 600; color: var(--st-ink-3); }
.er-day__why p { margin: 6px 0; font-size: 15px; color: var(--st-ink-2); }
.er-day__why-caution { font-size: 14px; color: var(--st-ink-3); }

.er-studio__addday { padding: 18px 0 0 98px; }

/* ── Timeline entries ────────────────────────────────────────────────────── */

.er-day__timeline {
    position: relative;
    padding: 6px 0 10px;
}

.er-entry {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 0 0;
    position: relative;
}

/* The time rail */
.er-entry__time {
    padding: 20px 14px 0 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.er-entry__timerange {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--st-ink);
    white-space: normal;
}
.er-entry__time--needs span {
    font-size: 14px;
    font-weight: 500;
    color: var(--st-clay-deep);
}

.er-entry__body {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 5px 0;
    border-left: 2px solid var(--st-rule-soft);
    padding-left: 18px;
}
.er-entry__body::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 28px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--st-paper);
    border: 2px solid var(--st-ink);
}
.er-entry--personal .er-entry__body::before {
    border-color: var(--st-clay-deep);
    background: var(--st-clay-deep);
    border-radius: 2px;
    transform: rotate(45deg);
    top: 30px;
}
.er-entry--note .er-entry__body::before { border-style: dashed; border-color: var(--st-ink-3); }

.er-entry__grip {
    align-self: center;
    flex: 0 0 auto;
    width: 28px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    border-radius: 6px;
    color: rgba(31, 27, 20, 0.55);
    font-size: 15px;
    cursor: grab;
    touch-action: none;
}
.er-entry__grip:hover { color: var(--st-ink); background: var(--st-ivory); }
.er-entry__grip--lock { cursor: default; color: var(--st-clay-deep); font-size: 13px; }
.er-entry__grip--lock:hover { background: none; }

.er-entry__card {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 14px;
    align-items: center;
    background: var(--st-white);
    border: 1px solid var(--st-rule-soft);
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow);
    padding: 11px 16px;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}
.er-entry:hover .er-entry__card { border-color: var(--st-rule); }
.er-entry.is-highlight .er-entry__card {
    border-color: var(--st-clay);
    box-shadow: 0 0 0 3px rgba(179, 106, 69, 0.22), var(--st-shadow);
}
.er-entry.is-dragging { opacity: 0.45; }
.er-entry.is-dropbefore .er-entry__card { box-shadow: 0 -3px 0 0 var(--st-clay-deep), var(--st-shadow); }

.er-entry--personal .er-entry__card {
    background: var(--st-ivory);
    border-left: 3px solid var(--st-clay);
}
.er-entry--conflict .er-entry__card { border-color: rgba(142, 59, 46, 0.55); }

.er-entry--note .er-entry__card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 8px 4px;
    align-items: center;
}
.er-entry__notetext {
    margin: 0;
    flex: 1;
    font-size: 15.5px;
    font-style: italic;
    color: var(--st-ink-2);
    font-family: var(--st-serif);
}
.er-entry__notemark { color: var(--st-clay-deep); margin-right: 8px; font-style: normal; }

/* Thumb: approved image or designed typed mark. Never a blank box. */
.er-entry-thumb {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 9px;
    overflow: hidden;
    background: var(--st-limestone);
}
.er-entry-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.er-entry-thumb--mark {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #efe7d4, #e3d9c2);
    color: var(--st-clay-deep);
    font-size: 20px;
}
.er-entry-thumb--saint { background: linear-gradient(160deg, #e9e2d9, #d8cfc2); color: var(--st-ink-2); }
.er-entry-thumb--route { background: linear-gradient(160deg, #e8e9dd, #d8dcc6); color: var(--st-olive); }

.er-entry__main { flex: 1; min-width: 0; }

.er-entry__meta {
    margin: 0 0 2px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--st-ink-3);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.er-entry__title {
    margin: 0;
    font-family: var(--st-serif);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.er-entry__titlelink { color: inherit; text-decoration: none; }
.er-entry__titlelink:hover { color: var(--st-clay-deep); text-decoration: underline; text-underline-offset: 3px; }

.er-entry__line {
    margin: 5px 0 0;
    font-size: 15.5px;
    line-height: 1.45;
    color: var(--st-ink-2);
}

.er-entry__warning {
    margin: 7px 0 0;
    font-size: 15px;
    color: #7c4a1e;
}

.er-entry__note {
    margin: 7px 0 0;
    font-family: var(--st-serif);
    font-style: italic;
    font-size: 15.5px;
    color: var(--st-ink-2);
}

.er-entry__actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.er-entry__act {
    background: none;
    border: 0;
    padding: 8px 10px;
    min-height: 40px;
    border-radius: 8px;
    font-family: var(--st-sans);
    font-size: 15px;
    font-weight: 500;
    color: var(--st-ink-2);
    cursor: pointer;
    white-space: nowrap;
}
.er-entry__act:hover { color: var(--st-ink); background: var(--st-ivory); }
.er-entry__act--quiet { color: var(--st-ink-3); }

/* Badges: readable pills, never microtype. */
.er-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}
.er-badge--fixed { background: rgba(179, 106, 69, 0.16); color: var(--st-clay-deep); }
.er-badge--essential { background: rgba(110, 114, 75, 0.16); color: #555a34; }
.er-badge--needs { background: rgba(31, 27, 20, 0.08); color: var(--st-ink-2); }
.er-badge--conflict { background: rgba(142, 59, 46, 0.14); color: #8e3b2e; }
.er-badge--suggested { background: rgba(110, 123, 130, 0.15); color: #4d5a61; }
.er-badge--in { background: rgba(110, 114, 75, 0.16); color: #555a34; }
.er-badge--kept { background: rgba(179, 106, 69, 0.12); color: var(--st-clay-deep); }

/* First-use working set: one clear action pair above the ready-to-plan rows. */
.er-firstuse__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

/* Compact library rows for places already active in this journey: the full
   card lives in the plan, never twice. */
.er-saved-row--compact { padding: 8px 0; align-items: center; flex-wrap: wrap; }
.er-saved-row--compact .er-saved-row__title { font-size: 15.5px; margin: 0; }
.er-saved-row--compact .er-badge { margin-left: 10px; }
.er-saved-row--compact .er-entry__actions {
    flex: 1 0 100%;
    justify-content: flex-start;
    align-items: center;
}
.er-saved__grouplabel {
    margin: 14px 0 4px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--st-ink-3);
}

/* Visit length chooser */
.er-visitlen__label { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--st-ink); }
.er-visitlen fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.er-visitlen__place { margin: 0 0 10px; font-family: var(--st-serif); font-size: 18px; }
.er-visitlen__opts { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 8px; }
.er-visitlen__opt {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--st-rule);
    border-radius: 9px;
    padding: 0;
    min-height: 44px;
    font-size: 14.5px;
    color: var(--st-ink-2);
    cursor: pointer;
    overflow: hidden;
}
.er-visitlen__opt span { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 8px 12px; }
.er-visitlen__opt strong { font-weight: 650; white-space: nowrap; }
.er-visitlen__opt:has(input:checked) { border-color: var(--st-ink); background: var(--st-ink); color: var(--st-paper); font-weight: 600; }
.er-visitlen__opt input { position: absolute; opacity: 0; pointer-events: none; }
.er-visitlen__opt--suggested { border-color: rgba(142, 78, 46, 0.45); }

/* Entries without a time cell (unscheduled, no-clock days) span full width. */
.er-entry--unscheduled,
.er-entry:not(:has(.er-entry__time)) { grid-template-columns: minmax(0, 1fr); }
.er-entry--unscheduled .er-entry__body { border-left: 0; padding-left: 0; }
.er-entry--unscheduled .er-entry__body::before { display: none; }

/* Transition between stops */
.er-transition {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
}
.er-transition__line { display: none; }
.er-transition__label { /* sized below */
    grid-column: 2;
    margin-left: 18px;
    border-left: 2px dashed var(--st-rule);
    padding: 7px 0 7px 26px;
    font-size: 15px;
    font-weight: 500;
    color: var(--st-ink-3);
}

/* ── Inline forms (personal stop, add-saved, notes, trip name) ──────────── */

.er-personal-form, .er-addsaved {
    background: var(--st-white);
    border: 1px solid var(--st-rule);
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow);
    padding: 20px 22px;
    margin: 0 0 20px;
}
.er-studio__personal-host[hidden] { display: none; }
.er-studio__personal-host { margin: 18px 0 0; }
.er-personal-form__eyebrow {
    margin: 0 0 4px;
    color: var(--st-clay-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.er-personal-form__title {
    margin: 0 0 14px;
    font-family: var(--st-serif);
    font-size: 21px;
    font-weight: 600;
}

.er-personal-form__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px 18px;
}

.er-personal-form__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.er-personal-form__field--wide { grid-column: 1 / -1; }
.er-personal-form__field > span {
    font-size: 15px;
    font-weight: 600;
    color: var(--st-ink-2);
}
.er-personal-form__field > span em { font-style: normal; font-weight: 400; color: var(--st-ink-3); }
.er-personal-form__field input[type="text"],
.er-personal-form__field input[type="time"],
.er-personal-form__field input[type="date"],
.er-personal-form__field input[type="number"],
.er-personal-form__field input[type="url"],
.er-personal-form__field textarea,
.er-personal-form__field select {
    font-family: var(--st-sans);
    font-size: 16px;
    color: var(--st-ink);
    background: var(--st-paper);
    border: 1px solid var(--st-rule);
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 46px;
    width: 100%;
}
.er-personal-form__field textarea { resize: vertical; min-height: 104px; }
.er-personal-form__fieldset {
    margin: 16px 0 0;
    padding: 16px;
    border: 1px solid var(--st-rule-soft);
    border-radius: 10px;
}
.er-personal-form__fieldset legend { padding: 0 6px; font-weight: 700; color: var(--st-ink-2); }
.er-personal-form__fieldset legend span { font-weight: 400; color: var(--st-ink-3); }
.er-personal-form__details { margin-top: 14px; color: var(--st-ink-2); }
.er-personal-form__details summary { cursor: pointer; font-weight: 650; }
.er-personal-form__details > p { margin: 8px 0; color: var(--st-ink-3); font-size: 14px; }
.er-personal-form__details .er-personal-form__grid { margin-top: 12px; }
.er-personal-form__field--check { justify-content: center; grid-column: 1 / -1; }
.er-personal-form__checkline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15.5px;
    color: var(--st-ink-2);
}
.er-personal-form__checkline input { width: 20px; height: 20px; accent-color: var(--st-clay-deep); }

.er-personal-form__error {
    margin: 12px 0 0;
    font-size: 15px;
    font-weight: 500;
    color: #8e3b2e;
}
.er-personal-form__privacy {
    margin: 12px 0 0;
    font-size: 14.5px;
    color: var(--st-ink-3);
}
.er-personal-form__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.er-addsaved__row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--st-rule-soft);
    padding: 12px 8px;
    font-family: var(--st-sans);
    cursor: pointer;
    border-radius: 8px;
}
.er-addsaved__row:hover { background: var(--st-ivory); }
.er-addsaved__row strong { font-size: 16.5px; font-weight: 600; color: var(--st-ink); }
.er-addsaved__row span { font-size: 15px; color: var(--st-ink-2); }

.er-noteform label { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.er-noteform label span { font-size: 15px; font-weight: 600; color: var(--st-ink-2); }
.er-noteform input {
    font-size: 16px;
    padding: 10px 12px;
    border: 1px solid var(--st-rule);
    border-radius: 8px;
    background: var(--st-paper);
    min-height: 46px;
}
.er-noteform div { display: flex; gap: 8px; }

/* ── Map column ──────────────────────────────────────────────────────────── */

.er-studio__mapcard {
    position: sticky;
    top: 24px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--st-rule);
    background: var(--st-white);
    box-shadow: var(--st-shadow);
}

.er-studio__map {
    width: 100%;
    height: clamp(360px, calc(100vh - 250px), 560px);
    background: var(--st-limestone);
    z-index: 1;
}

.er-studio__map-note {
    margin: 0;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--st-ink-2);
    border-top: 1px solid var(--st-rule-soft);
    background: var(--st-white);
}

.er-map-pinwrap { background: none; border: 0; }
.er-map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--st-ink, #1f1b14);
    color: #fbf7ec;
    font-family: var(--st-sans, system-ui);
    font-size: 14px;
    font-weight: 700;
    border: 2px solid #fbf7ec;
    box-shadow: 0 2px 8px rgba(31, 27, 20, 0.4);
}
.er-map-pin--fixed, .er-map-pin--personal {
    background: var(--st-clay-deep, #8e4e2e);
    border-radius: 6px;
}
.er-map-pin--stay { background: var(--st-ink-2); border-radius: 50% 50% 50% 6px; transform: rotate(-45deg); }
.er-map-pin--stay > span { transform: rotate(45deg); }
.er-map-pin--shared { box-shadow: 0 0 0 4px rgba(142, 78, 46, 0.2), 0 2px 8px rgba(31, 27, 20, 0.4); }
.er-map-pin--preview { background: var(--st-clay-deep, #8e4e2e); box-shadow: 0 0 0 5px rgba(179, 106, 69, 0.22), 0 2px 8px rgba(31, 27, 20, 0.4); }
.er-map-pinwrap.is-preview .er-map-pin { box-shadow: 0 0 0 6px rgba(179, 106, 69, 0.3), 0 2px 8px rgba(31, 27, 20, 0.4); transform: scale(1.08); }

/* ── Direct Saved planning tray ─────────────────────────────────────────── */

.er-tray__scrim { display: none; }
.er-tray__sheet {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    max-height: min(760px, calc(100vh - 40px));
    min-height: 520px;
    background: var(--st-white);
    border: 1px solid var(--st-rule);
    border-radius: 16px;
    box-shadow: var(--st-shadow);
    overflow: hidden;
}
.er-tray__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 20px 14px; border-bottom: 1px solid var(--st-rule-soft); }
.er-tray__eyebrow { margin: 0 0 2px; color: var(--st-clay-deep); font-size: 13px; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; }
.er-tray__head h2 { margin: 0; font-family: var(--st-serif); font-size: 26px; line-height: 1.15; }
.er-tray__head p:last-child { margin: 4px 0 0; color: var(--st-ink-3); font-size: 15px; }
.er-tray__controls { padding: 13px 16px 10px; border-bottom: 1px solid var(--st-rule-soft); }
.er-tray-search input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--st-rule); border-radius: 9px; background: var(--st-paper); color: var(--st-ink); font: 16px var(--st-sans); }
.er-tray-filters { display: flex; gap: 5px; overflow-x: auto; padding-top: 9px; }
.er-tray-filters button { flex: 0 0 auto; min-height: 40px; padding: 7px 11px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--st-ink-3); font: 500 14.5px var(--st-sans); cursor: pointer; }
.er-tray-filters button:hover { background: var(--st-ivory); color: var(--st-ink); }
.er-tray-filters button.is-active { background: var(--st-ink); color: var(--st-paper); }
.er-tray-filters button:disabled { opacity: 0.45; cursor: not-allowed; }
.er-tray__preview { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; margin: 12px 16px 0; padding: 13px; border: 1px solid rgba(179, 106, 69, 0.3); border-radius: 12px; background: var(--st-ivory); }
.er-tray-preview__thumb { width: 96px; height: 96px; }
.er-tray-preview__main h3 { margin: 1px 28px 4px 0; font-family: var(--st-serif); font-size: 20px; line-height: 1.2; }
.er-tray-preview__address, .er-tray-preview__facts, .er-tray-preview__line { margin: 3px 0; font-size: 14px; color: var(--st-ink-2); }
.er-tray-preview__line { margin-top: 7px; font-family: var(--st-serif); font-style: italic; }
.er-tray-preview__close { position: absolute; top: 5px; right: 7px; width: 36px; height: 36px; border: 0; background: transparent; color: var(--st-ink-3); font-size: 24px; cursor: pointer; }
.er-tray__notice { margin: 10px 16px 0; padding: 12px; border-left: 3px solid var(--st-clay-deep); border-radius: 0 9px 9px 0; background: var(--st-ivory); color: var(--st-ink-2); font-size: 14.5px; }
.er-tray__notice p { margin: 4px 0 8px; }
.er-tray__notice div { display: flex; gap: 6px; flex-wrap: wrap; }
.er-tray__list { flex: 1; min-height: 160px; overflow-y: auto; padding: 4px 16px 14px; }
.er-tray-row { position: relative; display: grid; grid-template-columns: 30px 58px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--st-rule-soft); }
.er-tray-row[draggable="true"] { cursor: grab; }
.er-tray-row.is-selected { background: linear-gradient(90deg, rgba(179, 106, 69, 0.1), transparent 80%); }
.er-tray-row.is-dragging { opacity: 0.45; }
.er-tray-row__check { display: flex; align-items: center; justify-content: center; width: 30px; min-height: 44px; }
.er-tray-row__check input { width: 20px; height: 20px; accent-color: var(--st-clay-deep); }
.er-tray-row__thumb { width: 58px; height: 58px; }
.er-tray-row__main { min-width: 0; }
.er-tray-row__main h3 { margin: 1px 0; font-family: var(--st-serif); font-size: 17.5px; line-height: 1.22; overflow-wrap: anywhere; }
.er-tray-row__state, .er-tray-row__reason { margin: 2px 0 0; color: var(--st-ink-3); font-size: 13.5px; }
.er-tray-row__reason { color: #765445; }
.er-tray-row__actions { grid-column: 2 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 6px; position: relative; }
.er-tray-row__add { min-height: 40px; padding: 8px 13px; font-size: 14px; }
.er-tray-addmenu { right: 0; top: calc(100% + 4px); }
/* The saved-places drawer owns the screen while it is open: site-level
   floating controls must not overlap it or its buttons. */
body.er-studio-tray-open .er-feedback-tab,
body.er-studio-tray-open #backToTop { display: none !important; }

/* A stop already scheduled on the day being added to: shown, never actionable. */
.er-tray-row.is-on-day { opacity: 0.72; }
.er-tray-row__done {
    display: inline-flex; align-items: center; min-height: 40px; padding: 8px 13px;
    color: var(--st-ink-3); font: 500 14px var(--st-sans); font-style: italic;
}
/* A deliberately-opened preview stays a compact, self-contained region above
   the scrolling list; it never grows tall enough to bury the results. */
.er-tray__preview { max-height: 40vh; overflow-y: auto; }

.er-tray__foot { flex: 0 0 auto; padding: 13px 16px 16px; border-top: 1px solid var(--st-rule); background: var(--st-white); }
.er-tray__foot p { margin: 0 0 8px; color: var(--st-ink-3); font-size: 14.5px; }
.er-tray__foot div { display: flex; gap: 7px; flex-wrap: wrap; }
.er-tray__foot .er-studio-btn { min-height: 42px; padding: 8px 13px; font-size: 14.5px; }

/* ── Unified Add sources (Saved Ideas · Eternal Roam · Places & addresses) ── */
.er-tray__sources { flex: 0 0 auto; display: flex; gap: 4px; padding: 10px 16px 0; overflow-x: auto; }
.er-tray__source { flex: 0 0 auto; min-height: 40px; padding: 8px 13px; border: 1px solid var(--st-rule-soft); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--st-paper); color: var(--st-ink-3); font: 600 14px var(--st-sans); cursor: pointer; }
.er-tray__source:hover { color: var(--st-ink); }
.er-tray__source.is-active { background: var(--st-white); color: var(--st-ink); border-color: var(--st-rule); box-shadow: 0 -1px 0 var(--st-clay-deep) inset; }
.er-tray__source:focus-visible { outline: 2px solid var(--st-clay-deep); outline-offset: 2px; }

.er-tray-remote__form { display: flex; gap: 7px; align-items: stretch; }
.er-tray-search--remote { flex: 1 1 auto; }
.er-tray-remote__go { flex: 0 0 auto; min-height: 44px; padding: 8px 16px; }
.er-tray-remote__hint { margin: 8px 0 0; color: var(--st-ink-3); font-size: 13.5px; }
.er-tray-remote__attr { margin: 12px 0 2px; color: var(--st-ink-4, #8c8472); font-size: 12.5px; }
.er-tray-remote__manual { margin: 0; color: var(--st-ink-3); font-size: 14px; }

.er-tray-row--remote { grid-template-columns: 58px minmax(0, 1fr); }
.er-tray-row--remote.er-tray-row--external { grid-template-columns: 22px minmax(0, 1fr); }
.er-tray-row__addr { margin: 3px 0 0; color: var(--st-ink-3); font-size: 13px; overflow-wrap: anywhere; }
.er-tray-row__ext { align-self: start; width: 14px; height: 14px; margin-top: 6px; border-radius: 50% 50% 50% 3px; background: var(--st-clay-deep); transform: rotate(-45deg); }
.er-tray-row__extbadge { display: inline-block; padding: 1px 7px; border-radius: 999px; background: rgba(142, 78, 46, 0.12); color: var(--st-clay-deep); font-weight: 650; font-size: 11.5px; letter-spacing: 0.02em; }

/* In-form geocoder (Find this place) */
.er-geo { margin: 0 0 10px; padding: 12px; border: 1px solid rgba(179, 106, 69, 0.28); border-radius: 11px; background: var(--st-ivory); }
.er-geo__row { display: flex; gap: 7px; }
.er-geo__row input { flex: 1 1 auto; min-height: 44px; padding: 9px 12px; border: 1px solid var(--st-rule); border-radius: 9px; background: var(--st-paper); color: var(--st-ink); font: 16px var(--st-sans); }
.er-geo__go { flex: 0 0 auto; min-height: 44px; }
.er-geo__results { margin-top: 9px; display: flex; flex-direction: column; gap: 5px; max-height: 230px; overflow-y: auto; }
.er-geo__result { display: flex; flex-direction: column; gap: 1px; text-align: left; padding: 9px 11px; border: 1px solid var(--st-rule-soft); border-radius: 9px; background: var(--st-white); color: var(--st-ink); cursor: pointer; }
.er-geo__result:hover, .er-geo__result:focus-visible { border-color: var(--st-clay-deep); background: var(--st-paper); }
.er-geo__result strong { font: 600 15px var(--st-sans); }
.er-geo__result span { color: var(--st-ink-3); font-size: 13px; }
.er-geo__result em { color: var(--st-ink-4, #8c8472); font-size: 12px; font-style: normal; }
.er-geo__note { margin: 8px 0 0; color: var(--st-ink-3); font-size: 13.5px; }
.er-geo__attr { margin: 8px 0 0; color: var(--st-ink-4, #8c8472); font-size: 12px; }
.er-geo__picked { margin: 8px 0 0; color: var(--st-clay-deep); font-size: 13.5px; font-weight: 550; }

.er-studio-undo { position: fixed; left: 50%; bottom: 22px; z-index: 1200; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; max-width: min(620px, calc(100% - 28px)); padding: 12px 14px 12px 18px; border-radius: 12px; background: var(--st-ink); color: var(--st-paper); box-shadow: 0 16px 45px rgba(31, 27, 20, 0.35); font-size: 15px; }
.er-studio-undo button { min-height: 40px; padding: 6px 11px; border: 1px solid rgba(255,255,255,0.45); border-radius: 8px; background: transparent; color: inherit; font: 650 15px var(--st-sans); cursor: pointer; }

.er-saved-more { position: relative; }
.er-saved-more summary { min-height: 40px; display: inline-flex; align-items: center; padding: 7px 10px; border-radius: 7px; color: var(--st-ink-3); font-size: 14px; cursor: pointer; list-style: none; }
.er-saved-more summary::-webkit-details-marker { display: none; }
.er-saved-more[open] > div { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: flex; flex-direction: column; align-items: stretch; min-width: 190px; padding: 7px; border: 1px solid var(--st-rule); border-radius: 10px; background: var(--st-white); box-shadow: var(--st-shadow); }
.er-saved-more[open] > div .er-entry__act { text-align: left; }

/* ── Saved panel ─────────────────────────────────────────────────────────── */

.er-studio__saved {
    border-top: 2px solid var(--st-ink);
    padding-top: 18px;
}

.er-saved__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.er-saved__title {
    margin: 0;
    font-family: var(--st-serif);
    font-size: 24px;
    font-weight: 600;
}

.er-saved__tabs { display: flex; gap: 4px; }

.er-saved-tab {
    background: none;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 8px 16px;
    min-height: 40px;
    font-family: var(--st-sans);
    font-size: 15px;
    font-weight: 500;
    color: var(--st-ink-3);
    cursor: pointer;
}
.er-saved-tab:hover { color: var(--st-ink); background: var(--st-ivory); }
.er-saved-tab.is-active {
    background: var(--st-ink);
    color: var(--st-paper);
}
.er-saved-tab span { opacity: 0.75; margin-left: 2px; }

.er-saved-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 6px;
    border-bottom: 1px solid var(--st-rule-soft);
}
.er-saved-row__thumb { width: 60px; height: 60px; }
.er-saved-row__main { flex: 1; min-width: 0; }
.er-saved-row__title {
    margin: 2px 0 0;
    font-family: var(--st-serif);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.er-saved-row__title a { color: inherit; text-decoration: none; }
.er-saved-row__title a:hover { color: var(--st-clay-deep); text-decoration: underline; text-underline-offset: 3px; }
.er-saved-row .er-entry__actions { flex-direction: row; flex-wrap: wrap; }

.er-saved__foot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0 0;
    font-size: 15px;
    color: var(--st-ink-3);
}
.er-saved__foot [data-clear-confirm] { display: inline-flex; align-items: center; gap: 6px; }

.er-studio__fineprint {
    margin: 34px 0 0;
    font-family: var(--st-serif);
    font-style: italic;
    font-size: 15px;
    color: var(--st-ink-3);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.er-studio--empty .er-studio__body,
.er-studio--empty .er-studio__daynav,
.er-studio--empty .er-studio__views,
.er-studio--empty .er-studio__saved { display: none; }

.er-studio-empty {
    max-width: 720px;
    padding: 48px 0 24px;
}
.er-studio-empty__eyebrow {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--st-clay-deep);
}
.er-studio-empty__title {
    margin: 0 0 16px;
    font-family: var(--st-serif);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 600;
    line-height: 1.15;
}
.er-studio-empty__title em { font-style: italic; color: var(--st-clay-deep); }
.er-studio-empty__body {
    margin: 0 0 26px;
    font-size: 17.5px;
    line-height: 1.6;
    color: var(--st-ink-2);
    max-width: 56ch;
}
.er-studio-empty__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Planner drawer ──────────────────────────────────────────────────────── */

.er-studio__planner {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
}
.er-studio__planner-scrim {
    position: absolute;
    inset: 0;
    background: rgba(31, 27, 20, 0.45);
}
.er-studio__planner-sheet {
    position: relative;
    width: min(760px, 100%);
    height: 100%;
    overflow-y: auto;
    background: var(--st-paper);
    box-shadow: -18px 0 50px -20px rgba(31, 27, 20, 0.5);
    padding: 22px clamp(20px, 4vw, 44px) 60px;
}
.er-studio__planner-close {
    position: sticky;
    top: 0;
    margin-left: auto;
    display: flex;
    z-index: 5;
    background: var(--st-ink);
    color: var(--st-paper);
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    min-height: 44px;
    font-family: var(--st-sans);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}
body.er-studio-planner-open { overflow: hidden; }

/* Compiler form inside the drawer inherits the studio look. */
.er-studio__planner .er-city-compiler__city { background: transparent; border: 0; padding: 0; }

/* ── Leaflet chrome harmonization ───────────────────────────────────────── */

.er-studio__map .leaflet-control-zoom a {
    color: var(--st-ink);
    background: var(--st-white);
    border-color: var(--st-rule);
}
.er-studio__map .leaflet-popup-content-wrapper {
    background: var(--st-white);
    color: var(--st-ink);
    border-radius: 10px;
    font-family: var(--st-sans);
    font-size: 15px;
}

.er-studio__map .leaflet-popup-content { margin: 0; }
.er-map-popup { display: grid; grid-template-columns: 88px minmax(0, 1fr); width: min(320px, calc(100vw - 64px)); color: var(--st-ink); }
.er-map-popup--text { grid-template-columns: minmax(0, 1fr); }
.er-map-popup__image { width: 88px; height: 100%; min-height: 116px; object-fit: cover; border-radius: 9px 0 0 9px; }
.er-map-popup__body { min-width: 0; padding: 14px; }
.er-map-popup__type { margin: 0 0 4px; color: var(--st-clay-deep); font-size: 13px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.er-map-popup__title { margin: 0; font-family: var(--st-serif); font-size: 20px; line-height: 1.18; overflow-wrap: anywhere; }
.er-map-popup__place,
.er-map-popup__summary,
.er-map-popup__status { margin: 6px 0 0; font-size: 15px; line-height: 1.42; color: var(--st-ink-2); overflow-wrap: anywhere; }
.er-map-popup__status { color: var(--st-clay-deep); font-weight: 600; }
.er-map-popup__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.er-map-popup__action { min-height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--st-clay-deep); border-radius: 8px; padding: 8px 10px; background: var(--st-clay-deep); color: var(--st-white); font: 600 15px/1.2 var(--st-sans); text-decoration: none; cursor: pointer; }
.er-map-popup__action--quiet { background: transparent; color: var(--st-ink-2); border-color: var(--st-rule); }
.er-map-popup__action:focus-visible { outline: 3px solid rgba(142, 78, 46, .35); outline-offset: 2px; }
.er-map-popup__rule { margin: 0; border: 0; border-top: 1px solid var(--st-rule); }
.er-map-pin--unscheduled { background: var(--st-white); color: var(--st-clay-deep); border: 2px dashed var(--st-clay-deep); }
.er-map-pin--scheduled { background: var(--st-clay-deep); color: var(--st-white); }

@media (max-width: 480px) {
    .er-map-popup { grid-template-columns: minmax(0, 1fr); width: min(280px, calc(100vw - 56px)); }
    .er-map-popup__image { width: 100%; height: 104px; min-height: 0; border-radius: 9px 9px 0 0; }
}

/* ── Responsive: tablet and mobile ───────────────────────────────────────── */

@media (max-width: 1100px) {
    .er-studio { width: min(1440px, calc(100% - 40px)); }
    .er-studio__body { grid-template-columns: minmax(0, 1fr) clamp(300px, 38vw, 420px); gap: 12px 24px; }
}

@media (max-width: 900px) {
    .er-studio { width: calc(100% - 32px); padding-top: 18px; }
    .er-studio-recovery { align-items: flex-start; flex-direction: column; }

    .er-studio__header {
        grid-template-columns: 1fr;
        grid-template-areas: "brand" "main" "actions";
        align-items: start;
    }
    .er-studio-header__actions { justify-content: flex-start; }
    .er-studio-header__menuwrap .er-studio-menu--prefs { left: 0; right: auto; }

    /* Plan / Map / Saved switcher */
    .er-studio__views {
        display: flex;
        gap: 6px;
        position: sticky;
        top: 0;
        z-index: 50;
        background: var(--st-paper);
        padding: 10px 0;
        margin: 0 0 6px;
        border-bottom: 1px solid var(--st-rule-soft);
    }
    .er-studio__views button {
        flex: 1;
        min-height: 46px;
        border: 1px solid var(--st-rule);
        background: var(--st-white);
        border-radius: 10px;
        font-family: var(--st-sans);
        font-size: 16px;
        font-weight: 500;
        color: var(--st-ink-2);
        cursor: pointer;
    }
    .er-studio__views button[aria-selected="true"] {
        background: var(--st-ink);
        border-color: var(--st-ink);
        color: var(--st-paper);
        font-weight: 600;
    }

    .er-studio__body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "plan" "map" "saved"; }

    /* One panel at a time on mobile. */
    .er-studio--view-plan .er-studio__mapcol,
    .er-studio--view-plan .er-studio__saved { display: none; }
    .er-studio--view-map .er-studio__plan,
    .er-studio--view-map .er-studio__saved { display: none; }
    .er-studio--view-saved .er-studio__plan,
    .er-studio--view-saved .er-studio__mapcol { display: none; }

    .er-studio__saved { margin-top: 8px; border-top: 0; }
    .er-studio__mapcard { position: static; }
    .er-studio__map { height: min(66vh, 560px); }

    /* Timeline compacts: the time moves above the card. */
    .er-entry { grid-template-columns: minmax(0, 1fr); }
    .er-entry__time { text-align: left; padding: 12px 0 2px 40px; }
    .er-entry__timerange { display: inline; font-size: 15.5px; }
    .er-entry__body { border-left: 0; padding-left: 0; }
    .er-entry__body::before { display: none; }
    .er-entry__card { padding: 14px; gap: 12px; flex-wrap: wrap; }
    .er-entry-thumb { width: 62px; height: 62px; }
    .er-entry__title { font-size: 19px; }
    .er-entry__actions { flex-direction: row; width: 100%; justify-content: flex-end; gap: 6px; }
    /* Scheduled rows carry one options control: pin it to the card corner so a
       one-line commitment does not spend a whole row on it. Unscheduled rows
       keep the full-width action row for their multiple actions. */
    .er-entry:not(.er-entry--unscheduled) .er-entry__card { position: relative; padding-right: 50px; }
    .er-entry:not(.er-entry--unscheduled) .er-entry__actions { position: absolute; top: 6px; right: 6px; width: auto; }
    .er-entry__grip { align-self: flex-start; margin-top: 10px; }

    .er-transition { grid-template-columns: minmax(0, 1fr); }
    .er-transition__label { grid-column: 1; border-left: 0; margin-left: 40px; padding-left: 0; }

    .er-day__head { flex-direction: column; align-items: flex-start; }
    .er-studio__addday { padding-left: 0; }

    .er-saved__head { flex-direction: column; align-items: flex-start; }
    .er-saved-row { flex-wrap: wrap; }
    .er-saved-row .er-entry__actions { width: 100%; justify-content: flex-end; }

    .er-studio__planner-sheet { width: 100%; }

    body.er-studio-tray-open { overflow: hidden; }
    .er-studio__tray { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: flex-end; }
    .er-tray__scrim { display: block; position: absolute; inset: 0; background: rgba(31, 27, 20, 0.46); }
    .er-tray__sheet { position: relative; top: auto; width: 100%; height: min(92dvh, 820px); max-height: none; min-height: 0; border-radius: 18px 18px 0 0; border-bottom: 0; }
    .er-studio--tray-open .er-studio__body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "plan" "map" "saved"; }
    .er-studio--tray-open .er-studio__map { height: min(66vh, 560px); }
}

@media (max-width: 480px) {
    .er-studio { width: calc(100% - 24px); }
    .er-studio-header__title { font-size: 28px; }
    .er-daytab { min-width: 96px; padding: 12px 12px 10px; }
    .er-entry__card { padding: 12px; }
    .er-personal-form, .er-addsaved { padding: 16px; }
    .er-tray__head { padding: 15px 14px 11px; }
    .er-tray__controls { padding-inline: 12px; }
    .er-tray__list { padding-inline: 12px; }
    .er-tray__preview { margin-inline: 12px; grid-template-columns: 72px minmax(0, 1fr); }
    .er-tray-preview__thumb { width: 72px; height: 72px; }
    .er-tray-row { grid-template-columns: 28px 52px minmax(0, 1fr); gap: 8px; }
    .er-tray-row__thumb { width: 52px; height: 52px; }
    .er-tray-row__actions { grid-column: 1 / -1; }
    .er-tray__foot { padding: 10px 12px 12px; }
    .er-tray__foot div { display: grid; grid-template-columns: 1fr 1fr; }
    .er-tray__foot .er-studio-btn--primary { grid-column: 1 / -1; }
    .er-visitlen__opts { display: grid; grid-template-columns: 1fr 1fr; }
    .er-visitlen__opt span { width: 100%; justify-content: center; text-align: center; }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .er-studio-page *, .er-studio-page *::before, .er-studio-page *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}

/* ── Print: Compact Schedule & Pilgrim Guide ─────────────────────────────── */

#er-studio-print { display: none; }

@media print {
    body > *:not(#er-studio-print) { display: none !important; }
    #er-studio-print { display: block !important; }

    #er-studio-print .er-print {
        font-family: Georgia, "Times New Roman", serif;
        color: #000;
        font-size: 12pt;
        line-height: 1.45;
    }

    .er-print-head { border-bottom: 2pt solid #000; padding-bottom: 8pt; margin-bottom: 14pt; }
    .er-print-brand {
        margin: 0 0 4pt;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 9pt;
        letter-spacing: 0.16em;
        text-transform: uppercase;
    }
    .er-print-head h1 { margin: 0; font-size: 22pt; font-weight: 600; }
    .er-print-sub { margin: 3pt 0 0; font-size: 12pt; color: #333; }

    .er-print-day { margin: 0 0 14pt; break-inside: auto; }
    .er-print-day h3 {
        font-family: Helvetica, Arial, sans-serif;
        font-size: 12pt;
        border-bottom: 1pt solid #000;
        padding-bottom: 3pt;
        margin: 12pt 0 6pt;
        break-after: avoid;
    }

    .er-print-entry {
        display: flex;
        gap: 10pt;
        padding: 6pt 0;
        border-bottom: 0.5pt solid #bbb;
        break-inside: avoid;
    }
    .er-print-entry__time {
        flex: 0 0 82pt;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 10pt;
        font-weight: 700;
    }
    .er-print-entry__time span { display: block; font-weight: 400; color: #444; }
    .er-print-entry__img {
        width: 52pt;
        height: 52pt;
        object-fit: cover;
        border-radius: 4pt;
    }
    .er-print-entry__main { flex: 1; min-width: 0; }
    .er-print-entry__kicker {
        margin: 0;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 8.5pt;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: #555;
    }
    .er-print-entry__main h4 { margin: 1pt 0 2pt; font-size: 13pt; font-weight: 600; }
    .er-print-entry__addr { margin: 0; font-size: 10.5pt; color: #333; }
    .er-print-entry__line { margin: 3pt 0 0; font-size: 11pt; font-style: italic; }
    .er-print-entry__warn { margin: 3pt 0 0; font-size: 10pt; color: #333; }
    .er-print-entry__note { margin: 3pt 0 0; font-size: 10.5pt; }
    .er-print-entry__trans {
        margin: 3pt 0 0;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 9pt;
        color: #555;
    }
    .er-print-entry--fixed { border-left: 3pt solid #000; padding-left: 6pt; }
    .er-print-entry--note p { margin: 0; font-style: italic; }

    .er-print-unsched p { margin: 3pt 0; font-size: 11pt; }
    .er-print-cautions { margin-top: 12pt; break-inside: avoid; }
    .er-print-cautions h3 { font-family: Helvetica, Arial, sans-serif; font-size: 11pt; margin: 0 0 4pt; }
    .er-print-cautions ul { margin: 0; padding-left: 14pt; }
    .er-print-cautions li { font-size: 10.5pt; margin: 2pt 0; }

    .er-print-foot {
        margin-top: 16pt;
        border-top: 0.5pt solid #000;
        padding-top: 6pt;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 9pt;
        color: #444;
        display: flex;
        justify-content: space-between;
        gap: 12pt;
    }
    .er-print-foot p { margin: 0; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Simplification pass 2026-07-17: My Journeys home, one options control per
   row, simplified Add menu, Saved Ideas inside the home view.
   ══════════════════════════════════════════════════════════════════════════ */

.er-studio-header__home {
    background: none;
    border: 0;
    padding: 4px 0;
    font-family: var(--st-sans);
    font-size: 15px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--st-clay-deep);
    cursor: pointer;
}
.er-studio-header__home:hover { text-decoration: underline; text-underline-offset: 3px; }

/* One quiet options control per row. */
.er-entry__act--menu {
    font-size: 19px;
    line-height: 1;
    letter-spacing: 0.08em;
    padding: 6px 12px;
    color: var(--st-ink-3);
}
.er-entry__act--menu:hover { color: var(--st-ink); }
.er-entry__card { padding: 13px 16px; }
.er-entry__actions { flex-direction: row; align-items: center; }

/* Progressive Commitment group inside the Add menu. */
.er-studio-menu__group summary {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: var(--st-sans);
    font-size: 15.5px;
    font-weight: 500;
    color: var(--st-ink-2);
    cursor: pointer;
    list-style: none;
}
.er-studio-menu__group summary::-webkit-details-marker { display: none; }
.er-studio-menu__group summary::after { content: ' ›'; color: var(--st-ink-3); }
.er-studio-menu__group[open] summary::after { content: ' ⌄'; }
.er-studio-menu__group summary:hover { background: var(--st-ivory); }
.er-studio-menu__group > div { padding-left: 10px; }
.er-studio-menu__item--quiet { color: var(--st-ink-3); }
.er-studio-menu--more { min-width: 300px; max-height: min(70vh, 560px); overflow-y: auto; }

/* ── My Journeys home ──────────────────────────────────────────────────── */
.er-studio--home .er-studio__body { display: block; }
.er-studio--home .er-studio__mapcol { display: none; }
.er-home { max-width: 880px; margin: 0 auto; padding: 10px 0 40px; }
.er-home__head { margin: 18px 0 26px; }
.er-home__title {
    font-family: var(--st-serif);
    font-size: clamp(34px, 4.6vw, 46px);
    line-height: 1.08;
    color: var(--st-ink);
    margin: 0 0 10px;
}
.er-home__sub { font-size: 16.5px; color: var(--st-ink-2); max-width: 560px; }
.er-home__notice {
    margin: 0 0 18px;
    padding: 12px 16px;
    border-left: 3px solid var(--st-clay);
    background: var(--st-ivory);
    color: var(--st-ink-2);
}
.er-home__cards { display: grid; gap: 14px; }
.er-home-empty {
    padding: 28px;
    border: 1px dashed var(--st-rule);
    border-radius: var(--st-radius);
    background: rgba(255, 253, 247, 0.45);
}
.er-home-empty h2 { margin: 0 0 6px; font-family: var(--st-serif); font-size: 25px; }
.er-home-empty p { margin: 0; color: var(--st-ink-2); max-width: 560px; }
.er-home-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    background: var(--st-white);
    border: 1px solid var(--st-rule-soft);
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow);
    padding: 18px 22px;
}
.er-home-card__main { min-width: 0; flex: 1 1 420px; }
.er-home-card.is-active { border-left: 3px solid var(--st-clay); }
.er-home-card__title { margin: 0 0 4px; }
.er-home-card__title button {
    background: none;
    border: 0;
    padding: 0;
    font-family: var(--st-serif);
    font-size: 24px;
    font-weight: 600;
    color: var(--st-ink);
    cursor: pointer;
    text-align: left;
    overflow-wrap: anywhere;
}
.er-home-card__title button:hover { color: var(--st-clay-deep); }
.er-home-card__meta { font-size: 15.5px; color: var(--st-ink-2); margin: 0 0 2px; }
.er-home-card__counts { font-size: 15px; line-height: 1.45; color: var(--st-ink-3); margin: 0; }
.er-home-card__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.er-home__newwrap { margin: 0 0 18px; }
.er-home-create {
    margin-top: 14px;
    max-width: 560px;
    padding: 18px;
    border: 1px solid var(--st-rule);
    border-radius: var(--st-radius);
    background: var(--st-white);
    box-shadow: var(--st-shadow);
}
.er-home-create label { display: grid; gap: 7px; font-size: 16px; font-weight: 600; }
.er-home-create input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid rgba(31, 27, 20, 0.3);
    border-radius: 8px;
    background: #fff;
    color: var(--st-ink);
    font: inherit;
    font-size: 16px;
}
.er-home-create > div { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.er-home-create__error { margin: 8px 0 0; color: #8e3b2e; font-size: 15px; }
.er-home__saved { margin-top: 44px; border-top: 1px solid var(--st-rule-soft); padding-top: 26px; }
.er-home__saved-intro { margin: 0 0 14px; color: var(--st-ink-2); font-size: 15.5px; }
.er-home__saved .er-saved__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.er-home__saved .er-saved__title { font-family: var(--st-serif); font-size: 26px; margin: 0; }

@media (max-width: 700px) {
    .er-home-card { padding: 15px 16px; }
    .er-home-card__actions { width: 100%; justify-content: flex-start; }
    .er-home-create { padding: 15px; }
}
