/* Brockton's Celestial Forge — DAW-style scrubber */

* { box-sizing: border-box; }

:root {
  color-scheme: light;

  --ink: #1a1a1a;
  --gray-1: #444;
  --gray-2: #666;
  --gray-3: #999;
  --gray-4: #ccc;
  --gray-5: #eee;
  --gray-6: #f7f7f7;
  --shadow-band: rgba(160, 80, 100, 0.55);
  --accent: #2a4f7d;
  --accent-warm: #b86b2c;
  --accent-hover: #1a3a5a;
  --hit: #2a7d4f;
  --miss: #b04444;
  --unknown: #888;
  --untracked: #6b4a8a;
  --paid: #2a4f7d;
  --free: #b86b2c;
  --preroll-bg: #f0f0f5;

  /* Surfaces */
  --bg-page: #fff;
  --bg-surface: #fff;
  --bg-track-stack: var(--preroll-bg);
  --bg-axis-row: #fff;

  /* Translucent label/chip backgrounds layered over tracks */
  --label-bg: rgba(255, 255, 255, 0.86);
  --label-bg-soft: rgba(255, 255, 255, 0.82);
  --chap-label-bg: rgba(240, 240, 245, 0.78);

  /* Decorative rims and shadows */
  --dot-rim: rgba(255, 255, 255, 0.7);
  --dot-rim-soft: rgba(255, 255, 255, 0.6);
  --dot-shadow: rgba(0, 0, 0, 0.35);
  --pov-divider: rgba(255, 255, 255, 0.55);
  --marker-line: rgba(26, 26, 26, 0.32);
  --shadow-bar-bg: rgba(160, 80, 100, 0.24);
  --shadow-bar-border: rgba(120, 50, 70, 0.55);
  --tooltip-shadow: rgba(0, 0, 0, 0.15);
  --preroll-stripe: rgba(0, 0, 0, 0.04);
  --date-chapter-tick: rgba(42, 79, 125, 0.32);
  --date-line: rgba(42, 79, 125, 0.55);

  /* Text on the play button (which uses --accent as its background) */
  --on-accent: #fff;
}

/* Dark theme: applied either by explicit data-theme="dark" or by system
   preference when the user hasn't picked a theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --ink: #ececec;
    --gray-1: #cfcfcf;
    --gray-2: #a0a0a0;
    --gray-3: #777;
    --gray-4: #444;
    --gray-5: #2a2a2e;
    --gray-6: #1d1d20;
    --shadow-band: rgba(220, 130, 150, 0.55);
    --accent: #6ea3d6;
    --accent-warm: #e0894a;
    --accent-hover: #93b8de;
    --hit: #4cb077;
    --miss: #e36868;
    --unknown: #888;
    --untracked: #b095d6;
    --paid: #6ea3d6;
    --free: #e0894a;
    --preroll-bg: #161619;

    --bg-page: #121214;
    --bg-surface: #1c1c1f;
    --bg-track-stack: var(--preroll-bg);
    --bg-axis-row: #1c1c1f;

    --label-bg: rgba(28, 28, 31, 0.86);
    --label-bg-soft: rgba(28, 28, 31, 0.82);
    --chap-label-bg: rgba(40, 40, 48, 0.78);

    --dot-rim: rgba(255, 255, 255, 0.45);
    --dot-rim-soft: rgba(255, 255, 255, 0.35);
    --dot-shadow: rgba(0, 0, 0, 0.6);
    --pov-divider: rgba(255, 255, 255, 0.35);
    --marker-line: rgba(255, 255, 255, 0.32);
    --shadow-bar-bg: rgba(220, 130, 150, 0.20);
    --shadow-bar-border: rgba(220, 130, 150, 0.55);
    --tooltip-shadow: rgba(0, 0, 0, 0.55);
    --preroll-stripe: rgba(255, 255, 255, 0.06);
    --date-chapter-tick: rgba(110, 163, 214, 0.4);
    --date-line: rgba(110, 163, 214, 0.6);

    --on-accent: #0d1622;
  }
}

/* Explicit dark theme override (independent of system preference). */
:root[data-theme="dark"] {
  color-scheme: dark;

  --ink: #ececec;
  --gray-1: #cfcfcf;
  --gray-2: #a0a0a0;
  --gray-3: #777;
  --gray-4: #444;
  --gray-5: #2a2a2e;
  --gray-6: #1d1d20;
  --shadow-band: rgba(220, 130, 150, 0.55);
  --accent: #6ea3d6;
  --accent-warm: #e0894a;
  --accent-hover: #93b8de;
  --hit: #4cb077;
  --miss: #e36868;
  --unknown: #888;
  --untracked: #b095d6;
  --paid: #6ea3d6;
  --free: #e0894a;
  --preroll-bg: #161619;

  --bg-page: #121214;
  --bg-surface: #1c1c1f;
  --bg-track-stack: var(--preroll-bg);
  --bg-axis-row: #1c1c1f;

  --label-bg: rgba(28, 28, 31, 0.86);
  --label-bg-soft: rgba(28, 28, 31, 0.82);
  --chap-label-bg: rgba(40, 40, 48, 0.78);

  --dot-rim: rgba(255, 255, 255, 0.45);
  --dot-rim-soft: rgba(255, 255, 255, 0.35);
  --dot-shadow: rgba(0, 0, 0, 0.6);
  --pov-divider: rgba(255, 255, 255, 0.35);
  --marker-line: rgba(255, 255, 255, 0.32);
  --shadow-bar-bg: rgba(220, 130, 150, 0.20);
  --shadow-bar-border: rgba(220, 130, 150, 0.55);
  --tooltip-shadow: rgba(0, 0, 0, 0.55);
  --preroll-stripe: rgba(255, 255, 255, 0.06);
  --date-chapter-tick: rgba(110, 163, 214, 0.4);
  --date-line: rgba(110, 163, 214, 0.6);

  --on-accent: #0d1622;
}

