/* ================================================================
   FriendsByChance — journeys.css
   Journeys feature (110) styles
   ================================================================ */

/* ── Search bar: THE SEARCH FIELD (shared.css), kept in sight while the
   pane scrolls ─────────────────────────────────────────────────── */
.journeys-search-wrap {
    position:       sticky;
    top:            0;
    z-index:        1;
}

/* ── Section titles: each folds its section (FBC.ui.sectionFold, its look
   components/shared.css) — the chevron where the time section's is. */
.journeys-section-label { margin: 6px 0 0 8px; }

/* ── Pinned (journey-tree.js, PINNED) ──────────────────────────────
   One per row, rows like the tree's, under a header like the tree's (its
   buttons: .journeys-tree-header / -tools); a line under them sets them
   apart from the tree below. */
.journeys-pinned-section:not(:empty) {
    padding-bottom: 6px;
    border-bottom:  1px solid var(--color-divider);
}
.journeys-pinned-list { padding: 0 8px; }

/* ── Tree ───────────────────────────────────────────────────────── */
.journeys-tree-section { flex: 1; padding-bottom: 12px; }
.journeys-tree-header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding-right:   8px;
}
/* Its buttons together, at the end of the line. */
.journeys-tree-tools {
    display:     flex;
    align-items: center;
    gap:         6px;
    margin-top:  4px;
}
.journeys-tree-section > .journey-tree-wrap { padding: 0 8px; box-sizing: border-box; }
.journey-tree-wrap { width: 100%; }
.journey-tree-wrap[hidden] { display: none; }    /* left out by its host (setFiltered) */

/* ── A row (journey-tree.js, A ROW) ────────────────────────────────
   On the pane's own background, the journey's colour as a mark at its
   start and its name in the page's text colour — readable whatever the
   colour, the palest included.  --jt-color / --jt-ink are set on the row's
   element by the tree; the root's are the app's green. */
.journey-tree--root {
    --jt-color: var(--color-primary);
    --jt-ink:   var(--color-primary-dark);
}
.journey-tree-row,
.journeys-search-row {
    position:              relative;
    display:               flex;
    align-items:           center;
    gap:                   10px;
    min-height:            46px;
    margin:                2px 0;
    padding:               4px 4px 4px 6px;
    box-sizing:            border-box;
    border-radius:         10px;
    cursor:                pointer;
    transition:            background 0.12s, box-shadow 0.12s;
    /* A long press opens its actions: not a text selection, nor the
       phone's own menu for it. */
    -webkit-user-select:   none;
    user-select:           none;
    -webkit-touch-callout: none;
}
.journey-tree-row:hover,
.journeys-search-row:hover { background: var(--color-hover); }
/* Selected: the row wears its journey's colour, its ink down its edge. */
.journey-tree-row.active {
    background: var(--jt-color);
    box-shadow: inset 3px 0 0 var(--jt-ink);
}
.journey-tree--root > .journey-tree-row.active { background: var(--color-selected); }
/* Its marker pointed at on The Map (tree.highlightRow). */
.journey-tree-row.hovered {
    background:     var(--color-hover);
    outline:        2px solid var(--jt-ink);
    outline-offset: -2px;
}
/* A row the host has set aside (tree.setMuted — The Map: outside its time
   window): still there, still usable, visibly not "now". */
.journey-tree-row--muted .journey-tree-toggle,
.journey-tree-row--muted .journey-tree-name { opacity: 0.4; }

/* The name: what gives way to a narrow pane (an ellipsis). */
.journey-tree-name {
    flex:          1 1 auto;
    min-width:     0;
    overflow:      hidden;
    white-space:   nowrap;
    text-overflow: ellipsis;
    font-size:     0.95rem;
    font-weight:   600;
    line-height:   1.3;
    color:         var(--color-text);
}
.journey-tree--root > .journey-tree-row .journey-tree-name { font-weight: 700; }

/* The mark — in the tree, the row's TOGGLE: a square in its colour, the
   chevron in its ink, pointing at the name while folded and down while
   open… */
