/* Jazzverse — "less, but better". Neutral greys; covers carry the colour.
   Accents have one job each and are never decorative:
     red    selected / hovered album        yellow  sideman credits
     green  live recordings                 brown   posthumous releases, compilations
     blue   links, focus ring
   Yellow, green and brown are marks and swatches only, never text (too little contrast in one theme or both).
   Light and dark are equal variants; every colour lives in a token. */
:root {
  /* neutrals */
  --page: #E8E8E4;  --surface: #F4F4F1;  --chip: #F4F4F1;
  --hairline: #CFCFCA;  --rule: #BDBDB8;
  --ink: #1C1C1B;  --ink-2: #63635F;  --ink-3: #7A7A76; /* ink-3: decorative only */

  /* accents: one job each, never decorative */
  --red:    #D9402F;  /* selected / hovered album */
  --yellow: #E8AE1E;  /* sideman credits */
  --green:  #1E6B3F;  /* live recordings */
  --brown:  #5C4838;  /* posthumous releases, compilations */
  --blue:   #546878;  /* links, focus ring (Rams steel blue-grey) */
  --signal: var(--red);

  --radius: 4px;  --radius-cover: 1px;
  --dur: 120ms;  --ease: cubic-bezier(0.2, 0, 0, 1);
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Variant-specific roles, built from the tokens above. */
  --tip: var(--surface);                 /* tooltip, menus, dialogs */
  --seg-off: var(--surface);             /* inactive segment */
  --field-edge: var(--hairline);         /* search field border */
  --chip-edge: var(--rule);              /* album chip without cover */
  --cover-edge: rgba(0, 0, 0, 0.25);     /* inner border on cover art */
  --cover-dim: none;                     /* resting cover filter */
  --post-opacity: 0.7;                   /* released after death: cover / placeholder */
  --scrim: rgba(28, 28, 27, 0.3);

  --label-w: 250px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #1B1B1A;  --surface: #242423;  --chip: #2E2E2C;
    --hairline: #2E2E2C;  --rule: #3E3E3B;
    --ink: #E9E9E5;  --ink-2: #9A9A95;  --ink-3: #6E6E6A;

    --red:    #E8503D;
    --yellow: #F2BA2C;
    --green:  #2E8A52;
    --brown:  #8A6E58;
    --blue:   #AAB7BF;

    --tip: var(--chip); --seg-off: var(--chip);
    --field-edge: transparent; --chip-edge: transparent;
    --cover-edge: #000; --cover-dim: brightness(0.85); --post-opacity: 1;
    --scrim: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #1B1B1A;  --surface: #242423;  --chip: #2E2E2C;
  --hairline: #2E2E2C;  --rule: #3E3E3B;
  --ink: #E9E9E5;  --ink-2: #9A9A95;  --ink-3: #6E6E6A;

  --red:    #E8503D;
  --yellow: #F2BA2C;
  --green:  #2E8A52;
  --brown:  #8A6E58;
  --blue:   #AAB7BF;

  --tip: var(--chip); --seg-off: var(--chip);
  --field-edge: transparent; --chip-edge: transparent;
  --cover-edge: #000; --cover-dim: brightness(0.85); --post-opacity: 1;
  --scrim: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
@media (max-width: 640px) { :root { --label-w: 148px; } }

* { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  display: flex; flex-direction: column; overflow: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
.muted { color: var(--ink-2); }

/* ---------------- header + search */
.top {
  display: flex; align-items: center; gap: 20px; padding: 12px 24px;
  border-bottom: 1px solid var(--hairline); flex: none; position: relative; z-index: 20; background: var(--page);
}
.wordmark { font: 500 19px/1 var(--font); text-decoration: none; letter-spacing: -0.02em; }
.search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.search input {
  width: 100%; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--field-edge);
  background: var(--surface); color: var(--ink); font: inherit; outline: none;
}
.search input::placeholder { color: var(--ink-2); opacity: 1; }

#results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 0; list-style: none;
  background: var(--tip); border: 1px solid var(--hairline); border-radius: var(--radius); max-height: 60vh; overflow: auto;
}
#results li { padding: 8px 12px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; border-top: 1px solid var(--hairline); }
#results li:first-child { border-top: 0; }
#results li[aria-selected="true"], #results li:hover { background: var(--page); }
#results .n { font-weight: 500; }
#results .d { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#results .empty { color: var(--ink-2); cursor: default; }

