/*
 * Issue #402 (FR-10, D10, design 6.1, 6.4; design 402 section 8, D7, D19) and Community design 6
 * (S1-U1) - the journey STORY's styles, shared by the public pages and the Community view.
 *
 * Every rule here is scoped by .pj-theme, a class on an ancestor: the shell's <body> on every /j
 * page, the Community view's story wrapper inside the Web app. The --pj-* tokens and the body type
 * sit on .pj-theme itself; the element rules (images, links, headings, the focus ring) are under
 * :where(.pj-theme), which adds no specificity, so each keeps (0,0,1) or its own (0,1,1) and every
 * component rule below still wins over it. The focus rule is restated selector by selector, never
 * bare, so no Web app control gains a ring. Linked after app.css in the Web app, before journey.css
 * on /j (journey.css keeps the page globals: the fonts, box-sizing, [hidden], html, the body
 * margin and background, the two scroll locks and reduced motion).
 *
 * Served from /j/assets/css/ with the page's own CSP: style-src 'self', font-src 'self', img-src
 * 'self' plus the CARTO tile host. So: no @import, no url(), nothing a browser would fetch from
 * anywhere else.
 *
 * Colours: the brand tokens come from tokens.css (the one :root block, D19); this file keeps only
 * its --pj-* tokens, which reference them. No copied hex. The map's pins, glows, pop card and the
 * route outline classes are journey-map.css's (D7).
 *
 * Mobile first: one column, readable at 360 px with no sideways scroll, with no sticky map (a still
 * overview, a map per day, one sticky chapter bar); the story beside a sticky map from 1024 px.
 * Without script every part still works: the lightbox and the full-screen map are :target, the
 * numbers a <details>, the maps the server SVG.
 */

.pj-theme {
    /* Text on white at 4.5:1 or better: Earth Green itself is 3.4:1, so text and buttons use its hover shade. */
    --pj-ink: var(--cailo-text-primary);
    --pj-muted: var(--cailo-slate-grey);
    --pj-brand-ink: var(--cailo-primary-hover);
    /* The invite screens' notice and invalid field (S5): 6.5:1 on white; the tint is behind dark text. */
    --pj-error: #b3261e;
    --pj-error-bg: #fdecea;
    /* Form field borders at 3:1 or better against white (WCAG 1.4.11). */
    --pj-field-border: var(--cailo-text-secondary);
    --pj-radius: 12px;
    --pj-font-heading: "Montserrat", "Segoe UI", Arial, sans-serif;
    --pj-font-body: "Open Sans", "Segoe UI", Arial, sans-serif;
    /* The selection and focus accent (D19), kept out of the day colour cycle. */
    --pj-accent: var(--cailo-tertiary-light);
}

.pj-theme {
    color: var(--pj-ink);
    font-family: var(--pj-font-body);
    font-size: 15px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

:where(.pj-theme) :is(img, svg) { max-width: 100%; }

:where(.pj-theme) a { color: var(--pj-brand-ink); }
:where(.pj-theme) a:focus-visible, :where(.pj-theme) button:focus-visible, :where(.pj-theme) summary:focus-visible, :where(.pj-theme) .pj-button:focus-visible { outline: 3px solid var(--cailo-tertiary); outline-offset: 2px; }

:where(.pj-theme) :is(h1, h2, h3) { font-family: var(--pj-font-heading); color: var(--pj-brand-ink); line-height: 1.25; margin: 0; }

.pj-skip {
    position: absolute; left: -9999px; top: 8px;
    background: var(--cailo-white); color: var(--pj-brand-ink); padding: 8px 12px; border-radius: 8px; z-index: 3000;
}
.pj-skip:focus { left: 8px; }

/* ------------------------------------------------------------------ top bar */
.pj-top {
    height: 56px; display: flex; align-items: center; padding: 0 16px;
    background: linear-gradient(90deg, var(--cailo-primary) 0%, var(--cailo-primary-dark) 100%);
}
.pj-top a { display: inline-flex; }
.pj-top img { height: 22px; width: auto; display: block; }

/* ------------------------------------------------------------------ the other pages' column and shared pieces */
.pj-wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 16px; }

.pj-preview-banner {
    margin: 0; padding: 10px 14px; border-radius: 10px;
    background: var(--cailo-warning-light); color: var(--pj-ink); font-weight: 600; font-size: 14px;
}

.pj-card {
    background: var(--cailo-surface); border-radius: var(--pj-radius);
    box-shadow: 0 1px 3px var(--cailo-black-20), 0 2px 8px var(--cailo-shadow-color);
    padding: 16px;
}
.pj-card > h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 12px; }

.pj-footer { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 0; text-align: center; }
.pj-button {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px;
    border-radius: 8px; background: var(--cailo-primary-hover); color: var(--cailo-white);
    font-family: var(--pj-font-heading); font-weight: 600; font-size: 15px; text-decoration: none;
}
.pj-button:hover { background: var(--cailo-primary-dark); }
.pj-button svg { width: 18px; height: 18px; fill: currentColor; }
.pj-button-outlined { background: transparent; color: var(--pj-brand-ink); border: 1px solid var(--pj-brand-ink); }
.pj-button-outlined:hover { background: var(--cailo-primary-05); }
.pj-small { font-size: 12px; color: var(--pj-muted); max-width: 640px; margin: 0; }
.pj-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 13px; margin: 0; }
.pj-links a { color: var(--pj-muted); }

/* ================================================================== the journey page (design 402 8.2; UX rework, plan section 3)
   Type (#10): Montserrat for headings and figures, the owner's words in Open Sans 17px ink; green
   for numbers and markers only, never for paragraphs. The closing chapter is the one dark accent. */

.pj { display: block; }
.pj > .pj-preview-banner, .pj > .pj-staff-banner { width: calc(100% - 32px); max-width: 1180px; margin: 12px auto; }

/* The page's round button (the invite's link). */
.pj-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 24px;
    border-radius: 999px; font: 700 15px/1.2 var(--pj-font-heading); text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pj-btn--brand { background: var(--cailo-primary-hover); color: var(--cailo-white); box-shadow: 0 8px 24px var(--cailo-black-20); }
.pj-btn--brand:hover { background: var(--cailo-primary-dark); transform: translateY(-2px); }

/* ------------------------------------------------------------------ hero: the cover with the dates and title, then the byline and the facts */
.pj-hero { background: var(--cailo-surface); }
.pj-hero-media {
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; align-items: flex-end;
    min-height: min(56vh, 520px);
    color: var(--cailo-white);
    background: var(--cailo-primary-dark);
}
/* The cover's route (JourneyCoverArt, the .jca-* rules at the end): behind the words, under the photo
   scrim; on the right beside the title from 900 px, above it on a phone. */
.pj-hero-media {
    --jca-z: -2;
    --jca-top: 8%; --jca-right: 8%; --jca-bottom: 46%; --jca-left: 8%;
    --jca-mark-top: 14px; --jca-mark-bottom: auto; --jca-mark-right: 16px;
}
.pj-hero-img {
    position: absolute; inset: 0; z-index: -2;
    width: 100%; height: 100%; max-width: none; object-fit: cover;
    animation: pj-drift 20s ease-out both;
}
.pj-hero--photo .pj-hero-media::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, var(--cailo-black-20) 0%, transparent 22%, transparent 48%, var(--cailo-black-40) 100%);
}
@keyframes pj-drift { from { transform: scale(1.02); } to { transform: scale(1.08) translateY(-1%); } }