html, body {
  margin: 0; padding: 0;
  background: var(--bg-page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 8px;
}
header h1 {
  margin: 0 0 4px;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0;
}
header h1 a {
  color: var(--ink);
  text-decoration: none;
}
header h1 a:hover { text-decoration: underline; }
header .byline {
  margin: 0 0 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--gray-2);
  font-size: 0.88rem;
}
.story-label {
  color: var(--gray-1);
  font-weight: 600;
}
header .viz-credit {
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  color: var(--gray-3);
  font-size: 0.72rem;
}
header .credit-separator {
  color: var(--gray-4);
}
header .gh-link {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--gray-3);
}
header .gh-link:hover { color: var(--gray-1); }
header .gh-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Theme toggle (cycles auto → light → dark) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--gray-3);
  cursor: pointer;
  font: inherit;
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--gray-4);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-toggle svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: none;
}
.theme-toggle[data-theme-pref="auto"]  .theme-icon-auto,
.theme-toggle[data-theme-pref="light"] .theme-icon-light,
.theme-toggle[data-theme-pref="dark"]  .theme-icon-dark {
  display: block;
}
.site-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border: 1px solid var(--gray-4);
  border-radius: 999px;
  color: var(--gray-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1;
  text-decoration: none;
  background: var(--bg-surface);
}
.site-badge:hover {
  color: var(--ink);
  border-color: var(--gray-3);
}

/* --- planetarium sky -------------------------------------------------- */

#sky-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px 10px;
}

.sky-shell {
  border: 1px solid #2d3441;
  border-radius: 8px;
  overflow: hidden;
  background: #080a10;
  color: #dfe6f1;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.sky-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid #283140;
  background: #111621;
}

.sky-toolbar h2 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.2;
  font-weight: 700;
  color: #f2f6ff;
  letter-spacing: 0;
}

#sky-subtitle {
  margin: 2px 0 0;
  color: #9ba8bb;
  font-size: 0.78rem;
}

.sky-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sky-control-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #465163;
  border-radius: 6px;
  background: #1d2532;
  color: #c9d4e4;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.sky-control-btn:hover {
  border-color: #6ea3d6;
  color: #f7fbff;
}

.sky-control-btn[aria-pressed="true"] {
  border-color: #8ab9e6;
  background: #20344a;
  color: #ffffff;
}

#sky-canvas-wrap {
  position: relative;
  height: clamp(420px, 56vh, 700px);
  min-height: 420px;
  background: #03050a;
}

#sky-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#sky-hud {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: min(420px, calc(100% - 32px));
  padding: 10px 12px;
  border: 1px solid rgba(150, 170, 200, 0.28);
  border-radius: 6px;
  background: rgba(8, 12, 19, 0.74);
  color: #dfe6f1;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

#sky-hud-kicker {
  margin-bottom: 2px;
  color: #9fc8ff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

#sky-hud-title {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

#sky-hud-meta {
  margin-top: 3px;
  color: #aeb9c8;
  font-size: 0.76rem;
  line-height: 1.35;
}

#sky-inspector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1px;
  border-top: 1px solid #283140;
  background: #283140;
  font-size: 0.82rem;
}

#sky-inspector > div {
  min-width: 0;
  padding: 9px 12px;
  background: #111621;
  color: #dfe6f1;
}

.sky-inspector-label {
  display: inline-block;
  margin-right: 8px;
  color: #8895a8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.sky-focus-mode {
  background: #090b10;
}

body.sky-focus-mode #panels,
body.sky-focus-mode #recent-rail,
body.sky-focus-mode .control-panels,
body.sky-focus-mode #chapter-detail-panel,
body.sky-focus-mode #track-label-overlay {
  display: none;
}

body.sky-focus-mode header {
  max-width: none;
  padding-top: 10px;
  padding-bottom: 4px;
}

body.sky-focus-mode #sky-section,
body.sky-focus-mode #scrubber-section {
  max-width: none;
  padding-left: 16px;
  padding-right: 16px;
}

body.sky-focus-mode #sky-canvas-wrap {
  height: clamp(480px, calc(100vh - 380px), 820px);
  min-height: 480px;
}

body.sky-focus-mode #scrubber-section {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  border-bottom: 0;
  background: #090b10;
}

body.sky-focus-mode #scrubber-container,
body.sky-focus-mode #scrubber-main-column {
  grid-column: 1;
}

body.sky-focus-mode #scrubber-container {
  margin-bottom: 2px;
}

body.sky-focus-mode #track-stack {
  height: 84px;
  border-color: #303846;
}

