/* Layout idea: a soft, rounded instrument. Tabs and search on top, a wide stage where
   each timeline lane grows upward from its axis toward the era pills, a shared year
   ruler at the bottom, and a control panel on the right. */
:root {
  --bg: #f1f2f6;
  --surface: #ffffff;
  --surface-2: #f6f7fa;
  --ink: #171b26;
  --muted: #5d6477;
  --line: #e0e3eb;
  --accent: #2b4c9e;
  --accent-ink: #ffffff;
  --dot: #121419;
  --tint: 0.045;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 27, 38, .05), 0 6px 18px rgba(23, 27, 38, .07);
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10131a; --surface: #181c26; --surface-2: #1d2230; --ink: #e6e8ef; --muted: #9aa1b3; --line: #2a3040;
    --accent: #8fa8ef; --accent-ink: #10131a; --dot: #07080b; --tint: 0.06;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10131a; --surface: #181c26; --surface-2: #1d2230; --ink: #e6e8ef; --muted: #9aa1b3; --line: #2a3040;
  --accent: #8fa8ef; --accent-ink: #10131a; --dot: #07080b; --tint: 0.06;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--font-body);
  display: flex; flex-direction: column; overflow: hidden;
}
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 16px; background: var(--surface); }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand h1 { font: 600 25px/1 var(--font-display); margin: 0; letter-spacing: .01em; white-space: nowrap; }
.pill { font-size: 11px; font-weight: 500; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.search { position: relative; flex: 1 1 260px; max-width: 520px; margin: 0 auto; }
.search input {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px;
  padding: 7px 14px 7px 34px; font-size: 13.5px;
}
.search input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); max-height: 60vh; overflow: auto;
}
.results li { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 9px; cursor: pointer; }
.results li[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.results .rt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); width: 58px; }
.results .rn { font-weight: 500; }
.results .rs { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.results .none { display: block; color: var(--muted); cursor: default; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; white-space: nowrap; }
.count b { color: var(--ink); font-weight: 600; }

.btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 13px;
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { padding: 3px 10px; font-size: 12px; }
.btn.danger { color: #c63c3c; }

/* ---------- tabs ---------- */
.tabs { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  border: 0; background: transparent; border-radius: 99px; padding: 5px 13px; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--muted);
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); color: var(--ink); font-weight: 500; }
.tab i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px var(--dot); }
.tab.add { color: var(--accent); }
.tabs .spacer { flex: 1; }

.chips-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.chip b { font-weight: 500; color: var(--muted); }
.chip button { border: 0; background: transparent; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; line-height: 1; color: var(--muted); }
.chip button:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- main ---------- */
main { position: relative; display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); flex: 1; min-height: 0; }
#stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
#stage.dragging { cursor: grabbing; }

#eras { position: relative; height: 40px; flex: none; overflow: hidden; }
#eras.off { display: none; }
.era {
  position: absolute; top: 7px; left: 0; height: 26px; border: 0; padding: 0 12px; text-align: left; border-radius: 99px;
  background: color-mix(in srgb, hsl(var(--h) 35% 55%) 13%, var(--surface));
  color: var(--ink); display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, hsl(var(--h) 30% 50%) 16%, transparent);
}
.era:hover { background: color-mix(in srgb, hsl(var(--h) 35% 55%) 24%, var(--surface)); }
.era b { font: 600 15px/1 var(--font-display); }
.era small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.era.narrow small { display: none; }
.era.tiny b { display: none; }

