/* Display styles reused from Lazulite Studio 87b96db (AGPL-3.0).
 * Sources: semantic-editor.module.css, media.module.css,
 * shared/timeline-element.module.css and shared/tokens.css.
 * CSS Modules composition is expanded here; no Studio runtime is required.
 * Static examples retain the rendered control structure, without editing handlers.
 */
.studio-demo {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  color: #20252d;
  --blue: #2563eb;
  --blue-soft: #e9f0ff;
  --muted: #6b7280;
  --line: #d7dce3;
  --timeline-surface: #f2f5f9;
  --timeline-label-width: 36px;
  --timeline-gap: 5px;
  --timeline-lane-height: 22px;
  --timeline-bar-height: 20px;
  --timeline-bar-inset: 1px;
  --timeline-label-inset: 9px;
  --beat-space: 0px;
  line-height: normal;
}
.studio-demo .syncWords { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px 4px; min-height: 64px; }
.studio-demo .syncWord { display: grid; grid-template-rows: minmax(24px, auto) minmax(34px, auto) minmax(24px, auto); position: relative; min-width: 24px; max-width: 100%; border-radius: 5px; outline-offset: -2px; }
.studio-demo .syncBody { grid-row: 2; grid-column: 1 / -1; text-align: center; padding: 0; font-size: 24px; font-weight: 650; line-height: 1.4; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.studio-demo .syncRubyColumn { display: grid; grid-template-rows: subgrid; grid-row: 1 / 4; min-width: 0; }
.studio-demo .syncRuby { grid-row: 1; padding: 0 min(calc(4px + var(--beat-space)), max(4px, calc(100% - 28px))) 0 4px; text-align: center; font-size: 14px; font-weight: 600; min-width: 24px; border-radius: 4px; }
.studio-demo .syncText { display: inline-block; white-space: pre-wrap; min-width: 12px; max-width: 100%; vertical-align: baseline; }
.studio-demo .syncText > span { display: inline-block; transition: transform 100ms ease, color 100ms ease; }
.studio-demo .syncText[data-sync-active] > span { color: var(--blue); transform: translateY(-2px); }
.studio-demo .syncRuby[data-selected] { background: var(--blue-soft); }
.studio-demo .trackRow {
  display: grid;
  grid-template-columns: var(--timeline-label-width, 36px) minmax(0, 1fr);
  gap: var(--timeline-gap, 5px);
  align-items: center; min-height: var(--timeline-lane-height); font-size: 10px; }
.studio-demo .trackLane {
  position: relative;
  overflow: hidden;
  background: var(--timeline-surface);
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 3px;
  touch-action: none;
  height: var(--timeline-bar-height); }
.studio-demo .trackBar {
  position: absolute;
  box-sizing: border-box;
  height: var(--timeline-bar-height);
  display: flex;
  align-items: center;
  overflow: hidden;
  --timeline-element-radius: 3px;
  border-radius: var(--timeline-element-radius);
  cursor: grab;
 color: #192d4a;  touch-action:none;  inset-block: var(--timeline-bar-inset); white-space: nowrap; border: 1px solid #7297d6; background: #a9c5ef; color: #233c65;  border: 0; box-shadow: inset 0 0 0 1px #7297d6; }
.studio-demo .trackRow > strong { color: var(--muted);  color: #596273; padding-left: var(--timeline-label-inset);  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-demo .trackSelected { color: #fff;  background: #518ae2; color: #fff; border-color: #2d64bc;  box-shadow: inset 0 0 0 1px #2d64bc; }
.studio-demo .backgroundBar { background: #d7e4f5; border-color: #9ab4d7; cursor: default; }
.studio-demo .trackBarText { flex: 1; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.studio-demo .trackHandle { width: 5px; min-width: 5px; height: 100%; cursor: ew-resize; background: #487acb66; }

/* Website framing and static sample timing; control sizes above stay unchanged. */
.studio-demo .syncWords { padding: 26px 0 16px; justify-content: center; }
.studio-demo .syncWord { grid-template-columns: max-content; }
.studio-demo .syncWord:last-child { grid-template-columns: repeat(2, max-content); }
.studio-demo .syncRubyColumn { grid-column: 1; }
.studio-demo .syncRubyColumn:nth-child(2) { grid-column: 2; }
.studio-demo .syncMarker { grid-row: 3; min-height: 24px; display: grid; place-items: center; color: var(--muted); }
.studio-demo .syncMarker::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.studio-demo .syncMarker[data-current] { color: var(--blue); }
.studio-demo .trackBar, .studio-demo .trackHandle { cursor: default; }
.studio-demo .trackLane { height: var(--timeline-lane-height); }
.studio-demo .trackRow { margin-top: 4px; }
.studio-demo .sample-line { left: 0; width: 96%; }
.studio-demo .backgroundBar { left: 40%; width: 48%; }
/* Shared intervals keep the word, reading and timed romanization aligned. */
.studio-demo .sample-unit-1 { left: 0; width: 20%; }
.studio-demo .sample-unit-2 { left: 20%; width: 26%; }
.studio-demo .sample-unit-3 { left: 46%; width: 16%; }
.studio-demo .sample-unit-4 { left: 62%; width: 17%; }
.studio-demo .sample-unit-5 { left: 79%; width: 17%; }
.studio-demo .sample-word-dream { left: 62%; width: 34%; }
/* Expanded group structure and label placement from Studio's media.module.css. */
.studio-demo .expandedGroup { display: flex; flex-direction: column; gap: 4px; padding-bottom: 4px; margin-top: 8px; }
.studio-demo .expandedGroup .trackRow { margin-top: 0; }
.studio-demo .groupLabel { padding-left: calc(var(--timeline-label-width) + var(--timeline-gap)); font-size: 10px; color: var(--muted); }
.studio-demo .sample-ruler { display: flex; justify-content: space-between; margin-left: calc(var(--timeline-label-width) + var(--timeline-gap)); font-size: 10px; color: var(--muted); padding: 18px 0 8px; font-variant-numeric: tabular-nums; }
.studio-demo .sample-tracks { position: relative; padding-bottom: 16px; }
.studio-demo .sample-tracks::after { content: ""; position: absolute; left: 62%; top: 0; bottom: 16px; width: 1px; background: #2563eb; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .studio-demo .syncText > span { transition: none; } }