body.sky-focus-mode .track-dates,
body.sky-focus-mode .track-pov,
body.sky-focus-mode .track-markers,
body.sky-focus-mode .track-axis,
body.sky-focus-mode .roll-lane-label {
  display: none;
}

body.sky-focus-mode .track-chapters {
  top: 0;
  height: 24px;
}

body.sky-focus-mode .track-rolls {
  top: 24px;
  height: 60px;
}

body.sky-focus-mode .chap-label {
  display: none;
}

body.sky-focus-mode .chap-tick {
  height: 100%;
  opacity: 0.55;
}

body.sky-focus-mode .shadow-bar {
  top: 0;
  bottom: 0;
}

body.sky-focus-mode #scrubber-playhead,
body.sky-focus-mode #scrubber-hitarea {
  bottom: 0;
}

body.sky-focus-mode #scrubber-chapter-readout {
  margin-bottom: 0;
  color: #c9d4e4;
}

body.sky-focus-mode #scrubber-readout,
body.sky-focus-mode #cumulative-strip,
body.sky-focus-mode #playback-controls,
body.sky-focus-mode #zoom-controls {
  color: #aeb9c8;
}

@media (prefers-reduced-motion: reduce) {
  .sky-shell {
    scroll-behavior: auto;
  }
}

/* --- DAW scrubber ---------------------------------------------------- */

#scrubber-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px 12px;
  position: relative;
  z-index: 1;
  background: var(--bg-page);
  border-bottom: 1px solid var(--gray-5);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 10px 18px;
}

#scrubber-container {
  position: relative;
  margin: 0 0 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-color: var(--gray-3) var(--gray-5);
  scrollbar-width: thin;
  padding-bottom: 4px;
  grid-column: 1 / -1;
}

#track-label-overlay {
  position: absolute;
  top: 12px;
  left: 24px;
  right: 24px;
  height: 286px;
  z-index: 12;
  pointer-events: none;
}

#track-stack {
  position: relative;
  min-width: 100%;
  height: 286px;             /* sum of track heights */
  border: 1px solid var(--gray-4);
  border-radius: 4px;
  background: var(--bg-track-stack);
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
}

.track {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;       /* hit-area below catches clicks */
}
.track-dates,
.track-pov,
.track-rolls {
  z-index: 2;
}
.track-markers {
  z-index: 4;
}
.track-axis {
  z-index: 1;
}
.track-chapters { z-index: 3; }

/* Track positioning, top-down */
.track-dates    { top: 0;    height: 48px; }
.track-chapters { top: 48px; height: 44px; }
.track-pov      { top: 92px; height: 34px; }
.track-markers  { top: 126px; height: 128px; }
.track-rolls    { top: 126px; height: 128px; }
.track-axis     { top: 254px; height: 32px; border-top: 1px solid var(--gray-4); background: var(--bg-axis-row); }

.track-label {
  position: absolute;
  left: 0;
  display: inline-flex;
  align-items: center;
  height: 16px;
  min-width: 62px;
  padding: 0 6px;
  background: var(--label-bg);
  border-right: 1px solid var(--gray-5);
  border-bottom: 1px solid var(--gray-5);
  color: var(--gray-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
}
.label-dates { top: 0; }
.label-chapters { top: 48px; }
.label-pov { top: 92px; }
.label-rolls { top: 126px; }
.label-axis { top: 254px; }

/* Real-world date track */
.date-tick {
  position: absolute;
  width: 1px;
  background: var(--gray-4);
  pointer-events: auto;
  cursor: default;
}
.date-tick.year {
  top: 0;
  bottom: 0;
  background: var(--gray-2);
}
.date-tick.month {
  bottom: 0;
  height: 24px;
  background: var(--gray-3);
  display: none;
}
.date-tick.week {
  bottom: 0;
  height: 12px;
  background: var(--gray-4);
  display: none;
}
.date-tick.chapter {
  top: 0;
  bottom: 0;
  background: var(--date-chapter-tick);
  display: none;
}
.date-label {
  position: absolute;
  font-size: 9px;
  color: var(--gray-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1;
}
.date-label.year-label {
  top: 0;
  transform: translateX(3px);
  font-weight: 600;
  color: var(--gray-1);
}
.date-label.month-label {
  top: 12px;
  transform: translateX(3px);
  display: none;
}
.date-label.chapter-label {
  top: 22px;
  transform: translateX(-50%);
  color: var(--gray-3);
  background: var(--label-bg-soft);
  padding: 0 1px;
  border-radius: 1px;
  display: none;
}
#track-stack[data-zoom-detail="medium"] .date-tick.month,
#track-stack[data-zoom-detail="high"] .date-tick.month,
#track-stack[data-zoom-detail="exact"] .date-tick.month,
#track-stack[data-zoom-detail="medium"] .date-label.month-label,
#track-stack[data-zoom-detail="high"] .date-label.month-label,
#track-stack[data-zoom-detail="exact"] .date-label.month-label,
#track-stack[data-zoom-detail="high"] .date-tick.week,
#track-stack[data-zoom-detail="exact"] .date-tick.week,
#track-stack[data-zoom-detail="exact"] .date-tick.chapter,
#track-stack[data-zoom-detail="exact"] .date-label.chapter-label {
  display: block;
}

/* Chapter ticks track */
.chap-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  background: var(--gray-3);
  border: 0;
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
}
.chap-tick.major { background: var(--gray-1); height: 72%; }
.chap-tick.minor { background: var(--gray-3); height: 45%; }
.chap-tick:hover { width: 2px; background: var(--accent); }
@media (pointer: coarse) {
  .chap-tick::before {
    content: "";
    position: absolute;
    top: -4px;
    bottom: -4px;
    left: -8px;
    right: -8px;
  }
}
.chap-label {
  position: absolute;
  font-size: 10px;
  color: var(--gray-1);
  transform: translateX(-50%);
  white-space: nowrap;
  line-height: 1;
  padding: 0 2px;
  background: var(--chap-label-bg);
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}
.chap-label.major { color: var(--ink); font-weight: 700; }
.chap-label.sub { color: var(--gray-2); font-size: 9px; }
#track-stack[data-zoom-detail="low"] .chap-label:not(.major),
#track-stack[data-zoom-detail="medium"] .chap-label.sub {
  display: none;
}