.pj-hero-text { position: relative; width: 100%; max-width: 1180px; margin: 0 auto; padding: 40px 16px 24px; }
.pj-eyebrow { margin: 0; font: 600 12px/1.3 var(--pj-font-heading); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cailo-white-90); }
.pj-hero .pj-title {
    margin: 10px 0 0; color: var(--cailo-white);
    font-size: clamp(2rem, 7vw, 4.2rem); line-height: 1.08; font-weight: 700; letter-spacing: -0.01em;
    text-wrap: balance;
}
.pj-hero--photo .pj-title { text-shadow: 0 2px 16px var(--cailo-black-40); }
.pj-hero-meta { max-width: 1180px; margin: 0 auto; padding: 18px 16px 6px; }
.pj-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; font-size: 15px; color: var(--pj-muted); }
.pj-byline b { font-family: var(--pj-font-heading); font-weight: 600; color: var(--pj-ink); }
.pj-avatar {
    flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--cailo-primary), var(--cailo-primary-light));
    color: var(--cailo-white); font: 700 14px/1 var(--pj-font-heading);
}
.pj-byline-car::before { content: "\00B7"; margin-right: 12px; }
.pj-recorded { margin: 10px 0 0; font-size: 13px; }
.pj-recorded a { color: var(--pj-brand-ink); font-weight: 600; text-decoration: none; }
.pj-recorded a:hover { text-decoration: underline; }
.pj-summary { margin: 14px 0 0; font: 600 15px/1.45 var(--pj-font-heading); color: var(--pj-ink); }
.pj-ends { margin: 6px 0 0; font-size: 13px; color: var(--pj-muted); }

/* ------------------------------------------------------------------ the story, as body text (not a pull quote) */
.pj-lead { max-width: 720px; margin: 0 auto; padding: 20px 16px 4px; }
.pj-lead-text p { margin: 0 0 18px; font-size: 17px; line-height: 1.65; color: var(--pj-ink); white-space: pre-line; }

/* ------------------------------------------------------------------ the storymap: the overview, then the story column */
.pj-storymap { max-width: 1440px; margin: 0 auto; }
.pj-story { min-width: 0; padding: 8px 16px 40px; }

/* The overview: the server SVG until journey-map.js mounts (.pj-live), then the live map in its place.
   Full screen is #pj-map (:target), at the end of this file. */
.pj-map { position: relative; isolation: isolate; margin: 16px; }
.pj-map .pj-map-svg { border-radius: 16px; }
.pj-live .pj-map-svg { display: none; }
.pj-live-map { position: absolute; inset: 0; }
.pj-maprow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; margin: 8px 4px 0; }
.pj-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--pj-muted); }
.pj-legend li { display: inline-flex; align-items: center; gap: 6px; }
.pj-key { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.pj-key-route { width: 18px; height: 4px; border-radius: 2px; background: var(--cailo-primary); }
.pj-key-chargingstop { background: var(--cailo-primary-hover); }
.pj-key-photo { background: var(--cailo-tertiary); }
.pj-key-note { background: var(--cailo-slate-grey); }
.pj-key-area { background: var(--cailo-primary-light); border: 1px dashed var(--cailo-primary); box-sizing: border-box; }
.pj-map-open {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: auto;
    color: var(--pj-brand-ink); font: 600 13px/1.2 var(--pj-font-heading); text-decoration: none; white-space: nowrap;
}
.pj-map-open svg { display: block; width: 16px; height: 16px; fill: currentColor; }
.pj-map-open:hover { text-decoration: underline; }
.pj-map-close { display: none; }

/* The day chips. */
.pj-daybar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 8px 0; }
.pj-daylink {
    display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 999px;
    background: var(--cailo-surface); border: 2px solid var(--jm-day, var(--cailo-primary));
    color: var(--pj-ink); font: 700 13px/1.2 var(--pj-font-heading); text-decoration: none;
}
.pj-daylink:hover { background: var(--cailo-primary-05); }

/* ------------------------------------------------------------------ a chapter: the sticky bar, a light opener, the day map, the beats */
.pj-day { margin: 20px 0 48px; scroll-margin-top: 0; }
/* The one sticky element on a phone, a direct child of its section, so it sticks for its own day only. */
.pj-chapterbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: baseline; gap: 8px; margin: 0 -16px; padding: 12px 16px;
    background: var(--cailo-light-bg);
    background: color-mix(in srgb, var(--cailo-light-bg) 94%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--cailo-border-color);
    font-size: 13px; color: var(--pj-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pj-chapterbar b { flex: none; font: 700 13px/1.2 var(--pj-font-heading); color: var(--pj-brand-ink); }
.pj-chapterbar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pj-day-head { padding: 22px 0 4px; }
.pj-day:target .pj-day-head { outline: 3px solid var(--pj-accent); outline-offset: 4px; border-radius: 8px; }
.pj-day-kicker { margin: 0 0 6px; }
.pj-day-num { font: 700 12px/1.2 var(--pj-font-heading); letter-spacing: 0.08em; text-transform: uppercase; color: var(--pj-brand-ink); }
.pj-day-title { color: var(--pj-ink); font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.2; font-weight: 700; text-wrap: balance; }
.pj-day-date { margin: 4px 0 0; color: var(--pj-muted); font-size: 14px; }
.pj-day-note { margin: 14px 0 0; }
.pj-day-note p { margin: 0 0 12px; font-size: 17px; line-height: 1.65; color: var(--pj-ink); white-space: pre-line; }
.pj-day-note p:last-child { margin-bottom: 0; }

/* A day's own map: its SVG without script, a still live map (journey-map.js) with it. One fixed box for
   both, so nothing shifts when the live map mounts; the link over it opens the overview full screen. */
.pj-daymap { position: relative; isolation: isolate; height: 220px; margin: 14px 0 4px; border-radius: 16px; overflow: hidden; background: var(--cailo-primary-05); cursor: pointer; }
.pj-daymap-open { position: absolute; inset: 0; z-index: 1; display: block; }
.pj-daymap-open:focus-visible { outline-offset: -3px; }
.pj-daymap .pj-map-svg { width: 100%; height: 100%; border-radius: 0; }
.pj-daymap.pj-live .pj-map-svg { visibility: hidden; }
.pj-daymap .pj-live-map { z-index: 0; pointer-events: none; }

/* ------------------------------------------------------------------ the beats: a timeline in the day's colour */
.pj-beats { position: relative; list-style: none; margin: 20px 0 0; padding: 0 0 0 36px; display: flex; flex-direction: column; gap: 18px; }
.pj-beats::before {
    content: ""; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px;
    background: linear-gradient(var(--jm-day, var(--cailo-primary)), var(--cailo-border-color));
}
.pj-beat { position: relative; border-radius: 16px; scroll-margin-top: 30vh; transition: box-shadow 0.25s ease, background 0.25s ease; }
.pj:has(.pj-live) .pj-beat { cursor: pointer; }
.pj-node {
    position: absolute; left: -36px; top: 8px; width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--cailo-surface); border: 3px solid var(--jm-day, var(--cailo-primary)); color: var(--cailo-primary-dark);
}
.pj-node svg { width: 15px; height: 15px; fill: currentColor; }
.pj-node-charge { background: var(--cailo-warning); border-color: var(--cailo-warning-dark); }
.pj-node-moment { left: -29px; top: 18px; width: 16px; height: 16px; background: var(--jm-day, var(--cailo-primary)); border: 3px solid var(--cailo-light-bg); }

