/* ══════════════════════════════════════════════════════════════
   EXPLORER CONSOLE
   Layout: index above the Ask PadreGPT session (left), map (centre),
   dossier + journey log (right), timeline (bottom). Navy-black panels, gilt chrome, vellum text; the
   bright colours are reserved for data (routes, tracked figures, timeline).
   explore.css still styles the content inside the panels.
   ══════════════════════════════════════════════════════════════ */

/* Tokens, panels, buttons and the top bar come from site.css. */

body { overflow: hidden; }

/* ── Frame ─────────────────────────────────────────────── */

.console {
    height: 100%;
    display: grid;
    gap: 10px;
    grid-template-columns: 288px minmax(0, 1fr) 340px;
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 1.2fr) auto;
    grid-template-areas: "top top top" "lib map itin" "sess map itin" "chron chron chron";
    padding-block: 10px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.console > .top { grid-area: top; }

/* ── Index (figures / events / doctrines) ──────────────── */

.lib { grid-area: lib; display: flex; flex-direction: column; }
.lib .panel-mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--rule); flex: 0 0 auto; }
.lib .mode-tab {
    padding: 9px 4px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    border-right: 1px solid var(--rule);
}
.lib .mode-tab:last-child { border-right: 0; }
.lib .mode-tab:hover { color: var(--tan); }
.lib .mode-tab.active { color: var(--bone); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--gilt); }
.figures-body, .events-body, .doctrines-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.lib .figure-search-wrap { display: flex; align-items: center; gap: 0; margin: 0; border-bottom: 1px solid var(--rule); }
.lib .figure-search-wrap > span { padding: 9px 0 9px 12px; color: var(--gilt); }
.lib .figure-search-wrap input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    color: var(--bone);
    font: inherit;
    font-size: 12px;
    padding: 9px 10px 9px 8px;
}
.lib .figure-search-wrap input::placeholder { color: var(--muted); }
.lib .figure-search-wrap button {
    background: none;
    border: 0;
    border-left: 1px solid var(--rule);
    color: var(--gilt);
    font-family: var(--mono);
    font-size: 15px;
    padding: 6px 12px;
    align-self: stretch;
}
.lib .figure-search-wrap button:hover { background: rgba(230,185,79,.08); }

.lib .category-tabs { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 12px; margin: 0; border-bottom: 1px solid var(--rule); justify-content: flex-start; flex: 0 0 auto; }
.lib .cat-tab {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 7px;
    border: 1px solid var(--rule-2);
    color: var(--tan);
    background: none;
}
.lib .cat-tab:hover { border-color: var(--fde); color: var(--bone); }
.lib .cat-tab.active { border-color: var(--gilt); color: var(--gilt); background: rgba(230,185,79,.08); }

.figures-grid, .lib .events-list, .lib .doctrines-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: 4px 0;
}
.figures-grid { display: block; }
.figures-grid::-webkit-scrollbar, .log::-webkit-scrollbar, #event-card .card-inner::-webkit-scrollbar,
.explorer-chat-messages::-webkit-scrollbar, .lib .events-list::-webkit-scrollbar, .lib .doctrines-list::-webkit-scrollbar { width: 6px; }
.figures-grid::-webkit-scrollbar-thumb, .log::-webkit-scrollbar-thumb, #event-card .card-inner::-webkit-scrollbar-thumb,
.explorer-chat-messages::-webkit-scrollbar-thumb, .lib .events-list::-webkit-scrollbar-thumb, .lib .doctrines-list::-webkit-scrollbar-thumb { background: var(--rule-2); }