#lanes { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lane { position: relative; flex: 1 1 0; min-height: 150px; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.lane:first-child { border-top: 0; }
.lane-h { position: relative; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 6px 12px 0; height: 32px; flex: none; }
.lane-name {
  border: 0; background: var(--surface); border-radius: 99px; padding: 3px 12px; font: 600 16px/1.2 var(--font-display);
  box-shadow: 0 0 0 1px var(--line); cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.lane-name i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.lane.active .lane-name { box-shadow: 0 0 0 2px var(--accent); }
.lane-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lane-spacer { flex: 1; }
.lane-ev, .lane-x {
  border: 0; background: var(--surface); box-shadow: 0 0 0 1px var(--line); border-radius: 99px; padding: 2px 10px; font-size: 12px; cursor: pointer; color: var(--muted);
}
.lane-ev[aria-pressed="true"] { color: var(--ink); }
.lane-x { width: 24px; height: 24px; padding: 0; font-size: 15px; line-height: 1; }
.lane-body { position: relative; flex: 1; min-height: 0; overflow: hidden; }
canvas.layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lane-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.stems path { fill: none; stroke: var(--muted); stroke-width: 1; stroke-linecap: round; }
.links path { fill: none; stroke-width: 1.4; stroke-linecap: round; }
.links path.teach { stroke: var(--accent); }
.links path.infl { stroke: var(--muted); stroke-dasharray: 3 4; }
.dots, .cards, .evs { position: absolute; inset: 0; }
.dots { pointer-events: none; }

#ruler { position: relative; height: 36px; flex: none; border-bottom: 1px solid var(--line); background: var(--surface); }

/* ---------- dots ---------- */
.dot {
  position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%; background: var(--dot);
  box-shadow: 0 0 0 2.5px var(--c), 0 0 0 4.5px var(--bg);
  will-change: transform, opacity;
}
.dot.soft { box-shadow: 0 0 0 2.5px var(--c), 0 0 0 4.5px var(--bg), 0 0 9px 5px color-mix(in srgb, var(--c) 45%, transparent); }

/* ---------- cards, combined nodes, clusters ---------- */
.card, .group {
  position: absolute; left: 0; top: 0; padding: 0; margin: 0; text-align: left; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; will-change: transform, opacity, width, height; contain: layout paint;
}
.card:hover, .group:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow); }
.card.flash, .group.flash { animation: flash 1.6s ease-out 2; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent), var(--shadow); } 100% { box-shadow: 0 0 0 14px transparent, var(--shadow); } }
.card .in, .seg { display: flex; flex-direction: column; gap: 1px; white-space: nowrap; min-width: 0; }
.card .in { position: absolute; inset: 0; padding: 7px 12px 7px 14px; }
.swap .in, .swap .g-in { animation: swap .22s ease-out; }
@keyframes swap { from { opacity: 0; } to { opacity: 1; } }
.c-dates { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.c-title { font: 600 19px/1.1 var(--font-display); overflow: hidden; text-overflow: ellipsis; }
.c-short { font: 500 13px/1.2 var(--font-body); display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; }
.cd { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 2px var(--c); display: inline-block; }
.c-meta, .c-work { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.c-work { color: var(--ink); }
.c-work::before { content: "♪ "; color: var(--muted); }
.c-tags { display: flex; gap: 4px; margin-top: 3px; }
.c-tags em { font-style: normal; font-size: 10.5px; padding: 0 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.yours { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-left: 6px; font-weight: 600; }

.m-name { border-radius: 99px; }
.m-name .in { padding: 0 12px; justify-content: center; }
.m-name .c-top, .m-name .c-title, .m-name .c-meta, .m-name .c-work, .m-name .c-tags { display: none; }
.m-card .c-short, .m-card .c-work, .m-card .c-tags { display: none; }
.m-full .c-short { display: none; }

.badge {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%); z-index: 2;
  border: 0; border-radius: 99px; padding: 1px 7px; font: 600 11.5px/1.4 var(--font-body); cursor: zoom-in;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent);
}
.m-card .badge, .m-full .badge { top: 8px; transform: none; }

/* lifespan bubbles */
.b-bar, .b-label { display: none; }
.card.is-bubble { background: transparent; border-color: transparent; box-shadow: none; border-radius: 99px; overflow: visible; contain: layout; }
.card.is-bubble .in { display: none; }
.card.is-bubble .b-bar {
  display: block; position: absolute; left: 0; top: 0; bottom: 0; width: var(--life, 100%); border-radius: 99px;
  background: color-mix(in srgb, var(--c) 24%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--sl, 0px), #000 calc(100% - var(--sr, 0px)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--sl, 0px), #000 calc(100% - var(--sr, 0px)), transparent 100%);
}
.card.is-bubble .b-label {
  display: flex; flex-direction: column; justify-content: center; position: absolute; top: 0; bottom: 0; left: 0;
  padding: 0 10px; transform: translateX(var(--lx, 0px)); white-space: nowrap; line-height: 1.15;
}
.b-name { font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.b-dates { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card.is-bubble.m-dot .b-label, .card.is-bubble.m-name .b-dates { display: none; }
.card.is-bubble.sel .b-bar { box-shadow: inset 0 0 0 2px var(--accent); }
.card.is-bubble:hover .b-bar { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 85%, transparent); }
.card.is-bubble .badge { right: 4px; }

.group.combo .g-in { position: absolute; inset: 0; display: flex; }
.group.combo .seg { position: relative; padding: 7px 12px 7px 14px; justify-content: center; border-left: 1px solid var(--line); }
.group.combo .seg:first-child { border-left: 0; }
.group.combo .seg:hover { background: var(--surface-2); }
.group.combo.m-name { border-radius: 99px; }
.group.combo.m-name .seg { padding: 0 12px; }
.group.combo.m-name .c-top, .group.combo.m-name .c-title, .group.combo.m-name .c-meta, .group.combo.m-name .c-work { display: none; }
.group.combo.m-card .c-short, .group.combo.m-card .c-work { display: none; }
.group.combo.m-full .c-short { display: none; }
.group.combo .seg.sel { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

.group.cluster { background: color-mix(in srgb, var(--surface) 90%, var(--accent)); border-style: dashed; cursor: zoom-in; }
.group.cluster .g-in { position: absolute; inset: 0; padding: 7px 12px; display: flex; flex-direction: column; gap: 1px; white-space: nowrap; }
.k-count { font: 600 13px/1.2 var(--font-body); display: flex; align-items: center; gap: 7px; }
.k-dots { display: inline-flex; }
.k-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 1.5px var(--c); margin-left: -2px; }
.k-dots i:first-child { margin-left: 0; }
.k-span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.k-names { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.group.cluster.m-name { border-radius: 99px; }
.group.cluster.m-name .g-in { justify-content: center; padding: 0 12px; }
.group.cluster.m-name .k-span, .group.cluster.m-name .k-names { display: none; }

/* events */
.ev {
  position: absolute; left: 0; top: 0; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--ink);
  border-radius: 99px; will-change: transform, opacity, width;
  background: color-mix(in srgb, var(--c) 7%, var(--surface));
}
.ev.point { background: transparent; }
.ev .e-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--life, 100%); min-width: 4px; border-radius: 99px;
  background: color-mix(in srgb, var(--c) 20%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent);
}
.ev .e-label { position: absolute; left: 0; top: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 0 9px; font-size: 11.5px; white-space: nowrap; transform: translateX(var(--lx, 0px)); }
.ev .e-label i { width: 7px; height: 7px; transform: rotate(45deg); background: var(--c); border-radius: 1.5px; flex: none; }
.ev.point .e-bar { width: 12px; background: transparent; box-shadow: none; }
.ev:hover .e-bar { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 80%, transparent); }
.ev.sel .e-bar { box-shadow: inset 0 0 0 2px var(--accent); }
.ev.flash { animation: flash 1.6s ease-out 2; }

.hint {
  position: absolute; right: 12px; bottom: 8px; z-index: 4; font-size: 11.5px; color: var(--muted); pointer-events: none;
  background: color-mix(in srgb, var(--surface) 88%, transparent); padding: 3px 10px; border-radius: 99px;
}