/* Selected on the map (the module marks .is-selected). */
.pj-drive.is-selected, .pj-moment.is-selected .pj-moment-card, .pj-charge.is-selected .pj-charge-card {
    box-shadow: 0 0 0 3px var(--pj-accent), 0 18px 36px -20px var(--cailo-black-40);
}

/* A drive line. */
.pj-drive { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-left: -8px; padding: 10px 12px 10px 8px; }
.pj-drive .pj-node { left: -28px; }
.pj-drive:hover { background: var(--cailo-primary-05); }
.pj-drive.is-selected { background: var(--cailo-tertiary-05); }
.pj-drive-body { flex: 1 1 200px; min-width: 0; }
.pj-drive-line { margin: 0; font: 700 1rem/1.35 var(--pj-font-heading); color: var(--pj-ink); }
.pj-meta { margin: 2px 0 0; font-size: 13px; color: var(--pj-muted); }
/* A CSS escape swallows ONE whitespace after its hex digits, so " \00B7 " drew "12:32 pm ·30.4 kWh added": the trailing space is its own escape. */
.pj-meta span + span::before { content: " \00B7\0020"; }
.pj-meta-quiet { font-size: 12px; }

/* A charge as a refill card: light, the place, the battery from arrival to departure, then its moments. */
.pj-charge-card {
    padding: 16px; border-radius: 14px; color: var(--pj-ink);
    background: var(--cailo-surface); border: 1px solid var(--cailo-border-color);
}
.pj-charge-kicker {
    display: flex; align-items: center; gap: 6px; margin: 0;
    font: 600 12px/1.3 var(--pj-font-heading); letter-spacing: 0.08em; text-transform: uppercase; color: var(--pj-muted);
}
.pj-charge-kicker svg { display: block; width: 14px; height: 14px; fill: var(--cailo-warning-dark); }
.pj-charge-line { margin: 4px 0 12px; font: 700 1.15rem/1.3 var(--pj-font-heading); color: var(--pj-ink); }
.pj-battery { display: flex; align-items: center; gap: 12px; }
.pj-battbar { display: block; flex: 1 1 auto; min-width: 0; max-width: 320px; height: 16px; border-radius: 4px; }
.pj-battbar-track { fill: var(--cailo-border-color); }
.pj-battbar-from { fill: var(--cailo-text-secondary); }
.pj-battbar-gain { fill: var(--cailo-primary); transform-box: fill-box; transform-origin: left center; animation: pj-fill 1.6s 0.3s ease-out both; }
@keyframes pj-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.pj-battery-text { flex: none; font: 700 15px/1.2 var(--pj-font-heading); color: var(--pj-brand-ink); }
.pj-charge-card .pj-meta { margin-top: 10px; }
.pj-during { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pj-during .pj-node { display: none; }

/* UI review H1 (hide v2): the moments at a hidden stop, one beat between the two legs, with no time or place. */
.pj-node-private { background: var(--cailo-primary-10); border-style: dashed; }
.pj-private-card { padding: 14px 16px; border-radius: 14px; background: var(--cailo-primary-05); border: 1px dashed var(--cailo-primary-25); }
.pj-private-title { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 1rem/1.35 var(--pj-font-heading); color: var(--pj-ink); }
.pj-private-card .pj-during { margin-top: 10px; }

/* A moment: each photo once, full width at its own shape, then its place and words. */
.pj-moment-card {
    overflow: hidden; border-radius: 16px; background: var(--cailo-surface);
    box-shadow: 0 8px 24px -18px var(--cailo-black-40);
}
.pj-moment--note .pj-moment-card { border-left: 4px solid var(--jm-day, var(--cailo-primary)); }
/* Owner ruling 2026-11-08: tapping a moment card opens its photos (the card's one stretched link, no
   script); its own controls (each photo, Read more, Show on the map, reactions) stay above it. */
.pj-moment-card { position: relative; }
.pj-moment-open { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.pj-moment-open:focus-visible { outline: 3px solid var(--cailo-primary); outline-offset: -3px; }
.pj-moment-card .pj-moment-photo, .pj-moment-card .pj-show, .pj-moment-card .pj-more-toggle,
.pj-moment-card .pj-react, .pj-moment-card form { position: relative; z-index: 2; }
.pj-moment-photo { display: block; background: var(--cailo-primary-05); }
.pj-moment-photo + .pj-moment-photo { margin-top: 4px; }
.pj-moment-photo img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; }
.pj-moment-body { padding: 12px 16px 16px; }
.pj-where { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; font-size: 13px; color: var(--pj-muted); }
.pj-where-icon svg { display: block; width: 16px; height: 16px; fill: var(--jm-day, var(--cailo-primary)); }
.pj-caption, .pj-note-words { margin: 6px 0 0; font-size: 17px; line-height: 1.6; color: var(--pj-ink); white-space: pre-line; }

/* "Show on the map": revealed by the map module, the keyboard way to the same selection. */
.pj-show {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-top: 10px; padding: 6px 12px;
    border: 1.5px solid var(--pj-brand-ink); border-radius: 999px; background: transparent; cursor: pointer;
    color: var(--pj-brand-ink); font: 700 13px/1.2 var(--pj-font-heading);
}
.pj-show svg { width: 15px; height: 15px; fill: currentColor; }
.pj-show:hover { background: var(--cailo-primary-05); }
.pj-drive .pj-show { margin-top: 0; }

/* The pop card's content (a clone of a [data-pop] block, inside journey-map.css's .jm-pop). */
.pj-pop-title { font: 700 14px/1.3 var(--pj-font-heading); color: var(--pj-ink); }
.pj-pop-meta { font-size: 12.5px; color: var(--pj-muted); }
.pj-pop-words { font-size: 14px; white-space: pre-line; }

/* ------------------------------------------------------------------ Read more (long owner words, no script)
   PublicJourneyStory.More (ReadMoreText's rule): the words are clamped while the <details> after them
   is closed, and whole while it is open. A browser without :has() shows the words whole and no
   toggle, so nothing is ever cut without a way to read it. Classes only (style-src 'self'). */
.pj-more-toggle { display: none; }
@supports selector(:has(*)) {
    .pj-more-toggle { display: block; margin: 6px 0 0; }
    .pj-more:has(> .pj-more-toggle:not([open])) > .pj-more-text { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
    .pj-more--note:has(> .pj-more-toggle:not([open])) > .pj-more-text { -webkit-line-clamp: 6; line-clamp: 6; }
    .pj-more--story:has(> .pj-more-toggle:not([open])) > .pj-more-text { -webkit-line-clamp: 10; line-clamp: 10; }
}
.pj-more-toggle summary {
    display: inline-flex; align-items: center; min-height: 44px; list-style: none; cursor: pointer;
    color: var(--pj-brand-ink); font: 700 14px/1.2 var(--pj-font-heading);
}
.pj-more-toggle summary::-webkit-details-marker { display: none; }
.pj-more-toggle summary:hover { text-decoration: underline; }
.pj-more-toggle[open] .pj-open-only { display: inline; }
.pj-more-toggle[open] .pj-closed-only { display: none; }

/* ------------------------------------------------------------------ the gallery: photos with no time and no place */
.pj-gallery-section { max-width: 1180px; margin: 0 auto; padding: 24px 16px; }
.pj-section-title { margin-bottom: 16px; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; color: var(--pj-ink); }
.pj-gallery { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; }
.pj-gallery li:first-child { grid-column: span 2; }
.pj-gallery a { display: block; height: 100%; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 14px; background: var(--cailo-primary-05); }
.pj-gallery li:first-child a { aspect-ratio: 16 / 9; }
.pj-gallery img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.pj-gallery a:hover img { transform: scale(1.05); }

/* Owner ruling 2026-11-08: what each hidden circle holds (its photos, its charging stops), no pin or place. */
.pj-circle-list { list-style: none; display: grid; gap: 16px; margin: 0; padding: 0; }
.pj-circle { padding: 14px 16px; border: 1px dashed var(--cailo-primary); border-radius: 14px; background: var(--cailo-primary-05); }
.pj-circle.is-selected, .pj-circle.is-hover { border-style: solid; }
.pj-circle-label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 700; color: var(--pj-ink); }
.pj-circle-photos { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; padding: 0; }
.pj-circle-photo { display: block; overflow: hidden; aspect-ratio: 1 / 1; border-radius: 10px; }
.pj-circle-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pj-circle-charge { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: var(--pj-ink); }
.pj-circle-charge svg { width: 16px; height: 16px; fill: var(--cailo-primary); }

/* ------------------------------------------------------------------ the closing chapter (U2): the one dark accent */
.pj-closing {
    width: calc(100% - 32px); max-width: 1180px; margin: 24px auto; padding: 32px 20px 28px;
    border-radius: 24px; color: var(--cailo-white);
    background: linear-gradient(180deg, var(--cailo-primary-dark) 0%, var(--cailo-primary-hover) 100%);
}
.pj-closing .pj-map-svg { max-width: 420px; max-height: 320px; margin: 0 auto 20px; background: transparent; }
.pj-closing .pj-route { stroke: var(--cailo-white); }
.pj-closing .pj-end { fill: var(--cailo-primary-dark); stroke: var(--cailo-primary-light); }
.pj-closing-title { color: var(--cailo-white); font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.15; font-weight: 700; }
.pj-closing-date { margin: 4px 0 0; color: var(--cailo-white-80); font-size: 14px; }
.pj-closing-facts { margin: 14px 0 0; font: 600 15px/1.45 var(--pj-font-heading); color: var(--cailo-white-90); }
.pj-signature {
    display: flex; align-items: center; gap: 10px; margin: 20px 0 0; padding-top: 16px;
    border-top: 1px solid var(--cailo-white-20); font: 600 15px/1.2 var(--pj-font-heading); color: var(--cailo-white-90);
}
.pj-signature .pj-avatar { width: 34px; height: 34px; font-size: 12px; background: var(--cailo-white-20); color: var(--cailo-white); }

/* ------------------------------------------------------------------ All the numbers (closed by default) */
.pj-numbers {
    width: calc(100% - 32px); max-width: 1180px; margin: 16px auto; overflow: hidden;
    border-radius: 16px; background: var(--cailo-surface); border: 1px solid var(--cailo-border-color);
}
.pj-numbers summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 44px; padding: 16px 20px; }
.pj-numbers summary::-webkit-details-marker { display: none; }
.pj-numbers summary:focus-visible { outline-offset: -4px; }
.pj-numbers-title { font: 700 1.1rem/1.2 var(--pj-font-heading); color: var(--pj-ink); }
.pj-numbers-toggle { margin-left: auto; padding: 6px 14px; border: 1.5px solid var(--pj-brand-ink); border-radius: 999px; color: var(--pj-brand-ink); font: 700 13px/1.2 var(--pj-font-heading); }
.pj-open-only { display: none; }
.pj-numbers[open] .pj-open-only { display: inline; }
.pj-numbers[open] .pj-closed-only { display: none; }
.pj-numbers-body { padding: 4px 20px 22px; border-top: 1px solid var(--cailo-border-color); }