/* POV section track */
.pov-segment {
  position: absolute;
  top: 8px;
  bottom: 8px;
  opacity: 0.78;
  border-right: 1px solid var(--pov-divider);
  pointer-events: auto;
  cursor: default;
}
.pov-segment.non-cp { opacity: 0.28; }
.pov-segment:hover { opacity: 1; }

/* Mechanic-change markers */
.regime-change-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--marker-line);
  pointer-events: auto;
  cursor: help;
}
.regime-change-marker span {
  position: absolute;
  top: 5px;
  left: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-1);
  white-space: nowrap;
  letter-spacing: 0;
  pointer-events: none;
}

@media (pointer: coarse) {
  .date-tick,
  .pov-segment,
  .regime-change-marker {
    pointer-events: none;
  }
}

/* Shadow track — bars */
.shadow-bar {
  position: absolute;
  top: 6px;
  bottom: 6px;
  z-index: 0;
  background: var(--shadow-bar-bg);
  border-left: 1px solid var(--shadow-bar-border);
  border-right: 1px solid var(--shadow-bar-border);
  pointer-events: none;
  cursor: default;
}

/* Rolls track — dots */
.roll-dot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  appearance: none;
  aspect-ratio: 1 / 1;
  line-height: 0;
  border-radius: 50%;
  overflow: visible;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  border: 0;
  background: transparent;
  transition: transform 0.08s, box-shadow 0.08s;
  z-index: 2;
}
.roll-dot:hover {
  transform: scale(1.6);
  box-shadow: 0 0 6px var(--dot-shadow);
  z-index: 5;
}
@media (pointer: coarse) {
  .roll-dot::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
  }
}
.roll-dot.hit                  { top: 26px; }
.roll-dot.miss                 { top: 86px; }
.roll-dot.unknown              { top: 86px; }
.roll-dot.untracked            { top: 26px; }

.roll-skip-marker {
  position: absolute;
  top: 58px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  padding: 0;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--gray-3);
  font: 700 11px/12px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
  cursor: help;
  z-index: 3;
}
.roll-skip-marker:hover,
.roll-skip-marker:focus-visible {
  color: var(--gray-1);
}

.legend-skip-marker {
  display: inline-block;
  width: 24px;
  color: var(--gray-3);
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}