/* ---------- panel ---------- */
aside { border-left: 1px solid var(--line); background: var(--surface); overflow: auto; min-height: 0; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 20px; }
aside h2 { font: 600 11px/1 var(--font-body); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 10px; }
.ctl { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; margin-bottom: 12px; }
.ctl label { font-size: 12.5px; font-weight: 500; }
.ctl output { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.ctl .row { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.ctl .ticks { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); padding: 0 2px; }
input[type="range"] { flex: 1; accent-color: var(--accent); height: 22px; margin: 0; }
.auto { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.auto input { accent-color: var(--accent); margin: 0; }
.seg2 { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 99px; padding: 3px; margin-bottom: 14px; }
.seg2 button { border: 0; background: transparent; border-radius: 99px; padding: 5px 8px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.seg2 button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.toggles { display: flex; flex-direction: column; gap: 9px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; cursor: pointer; }
.switch input {
  appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; flex: none; margin: 0;
  transition: background .15s;
}
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); }
.switch small { display: block; color: var(--muted); font-size: 11.5px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field > span { font-size: 12px; color: var(--muted); }
select, .input {
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 6px 9px; font-size: 13px; width: 100%;
}
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.chipset { display: flex; flex-wrap: wrap; gap: 5px; }
.chipset button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 2px 10px; font-size: 12px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.chipset button i { width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: var(--c); }
.chipset button[aria-pressed="true"] { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; }
.legend div { display: flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 2px var(--c); }

.sel-title { font: 600 27px/1.05 var(--font-display); margin: 0 0 4px; text-wrap: balance; }
.sel-dates { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: 12.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mono { font-family: var(--font-mono); font-size: 11.5px; }
.pips { letter-spacing: 2px; color: var(--accent); }
.tagrow { display: flex; flex-wrap: wrap; gap: 4px; }
.tagrow span { font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
ul.rels { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
ul.rels li span { color: var(--muted); }
ul.rels button { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; text-align: left; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12.5px; font-variant-numeric: tabular-nums; margin-top: 8px; }
.stats span:nth-child(odd) { color: var(--muted); }
.stats span:nth-child(even) { text-align: right; }
details summary { cursor: pointer; font-size: 12.5px; }
.tests { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.tests .ok::before { content: "✓ "; color: #2a9d6f; }
.tests .bad::before { content: "✗ "; color: #d63b3b; }
.empty { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- dialogs ---------- */
dialog {
  border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(15, 18, 26, .35); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.dlg-h { padding: 18px 20px 6px; }
.dlg-h h2 { font: 600 24px/1.1 var(--font-display); margin: 0 0 10px; }
.dlg-b { padding: 6px 20px 8px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.dlg-f { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.err { color: #c63c3c; font-size: 12.5px; min-height: 1.2em; margin: 2px 0 0; }
.picklist { border: 1px solid var(--line); border-radius: 12px; max-height: 200px; overflow: auto; padding: 4px; }
.picklist label { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.picklist label:hover { background: var(--surface-2); }
.picklist small { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; grid-template-rows: 1fr minmax(0, 40%); }
  aside { border-left: 0; border-top: 1px solid var(--line); }
  .hint { display: none; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .swap .in, .swap .g-in, .card.flash, .group.flash, .ev.flash { animation: none; }
  .switch input, .switch input::after { transition: none; }
}

/* additions */
.lane-svg marker path { fill: var(--muted); }
.group.combo .badge { position: static; transform: none; align-self: center; margin: 0 9px 0 3px; flex: none; }
#stage .hint { bottom: 44px; }
.tab .del { margin-left: 2px; width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--muted); }
.tab .del:hover { background: var(--line); color: var(--ink); }


/* ===== v3: controls on top, overlay panel, cards hanging below the axis ===== */
.top { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 18px 12px; border-bottom: 1px solid var(--line); }
.row1 { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.row1 .brand { margin-right: auto; align-items: center; gap: 12px; }
.logo { width: 38px; height: 38px; border-radius: 11px; background: var(--ink); color: var(--surface); display: grid; place-items: center; font-size: 24px; line-height: 1; flex: none; }
.brand h1 { font-variant: small-caps; letter-spacing: .06em; font-size: 26px; }
.sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn.dark { background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 500; padding: 7px 14px; display: inline-flex; align-items: center; gap: 8px; }
.actions .btn { padding: 7px 14px; font-size: 13px; }
.tri { display: inline-flex; gap: 3px; }
.tri i { width: 7px; height: 7px; border-radius: 50%; }
.tri i:nth-child(1) { background: #e9b500; } .tri i:nth-child(2) { background: #d63b3b; } .tri i:nth-child(3) { background: #2f6fd6; }
.menu { position: relative; }
.pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 330px; max-height: calc(100vh - 120px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.16); padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.pop h2 { font: 600 11px/1 var(--font-body); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 6px 0 0; }
.pop .seg2 { margin-bottom: 4px; }
.more summary { font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.more[open] summary { margin-bottom: 8px; }

.row2 { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.row2 .search { flex: 1 1 200px; max-width: 280px; margin: 0; align-self: center; }
.fsel { width: auto; min-width: 104px; border-radius: 99px; padding: 6px 12px; align-self: center; background: var(--surface); }
.sl { display: flex; flex-direction: column; justify-content: center; gap: 0; border: 1px solid var(--line); border-radius: 14px; padding: 5px 12px 4px; width: 182px; background: var(--surface); }
.sl-h { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sl-h label:first-child { font-weight: 500; }
.sl-h output { margin-left: auto; font: 500 11.5px var(--font-mono); color: var(--ink); white-space: nowrap; }
.sl .auto { font-size: 11px; }
.sl input[type="range"] { width: 100%; height: 18px; }
.sl-t { display: flex; justify-content: space-between; font: 400 9.5px var(--font-mono); color: var(--muted); }

.tabs .count { margin-left: 8px; font: 500 12px var(--font-mono); border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; }
.tabs .tip { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--surface); }
.tab[aria-selected="true"] i { box-shadow: 0 0 0 1.5px var(--surface); }
.tab { box-shadow: inset 0 0 0 1px var(--line); }
.tab.add { box-shadow: inset 0 0 0 1px var(--line); border: 0; outline: 1px dashed transparent; }

#lanes.single .lane-h { display: none; }
.cards, .evs { pointer-events: none; }
.card, .group, .ev { pointer-events: auto; }

.c-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.c-dates { font: 500 10.5px/1.5 var(--font-mono); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; letter-spacing: 0; }
.c-country { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.c-country .cd { width: 7px; height: 7px; }
.card .in { padding: 8px 12px; }
.group.combo .seg { padding: 8px 12px; }

#panel {
  position: absolute; right: 14px; top: 14px; bottom: 14px; width: 340px; z-index: 20;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 40px rgba(0,0,0,.14);
  overflow: auto; padding: 18px 18px 22px; display: block;
}
#panel[hidden] { display: none; }
.panel-x { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; font-size: 17px; line-height: 1; color: var(--muted); }
.panel-x:hover { color: var(--ink); }
#sel h2 { font: 600 11px/1 var(--font-body); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 10px; }
textarea.input { resize: vertical; min-height: 160px; font-size: 11.5px; }

@media (max-width: 900px) {
  main { grid-template-rows: 1fr; }
  #panel { left: 10px; right: 10px; top: auto; width: auto; max-height: 55%; }
  .sl { width: calc(50% - 4px); }
  .row2 .search { max-width: none; flex-basis: 100%; }
}

.top, .tabs, .chips-bar { flex: none; }
@media (max-width: 1500px) { .tabs .tip { display: none; } }

/* ===== v4 ===== */
.dot { background: var(--ink); box-shadow: 0 0 0 3px var(--bg); }
.dot.soft { box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px color-mix(in srgb, var(--ink) 25%, transparent), 0 0 8px 4px color-mix(in srgb, var(--ink) 22%, transparent); }
.row2 { align-items: center; gap: 8px; }
.row2 .search input { height: 34px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
.fsel { height: 34px; min-width: 0; width: 98px; padding: 0 8px 0 12px; font-size: 12.5px; }
.sl { flex-direction: row; align-items: center; gap: 8px; height: 34px; width: auto; padding: 0 12px; border-radius: 99px; }
.sl-h { display: contents; }
.sl-h label:first-child { order: 0; }
.sl input[type="range"] { order: 1; width: 92px; height: 16px; }
.sl-h output { order: 2; margin-left: 0; min-width: 44px; text-align: right; }
.sl .auto { order: 3; padding-left: 8px; border-left: 1px solid var(--line); }
.sl-t { display: none; }
.ev.career { background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.ev.career .e-bar { background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
.ev.career .e-label { font-weight: 500; }
.ev.life .e-label i { background: var(--ink); border-radius: 50%; transform: none; }

/* ===== composer page ===== */
#panel.wide { width: min(600px, calc(100% - 28px)); }
.cp-h { padding-right: 36px; }
.cp-kicker { margin: 0 0 4px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cp-title { font: 600 32px/1.05 var(--font-display); margin: 0; text-wrap: balance; }
.cp-dates { margin: 6px 0 14px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.ph { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.cp-tabs small { color: var(--muted); font-size: 11px; margin-left: 3px; }
.cp-body { display: flex; flex-direction: column; gap: 4px; }
.cp-s { padding: 12px 0; border-top: 1px solid var(--line); }
.cp-s:first-of-type { border-top: 0; }
.cp-s h3, .w-sec h3 { font: 600 11px/1 var(--font-body); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 9px; }
.w-sec h3 small { font-weight: 400; letter-spacing: 0; }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
ul.plain li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
ul.plain li > span:not(.lbl):not(.st) { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; font-size: 12px; }
ul.plain .lbl { color: var(--muted); font-size: 12px; min-width: 92px; }
.sw { width: 10px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--c) 45%, var(--surface)); box-shadow: inset 0 0 0 1px var(--c); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-align: left; }
button.link:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: 13px; margin: 0; }
.w-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.w-tools .input { flex: 1 1 160px; width: auto; border-radius: 99px; height: 32px; padding: 0 12px; }
.w-group { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.w-group select { width: auto; height: 32px; border-radius: 99px; padding: 0 10px; }
.w-sec { padding-top: 12px; }
.work { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; background: var(--surface); }
.work.open { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.w-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; }
.w-main { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 2px 4px; cursor: pointer; display: flex; flex-direction: column; }
.w-title { font: 600 16.5px/1.2 var(--font-display); }
.w-title small { font: 500 10.5px var(--font-mono); color: var(--muted); }
.w-title .has-note { font-family: var(--font-body); color: var(--accent); }
.w-meta { font-size: 11.5px; color: var(--muted); }
.st, .bm, .rate button { border: 0; background: none; cursor: pointer; color: var(--line); padding: 2px; line-height: 1; }
.st { font-size: 19px; }
.st.on { color: #e9b500; }
.bm svg { width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.bm.on svg { fill: var(--accent); stroke: var(--accent); }
.rate { display: inline-flex; }
.rate button { font-size: 13px; color: color-mix(in srgb, var(--muted) 40%, transparent); }
.rate button.on { color: var(--accent); }
.rate:hover button { color: var(--accent); }
.rate button:hover ~ button { color: color-mix(in srgb, var(--muted) 40%, transparent); }
.w-detail { padding: 4px 14px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.w-detail .kv { margin-top: 8px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; align-items: center; }
.links .lbl { color: var(--muted); }
.links a { color: var(--accent); }
.ned { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.ned-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 5px 6px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ned-bar button { border: 0; background: var(--surface); border-radius: 7px; padding: 3px 9px; font-size: 12px; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.ned-link { width: auto; height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.ned-status { margin-left: auto; font-size: 11.5px; color: var(--muted); padding-right: 4px; }
.ned-area { min-height: 96px; padding: 10px 12px; font-size: 13.5px; line-height: 1.55; outline: none; }
.ned-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.ned-area ul, .ned-area ol { margin: 4px 0; padding-left: 22px; }
.ent-link { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 5px; padding: 0 4px; cursor: pointer; white-space: nowrap; }
.yt-chip { display: inline-block; margin: 4px 0; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: color-mix(in srgb, #d63b3b 12%, var(--surface)); color: var(--ink); user-select: none; }
.ned-yt { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.ned-yt .input { height: 30px; padding: 0 10px; font-size: 12.5px; }
.ned-videos { display: flex; flex-direction: column; gap: 6px; padding: 0 8px; }
.ned-videos:not(:empty) { padding-bottom: 8px; }
.yt-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; }
.yt-play { width: 28px; height: 20px; border-radius: 6px; background: #d63b3b; color: #fff; display: grid; place-items: center; font-size: 10px; flex: none; }
.yt-t { display: flex; flex-direction: column; min-width: 0; }
.yt-t small { color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; }
.yt-card a { margin-left: auto; color: var(--accent); white-space: nowrap; }
.yt-card .x, .yt .x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; }
.yt iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; }

#sel .cp-title { font: 600 32px/1.05 var(--font-display); text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; }
#sel .cp-h h2.cp-title { margin: 0; }

/* ===== v5 ===== */
.cd { background: var(--c); box-shadow: none; }
.tab i, .legend i, .k-dots i { background: var(--c); box-shadow: none; }
.k-dots i { box-shadow: 0 0 0 1.5px var(--surface); }
.c-born { font: 500 10.5px var(--font-mono); color: var(--muted); margin-left: 2px; }
.go {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: var(--surface-2); color: var(--muted); font: 600 14px/1 var(--font-body); cursor: pointer; box-shadow: 0 0 0 1px var(--line);
}
.go:hover { background: var(--ink); color: var(--surface); box-shadow: none; }
.card-go { position: absolute; z-index: 2; right: 9px; top: 31px; }
.m-name .card-go { top: 50%; right: 6px; transform: translateY(-50%); }
.m-name .badge { right: 28px; }
.card.is-bubble .card-go { display: none; }
.b-name .go { margin-left: 4px; width: 16px; height: 16px; font-size: 12px; }
.group.combo .seg .card-go { top: 31px; right: 8px; }
.group.combo.m-name .seg .card-go { top: 50%; }
.imp-set { display: flex; align-items: center; gap: 10px; }
.imp-set input { flex: 0 1 180px; }
.imp-set output { font: 500 12px var(--font-mono); }
.link-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.link-add .input { flex: 1 1 160px; width: auto; height: 32px; padding: 0 10px; font-size: 12.5px; }
ul.plain .x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; padding: 0 2px; }
ul.plain a { color: var(--accent); }
.yt { display: flex; flex-direction: column; gap: 4px; }
.yt-foot { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--muted); }
.yt-foot a { margin-left: auto; color: var(--accent); white-space: nowrap; }

/* ===== v6 ===== */
#stage { background: var(--surface); }
.lane-body { background: var(--surface); }
.era { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.era:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
#lanes.single .lane.composer .lane-h { display: flex; }
.lane-name { cursor: pointer; }
.lane-name::after { content: "▾"; font: 400 11px var(--font-body); color: var(--muted); margin-left: 2px; }
.lane-works { border: 0; background: var(--surface); box-shadow: 0 0 0 1px var(--line); border-radius: 99px; padding: 2px 10px; font-size: 12px; cursor: pointer; color: var(--muted); }
.lane-works[aria-pressed="true"] { color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

.mode-top { margin: 0; padding: 2px; height: 34px; }
.mode-top button { padding: 4px 12px; }
.grp { height: 34px; }
.grp[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* expand icon: top-right corner of every card, combined row and bubble */
.go { width: 18px; height: 18px; }
.go svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card-go, .m-name .card-go, .group.combo .seg .card-go, .group.combo.m-name .seg .card-go { top: 5px; right: 5px; transform: none; }
.m-name .card-go { top: 50%; transform: translateY(-50%); }
.card.is-bubble .card-go { display: inline-grid; top: 50%; right: 4px; transform: translateY(-50%); width: 16px; height: 16px; }
.card.is-bubble.m-card .card-go, .card.is-bubble.m-full .card-go { top: 4px; transform: none; }
.c-top { padding-right: 20px; }
.m-name .c-top { padding-right: 0; }
.card.is-bubble .badge { right: 24px; }

/* lifespan bubbles: no fades, text always inside */
.card.is-bubble { background: color-mix(in srgb, var(--c) 12%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); border-radius: 12px; overflow: hidden; }
.card.is-bubble.m-name { border-radius: 99px; }
.card.is-bubble .b-bar { -webkit-mask-image: none; mask-image: none; border-radius: inherit; box-shadow: none; background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.card.is-bubble .b-label { justify-content: flex-start; padding-top: 4px; right: 22px; }
.card.is-bubble.m-name .b-label { justify-content: center; padding-top: 0; }
.card.is-bubble.tight .c-born, .card.is-bubble.tight .b-dates { display: none; }
.card.is-bubble.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.card.is-bubble.sel .b-bar { box-shadow: none; }
.b-name, .b-dates { overflow: hidden; text-overflow: clip; }
.b-cities { display: none; }
.card.is-bubble.m-full .b-cities { display: block; position: absolute; left: 0; right: 0; bottom: 4px; height: 15px; }
.b-cities span {
  position: absolute; left: 0; top: 0; height: 15px; border-radius: 4px; padding: 0 5px; overflow: hidden; white-space: nowrap;
  font-size: 10px; line-height: 15px; color: var(--ink); background: color-mix(in srgb, var(--surface) 72%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent);
}
.b-cities span.nolabel { color: transparent; }

/* group-by-country labels in lifespan view */
.glabels { position: absolute; inset: 0; pointer-events: none; }
.glabel { position: absolute; left: 10px; top: 0; display: flex; align-items: center; gap: 6px; font: 600 11px var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.glabel i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.glabel small { font-weight: 400; letter-spacing: 0; }

/* combined nodes stack vertically */
.group.combo .g-in { flex-direction: column; }
.group.combo .seg { flex: 1 1 0; border-left: 0; border-top: 1px solid var(--line); min-height: 0; }
.group.combo .seg:first-child { border-top: 0; }
.group.combo.m-name { border-radius: 15px; }
.group.combo .badge { position: absolute; right: 28px; bottom: 6px; top: auto; margin: 0; }

/* connection line hover */
.links path.hit { stroke: transparent; stroke-width: 12; pointer-events: stroke; cursor: help; fill: none; }
.link-tip {
  position: fixed; left: 0; top: 0; z-index: 60; max-width: 320px; padding: 8px 11px; border-radius: 10px; pointer-events: none;
  background: var(--ink); color: var(--surface); font-size: 12.5px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.lane-pop { position: fixed; width: 320px; max-height: 60vh; z-index: 50; }
.lane-pop h2 { margin-top: 8px; }
#lane-opts { display: flex; flex-direction: column; gap: 1px; }
#lane-opts button { border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px; }
#lane-opts button:hover { background: var(--surface-2); }
#lane-opts i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.bio p { margin: 0 0 9px; font-size: 13.5px; line-height: 1.6; max-width: 62ch; }

.link-tip[hidden] { display: none; }
.c-top { padding-right: 26px; }
.row2 { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.row2 > * { flex-shrink: 0; }
.row2 .search { flex: 1 1 150px; min-width: 150px; max-width: 240px; }
.fsel { width: 88px; }
.sl { padding: 0 10px; gap: 6px; }
.sl input[type="range"] { width: 64px; }
.sl-h output { min-width: 40px; }
.mode-top button { padding: 4px 10px; }
@media (max-width: 1100px) { .row2 { flex-wrap: wrap; } }

.ev.career { overflow: hidden; }
.ev.career .e-label { right: 0; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 20px; }

/* ===== v7: boxes sized to content ===== */
.card .in { padding: 8px 12px; gap: 0; }
.c-top { height: 18px; margin-bottom: 2px; }
.c-title { line-height: 23px; height: 23px; }
.c-meta, .c-work { line-height: 16px; height: 16px; }
.c-tags { margin-top: 4px; height: 17px; align-items: center; }
.c-tags[hidden] { display: none !important; }
.group.combo .seg { flex: 0 0 auto; gap: 0; padding: 8px 12px; justify-content: flex-start; }
.group.combo.m-name .seg { justify-content: center; padding: 0 12px; }
.group.cluster .g-in { padding: 6px 12px; }
.dot { box-shadow: 0 0 0 2px var(--bg); transition: box-shadow .12s; }
.dot.soft { box-shadow: 0 0 0 2px var(--bg); }
.dot.hot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4.5px var(--accent); }
.era { background: color-mix(in srgb, hsl(var(--h) 38% 55%) 14%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, hsl(var(--h) 30% 50%) 18%, transparent); }
.era:hover { background: color-mix(in srgb, hsl(var(--h) 38% 55%) 24%, var(--surface)); }
.go, .go:hover { background: none; box-shadow: none; border-radius: 0; }
.go { color: var(--muted); width: 16px; height: 16px; }
.go:hover { color: var(--ink); }
.go svg { width: 12px; height: 12px; stroke-width: 1.7; }
.lane-svg marker path { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* ===== v8 ===== */
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line); }
.top.compact { gap: 0; padding-top: 8px; padding-bottom: 8px; }
.top.compact .row2 { display: none; }
.top.compact .sub { display: none; }
.top.compact .logo { width: 30px; height: 30px; font-size: 19px; border-radius: 9px; }
.top.compact .brand h1 { font-size: 21px; }
.top.compact .actions .btn { padding: 5px 12px; }

.filter-tab { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 12px; background: var(--ink); color: var(--surface); cursor: default; box-shadow: none; }
.filter-tab[aria-selected="false"] { background: var(--surface-2); color: var(--ink); cursor: pointer; }
.ft-l { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.fchip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 2px 1px 9px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 16%, transparent); font-size: 12.5px; }
.filter-tab[aria-selected="false"] .fchip { background: var(--surface); }
.fchip b { font-weight: 500; opacity: .7; }
.fchip button, .filter-tab .fx { border: 0; background: none; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; line-height: 1; opacity: .75; }
.fchip button:hover, .filter-tab .fx:hover { opacity: 1; background: color-mix(in srgb, var(--surface) 22%, transparent); }
.fsave { border: 0; background: color-mix(in srgb, var(--surface) 18%, transparent); color: inherit; border-radius: 99px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.filter-tab[aria-selected="false"] .fsave { background: var(--surface); }

.sl .rng { order: 1; position: relative; display: inline-flex; align-items: center; }
.sl .rng input { width: 64px; }
.hash { position: absolute; left: 7px; right: 7px; bottom: 1px; display: flex; justify-content: space-between; pointer-events: none; }
.hash i { width: 1px; height: 5px; background: var(--muted); opacity: .7; }
#tl-styles, #tl-tags { max-height: 132px; overflow: auto; padding: 2px; }

/* ===== v9 ===== */
.fsel {
  -webkit-appearance: none; appearance: none; width: auto; field-sizing: content; min-width: 0;
  padding: 0 28px 0 13px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235d6477' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
}
@supports not (field-sizing: content) { .fsel { width: 96px; } }
/* Hidden filters: keep the three sliders, drop the rest of the top clutter. */
.top.compact .row2 { display: flex; border-top: 0; padding-top: 6px; }
.top.compact .row2 > :not(.sl) { display: none; }
.top.compact #add-btn, .top.compact #bm-btn, .top.compact #backup-btn { display: none; }
.top.compact + .tabs .tab:not([aria-selected="true"]):not(.filter-tab), .top.compact + .tabs .tip, .top.compact + .tabs .tab.add { display: none; }

/* ===== v10: one-row compact header ===== */
.brand-cc, .cur-sel { display: none; }
.top.compact { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 10px; }
.top.compact .row1 { display: contents; }
.top.compact .brand { order: 0; margin-right: 0; flex: none; gap: 8px; }
.top.compact .brand > div:not(.logo) { display: none; }
.top.compact .brand-cc { display: inline; font: 600 20px/1 var(--font-display); letter-spacing: .06em; font-variant: small-caps; }
.top.compact .cur-sel { order: 1; display: flex; align-items: center; gap: 5px; min-width: 0; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; }
.top.compact .row2 { order: 2; flex: none; padding-top: 0; }
.top.compact .actions { order: 3; margin-left: auto; flex-wrap: nowrap; flex: none; }
.top.compact + .tabs { display: none; }
.cs-lane { white-space: nowrap; font-size: 12.5px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.cs-lane.on { background: var(--ink); color: var(--surface); }
.cur-sel .fchip { background: var(--surface-2); white-space: nowrap; }
.cs-x { border: 0; background: var(--surface-2); border-radius: 50%; width: 22px; height: 22px; cursor: pointer; color: var(--muted); flex: none; }
.cs-x:hover { color: var(--ink); }
.top.compact .sl { height: 32px; }

/* ===== v11 ===== */
.top.compact .actions, .top.compact .brand, .top.compact .cur-sel, .top.compact .row2 { margin-top: 0; margin-bottom: 0; align-self: center; }
.top.compact .actions .btn { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; }
/* Lifespans: no city strip; birth year only where no date range is shown. */
.card.is-bubble.m-full .b-cities, .b-cities { display: none !important; }
.card.is-bubble.m-card .c-born, .card.is-bubble.m-full .c-born { display: none; }

/* ===== v12: multiple pages, page button ===== */
#panels {
  position: absolute; top: 14px; right: 14px; bottom: 14px; z-index: 20; display: flex; gap: 12px;
  max-width: calc(100% - 28px); pointer-events: none;
}
#panels[hidden] { display: none; }
#panels.has-max { left: 14px; }
.page {
  pointer-events: auto; position: relative; width: 410px; flex: none; display: flex; flex-direction: column; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 40px rgba(0,0,0,.14);
}
.page.max { z-index: 3; }
.page.arrive { animation: arrive .25s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pg-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px; padding: 8px 10px 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pg-t { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-b { border: 0; background: none; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; }
.pg-b:hover { background: var(--surface-2); color: var(--ink); }
.pg-in { padding: 14px 18px 22px; }
.page.max .pg-in { max-width: 900px; width: 100%; margin: 0 auto; }
.page .cp-h { padding-right: 0; }
@media (max-width: 900px) { #panels { left: 10px; right: 10px; top: auto; height: 60%; } .page { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .page.arrive { animation: none; } }

.corner { position: absolute; z-index: 2; top: 5px; right: 5px; display: flex; gap: 1px; }
.m-name .corner { top: 50%; transform: translateY(-50%); }
.card.is-bubble .corner { top: 50%; transform: translateY(-50%); right: 4px; }
.card.is-bubble.m-card .corner, .card.is-bubble.m-full .corner { top: 4px; transform: none; }
.info { display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--muted); cursor: pointer; }
.info:hover { color: var(--ink); }
.info svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.c-top { padding-right: 44px; }
.m-name .badge { right: 44px; }
.card.is-bubble .badge { right: 44px; }

/* ===== v13: pages as movable, resizable windows ===== */
#panels { inset: 0; top: 0; right: 0; bottom: 0; left: 0; display: block; max-width: none; }
#panels.has-max { left: 0; }
.page { position: absolute; width: 410px; }
.page.dragging { user-select: none; box-shadow: 0 24px 60px rgba(0,0,0,.22); }
.pg-bar { cursor: grab; touch-action: none; }
.page.dragging .pg-bar { cursor: grabbing; }
.page.max .pg-bar { cursor: default; }
.rz { position: absolute; width: 16px; height: 16px; z-index: 4; touch-action: none; }
.rz.nw { left: -4px; top: -4px; cursor: nwse-resize; }
.rz.ne { right: -4px; top: -4px; cursor: nesw-resize; }
.rz.sw { left: -4px; bottom: -4px; cursor: nesw-resize; }
.rz.se { right: -4px; bottom: -4px; cursor: nwse-resize; }
.rz.se::after { content: ""; position: absolute; right: 7px; bottom: 7px; width: 7px; height: 7px; border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); border-radius: 0 0 3px 0; }
.page.max .rz { display: none; }
.page { overflow: hidden; }
.page .pg-in { overflow: auto; flex: 1; min-height: 0; }
@media (max-width: 900px) { #panels { top: auto; height: auto; } }
/* rounded corners would clip the corner handles, so the page itself doesn't clip */
.page { overflow: visible; }
.pg-bar { border-radius: 18px 18px 0 0; }
.page .pg-in { border-radius: 0 0 18px 18px; }

/* ===== v14 ===== */
.tabs { gap: 8px; }
.tabs-scroll { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; padding: 2px 0; }
.tabs > .tab.add, .tabs > .count { flex: none; }
.tab .del { opacity: 0; transition: opacity .12s; }
.tab:hover .del, .tab:focus-within .del, .tab:focus-visible .del { opacity: 1; }
.top.compact + .tabs .tabs-scroll .tab:not([aria-selected="true"]):not(.filter-tab) { display: none; }

button.fsel { cursor: pointer; text-align: left; border: 1px solid var(--line); height: 34px; color: var(--ink); font-size: 12.5px; }
button.fsel[aria-expanded="true"] { border-color: var(--accent); }
.combo-pop { position: fixed; z-index: 55; width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; }
.combo-pop[hidden] { display: none; }
.combo-pop .input { height: 32px; border-radius: 99px; padding: 0 12px; margin-bottom: 6px; }
.combo-pop .results { position: static; border: 0; box-shadow: none; padding: 0; max-height: 372px; overflow-y: auto; }
.combo-pop .results li { grid-template-columns: 1fr auto; padding: 6px 10px; }

.yr {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .1s;
  margin: -22px 0 0; translate: -50% 0; padding: 1px 7px; border-radius: 99px; white-space: nowrap;
  font: 500 10.5px var(--font-mono); background: var(--ink); color: var(--surface);
}
.yr.left { translate: 0 0; }
.yr.on { opacity: 1; }

/* ===== v15: windows float over the whole screen ===== */
#panels { position: fixed; inset: 0; z-index: 45; }

@media (max-width: 900px) { #panels { top: 0; height: auto; } }

/* ===== v16: snapping, logo in window bars, bookmark / pin / rating ===== */
#snap-prev { position: fixed; z-index: 44; border-radius: 18px; pointer-events: none; opacity: 0; transition: opacity .12s, left .12s, top .12s, width .12s, height .12s;
  background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
#snap-prev.on { opacity: 1; }
.pg-logo { width: 22px; height: 22px; border-radius: 7px; background: var(--ink); color: var(--surface); display: grid; place-items: center; font-size: 14px; line-height: 1; flex: none; margin-right: 4px; }
.st.bkm svg, .bm.pin svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.st.bkm.on svg { fill: #e9b500; stroke: #c99a00; }
.bm.pin.on svg { fill: var(--accent); stroke: var(--accent); }
ul.plain .st.bkm svg { width: 13px; height: 13px; }
.rate { gap: 3px; align-items: center; padding: 0 4px; }
.rate button { width: 9px; height: 9px; padding: 0; border-radius: 50%; background: color-mix(in srgb, var(--muted) 28%, transparent); }
.rate button.on { background: var(--accent); }
.rate:hover button { background: var(--accent); }
.rate button:hover ~ button { background: color-mix(in srgb, var(--muted) 28%, transparent); }

/* ===== v17: lanebar, tags ===== */
#lanebar { display: none; flex: none; border-bottom: 1px solid var(--line); background: var(--surface); }
#lanebar .lane-h { display: flex; padding: 5px 12px; height: 38px; }
#lanebar.composer, .top.compact ~ main #lanebar { display: block; }
#lanebar:empty { display: none !important; }
.tag-ed { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 6px; }
.tchip { border: 0; background: var(--surface-2); color: var(--ink); border-radius: 99px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.tchip:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
span.tchip { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 0; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
span.tchip button { border: 0; background: none; cursor: pointer; font-size: 12px; padding: 2px 4px 2px 10px; color: var(--ink); }
span.tchip .x { padding: 0 6px; color: var(--muted); font-size: 14px; }
.tag-in { border: 1px dashed var(--line); background: none; border-radius: 99px; padding: 2px 10px; font-size: 12px; width: 120px; color: var(--ink); }
.tag-in:focus { outline: none; border-style: solid; border-color: var(--accent); width: 160px; }

/* ===== v18: welcome screen, guest chip, feedback ===== */
.welcome { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--bg, #eef0f5) 70%, transparent); backdrop-filter: blur(6px); }
.welcome[hidden] { display: none; }
.wl-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15,18,26,.18); padding: 30px 30px 22px; text-align: center; }
.wl-logo { width: 54px; height: 54px; margin: 0 auto 10px; border-radius: 14px; background: var(--ink); color: var(--surface);
  display: grid; place-items: center; font-size: 32px; }
.wl-badge { display: inline-block; margin: 0 0 8px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
  background: color-mix(in srgb, #e6a817 18%, var(--surface)); color: color-mix(in srgb, #8a5a00 85%, var(--ink)); font-weight: 600; }
.wl-card h2 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 30px; font-weight: 600; margin: 0 0 8px; line-height: 1.1; }
.wl-card > p#wl-msg { color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
.wl-card .field { text-align: left; }
.wl-card em, #dlg-feedback em { font-style: normal; color: var(--muted); opacity: .8; }
.wl-go { width: 100%; padding: 10px; font-size: 15px; margin-top: 4px; }
.wl-loading { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; display: flex; gap: 8px; justify-content: center; align-items: center; }
.wl-loading[hidden] { display: none; }
.spin { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: cc-spin .8s linear infinite; }
@keyframes cc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.wl-fine { font-size: 11.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.45; }
body.welcoming { overflow: hidden; }

.building-pill { font-size: 11px; padding: 2px 9px; border-radius: 99px; font-weight: 600; letter-spacing: .03em;
  background: color-mix(in srgb, #e6a817 16%, var(--surface)); color: color-mix(in srgb, #8a5a00 85%, var(--ink)); white-space: nowrap; }
.top.compact .building-pill { display: none; }
.guest-chip { position: relative; }
.guest-chip[hidden] { display: none; }
#guest-chip-btn { display: inline-flex; gap: 6px; align-items: center; max-width: 180px; }
#guest-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-av { font-size: 12px; filter: grayscale(1); }
.guest-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; min-width: 230px; padding: 6px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.guest-menu[hidden] { display: none; }
.guest-menu .gm-h { margin: 4px 8px 6px; font-size: 12.5px; font-weight: 600; }
.guest-menu .gm-h small { display: block; font-weight: 400; color: var(--muted); }
.guest-menu button { text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 13px; }
.guest-menu button:hover, .guest-menu button:focus-visible { background: var(--surface-2); }
#gm-out { color: var(--muted); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }

#dlg-feedback { width: min(540px, calc(100vw - 24px)); }
#dlg-feedback .seg2 { margin: 10px 0 0; max-width: 280px; }
.fb-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.fb-kind button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--ink); }
.fb-kind button b { display: block; font-size: 13.5px; font-weight: 600; }
.fb-kind button small { color: var(--muted); font-size: 12px; }
.fb-kind button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
#dlg-feedback textarea.input { resize: vertical; min-height: 110px; font: inherit; }
#fb-sev-row[hidden] { display: none; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-done { text-align: center; padding: 18px 8px; }
.fb-done-i { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  background: color-mix(in srgb, #2f8a4a 15%, var(--surface)); color: #2f8a4a; }
.fb-done h3 { margin: 0 0 6px; }
.fb-done p { color: var(--muted); margin: 0 0 14px; }
.fb-done .row { display: flex; gap: 8px; justify-content: center; }
.fb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fb-list li { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.fb-list li div { flex: 1; min-width: 0; }
.fb-list b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-list small { color: var(--muted); font-size: 11.5px; }
.fb-k { font-size: 11px; border-radius: 99px; padding: 1px 8px; font-weight: 600; }
.fb-k.bug { background: color-mix(in srgb, #c63c3c 14%, var(--surface)); color: #a33030; }
.fb-k.idea { background: color-mix(in srgb, #2f8a4a 14%, var(--surface)); color: #23703a; }
.fb-st { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
#site-mode:empty { display: none; }

/* ===== v19: table view, repertoire finder, year and text pages ===== */
#table-view { display: none; flex: 1; min-height: 0; gap: 0; background: var(--bg, var(--surface-2)); }
body.table-mode #table-view:not([hidden]) { display: flex; }
body.table-mode #stage { display: none; }
body.table-mode .row2 .sl, body.table-mode #grp-country { display: none; }
.t-finder { width: 280px; flex: none; overflow: auto; padding: 14px 16px 24px; border-right: 1px solid var(--line); background: var(--surface); }
.t-finder h2 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 22px; font-weight: 600; margin: 0 0 10px; }
.t-finder .seg2 { margin-bottom: 12px; }
.t-finder .f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.t-finder .field { margin-bottom: 8px; }
.t-finder .input { width: 100%; }
.fs { border: 0; margin: 4px 0 10px; padding: 0; }
.fs legend { font-size: 12px; color: var(--muted); padding: 0; margin-bottom: 4px; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 2px 0; cursor: pointer; }
.t-finder > .btn { margin-top: 8px; }
.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.t-count { margin: 0; font-size: 13px; color: var(--muted); }
.t-count b { color: var(--ink); }
.t-wrap { flex: 1; overflow: auto; }
.rep-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; background: var(--surface); }
.rep-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-weight: 500; border-bottom: 1px solid var(--line); padding: 0; white-space: nowrap; }
.rep-table thead th button { all: unset; display: block; padding: 8px 10px; cursor: pointer; color: var(--muted); font-size: 12px; }
.rep-table thead th button:hover, .rep-table thead th button:focus-visible { color: var(--ink); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.rep-table thead th[aria-sort="ascending"] button, .rep-table thead th[aria-sort="descending"] button { color: var(--ink); font-weight: 600; }
.rep-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rep-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.rep-table td.c-title { min-width: 220px; }
.rep-table td.c-title small { color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: 11px; }
.rep-table td.c-year, .rep-table td.c-end, .rep-table td.c-dur, .rep-table td.c-works, .rep-table td.c-importance { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-table .c-star { width: 30px; }
.rep-table .link { text-align: left; }
.t-star { border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--muted); padding: 0 2px; line-height: 1; }
.t-star.on { color: var(--accent); }
.diff { letter-spacing: 1px; font-size: 9px; color: var(--accent); white-space: nowrap; }
.diff .off { color: var(--line); }
.rep-table sup { color: var(--muted); margin-left: 1px; }
.t-more { padding: 12px; text-align: center; }
.t-empty { padding: 24px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) { #table-view:not([hidden]) { flex-direction: column; } .t-finder { width: auto; max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--line); } }

#ruler { cursor: pointer; }
#ruler:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.yr-nav { display: flex; align-items: center; gap: 10px; }
.yr-nav .cp-title { margin: 0; font-variant-numeric: tabular-nums; }
.yr-go { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-left: auto; }
.yr-go .input { width: 84px; }
ol.settings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
ol.settings li { display: flex; gap: 12px; align-items: baseline; }
ol.settings .yr { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); width: 58px; flex: none; }
ol.settings small { display: block; color: var(--muted); font-size: 12px; }
.w-detail .links { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.sources li a { font-size: 13px; }
.t-bar { justify-content: flex-start; }
.rep-table .link { font: 500 13px/1.35 'IBM Plex Sans', system-ui, sans-serif; color: var(--accent); }
.rep-table td.c-title .link { font-size: 13.5px; color: var(--ink); }
.rep-table td.c-title .link:hover { color: var(--accent); text-decoration: underline; }

/* ===== v20: Feedback button beside the title, no subline ===== */
.brand .fb-cta { margin-left: 6px; padding: 7px 16px; font-weight: 600; font-size: 13.5px; white-space: nowrap; box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.brand .fb-cta:hover, .brand .fb-cta:focus-visible { filter: brightness(1.08); }
.top.compact .brand .fb-cta { padding: 5px 12px; font-size: 12.5px; }
@media (max-width: 760px) { .row1 .brand { flex-wrap: wrap; row-gap: 8px; max-width: 100%; } .brand h1 { font-size: 21px; } .brand .fb-cta { padding: 6px 12px; margin-left: 0; } }