/* ---------------- landing */
#landing { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 24px 12vh; max-width: 820px; margin: 0 auto; width: 100%; }
#landing h1 { font: 500 clamp(34px, 6vw, 56px)/1.08 var(--font); margin: 0 0 22px; letter-spacing: -0.02em; }
#landing h1 span { color: var(--ink-2); }
#landing .hint { color: var(--ink-2); margin: 0 0 8px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.suggest a { text-decoration: none; padding: 6px 12px; border: 1px solid var(--rule); border-radius: var(--radius); }
.suggest a:hover { border-color: var(--ink); }

/* ---------------- musician view */
#musician { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.intro { padding: 14px 24px 10px; flex: none; }
.trail { font-size: 13px; color: var(--ink-2); min-height: 18px; display: flex; flex-wrap: wrap; gap: 2px 6px; }
.trail a { text-decoration: none; color: var(--blue); }
.trail a:hover { text-decoration: underline; }
.trail .sep { color: var(--ink-3); }
.trail .here { color: var(--ink); }
.centre { display: flex; align-items: center; gap: 16px; margin: 8px 0 10px; }
.centre h1 { font: 500 clamp(28px, 4vw, 38px)/1.05 var(--font); margin: 0; letter-spacing: -0.02em; view-transition-name: centre-name; }
.centre-meta { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
#centre-photo { view-transition-name: centre-photo; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tools > button { border: 1px solid var(--rule); background: transparent; border-radius: var(--radius); padding: 5px 11px; cursor: pointer; font-size: 13px; }
.tools > button:hover { border-color: var(--ink); }
.tools .seg { display: inline-flex; gap: 0; border-radius: var(--radius); overflow: hidden; }
.tools .seg button { border: 0; background: var(--seg-off); color: var(--ink); padding: 6px 12px; cursor: pointer; font-size: 13px; font-variant-numeric: tabular-nums; }
.tools .seg button:hover { background: var(--hairline); }
.tools .seg button[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.tools .quiet { border-color: transparent; color: var(--ink-2); }
.tools .quiet:hover { border-color: transparent; color: var(--ink); }
.tools .primary { margin-left: auto; background: var(--ink); color: var(--page); border-color: var(--ink); }
.tools .primary:disabled { opacity: 0.5; cursor: progress; }
.status { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--ink-2); min-height: 16px; font-variant-numeric: tabular-nums; }
.status .bar { width: 120px; height: 1px; background: var(--rule); overflow: hidden; flex: none; }
.status .bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width var(--dur) var(--ease); }
.status.done .bar { display: none; }

/* photos / initials */
.ph {
  --s: 26px; width: var(--s); height: var(--s); border-radius: var(--radius); flex: none; overflow: hidden;
  display: inline-grid; place-items: center; background: var(--chip); color: var(--ink-2);
  outline: 1px solid var(--chip-edge); outline-offset: -1px;
  font: 500 calc(var(--s) * 0.36)/1 var(--font); letter-spacing: 0; position: relative;
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; display: block; }
.ph-xl { --s: 76px; }
.ph.loading { background: var(--hairline); color: transparent; outline: 0; }

