/* Transport and piano-roll styling adapted from SpanSynth-Edit.
 * Copyright 2026 SpanSynth contributors. Apache-2.0 (assets/player-license.txt).
 * Changes: compact research layout, two transports, crop facts and responsive diagrams.
 */
:root {
  color-scheme: light;
  --background: #ffffff;
  --surface: #ffffff;
  --text: #202428;
  --muted: #646b72;
  --line: #e0e3e6;
  --accent: #344e65;
  --accent-soft: #f2f5f7;
  --grid: #e9edf0;
}
:root[data-theme=dark] {
  color-scheme: dark;
  --background: #191b1e;
  --surface: #202327;
  --text: #e9ebed;
  --muted: #a7afb7;
  --line: #3a3f45;
  --accent: #b0c7da;
  --accent-soft: #29343e;
  --grid: #353b42;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--background); color: var(--text); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button, select, input { font: inherit; }
button, select { color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 3px; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:focus-visible, select:focus-visible, a:focus-visible, input:focus-visible, .piano-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
select { padding: 7px 28px 7px 10px; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.3; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: 27px; }
h2 { font-size: 21px; }
h3 { font-size: 19px; }
h4 { font-size: 14px; letter-spacing: 0; }
.wrap { width: min(1160px, 100%); margin: 0 auto; padding-left: 28px; padding-right: 28px; }
.page-header { padding-top: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.page-description { margin-top: 5px; color: var(--muted); font-size: 13px; }
.header-tools { display: flex; align-items: center; gap: 20px; font-size: 12px; padding-top: 4px; }
.header-tools a { text-decoration: none; }
.appearance-label { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.appearance-label select { padding: 4px 24px 4px 8px; font-size: 12px; }
.page-nav { display: flex; gap: 24px; margin-top: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.page-nav a { text-decoration: none; color: var(--text); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin: 24px 0 14px; }
.section-heading > a { font-size: 12px; text-decoration: none; flex-shrink: 0; }
.dataset-tabs { display: flex; gap: 7px; }
.dataset-tabs button { padding: 7px 13px; font-size: 13px; background: transparent; }
.dataset-tabs button span { margin-left: 7px; color: var(--muted); font-size: 11px; }
.dataset-tabs button[aria-pressed=true] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.selection { display: flex; gap: 12px; align-items: center; padding: 14px 0; }
.selection > label { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.selection > select { flex: 1; min-width: 0; max-width: 660px; font-size: 13px; }
.step-buttons { display: flex; gap: 5px; }
.step-buttons button { width: 34px; height: 35px; font-size: 16px; }
.example { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 20px; }
.example-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--muted); font-size: 12px; line-height: 1.5; }
.example-heading .eyebrow { margin-bottom: 4px; }
.example-heading h3 { overflow-wrap: anywhere; }
.example-heading .muted { font-size: 12px; margin-top: 5px; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; max-width: 330px; flex-shrink: 0; }
.badges span { font-size: 11px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); white-space: nowrap; }
.badges .midi-type { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.listening-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; padding-top: 20px; }
.sound-block + .sound-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.sound-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sound-type { font-size: 11px; white-space: nowrap; color: var(--muted); }
.sound-description { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 7px 0 11px; }
.player { display: grid; grid-template-columns: 33px minmax(0, 1fr); gap: 6px 10px; align-items: center; --progress: 0%; }
.play { width: 33px; height: 33px; border-radius: 3px; border-color: var(--accent); color: var(--accent); font-size: 12px; padding: 0; background: var(--accent-soft); }
.seek { display: block; width: 100%; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.time { grid-column: 2; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); line-height: 1.2; margin-top: -3px; }
.player-error { grid-column: 1/-1; font-size: 12px; color: #a64439; line-height: 1.5; padding-top: 3px; }
.midi-status { font-size: 11px; line-height: 1.5; margin-top: 7px; }
.muted { color: var(--muted); }
.download-links { display: flex; flex-wrap: wrap; gap: 7px 12px; font-size: 11px; margin-top: 18px; }
.download-links a { text-decoration: none; }
.roll-panel { min-width: 0; }
.roll-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.roll-heading label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); min-width: 0; }
.roll-heading select { font-size: 12px; padding-top: 4px; padding-bottom: 4px; max-width: 210px; }
.roll-status { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 12px; border: 1px solid var(--line); background: var(--background); }
.roll-status[hidden] { display: none; }
.roll-status button { padding: 5px 10px; font-size: 12px; }
.piano-scroll { overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); background: var(--background); border-radius: 2px; }
.piano-scroll:empty { display: none; }
.piano-scroll svg { display: block; width: 100%; min-width: 620px; }
.pitch-line { stroke: var(--grid); stroke-width: 1; }
.pitch-label, .tick-label { fill: var(--muted); font: 10px system-ui, sans-serif; }
.playhead { stroke: var(--text); stroke-width: 1.8; pointer-events: none; }
.roll-legend { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 10px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.roll-legend span { display: inline-flex; align-items: center; gap: 4px; }
.roll-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 1px; background: var(--instrument-color); }
.roll-legend small { font-size: 10px; }
.roll-caption { font-size: 11px; color: var(--muted); line-height: 1.6; margin-top: 9px; }
.crop-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0 0; padding-top: 15px; border-top: 1px solid var(--line); }
dt { font-size: 11px; color: var(--muted); }
dd { margin: 2px 0 0; font-size: 13px; font-weight: 500; }
.source-details { margin-top: 14px; font-size: 12px; color: var(--muted); }
summary { cursor: pointer; width: fit-content; }
.source-details dl { margin: 12px 0 0; display: grid; gap: 8px; }
.source-details dl > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.source-details dd { font-size: 12px; font-weight: 400; margin: 0; overflow-wrap: anywhere; }
.selection-caption { font-size: 12px; line-height: 1.7; color: var(--muted); margin-top: 12px; }
.lower-section { margin-top: 36px; border-top: 1px solid var(--line); }
.lower-section .section-heading { margin-top: 24px; }
.diagram-scroll { overflow-x: auto; border-radius: 3px; }
.pipeline-image { width: 100%; min-width: 860px; display: block; }
.pipeline-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; font-size: 13px; line-height: 1.7; margin-top: 18px; }
.pipeline-notes strong { color: var(--text); font-weight: 600; }
.pipeline-notes p { color: var(--muted); }
.table-scroll { overflow-x: auto; margin-top: 24px; }
.dataset-counts { width: 100%; min-width: 630px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; text-align: left; }
.dataset-counts caption { text-align: left; color: var(--muted); font-size: 12px; padding-bottom: 10px; }
.dataset-counts th, .dataset-counts td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.dataset-counts th:first-child, .dataset-counts td:first-child { padding-left: 0; }
.dataset-counts thead th { font-weight: 500; color: var(--muted); font-size: 12px; }
.dataset-counts tbody th { font-weight: 500; }
.footnote { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.7; }
.distribution-link { display: block; overflow: hidden; background: #fff; }
.distribution-link img { display: block; width: 100%; height: auto; }
footer { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 28px; font-size: 12px; color: var(--muted); }
footer details { margin-top: 8px; }
footer details p { margin-top: 9px; max-width: 1000px; }
footer a { text-decoration: none; }
@media (max-width: 1000px) {
  .listening-grid { grid-template-columns: 265px minmax(0, 1fr); gap: 20px; }
  .badges { max-width: 260px; }
  .roll-heading { align-items: flex-start; flex-wrap: wrap; }
  .roll-heading label { width: 100%; justify-content: flex-end; }
}
@media (max-width: 760px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .listening-grid { grid-template-columns: 1fr; }
  .sound-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .sound-block + .sound-block { margin-top: 0; padding-top: 0; border-top: 0; }
  .download-links { grid-column: 1/-1; margin-top: 0; }
  .roll-heading label { width: auto; }
  .example-heading { display: block; }
  .badges { margin-top: 10px; justify-content: flex-start; max-width: none; }
  .header-tools { gap: 12px; }
}
@media (max-width: 520px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .page-header { padding-top: 20px; }
  .topbar { gap: 14px; }
  h1 { font-size: 22px; }
  .page-description { font-size: 12px; }
  .header-tools { align-items: flex-end; flex-direction: column; gap: 8px; font-size: 11px; padding-top: 1px; }
  .appearance-label { gap: 5px; font-size: 11px; }
  .appearance-label select { font-size: 11px; padding: 3px 18px 3px 5px; }
  .page-nav { font-size: 12px; gap: 22px; margin-top: 16px; padding: 12px 0; }
  .section-heading { gap: 12px; margin-top: 22px; }
  h2 { font-size: 19px; }
  .section-heading > a { font-size: 11px; }
  .dataset-tabs button { font-size: 12px; padding: 7px 11px; }
  .selection { gap: 6px; padding: 12px 0; }
  .selection > label { display: none; }
  .selection > select { font-size: 12px; padding: 8px 22px 8px 8px; }
  .step-buttons { gap: 4px; }
  .step-buttons button { width: 30px; height: 35px; }
  .example { padding: 15px; }
  h3 { font-size: 18px; }
  .listening-grid { padding-top: 17px; gap: 22px; }
  .sound-panel { display: block; }
  .sound-block + .sound-block { padding-top: 17px; margin-top: 18px; border-top: 1px solid var(--line); }
  .download-links { margin-top: 18px; }
  .roll-heading label, .roll-heading select { font-size: 11px; }
  .roll-heading select { max-width: 170px; }
  .crop-facts { grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
  .source-details dl > div { grid-template-columns: 90px 1fr; gap: 8px; }
  .pipeline-notes { grid-template-columns: 1fr; gap: 12px; font-size: 12px; }
  .dataset-counts { min-width: 600px; font-size: 12px; }
  .dataset-counts th, .dataset-counts td { padding: 9px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
