/* The Codex tab (codex-view.mjs): an index on the left, the entry on the right. Tokens from style.css (docs/ui.md).
   Teal only for you (your kills, your level); ??? in dim gray, dashed. On a phone the index folds into a bar over the entry. */
.cx-page { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.cx-page > * { min-width: 0; }

/* ---------- index ---------- */
.cx-index { padding: var(--s5) var(--s4); gap: var(--s5); position: sticky; top: 0; max-height: calc(100dvh - 210px); overflow-y: auto; }
.cx-fold { display: none; }
.cx-groups { display: grid; gap: var(--s5); }
.cx-grp h3 { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin: 0 0 var(--s2); padding: 0 var(--s3); font: var(--kicker); letter-spacing: var(--kicker-track); text-transform: uppercase; color: var(--muted); }
.cx-grp h3 small { font: var(--label); letter-spacing: var(--label-track); color: var(--dim); }
.cx-grp ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.cx-row { width: 100%; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); min-height: var(--h-btn-sm); padding: var(--s2) var(--s3); text-align: left; color: var(--text); font: 500 13px var(--sans); border: 1px solid transparent; border-radius: var(--r-btn); }
.cx-row:hover:not(:disabled) { border-color: var(--line); background: var(--inset); }
.cx-row.on { border-color: var(--line-strong); background: var(--amber-wash); color: var(--bright); }
.cx-row .cx-ico { display: inline-flex; color: var(--amber); }
.cx-row .cx-ico .glyph { width: 14px; height: 14px; margin: 0; }
.cx-row .cx-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-row .cx-n { font: 500 11px var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; }
.cx-row .cx-n.full { color: var(--amber); }
.cx-row.unknown { color: var(--gray); }
.cx-row.unknown .cx-name { font-family: var(--mono); letter-spacing: 1px; }
.cx-none { display: block; width: 8px; height: 8px; margin: 0 auto; transform: rotate(45deg); border: 1px solid var(--dim); opacity: 0.7; }

/* ---------- entry ---------- */
.cx-entry { gap: var(--s6); }
.cx-head { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.cx-head.solo { grid-template-columns: minmax(0, 1fr); }
.cx-art { height: 180px; background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-btn); overflow: hidden; }
.cx-art canvas { display: block; width: 100%; height: 100%; }
.cx-title { display: grid; gap: var(--s4); align-content: start; min-width: 0; }
.cx-title h2 { font: var(--kicker); letter-spacing: var(--kicker-track); text-transform: uppercase; color: var(--muted); }
.cx-title h1 { font-size: 26px; line-height: 1.1; color: var(--bright); letter-spacing: 1px; overflow-wrap: anywhere; }
.cx-title h1.unknown { font-family: var(--mono); color: var(--gray); }
.cx-entry .you { color: var(--you); }
.cx-by { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); color: var(--muted); max-width: none; }
.cx-by .byline { margin: 0; }
.cx-label { font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--dim); }
.cx-link { display: inline-flex; align-items: center; min-height: var(--h-chip); padding: 0 var(--s3); font: 600 11px var(--mono); letter-spacing: 1px; text-transform: uppercase; color: var(--amber); border: 1px solid var(--line-strong); border-radius: var(--r-tag); }
.cx-link:hover { background: var(--amber-wash); }
.cx-rule { color: var(--text); max-width: 72ch; padding: var(--s4) var(--s5); border-left: 2px solid var(--amber-deep); background: var(--inset); }

.cx-sec { display: grid; gap: var(--s4); }
.cx-kick { display: flex; align-items: baseline; gap: var(--s3); margin: 0; padding-bottom: var(--s2); border-bottom: 1px solid var(--line); font: var(--kicker); letter-spacing: var(--kicker-track); text-transform: uppercase; color: var(--muted); }
.cx-kick small { font: var(--label); letter-spacing: var(--label-track); color: var(--dim); }
.cx-kick small b { font-weight: 600; }
.cx-foot { font: 12px var(--sans); color: var(--dim); }
.cx-entry .cxp-hint { font: 12px var(--sans); color: var(--dim); }