.roll-star-system {
  --star-core: #ffffff;
  --star-mid: #8fcff2;
  --star-edge: rgba(143, 207, 242, 0);
  --spike-main: rgba(255, 255, 255, 0.96);
  --spike-tint: rgba(143, 207, 242, 0.68);
  --spike-fade: rgba(143, 207, 242, 0);
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.star-source,
.star-companion,
.star-untracked-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
}
.star-source {
  width: calc(var(--roll-size, 30px) * 0.54);
  height: calc(var(--roll-size, 30px) * 0.54);
  min-width: 11px;
  min-height: 11px;
  max-width: 22px;
  max-height: 22px;
  transform:
    translate(calc(-50% + var(--source-x, 0px)), calc(-50% + var(--source-y, 0px)))
    scale(var(--source-scale, 1));
  border-radius: 50%;
}
.star-source-svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--roll-size, 30px) * 3.25);
  height: calc(var(--roll-size, 30px) * 3.25);
  min-width: 58px;
  min-height: 58px;
  max-width: 132px;
  max-height: 132px;
  overflow: visible;
  transform: translate(-50%, -50%);
  filter:
    drop-shadow(0 0 0.9px var(--star-core))
    drop-shadow(0 0 2.4px var(--star-mid));
  opacity: 0.82;
}
.star-svg-spikes {
  mix-blend-mode: screen;
}
.star-svg-spikes-primary {
  opacity: 0.68;
}
.star-svg-spikes-secondary {
  opacity: 0.32;
}
.star-svg-tint {
  fill: var(--star-mid);
  opacity: 0.12;
}
.star-svg-core {
  fill: var(--star-core);
  filter: drop-shadow(0 0 1.4px var(--star-core));
}
.star-companion {
  width: 3.5px;
  height: 3.5px;
  transform:
    translate(calc(-50% + var(--companion-x, 0px)), calc(-50% + var(--companion-y, 0px)))
    scale(var(--companion-scale, 1));
  border-radius: 50%;
  background:
    radial-gradient(circle,
      var(--star-core) 0 32%,
      var(--star-mid) 34% 100%);
  outline: 0.75px solid rgba(10, 12, 16, 0.72);
  border: 1px solid color-mix(in srgb, var(--star-mid) 78%, var(--star-core));
  box-shadow:
    0 0 1px var(--star-core),
    0 0 2.8px var(--star-mid),
    0 0 0 0.75px color-mix(in srgb, var(--star-mid) 38%, transparent);
  opacity: 0.86;
  z-index: 8;
}
.star-untracked-ring {
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--star-core) 82%, transparent);
  z-index: 4;
}
.is-miss-like .star-source {
  width: calc(var(--roll-size, 24px) * 0.44);
  height: calc(var(--roll-size, 24px) * 0.44);
  opacity: 0.82;
}
.is-miss-like .star-source-svg {
  width: calc(var(--roll-size, 24px) * 2.35);
  height: calc(var(--roll-size, 24px) * 2.35);
  min-width: 50px;
  min-height: 50px;
  max-width: 78px;
  max-height: 78px;
  opacity: 0.78;
}
.roll-star-system.toolkits,
.star-source.toolkits,
.star-companion.toolkits {
  --star-mid: #71cef9;
  --star-edge: rgba(47, 111, 159, 0);
  --spike-tint: rgba(113, 206, 249, 0.72);
  --spike-fade: rgba(113, 206, 249, 0);
}
.roll-star-system.knowledge,
.star-source.knowledge,
.star-companion.knowledge {
  --star-mid: #b6acff;
  --star-edge: rgba(106, 90, 205, 0);
  --spike-tint: rgba(182, 172, 255, 0.72);
  --spike-fade: rgba(182, 172, 255, 0);
}
.roll-star-system.vehicles,
.star-source.vehicles,
.star-companion.vehicles,
.roll-star-system.size,
.star-source.size,
.star-companion.size {
  --star-mid: #ffa46b;
  --star-edge: rgba(214, 107, 45, 0);
  --spike-tint: rgba(255, 164, 107, 0.72);
  --spike-fade: rgba(255, 164, 107, 0);
}
.roll-star-system.time,
.star-source.time,
.star-companion.time,
.roll-star-system.magic,
.star-source.magic,
.star-companion.magic {
  --star-mid: #c4a6ff;
  --star-edge: rgba(138, 99, 210, 0);
  --spike-tint: rgba(196, 166, 255, 0.72);
  --spike-fade: rgba(196, 166, 255, 0);
}
.roll-star-system.crafting,
.star-source.crafting,
.star-companion.crafting,
.roll-star-system.quality,
.star-source.quality,
.star-companion.quality {
  --star-mid: #8ee596;
  --star-edge: rgba(61, 124, 68, 0);
  --spike-tint: rgba(142, 229, 150, 0.72);
  --spike-fade: rgba(142, 229, 150, 0);
}
.roll-star-system.clothing,
.star-source.clothing,
.star-companion.clothing {
  --star-mid: #ff9fd0;
  --star-edge: rgba(196, 79, 143, 0);
  --spike-tint: rgba(255, 159, 208, 0.72);
  --spike-fade: rgba(255, 159, 208, 0);
}
.roll-star-system.resources-and-durability,
.star-source.resources-and-durability,
.star-companion.resources-and-durability,
.roll-star-system.alchemy,
.star-source.alchemy,
.star-companion.alchemy {
  --star-mid: #f0cd57;
  --star-edge: rgba(180, 138, 0, 0);
  --spike-tint: rgba(240, 205, 87, 0.72);
  --spike-fade: rgba(240, 205, 87, 0);
}
.roll-star-system.magitech,
.star-source.magitech,
.star-companion.magitech {
  --star-mid: #80e0f2;
  --star-edge: rgba(44, 138, 160, 0);
  --spike-tint: rgba(128, 224, 242, 0.72);
  --spike-fade: rgba(128, 224, 242, 0);
}
.roll-star-system.capstone,
.star-source.capstone,
.star-companion.capstone {
  --star-mid: #ff9494;
  --star-edge: rgba(182, 59, 59, 0);
  --spike-tint: rgba(255, 148, 148, 0.72);
  --spike-fade: rgba(255, 148, 148, 0);
}
.roll-star-system.personal-reality,
.star-source.personal-reality,
.star-companion.personal-reality {
  --star-mid: #c0e980;
  --star-edge: rgba(79, 111, 59, 0);
  --spike-tint: rgba(192, 233, 128, 0.72);
  --spike-fade: rgba(192, 233, 128, 0);
}
.roll-star-system.miss,
.star-source.miss,
.star-companion.miss,
.roll-star-system.unknown,
.star-source.unknown,
.star-companion.unknown {
  --star-mid: #c4cad3;
  --star-edge: rgba(123, 130, 141, 0);
  --spike-tint: rgba(196, 202, 211, 0.48);
  --spike-fade: rgba(196, 202, 211, 0);
  --spike-main: rgba(255, 255, 255, 0.68);
}

/* Roll lane labels (left side) */
.roll-lane-label {
  position: absolute;
  left: 88px;
  font-size: 9px;
  color: var(--gray-2);
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 3;
}
.roll-lane-label.hit-label  { top: 6px; }
.roll-lane-label.miss-label { top: 98px; }