.pj-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.pj-stat { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 14px; background: var(--cailo-light-bg); }
/* The label comes first in the markup (dt before dd) and is shown under its value. */
.pj-stat dt { order: 2; font-size: 12px; color: var(--pj-muted); }
.pj-stat dd { order: 1; margin: 0; font-family: var(--pj-font-heading); font-weight: 700; font-size: 1.2rem; color: var(--pj-brand-ink); }
.pj-stat dd.pj-detail { order: 3; font-family: var(--pj-font-body); font-weight: 400; font-size: 12px; color: var(--pj-muted); margin-top: 2px; }
.pj-highlights { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.pj-highlights li { padding: 12px 14px; border-radius: 14px; background: var(--cailo-light-bg); }

/* ------------------------------------------------------------------ the invite (UX rework #13) and the footer */
.pj-invite { max-width: 640px; margin: 24px auto 8px; padding: 32px 20px 16px; text-align: center; }
.pj-invite-kicker { margin: 0; font: 700 13px/1.2 var(--pj-font-heading); letter-spacing: 0.12em; text-transform: uppercase; color: var(--pj-brand-ink); }
.pj-invite h2 { margin: 12px 0 8px; color: var(--pj-ink); font-size: clamp(1.3rem, 4vw, 1.7rem); line-height: 1.3; text-wrap: balance; }
.pj-invite p { margin: 0 0 18px; font-size: 15px; line-height: 1.6; color: var(--pj-muted); }

.pj > .pj-footer { max-width: 760px; margin: 0 auto; padding: 8px 16px 40px; }

/* ------------------------------------------------------------------ the lightbox (:target; the l rendition loads only when opened) */
.pj-lightbox { display: none; position: fixed; inset: 0; z-index: 2000; align-items: center; justify-content: center; padding: 64px 16px; }
.pj-lightbox:target { display: flex; animation: pj-fade 0.25s ease-out; }
@keyframes pj-fade { from { opacity: 0; } }
.pj-lb-backdrop { position: absolute; inset: 0; background: var(--cailo-primary-dark); background: color-mix(in srgb, var(--cailo-primary-dark) 22%, black); opacity: 0.97; }
.pj-lb-figure { position: relative; display: flex; flex-direction: column; gap: 12px; width: min(1100px, 100%); max-height: 100%; margin: 0; }
/* The cached small rendition under the lazy large one, in one grid cell, so the frame is never blank. */
.pj-lb-stack { display: grid; }
.pj-lb-stack > img { grid-area: 1 / 1; display: block; width: 100%; height: auto; max-height: calc(100vh - 200px); object-fit: contain; }
.pj-lb-figure figcaption { display: flex; flex-direction: column; gap: 2px; color: var(--cailo-white); }
.pj-lb-caption { font: 700 1.1rem/1.35 var(--pj-font-heading); white-space: pre-line; }
.pj-lb-detail { font-size: 14px; color: var(--cailo-white-80); }
.pj-lb-count { position: absolute; left: 20px; top: 22px; color: var(--cailo-white-80); font: 600 13px/1 var(--pj-font-heading); }
.pj-lb-nav, .pj-lb-close {
    position: absolute; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
    background: var(--cailo-white-15); color: var(--cailo-white); text-decoration: none;
}
.pj-lb-nav svg, .pj-lb-close svg { display: block; width: 28px; height: 28px; fill: currentColor; }
.pj-lb-nav:hover, .pj-lb-close:hover { background: var(--cailo-white-20); }
.pj-lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.pj-lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.pj-lb-close { right: 12px; top: 10px; }
.pj-lightbox a:focus-visible { outline-color: var(--cailo-white); }

/* ------------------------------------------------------------------ unavailable (w08) */
.pj-gone { max-width: 520px; margin: 10vh auto 0; text-align: center; padding: 40px 24px; }
.pj-gone svg { width: 40px; height: 40px; fill: var(--cailo-text-secondary); }
.pj-gone h1 { font-size: 1.35rem; font-weight: 600; margin: 12px 0 8px; }
.pj-gone p { color: var(--pj-muted); margin: 0 0 20px; }

/* ------------------------------------------------------------------ holding page (share readiness section 5) */
.pj-holding { max-width: 520px; margin: 10vh auto 0; text-align: center; padding: 40px 24px; }
.pj-holding .pj-title { font-family: var(--pj-font-heading); font-size: 1.35rem; font-weight: 600; margin: 0 0 8px; }
.pj-holding .pj-byline { justify-content: center; margin-bottom: 20px; }
.pj-holding-text { color: var(--pj-muted); margin: 0; }

/* ------------------------------------------------------------------ invite check (S5: w21, w22) */
.pj-verify { width: 100%; max-width: 440px; margin: 6vh auto 0; padding: 32px 20px; }
.pj-verify-icon { display: block; width: 40px; height: 40px; margin: 0 auto; fill: var(--pj-brand-ink); }
.pj-verify h1 { font-size: 1.35rem; font-weight: 600; margin: 12px 0 8px; text-align: center; }
p.pj-lead { margin: 0 0 20px; color: var(--pj-muted); text-align: center; }

.pj-notice {
    margin: 0 0 16px; padding: 10px 12px; border-radius: 8px;
    border-left: 4px solid var(--pj-error); background: var(--pj-error-bg); color: var(--pj-ink); font-size: 14px;
}

.pj-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.pj-field { display: flex; flex-direction: column; gap: 6px; }
.pj-field label { font-weight: 600; font-size: 14px; color: var(--pj-ink); }
/* 16px text, so phones do not zoom into the field. */
.pj-field input {
    width: 100%; min-height: 48px; padding: 10px 12px; margin: 0;
    font-family: var(--pj-font-body); font-size: 16px; color: var(--pj-ink);
    background: var(--cailo-surface); border: 1px solid var(--pj-field-border); border-radius: 8px;
}
.pj-field input[aria-invalid="true"] { border: 2px solid var(--pj-error); }
.pj-code-input { letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }

.pj-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.pj-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--pj-brand-ink); }
.pj-check label { cursor: pointer; }