/* ---------------- timeline */
.scroller { flex: 1; overflow: auto; position: relative; border-top: 1px solid var(--hairline); overscroll-behavior: contain; }
.chart { position: relative; min-width: 100%; }
.axis { position: sticky; top: 0; z-index: 6; display: flex; height: 30px; background: var(--page); border-bottom: 1px solid var(--rule); view-transition-name: axis; }
.axis .corner { position: sticky; left: 0; width: var(--label-w); flex: none; background: var(--page); z-index: 2; }
.axis .ticks { position: relative; flex: 1; }
.tick { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; padding-bottom: 7px; transition: left var(--dur) var(--ease); }
.tick.decade { color: var(--ink); font-weight: 500; }
.tick.month { font-size: 10px; }
.tick.month::after { height: 3px; }
.tick::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 1px; height: 4px; background: var(--rule); }
.lanes { position: relative; view-transition-name: lanes; }
.grid { position: absolute; inset: 0 0 0 var(--label-w); pointer-events: none; }
.grid i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--hairline); transition: left var(--dur) var(--ease); }
.grid i.dec { background: var(--rule); }

.lane {
  position: absolute; left: 0; right: 0; display: flex; height: var(--lh, 36px);
  border-bottom: 1px solid var(--hairline);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.lane.enter { animation: lane-in var(--dur) var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes lane-in { from { opacity: 0; } }
.lane:hover, .lane:hover .label, .lane:has(.mark.active), .lane:has(.mark.active) .label { background: var(--surface); }
.label {
  position: sticky; left: 0; z-index: 3; width: var(--label-w); flex: none; display: flex; align-items: center; gap: 9px;
  padding: 0 10px 0 24px; background: var(--page); border-right: 1px solid var(--hairline); min-width: 0;
}
.label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 1fr minmax(min-content, auto) minmax(min-content, auto) 1fr; align-content: center; column-gap: 9px; row-gap: 1px; line-height: 1.2; }
.label > .ph { grid-row: 1 / 5; align-self: center; } /* empty 1fr rows keep name + dates packed and centred beside a tall photo */
/* minmax(min-content, …): name and dates clip their overflow, which lets plain auto rows shrink to nothing and the two
   lines overlap. On desktop the count shares the name's row and hides this; on phones the count is hidden. */
.label .txt { display: contents; }
.label .name { grid-column: 2; grid-row: 2; align-self: baseline; }
.label .sub { grid-column: 2; grid-row: 3; }
.label .count { grid-column: 3; grid-row: 2; align-self: baseline; }
.label .name {
  display: block; max-width: 100%; border: 0; background: none; padding: 0; cursor: pointer; text-align: left;
  font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.label .name:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.label .sub { display: flex; gap: 6px; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.label .inst { overflow: hidden; text-overflow: ellipsis; }
.label .born { flex: none; position: relative; overflow: hidden; font-variant-numeric: tabular-nums; }
.label .born.loading { width: 34px; height: 11px; margin-top: 2px; background: var(--hairline); }
.label .count { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; flex: none; }
.lane.centre-lane { border-bottom: 1px solid var(--rule); }
.lane.centre-lane .label .name { font-size: 15px; cursor: default; }
.lane.centre-lane .label .name:hover { text-decoration: none; }

.track { position: relative; flex: 1; }
/* "Albums as leader": a 2px line from first to last album. */
.span { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--ink-3); transition: left var(--dur) var(--ease), width var(--dur) var(--ease); }
.mark {
  position: absolute; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; padding: 0; border: 0; border-radius: var(--radius-cover);
  background: var(--ink-2); cursor: pointer;
  transition: left var(--dur) var(--ease), transform var(--dur) var(--ease); animation: pop var(--dur) var(--ease) both;
}
.centre-lane .mark { background: var(--ink); }
.mark.pending, .thumbs .mark.pending { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: var(--radius-cover); background: var(--rule); outline: 0; pointer-events: none; }
.mark.inferred { background: transparent; outline: 1px solid var(--ink-2); outline-offset: -1px; }
.mark:hover, .mark.active { transform: scale(1.6); z-index: 2; outline: 2px solid var(--signal); outline-offset: 1px; }
.mark:focus-visible:not(.active) { z-index: 2; outline: 2px solid var(--blue); outline-offset: 2px; }
.thumbs .mark { width: var(--cs, 28px); height: var(--cs, 28px); margin: calc(var(--cs, 28px) / -2) 0 0 calc(var(--cs, 28px) / -2); overflow: hidden; background: var(--chip); outline: 1px solid var(--chip-edge); outline-offset: -1px; }
.thumbs .centre-lane .mark { --c: calc(var(--cs, 28px) + 10px); width: var(--c); height: var(--c); margin: calc(var(--c) / -2) 0 0 calc(var(--c) / -2); }
.thumbs .mark .tile { font-size: clamp(9px, calc(var(--cs, 28px) * 0.32), 10px); }
.zooming :is(.mark, .span, .tick, .grid i) { transition: none; }
.thumbs .mark:hover, .thumbs .mark.active { transform: scale(1.25); outline: 2px solid var(--signal); outline-offset: 1px; }
.thumbs .mark:focus-visible:not(.active) { outline: 2px solid var(--blue); outline-offset: 2px; }
.mark img { width: 100%; height: 100%; object-fit: cover; display: block; filter: var(--cover-dim); transition: filter var(--dur) var(--ease); }
.lane:hover .mark img, .mark:hover img, .mark.active img { filter: none; }
/* A chip showing cover art: hairline inner border so the art doesn't bleed into the page. */
.thumbs .mark:has(img) { outline-color: transparent; }
.thumbs .mark:has(img)::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--cover-edge); pointer-events: none; }
.thumbs .mark:has(img):is(:hover, .active) { outline-color: var(--signal); }
.thumbs .mark:has(img):focus-visible:not(.active) { outline-color: var(--blue); }
.mark .tile { display: grid; place-items: center; width: 100%; height: 100%; font: 500 9px/1 var(--font); color: var(--ink-2); background: var(--chip); text-transform: uppercase; letter-spacing: 0.02em; }
/* Accent flags on album marks. Dots: sideman = yellow fill, live = green ring.
   Chips: sideman = 3px yellow edge on top, live = 3px green edge at the bottom. */