/* Word-position axis track */
.axis-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  background: var(--gray-4);
}
.axis-tick.minor {
  height: 8px;
  background: var(--gray-5);
}
.axis-tick.mid {
  height: 16px;
  background: var(--gray-4);
}
.axis-tick.major {
  top: 0;
  bottom: 0;
  background: var(--gray-4);
}
.axis-label {
  position: absolute;
  top: 16px;
  font-size: 8px;
  color: var(--gray-2);
  transform: translateX(-50%);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  padding: 0 1px;
  background: var(--label-bg-soft);
}
#track-stack[data-zoom-detail="low"] .axis-tick.mid,
#track-stack[data-zoom-detail="low"] .axis-tick.minor,
#track-stack[data-zoom-detail="medium"] .axis-tick.minor {
  display: none;
}
#track-stack[data-zoom-detail="low"] .axis-label:not(.milestone-50),
#track-stack[data-zoom-detail="medium"] .axis-label:not(.milestone-25),
#track-stack[data-zoom-detail="high"] .axis-label:not(.milestone-10) {
  display: none;
}

/* Pre-roll band overlay */
.preroll-band {
  position: absolute;
  top: 0;
  bottom: 32px;                /* leave the axis row clear */
  background: repeating-linear-gradient(
    -45deg, var(--preroll-stripe) 0 4px, transparent 4px 12px
  );
  pointer-events: none;
}

/* Playhead — vertical line + draggable knob */
#scrubber-playhead {
  position: absolute;
  top: 0;
  bottom: 32px;                /* sit above the axis row */
  width: 2px;
  margin-left: -1px;
  background: var(--accent);
  z-index: 6;
  cursor: ew-resize;
  pointer-events: auto;
}
#scrubber-playhead::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  height: 8px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
#scrubber-playhead:focus { outline: none; }
#scrubber-playhead:focus::before { background: var(--accent-warm); }

#scrubber-hitarea {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: 32px;                /* don't capture clicks on the axis row */
  z-index: 1;
  cursor: pointer;
  touch-action: none;
}

/* Side rail and legend */
#scrubber-main-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#scrubber-chapter-readout {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.95rem;
  color: var(--gray-1);
  margin: 0 0 6px;
  padding: 0 12px;
  line-height: 1.35;
}
#scrubber-chapter-readout #readout-chapter {
  font-weight: 600;
  color: var(--ink);
}
#scrubber-chapter-readout .dot {
  color: var(--gray-3);
  margin: 0 6px;
}

#recent-rail {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-self: end;
  min-height: 0;
}
#recent-rail .panel {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
}
#legend-panel {
  width: 100%;
  border: 1px solid var(--gray-5);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--gray-2);
  background: var(--bg-surface);
  max-height: none;
  overflow: visible;
}
#legend-panel summary {
  cursor: pointer;
  color: var(--gray-1);
  font-weight: 600;
  width: max-content;
}
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px 24px;
  margin-top: 8px;
}
.legend-grid h2 {
  margin: 0 0 6px;
  font-size: 0.72rem;
  color: var(--gray-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 5px 16px;
  align-items: center;
}
.swatch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.legend-star {
  --roll-size: 22px;
  --marker-color: var(--star-mid);
  display: inline-block;
  position: relative;
  width: 34px;
  height: 24px;
  flex: 0 0 34px;
  pointer-events: none;
}
.swatch-row .legend-star {
  width: 28px;
  height: 18px;
  flex-basis: 28px;
  --roll-size: 18px;
}
.marker-example-list {
  display: grid;
  gap: 6px;
}
.marker-example-row {
  min-height: 28px;
}
.marker-cost-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 7px 14px;
  align-items: center;
}
.cost-example {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
}
.cost-example .legend-star {
  --roll-size: 20px;
}
.legend-star .star-source-svg {
  width: calc(var(--roll-size, 20px) * 2.45);
  height: calc(var(--roll-size, 20px) * 2.45);
  min-width: 34px;
  min-height: 34px;
  max-width: 58px;
  max-height: 58px;
}
.legend-star .star-companion {
  width: 3px;
  height: 3px;
}
.legend-star .star-untracked-ring {
  width: 24px;
  height: 24px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.legend-dot,
.size-dot {
  display: inline-block;
  width: var(--dot-size, 9px);
  height: var(--dot-size, 9px);
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid var(--dot-rim);
  box-shadow: 0 0 0 1px var(--gray-4);
}
.legend-dot.dashed { border: 2px dashed var(--accent); background: transparent; box-shadow: none; }
.legend-dot.gray { background: var(--unknown); }
.legend-band {
  display: inline-block;
  width: 22px;
  height: 8px;
  border-radius: 2px;
}
.legend-band.shadow { background: var(--shadow-band); }
.legend-band.pov { background: var(--accent); opacity: 0.55; }
.legend-line {
  display: inline-block;
  width: 18px;
  height: 14px;
  border-left: 2px solid var(--gray-4);
}
.legend-line.date { border-color: var(--date-line); }
.legend-line.chapter { border-color: var(--gray-1); }
.legend-marker {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--marker-line);
  margin-left: 5px;
  margin-right: 15px;
}
.size-legend {
  display: grid;
  grid-template-columns: repeat(4, auto auto);
  gap: 6px 5px;
  align-items: center;
}

#data-package-selector {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  font-size: inherit;
}