.pj-field input:focus-visible, .pj-field textarea:focus-visible, .pj-check input:focus-visible, .pj-linkbutton:focus-visible {
    outline: 3px solid var(--cailo-tertiary); outline-offset: 2px;
}

button.pj-button { border: 0; cursor: pointer; justify-content: center; }
.pj-button-block { width: 100%; }

.pj-resend { margin: 12px 0 0; text-align: center; }
.pj-resend form { margin: 0; }
.pj-linkbutton {
    display: inline-flex; align-items: center; min-height: 44px; padding: 8px; margin: 0;
    background: none; border: 0; cursor: pointer;
    font-family: var(--pj-font-body); font-weight: 600; font-size: 14px; color: var(--pj-brand-ink); text-decoration: underline;
}

.pj-quiet { color: var(--pj-muted); font-size: 13px; }

/* ------------------------------------------------------------------ report (S6: w05b, w05c) */
.pj-visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.pj-radios { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pj-radios .pj-check { font-size: 15px; }
.pj-radios[aria-invalid="true"] { padding: 4px 8px; border-left: 4px solid var(--pj-error); }
.pj-field textarea {
    width: 100%; min-height: 104px; padding: 10px 12px; margin: 0; resize: vertical;
    font-family: var(--pj-font-body); font-size: 16px; line-height: 1.5; color: var(--pj-ink);
    background: var(--cailo-surface); border: 1px solid var(--pj-field-border); border-radius: 8px;
}
.pj-field textarea[aria-invalid="true"] { border: 2px solid var(--pj-error); }
.pj-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pj-actions .pj-button { justify-content: center; flex: 1 1 120px; }
.pj-staff-banner {
    margin: 0; padding: 10px 14px; border-radius: 10px;
    background: var(--cailo-tertiary-10); border-left: 4px solid var(--cailo-tertiary-dark);
    color: var(--pj-ink); font-weight: 600; font-size: 14px;
}

/* ------------------------------------------------------------------ content rules (/j/rules) */
.pj-rules h1 { font-size: 1.5rem; margin-bottom: 4px; }
.pj-rules h2 { font-size: 1.1rem; margin: 18px 0 6px; }
.pj-rules h3 { font-size: 1rem; color: var(--pj-ink); margin: 18px 0 6px; }
.pj-rules p, .pj-rules li { color: var(--pj-muted); }
.pj-rules ol, .pj-rules ul { padding-left: 22px; margin: 0; }
.pj-rules li + li { margin-top: 6px; }
.pj-rules .pj-strong { color: var(--pj-ink); font-weight: 600; }


/* ------------------------------------------------------------------ reactions (FR-13, w23; owner requirement 2026-11-07)
   THE reaction control (ReactionControl), on the public page and in Community alike (the one
   exception to this file's .pj-theme scope, beside .jca-*): one small "React" button, or the
   viewer's own reaction highlighted, and the summary (top faces and the count). The button is a
   <summary>, so a click or tap opens the five with no script; journey-reactions.js adds hover with a
   delay, tap-outside, Escape and the arrow keys. The menu floats above the button, white with ink
   faces, so it reads on a light day and on the dark closing chapter alike; the chosen face keeps a
   border and a tint, never colour alone. */
.pj-react { margin: 12px 0 0; }
.jrx { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.jrx-pop { position: relative; display: inline-block; }
.jrx-btn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; list-style: none; cursor: pointer;
    border: 1px solid var(--cailo-border-color); border-radius: 999px; background: var(--cailo-surface);
    font: 600 13px/1 var(--cailo-font-family-body); color: var(--cailo-text-primary);
}
.jrx-btn::-webkit-details-marker { display: none; }
.jrx-btn::marker { content: ""; }
.jrx-btn:hover { border-color: var(--cailo-primary-hover); }
.jrx-btn:focus-visible { outline: 3px solid var(--cailo-primary); outline-offset: 2px; }
.jrx-btn.is-mine { border: 2px solid var(--cailo-primary-hover); background: var(--cailo-primary-10); }
.jrx-icon svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.jrx-face { font-size: 17px; line-height: 1; }
.jrx-menu {
    position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 40;
    display: inline-flex; gap: 2px; width: max-content; padding: 4px 6px; border-radius: 999px;
    background: var(--cailo-surface); border: 1px solid var(--cailo-border-color); box-shadow: 0 6px 20px var(--cailo-black-20);
    animation: jrx-in 0.16s ease-out;
}
.jrx-pop:not([open]) > .jrx-menu { display: none; }
.pj-react-btn {
    display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; margin: 0;
    border: 2px solid transparent; border-radius: 999px; background: transparent; cursor: pointer;
    font: 400 24px/1 var(--cailo-font-family-body); color: var(--cailo-text-primary);
    transition: transform 0.12s ease;
}
.pj-react-btn:hover, .pj-react-btn:focus-visible { transform: scale(1.18); }
.pj-react-btn:focus-visible { outline: 3px solid var(--cailo-primary); outline-offset: 1px; }
.pj-react-btn[aria-checked="true"] { border-color: var(--cailo-primary-hover); background: var(--cailo-primary-10); }
.pj-react-btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.jrx-sum { display: inline-flex; align-items: center; gap: 4px; font: 600 13px/1 var(--cailo-font-family-body); color: var(--cailo-text-primary); }
.jrx-sum-button { min-height: 32px; padding: 2px 8px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; }
.jrx-sum-button:hover { background: var(--cailo-primary-05); }
.jrx-sum-button:focus-visible { outline: 3px solid var(--cailo-primary); outline-offset: 2px; }
.jrx-top { letter-spacing: -3px; font-size: 15px; padding-right: 3px; }
.jrx-vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@keyframes jrx-in { from { opacity: 0; transform: translateY(4px) scale(0.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .jrx-menu { animation: none; } .pj-react-btn { transition: none; } }
/* A narrow screen: the smiley (or the viewer's face) only; the button's name stays for a screen reader. */
@media (max-width: 599.98px) { .jrx-btn-text { display: none; } .jrx-btn { padding: 4px 10px; } }
.pj-closing .jrx-sum { color: var(--cailo-white); }
.pj-day > .pj-react { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--cailo-border-color); }
.pj-closing .pj-react { margin-top: 20px; }
.pj-moment-card > .pj-react { margin: 8px 16px 0; }
.pj-gallery .pj-react { margin-top: 6px; }
.pj-journey-actions { width: calc(100% - 32px); max-width: 1180px; margin: 24px auto; }

/* FR-17 (w24): an invitee link with comments on. */
.pj-invited-note {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
    width: calc(100% - 32px); max-width: 1180px; margin: 12px auto; padding: 16px 20px; border-radius: var(--pj-radius);
    background: var(--cailo-primary-05); border: 1px solid var(--cailo-border-color); color: var(--pj-ink);
}
.pj-invited-note p { flex: 1 1 280px; margin: 0; }

/* A react redirect's notice (w23b, design 6): fixed to the screen, since the return anchor may sit far below the top. */
.pj-react-notice {
    position: fixed; left: 50%; bottom: 16px; z-index: 2100; transform: translateX(-50%);
    width: min(560px, calc(100% - 32px)); margin: 0; padding: 12px 16px; border-radius: 10px;
    border-left: 4px solid var(--pj-error); background: var(--pj-error-bg); color: var(--pj-ink);
    font-size: 14px; box-shadow: 0 6px 20px var(--cailo-black-20);
}

/* ------------------------------------------------------------------ wider screens */
@media (min-width: 640px) {
    .pj-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pj-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pj-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pj-lead-text p, .pj-day-note p { font-size: 18px; }
    .pj-closing { padding: 40px 40px 32px; }
}

@media (min-width: 900px) {
    .pj-wrap { max-width: 1040px; padding-top: 24px; }
    .pj-top { padding: 0 24px; }
    .pj-hero-text { padding: 64px 40px 40px; }
    .pj-hero-meta { padding: 20px 40px 6px; }
    .pj-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .pj-highlights { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pj-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 170px; }
    .pj-gallery a, .pj-gallery li:first-child a { aspect-ratio: auto; }
    .pj-gallery li:first-child { grid-row: span 2; }
}

/* The split view, as before: the story beside a sticky overview that follows it. No day maps and no
   chapter bar here (the overview is always in view and the day chips stay sticky). */
@media (min-width: 1024px) {
    .pj-storymap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 46%); align-items: start; }
    .pj-storymap--nomap { grid-template-columns: minmax(0, 820px); justify-content: center; }
    .pj-story { grid-column: 1; grid-row: 1; padding: 8px 40px 64px; }
    .pj-map { grid-column: 2; grid-row: 1; position: sticky; top: 16px; margin: 16px 16px 16px 0; }
    .pj-map.pj-live { z-index: 1; height: calc(100vh - 32px); min-height: 480px; border-radius: 24px; overflow: hidden; box-shadow: 0 10px 24px var(--cailo-black-20); }
    .pj-live .pj-maprow { display: none; }
    .pj-daybar {
        position: sticky; top: 0; z-index: 5; margin: 16px -8px 0; padding: 12px 8px;
        background: var(--cailo-light-bg);
        background: color-mix(in srgb, var(--cailo-light-bg) 88%, transparent);
        backdrop-filter: blur(8px);
    }
    .pj-chapterbar, .pj-daymap { display: none; }
    .pj-day { scroll-margin-top: 64px; }
    .pj-beat { scroll-margin-top: 40vh; }
}