/* A part: tooltip grammar. Name, then Integrity and ◆, the attack line (name, number, timing), what it does, the answer, the drop. */
.cx-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.cx-part { display: grid; gap: var(--s3); align-content: start; padding: var(--s5); background: var(--inset); border: 1px solid var(--line); border-top: 2px solid var(--amber-deep); border-radius: var(--r-btn); min-width: 0; }
.cx-part p { margin: 0; max-width: none; }
.cxp-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.cxp-head b { font: 600 15px var(--sans); color: var(--bright); margin-right: auto; }
.cxp-stats { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); font: 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.cxp-stats b { color: var(--bright); font-weight: 600; }
.cxp-atk { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); padding: var(--s2) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 12px var(--mono); }
.cxp-atk b { color: var(--amber); font-weight: 600; }
.cxp-atk .cxp-dmg { color: var(--bright); }
.cxp-atk .cxp-when { color: var(--dim); margin-left: auto; }
.cxp-atk.none b { color: var(--dim); }
.cx-entry .cxp-does { color: var(--text); font-size: 13px; line-height: 1.45; }
.cx-entry .cxp-answer { color: var(--you); font-size: 13px; line-height: 1.45; }
.cx-entry .cxp-answer::before, .cx-rule .cx-ans::before { content: '▸ '; } /* the answer line, as the fight board's tooltips draw it (docs/ui.md "Tooltip style") */
.cx-entry .cxp-exe { color: var(--dim); font-size: 12px; line-height: 1.45; margin-top: var(--s1); cursor: help; } /* its .exe build (exe.mjs), red like the board's */
.cx-rule .cx-ans { display: block; margin-top: var(--s2); color: var(--you); }
.cx-entry .cxp-tele { color: var(--muted); font-size: 12px; }
.cx-entry .cxp-tele .glyph { width: 11px; height: 11px; margin: 0 var(--s2) 0 0; vertical-align: -1px; }
.cx-entry .cxp-loot { display: flex; align-items: center; gap: var(--s2); font: 12px var(--mono); color: var(--muted); }
.cx-entry .cxp-loot .glyph { width: 12px; height: 12px; margin: 0; color: var(--amber); }
/* Research (research.mjs): a bar of 20 with marks at 1, 5 and 20, lit once reached; what's locked reads ??? and what unlocks it. */
.cxp-res { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s4); }
.cxr-bar { position: relative; height: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 1px; }
.cxr-bar > b { display: block; height: 100%; background: var(--amber-soft); }
.cxr-mk { position: absolute; top: -4px; bottom: -4px; width: 1px; margin-left: -1px; background: var(--gray); }
.cxr-mk.on { background: var(--amber); }
.cxr-n { font: 500 11px var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }
.cxr-n.full { color: var(--amber); }
.cx-entry .cxp-hits { font: 12px var(--mono); color: var(--muted); }
.cx-entry .cxp-lock { font: 12px/1.4 var(--sans); color: var(--dim); }
.cx-entry .cxp-lock > span { font: 12px var(--mono); letter-spacing: 1px; color: var(--gray); margin-right: var(--s3); }
.cx-entry .cxp-rides { font-size: 12px; line-height: 1.45; color: var(--muted); }
.cx-entry .cxp-rides b { color: var(--text); font-weight: 600; }
.cx-entry .cxp-rides small { font: 11px var(--mono); color: var(--dim); }
.cx-entry .cxp-perk { font-size: 12px; line-height: 1.45; color: var(--amber-soft); }
.cx-part.t0 { border-top-width: 1px; }
.cx-part.mastered { border-top-color: var(--amber-soft); }
.cxp-head .pmast { margin-left: var(--s3); }
.cx-entry .stat strong.full { color: var(--amber); }
.cx-part.unknown { border-style: dashed; border-top-width: 1px; border-color: var(--line); }
.cx-part.unknown .cxp-head b, .cx-part.unknown .cxp-stats, .cx-part.unknown .cxp-does { font-family: var(--mono); color: var(--gray); }