.mark.sideman { background: var(--yellow); }
.mark.live { outline: 1.5px solid var(--green); outline-offset: 1px; }
.thumbs .mark.sideman { background: var(--chip); border-top: 3px solid var(--yellow); }
.thumbs .mark.live { outline: 1px solid var(--chip-edge); outline-offset: -1px; border-bottom: 3px solid var(--green); }
.thumbs .mark.live:has(img) { outline-color: transparent; }
.mark:is(.live, .sideman):is(:hover, .active) { outline: 2px solid var(--signal); outline-offset: 1px; }
/* Small square swatch used next to text labels (tooltip, album page, legend). */
.flag { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.flag.sideman { background: var(--yellow); }
.flag.live { background: var(--green); }
.flag.post, .flag.compilation { background: var(--brown); }
@keyframes pop { from { opacity: 0; } }

/* ---------------- instrument view */
#instrument { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#instrument .centre { margin-top: 4px; }
.life { position: absolute; top: 50%; height: 1px; margin-top: 0; background: var(--rule); transition: left var(--dur) var(--ease), width var(--dur) var(--ease); }
#instrument .mark { width: 6px; height: 6px; margin: -3px 0 0 -3px; }
/* Released after death: dashed 1px brown edge. Light: art at 70%. Dark: full opacity (fading vanishes on black). */
#instrument .mark.posthumous { background: var(--page); outline: 1px dashed var(--brown); outline-offset: -1px; }
#instrument .thumbs .mark { width: var(--cs, 28px); height: var(--cs, 28px); margin: calc(var(--cs, 28px) / -2) 0 0 calc(var(--cs, 28px) / -2); background: var(--chip); }
#instrument .thumbs .mark.posthumous { background: var(--chip); outline: 1px dashed var(--brown); outline-offset: -1px; }
#instrument .thumbs .mark.posthumous:has(img)::after { border: 0; }
#instrument .mark.posthumous :is(img, .tile) { opacity: var(--post-opacity); }
#instrument .mark.posthumous:is(:hover, .active) { outline: 2px solid var(--signal); outline-offset: 1px; }
#instrument .thumbs .mark .tile { font-size: clamp(9px, calc(var(--cs, 28px) * 0.32), 10px); }
#instrument .zooming :is(.mark, .span, .life, .tick, .grid i) { transition: none; }
.tools .zoom { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 15px; user-select: none; }
.tools .zoom input { width: 170px; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; height: 16px; cursor: pointer; }
.tools .zoom input::-webkit-slider-runnable-track { height: 1px; background: var(--rule); }
.tools .zoom input::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; margin-top: -4.5px; background: var(--ink); border: 0; border-radius: 0; }
.tools .zoom input::-moz-range-track { height: 1px; background: var(--rule); }
.tools .zoom input::-moz-range-thumb { width: 10px; height: 10px; background: var(--ink); border: 0; border-radius: 0; }
.tools .zoom input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tools .zoom .knob { cursor: pointer; width: 24px; height: 24px; margin: 0 -5px; padding: 0; border: 0; background: transparent; color: var(--ink-2); font-size: 15px; line-height: 1; display: inline-grid; place-items: center; } /* plain glyphs; negative margin keeps the 24px hit area without widening the gap */
.tools .zoom .knob:hover { color: var(--ink); }
.tools .zoom .knob:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.card .step { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.card .step button { width: 36px; height: 30px; border: 1px solid var(--rule); background: none; border-radius: var(--radius); font-size: 18px; line-height: 1; cursor: pointer; }
.card .step button:hover:not(:disabled) { border-color: var(--ink); }
.card .step button:disabled { opacity: 0.35; cursor: default; }
.card.docked { left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; }
.card.docked .step button { width: 44px; height: 36px; }
#instrument .label .count .born.loading { display: inline-block; width: 16px; }
#musician .tools .primary { margin-left: 0; }
.legend { display: inline-flex; align-items: center; gap: 14px; font-size: 12px; color: var(--ink-2); margin-left: auto; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .lg::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.legend .lg-red::before { background: var(--red); }
.legend .lg-yellow::before { background: var(--yellow); }
.legend .lg-brown::before { background: var(--brown); }
.legend .lg-green::before { background: var(--green); }
/* Only categories present in the data. */
main:not(:has(.mark.sideman)) .legend .lg-yellow,
main:not(:has(.mark.posthumous)) .legend .lg-brown,
main:not(:has(.mark.live)) .legend .lg-green { display: none; }
#instrument .label .n-albums { display: none; }
#instrument .label .ph { --s: clamp(24px, calc(var(--lh, 54px) - 22px), 48px); } /* follows row height (which follows zoom), ≥11px clear above and below */
@media (max-width: 640px) {
  #instrument { --label-w: 164px; }
  #instrument .label { column-gap: 6px; padding-right: 6px; padding-left: 8px; }
  #instrument .label .ph { --s: 22px; }
  #instrument .label .name { font-size: 12.5px; }
  #instrument .label .n-albums { display: inline; }
  #instrument .label .sub { font-size: 10.5px; gap: 3px; letter-spacing: -0.01em; }
  .tools .zoom { flex: 1 1 140px; }
  #musician .tools .primary { margin-left: 0; }
  .tools .zoom input { width: auto; flex: 1; }
  #instrument .mark { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; }
}
@media (max-width: 640px) { .legend { display: none; } }

/* ---------------- hover card (tooltip) */
.card {
  position: fixed; z-index: 50; width: 300px; background: var(--tip); color: var(--ink); border-radius: var(--radius);
  border: 1px solid var(--hairline); padding: 12px; display: flex; gap: 12px; font-size: 13px; line-height: 1.35;
}
.card[hidden] { display: none; }
.card .cover { position: relative; width: 84px; height: 84px; flex: none; border-radius: var(--radius-cover); overflow: hidden; background: var(--chip); }
.card .cover::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--cover-edge); pointer-events: none; }
.card .cover:not(:has(img))::after { border-color: var(--chip-edge); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .tile { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 6px; font: 500 11px/1.2 var(--font); color: var(--ink-2); overflow: hidden; }
.card .body { min-width: 0; }
.card .t { font: 500 15px/1.25 var(--font); letter-spacing: -0.01em; text-decoration: none; display: block; margin-bottom: 3px; }
.card .t:hover { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; }
.card .when { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card .lbl { color: var(--ink-2); }
.card .who { margin-top: 6px; }
.card .who b { font-weight: 500; }
.card .note { margin-top: 6px; color: var(--ink-2); font-size: 11.5px; }

/* ---------------- credits dialog */
dialog#credits { border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--tip); color: var(--ink); width: min(560px, 92vw); max-height: 80vh; padding: 20px 24px; }
dialog#credits::backdrop { background: var(--scrim); }
dialog#credits h2 { font: 500 22px/1.2 var(--font); letter-spacing: -0.02em; margin: 0 0 6px; }
dialog#credits ul { list-style: none; padding: 0; margin: 14px 0 0; }
dialog#credits li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--hairline); font-size: 13px; }
dialog#credits li .muted { font-size: 12px; }
dialog#credits .close { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--ink-2); }

.foot { flex: none; font-size: 11.5px; color: var(--ink-2); padding: 7px 24px; border-top: 1px solid var(--hairline); }
.foot a { text-decoration: none; color: var(--blue); }
.foot a:hover { text-decoration: underline; }

/* ---------------- album page */
#album { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.album-wrap { max-width: 920px; margin: 0 auto; padding: 0 24px 60px; }
.back-btn { margin: 14px 0 0; border: 0; background: none; padding: 4px 0; color: var(--ink-2); cursor: pointer; font-size: 14px; }
.back-btn:hover { color: var(--ink); }
.album-hero { position: relative; margin: 0 -24px; padding: 22px 24px 20px; overflow: hidden; }
.album-hero .inner { position: relative; display: grid; gap: 18px; }
.acover { position: relative; width: min(72vw, 300px); aspect-ratio: 1; margin: 0 auto; border-radius: var(--radius-cover); overflow: hidden; background: var(--chip); }
.acover::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--cover-edge); pointer-events: none; }
.acover:not(:has(img))::after { border-color: var(--chip-edge); }
.acover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acover .tile { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 12%; font: 500 22px/1.15 var(--font); letter-spacing: -0.01em; color: var(--ink-2); }
@media (min-width: 640px) {
  .album-hero .inner { grid-template-columns: 260px 1fr; align-items: end; }
  .acover { width: 260px; margin: 0; }
}
.album-hero h1 { font: 500 clamp(28px, 4.6vw, 40px)/1.05 var(--font); margin: 0; letter-spacing: -0.02em; }
.album-hero .by { font-size: 18px; margin-top: 6px; }
.album-hero .by a { color: var(--ink); font-weight: 500; text-decoration: none; }
.album-hero .by a:hover { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; }
.album-hero .meta { color: var(--ink-2); font-size: 14px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kicker { font-size: 12px; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; }
.kicker .flag { width: 7px; height: 7px; margin: 0 4px 0 2px; }
#album h2.section { font: 500 20px/1.2 var(--font); letter-spacing: -0.015em; margin: 30px 0 12px; display: flex; align-items: baseline; gap: 8px; }
#album h2.section small { font: 400 13px var(--font); letter-spacing: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
#album .small { font-size: 13px; }
#album .center { text-align: center; padding: 30px 0; }
#album a { text-decoration: none; }
#album .src a, #album .pbody p a { color: var(--blue); text-decoration: underline; text-decoration-color: currentColor; text-decoration-thickness: 1px; }
.ph-m { --s: 64px; }


#album .list { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
#album .row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--hairline); min-height: 56px; }
#album .row:first-child { border-top: 0; }
#album a.row:hover { background: var(--page); }
#album .grow { flex: 1; min-width: 0; }
#album .name { font-weight: 500; }
#album .sub { font-size: 13px; color: var(--ink-2); }
#album .chev { color: var(--ink-3); font-size: 18px; }
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 0 6px; border-radius: var(--radius); border: 1px solid var(--ink); color: var(--ink); vertical-align: 1px; margin-left: 6px; }
.badge.grey { border-color: var(--rule); color: var(--ink-2); }