/* A phone: no sticky map. The overview is a still picture in place, 30% of the screen, and opens full
   screen on a tap; its SVG and its live map share that one box, so nothing shifts when it mounts. */
@media (max-width: 1023.98px) {
    .pj-map .pj-map-svg { height: 30vh; min-height: 200px; }
    .pj-map.pj-live { display: flex; flex-direction: column; }
    .pj-map.pj-live .pj-live-map { order: -1; position: relative; inset: auto; height: 30vh; min-height: 200px; border-radius: 16px; overflow: hidden; }
    .pj-beat { scroll-margin-top: 64px; }
}

/* ------------------------------------------------------------------ the full-screen map (#pj-map, :target), at any width
   Without script it shows the SVG; with it journey-map.js turns the live map interactive here
   (hashchange). Its close link returns to the storymap's top (#pj-route); the page behind holds still. */
.pj-map:target, .pj-map.pj-live:target {
    position: fixed; inset: 0; z-index: 2000; margin: 0; height: auto; min-height: 0;
    display: flex; flex-direction: column; justify-content: center;
    border-radius: 0; box-shadow: none; background: var(--cailo-surface);
}
.pj-map:target .pj-map-svg { height: auto; max-height: 100%; border-radius: 0; }
.pj-map.pj-live:target .pj-live-map { position: absolute; inset: 0; height: auto; min-height: 0; border-radius: 0; }
.pj-map:target .pj-maprow { display: none; }
.pj-map:target .pj-map-close {
    position: absolute; top: 12px; right: 12px; z-index: 1100;
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    background: var(--cailo-surface); color: var(--pj-ink); box-shadow: 0 4px 12px var(--cailo-black-20);
}
.pj-map-close svg { display: block; width: 24px; height: 24px; fill: currentColor; }