#data-package-selector select {
  max-width: min(420px, 88vw);
  color: var(--ink);
  background: var(--bg-surface);
  border: 1px solid var(--gray-5);
  border-radius: 4px;
  padding: 2px 22px 2px 6px;
  font: inherit;
}

#data-package-selector .data-package-static {
  max-width: min(520px, 88vw);
  color: var(--gray-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Readout under the scrubber */
#scrubber-readout {
  font-size: 0.92rem;
  color: var(--gray-1);
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
  margin-bottom: 6px;
}
#cumulative-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 8px;
  color: var(--gray-2);
  font-size: 0.84rem;
}
#cumulative-strip strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
#readout-state {
  font-variant-caps: small-caps;
  letter-spacing: 0.06em;
  color: var(--gray-2);
  font-size: 0.8rem;
}
#readout-state.preroll { color: var(--gray-3); }
#readout-state.playing { color: var(--accent-warm); }
#readout-chapter { font-weight: 600; color: var(--ink); }
#scrubber-readout .dot { color: var(--gray-3); margin: 0 6px; }
#readout-words { font-variant-numeric: tabular-nums; }
#readout-sv-link { color: var(--accent); }
#readout-sv-link[hidden] { display: none; }

/* Playback controls */
#playback-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--gray-2);
}
#play-pause {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 3px;
  width: 30px;
  height: 28px;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#play-pause:hover { background: var(--accent-hover); }
#play-pause.playing { background: var(--accent-warm); }
#playback-controls .speed-label { display: inline-flex; gap: 6px; align-items: center; }
#playback-controls select {
  font: inherit;
  padding: 2px 4px;
  border: 1px solid var(--gray-4);
  border-radius: 3px;
  background: var(--bg-surface);
  color: var(--ink);
}
.link-btn {
  background: none;
  border: none;
  color: var(--gray-2);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.link-btn:hover { color: var(--ink); }
.control-hint {
  color: var(--gray-3);
  font-size: 0.78rem;
  margin-left: auto;
  white-space: nowrap;
}

/* Zoom controls */
#zoom-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.86rem;
  color: var(--gray-2);
}
.icon-btn {
  width: 26px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-4);
  border-radius: 3px;
  background: var(--bg-surface);
  color: var(--gray-1);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--gray-3);
  color: var(--ink);
}
.zoom-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#timeline-zoom {
  width: 180px;
  accent-color: var(--accent);
}
#zoom-readout {
  min-width: 32px;
  color: var(--gray-1);
  font-variant-numeric: tabular-nums;
}
.inline-detail {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--gray-5);
  border-radius: 4px;
  background: var(--gray-6);
}
.inline-detail h2 {
  margin: 0 0 6px;
  color: var(--gray-1);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.inline-detail[hidden] { display: none; }
.control-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  flex: 1 1 auto;
  margin-top: 14px;
}
.control-panels .panel {
  height: 100%;
  padding: 12px 14px 14px;
}

/* Tooltip floating over scrubber */
#roll-tooltip {
  position: fixed;
  background: var(--bg-surface);
  border: 1px solid var(--gray-3);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 0.82rem;
  line-height: 1.35;
  max-width: 320px;
  box-shadow: 0 4px 14px var(--tooltip-shadow);
  z-index: 50;
  pointer-events: none;
}
#roll-tooltip[hidden] { display: none; }
#roll-tooltip .tip-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}
#roll-tooltip .tip-row { color: var(--gray-1); }
#roll-tooltip .tip-row .tip-label {
  display: inline-block;
  min-width: 84px;
  color: var(--gray-2);
  font-size: 0.76rem;
}
#roll-tooltip .tip-perks { margin-top: 4px; }
#roll-tooltip .tip-perks .perk { display: block; margin-left: 12px; }
#roll-tooltip .tip-link {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--accent);
}

/* --- panels ------------------------------------------------------------ */

#panels {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.panel {
  background: var(--gray-6);
  border: 1px solid var(--gray-5);
  border-radius: 4px;
  padding: 14px 18px 16px;
}
.panel.wide { grid-column: 1; }
.panel h2 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 16px;
}
.stat-num {
  font-size: 1.4rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat-label {
  font-size: 0.78rem;
  color: var(--gray-2);
  margin-top: -2px;
}
.meta { font-size: 0.86rem; color: var(--gray-2); margin-top: 8px; }
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-title-row h2 { margin: 0; }
.panel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--gray-4);
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--gray-2);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.panel-close:hover {
  color: var(--ink);
  border-color: var(--gray-3);
}
.panel-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.perk-list {
  margin: 0; padding: 0;
  list-style: none;
  max-height: none;
  overflow-y: visible;
}
.perk-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--gray-5);
  font-size: 0.87rem;
  font-variant-numeric: tabular-nums;
}
.perk-list li:last-child { border-bottom: none; }
.perk-list .perk-name { color: var(--ink); }
.perk-list .perk-source { color: var(--gray-2); font-style: italic; font-size: 0.82rem; }
.perk-list .perk-cost { color: var(--paid); font-weight: 500; }
.perk-list .perk-cost.free { color: var(--free); }
.perk-list .perk-chapter { color: var(--gray-3); font-size: 0.78rem; }

