/* Bible history timeline — public page (layouts/timeline.html.erb).
   Loaded only by that layout, so global selectors here never reach the rest of the site.
   Ported from the opus55-bible design demo. */
:root {
  --paper: #F4F4F0;
  --card: #FFFFFF;
  --ink: #111111;
  --ink-2: rgba(17, 17, 17, .74);
  --muted: rgba(17, 17, 17, .56);
  --line: rgba(17, 17, 17, .14);
  --red: #E63946;
  --red-dark: #B91C1C;
  --blue: #2952FF;
  --cream: #FFF7E6;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: .45s;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --serif: Merriweather, Georgia, serif;
  --gut: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.label, .eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.eyebrow { color: var(--muted); }

/* ---------- icons ---------- */
.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; overflow: visible; }

/* role colours, from the site palette */
.g-patriarch-c { --c: #FFD60A; --fg: var(--ink); }
.g-prophet-c { --c: var(--red); --fg: #fff; }
.g-judge-c { --c: #0F766E; --fg: #fff; }
.g-priest-c { --c: #B86E2D; --fg: #fff; }
.g-king-c { --c: var(--blue); --fg: #fff; }
.g-messiah-c { --c: #8B5CF6; --fg: #fff; }
.g-apostle-c { --c: var(--ink); --fg: #fff; }
.g-messenger-c { --c: #4F46E5; --fg: #fff; }
.g-missionary-c { --c: #52796F; --fg: #fff; }
.g-other-c { --c: #fff; --fg: var(--ink); }
/* group badge: coloured square with the group's icon */
.gb { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border: 1.5px solid var(--ink); background: var(--c); color: var(--fg); font-size: 12px; }
.gb .ic { stroke-width: 2.2; }
.gb-lg { width: 52px; height: 52px; border-width: 2px; font-size: 28px; box-shadow: 3px 3px 0 var(--ink); }
.gb-lg .ic { stroke-width: 1.8; }
/* tile: white square with an outlined icon (periods, event kinds) */
.tile { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border: 1.5px solid var(--ink); background: var(--card); font-size: 12px; }
.tile-lg { width: 52px; height: 52px; border-width: 2px; font-size: 28px; box-shadow: 3px 3px 0 var(--ink); }
.tile-lg .ic { stroke-width: 1.8; }
.tile.is-key { background: var(--cream); }
.dia { display: inline-block; flex: none; width: 9px; height: 9px; transform: rotate(45deg); border: 1.5px solid var(--ink); background: #fff; }
.dia.is-key { background: var(--ink); }

/* stat: icon + number, so counts read without labels */
.stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stat { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border: 1.5px solid var(--ink); background: var(--card); font-size: 13px; font-weight: 700; white-space: nowrap; }
.stat .ic { font-size: 15px; }
.stat.is-none { color: var(--muted); border-style: dashed; font-weight: 500; font-size: 12px; }
button.stat:hover { background: var(--ink); color: #fff; }

/* ---------- frame: the timeline fills the window ---------- */
.tl-app { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: 100dvh; }
.tl-top { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 16px; background: var(--paper); border-bottom: 2px solid var(--ink); }
.tl-brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.tl-logo { display: grid; place-items: center; flex: none; width: 34px; height: 34px; background: var(--red); color: #fff; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font-weight: 700; font-size: 16px; }
.tl-brand-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.tl-brand-txt b { font-size: 15px; white-space: nowrap; }
.tl-brand-txt small { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tl-icon-btn { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 2px solid var(--ink); background: var(--card); font-size: 18px; }
.tl-icon-btn:hover, .tl-icon-btn[aria-expanded="true"] { background: var(--ink); color: #fff; }
.tl-lang { display: flex; flex: none; border: 2px solid var(--ink); background: var(--card); }
.tl-lang-form { display: contents; }
.tl-lang-btn { padding: 6px 9px; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.tl-lang-btn + .tl-lang-btn, .tl-lang-form + .tl-lang-form .tl-lang-btn { border-left: 2px solid var(--ink); }
.tl-lang-btn.is-on { background: var(--ink); color: #fff; }
.tl-back { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; text-decoration: none; border-bottom: 2px solid transparent; }
.tl-back:hover { border-bottom-color: var(--ink); }
.tl-back .ic { font-size: 16px; }

/* stepper: each step shows the icon of what was chosen on that level */
.path { margin-left: auto; display: flex; align-items: stretch; min-width: 0; border: 2px solid var(--ink); background: var(--card); box-shadow: 3px 3px 0 var(--ink); }
.step { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-right: 2px solid var(--ink); font-size: 13px; font-weight: 700; max-width: 260px; min-width: 0; transition: background-color .15s; }
.step:last-child { border-right: 0; }
.step .si { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid var(--ink); background: var(--card); color: var(--ink); font-size: 14px; }
.step .si.gb { background: var(--c); color: var(--fg); }
.step .txt, .step .txt-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .txt-s { display: none; }
.step.is-current { background: var(--ink); color: #fff; }
.step.is-current .si { border-color: #fff; }
.step.is-todo { color: var(--muted); font-weight: 500; }
.step.is-todo .si { border-style: dashed; border-color: var(--muted); color: var(--muted); background: transparent; }
.step.is-current.is-todo { color: #fff; }
.step.is-current.is-todo .si { border-color: rgba(255, 255, 255, .7); color: #fff; }
button.step:hover { background: var(--paper); }
button.step.is-current:hover { background: var(--ink); }

.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 0; }
.tl-app.is-side-hidden .layout { grid-template-columns: minmax(0, 1fr); }
.tl-app.is-side-hidden .side { display: none; }

/* ---------- structure tree ---------- */
.side { display: flex; flex-direction: column; min-height: 0; background: var(--card); border-right: 2px solid var(--ink); }
.side-toggle { display: none; }
.side-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px; border-bottom: 2px solid var(--ink); }
.side-actions { display: flex; gap: 6px; }
.mini { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: 3px 6px; border: 1.5px solid var(--ink); }
.mini:hover { background: var(--ink); color: #fff; }

.tree { overflow: auto; padding: 10px 10px 14px 8px; flex: 1; min-height: 0; font-size: 13px; }
.tree ul { margin-left: 13px; padding-left: 10px; }
.tree li { position: relative; }
.tree ul > li::before { content: ""; position: absolute; left: -10px; top: 0; width: 9px; height: 15px; border-left: 1.5px solid rgba(17, 17, 17, .26); border-bottom: 1.5px solid rgba(17, 17, 17, .26); }
.tree ul > li:not(:last-child)::after { content: ""; position: absolute; left: -10px; top: 15px; bottom: 0; border-left: 1.5px solid rgba(17, 17, 17, .26); }
/* path to the selection: a solid line from each ancestor down to the chosen row */
.tree ul > li.on-path::before { border-color: var(--ink); border-width: 2px; }
.tree ul > li.trunk::before { border-left-color: transparent; }
.tree ul > li.trunk:not(:last-child)::after { top: 0; border-left: 2px solid var(--ink); }
.tree li[aria-expanded="false"] > ul { display: none; }

.row { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 6px 0 2px; cursor: pointer; border: 1.5px solid transparent; user-select: none; }
.row:hover { background: var(--paper); }
.row .tw { flex: none; display: grid; place-items: center; width: 14px; height: 16px; color: var(--muted); }
.row .tw::before { content: ""; width: 0; height: 0; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .2s var(--ease); }
li[aria-expanded="true"] > .row .tw::before { transform: rotate(90deg); }
li:not([aria-expanded]) > .row .tw::before { content: none; }
.row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .yr { flex: none; font-size: 11px; color: var(--muted); }
.row .ct { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; color: var(--muted); }
.row .ct .ic { font-size: 11px; }
.row .also { color: var(--red-dark); font-size: 12px; }
.row .tile, .row .gb { width: 20px; height: 20px; font-size: 13px; }
.tree [aria-level="1"] > .row { font-weight: 700; }
.tree [aria-level="3"] > .row .tile { width: 18px; height: 18px; font-size: 11px; border-color: rgba(17, 17, 17, .35); }
.tree li.is-also > .row .nm { font-style: italic; color: var(--ink-2); }
.tree li.on-path > .row { font-weight: 700; }
.tree li.on-path[aria-level="1"] > .row .tile { background: var(--ink); color: #fff; }
.tree li[aria-selected="true"] > .row { background: var(--ink); color: #fff; border-color: var(--ink); }
.tree li[aria-selected="true"] > .row .nm, .tree li[aria-selected="true"] > .row .also { color: #fff; }
.tree li[aria-selected="true"] > .row .yr, .tree li[aria-selected="true"] > .row .tw, .tree li[aria-selected="true"] > .row .ct { color: rgba(255, 255, 255, .7); }
.tree li[aria-selected="true"] > .row .tile { background: var(--red); color: #fff; border-color: #fff; }
.tree li[aria-selected="true"] > .row .gb { border-color: #fff; }
.tree li.is-hover > .row { border-color: var(--ink); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; padding: 10px 14px 12px; border-top: 2px solid var(--ink); font-size: 11px; color: var(--ink-2); }
.legend div { display: flex; align-items: center; gap: 7px; }

/* ---------- stage ---------- */
.stage { min-width: 0; overflow: auto; padding: 14px 20px 40px; scroll-padding-top: 12px; }
.hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.hint .ic { font-size: 15px; color: var(--ink); }
.hint span { opacity: .5; }
kbd { font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 1.5px solid var(--ink); border-bottom-width: 3px; background: var(--card); color: var(--ink); padding: 1px 5px; }
.levels { position: relative; padding-right: 6px; }

.band { position: relative; background: var(--card); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); transition: box-shadow .25s var(--ease); }
.band.is-active { box-shadow: 5px 5px 0 var(--red); }
.band-head { display: flex; align-items: flex-start; gap: 14px; padding: 12px 16px; border-bottom: 2px solid var(--ink); transition: padding var(--t) var(--ease); }
/* level badge: the level's icon, with its number in the corner */
.lvl { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; font-size: 22px; background: var(--ink); color: #fff; transition: width var(--t) var(--ease), height var(--t) var(--ease), font-size var(--t) var(--ease); }
.lvl b { position: absolute; right: -7px; bottom: -7px; display: grid; place-items: center; width: 17px; height: 17px; font-size: 10px; background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); }
.band.is-active .lvl { background: var(--red); }
.band.is-idle .lvl { background: transparent; color: var(--muted); border: 2px dashed var(--muted); }
.band.is-idle .lvl b { border-style: dashed; border-color: var(--muted); color: var(--muted); }
.band-title { min-width: 0; flex: 1; }
.band-title h2 { margin-top: 2px; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: font-size var(--t) var(--ease); }
.band.is-idle .band-title h2 { color: var(--muted); }
.meta { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.meta b { color: var(--ink); font-weight: 700; }
.meta .m { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.meta .m .ic { font-size: 14px; color: var(--ink); }
.band-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; max-width: 62%; }

.band.is-compact .band-head { padding: 8px 16px; align-items: center; }
.band.is-compact .lvl { width: 30px; height: 30px; font-size: 16px; }
.band.is-compact .band-title h2 { font-size: 16px; }
.band.is-compact .eyebrow, .band.is-compact .meta { display: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; border: 1.5px solid var(--ink); background: var(--card); padding: 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.chip .c { opacity: .55; }
.chip .gb { width: 16px; height: 16px; font-size: 10px; }
.chip > .ic { font-size: 14px; }
button.chip:hover:not(:disabled) { background: var(--paper); }
.chip[aria-pressed="true"], .chip[aria-pressed="true"]:hover { background: var(--ink); color: #fff; }
.chip[aria-pressed="true"] .gb { border-color: #fff; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); background: var(--red); color: #fff; padding: 8px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; box-shadow: 3px 3px 0 var(--ink); transition: transform .15s, box-shadow .15s; white-space: nowrap; }
.btn .ic { font-size: 15px; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-ghost { background: var(--card); color: var(--ink); }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--ink); background: var(--card); font-size: 16px; font-weight: 700; line-height: 1; }
.icon-btn:hover:not(:disabled) { background: var(--ink); color: #fff; }
.icon-btn:disabled { opacity: .3; cursor: default; }

/* band body: zoom card on the left, sub-timeline on the right */
.band-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.band.has-card .band-body { grid-template-columns: 280px minmax(0, 1fr); }
.card-slot { display: none; min-width: 0; }
.band.has-card .card-slot { display: block; border-right: 2px solid var(--ink); background: var(--paper); padding: 14px; }
.band.is-compact .card-slot { padding: 8px 14px; }

.zcard { position: relative; background: var(--card); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: 14px 14px 16px; transform-origin: 0 0; overflow: hidden; }
.zc-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.zc-head > div { min-width: 0; flex: 1; }
.zc-head .label { color: var(--muted); line-height: 1.5; }
.zc-head .zc-t { display: none; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zcard h3 { margin: 12px 0 8px; font-size: 22px; line-height: 1.1; letter-spacing: -.02em; overflow-wrap: break-word; hyphens: auto; }
.zcard .sum { font-family: var(--serif); font-size: 13px; line-height: 1.6; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.zcard .stats { margin: 12px 0 14px; }
.zcard .watermark { position: absolute; right: -16px; bottom: -20px; font-size: 120px; line-height: 0; color: var(--ink); opacity: .05; pointer-events: none; }
.zcard .watermark .ic { stroke-width: 1.4; }
.zc-more { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--t) var(--ease), opacity .25s; }
.zc-more > div { min-height: 0; overflow: hidden; }
/* compact zoom card: icon + one title line */
.band.is-compact .zcard { padding: 6px 10px 6px 6px; box-shadow: 3px 3px 0 var(--ink); }
.band.is-compact .zc-head .tile-lg, .band.is-compact .zc-head .gb-lg { width: 30px; height: 30px; font-size: 17px; box-shadow: none; }
.band.is-compact .zc-head .label { display: none; }
.band.is-compact .zc-head .zc-t { display: block; }
.band.is-compact .zc-more { grid-template-rows: 0fr; opacity: 0; }
.band.is-compact .zcard .watermark { display: none; }

/* ---------- tracks ---------- */
.track { position: relative; min-height: var(--h, 120px); margin: 0 var(--gut); min-width: 0; transition: min-height var(--t) var(--ease); }
.layer { position: absolute; inset: 0; }
.layer.items { pointer-events: none; }
.layer.items > * { pointer-events: auto; }
.axis { position: absolute; left: 0; right: 0; bottom: 26px; height: 2px; background: var(--ink); }
.tick { position: absolute; bottom: 8px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tick::before { content: ""; position: absolute; left: 50%; bottom: 16px; width: 1.5px; height: 6px; background: var(--ink); }
.tick.is-major { color: var(--ink); font-weight: 700; }
.tick.is-major::before { height: 9px; width: 2px; }
.tick.is-start { transform: none; }
.tick.is-start::before { left: 0; }
.tick.is-end { transform: translateX(-100%); }
.tick.is-end::before { left: auto; right: 0; }
.tick.is-bare { color: transparent; }
.grid { position: absolute; top: 0; bottom: 28px; width: 1px; background: var(--line); }
/* BC | AD divider wherever an axis crosses year zero */
.era { position: absolute; top: 0; bottom: 27px; border-left: 2px dashed var(--red); pointer-events: none; }
.era span { position: absolute; top: 4px; white-space: nowrap; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--red-dark); background: var(--card); padding: 0 3px; }
.era span:first-child { right: 4px; }
.era span:last-child { left: 4px; }

.ghost { position: absolute; bottom: 22px; height: 10px; background: var(--red); opacity: 0; transition: opacity .15s; pointer-events: none; }
.ghost.is-on { opacity: .9; }
.ghost.is-sel { background: var(--ink); height: 6px; bottom: 24px; }

/* level 1: equal slots (period lengths differ by two orders of magnitude).
   Each card is a size container, so its content adapts to the width it gets
   instead of overflowing: full title, short name, then icon only. */
.period { position: absolute; top: 12px; height: 100px; padding: 0; background: var(--card); border: 2px solid var(--ink); overflow: hidden; container-type: inline-size; transition: top var(--t) var(--ease), height var(--t) var(--ease), left var(--t) var(--ease), width var(--t) var(--ease), background-color .15s, color .15s, box-shadow .2s; }
.pc { height: 100%; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.pc-top .ic { font-size: 24px; }
.pc-top .rn { font-size: 10px; font-weight: 700; color: var(--muted); }
.period .nm { font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.period .nm-full { display: none; }
.period .yrs { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.period .pdots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; height: 7px; overflow: hidden; }
.period .pdots i { width: 7px; height: 7px; border: 1.5px solid var(--ink); background: var(--c); }
.period:hover { background: var(--paper); z-index: 2; }
.period.is-selected { background: var(--ink); color: #fff; z-index: 3; box-shadow: 0 5px 0 var(--red); }
.period.is-selected .yrs, .period.is-selected .rn { color: rgba(255, 255, 255, .7); }
.period.is-selected .pdots i { border-color: #fff; }
.period.is-dim { color: var(--muted); }
.period.is-dim .pdots { opacity: .5; }
@container (min-width: 170px) {
  .period .nm-short { display: none; }
  .period .nm-full { display: block; }
}
@container (max-width: 100px) {
  .period .yrs .era-s { display: none; }
}
@container (max-width: 78px) {
  .period .nm { font-size: 11px; }
  .pc-top .rn { display: none; }
}
@container (max-width: 58px) {
  .pc { padding: 8px 2px 6px; align-items: center; }
  .period .nm, .period .yrs { display: none; }
  .pc-top { justify-content: center; }
  .pc-top .ic { font-size: 20px; }
  .period .pdots { justify-content: center; height: auto; max-height: 24px; }
}
#band1.is-compact .period { top: 8px; height: 38px; }
#band1.is-compact .pc { flex-direction: row; align-items: center; gap: 7px; padding: 5px 8px; }
#band1.is-compact .pc-top .ic { font-size: 20px; }
#band1.is-compact .pc-top .rn, #band1.is-compact .period .yrs, #band1.is-compact .period .pdots, #band1.is-compact .period .nm-full { display: none; }
#band1.is-compact .period .nm-short { display: block; font-size: 12px; }
@container (max-width: 124px) {
  #band1.is-compact .pc { gap: 5px; padding: 5px 6px; }
  #band1.is-compact .pc-top .ic { font-size: 17px; }
  #band1.is-compact .period .nm-short { font-size: 11px; text-overflow: clip; }
}
@container (max-width: 70px) {
  #band1.is-compact .period .nm-short { display: none; }
  #band1.is-compact .pc { justify-content: center; padding: 5px 2px; }
}
.period.enter { animation: pop .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }

/* level 2: lifespans as bars packed in rows */
.bar { position: absolute; height: 26px; transition: bottom var(--t) var(--ease), left var(--t) var(--ease), width var(--t) var(--ease), height var(--t) var(--ease), opacity .2s; }
.bar .fill { position: absolute; inset: 0; border: 2px solid var(--ink); background: var(--c); transition: box-shadow .15s, transform .15s; }


.bar.cut-l .fill { border-left-style: dashed; }
.bar.cut-r .fill { border-right-style: dashed; }
.bar .bi { position: absolute; left: 5px; top: 50%; transform: translateY(-50%); color: var(--fg); font-size: 15px; display: flex; transition: opacity .2s; }
.bar .lbl { position: absolute; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1; pointer-events: none; transition: opacity .2s; }
.bar .lbl .ic { font-size: 12px; color: var(--red-dark); }
.bar .lbl-in { left: 8px; color: var(--fg); }
.bar.has-icon .lbl-in { left: 26px; }
.bar .lbl-in .ic { color: var(--fg); }
.bar .lbl-r { left: calc(100% + 8px); }
.bar .lbl-l { right: calc(100% + 8px); }
/* the person's life events peek out under their bar */
.bar .evs { position: absolute; left: 0; right: 0; bottom: -5px; height: 8px; pointer-events: none; transition: opacity .2s; }
.bar .evs i { position: absolute; top: 0; width: 8px; height: 8px; margin-left: -4px; transform: rotate(45deg); border: 1.5px solid var(--ink); background: #fff; }
.bar:hover .fill, .bar.is-hover .fill { box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.bar.is-selected .fill { box-shadow: 4px 4px 0 var(--red); }
.bar.is-selected .lbl { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.bar.is-dim { opacity: .3; }
.bar.enter { animation: pop .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
#band2.is-compact .bar { height: 12px; }
#band2.is-compact .bar .bi, #band2.is-compact .bar .evs, #band2.is-compact .bar .lbl { opacity: 0; }
#band2.is-compact .bar.is-selected .lbl, #band2.is-compact .bar:hover .lbl { opacity: 1; }
#band2.is-compact .bar.is-selected { opacity: 1; }

.dot { position: absolute; bottom: 21px; width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg); border: 2px dashed var(--ink); background: var(--card); transition: left var(--t) var(--ease); }
.dot:hover, .dot.is-hover { background: var(--ink); }

/* level 3: life events as flags with a kind icon; the chosen one zooms in place */
.ev { position: absolute; display: block; transition: left var(--t) var(--ease), bottom var(--t) var(--ease), width var(--t) var(--ease), height var(--t) var(--ease), opacity .2s; }
.ev .flag { position: absolute; inset: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-content: start; border: 2px solid var(--ink); background: var(--card); padding: 5px 8px 5px 5px; line-height: 1.2; overflow: hidden; box-shadow: 2px 2px 0 var(--ink); transition: box-shadow .15s, background-color .15s, padding var(--t) var(--ease); }
.ev .flag > .tile { grid-row: span 2; width: 30px; height: 30px; font-size: 17px; transition: width var(--t) var(--ease), height var(--t) var(--ease), font-size var(--t) var(--ease), background-color .2s; }
.ev .d { display: block; font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .d .ic { color: var(--red-dark); font-size: 10px; }
.ev .t { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: font-size var(--t) var(--ease); }
.ev .x { grid-column: 1 / -1; display: block; opacity: 0; margin-top: 10px; transition: opacity .2s; pointer-events: none; }
.x .sum { font-family: var(--serif); font-size: 12px; line-height: 1.55; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.x .stats { margin-top: 10px; }
.x .stat { height: 22px; font-size: 11px; padding: 0 6px; }
.x .stat .ic { font-size: 13px; }
.x .go { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--red-dark); white-space: nowrap; }
.ev .stem { position: absolute; left: 0; top: 100%; width: 2px; height: var(--stem); background: var(--ink); transition: height var(--t) var(--ease); }
.ev .pin { position: absolute; left: -5px; top: calc(100% + var(--stem) - 6px); width: 12px; height: 12px; transform: rotate(45deg); border: 2px solid var(--ink); background: var(--card); transition: top var(--t) var(--ease); }
.ev.is-flip .stem { left: auto; right: 0; }
.ev.is-flip .pin { left: auto; right: -5px; }
.ev.is-key .pin { background: var(--ink); }
.ev.is-key .flag { background: var(--cream); }
.ev:hover .flag, .ev.is-hover .flag { box-shadow: 3px 3px 0 var(--ink); }
.ev.is-dim { opacity: .45; }
.ev.is-focus { z-index: 10; opacity: 1; }
.ev.is-focus .flag { background: var(--card); padding: 10px 12px 10px 10px; box-shadow: 5px 5px 0 var(--red); }
.ev.is-focus .flag > .tile { width: 44px; height: 44px; font-size: 24px; background: var(--ink); color: #fff; }
.ev.is-focus .t { font-size: 17px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev.is-focus .x { opacity: 1; pointer-events: auto; transition-delay: .15s; }
.ev.is-focus .pin { background: var(--red); }
.ev.enter { animation: pop .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.span-bg { position: absolute; bottom: 21px; height: 12px; background: rgba(17, 17, 17, .08); border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }

/* level 3 on narrow screens: a vertical life line instead of a horizontal axis */
.track.is-list { min-height: 0; }
.track.is-list .layer.items { position: relative; inset: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 0 16px; }
.vline { position: absolute; left: 17px; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.evrow { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; }
.evrow .node { position: relative; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; border: 2px solid var(--ink); background: var(--card); font-size: 18px; transition: background-color .2s, color .2s; }
.evrow.is-key .node { background: var(--cream); }
.evrow .body { min-width: 0; border: 2px solid var(--ink); background: var(--card); padding: 7px 10px 8px; box-shadow: 2px 2px 0 var(--ink); transition: box-shadow .2s; }
.evrow .d { display: block; font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.evrow .t { display: block; margin-top: 2px; font-size: 14px; font-weight: 700; line-height: 1.25; }
.evrow .x { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--t) var(--ease), opacity .25s; }
.evrow .x > span { min-height: 0; overflow: hidden; display: block; }
.evrow .x .sum { margin-top: 8px; }
.evrow.is-focus .x { grid-template-rows: 1fr; opacity: 1; }
.evrow.is-focus .node { background: var(--red); color: #fff; }
.evrow.is-focus .body { box-shadow: 4px 4px 0 var(--red); }
.evrow.is-hover .body, .evrow:hover .body { box-shadow: 3px 3px 0 var(--ink); }
.evrow.enter { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }

.bar.is-unknown .fill { border-style: dashed; background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .55) 6px 10px); }
.bar.g-other-c.is-unknown .fill, .bar.g-patriarch-c.is-unknown .fill { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(17, 17, 17, .12) 6px 10px); }
.span-bg.is-unknown { border-style: dashed; }

/* events of the period itself (no single person), on the people axis */
.pev { position: absolute; bottom: 14px; z-index: 2; display: grid; place-items: center; width: 26px; height: 26px; margin-left: -13px; border: 2px solid var(--ink); background: var(--card); font-size: 14px; box-shadow: 2px 2px 0 var(--ink); transition: transform .15s, box-shadow .15s; }
.pev.is-key { background: var(--cream); }
.pev:hover, .pev.is-hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--red); }

/* events of someone else that this person takes part in */
.ev.is-joined .flag { border-style: dashed; }
.ev.is-joined .d { color: var(--ink-2); }
.evrow.is-joined .body { border-style: dashed; }

.quote-link { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--red-dark); text-decoration: none; }
.quote-link:hover { text-decoration: underline; }
.ph.has-img { background: var(--paper); overflow: hidden; }
.ph.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph.has-img figcaption { right: 0; border-right: 0; font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.loading { font-size: 13px; color: var(--muted); }
.refs li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.refs a { font-weight: 700; }
.legend .also-ic { color: var(--red-dark); }
.d-detail > .ph-row { margin-bottom: 4px; }

@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* person without a life timeline: details instead of a track */
.details { position: absolute; inset: 14px 0; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-content: start; }
.details .note { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 2px dashed rgba(17, 17, 17, .3); font-size: 13px; color: var(--ink-2); }
.details .note .ic { font-size: 22px; color: var(--ink); }
.details .note b { color: var(--ink); }
.sec-h { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.sec-h .ic { font-size: 16px; }

.idle { position: absolute; inset: 14px 0; display: flex; align-items: center; justify-content: center; gap: 14px; border: 2px dashed rgba(17, 17, 17, .25); font-size: 13px; color: var(--muted); padding: 0 16px; }
.idle .ic { flex: none; font-size: 30px; color: rgba(17, 17, 17, .35); stroke-width: 1.6; }

.tl-empty { margin: 40px auto; max-width: 520px; padding: 24px; border: 2px dashed rgba(17, 17, 17, .3); text-align: center; color: var(--muted); }

/* zoom funnels */
.funnel { display: block; width: 100%; height: 34px; overflow: visible; }
.funnel-fill { fill: url(#tl-hatch); transition: d var(--t) var(--ease), opacity .3s; }
.funnel-edge { fill: none; stroke: var(--ink); stroke-width: 2; transition: d var(--t) var(--ease), opacity .3s; }
.funnel.is-off path { opacity: 0; }

/* ---------- tooltip ---------- */
.tip { position: fixed; z-index: 60; pointer-events: none; display: flex; gap: 10px; align-items: flex-start; max-width: 280px; background: var(--ink); color: #fff; padding: 9px 11px; font-size: 12px; line-height: 1.35; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; box-shadow: 3px 3px 0 var(--red); }
.tip.is-on { opacity: 1; transform: none; }
.tip > .ic { font-size: 22px; margin-top: 2px; }
.tip b { display: block; font-size: 13px; }
.tip .when { color: rgba(255, 255, 255, .75); }
.tip .tstats { display: flex; gap: 10px; margin-top: 4px; color: rgba(255, 255, 255, .85); font-weight: 700; }
.tip .tstats span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- shared: images, references ---------- */
.ph-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ph { position: relative; aspect-ratio: 16 / 9; border: 2px solid var(--ink); background: repeating-linear-gradient(45deg, #fff 0 6px, #ececec 6px 12px); display: grid; place-items: center; }
.ph > .ic { font-size: 26px; color: rgba(17, 17, 17, .4); }
.ph figcaption { position: absolute; left: 0; bottom: 0; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--card); border-top: 2px solid var(--ink); border-right: 2px solid var(--ink); padding: 2px 6px; }
.quotes { display: grid; gap: 8px; }
.quote { border-left: 4px solid var(--red); background: var(--paper); padding: 8px 10px 9px 12px; }
.quote cite { display: flex; align-items: center; gap: 6px; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.quote cite .ic { font-size: 14px; }
.quote p { margin-top: 4px; font-family: var(--serif); font-style: italic; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.prose { font-family: var(--serif); font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.prose p + p { margin-top: 10px; }

/* ---------- full-detail drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(17, 17, 17, .28); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.is-on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(500px, 100vw); display: flex; flex-direction: column; background: var(--card); border-left: 2px solid var(--ink); box-shadow: -6px 0 0 var(--ink); transform: translateX(105%); transition: transform .4s var(--ease); }
.drawer.is-on { transform: none; }
.d-top { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 2px solid var(--ink); }
.d-top .label { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.d-top .label .ic { font-size: 16px; }
.d-body { flex: 1; overflow: auto; padding: 18px 20px 28px; }
.d-tree { margin-bottom: 18px; font-size: 12px; }
.d-tree li { position: relative; display: flex; align-items: center; gap: 6px; padding: 3px 0; margin-left: calc(var(--d) * 18px); min-width: 0; }
.d-tree li + li::before { content: ""; position: absolute; left: -12px; top: -4px; width: 8px; height: 15px; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.d-tree .ic { font-size: 14px; }
.d-tree button { font-weight: 700; border-bottom: 1.5px solid transparent; }
.d-tree button:hover { border-bottom-color: var(--ink); }
.d-tree li:last-child { color: var(--red-dark); font-weight: 700; }
.d-hero { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 16px; }
.d-hero > div { min-width: 0; }
.d-title { font-size: 28px; line-height: 1.08; letter-spacing: -.02em; overflow-wrap: break-word; }
.d-hero .stats { margin-top: 10px; }
.d-sum { margin-top: 14px; font-family: var(--serif); font-size: 15px; line-height: 1.65; }
.d-sec { margin-top: 22px; padding-top: 14px; border-top: 2px solid var(--ink); }
.kids li { border-bottom: 1px solid var(--line); }
.kids button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 4px; font-size: 13px; }
.kids button:hover { background: var(--paper); }
.kids .nm { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kids .yr { font-size: 11px; color: var(--muted); white-space: nowrap; }
.d-foot { display: flex; gap: 10px; padding: 12px 16px; border-top: 2px solid var(--ink); }
.d-foot .btn { flex: 1; justify-content: center; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .band.has-card .band-body { grid-template-columns: 240px minmax(0, 1fr); }
  .tl-back span { display: none; }
}
@media (max-width: 1100px) {
  .band.has-card .band-body { grid-template-columns: minmax(0, 1fr); }
  .band.has-card .card-slot { border-right: 0; border-bottom: 2px solid var(--ink); }
  .zcard .sum { -webkit-line-clamp: 2; }
  .zcard .watermark { font-size: 90px; }
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
}
/* phones and small tablets: one scrolling page, structure folds into a button */
@media (max-width: 980px) {
  :root { --gut: 12px; }
  body { overflow: auto; }
  .tl-app { display: block; height: auto; }
  .tl-top { flex-wrap: wrap; padding: 10px 12px; }
  .tl-side-btn { display: none; }
  .path { order: 5; margin-left: 0; width: 100%; box-shadow: 2px 2px 0 var(--ink); }
  .step { flex: 1 1 0; max-width: none; padding: 6px 8px 6px 6px; font-size: 12px; gap: 6px; }
  .step .txt { display: none; }
  .step .txt-s { display: block; }
  .tl-lang { margin-left: auto; }
  .layout, .tl-app.is-side-hidden .layout { display: block; padding: 12px 12px 40px; }
  .tl-app.is-side-hidden .side { display: flex; }
  .side { border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); margin-bottom: 16px; }
  .side-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; }
  .side-toggle > .ic { font-size: 18px; }
  .side-count { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-toggle .caret { flex: none; width: 0; height: 0; border-top: 6px solid var(--ink); border-left: 5px solid transparent; border-right: 5px solid transparent; transition: transform .2s; }
  .side-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
  .side-body { display: none; border-top: 2px solid var(--ink); }
  .side-head { display: none; }
  .side.is-open .side-body { display: flex; }
  .side.is-open .tree { max-height: 50vh; }
  .stage { overflow: visible; padding: 0; }
  .hint { display: none; }
  .band { box-shadow: 4px 4px 0 var(--ink); }
  .band.is-active { box-shadow: 4px 4px 0 var(--red); }
  .band-head { flex-wrap: wrap; padding: 12px; gap: 12px; }
  .band.is-compact .band-head { padding: 8px 12px; }
  .band-tools { max-width: none; width: 100%; justify-content: flex-start; }
  .band.is-compact .band-tools { width: auto; }
  .band.has-card .card-slot { padding: 12px; }
  .details { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .tl-brand-txt small { display: none; }
  .tl-brand-txt b { font-size: 14px; }
  .band-title h2 { font-size: 19px; }
  .chip { padding: 0 7px; }
  .chip .t { display: none; }
  .zcard h3 { font-size: 19px; }
  .gb-lg, .tile-lg { width: 44px; height: 44px; font-size: 24px; }
  .d-title { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0ms !important; }
}

/* ---------- event categories (filter, flags, markers) ---------- */
.c-spiritual { --cat: #2F5FD0; --cat-bg: #E4ECFF; }
.c-personal { --cat: #2E7D5B; --cat-bg: #E1F2E9; }
.c-supernatural { --cat: #B87800; --cat-bg: #FFF0C2; }
.c-history { --cat: #6B5B4E; --cat-bg: #EEE8E1; }
.stage-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 14px; }
.stage-top .hint { margin-bottom: 0; }
.tl-cats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tl-cats > .label { margin-right: 4px; color: var(--muted); }
.cat-chip { box-shadow: 2px 2px 0 var(--ink); }
.cat-chip > .ic { color: var(--cat); font-size: 16px; stroke-width: 2.2; }
.cat-chip[aria-pressed="true"], .cat-chip[aria-pressed="true"]:hover { background: var(--cat-bg); color: var(--ink); box-shadow: inset 0 -4px 0 var(--cat), 2px 2px 0 var(--ink); }
.cat-chip[aria-pressed="false"] { border-style: dashed; color: var(--muted); box-shadow: none; }
.cat-chip[aria-pressed="false"] .t { text-decoration: line-through; }
.cat-chip[aria-pressed="false"] > .ic { color: var(--muted); }
.ev[class*=" c-"] .flag { border-left: 6px solid var(--cat); }
.ev[class*=" c-"] .flag > .tile { background: var(--cat-bg); }
.ev .d .ci { display: inline-flex; vertical-align: -2px; margin-right: 3px; }
.ev .d .ci .ic, .evrow .d > .ic { color: var(--cat); font-size: 12px; stroke-width: 2.4; }
.ev.is-focus .flag > .tile { background: var(--cat, var(--ink)); color: #fff; }
.ev[class*=" c-"] .pin { background: var(--cat-bg); }
.ev.is-key .pin { background: var(--cat, var(--ink)); }
.evrow[class*=" c-"] .body { border-left: 6px solid var(--cat); }
.evrow[class*=" c-"] .node { background: var(--cat-bg); }
.bar .evs i[class*="c-"] { background: var(--cat); }
.pev[class*=" c-"] { background: var(--cat-bg); }
.tile[class*=" c-"] { background: var(--cat-bg); border-color: var(--ink); }
.tree li[aria-selected="true"] > .row .tile[class*=" c-"] { background: var(--cat); }
.stat.cat { background: var(--cat-bg); }
.stat.cat .ic { color: var(--cat); stroke-width: 2.2; }

/* ---------- person portrait: a real photo, or a person pictogram ---------- */
.avatar { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border: 1.5px solid var(--ink); background: var(--c); color: var(--fg); overflow: hidden; }
.avatar-lg { width: 52px; height: 52px; border-width: 2px; font-size: 34px; box-shadow: 3px 3px 0 var(--ink); }
.avatar-lg .ic { stroke-width: 1.5; margin-top: 8px; }
.avatar.has-photo { background: var(--paper); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.band.is-compact .zc-head .avatar-lg { width: 30px; height: 30px; font-size: 20px; box-shadow: none; }
.zc-head .label .gb { width: 14px; height: 14px; font-size: 9px; vertical-align: -2px; }

/* ---------- detail drawer: shared-event note, passages, photos ---------- */
.d-as { display: flex; align-items: center; gap: 8px; margin: -4px 0 4px; padding: 8px 10px; border: 1.5px dashed var(--ink); font-size: 13px; }
.passages { display: grid; gap: 8px; }
.passage { border-left: 4px solid var(--red); background: var(--paper); }
.passage > summary, .passage.is-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; list-style: none; }
.passage > summary { cursor: pointer; }
.passage > summary::-webkit-details-marker { display: none; }
.passage > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); transition: transform .2s; }
.passage[open] > summary::after { transform: rotate(-135deg); }
.passage > summary:hover { background: rgba(17, 17, 17, .05); }
.passage .ic { flex: none; font-size: 15px; }
.passage .pl { min-width: 0; }
.passage .pc { flex: none; padding: 0 5px; border: 1.5px solid var(--ink); background: var(--card); font-size: 10px; letter-spacing: 0; }
.passage.is-link .quote-link { margin: 0 0 0 auto; }
.pv { padding: 0 12px 10px 14px; }
.pv p { font-family: var(--serif); font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.pv sup { margin-right: 2px; font-family: var(--sans); font-size: 10px; font-weight: 700; color: var(--red-dark); }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 4px; }
.gallery.is-single { grid-template-columns: minmax(0, 1fr); }
.photo { margin: 0; border: 2px solid var(--ink); background: var(--card); box-shadow: 3px 3px 0 var(--ink); }
.photo a { display: block; }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper); }
.gallery.is-single .photo img { aspect-ratio: 16 / 10; }
.photo figcaption { padding: 6px 8px 7px; border-top: 2px solid var(--ink); font-size: 12px; line-height: 1.35; }
.photo figcaption small { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }

@media (max-width: 980px) {
  .stage-top { margin: 0 0 12px; }
  .tl-cats > .label { display: none; }
}
@media (max-width: 560px) {
  .tl-cats { width: 100%; }
  .cat-chip { flex: 1 1 calc(50% - 6px); justify-content: flex-start; min-width: 0; }
  .cat-chip .t { display: inline; overflow: hidden; text-overflow: ellipsis; }
  .cat-chip .c { margin-left: auto; }
  .gallery { grid-template-columns: minmax(0, 1fr); }
}