/* ================================================================== "More journeys from" (owner ruling 2026-11-07)
   One tile (PublicJourneyTileLink) for the rail at the end of a shared journey and the journeys
   page (/j/u/{handle}): the cover (or the hero's brand art), the title, the dates and the facts
   line. Plain links; no script. */

.pj-tile {
    display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    background: var(--cailo-surface); border-radius: var(--pj-radius);
    box-shadow: 0 1px 3px var(--cailo-black-20), 0 2px 8px var(--cailo-shadow-color);
    color: var(--pj-ink); text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pj-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px var(--cailo-black-20); }
.pj-tile-cover {
    position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
    background: var(--cailo-primary-dark);
}
.pj-tile-cover img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.pj-tile-cover { --jca-top: 12%; --jca-right: 10%; --jca-bottom: 14%; --jca-left: 10%; }
.pj-tile-badge {
    position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px;
    background: var(--cailo-surface); color: var(--pj-brand-ink); font: 700 12px/1.2 var(--pj-font-heading);
}
.pj-tile-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
:where(.pj-theme) .pj-tile-title { margin: 0 0 2px; color: var(--pj-ink); font-size: 1rem; font-weight: 600; line-height: 1.3; }
.pj-tile-meta { font-size: 13px; color: var(--pj-muted); }

/* The rail: after the story, before the invite. Swiped sideways on a phone (the next tile peeks in),
   four across from 900 px. */
.pj-more { max-width: 1180px; margin: 32px auto 0; padding: 0 16px; }
.pj-more-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.pj-more-head h2 { font-size: clamp(1.15rem, 3.5vw, 1.4rem); }
.pj-more-all { flex: none; font: 600 14px/1.2 var(--pj-font-heading); }
.pj-more-rail {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -16px; padding: 2px 16px 12px;
}
.pj-more-rail > .pj-tile { flex: 0 0 72%; scroll-snap-align: start; }

/* The journeys page: the heading, the latest as the feature, then a list (phone) or a grid. */
.pj-channel { max-width: 1180px; margin: 0 auto; padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 20px; }
.pj-channel-head { display: flex; align-items: center; gap: 14px; }
.pj-avatar--lg { width: 56px; height: 56px; font-size: 20px; }
:where(.pj-theme) .pj-channel-title { font-size: clamp(1.4rem, 5vw, 2rem); }
.pj-channel-head .pj-recorded { margin: 4px 0 0; }
.pj-tile--feature .pj-tile-body { padding: 16px 18px 18px; }
:where(.pj-theme) .pj-tile--feature .pj-tile-title { font-size: clamp(1.2rem, 4vw, 1.6rem); }
.pj-channel-grid { display: flex; flex-direction: column; gap: 12px; }
.pj-channel-grid > .pj-tile { flex-direction: row; box-shadow: none; border-radius: 0; background: transparent; gap: 12px; }
.pj-channel-grid > .pj-tile .pj-tile-cover { flex: none; width: 112px; border-radius: 10px; --jca-mark-display: none; }
.pj-channel-grid > .pj-tile .pj-tile-body { padding: 2px 0 0; }
.pj-channel-more { margin: 0; text-align: center; }
.pj-channel > .pj-footer { padding: 8px 0 0; }

@media (min-width: 900px) {
    .pj-more-rail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 2px 0 12px; }
    .pj-more-rail > .pj-tile { flex: none; }
    .pj-tile--feature { display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; }
    .pj-tile--feature .pj-tile-cover { aspect-ratio: 16 / 9; }
    .pj-channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .pj-channel-grid > .pj-tile { flex-direction: column; gap: 0; background: var(--cailo-surface); border-radius: var(--pj-radius);
        box-shadow: 0 1px 3px var(--cailo-black-20), 0 2px 8px var(--cailo-shadow-color); }
    .pj-channel-grid > .pj-tile .pj-tile-cover { width: auto; border-radius: 0; --jca-mark-display: block; }
    .pj-channel-grid > .pj-tile .pj-tile-body { padding: 12px 14px 14px; }
    .pj-hero-media { --jca-top: 10%; --jca-right: 6%; --jca-bottom: 10%; --jca-left: 52%; }
}

/* ================================================================== the journey cover from its route (owner requirement 2026-11-07)
   JourneyCoverArt (Components/PublicJourney): THE route cover and the faint route over a cover photo,
   on the owner's hero and Shelf cards, the Community card, the /j hero, the tiles, the rail, the trip
   postcard, the On the road card and the start dialog's thumbnails. ★ The one exception to this
   file's .pj-theme scope: the owner pages draw it too, and this is the one sheet both apps link. The
   og image draws the same values (JourneyCoverStyle, the hex of these tokens) in JourneyImage.

   The host is position: relative and places the parts with custom properties, which inherit:
   --jca-top/right/bottom/left (the route's box), --jca-mark-top/right/bottom and --jca-mark-display
   (the wordmark), --jca-z (the layer). The strokes do not scale with the picture
   (vector-effect), so a thumbnail and a hero draw the same line. */
.jca, .jca-ghost {
    position: absolute; z-index: var(--jca-z, auto); pointer-events: none;
}
.jca {
    inset: 0; overflow: hidden;
    background: linear-gradient(150deg, var(--cailo-primary-dark) 0%, var(--cailo-primary-hover) 100%);
}
.jca-contours { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; }
.jca-contour { stroke: var(--cailo-white-10); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.jca-route, .jca-ghost {
    position: absolute; display: block; max-width: none; overflow: visible;
    top: var(--jca-top, 14%); left: var(--jca-left, 10%);
    width: calc(100% - var(--jca-left, 10%) - var(--jca-right, 10%));
    height: calc(100% - var(--jca-top, 14%) - var(--jca-bottom, 14%));
}
.jca-glow, .jca-line, .jca-ghost-casing, .jca-ghost-line {
    stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.jca-glow { stroke: var(--cailo-primary-light); stroke-opacity: 0.35; stroke-width: 11px; }
.jca-line { stroke: var(--cailo-primary-light); stroke-width: 3.5px; }
/* A hidden start or end: only its privacy circle (public pictures carry them; owner outlines never do). */
.jca-circle {
    fill: var(--cailo-white-10); stroke: var(--cailo-white-55); stroke-width: 1.5px; stroke-dasharray: 6 5;
    vector-effect: non-scaling-stroke;
}
.jca-mark {
    position: absolute; display: var(--jca-mark-display, block);
    top: var(--jca-mark-top, auto); right: var(--jca-mark-right, 12px); bottom: var(--jca-mark-bottom, 10px);
    font: 700 11px/1 var(--cailo-font-family-headings); letter-spacing: 0.22em; color: var(--cailo-white-80);
}
/* "Show the route on the cover": faint, over the photo, under the host's scrim and words. */
.jca-ghost-casing { stroke: var(--cailo-black-30); stroke-width: 6px; }
.jca-ghost-line { stroke: var(--cailo-white-80); stroke-width: 2.5px; }

/* Animate (the owner's pages): each run has pathLength="1", so one dash of length 1 draws it in. */
.jca-route--animate .jca-line, .jca-route--animate .jca-glow { stroke-dasharray: 1; stroke-dashoffset: 1; animation: jca-draw 1.6s ease-out 0.2s forwards; }
@keyframes jca-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
    .jca-route--animate .jca-line, .jca-route--animate .jca-glow { animation: none; stroke-dashoffset: 0; }
}

/* ------------------------------------------------------------------ the Stops timeline (concept 5)
   One layout for the owner's page and the public story (Components/PublicJourney/Stops): places are
   the cards, drives the road between them, down one 56 px rail. Scoped by .jst, the timeline's own
   root, NOT by .pj-theme, because the owner's page (outside .pj-theme) renders it too; the cards
   inside it keep their own page's styles (pj-* here, jr-* in the owner's scoped sheet). Brand
   tokens only (tokens.css); no url(), no style attribute. */
.jst {
    --jst-rail: var(--cailo-primary-25);
    --jst-node: 30px;
    list-style: none; margin: 16px 0 0; padding: 0;
}
.jst ol { list-style: none; margin: 0; padding: 0; }
.jst-row { display: flex; position: relative; scroll-margin-top: 30vh; }
.jst-rail { width: 56px; flex-shrink: 0; position: relative; display: flex; flex-direction: column; align-items: center; }
.jst-rail::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--jst-rail); }
.jst-first > .jst-rail::before { top: 22px; }
.jst-last > .jst-rail::before { bottom: calc(100% - 22px); }
.jst-first.jst-last > .jst-rail::before { display: none; }
.jst-body { flex: 1; min-width: 0; padding-bottom: 14px; }