/* Attack sets: a strip a set, a row a part, a mark on each cycle it fires (1 to 12). */
.cx-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s4); align-items: start; }
.cx-set { display: grid; gap: var(--s3); padding: var(--s4) var(--s5); background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-btn); min-width: 0; }
.cx-set.unknown { border-style: dashed; }
.cxs-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); }
.cxs-head b { font: 600 14px var(--sans); color: var(--bright); }
.cx-set.unknown .cxs-head b { font-family: var(--mono); color: var(--gray); }
.cxs-head small { font: 12px var(--sans); color: var(--muted); }
.cx-set.unknown .cxs-head small { color: var(--dim); }
.cxs-by { margin-left: auto; display: flex; gap: var(--s3); }
.cxs-by .byline { margin: 0; }
.cxs-strip { display: grid; gap: 2px; }
.cxs-row { display: grid; grid-template-columns: minmax(64px, 96px) repeat(12, minmax(0, 1fr)); gap: 2px; align-items: center; }
.cxs-name { font: 11px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: var(--s2); }
.cxs-name em { font-style: normal; color: var(--next); margin-left: var(--s2); }
.cxs-row i { display: block; height: 14px; border: 1px solid var(--line); border-radius: 1px; background: transparent; }
.cxs-row i.m { background: var(--amber); border-color: var(--amber); }
.cxs-row i.m.dlv { background: transparent; border: 1px dashed var(--amber); }
.cxs-cycles i { height: auto; border: 0; font: 9px var(--mono); font-style: normal; color: var(--dim); text-align: center; }

/* Tells and loot: rows. */
.cx-tells { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); align-items: start; }
.cx-tell { display: grid; gap: var(--s3); align-content: start; padding: var(--s4) var(--s5); background: var(--inset); border: 1px solid var(--line); border-left: 2px solid var(--hot); border-radius: var(--r-btn); }
.cx-tell p { margin: 0; }
.cx-tell.unknown { border-left: 1px dashed var(--line); border-style: dashed; }
.cxt-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.cxt-head b { font: 600 14px var(--sans); color: var(--bright); }
.cx-tell.unknown .cxt-head b { font-family: var(--mono); color: var(--gray); }
.cxt-head small { font: 12px var(--sans); color: var(--muted); }
.cxt-head .tag.dim { margin-left: auto; }
.cx-loot { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s2) var(--s4); }
.cx-loot li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.cx-loot .glyph { width: 13px; height: 13px; margin: 0; color: var(--amber); }
.cx-loot b { font: 600 13px var(--sans); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-loot small { font: 11px var(--mono); color: var(--dim); }
.cx-loot li.unknown b { font-family: var(--mono); color: var(--gray); }
.cx-loot li.unknown .glyph { color: var(--dim); }
/* A boss's loot, Grouped (docs/floor-items.md): a group a source, its odds for the next kill as an amber bar. */
.cx-lg { display: grid; gap: var(--s5); }
.cxg-head { display: flex; align-items: baseline; gap: var(--s4); padding-bottom: var(--s2); border-bottom: 1px solid var(--line-strong); }
.cxg-head .cx-label, .cxg-head small { white-space: nowrap; }
.cxg-head small { font: 11px var(--mono); color: var(--dim); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cxg-odds { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s3); }
.cxg-bar { width: 96px; height: 6px; background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-tag); overflow: hidden; }
.cxg-bar b { display: block; height: 100%; background: var(--amber); }
.cxg-odds em { font: 600 12px var(--mono); font-style: normal; color: var(--amber); min-width: 4ch; text-align: right; }
.cxg-grp.set .cxg-bar b { background: var(--r-set); }
.cxg-grp.set .cxg-odds em { color: var(--r-set); }
.cxg-grp.set .cx-loot .glyph { color: var(--r-set); }
@media (max-width: 520px) { .cxg-head { flex-wrap: wrap; } .cxg-bar { width: 64px; } }