#constellation-bars {
  display: grid;
  grid-template-columns: minmax(140px, max-content) minmax(0, 1fr) minmax(64px, auto) minmax(72px, auto);
  gap: 4px 12px;
  align-items: center;
  justify-content: start;
  font-size: 0.85rem;
}
.const-name { color: var(--gray-1); }
.const-empty {
  grid-column: 1 / -1;
  color: var(--gray-3);
  font-style: italic;
}
.const-bar-wrap {
  width: 100%;
}
.const-bar {
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
  min-width: 0;
}
.const-count {
  font-variant-numeric: tabular-nums;
  color: var(--gray-2);
  text-align: right;
}
.const-discovered {
  font-variant-numeric: tabular-nums;
  color: var(--gray-2);
  text-align: right;
}
.const-name.complete,
.const-count.complete,
.const-discovered.complete {
  color: var(--gray-3);
  text-decoration-line: line-through;
  text-decoration-thickness: 1px;
}

@media (max-width: 960px) {
  #scrubber-section { grid-template-columns: 1fr; }
  #scrubber-container,
  #scrubber-main-column,
  #recent-rail { grid-column: 1; }
  #recent-rail { grid-row: auto; align-self: stretch; }
  #panels { grid-template-columns: 1fr; }
  .panel.wide { grid-column: 1; }
}

@media (max-width: 700px) {
  header { padding: 18px 16px 8px; }
  header h1 { font-size: 1.25rem; }
  #scrubber-section {
    padding: 10px 16px 12px;
    gap: 8px;
  }
  #track-label-overlay {
    top: 10px;
    left: 16px;
    right: 16px;
  }
  #scrubber-container { margin-bottom: 8px; }
  #scrubber-readout {
    font-size: 0.86rem;
    line-height: 1.35;
  }
  #cumulative-strip {
    gap: 4px 10px;
    font-size: 0.8rem;
  }
  #playback-controls {
    flex-wrap: wrap;
    gap: 8px 10px;
    font-size: 0.84rem;
  }
  #play-pause {
    width: 34px;
    height: 32px;
  }
  #playback-controls select {
    min-height: 32px;
  }
  .link-btn {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }
  .control-hint {
    flex-basis: 100%;
    margin-left: 0;
    white-space: normal;
    line-height: 1.25;
  }
  #zoom-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
  .icon-btn {
    width: 32px;
    height: 30px;
  }
  #timeline-zoom { width: 160px; }
  #panels { grid-template-columns: 1fr; }
  #panels { padding: 10px 16px 28px; }
  .panel.wide { grid-column: 1; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .size-legend { grid-template-columns: repeat(2, auto auto); }
}

@media (max-width: 520px) {
  header { padding-left: 12px; padding-right: 12px; }
  #scrubber-section {
    padding: 8px 12px 10px;
  }
  #track-label-overlay {
    top: 8px;
    left: 12px;
    right: 12px;
    height: 244px;
  }
  #track-stack { height: 244px; }
  .track-dates    { top: 0;    height: 42px; }
  .track-chapters { top: 42px; height: 38px; }
  .track-pov      { top: 80px; height: 30px; }
  .track-markers  { top: 110px; height: 106px; }
  .track-rolls    { top: 110px; height: 106px; }
  .track-axis     { top: 216px; height: 28px; }
  .label-dates { top: 0; }
  .label-chapters { top: 42px; }
  .label-pov { top: 80px; }
  .label-rolls { top: 110px; }
  .label-axis { top: 216px; }
  .track-label {
    height: 14px;
    min-width: 56px;
    padding: 0 5px;
    font-size: 9px;
  }
  .preroll-band,
  #scrubber-playhead,
  #scrubber-hitarea {
    bottom: 28px;
  }
  .roll-dot.hit,
  .roll-dot.untracked { top: 18px; }
  .roll-dot.miss,
  .roll-dot.unknown { top: 70px; }
  .roll-skip-marker { top: 44px; }
  .roll-lane-label.hit-label { top: 2px; }
  .roll-lane-label.miss-label { top: 82px; }
  #scrubber-readout .dot { margin: 0 4px; }
  #timeline-zoom { width: 132px; }
  .control-hint { display: none; }
  #panels { padding-left: 12px; padding-right: 12px; }
}

@media (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  #track-label-overlay { height: 244px; }
  #track-stack { height: 244px; }
  .track-dates    { top: 0;    height: 42px; }
  .track-chapters { top: 42px; height: 38px; }
  .track-pov      { top: 80px; height: 30px; }
  .track-markers  { top: 110px; height: 106px; }
  .track-rolls    { top: 110px; height: 106px; }
  .track-axis     { top: 216px; height: 28px; }
  .label-dates { top: 0; }
  .label-chapters { top: 42px; }
  .label-pov { top: 80px; }
  .label-rolls { top: 110px; }
  .label-axis { top: 216px; }
  .track-label {
    height: 14px;
    min-width: 56px;
    padding: 0 5px;
    font-size: 9px;
  }
  .preroll-band,
  #scrubber-playhead,
  #scrubber-hitarea {
    bottom: 28px;
  }
  .roll-dot.hit,
  .roll-dot.untracked { top: 18px; }
  .roll-dot.miss,
  .roll-dot.unknown { top: 70px; }
  .roll-skip-marker { top: 44px; }
  .roll-lane-label.hit-label { top: 2px; }
  .roll-lane-label.miss-label { top: 82px; }
  .control-hint { display: none; }
}