.atrack { border-top: 1px solid var(--hairline); }
.atrack:first-child { border-top: 0; }
.atrack summary { list-style: none; display: flex; gap: 12px; align-items: center; padding: 11px 14px; cursor: pointer; }
.atrack summary:hover { background: var(--page); }
.atrack summary::-webkit-details-marker { display: none; }
.atrack .pos { width: 30px; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13px; flex: none; }
.atrack .len { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.atrack .body { padding: 0 14px 14px 56px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 4px; align-items: baseline; font-size: 13px; padding: 4px 10px; border-radius: var(--radius); background: var(--page); border: 1px solid var(--hairline); }
a.chip:hover { border-color: var(--ink); }
.chip em { font-style: normal; color: var(--ink-2); }

details.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); margin-top: 12px; }
details.panel > summary { padding: 13px 14px; cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; color: var(--ink-2); }
details.panel[open] > summary::after { content: "−"; }
details.panel .pbody { padding: 0 14px 14px; }
.metrics { border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
@media (min-width: 560px) { .metrics { grid-template-columns: repeat(4, 1fr); } }
.metric { background: var(--surface); padding: 10px; }
.metric b { display: block; font: 500 20px var(--font); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.metric span { font-size: 12px; color: var(--ink-2); }
.metric.bad b { color: var(--ink-2); }
.warn { background: var(--page); border: 1px solid var(--rule); border-left: 2px solid var(--ink); padding: 10px 12px; font-size: 14px; margin-top: 10px; }
.quality-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
/* Data quality as a fill level: full, half, empty. */
.dot { width: 8px; height: 8px; border-radius: var(--radius-cover); background: var(--ink); outline: 1px solid var(--ink); outline-offset: -1px; }
.dot.mid { background: var(--ink-3); }
.dot.low { background: transparent; }
.editions { max-height: 320px; overflow: auto; }
.editions a { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid var(--hairline); font-size: 14px; }
.editions a:hover { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; }
.editions a.cur { font-weight: 500; }
.editions .ed-date { width: 92px; flex: none; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.src { margin-top: 28px; }
.skeleton { background: var(--hairline); border-radius: var(--radius); }
#album .err { background: var(--surface); border: 1px solid var(--hairline); padding: 20px; border-radius: var(--radius); margin-top: 24px; }
#album .btn { border: 0; background: var(--ink); color: var(--page); padding: 7px 14px; border-radius: var(--radius); cursor: pointer; margin-right: 10px; }
@media (max-width: 640px) {
  .album-wrap { padding: 0 16px 40px; }
  .album-hero { margin: 0 -16px; padding: 18px 16px; }
}

/* ---------------- view transitions: a short cross-fade, like a switch */
::view-transition-group(centre-name), ::view-transition-group(centre-photo) { animation-duration: var(--dur); animation-timing-function: var(--ease); }
::view-transition-old(lanes), ::view-transition-old(axis) { animation: lanes-out var(--dur) var(--ease) both; }
::view-transition-new(lanes), ::view-transition-new(axis) { animation: lanes-fade var(--dur) var(--ease) both; }
@keyframes lanes-out { to { opacity: 0; } }
@keyframes lanes-fade { from { opacity: 0; } }

@media (max-width: 640px) {
  .top { padding: 10px 14px; gap: 12px; }
  .intro { padding: 10px 14px 8px; }
  .ph-xl { --s: 54px; }
  .label { padding-left: 10px; column-gap: 7px; }
  .label .count { display: none; }
  .tools .primary { margin-left: 0; }
  .foot { padding: 6px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