/* A boss's phases. */
.cx-phases { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.cx-phases li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--s4); align-items: start; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.cx-phases p { margin: 0; color: var(--text); font-size: 13px; }
.cxph-at { font: 600 13px var(--mono); color: var(--amber); }
.cxph-guide { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s2); }
.cx-phases .cxph-guide li { border: 0; padding: 0; }
.cxph-guide li > span:only-child { grid-column: 1 / -1; }
.cxph-guide li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s4); font-size: 13px; color: var(--text); }
.cxph-guide li b { font: 600 12px var(--mono); color: var(--amber); }
.cx-phases .cxp-hint { margin-top: var(--s2); color: var(--dim); }
@media (max-width: 520px) { .cxph-guide li { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.cxph-mechs { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2) !important; }
.cx-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.cx-head .tag[style*='--ax'] { color: var(--ax); border-color: var(--ax); display: inline-flex; align-items: center; gap: var(--s2); }
.cx-head .tag .glyph { width: 11px; height: 11px; margin: 0; }
/* ---------- phone: the index folds into a bar above the entry ---------- */
@media (max-width: 900px) {
  .cx-page { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .cx-index { position: static; max-height: none; overflow: visible; padding: var(--s3); gap: var(--s4); }
  .cx-fold { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s4); width: 100%; min-height: var(--h-btn); padding: var(--s3) var(--s4); text-align: left; border: 1px solid var(--line-strong); border-radius: var(--r-btn); }
  .cx-fold b { color: var(--bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cx-fold .cx-caret { color: var(--amber); }
  .cx-page:not(.idx-open) .cx-groups { display: none; }
  .cx-groups { gap: var(--s4); }
  .cx-side { display: none; }
  .cx-top { grid-template-columns: minmax(0, 1fr); }
  .cx-page.side-shut { grid-template-columns: minmax(0, 1fr); }
  .side-shut .cx-index > :not(.cx-top), .side-shut .cx-top .lg-tabs { display: revert; }
  .side-shut .cx-index > .cx-fold { display: grid; }
  .cx-grp ul { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s3); }
  .cx-head { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .cx-art { height: 150px; }
  .cx-entry { padding: var(--s5) var(--s4); }
  .cx-parts, .cx-sets, .cx-tells { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .cxs-row { grid-template-columns: minmax(52px, 72px) repeat(12, minmax(0, 1fr)); }
}
/* A page with a tile or two (a boss, a mutation): tiles keep a tile's width. */
.cx-head.solo .stats > .stat { flex: 0 1 200px; }

/* ---------- the Collection tab (collection-view.mjs): the Ledger ---------- */
/* The index's top: the fold-away button and the two tabs. Folded, the index is a rail with only the button. */
.cx-top { display: grid; grid-template-columns: var(--h-btn-sm) minmax(0, 1fr); gap: var(--s3); }
.cx-side { display: grid; place-items: center; min-height: var(--h-btn-sm); color: var(--amber); font: 600 15px var(--mono); border: 1px solid var(--line-strong); border-radius: var(--r-btn); }
.cx-side:hover { background: var(--amber-wash); }
.cx-page.side-shut { grid-template-columns: calc(var(--h-btn-sm) + 2 * var(--s3)) minmax(0, 1fr); }
.side-shut .cx-index { padding: var(--s3); }
.side-shut .cx-index > :not(.cx-top), .side-shut .cx-top .lg-tabs { display: none; }
.side-shut .cx-top { grid-template-columns: var(--h-btn-sm); }
.lg-find { width: 100%; min-height: var(--h-btn-sm); padding: 0 var(--s4); font: 13px var(--sans); color: var(--bright); background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-btn); }
.lg-find::placeholder { color: var(--dim); }
.lg-find:focus { outline: none; border-color: var(--line-strong); }
.lg-none { padding: 0 var(--s3); font: 12px var(--sans); color: var(--dim); }
/* Amber is what you've collected (a set piece in the set's green), gray ??? what's left; the date it first came on the right. */
.lg-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); border-radius: var(--r-btn); overflow: hidden; }
.lg-tabs button { min-height: var(--h-btn-sm); font: var(--label); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--muted); }
.lg-tabs button + button { border-left: 1px solid var(--line-strong); }
.lg-tabs button.on { background: var(--amber-wash); color: var(--bright); }
.lg-tabs small { font: inherit; color: var(--dim); margin-left: var(--s2); }
.lg-n { font: 500 11px var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; }
.lg-n.full { color: var(--amber); }
.lg-setname { color: var(--r-set); }
.lg-bar { display: block; height: 4px; background: var(--inset); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.lg-bar b { display: block; height: 100%; background: var(--amber-soft); }
.lg-bar.thin { grid-column: 2 / 4; height: 3px; border: 0; background: var(--amber-wash); }
.cx-row.lg-row { row-gap: 2px; }
.lg-entry { gap: var(--s6); }
.lg-head { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: var(--s6); align-items: end; padding-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.lg-head h2 { display: flex; gap: var(--s3); align-items: center; }
.lg-total { display: grid; gap: var(--s3); justify-items: end; }
.lg-total b { font: 600 24px var(--mono); color: var(--bright); font-variant-numeric: tabular-nums; }
.lg-total b small { font-size: 14px; color: var(--dim); }
.lg-total .lg-bar { width: 100%; height: 6px; }
.lg-lines { list-style: none; margin: 0; padding: 0; display: grid; max-width: 760px; }
.lg-line { display: grid; grid-template-columns: 16px 200px minmax(0, 1fr) 56px; gap: var(--s4); align-items: center; min-height: 26px; padding: 0 var(--s3); border-bottom: 1px solid var(--amber-wash); }
.lg-line .lg-ico { display: inline-flex; color: var(--gray); }
.lg-line .lg-ico .glyph { width: 14px; height: 14px; margin: 0; }
.lg-line b { font: 500 13px var(--sans); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-line b.unk { font-family: var(--mono); letter-spacing: 1px; color: var(--gray); }
.lg-line .lg-hint { font: 12px var(--sans); color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-line time { font: 11px var(--mono); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.lg-line.got .lg-ico { color: var(--amber); }
.lg-line.got.set .lg-ico { color: var(--r-set); }
.lg-line.got b { color: var(--bright); }
.lg-line.got b.r-zeroday { color: var(--r-zeroday); }
.lg-line.got b.r-set { color: var(--r-set); }
/* An earned piece you lack (earned.mjs, the Segments look): named and muted, a cell a count (set green for a set piece,
   amber for a unique) and its goal with n/N, its pin where the date goes. */
.lg-line b.lg-earn { color: var(--muted); }
.lg-goal { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.lg-goal small { font: 11px var(--mono); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ecells { display: inline-flex; flex: none; gap: 2px; }
.ecells i { width: 6px; height: 8px; border: 1px solid var(--line-strong); border-radius: 1px; }
.ecells.set i.on { background: var(--r-set); border-color: var(--r-set); }
.ecells.uniq i.on { background: var(--amber); border-color: var(--amber); }
.lg-pin { justify-self: end; display: inline-flex; padding: 2px; background: none; border: 0; color: var(--gray); cursor: pointer; }
.lg-pin .glyph { width: 13px; height: 13px; margin: 0; }
.lg-pin:hover, .lg-pin:focus-visible { color: var(--text); }
.lg-pin.on { color: var(--r-set); }
.lg-line:not(.set) .lg-pin.on { color: var(--amber); }
.lg-pin:disabled { opacity: 0.35; cursor: default; }
.lg-rs { display: grid; grid-template-columns: 120px auto; gap: var(--s4); align-items: center; }
.lg-rs small { font: 11px var(--mono); color: var(--dim); }
@media (max-width: 900px) {
  .lg-head { grid-template-columns: minmax(0, 1fr) 120px; gap: var(--s4); }
  .lg-line { grid-template-columns: 16px minmax(0, 1fr) 48px; }
  .lg-line .lg-hint, .lg-line .lg-rs, .lg-line .lg-goal { grid-column: 2 / 4; grid-row: 2; padding-bottom: var(--s2); }
}

/* ---------- Journals (journals-view.mjs): the Ledger's entry and the first find's card. Amber is found, the Cascade
   ivory (never red), unfound faint and dashed. The sheet takes the writer's type. Nothing moves. ---------- */
.lg-entry, .jr-wrap { --ivory: #e9e2cf; }
.jr-tl { display: grid; grid-template-columns: repeat(44, minmax(0, 1fr)); gap: 2px; align-items: end; padding-top: 22px; position: relative; }
.jr-col { position: relative; display: grid; grid-template-rows: auto 26px; align-items: end; min-height: 40px; }
.jr-stack { display: flex; flex-direction: column-reverse; gap: 2px; align-items: center; }
.jr-col.c0 { align-self: stretch; }
.jr-chip { display: grid; place-items: center; justify-self: center; width: min(100%, 24px); height: 16px; min-width: 0; padding: 0; font: 600 8px/1 var(--mono); letter-spacing: 0; color: var(--dim); border: 1px dashed var(--line); border-radius: 2px; background: none; font-style: normal; }
.jr-chip.got { color: var(--bg); background: var(--amber-soft); border: 1px solid var(--amber); cursor: pointer; }
.jr-chip.got:hover, .jr-chip.lit { background: var(--amber); color: var(--bg); box-shadow: 0 0 0 1px var(--bright); }
.jr-chip.fade { opacity: 0.22; }
.jr-col.c0::before { content: ''; position: absolute; left: 50%; top: -6px; bottom: 26px; width: 1px; background: var(--ivory); opacity: 0.7; }
.jr-cascade { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font: var(--label); letter-spacing: var(--label-track); color: var(--ivory); white-space: nowrap; }
.jr-ax { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; font: 10px/1.2 var(--mono); color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.jr-ax b { font-weight: 500; color: var(--muted); }
.jr-col:first-child .jr-ax { left: 0; transform: none; justify-items: start; }
.jr-col:last-child .jr-ax { left: auto; right: 0; transform: none; justify-items: end; }
.jr-writers { list-style: none; margin: 0; padding: 0; display: grid; max-width: 760px; }
.jr-row { display: grid; grid-template-columns: 16px 140px minmax(0, 1fr) auto 36px; gap: var(--s4); align-items: center; width: 100%; min-height: 30px; padding: 0 var(--s3); text-align: left; border-bottom: 1px solid var(--amber-wash); }
.jr-row:hover { background: var(--amber-wash); }
.jr-row .lg-ico { display: inline-flex; color: var(--gray); }
.jr-row .lg-ico .glyph { width: 14px; height: 14px; margin: 0; }
.jr-row.known .lg-ico { color: var(--amber); }
.jr-row b { font: 500 13px var(--sans); color: var(--bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-row b.unk, .jr-line b.unk { font-family: var(--mono); letter-spacing: 1px; color: var(--gray); }
.jr-role { font: 12px var(--sans); color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-pips { display: flex; gap: 3px; }
.jr-pip { width: 6px; height: 6px; border: 1px solid var(--line-strong); border-radius: 1px; }
.jr-pip.got { background: var(--amber); border-color: var(--amber); }
.jr-row .lg-n { text-align: right; }
.jr-wr.open > .jr-row { background: var(--amber-wash); }
.jr-lines { list-style: none; margin: 0 0 var(--s3); padding: 0 0 0 calc(16px + var(--s4) + var(--s3)); display: grid; }
.jr-line { display: grid; grid-template-columns: 140px minmax(0, 1fr) 56px; gap: var(--s4); align-items: center; width: 100%; min-height: 26px; padding: 0 var(--s3); text-align: left; border-bottom: 1px solid var(--amber-wash); }
.jr-line b { font: 500 13px var(--sans); color: var(--bright); }
.jr-line small { font: 12px var(--sans); color: var(--dim); }
.jr-line time { font: 11px var(--mono); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
button.jr-line:hover { background: var(--amber-wash); }
.jr-read { display: grid; gap: var(--s5); max-width: 760px; }
.jr-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); }
.jr-step { display: inline-flex; align-items: center; gap: var(--s4); }
.jr-head { display: grid; width: 100%; }
.jr-head h2 { margin: 0; font: 600 18px/1.2 var(--sans); color: var(--bright); letter-spacing: 0.2px; text-transform: none; }
.jr-by { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s5); margin: var(--s1) 0 0; font: 12px var(--sans); color: var(--muted); max-width: none; }
.jr-by span + span { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.jr-found { margin: 0; font: 11px var(--mono); color: var(--dim); }
/* The sheet: a framed page, one muted header line, the writer's type. */
.jr-sheet { display: grid; gap: var(--s4); padding: var(--s5) var(--s6); background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-card); }
.jr-sheet p { margin: 0; max-width: 68ch; font: 14px/1.6 var(--sans); color: var(--text); }
.jr-sheet .jr-medium { padding-bottom: var(--s3); border-bottom: 1px solid var(--line); font: var(--label); letter-spacing: var(--label-track); color: var(--dim); }
.jr-sheet.m-typed p:not(.jr-medium) { font: 14px/1.6 'Courier Prime', 'Courier New', monospace; color: var(--bright); }
.jr-sheet.m-notes p:not(.jr-medium) { font: 13px/1.6 var(--mono); text-transform: lowercase; }
.jr-sheet.m-notes .jr-medium { text-transform: none; letter-spacing: 0; font-weight: 400; }
.jr-sheet.m-desk p:not(.jr-medium) { font: 13px/1.6 var(--mono); color: var(--amber); }
/* The first find: a document card over the map. */
.gain.jr-wrap { z-index: 41; animation: none; }
.gain.jr-wrap .pz-card.jr-card { width: min(640px, 100%); gap: var(--s5); }
.jr-card .jr-sheet { max-height: min(52vh, 460px); overflow-y: auto; }
.jr-acts { display: flex; gap: var(--s4); }
.jr-acts kbd { margin-left: var(--s3); font: 10px var(--mono); color: var(--dim); }
@media (max-width: 640px) {
  .jr-tl { gap: 1px; }
  .jr-chip { width: 6px; height: 6px; font-size: 0; border-radius: 1px; }
  .jr-cascade { font-size: 8px; letter-spacing: 0.5px; }
  .jr-ax { font-size: 9px; }
  .jr-row { grid-template-columns: 16px minmax(0, 1fr) auto 32px; }
  .jr-role { grid-column: 2 / -1; grid-row: 2; padding-bottom: var(--s2); }
  .jr-lines { padding-left: var(--s3); }
  .jr-line { grid-template-columns: minmax(0, 1fr) 48px; }
  .jr-line small { grid-column: 1 / -1; grid-row: 2; padding-bottom: var(--s2); }
  .jr-sheet { padding: var(--s4); }
  .gain.jr-wrap .pz-card.jr-card { max-height: 88dvh; overflow-y: auto; }
  .jr-card .jr-sheet { max-height: none; overflow: visible; }
  .jr-acts { position: sticky; bottom: calc(-1 * var(--s5)); margin: 0 calc(-1 * var(--s4)) calc(-1 * var(--s5)); padding: var(--s4) var(--s4) var(--s5); background: var(--panel); border-top: 1px solid var(--line); }
  .jr-acts .btn { flex: 1; }
}