.jst-node {
    position: relative; z-index: 1; width: var(--jst-node); height: var(--jst-node); margin-top: 4px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--cailo-surface); border: 2px solid var(--cailo-primary); color: var(--cailo-primary);
}
.jst-glyph { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.jst-node-stop { width: 34px; height: 34px; border: 0; background: var(--cailo-primary); color: var(--cailo-surface); }
.jst-node-hidden { background: var(--cailo-slate-grey); }
.jst-node-drive { width: 24px; height: 24px; margin-top: 8px; border: 0; box-shadow: 0 0 0 2px var(--cailo-primary); }
.jst-node-drive .jst-glyph { width: 14px; height: 14px; }
.jst-node-slim { width: 12px; height: 12px; margin-top: 10px; border-width: 2px; }
.jst-node-next { background: var(--cailo-surface); border: 2px dashed var(--cailo-text-disabled); color: var(--cailo-text-disabled); }

/* A drive: a thick Earth Green rail, the server's line, the moments on the road. */
.jst-driverow > .jst-rail::before { width: 3px; margin-left: -1.5px; background: var(--cailo-primary); }
.jst-drive { padding: 8px 0 4px; border-radius: 10px; scroll-margin-top: 30vh; }
.jst-drive-line { margin: 0; font: 600 0.875rem/1.4 var(--cailo-font-family-body); color: var(--cailo-slate-grey); }
.jst-road { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }

/* A stop card. */
.jst-stoprow { padding-top: 4px; }
.jst-stop {
    background: var(--cailo-surface); border-radius: 12px; border: 1px solid var(--cailo-border-color);
    box-shadow: 0 2px 8px var(--cailo-primary-10); padding: 12px 12px 4px;
}
.jst-stop-head { padding: 2px 2px 10px; }
.jst-stop-label { margin: 0; font: 700 1rem/1.3 var(--cailo-font-family-headings); color: var(--cailo-text-primary); }
.jst-stop-when { margin: 2px 0 0; font-size: 0.8rem; color: var(--cailo-text-secondary); }
.jst-own { display: flex; align-items: center; gap: 5px; margin: 6px 0 0; font: 600 0.75rem/1.35 var(--cailo-font-family-body); color: var(--cailo-slate-grey); }
.jst-own .jst-glyph { width: 14px; height: 14px; }
.jst-stop .jst-moments, .jst-stop .jst-charges { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.jst-during { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.jst-stop--next { background: transparent; border: 1.5px dashed var(--cailo-border-color); box-shadow: none; padding-bottom: 12px; }
.jst-stop--next .jst-stop-head { padding-bottom: 0; }
.jst-nextrow > .jst-rail::before { background: repeating-linear-gradient(180deg, var(--cailo-secondary) 0 6px, transparent 6px 11px); bottom: calc(100% - 22px); }

/* An empty middle stop on a shared page: one slim line. */
.jst-slimrow { padding: 0; }
.jst-slimrow .jst-body { padding: 6px 0 10px; }
.jst-slim { margin: 0; font-size: 0.875rem; color: var(--cailo-slate-grey); }
.jst-slim-label { font-weight: 600; }
.jst-slim-when { margin-left: 8px; color: var(--cailo-text-secondary); }

/* Moments with no shown time at the end of a day. */
.jst-morerow .jst-moments { display: flex; flex-direction: column; gap: 10px; }

/* Days: a marker on the timeline, or a break inside a stop (an overnight stay is one card). */
.jst-dayrow { padding: 18px 0 6px; scroll-margin-top: 64px; }
.jst-day { display: block; }
.jst-day-heading { margin: 0; font: 700 0.875rem/1.3 var(--cailo-font-family-headings); color: var(--cailo-primary-hover); }
.jst-day-note { margin: 6px 0 0; font-size: 0.95rem; line-height: 1.55; color: var(--cailo-text-primary); white-space: pre-line; }
.jst-daybreak { margin: 2px 0; padding: 8px 2px; border-top: 1px dashed var(--cailo-border-color); }
/* Re-check item 3: a day break inside a stop is the same size as a day marker (Day 1 read 14px, Days 2 and 3 12.8px). */

/* The cards inside: the public story's own beat nodes and rail are the timeline's here, so they go. */
.jst .pj-node { display: none; }
.jst .pj-beat { scroll-margin-top: 30vh; }
.jst .pj-drive-meta { margin: 2px 0 0; }

/* Owner actions in the cards: 44 px tall, the brand's text-button look. */
.jst-add {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; margin: 0 0 4px;
    border: 0; background: none; cursor: pointer;
    font: 600 0.8rem/1 var(--cailo-font-family-body); color: var(--cailo-primary-hover);
}
.jst-add:hover { text-decoration: underline; }
.jst-add:focus-visible { outline: 3px solid var(--cailo-tertiary); outline-offset: 2px; border-radius: 6px; }
.jst-add[disabled] { opacity: 0.45; cursor: default; text-decoration: none; }
.jst-add .jst-glyph { width: 16px; height: 16px; }
.jst-road + .jst-add, .jst-drive + .jst-add { margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
    .jst-row, .jst-drive { scroll-behavior: auto; }
}

/* The Stops timeline on the public story: selection and anchors as the beats had them. */
.jst-drive.is-selected { box-shadow: 0 0 0 3px var(--cailo-tertiary-light); }
.jst-dayrow:target .jst-day-heading, .jst-daybreak:target .jst-day-heading { outline: 3px solid var(--cailo-tertiary-light); outline-offset: 4px; border-radius: 6px; }
.jst .pj-day-note { margin: 8px 0 0; }
.jst .pj-day-note p { font-size: 1rem; }
.jst .pj-daymap { margin: 12px 0 4px; }
.jst .pj-charge-card { margin: 0; }