.figure-avatar {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 12px;
    border-left: 2px solid transparent;
    cursor: pointer;
}
.figure-avatar:hover { background: rgba(255,255,255,.03); }
.figure-avatar .fr-sw { width: 10px; height: 10px; border: 1px solid var(--c); }
.figure-avatar.selected .fr-sw { background: var(--c); }
.figure-avatar.focus { border-left-color: var(--gilt); background: var(--panel-2); }
.figure-avatar .fr-text { min-width: 0; }
.figure-avatar .fr-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--bone); }
.figure-avatar .fr-meta { display: block; font-size: 10px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figure-avatar .fr-tag { font-size: 9px; letter-spacing: .12em; color: var(--tan); border: 1px solid var(--c); padding: 0 4px; }
.figure-avatar .fr-x { font-size: 14px; color: var(--muted); padding: 0 2px; line-height: 1; }
.figure-avatar .fr-x:hover { color: var(--signal); }
.figure-avatar.era-dimmed { opacity: .42; }
.figure-avatar.era-dimmed.selected { opacity: 1; }
.figure-avatar.loading .fr-sw { animation: fr-pulse 1s ease-in-out infinite; }
@keyframes fr-pulse { 50% { background: var(--c); } }

.lib .figures-actions {
    display: flex;
    justify-content: flex-start;
    gap: 6px;
    margin: 0;
    padding: 8px 12px;
    border-top: 1px solid var(--rule);
    flex: 0 0 auto;
}
.lib .figures-actions button {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 5px 9px;
    border: 1px solid var(--rule-2);
    color: var(--tan);
}
.lib .figures-actions button:hover { border-color: var(--bone); color: var(--bone); }
.lib .figure-search-loading { padding: 10px 12px; border-bottom: 1px solid var(--rule); }

.lib .event-list-item { padding: 7px 12px; border: 0; border-bottom: 1px solid var(--rule); gap: 9px; }
.lib .event-list-item.selected { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--gilt); }
.lib .event-list-label { font-size: 15px; color: var(--bone); line-height: 1.25; }
.lib .event-list-location { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lib .event-list-year { font-family: var(--mono); font-size: 10.5px; color: var(--tan); }
.lib .events-figure-filter-header { padding: 8px 12px; margin: 0; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.lib .doctrines-body .figure-search-wrap { margin: 0; }
.lib .doctrine-item { padding: 7px 12px; }
.lib .doctrine-text { font-size: 14.5px; line-height: 1.3; }
.lib .doctrine-category { padding: 8px 12px 4px; letter-spacing: .12em; text-transform: uppercase; }
.lib .doctrines-footer { padding: 8px 12px; margin: 0; border-top: 1px solid var(--rule); }

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

.mapwrap { grid-area: map; overflow: hidden; isolation: isolate; }   /* keeps Leaflet's and the HUD's z-indexes inside */
#explore-map { position: absolute; inset: 0; background: #57756d; z-index: 0; }
.leaflet-container { font-family: var(--mono); }
.mapwrap::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 600;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 1px, transparent 1px 3px),
                radial-gradient(ellipse at center, transparent 58%, rgba(6,7,13,.55) 100%);
}
.leaflet-bar { border: 1px solid var(--black) !important; border-radius: 0 !important; box-shadow: none !important; }
.leaflet-bar a, .leaflet-control-zoom a {
    background: var(--panel) !important;
    color: var(--gilt) !important;
    border-bottom: 1px solid var(--rule-2) !important;
    border-radius: 0 !important;
    font-family: var(--mono) !important;
}
.leaflet-bar a:hover { background: var(--panel-2) !important; }
.leaflet-top.leaflet-right { top: 8px; right: 8px; }
.leaflet-control-attribution { background: rgba(6,7,13,.8) !important; color: var(--muted) !important; font-size: 9.5px !important; font-family: var(--mono); }
.leaflet-control-attribution a { color: var(--tan) !important; }
.map-marker-tooltip, .leaflet-tooltip.map-marker-tooltip {
    background: var(--black) !important;
    border: 1px solid var(--fde) !important;
    border-radius: 0 !important;
    color: var(--bone) !important;
    font-family: var(--mono);
    font-size: 11px;
    padding: 5px 8px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.leaflet-tooltip-top.map-marker-tooltip::before { border-top-color: var(--fde) !important; }
.leaflet-tooltip-bottom.map-marker-tooltip::before { border-bottom-color: var(--fde) !important; }
.leaflet-tooltip-left.map-marker-tooltip::before { border-left-color: var(--fde) !important; }
.leaflet-tooltip-right.map-marker-tooltip::before { border-right-color: var(--fde) !important; }

.frame { position: absolute; inset: 8px; z-index: 650; pointer-events: none; }
.frame i { position: absolute; width: 26px; height: 26px; border: 2px solid var(--gilt); filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000); }
.frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.hud { position: absolute; z-index: 800; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-tl { top: 16px; left: 18px; display: flex; flex-direction: column; gap: 6px; max-width: min(64%, 560px); }
.feed { display: flex; align-items: center; gap: 8px; background: var(--black); padding: 4px 8px; font-size: 10px; letter-spacing: .18em; color: var(--tan); align-self: flex-start; white-space: nowrap; }
.feed .rec { color: var(--signal); font-weight: 600; }
.fchips { display: flex; flex-wrap: wrap; gap: 5px; }
.fchip { display: flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: .04em; padding: 3px 7px; background: var(--black); border: 1px solid var(--rule-2); color: var(--tan); }
.fchip i { width: 9px; height: 9px; background: var(--c); display: inline-block; }
.fchip .tid { color: var(--muted); font-size: 9.5px; letter-spacing: .1em; }
.fchip.focus { border-color: var(--gilt); color: var(--bone); }
.fchip .fx { color: var(--muted); margin-left: 2px; padding: 0 2px; }
.fchip .fx:hover { color: var(--signal); }
.hud-bl { left: 18px; bottom: 26px; }
.legend { background: var(--black); border: 1px solid var(--rule-2); min-width: 214px; }
.legend summary { list-style: none; cursor: pointer; padding: 7px 10px; font-size: 10px; letter-spacing: .2em; color: var(--tan); text-transform: uppercase; }
.legend summary::-webkit-details-marker { display: none; }
.legend summary::after { content: " \25BE"; color: var(--muted); }
.legend[open] summary { border-bottom: 1px solid var(--rule); }
.lg { padding: 7px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: var(--tan); }
.lg svg { flex: 0 0 auto; background: #b9a985; }
.lg .li { display: flex; align-items: center; gap: 8px; }
.lg .li .jstop { flex: 0 0 auto; }
.lg hr { border: 0; border-top: 1px solid var(--rule); margin: 4px 0; width: 100%; }
.lg label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.lg input { accent-color: var(--gilt); }
.lg .btn { align-self: flex-start; margin-top: 3px; }
.hud-br { right: 18px; bottom: 30px; font-size: 10px; letter-spacing: .08em; color: var(--gilt); background: var(--black); padding: 4px 8px; }
.toast {
    position: absolute;
    z-index: 900;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    max-width: min(520px, calc(100% - 32px));
    background: var(--black);
    border: 1px solid var(--rule-2);
    border-left: 8px solid var(--gilt);
    padding: 7px 12px;
    font-size: 11px;
    color: var(--bone);
    box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.toast.err { border-left-color: var(--signal); color: #ffd2c4; }

/* Map markers: black casings and ink labels so they read on the terrain */
.jm, .map-lbl { background: none !important; border: 0 !important; }
.jstop {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    font: 600 10px/1 var(--mono);
    color: var(--black);
    background: var(--c);
    border: 2px solid var(--black);
    position: relative;
    cursor: pointer;
}
.jstop.ahead { background: var(--parch); color: var(--ink); border: 1.5px solid var(--ink); opacity: .85; }
.jstop.now { background: var(--black); color: var(--c); border: 2px solid var(--c); box-shadow: 0 0 0 2px var(--black); z-index: 2; }
.jstop.now i { top: 4px; left: 32px; }   /* repeat count sits outside the tracker's corners */
.jstop i { position: absolute; top: -12px; left: 15px; font: 600 10px/1 var(--mono); font-style: normal; color: var(--c); background: var(--black); padding: 2px 3px; white-space: nowrap; }
.jstop-dot { width: 9px; height: 9px; background: var(--c); border: 1.5px solid var(--black); cursor: pointer; }
.jstop-dot.ahead { background: var(--parch); border-color: var(--ink); opacity: .85; }
.jstop-ink { width: 6px; height: 6px; background: var(--ink); opacity: .55; }
.jchev, .jwave { width: 14px; height: 14px; display: grid; place-items: center; color: var(--c); text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 3px #000; }
.jchev { font: 700 16px/1 var(--mono); }
.jwave { font: 700 13px/1 var(--mono); }
.leaflet-interactive.journey-hit { cursor: pointer; }
/* Trackers (base in site.css): tags, and the smaller mark for other figures */
.tgt.on-stop .core { visibility: hidden; }   /* the stop's number fills the corners instead */
.tgt .tag { position: absolute; left: 14px; top: -44px; white-space: nowrap; background: var(--black); border-left: 3px solid var(--c); padding: 3px 7px; font: 600 10px/1.25 var(--mono); letter-spacing: .08em; color: var(--bone); }
.tgt .tag .tid { color: var(--c); margin-right: 5px; }
.tgt .tag .sy { display: block; font-weight: 500; color: var(--tan); letter-spacing: .04em; }
.tgt.ghost { cursor: pointer; }
.tgt.ghost .bx { left: -11px; top: -11px; width: 22px; height: 22px; }
.tgt.ghost .bx i { width: 7px; height: 7px; border-width: 2px; }
.tgt.ghost .core { left: -3px; top: -3px; width: 6px; height: 6px; }
.tgt.ghost .tag { left: 12px; top: -27px; font-size: 9px; padding: 2px 5px; border-left-width: 2px; }
.lbl {
    position: absolute;
    white-space: nowrap;
    font: 500 13px/1.15 var(--serif);
    color: #3a2e1c;
    pointer-events: none;
    text-shadow: 0 0 2px var(--parch), 0 0 3px var(--parch), 0 0 5px var(--parch), 0 0 7px var(--parch);
}
.lbl.l-cur { font-weight: 700; color: #120d06; }
.lbl.l-ahead { color: #5b4a30; }
.lbl.l-old { font-style: italic; font-size: 12px; color: #6d5a3e; }
.lbl.l-ghost { font: 500 10px/1.2 var(--mono); color: var(--c); background: var(--black); padding: 1px 4px; text-shadow: none; letter-spacing: .04em; }
.lbl.era-place-major { font: 600 13px/1.15 var(--serif); color: #2e2414; letter-spacing: 0; }
.lbl.era-place-mid { font: 500 12px/1.15 var(--serif); color: #43361f; }
.lbl.era-place-minor { font: italic 500 11px/1.15 var(--serif); color: #5a4a30; opacity: 1; }
/* A place opened from a link: a gilt tracker and its name for a few seconds */
.place-ping { position: relative; pointer-events: none; }
.place-ping .core { display: none; }   /* corners only: a stop's number or the place's dot stays readable */
.place-ping span { position: absolute; left: 14px; top: -40px; white-space: nowrap; background: var(--black); border-left: 3px solid var(--gilt); padding: 2px 7px; font: 600 10px/1.3 var(--mono); letter-spacing: .08em; color: var(--bone); text-transform: uppercase; }
.chat-bubble .xlink { color: inherit; }
.chat-bubble .xlink:hover { color: var(--gilt); }
@media (prefers-reduced-motion: no-preference) {
    .journey-live { animation: ants 1s linear infinite; }
    @keyframes ants { to { stroke-dashoffset: -22; } }
    .feed .rec { animation: blink 1.4s steps(2, start) infinite; }
    @keyframes blink { to { visibility: hidden; } }
}

/* ── Dossier ───────────────────────────────────────────── */

.itin { grid-area: itin; display: flex; flex-direction: column; overflow: hidden; }
.dossier { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 4px 11px; padding: 12px; border-bottom: 1px solid var(--rule); }
.dsig { grid-row: span 2; width: 46px; height: 46px; display: grid; place-items: center; background: var(--black); border: 1px solid var(--rule-2); color: var(--c); font: 600 15px/1 var(--mono); position: relative; }
.dsig::before, .dsig::after { content: ""; position: absolute; width: 8px; height: 8px; border: 2px solid var(--c); }
.dsig::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.dsig::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.dname { font-family: var(--serif); font-size: 22px; line-height: 1.05; color: var(--bone); }
.dmeta { font-size: 10px; letter-spacing: .04em; color: var(--muted); }
.dbrief { grid-column: 1 / -1; margin: 6px 0 0; font-family: var(--serif); font-size: 15px; line-height: 1.35; color: var(--tan); }
.dact { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.dact .btn { padding: 4px 8px; }
.welcome { padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; color: var(--tan); border-bottom: 1px solid var(--rule); }
.welcome h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 21px; color: var(--bone); }
.welcome p { margin: 0; font-family: var(--serif); font-size: 15.5px; line-height: 1.45; }
.welcome .quick { display: flex; flex-wrap: wrap; gap: 6px; }
.jchips { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--rule); align-items: center; }
.jchips .lab { font-size: 9.5px; letter-spacing: .2em; color: var(--muted); margin-right: 4px; }
.jc { font-size: 10.5px; letter-spacing: .06em; padding: 4px 8px; border: 1px solid var(--rule-2); color: var(--tan); }
.jc[aria-pressed="true"] { background: var(--gilt); color: var(--black); border-color: var(--gilt); }
.loghead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 8px 5px 12px; font-size: 9.5px; letter-spacing: .2em; color: var(--muted); border-bottom: 1px solid var(--rule); background: var(--bezel); }
.loghead .seg { display: flex; }
.loghead .jc { font-size: 9.5px; letter-spacing: .1em; padding: 3px 7px; text-transform: uppercase; }
.loghead .jc + .jc { border-left: 0; }
.loghead b { color: var(--tan); font-weight: 500; }
.log { flex: 1 1 auto; min-height: 150px; overflow: auto; position: relative; }
.jh { position: sticky; top: 0; z-index: 2; display: block; width: 100%; text-align: left; padding: 7px 12px; background: var(--panel-2); border-bottom: 1px solid var(--rule); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--bone); }
.jh small { display: block; font-size: 10px; letter-spacing: .04em; text-transform: none; color: var(--muted); margin-top: 1px; }
.jh.dim { color: var(--muted); }
.jh:not(.dim) { box-shadow: inset 3px 0 0 var(--c); }
.row { display: grid; grid-template-columns: 14px 24px 58px minmax(0, 1fr) auto; gap: 6px; align-items: center; width: 100%; text-align: left; padding: 5px 12px 5px 8px; color: var(--tan); }
.row:hover { background: rgba(255,255,255,.035); }
.row .cur { color: var(--c); font-weight: 700; font-size: 9px; }
.row .rn { color: var(--muted); font-size: 10.5px; }
.row .ry { color: var(--tan); font-size: 10.5px; opacity: .85; white-space: nowrap; }
.row .rp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rf { font-size: 11.5px; color: var(--tan); white-space: nowrap; }
.row.past .rp { color: var(--bone); }
.row.ahead { opacity: .45; }
.row.now { background: linear-gradient(90deg, rgba(255,255,255,.07), transparent); box-shadow: inset 3px 0 0 var(--c); }
.row.now .rp { color: #fff; font-weight: 600; }
.row.now .ry { color: var(--gilt); }

/* The record: the current stop, or an event / route / profile */
#event-card { display: none; flex-direction: column; min-height: 0; max-height: 46%; border-top: 1px solid var(--rule); background: var(--bezel); }
#event-card.open { display: flex; }
.itin .log:empty { flex: 0 0 0; min-height: 0; }
.itin .log:empty + #event-card.open { max-height: none; flex: 1; }
#event-card .ph { position: relative; padding-right: 34px; }
#event-card .card-close { position: absolute; right: 8px; top: 4px; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 4px; }
#event-card .card-close:hover { color: var(--gilt); }
#event-card.rec-stop .card-close { display: none; }
#event-card .card-inner { overflow: auto; padding: 10px 12px 12px; }
#event-card .card-location { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; padding: 0; }
#event-card .card-title { font-family: var(--serif); font-size: 20px; font-weight: 500; line-height: 1.15; color: var(--bone); margin-bottom: 4px; }
#event-card.rec-stop .card-location { font-family: var(--serif); font-size: 20px; letter-spacing: 0; text-transform: none; color: var(--bone); line-height: 1.15; }
#event-card.rec-stop .card-title { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--tan); }
#event-card .card-date { font-family: var(--mono); font-size: 11px; color: var(--gilt); opacity: 1; margin-bottom: 8px; }
#event-card .card-description { font-family: var(--serif); font-size: 15.5px; line-height: 1.4; color: var(--bone); }
#event-card .card-evidence { background: none; border: 0; border-left: 2px solid var(--rule-2); padding: 2px 0 2px 10px; }
#event-card .card-evidence-ref { font-size: 11px; }
#event-card .wp-source-item { border-bottom-color: var(--rule); }
#event-card .wp-source-text, #event-card .card-evidence-quote { font-size: 14.5px; color: var(--tan); }
#event-card .card-actions { flex-wrap: wrap; margin: 10px 0; }
#event-card .card-chat-btn { flex: 0 1 auto; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; padding: 6px 10px; border: 1px solid var(--gilt); background: none; color: var(--gilt); }
#event-card .card-chat-btn:hover { background: rgba(230,185,79,.1); }
#event-card .card-chat-btn.rec-back { border-color: var(--rule-2); color: var(--tan); }
#event-card .card-chat-btn.rec-back:hover { border-color: var(--bone); color: var(--bone); background: none; }
#event-card .card-figures-row { border-top-color: var(--rule); }
#event-card .card-figures-row:empty { display: none; }
#event-card .card-figure-chip { background: var(--black); border-color: var(--rule-2); }
#event-card .card-figure-name { font-size: 13px; }
.rec-visits { font-size: 11px; color: var(--tan); line-height: 1.5; }
.rec-visits .k { color: var(--muted); letter-spacing: .14em; font-size: 9.5px; margin-right: 6px; }

.explorer-chat-welcome { text-align: left; padding: 0; color: var(--tan); }
.explorer-chat-welcome p { font-family: var(--serif); font-size: 15.5px; line-height: 1.4; color: var(--bone); margin: 0; }
.explorer-suggestions { margin-top: 12px; gap: 5px; }
.suggestion { text-align: left; font-family: var(--mono); font-size: 11px; color: var(--bone); padding: 6px 8px; border: 1px solid var(--rule-2); background: none; }
.suggestion::before { content: "> "; color: var(--gilt); }
.suggestion:hover { border-color: var(--gilt); color: var(--gilt); background: none; }
.chat-msg { margin-bottom: 12px; }
.chat-msg.user { text-align: left; }
.chat-msg .chat-bubble, .chat-msg.user .chat-bubble, .chat-msg.assistant .chat-bubble {
    display: block;
    max-width: none;
    background: none;
    border: 0;
    padding: 0;
    font-family: var(--serif);
    font-size: 15.5px;
    line-height: 1.42;
    color: var(--bone);
}
.chat-msg.user .chat-bubble::before, .chat-msg.assistant .chat-bubble::before {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .14em;
    color: var(--tan);
    margin-bottom: 3px;
}
.chat-msg.user .chat-bubble::before { content: "YOU"; color: var(--gilt); }
.chat-msg.assistant .chat-bubble::before { content: "PADREGPT"; }
.chat-bubble .chat-cite { font-family: var(--mono); font-size: 10.5px; color: var(--gilt); }
.explorer-action-btn { font-family: var(--mono); font-size: 10.5px; padding: 5px 8px; border: 1px solid var(--gilt); background: none; color: var(--gilt); }
.explorer-action-btn:hover { background: rgba(230,185,79,.1); }
.source-web { margin-top: 8px; border: 1px solid var(--rule-2); background: var(--black); }
.source-web summary { cursor: pointer; padding: 5px 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--tan); }
.source-web[open] summary { border-bottom: 1px solid var(--rule); }
.source-web .sw-body { padding: 6px 8px; display: flex; flex-direction: column; gap: 5px; }
.source-web .sw-entry { border-left: 2px solid var(--c); padding-left: 8px; font-family: var(--mono); font-size: 11px; line-height: 1.4; }
.source-web .sw-type { display: block; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--c); }
.source-web .sw-citations { color: var(--bone); }
.explorer-chat-input { display: flex; align-items: stretch; gap: 0; padding: 0; border-top: 1px solid var(--rule); }
.explorer-chat-input > span { padding: 11px 0 11px 12px; color: var(--gilt); }
.explorer-chat-input textarea { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--bone); font-family: var(--mono); font-size: 12px; padding: 11px 10px; resize: none; }
.explorer-chat-input textarea:focus { border: 0; }
.explorer-chat-input button { background: none; border: 0; border-left: 1px solid var(--rule); color: var(--gilt); font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; padding: 0 14px; }
.explorer-chat-input button:hover { background: rgba(230,185,79,.08); opacity: 1; }

.mtabs { display: none; }

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

#timeline-viewer { grid-area: chron; height: 132px; display: flex; flex-direction: column; transition: height .3s ease; }
#timeline-viewer.collapsed { height: auto !important; }
#timeline-viewer.collapsed .tl-track-wrap, #timeline-viewer.collapsed .tl-axis { display: none; }
#timeline-viewer .tl-toolbar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--rule); min-height: 40px; flex-wrap: nowrap; overflow: hidden; }
#timeline-viewer .tl-toolbar-label { font-family: var(--mono); font-weight: 600; font-size: 11px; letter-spacing: .2em; color: var(--tan); }
.cbtn { flex: 0 0 auto; width: 30px; height: 26px; border: 1px solid var(--rule-2); color: var(--bone); font-size: 12px; display: grid; place-items: center; }
.cbtn:hover { border-color: var(--bone); }
.cbtn.play { background: var(--gilt); border-color: var(--gilt); color: var(--black); width: 40px; }
.ro { display: flex; align-items: baseline; gap: 9px; min-width: 0; flex: 1 1 320px; }
.ro .rl { font-size: 9.5px; letter-spacing: .24em; color: var(--muted); }
.ro b { font-size: 20px; font-weight: 600; color: var(--bone); letter-spacing: .04em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ro .rc { color: var(--tan); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ro .rc strong { color: var(--bone); font-weight: 500; }
#timeline-viewer .event-nav { margin-left: 0; border-left: 1px solid var(--rule-2); flex: 0 1 auto; min-width: 0; }
#timeline-viewer .event-nav-name { font-family: var(--mono); }
#timeline-viewer .event-nav-label { font-family: var(--serif); font-size: 13.5px; color: var(--bone); max-width: 200px; }
.tl-zoom { display: flex; gap: 4px; flex: 0 0 auto; }
#timeline-viewer .tl-btn { background: none; border: 1px solid var(--rule-2); color: var(--bone); width: 24px; height: 24px; }
#timeline-viewer .tl-btn:hover { border-color: var(--bone); background: none; color: var(--bone); }
#timeline-viewer .tl-toggle { margin-left: 0; color: var(--muted); flex: 0 0 auto; }
#timeline-viewer .tl-loading-bar { background: var(--bezel); border-bottom-color: var(--rule); }
#timeline-viewer .tl-loading-text { font-family: var(--mono); font-size: 11px; }
#timeline-viewer .tl-loading-fill { background: var(--cyan); }
.tl-track-wrap::-webkit-scrollbar-thumb { background: var(--rule-2) !important; }
#tl-center-indicator { width: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
#tl-center-indicator::before { border-top-color: var(--cyan); }
#tl-center-indicator::after { border-bottom-color: var(--cyan); }
#tl-center-year { font-family: var(--mono); color: var(--cyan); top: 2px; left: 6px; transform: none; background: var(--black); padding: 0 4px; }
.tl-era-band.tl-era-active { border-color: rgba(67,230,217,.45); }
.tl-era-label { font-family: var(--mono); color: rgba(232,227,212,.45); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; }
.tl-bar { opacity: .5; }
.tl-bar.focus { opacity: .22; }
.tl-bar-label { font-family: var(--mono); font-size: 8px; color: rgba(232,227,212,.6); }
.tl-bar.focus .tl-bar-label { color: var(--bone); font-weight: 600; top: -14px; }
.tl-chap { position: absolute; height: 14px; background: var(--c); opacity: .45; cursor: pointer; z-index: 3; overflow: hidden; border-right: 1px solid var(--black); }
.tl-chap:hover { opacity: .8; }
.tl-chap.on { opacity: 1; box-shadow: 0 0 0 1px var(--bone); }
.tl-chap span { display: block; padding: 0 4px; font: 600 8.5px/14px var(--mono); color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tl-tick { position: absolute; width: 1px; height: 4px; background: var(--c); opacity: .8; pointer-events: none; z-index: 2; }
.tl-dot { border-color: var(--black); }
.tl-axis-label { font-family: var(--mono); font-size: 9px; color: var(--muted); }
.tl-tooltip { background: var(--black); border-color: var(--fde); font-family: var(--mono); color: var(--bone); }

/* ── Narrower screens ──────────────────────────────────── */

@media (max-width: 1240px) {
    .console { grid-template-columns: 250px minmax(0, 1fr) 300px; }
    .status .opt { display: none; }
    #timeline-viewer .event-nav { display: none !important; }
}
@media (max-width: 900px) {
    html, body { height: auto; }
    body { overflow: auto; }
    .console { height: auto; display: flex; flex-direction: column; }
    .top { order: 0; }
    .mapwrap { order: 1; height: 58vh; min-height: 340px; }
    #timeline-viewer { order: 2; }
    .mtabs { order: 3; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--rule); }
    .mtabs button { padding: 10px 4px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--rule); }
    .mtabs button:last-child { border-right: 0; }
    .mtabs button[aria-selected="true"] { color: var(--bone); box-shadow: inset 0 -2px 0 var(--gilt); }
    .lib { order: 4; }
    .itin { order: 5; overflow: visible; }
    .lib, .itin { display: none; }
    .lib.m-on, .itin.m-on { display: flex; }
    .lib .figures-grid, .lib .events-list, .lib .doctrines-list { max-height: 56vh; }
    .itin .log { max-height: 46vh; }
    #event-card { max-height: none; }
    #event-card .card-inner { overflow: visible; }
    .status { margin-left: 0; width: 100%; }
    .bs em { display: none; }
    .bl { font-size: 26px; }
    .hud-tl { max-width: calc(100% - 70px); }
    .legend { min-width: 0; }
    .hud-br { display: none; }
    .ro { flex-basis: 100%; order: 10; }
    #timeline-viewer { height: auto !important; }
    #timeline-viewer .tl-track-wrap { flex: 0 0 auto; height: 112px; }
    #timeline-viewer .tl-toolbar { flex-wrap: wrap; }
    #timeline-viewer .tl-toolbar-label { display: none; }
}

/* ── Shell: Chat, Sources and Canvas open below the top bar ── */

.views { display: none; position: relative; grid-row: 2 / 5; grid-column: 1 / -1; z-index: 900; min-height: 0; background: var(--black); }
body:not(.view-explorer) .views { display: block; }
.views iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--black); visibility: hidden; }
.views iframe.on { visibility: visible; }
body:not(.view-explorer) .top .status,
body:not(.view-explorer) .top .ask { display: none; }
@media (max-width: 900px) {
    html:has(body:not(.view-explorer)), body:not(.view-explorer) { height: 100%; overflow: hidden; }
    body:not(.view-explorer) .console { height: 100%; }
    /* Keep the map's panels laid out (offscreen) rather than collapsed: a zero-size
       Leaflet map can't fit bounds while it restores the remembered view. */
    body:not(.view-explorer) .console > :not(.top):not(.views) { position: fixed !important; left: -300vw; top: 0; width: 100vw; visibility: hidden; }
    .views { order: 1; flex: 1 1 auto; }
}

/* ── UX review fixes ───────────────────────────────────── */

/* The log and the record share the dossier, so the record is readable on a laptop */
.log { flex: 1 1 0; min-height: 110px; }
#event-card.open { flex: 1 1 0; max-height: none; min-height: 180px; }
@media (max-height: 800px) { .dbrief { display: none; } }

/* Upcoming stops and dimmed figures: dim with colour, not opacity, so the text stays legible */
.row.ahead { opacity: 1; }
.row.ahead .rp, .row.ahead .ry, .row.ahead .rn { color: var(--muted); }
.figure-avatar.era-dimmed { opacity: .6; }

/* Visible focus on the explorer's own inputs */
.lib .figure-search-wrap:focus-within, .explorer-chat-input:focus-within { box-shadow: inset 0 0 0 1px var(--gilt); }

/* No-match row in the figure index */
.fr-none { padding: 14px 12px; display: grid; gap: 8px; justify-items: start; font-family: var(--serif); font-size: 15px; color: var(--tan); }
.fr-none span { font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* Profile and record tags */
#card-evidence > .source-tag { display: inline-block; margin: 0 6px 4px 0; padding: 1px 6px; border: 1px solid var(--rule-2); font: 500 10px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--tan); }

/* Timeline: each figure's name beside its own bar; era names along the bottom */
.tl-bar { opacity: 1; background: color-mix(in srgb, var(--c, #888) 45%, transparent); }
.tl-bar:hover { opacity: 1; background: color-mix(in srgb, var(--c, #888) 65%, transparent); }
.tl-bar.focus { opacity: 1; background: color-mix(in srgb, var(--c, #888) 22%, transparent); }
.tl-bar-label, .tl-bar.focus .tl-bar-label { top: 0; left: auto; right: calc(100% + 6px); font: 600 9px/14px var(--mono); letter-spacing: .04em; color: var(--c, var(--tan)); }
.tl-era-label { bottom: 3px; color: rgba(232,227,212,.62); }

/* "REC" only while the journey plays; otherwise the year alone */
.feed .rec { display: none; }
body.playing .feed .rec { display: inline; }

/* Hairline seams between tiles at fractional zoom */
#explore-map .leaflet-tile-container img.leaflet-tile { width: 256.5px !important; height: 256.5px !important; }

/* Views load behind a quiet placeholder */
.views::before { content: "Loading\2026"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font: 500 11px var(--mono); letter-spacing: .2em; text-transform: uppercase; }
.views iframe { background: transparent; }

/* Event controls read as events, not as a second set of transport buttons */
.event-nav::before { content: "EVENTS"; font: 500 9.5px var(--mono); letter-spacing: .2em; color: var(--muted); margin-right: 2px; }

/* Touch targets */
@media (pointer: coarse) {
    .cbtn { min-width: 44px; height: 40px; }
    .cbtn.play { min-width: 56px; }
    #timeline-viewer .tl-btn, #timeline-viewer .tl-toggle { width: 40px; height: 40px; display: grid; place-items: center; }
    .leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; }
    .lib .mode-tab { min-height: 44px; }
    .lib .cat-tab { min-height: 36px; }
    .lib .figures-actions button { min-height: 40px; }
    .figure-avatar { min-height: 48px; }
    .figure-avatar .fr-x { min-width: 40px; min-height: 40px; }
    .row { min-height: 40px; }
    .jc, .loghead .jc { min-height: 36px; }
    .fchip { min-height: 36px; }
    .fchip .fx { padding: 8px; margin: -8px -6px -8px 0; }
    .explorer-action-btn, .suggestion { min-height: 40px; }
    #chat-panel .chat-panel-close, #event-card .card-close { min-width: 44px; min-height: 40px; display: grid; place-items: center; font-size: 20px; }
    #event-card .card-close { top: 0; right: 0; }
    .lg label { min-height: 36px; }
}

@media (max-width: 900px) {
    .ro .rc { white-space: normal; }
    /* The phone has Index / Dossier / Ask tabs: keep the top bar short */
    .console > .top .status, .console > .top .ask { display: none; }
    /* With nothing tracked, the map offers a few figures to start with */
    .fchip.quick { display: inline-flex; }
}
.fchip.quick { display: none; }

/* A figure's tag opens to the left near the map's right edge */
.tgt.flip .tag { left: auto; right: 14px; border-left: 0; border-right: 3px solid var(--c); text-align: right; }
.tgt.ghost.flip .tag { right: 12px; border-right-width: 2px; }

/* Ask drawer: "On the map" chips and the answer's actions, as in Chat */
.explorer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; }
.explorer-actions .kicker { margin-right: 4px; }
.explorer-actions .chip { text-decoration: none; text-transform: none; letter-spacing: .02em; font-size: 10.5px; }
.explorer-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.lib .events-figure-filter-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lib .events-figure-filter-header .btn { padding: 3px 7px; font-size: 9.5px; }

/* Phones: Index / Dossier / Ask stay in reach at the bottom of the screen */
@media (max-width: 900px) {
    .mtabs { position: sticky; bottom: 0; z-index: 1500; background: var(--black); padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -10px 24px rgba(0,0,0,.55); }
    .mtabs button { min-height: 44px; }
}

/* ── Ask PadreGPT: the research session, always open under the Index ── */

.sess { grid-area: sess; display: flex; flex-direction: column; }
.sess .ph em { margin-left: auto; }
.sess-bar { display: flex; border-bottom: 1px solid var(--rule); flex: 0 0 auto; }
.sess-pick {
    flex: 1;
    min-width: 0;
    appearance: none;
    -webkit-appearance: none;
    background: var(--black) linear-gradient(45deg, transparent 50%, var(--gilt) 50%) no-repeat right 12px center / 6px 6px;
    border: 0;
    border-right: 1px solid var(--rule);
    color: var(--bone);
    font: 500 11px/1.2 var(--mono);
    letter-spacing: .04em;
    padding: 8px 26px 8px 12px;
    text-overflow: ellipsis;
    cursor: pointer;
}
.sess-pick:focus-visible { outline: 1px solid var(--gilt); outline-offset: -1px; }
.sess-new { flex: 0 0 auto; padding: 0 12px; font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gilt); }
.sess-new:hover { background: rgba(230,185,79,.08); }
.sess-full {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid var(--rule);
    font: 500 10px var(--mono);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tan);
    text-align: left;
}
.sess-full:hover { color: var(--gilt); background: rgba(230,185,79,.05); }
.sess-stream { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; overscroll-behavior: contain; }
.sess-stream::-webkit-scrollbar { width: 6px; }
.sess-stream::-webkit-scrollbar-thumb { background: var(--rule-2); }
.sess-stream .chat-msg { margin-bottom: 10px; }
.sess-stream .chat-msg .chat-bubble { font-size: 15px; }
.sess-stream .explorer-foot { flex-wrap: wrap; }
.sess-welcome p { font-family: var(--serif); font-size: 15px; line-height: 1.4; color: var(--bone); margin: 0 0 10px; }
.sess-welcome .suggestion { display: block; width: 100%; margin-bottom: 5px; }
.sess-input { display: flex; align-items: stretch; border-top: 1px solid var(--rule); flex: 0 0 auto; }
.sess-input > span { padding: 11px 0 11px 12px; color: var(--gilt); }
.sess-input textarea { flex: 1; min-width: 0; max-height: 120px; background: transparent; border: 0; color: var(--bone); font-family: var(--mono); font-size: 12px; padding: 11px 10px; resize: none; }
.sess-input textarea:focus { outline: none; }
.sess-input:focus-within { box-shadow: inset 0 0 0 1px var(--gilt-dim); }
.sess-input button { border-left: 1px solid var(--rule); color: var(--gilt); font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 0 14px; }
.sess-input button:hover { background: rgba(230,185,79,.08); }
.sess-input button:disabled { color: var(--muted); }

/* A tighter Index, so the session gets room: one line per figure, and the
   category filters in one scrolling row. */
.figure-avatar { padding: 4px 12px; gap: 8px; }
.figure-avatar .fr-text { display: flex; align-items: baseline; gap: 8px; }
.figure-avatar .fr-name { flex: 1 1 auto; min-width: 0; font-size: 11.5px; }
.figure-avatar .fr-meta { flex: 0 0 auto; font-size: 9.5px; }
.lib .category-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 7px 12px; }
.lib .category-tabs::-webkit-scrollbar { display: none; }
.lib .cat-tab { flex: 0 0 auto; white-space: nowrap; }
.lib .figures-actions { padding: 5px 12px; }
.lib .figures-actions button { padding: 3px 8px; }
.lib .figure-search-wrap input { padding-top: 7px; padding-bottom: 7px; }

@media (max-width: 900px) {
    .sess { order: 6; display: none; height: 72vh; min-height: 360px; }
    .sess.m-on { display: flex; }
    .sess-stream { overscroll-behavior: auto; }
    .sess-input textarea { font-size: 16px; }
    .sess-pick, .sess-new, .sess-full { min-height: 44px; }
    .figure-avatar { padding: 9px 12px; }
}

/* Notes on an event record (kept in the session's log) */
.card-notes { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--rule-2); }
.cn-head { font: 600 10px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--gilt); margin-bottom: 6px; }
.cn-head em { font-style: normal; color: var(--muted); letter-spacing: .06em; margin-left: 6px; }
.cn-item { border-left: 2px solid var(--gilt-dim); padding: 2px 0 2px 9px; margin-bottom: 8px; }
.cn-item p { margin: 0; font-family: var(--serif); font-size: 15px; line-height: 1.35; color: var(--bone); white-space: pre-wrap; overflow-wrap: anywhere; }
.cn-item time { font: 500 10px var(--mono); color: var(--muted); letter-spacing: .04em; }
.cn-empty { margin: 0 0 8px; font: 500 10.5px/1.45 var(--mono); color: var(--muted); }
.cn-form { display: grid; gap: 6px; }
.cn-form textarea { width: 100%; resize: vertical; min-height: 54px; background: var(--black); border: 1px solid var(--rule-2); color: var(--bone); font: 12px/1.4 var(--mono); padding: 7px 9px; }
.cn-form textarea:focus { border-color: var(--gilt); outline: none; }
.cn-form .btn { justify-self: start; }

/* A tracked doctrine: its councils carry gilt trackers with a label */
.doc-mark { position: relative; cursor: pointer; }
.doc-mark .core { display: none; }
.doc-mark span { position: absolute; left: 14px; top: -36px; white-space: nowrap; background: var(--black); border-left: 3px solid var(--gilt); padding: 2px 7px; font: 600 10px/1.3 var(--mono); letter-spacing: .08em; color: var(--bone); text-transform: uppercase; }
.fchip.doc i { background: var(--gilt); }
.fchip.doc .tid { color: var(--gilt); }
.doc-councils .chip { margin: 0 6px 6px 0; }
.doc-ref { margin: 4px 0 10px; font: 500 11px/1.5 var(--mono); color: var(--tan); }
.doc-ref.muted { color: var(--muted); }
.doctrine-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.lib .doctrine-item.tracked { box-shadow: inset 2px 0 0 var(--gilt); background: var(--panel-2); }

/* Map tooltips: solid (Leaflet draws them at 90% opacity), and a stop's
   tooltip says what happened there. */
.leaflet-tooltip.map-marker-tooltip { opacity: 1 !important; white-space: normal; width: max-content; max-width: 300px; line-height: 1.4; }
.map-marker-tooltip .tt-note { display: block; margin: 3px 0 4px; font-family: var(--serif); font-size: 14.5px; line-height: 1.3; color: var(--bone); }
.map-marker-tooltip .tt-meta { display: block; font-size: 10px; letter-spacing: .04em; color: var(--muted); }

/* ══ Phones: the map and its tracker on top, Ask PadreGPT below.
   The Index and the Dossier open as full-screen sheets (from the menu, the
   "+ Figure" chip, or a record), and the timeline is a slim strip. ══ */

.m-head { display: none; }
@media (max-width: 900px) {
    html, body { height: 100%; overflow: hidden; }
    .console { height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 6px; padding-block: 6px; }
    .console > .top { order: 0; flex: 0 0 auto; }
    .mapwrap { order: 1; flex: 0 0 auto; height: 40dvh; min-height: 220px; }
    #timeline-viewer { order: 2; flex: 0 0 auto; }
    .sess { order: 3; display: flex !important; flex: 1 1 auto; height: auto !important; min-height: 0 !important; }
    .mtabs { display: none !important; }

    /* the timeline as a strip: step / play / step, the year and stop, a short scrubber */
    #timeline-viewer .tl-toolbar { flex-wrap: nowrap; gap: 6px; padding: 5px 8px; }
    #timeline-viewer .tl-toolbar-label, #timeline-viewer .tl-zoom, #timeline-viewer .tl-toggle,
    #timeline-viewer .event-nav, #timeline-viewer .tl-axis { display: none !important; }
    #timeline-viewer .ro { order: 0; flex: 1 1 0; min-width: 0; flex-basis: auto; cursor: pointer; }
    #timeline-viewer .ro b { font-size: 16px; }
    #timeline-viewer .ro .rc { white-space: nowrap; }
    #timeline-viewer .cbtn { width: 40px; height: 40px; }
    #timeline-viewer .tl-track-wrap { height: 46px !important; }

    /* the Index and the Dossier as sheets over everything */
    .lib, .itin { display: none !important; }
    .lib.m-sheet, .itin.m-sheet {
        display: flex !important;
        position: fixed;
        inset: 0;
        z-index: 2600;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        overflow: auto;
    }
    .itin.m-sheet .log { max-height: none; flex: 0 0 auto; }
    .lib.m-sheet .figures-grid, .lib.m-sheet .events-list, .lib.m-sheet .doctrines-list { max-height: none; }
    .m-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex: 0 0 auto;
        padding: 4px 4px 4px 14px;
        border-bottom: 1px solid var(--rule-2);
        background: var(--black);
        font: 600 11px var(--mono);
        letter-spacing: .18em;
        text-transform: uppercase;
        color: var(--gilt);
        position: sticky;
        top: 0;
        z-index: 3;
    }
    .m-close { width: 44px; height: 44px; font-size: 24px; line-height: 1; color: var(--bone); }
    .itin.m-sheet > .ph { display: none; }   /* the sheet's own header says it */
    .sess > .ph { display: none; }           /* on phones the chat box needs no title */
    .sess-full { min-height: 36px !important; padding: 4px 12px; }
    .fchip.add { border-style: dashed; color: var(--gilt); }
}
@media (min-width: 901px) {
    .fchip.add { display: none; }
}