.journey-tree-toggle {
    flex:            0 0 auto;
    width:           30px;
    height:          30px;
    padding:         0;
    border:          1px solid color-mix(in srgb, var(--jt-ink) 28%, transparent);
    border-radius:   9px;
    background:      var(--jt-color);
    color:           var(--jt-ink);
    cursor:          pointer;
    display:         flex;
    align-items:     center;
    justify-content: center;
    transition:      box-shadow 0.12s;
}
.journey-tree-toggle:hover         { box-shadow: 0 0 0 3px color-mix(in srgb, var(--jt-ink) 18%, transparent); }
.journey-tree-toggle:focus-visible { outline: 2px solid var(--jt-ink); outline-offset: 2px; }
.journey-tree--root > .journey-tree-row .journey-tree-toggle { color: #fff; }
.journey-tree-toggle svg {
    width:        16px;
    height:       16px;
    stroke-width: 2.6;
    transform:    rotate(-90deg);
    transition:   transform 0.15s;
}
.journey-tree-toggle--open svg { transform: none; }

/* …and a search result's, which unfolds nothing: a DOT. */
.journey-tree-dot {
    flex:            0 0 auto;
    width:           30px;
    height:          30px;
    display:         flex;
    align-items:     center;
    justify-content: center;
}
.journey-tree-dot::before {
    content:       '';
    width:         12px;
    height:        12px;
    box-sizing:    border-box;
    border-radius: 50%;
    border:        2.5px solid var(--jt-ink);
    background:    var(--jt-color);
}

/* Its parts hang from a guide in its ink, from under its mark. */
.journey-tree-children {
    margin-left:  20px;
    padding-left: 6px;
    border-left:  2px solid color-mix(in srgb, var(--jt-ink) 24%, transparent);
}

/* ── Its buttons: a pinned row's "unpin" first, "⋯" at the end ─────
   In the row, always there (a touch screen has no pointer to show them),
   quiet until wanted. */
.journey-tree-actions {
    flex:        0 0 auto;
    display:     flex;
    align-items: center;
    gap:         2px;
    margin-left: auto;
}
.journey-tree-action {
    width:         34px;
    height:        34px;
    border:        0;
    border-radius: 8px;
    background:    transparent;
    color:         var(--color-text-secondary);
}
.journey-tree-action:hover { background: rgba(62, 39, 35, 0.08); color: var(--color-text); }
.journey-tree-action.fbc-icon-btn--active { background: var(--color-primary); color: #fff; }
.journey-tree-more svg { width: 18px; height: 18px; }

/* ── Search results ─────────────────────────────────────────────── */
.journeys-search-results { padding: 8px; }
.journeys-search-text {
    flex:           1 1 auto;
    min-width:      0;
    display:        flex;
    flex-direction: column;
}
.journeys-search-desc {
    font-size:      0.82em;
    color:          var(--color-text-muted);
    white-space:    nowrap;
    overflow:       hidden;
    text-overflow:  ellipsis;
}

/* ── A journey panel (FBC.journeys.Panel) ──────────────────────────
   The view or the editor of one journey, wherever it is hosted: the
   Journeys page's main pane, over The Map, or in its right pane.  Its
   width is the HOST's, so what depends on width asks the panel (a
   container query, below) rather than the window. */
/* A journey in the right pane (journeys.js: THE RIGHT PANE'S JOURNEY) —
   its own scroll under the history's row, as a contact's there. */
.journeys-pane-host {
    flex:       1;
    min-height: 0;
    overflow-y: auto;
    padding:    12px 14px 20px;
}

.journey-panel {
    display:        flex;
    flex-direction: column;
    gap:            20px;
    container-type: inline-size;
    container-name: journey-panel;
    min-width:      0;
}

/* ── Detail header wrap (card + side column) ───────────────────── */
.journeys-detail-header-wrap {
    display:     flex;
    gap:         8px;
    align-items: flex-start;
}
.journeys-detail-header-wrap .journeys-detail-header-card {
    flex:      1;
    min-width: 0;
}

/* ── Detail header card (full-width, picture-as-background) ─────── */
.journeys-detail-header-card {
    border-radius:       12px;
    overflow:            hidden;
    position:            relative;
    background-color:    color-mix(in srgb, var(--color-primary) 7%, transparent);
    background-size:     cover;
    background-position: center;
    min-height:          10rem;
    display:             flex;
    flex-direction:      column;
    justify-content:     flex-start;
}
.journeys-detail-header-inner {
    padding:        14px 18px 16px;
    display:        flex;
    flex-direction: column;
    gap:            6px;
}
.journeys-detail-header-card.has-picture .journeys-detail-header-inner {
    background: linear-gradient(rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.3) 100%);
}
/* The picture itself: an <img> behind the card's contents (journeys.js
   _paintHeaderPicture — fetched with the session, so never a CSS
   background), covering the card as a background would. */
.journeys-detail-header-picture {
    position:   absolute;
    inset:      0;
    width:      100%;
    height:     100%;
    object-fit: cover;
}
/* …under the card's contents, which come after it. */
.journeys-detail-header-card > .journeys-detail-header-inner { position: relative; }

/* Someone else's journey (People mode): whose — their chip, as everywhere. */
.journeys-detail-person {
    display:     flex;
    align-items: center;
    flex-wrap:   wrap;
    gap:         6px;
    font-size:   0.85rem;
}
.journeys-detail-header-card.has-picture .journeys-detail-person { color: #fff; }

/* "Part of" (above the header): collapsed, the green line alone with a
   short, wide button on its middle — no row of its own (the user,
   2026-10-20); open, every way up to the root above the line. */
.journeys-routes { display: flex; flex-direction: column; gap: 8px; }
.journeys-routes-list {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    padding-left:   8px;
}
.journeys-route .journeys-routes-edit { margin-left: auto; }
.journeys-route {
    display:     flex;
    flex-wrap:   wrap;
    align-items: center;
    gap:         4px 5px;
}
.journeys-route-sep { color: var(--color-text-muted); font-weight: 700; }
.journeys-routes .journey-chip-parent { cursor: pointer; flex-shrink: 0; }
.journeys-routes .journey-chip-parent:hover { opacity: 0.85; }
/* Someone else's top: the person — nothing of theirs to open. */
.journeys-routes .journey-chip-parent--person { cursor: default; }
.journeys-routes .journey-chip-parent--person:hover { opacity: 1; }

/* A journey's card (journeys.js _journeyCard: a step of "Part of", a
   journey's chip shown anywhere): its header, as its view shows it, with
   its square buttons beside it (THE card frame) — wider than a chip's. */
.journeys-card-pop { max-width: min(500px, calc(100vw - 16px)); }
.journeys-card     { width: min(460px, calc(100vw - 48px)); }
.journeys-card .fbc-popover-head > .journeys-detail-header-card { flex: 1 1 auto; }
/* A journey's TILE (the page's tiled view): its header IS the tile — its
   tint (or its picture) edge to edge, no card inside a card — its colour
   down its left edge, its buttons a column at its right; under the header
   (taller) its diary.  The unfold button's chevron turns up while its
   children are shown. */
.journeys-card.journeys-card--tile {
    width:       auto;
    height:      100%;
    gap:         0;
    position:    relative;
    background:  color-mix(in srgb, var(--color-primary) 7%, var(--color-surface));
    border-left: 5px solid var(--jt-color, var(--color-primary));
}
.journeys-card--tile .fbc-popover-head { align-items: stretch; }
.journeys-card--tile .fbc-popover-head > .journeys-detail-header-card {
    flex:             1 1 0;
    min-height:       0;
    border-radius:    0;
    background-color: transparent;
}
.journeys-card--tile .journeys-detail-header-inner { padding: 12px 14px 10px; }
.journeys-card--tile .journeys-detail-header-desc {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.journeys-card--tile .fbc-side-col.fbc-popover-head-actions {
    flex-direction: column;
    padding:        8px 8px 0 0;
}
.journeys-card--tile > :not(.fbc-popover-head) { padding: 0 14px 12px; }
.journeys-tile-toggle svg { transition: transform 0.15s ease; }
.journeys-tile-toggle--open svg { transform: rotate(180deg); }

/* Name + action buttons row */
.journeys-header-name-row {
    display:     flex;
    align-items: center;
    gap:         8px;
}
.journeys-detail-name {
    margin:        0;
    padding:       2px 0;
    font-size:     1.3rem;
    font-weight:   700;
    line-height:   1.2;
    flex:          1;
    min-width:     0;
    overflow:      hidden;
    text-overflow: ellipsis;
    white-space:   nowrap;
    color:         var(--color-text);
}
.journeys-detail-header-card.has-picture .journeys-detail-name {
    color:       #fff;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}

/* Header icon action buttons */
.journeys-header-actions {
    display:     flex;
    gap:         5px;
    flex-shrink: 0;
}

/* Override icon buttons when picture is in the background */
.has-picture .fbc-icon-btn {
    background:   rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.35);
    color:        #fff;
}
.has-picture .fbc-icon-btn:hover  { background: rgba(0,0,0,0.5); }
.has-picture .fbc-icon-btn--active,
.has-picture .fbc-icon-btn--active:hover { background: var(--color-primary); border-color: var(--color-primary); }
.has-picture .fbc-icon-btn.danger { border-color: rgba(255,120,120,0.6); }

/* ── Type badge ─────────────────────────────────────────────────── */
.journeys-type-badge {
    /* Readable on any picture or colour behind the header (the user,
       2026-11-02): a solid light face of its own, its words dark and bold
       — it was muted words on nothing, lost on a picture. */
    display:        inline-block;
    font-size:      0.78em;
    font-weight:    700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color:          var(--color-text);
    background:     color-mix(in srgb, var(--color-surface) 92%, transparent);
    border:         1px solid rgba(0, 0, 0, 0.18);
    border-radius:  4px;
    padding:        2px 7px;
}
/* Badge inside header flex column must not stretch full-width */
.journeys-detail-header-inner .journeys-type-badge {
    align-self: flex-start;
}
/* The editor's: the same badge, pressed to choose (an OptionGrid) — a
   finger's target without a bigger face: the press reaches past it. */
.journeys-type-badge--choose {
    position:    relative;
    line-height: inherit;
    cursor:      pointer;
}
.journeys-type-badge--choose:hover { border-color: var(--color-primary); }
.journeys-type-badge--choose::after { content: ''; position: absolute; inset: -10px -6px; }

/* ── Section blocks within detail ───────────────────────────────── */
.journeys-section {
    display:        flex;
    flex-direction: column;
    gap:            4px;   /* diary slots carry their own padding */
    border-top:     1px solid var(--color-divider);
    padding-top:    16px;
}
.journeys-detail-section-title { margin: 0; }   /* its look: .fbc-section-title */
/* Description inside the detail header card — read-only, capped height with scroll */
.journeys-detail-header-desc {
    --jrny-desc-rows: 7;            /* ← change row cap here */
    max-height:   calc(var(--jrny-desc-rows) * 1.5em);
    overflow-y:   auto;
    font-size:    0.92em;
    line-height:  1.5;
    color:        var(--color-text);
    white-space:  pre-wrap;
    word-break:   break-word;
    margin:       0;
    padding:      0;
    margin-top:   10px;             /* same gap as type-spacer in editor */
}
.has-picture .journeys-detail-header-desc {
    color:       #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ── Associations (Locs | Times | Tags, then Check-ins | Contacts | Chats)
   However wide the panel, the three tag-like blocks share the first line
   and the people and chats the second (the user, 2026-11-02: "At most the
   first 3 should be on the first row (contacts can use the second, with
   Chats)") — a grid of six: a tag-like block two of them, a wide one
   three.  With the check-ins block (2026-11-09), the second line is its
   three, two each — mine, unconfirmed (000 D49).  Narrow, they stack (the
   container query below). */
.journeys-assocs-row {
    display:               grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap:                   12px;
    border-top:            1px solid var(--color-divider);
    padding-top:           16px;
}
.journeys-assoc-col {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    min-width:      0;
}
.journeys-assoc-col--q { grid-column: span 2; }   /* places, times, tags */
.journeys-assoc-col--h { grid-column: span 3; }   /* people, chats */
.journeys-assocs-row:has(> [data-assoc="checkins"]) .journeys-assoc-col--h { grid-column: span 2; }
/* Assoc chip line: plain wrapper for ChippedDisplay */
.journeys-assoc-chips-line {
    display:   block;
    min-height: 22px;
}


/* The group chats a journey adds people to (FBC.chat.linksFor): a block
   of its own, beside its people. */
.journeys-chats { display: flex; flex-wrap: wrap; gap: 6px; }

/* "++": the block's descendants count too.  The type badge's look, at the
   block title's own size; on is the darker grey, off the lighter.  The
   pseudo-element widens the press to a finger's (as the type badge's does). */
.journeys-assoc-more {
    position:       relative;
    font-size:      0.75rem;
    font-weight:    700;
    letter-spacing: 0.06em;
    line-height:    1;
    background:     none;
    cursor:         pointer;
    color:          #b8b8b8;
    flex:           0 0 auto;
}
.journeys-assoc-more--on { color: #5a5a5a; }
.journeys-assoc-more::after { content: ''; position: absolute; inset: -8px -6px; }
.journeys-assocs--folded .journeys-assoc-more { display: none; }

/* A new journey's links, said before it exists. */
.journeys-assoc-note {
    font-size:  0.8rem;
    color:      var(--color-text-muted);
    font-style: italic;
}

/* ── A narrow panel (The Map's right pane) ──────────────────────────
   Asked of the PANEL, not the window: the same journey is wide in the
   Journeys page and over the map, and narrow beside the map.  Its
   columns of chips do not fit in 270px, so they stack — and each gets
   the whole width back. */
@container journey-panel (max-width: 460px) {
    .journeys-assocs-row           { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .journeys-assoc-col--q,
    .journeys-assoc-col--h,
    .journeys-assocs-row:has(> [data-assoc="checkins"]) .journeys-assoc-col--h { grid-column: auto; }
    /* A people or chats block's title gives its line to the choice. */
    .journeys-assoc-col .journeys-section-head { flex-wrap: wrap; }
    .journeys-detail-header-inner  { padding: 12px 12px 14px; }
    .journeys-detail-header-card   { min-height: 7rem; }
    .journeys-detail-name,
    .journeys-name-input--header   { font-size: 1.12rem; }
    .fbc-diary-slot                { padding-left: calc(var(--fbc-grip-w) + 4px); padding-right: 6px; }
}
/* Narrow (the user, 2026-10-20): the header's buttons in a ROW under it,
   rather than a column beside it that takes the header's width. */
@container journey-panel (max-width: 520px) {
    .journeys-detail-header-wrap               { flex-direction: column; align-items: stretch; }
    .journeys-detail-header-wrap > .fbc-side-col {
        flex-direction: row;
        flex-wrap:      wrap;
        justify-content: flex-end;
        padding-top:    0;
    }
}
/* ── Detail bottom action buttons (edit / delete) ───────────────── */
.journeys-detail-actions {
    display:         flex;
    gap:             10px;
    flex-wrap:       wrap;
    justify-content: flex-end;
    margin-top:      40px;
    padding-top:     16px;
    border-top:      1px solid var(--color-divider);
}

/* ── Empty state ────────────────────────────────────────────────── */
.journeys-empty-state {
    color:          var(--color-text-muted);
    font-size:      0.95em;
    align-self:     center;
    margin-top:     80px;
    text-align:     center;
}

/* ── Editor ─────────────────────────────────────────────────────── */
.journeys-field-label {
    display:        block;
    font-size:      0.85em;
    font-weight:    600;
    color:          var(--color-text-muted);
    margin-bottom:  4px;
}
.journeys-name-input,
.journeys-desc-input {
    width:          100%;
    box-sizing:     border-box;
    padding:        8px 10px;
    border:         1px solid var(--color-divider);
    border-radius:  6px;
    font-size:      1.2em;
    background:     var(--color-input-bg, #fff);
    color:          var(--color-text);
}
.journeys-name-input:focus,
.journeys-desc-input:focus { outline: none; border-color: var(--color-primary); }
.journeys-desc-input { resize: vertical; min-height: 72px; }

.journeys-editor-pic {
    width:          100%;
    border-radius:  6px;
    display:        block;
    object-fit:     cover;
}

/* A refusal said in the editor's header (the diary's: components/diary.css). */
.journeys-editor-error {
    color:          var(--color-danger, #c0392b);
    font-size:      0.88em;
    margin-top:     4px;
}

/* ── Modal button rows ─────────────────────────────────────────── */
.journeys-modal-box .row-btns {
    justify-content: flex-end;
    margin-top:      12px;
}

/* ── Editor redesign — header-card interactive elements ─────────── */

/* Picture icon buttons — flows after desc textarea, right-aligned */
.journeys-editor-pic-overlay {
    display:    flex;
    gap:        5px;
    align-self: flex-end;
    margin-top: 6px;
}
.journeys-editor-type-spacer { height: 10px; }
/* Name input — transparent, styled like the name h2 */
.journeys-name-input--header {
    flex:            1;
    min-width:       0;
    background:      transparent;
    border:          none;
    border-radius:   0;
    padding:         2px 0;
    font-size:       1.3rem;
    font-weight:     700;
    line-height:     1.2;
    color:           var(--color-text);
    width:           100%;
}
.journeys-name-input--header:focus         { outline: none; border-bottom-color: var(--color-primary); }
.journeys-name-input--header::placeholder  { color: var(--color-text-muted); font-weight: 400; }
.has-picture .journeys-name-input--header  {
    color:               #fff;
    text-shadow:         0 1px 5px rgba(0,0,0,0.5);
}
/* The line under a journey's name — its view's, its editor's (its input)
   and a "Part of" card's alike: one rule, after the input's own `border`. */
.journeys-detail-name,
.journeys-name-input--header { border-bottom: 1px solid var(--color-divider); }
.has-picture .journeys-detail-name,
.has-picture .journeys-name-input--header { border-bottom-color: rgba(255,255,255,0.45); }
.journeys-name-input--header:focus { border-bottom-color: var(--color-primary); }
.has-picture .journeys-name-input--header:focus        { border-bottom-color: rgba(255,255,255,0.9); }
.has-picture .journeys-name-input--header::placeholder { color: rgba(255,255,255,0.55); }

/* Description textarea inside header card — transparent, matches other header inputs */
.journeys-detail-header-inner .journeys-desc-input {
    background:          transparent;
    border:              none;
    border-bottom:       1px solid var(--color-divider);
    border-radius:       0;
    padding:             4px 0;
    /* The words as the view shows them (.journeys-detail-header-desc). */
    font-size:           0.92em;
    line-height:         1.5;
    color:               var(--color-text);
    resize:              vertical;
    min-height:          54px;
}
.journeys-detail-header-inner .journeys-desc-input:focus {
    outline: none; border-bottom-color: var(--color-primary);
}
.journeys-detail-header-inner .journeys-desc-input::placeholder { color: var(--color-text-muted); }
.has-picture .journeys-detail-header-inner .journeys-desc-input {
    color:               #fff;
    border-bottom-color: rgba(255,255,255,0.45);
    text-shadow:         0 1px 3px rgba(0,0,0,0.5);
}
.has-picture .journeys-detail-header-inner .journeys-desc-input:focus {
    border-bottom-color: rgba(255,255,255,0.9);
}
.has-picture .journeys-detail-header-inner .journeys-desc-input::placeholder {
    color: rgba(255,255,255,0.55);
}

/* Color swatch button — square with rounded edges, same size as icon buttons */
.journeys-editor-color-btn {
    width:         30px;
    height:        30px;
    border-radius: 6px;
    border:        1px solid var(--color-divider);
    cursor:        pointer;
    flex-shrink:   0;
    padding:       0;
    box-shadow:    0 0 0 1px rgba(0,0,0,0.12);
    transition:    box-shadow 0.12s, border-color 0.12s;
}
.journeys-editor-color-btn:hover { box-shadow: 0 0 0 2px var(--color-primary); border-color: var(--color-primary); }

/* ── Modals ─────────────────────────────────────────────────────── */
.journeys-modal-overlay {
    position:       fixed;
    inset:          0;
    background:     rgba(0,0,0,0.45);
    z-index:        200;
    display:        flex;
    align-items:    center;
    justify-content:center;
}
.journeys-modal-box {
    background:     var(--color-bg);
    border-radius:  10px;
    padding:        24px 28px;
    width:          min(480px, 92vw);
    max-height:     80vh;
    overflow-y:     auto;
    display:        flex;
    flex-direction: column;
    gap:            12px;
    box-shadow:     0 8px 32px rgba(0,0,0,0.18);
}
.journeys-modal-box h3 { margin: 0; font-size: 1.1em; }

/* delete preview */
.journeys-delete-preview {
    max-height:     160px;
    overflow-y:     auto;
    border:         1px solid var(--color-divider);
    border-radius:  6px;
    padding:        8px 10px;
    display:        flex;
    flex-direction: column;
    gap:            4px;
}
.journeys-delete-section-label { margin-top: 4px; }   /* its look: .fbc-section-title */
.journeys-delete-row         { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.journeys-delete-solo        { color: var(--color-text-muted); font-size: 0.88em; margin: 4px 0; }
.journeys-delete-confirm-input {
    width:          100%;
    box-sizing:     border-box;
    padding:        7px 10px;
    border:         1px solid var(--color-divider);
    border-radius:  6px;
    font-size:      0.93em;
    background:     var(--color-input-bg, #fff);
    color:          var(--color-text);
}
.journeys-delete-confirm-input:focus { outline: none; border-color: var(--color-danger, #c0392b); }

/* ── Journey chip ───────────────────────────────────────────────── */
/* 40 % taller than .tag-chip — achieved via larger vertical padding */
.journey-chip {
    /* Readable on any colour, on a page as on The Map (the user,
       2026-11-02): its words dark or white by its colour, with a halo
       (.fbc-ink-*, FBC.ui.ColorPicker.chipInk — it was white on every
       colour, pale ones too), bold, a touch spaced, in rem — never shrunk
       by what it sits in — and an edge of its colour darkened. */
    display:        inline-flex;
    align-items:    center;
    border-radius:  10px;
    border:         1px solid rgba(0, 0, 0, 0.22);
    padding:        4px 12px;    /* tag-chip typically 2-3px top/bottom → +40% */
    font-size:      0.88rem;
    font-weight:    700;
    letter-spacing: 0.01em;
    line-height:    1.25;
    white-space:    nowrap;
    overflow:       hidden;
    max-width:      200px;
    cursor:         default;
    user-select:    none;
}
/* The name is what gives way to a short chip (FBC.ui.journeyChip). */
.journey-chip-name {
    min-width:     0;
    overflow:      hidden;
    text-overflow: ellipsis;
}
/* The root journey's colour — wherever its chip appears (FBC.ui.journeyChip). */
.journey-chip--root { background-color: var(--color-primary); }

/* ── Association chips ──────────────────────────────────────────── */
.journeys-assoc-chips {
    display:        flex;
    flex-wrap:      wrap;
    gap:            5px;
    align-items:    center;
}
.journeys-assoc-none {
    color:          var(--color-text-muted);
    font-size:      0.85em;
    font-style:     italic;
}
.journeys-assoc-loading {
    color:          var(--color-text-muted);
    font-size:      0.82em;
}
.journeys-assoc-error {
    color:          var(--color-danger, #c0392b);
    font-size:      0.85em;
    padding:        4px 0;
}

/* ── Loading / error states ─────────────────────────────────────── */
.journeys-loading {
    color:          var(--color-text-muted);
    font-size:      0.88em;
    padding:        12px 12px;
}
.journeys-error {
    color:          var(--color-danger, #c0392b);
    font-size:      0.88em;
    padding:        8px 12px;
}
.journeys-empty {
    color:          var(--color-text-muted);
    font-size:      0.88em;
    padding:        8px 12px;
}

/* An editor section's title on the left, its actions on the right. */
.journeys-section-head {
    display:     flex;
    align-items: center;
    gap:         8px;
    margin-bottom: 8px;
}
.journeys-section-actions {
    display:     flex;
    flex-wrap:   wrap;
    justify-content: flex-end;
    gap:         6px;
    margin-left: auto;
}
/* ── Modal full-screen on very narrow screens ───────────────────── */
@media (max-width: 480px) {
    .journeys-modal-overlay { align-items: flex-end; }
    .journeys-modal-box {
        width:         100%;
        max-width:     100%;
        border-radius: 16px 16px 0 0;
        max-height:    90vh;
    }
}

/* ── The four association blocks, in the view and the editor ────────
   One builder (journeys.js "The four association blocks").  Ruled off
   from what is above them, with the fold button sitting on that rule, at
   its right end — where it takes no line of its own. */
.journeys-assocs {
    position:    relative;
    border-top:  1px solid var(--color-divider);
    padding-top: 18px;
}
.journeys-assocs--edit {
    display:        flex;
    flex-direction: column;
    gap:            20px;
}
/* The container draws the rule the first section used to. */
.journeys-assocs--edit > .journeys-assocs-head + .journeys-section {
    border-top:  0;
    padding-top: 0;
}
.journeys-assocs-head {
    position: absolute;
    top:      -15px;
    right:    0;
}
.journeys-assocs-fold { background: var(--color-surface); }
.journeys-assoc-col .journeys-section-head { margin-bottom: 0; }

/* How many a block holds: said while it is folded, and as a dash when it
   is empty — whose (empty) body then takes no room at all. */
.journeys-assoc-count {
    display:     none;
    font-size:   0.75rem;
    font-weight: 600;
    color:       var(--color-text-muted);
}
.journeys-assoc-block--empty .journeys-assoc-count,
.journeys-assocs--folded .journeys-assoc-count { display: inline; }
.journeys-assoc-block--empty .journeys-assoc-chips-line,
.journeys-assoc-block--empty .journeys-assoc-chips,
.journeys-assocs--folded .journeys-assoc-chips-line,
.journeys-assocs--folded .journeys-assoc-chips { display: none; }

/* Folded: the view's titles flow on one line where they fit (a flex
   row, not the grid's slots); the editor's are short rows, each still
   with its actions. */
.journey-panel .journeys-assocs--folded.journeys-assocs-row {
    display:   flex;
    flex-wrap: wrap;
    gap:       6px 22px;
}
.journey-panel .journeys-assocs--folded .journeys-assoc-col { flex: 0 0 auto; }
/* The editor folded closes its blocks whole: a collapsed block is hidden,
   not shown as a row per kind (the user, 2026-10-21). */
.journeys-assocs--folded.journeys-assocs--edit .journeys-section { display: none; }
.journeys-assocs--folded .journeys-section {
    border-top:  0;
    padding-top: 0;
}

/* ── The pinned rows, put in order by hand (FBC.ui.dragReorder) ───── */
.journey-tree-wrap.dragging > .journey-tree-row  { opacity: 0.4; }
/* A pinned row's grip (.fbc-drag-handle), first on it — in the pinned
   list's edit mode only (FBC.ui.editMode). */
.journey-tree-drag-handle { align-self: stretch; margin-right: -4px; }
/* Lit up a moment, then gone — shown, not selected (The Map: a person's
   chip pressed twice brings their journeys' root into view). */
.journey-tree-row--flash { animation: journey-tree-flash 1.6s ease-out; }
@keyframes journey-tree-flash {
    0%, 35% { background: color-mix(in srgb, var(--color-primary) 30%, transparent); }
    100%    { background: transparent; }
}
.journey-tree-wrap.drag-before > .journey-tree-row { box-shadow: inset 0 2px 0 var(--color-primary); }
.journey-tree-wrap.drag-after  > .journey-tree-row { box-shadow: inset 0 -2px 0 var(--color-primary); }

/* ── The time section over a list of journeys (FBC.journeyTime: The Map's
   worlds, the Journeys page) ─────────────────────────────────────────── */
.journey-time {
    flex:          0 0 auto;
    display:       flex;
    flex-direction: column;
    gap:           6px;
    padding:       10px 12px 12px;
    border-bottom: 1px solid var(--color-divider);
}
/* Folded to its title: the row alone, as tall as a tree section's. */
.journey-time.fbc-section--folded { padding-bottom: 6px; }
.journey-time-title {
    display:     flex;
    flex-wrap:   wrap;
    align-items: center;
    gap:         6px;
    color:       var(--color-text-muted);
}
.journey-time-title svg { flex: 0 0 auto; }
/* Its ready-made days, at the end of the title's row — on a row of their
   own where they do not fit beside it. */
.journey-time-title .trb-presets {
    flex:        0 0 auto;
    max-width:   100%;
    margin-left: auto;
}


/* The Journeys page's left pane: the time section, then the tree, which
   scrolls under it (as The Map's .map-mode-body). */
.journeys-page .fbc-pane-left { overflow: hidden; }
.journeys-left-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
