:root {
  --bg: #0b0d12;
  --bg-soft: #10131b;
  --card: #151924;
  --card-2: #1b2130;
  --line: #252c3d;
  --line-soft: #1e2433;
  --text: #e9ecf4;
  --muted: #8d96ab;
  --accent: #ff8a3d;
  --accent-2: #ff4d8d;
  --good: #3ddc97;
  --media-w: 260px;
  --inspector-w: 340px;
  --timeline-h: 240px;
  --board-h: 200px;
  --dock-h: 0px;
  --console-w: 360px;
  --split: 6px;
  --split-board: 6px;
  --split-console: 6px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Noto Sans', 'Yu Gothic UI', 'Hiragino Sans', Roboto, Arial, sans-serif;
  font-size: 14px;
}

.studio {
  display: grid;
  grid-template-rows: 32px 1fr var(--split) var(--timeline-h) var(--split-board) var(--board-h) var(--dock-h);
  grid-template-columns:
    var(--media-w) var(--split) 1fr var(--split) var(--inspector-w) var(--split-console) var(--console-w);
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* startup overlay (SA.boot): painted before the scripts, faded out by app.js */
.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 700px at 50% 18%, #161b28 0%, var(--bg) 60%);
  transition: opacity 260ms ease;
}

.boot.is-done {
  opacity: 0;
  pointer-events: none;
}

.boot[hidden] {
  display: none;
}

.boot-card {
  width: min(420px, 76vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.boot-brand {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.boot-brand-sub {
  color: var(--accent);
  font-weight: 500;
}

.boot-channel {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #0b0d12;
  background: #ffb020;
  border-radius: 4px;
  padding: 2px 8px;
}

.boot-channel[hidden] {
  display: none;
}

.boot-status {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 13px;
}

.boot-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 1.4em;
}

.boot-detail {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5d6785;
  font-size: 12px;
}

.boot-detail[hidden] {
  display: none;
}

.boot-percent {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.boot-elapsed {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* compositor-only spinner: keeps turning while the main thread parses fonts */
.boot-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  vertical-align: baseline;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: boot-spin 0.9s linear infinite;
}

@keyframes boot-spin {
  to {
    transform: rotate(360deg);
  }
}

.boot-credit {
  color: var(--muted);
  font-size: 12px;
  opacity: 0.8;
}

.boot-bar {
  height: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-2);
  overflow: hidden;
}

.boot-fill {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  /* boot.js animates scaleX on the compositor so the bar moves even while the
     main thread parses fonts; the rounded .boot-bar clips the ends */
  transform: scaleX(0.04);
  transform-origin: left center;
  will-change: transform;
}

/* the shimmer must keep moving while the main thread parses fonts, so it is a
   transform animation (compositor) rather than a background-position one */
.boot.is-busy .boot-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-100%);
  animation: boot-shimmer 1.2s linear infinite;
}

@keyframes boot-shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.studio.console-hidden {
  --split-console: 0px;
  --console-w: 0px;
}

.studio.console-hidden #split-console {
  display: none;
}

.studio.panel-hidden-media {
  --media-w: 0px;
}

.studio.panel-hidden-inspector {
  --inspector-w: 0px;
}

.studio.panel-hidden-timeline {
  --timeline-h: 0px;
}

.studio.panel-hidden-board {
  --board-h: 0px;
  --split-board: 0px;
}

.studio.panel-hidden-board #split-board,
.studio.panel-hidden-board #board-panel {
  display: none;
}

.menubar {
  grid-row: 1;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 30;
}

.menu-title {
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.menu-title:hover,
.menu-title.is-open {
  background: var(--card-2);
}

.menu-spacer {
  flex: 1;
}

.menu-status {
  color: var(--muted);
  font-size: 12px;
  padding-right: 8px;
}

.dropdown {
  position: absolute;
  top: 30px;
  min-width: 220px;
  padding: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  /* preview overlay (z-index 5) が上に来てメニューのホバー/クリックを奪い、
     カーソルが crosshair に変わってサブメニューが選べなくなるため、
     メニューはプレビューより前面に出す */
  z-index: 70;
}

.dropdown[hidden] {
  display: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.menu-item:hover:not(:disabled),
.menu-item.is-active:not(:disabled) {
  background: var(--card-2);
}

.menu-item:disabled {
  color: #59617a;
  cursor: default;
}

.menu-item .menu-check {
  width: 14px;
  color: var(--accent);
}

.menu-item .menu-key {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  padding-left: 18px;
}

.menu-item .menu-arrow {
  margin-left: auto;
  color: var(--muted);
}

.menu-separator {
  height: 1px;
  margin: 5px 8px;
  background: var(--line);
}

.submenu {
  position: absolute;
  min-width: 200px;
  padding: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.panel {
  background: var(--bg-soft);
  overflow: auto;
  min-width: 0;
}

.media-panel {
  grid-row: 2;
  grid-column: 1;
  border-right: 1px solid var(--line);
}

.inspector-panel {
  grid-row: 2;
  grid-column: 5;
  border-left: 1px solid var(--line);
}

.preview-panel {
  grid-row: 2;
  grid-column: 3;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.timeline-panel {
  grid-row: 4;
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Board pane: a second, candidate-oriented timeline of the whole song. */
.board-panel {
  grid-row: 6;
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.board-panel .board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px 4px;
}

.board-close {
  line-height: 1;
  padding: 1px 7px;
}

.board-panel .board-body {
  flex: 1;
  min-height: 0;
  padding: 0;
  display: block;
}

.board-scroll {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: auto;
  border-top: 1px solid var(--line-soft);
  background: var(--bg);
  scrollbar-gutter: stable;
}

.board-canvas {
  position: relative;
}

.board-cell,
.board-head,
.board-label,
.board-corner {
  position: absolute;
  box-sizing: border-box;
}

.board-head {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  justify-content: center;
  padding: 1px 2px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line-soft);
  z-index: 2;
}

.board-head.is-now {
  background: rgba(255, 138, 61, 0.18);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.board-beat {
  font-size: 10px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.board-time {
  font-size: 9px;
  opacity: 0.5;
}

.board-gen {
  font-size: 9px;
  padding: 0 4px;
  line-height: 1.2;
  min-height: 0;
}

.board-label {
  display: grid;
  place-items: center;
  font-size: 10px;
  opacity: 0.6;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-soft);
  z-index: 2;
}

.board-corner {
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  z-index: 3;
}

.board-cell {
  padding: 1px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
}

.board-cell:hover {
  border-color: var(--accent);
}

.board-cell.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.board-cell.is-empty {
  cursor: default;
  border-color: transparent;
}

.board-cell.is-now {
  background: rgba(255, 138, 61, 0.1);
  box-shadow: inset 1px 0 0 rgba(255, 138, 61, 0.55), inset -1px 0 0 rgba(255, 138, 61, 0.55);
}

.board-menu {
  position: fixed;
}

.board-thumb {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: #000;
  border-radius: 3px;
  overflow: hidden;
}

.board-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.board-thumb-wait {
  font-size: 10px;
  opacity: 0.6;
}

.board-name {
  font-size: 9px;
  text-align: center;
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-marker {
  position: absolute;
  width: 1px;
  background: var(--accent);
  opacity: 0.55;
  z-index: 1;
  pointer-events: none;
}

.timeline-body {
  /* start the time axis at the left edge of the preview column */
  padding: 0 12px 12px calc(12px + var(--media-w) + var(--split));
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.timeline-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
}

.timeline-ruler {
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  border-bottom: 1px solid var(--line);
}

.timeline-hscroll {
  position: relative;
  flex: none;
  height: 10px;
  margin-top: 4px;
  border-radius: 5px;
  background: #0d1017;
  border: 1px solid var(--line);
}

.timeline-hscroll[hidden] {
  display: none;
}

.timeline-hscroll-thumb {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 24px;
  border-radius: 5px;
  background: #47516b;
  cursor: grab;
}

.timeline-hscroll-thumb:hover {
  background: #5b678a;
}

.timeline-hscroll-thumb.is-dragging {
  background: var(--accent);
  cursor: grabbing;
}

.timeline-head {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.timeline-head .btn-icon {
  min-width: 28px;
  padding: 3px 6px;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
}

.timeline-sep {
  width: 1px;
  align-self: stretch;
  margin: 2px 4px;
  background: var(--line);
}

.btn-mini {
  padding: 3px 9px;
  font-size: 12px;
  border-radius: 6px;
}

.timeline-zoom {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

.timeline-zoom input[type='range'] {
  width: 110px;
}

.timeline-prop {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  padding: 3px 6px;
  max-width: 180px;
}

#timeline-canvas {
  display: block;
  background: var(--bg-soft);
  cursor: default;
}

.timeline-edit {
  position: absolute;
  z-index: 60;
  min-height: 48px;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  padding: 5px 7px;
  resize: both;
}

.timeline-tip {
  position: absolute;
  z-index: 80;
  max-width: 360px;
  padding: 4px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.timeline-menu {
  position: absolute;
  z-index: 70;
  min-width: 190px;
  padding: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

.timeline-panel .panel-body {
  position: relative;
}

.splitter-v {
  cursor: col-resize;
  background: var(--bg);
}

#split-media {
  grid-row: 2;
  grid-column: 2;
}

#split-inspector {
  grid-row: 2;
  grid-column: 4;
}

#split-console {
  grid-row: 2;
  grid-column: 6;
}

.splitter-v:hover {
  background: var(--accent);
}

.splitter-h {
  grid-row: 3;
  grid-column: 1 / -1;
  cursor: row-resize;
  background: var(--bg);
}

.splitter-h:hover {
  background: var(--accent);
}

#split-board {
  grid-row: 5;
}

.panel-title {
  padding: 10px 12px 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

.panel-body {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-placeholder {
  color: #5d6785;
  font-size: 13px;
  padding: 4px 0;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.meta-row strong {
  color: var(--text);
  font-weight: 600;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-row img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--card-2);
}

.avatar-row img[hidden] {
  display: none;
}

.preview-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  padding: 14px;
}

.preview-console {
  grid-row: 2;
  grid-column: 7;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--bg-soft);
}

.preview-console[hidden] {
  display: none;
}

.debug-window {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: var(--bg-soft);
  color: var(--text);
  overflow: hidden;
}

.debug-window .console-list {
  min-height: 0;
}

.console-count {
  color: #5d6785;
  font-variant-numeric: tabular-nums;
}

.console-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.console-head .console-title {
  margin-right: auto;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.console-list {
  flex: 1;
  overflow: auto;
  padding: 6px 8px;
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 11.5px;
  line-height: 1.55;
}

.console-entry {
  display: flex;
  gap: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.console-time {
  flex: 0 0 auto;
  color: #5d6785;
}

.console-text {
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.console-warn .console-text {
  color: #ffc247;
}

.console-error .console-text {
  color: #ff8a8a;
}

.console-empty {
  color: #5d6785;
}

.preview-frame {
  position: relative;
  display: block;
  line-height: 0;
  max-width: 100%;
  max-height: 100%;
}

.preview-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#preview-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  z-index: 5;
  border-radius: 6px;
  /* the handles canvas must stay transparent, otherwise it hides the preview below */
  background: transparent;
  box-shadow: none;
}

.preview-stage canvas {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  /* the transparent frame base shows a checkerboard so transparency reads as
     transparency; the canvas keeps its alpha, so exports stay transparent */
  background:
    repeating-conic-gradient(#3a4050 0% 25%, #22262f 0% 50%) 50% / 16px 16px;
}

.preview-warn {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 138, 61, 0.16);
  border: 1px solid rgba(255, 138, 61, 0.5);
  color: #ffd7b0;
  font-size: 12.5px;
}

.preview-warn[hidden] {
  display: none;
}

.preview-status {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(11, 13, 18, 0.82);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.preview-status[hidden] {
  display: none;
}

.welcome {
  position: absolute;
  inset: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  background: rgba(11, 13, 18, 0.92);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.welcome[hidden] {
  display: none;
}

.welcome h2 {
  margin: 0;
  font-size: 22px;
}

.welcome p {
  margin: 0;
  color: var(--muted);
  max-width: 420px;
}

.welcome-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.transport {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.transport .time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 110px;
  cursor: text;
}

.transport-speed {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 5px 6px;
  font: inherit;
}

.btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1005;
}

.aspect-badge {
  margin-left: auto;
}

.btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.btn:hover {
  border-color: #3a4666;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1005;
  font-weight: 600;
}

/* the cue / beat draw + delete actions: tinted with the accent orange */
.btn-orange {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1005;
}

.btn-orange:hover {
  border-color: #ffb07a;
}

.btn-icon {
  padding: 5px 9px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 16px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  z-index: 100;
}

.toast[hidden] {
  display: none;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.66);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
}

.dialog-backdrop[hidden] {
  display: none;
}

/* progress dialog for generation work that holds the main thread; above the
   regular dialogs so it can cover one that launched it */
.busy-backdrop {
  z-index: 95;
  cursor: progress;
}

.busy-dialog {
  width: 360px;
}

.busy-status {
  color: var(--muted);
  font-size: 13px;
  min-height: 1.4em;
}

.busy-bar {
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-2);
  overflow: hidden;
}

.busy-fill {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0.04);
  transform-origin: left center;
  transition: transform 0.2s ease-out;
  will-change: transform;
}

/* a transform animation runs on the compositor, so the shimmer keeps moving
   while a generation step blocks the main thread (same trick as .boot-fill) */
.busy-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-100%);
  animation: boot-shimmer 1.2s linear infinite;
}

.dialog {
  width: 420px;
  max-width: calc(100vw - 40px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog h3 {
  margin: 0;
  font-size: 17px;
}

.dialog label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.dialog .field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.dialog input[type='number'],
.dialog select {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  padding: 5px 8px;
  font: inherit;
  width: 110px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.dialog-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* motion showcase picker: 16 part buttons in a grid */
.motion-showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.motion-showcase-grid .btn-mini {
  padding: 4px 0;
}

.theme-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
}

.theme-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--bg-soft);
  flex-wrap: wrap;
}

.theme-row .theme-badge {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
}

.theme-row .theme-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog input[type='text'] {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  padding: 5px 8px;
  font: inherit;
}

.theme-editor {
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 80px);
}

/* Only the body (already scrollable) shrinks; header, tools and action buttons stay visible. */
.theme-editor > :not(.theme-editor-body) {
  flex-shrink: 0;
}

.mood-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.axis-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.axis-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

/* the axis rows explain themselves on hover (title), hint at it in the label */
.axis-row > span:first-child {
  cursor: help;
  text-decoration: underline dotted;
}

.axis-row input[type='range'] {
  flex: 1;
}

.axis-row .axis-value {
  width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.theme-editor-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.theme-editor-tools .theme-name-input {
  flex: 1;
  min-width: 200px;
}

.theme-editor-tools .theme-seed-input {
  width: 92px;
}

.theme-editor-info {
  color: var(--muted);
  font-size: 12px;
}

.theme-editor-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  min-height: 0;
}

.theme-editor-body > * {
  flex: 0 0 auto;
}

.theme-group {
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  overflow: hidden;
}

.theme-group > summary {
  padding: 7px 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
}

.theme-group-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--line-soft);
}

.theme-instance-head {
  justify-content: flex-start;
}

.theme-instance-head select {
  flex: 1;
}

.cue-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
}

.cue-list .cue-chip {
  display: flex;
  gap: 8px;
  padding: 5px 8px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  color: var(--muted);
}

.cue-list .cue-chip strong {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.cue-list .cue-chip {
  cursor: pointer;
}

.cue-list .cue-chip:hover {
  border-color: #3a4666;
}

.cue-chip .cue-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cue-chip .cue-meta {
  color: #5d6785;
  font-size: 11px;
  white-space: nowrap;
}

.cue-chip .cue-warn {
  color: #ff8a8a;
  font-size: 11px;
  white-space: nowrap;
}

.cue-chip.is-warn {
  border-color: rgba(255, 92, 92, 0.55);
}

.beat-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  margin-bottom: 8px;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 9px;
}

.beat-head {
  font-size: 12px;
  color: var(--text);
}

.beat-text {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  padding: 6px;
  resize: vertical;
}

.beat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* the inspector's own variant of the beat button strip */
.insp-beat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.insp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* the draw tools pinned above the breadcrumb: one boxed group per scope */
.insp-regen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 5px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--card);
}

.insp-regen-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-right: 6px;
  border-right: 1px solid var(--line-soft);
}

.insp-regen-group:last-child {
  padding-right: 0;
  border-right: none;
}

.insp-regen-tag {
  color: #5d6785;
  font-size: 12px;
  line-height: 1;
  cursor: default;
}

.insp-regen-btn {
  min-width: 28px;
  padding: 4px 7px;
  font-size: 13px;
  line-height: 1;
  text-align: center;
}

.insp-regen-btn.is-disabled,
.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.insp-breadcrumb .insp-sep {
  color: #5d6785;
}

.insp-orphans {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid rgba(255, 92, 92, 0.45);
  color: #ffb3b3;
  font-size: 12px;
}

.insp-section {
  margin-bottom: 8px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  overflow: hidden;
}

.insp-section > summary {
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  user-select: none;
}

/* the cue / beat draw + delete buttons, right of the section label */
.insp-summary-actions {
  float: right;
  display: inline-flex;
  gap: 3px;
  margin: -3px 0;
  text-transform: none;
  letter-spacing: 0;
}

.insp-summary-actions .insp-regen-btn {
  min-width: 24px;
  padding: 3px 6px;
  font-size: 12px;
}

.insp-section[open] > summary {
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
}

.insp-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ctrl-row {
  display: grid;
  grid-template-columns: 1fr 96px auto auto;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border-left: 2px solid transparent;
  padding-left: 4px;
}

.ctrl-row.is-set {
  border-left-color: var(--accent);
}

.ctrl-row.is-keyed {
  border-left-color: var(--accent);
}

.ctrl-row.ctrl-row-block {
  grid-template-columns: 1fr;
}

/* x/y-style pairs share one row: label + two tagged inputs + buttons */
.ctrl-row.is-pair {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.ctrl-pair {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.ctrl-pair-cell {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.ctrl-pair-cell > .ctrl-number,
.ctrl-pair-cell > input[type='number'],
.ctrl-pair-cell > input[type='text'],
.ctrl-pair-cell > select,
.ctrl-pair-cell > .layer-source {
  flex: 1 1 0;
  min-width: 0;
}

.ctrl-pair-cell > .layer-source {
  gap: 4px;
}

.ctrl-pair-tag {
  flex: none;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  min-width: 10px;
  text-align: center;
  white-space: nowrap;
}

.ctrl-pair-btns {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* textenter2 origin picker: 3x3 point grid plus a baseline button */
.ctrl-anchor-grid {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ctrl-anchor-cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
}

.ctrl-anchor-cells .btn-mini {
  padding: 0 5px;
  line-height: 1.5;
}

.ctrl-label {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctrl-number {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.ctrl-number input[type='number'],
.ctrl-number input[type='range'] {
  min-width: 0;
  width: 100%;
}

.ctrl-number input[type='range'] {
  display: none;
}

.ctrl-row:hover .ctrl-number input[type='range'] {
  display: block;
  position: absolute;
  z-index: 20;
  width: 140px;
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}

.ctrl-row select,
.ctrl-row input[type='number'],
.ctrl-row input[type='text'],
.ctrl-text,
.ctrl-vec2 input {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  padding: 4px 6px;
  min-width: 0;
  width: 100%;
}

.ctrl-text {
  min-height: 54px;
  resize: vertical;
  font-family: inherit;
}

.ctrl-vec2 {
  display: flex;
  gap: 4px;
}

.ctrl-color {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ctrl-swatch {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--line);
  flex: none;
}

.ctrl-hex {
  width: 100%;
}

.ctrl-bool-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.palette-swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}

.palette-set-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.palette-set-row .palette-swatches {
  flex: 1;
}

.motion-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 0 6px;
}

.color-popover {
  position: fixed;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 214px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5);
}

.color-sv,
.color-hue {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.color-swatch {
  position: relative;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}

.color-swatch:hover {
  border-color: var(--accent);
}

.color-slot-index {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0 2px;
  font-size: 8px;
  line-height: 1.2;
  color: #0b0d12;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 3px;
  pointer-events: none;
}

.color-hex-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-rgb {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.palette-dot {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* inspector swatches open the colour picker */
.palette-dot-edit {
  padding: 0;
  cursor: pointer;
}

.palette-dot-edit:hover,
.palette-dot-edit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* P1..P10 slot numbers on the inspector palette */
.palette-pnum {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0 2px;
  font-size: 8px;
  line-height: 1.2;
  color: #0b0d12;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 3px;
  pointer-events: none;
}

/* a slot that only exists as a derived colour until it is edited */
.palette-dot-edit.is-derived {
  border-style: dashed;
  opacity: 0.92;
}

/* jump target from the BACKGROUND FILL section */
.palette-dot-edit.is-flash {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* the in-place P8 editor inside the bgFill group */
.insp-palette8 .ctrl-label {
  white-space: nowrap;
}

.palette-swatch-item {
  position: relative;
  display: inline-flex;
}

.palette-swatch-item .ctrl-swatch {
  width: 26px;
  height: 22px;
}

.palette-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

.insp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.insp-actions.is-selected {
  outline: 1px solid #ff8a3d;
  border-radius: 4px;
}

.ctrl-points {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-points-preview {
  color: #5d6785;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-key,
.btn-reset {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.btn-key.is-on {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-reset {
  color: var(--muted);
}

.insp-stack-item {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.insp-stack-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.insp-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex: none;
}

.insp-head-enabled {
  gap: 0;
}

.insp-inherit {
  color: #5d6785;
  font-size: 11px;
}

.insp-motion {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  border-top: 1px dashed var(--line-soft);
  padding-top: 6px;
}

/* media panel tabs */

.media-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.media-tabs .btn.is-active {
  background: var(--card);
  border-color: var(--accent);
  color: var(--accent);
}

.media-tabs .btn.has-media {
  border-color: var(--accent);
}

.media-pane {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.media-pane[hidden] {
  display: none;
}

.media-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.media-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.media-item {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card);
}

.media-item[draggable='true'] {
  cursor: grab;
}

.media-thumb {
  width: 100%;
  height: auto;
  border-radius: 5px;
  background: #0d1017;
  display: block;
}

.media-item-name {
  font-size: 11.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-item-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.media-audio-canvas {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  display: block;
}

/* layers dialog */

.dialog-wide {
  width: 760px;
  max-width: calc(100vw - 40px);
}

/* combined Theme dialog: list and editor share one narrow dialog via tabs */
.theme-combined {
  width: min(720px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
}

/* the Themes dialog docks to the right side of the screen instead of
   centering; other dialogs keep using the centered backdrop */
.dialog-backdrop:has(> .theme-combined) {
  justify-content: flex-end;
  padding-right: 24px;
}

.theme-combined-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-combined-head h3 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-combined-tabs {
  padding-top: 0;
}

.theme-combined-body {
  display: block;
  min-height: 0;
}

.theme-combined.hide-left .theme-combined-body,
.theme-combined.hide-right .theme-combined-body {
  display: block;
}

.theme-combined-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
}

.theme-combined-left[hidden],
.theme-combined-right[hidden] {
  display: none;
}

.theme-combined-left .theme-list {
  max-height: min(62vh, 560px);
}

.theme-combined-left-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.theme-combined-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.theme-combined-editor {
  overflow: auto;
  min-height: 0;
  max-height: min(62vh, 560px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.theme-editor-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-row.is-active {
  border-color: var(--accent);
}

.layer-body {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 12px;
  max-height: min(76vh, 760px);
  min-height: 0;
}

.layer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
  min-height: 0;
}

.layer-row {
  display: flex;
  align-items: center;
  text-align: left;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--bg-soft);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.layer-row:hover {
  border-color: #3a4666;
}

.layer-row.is-active {
  border-color: var(--accent);
  color: var(--text);
}

.layer-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  padding-right: 4px;
  min-height: 0;
}

/* The layers dialog grew with the anchor / crop fields: cap the whole dialog
   at the viewport and scroll the editor column (the grid children need
   min-height: 0 or overflow never engages). Title and actions stay visible. */
.layer-dialog {
  max-height: calc(100vh - 60px);
}

.layer-dialog > :not(.layer-body) {
  flex-shrink: 0;
}

.layer-source {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.layer-source input[type='text'] {
  min-width: 0;
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  padding: 5px 8px;
  font: inherit;
}

.layer-order {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.layer-section {
  border-top: 1px dashed var(--line-soft);
  padding-top: 6px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.layer-section-title {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.bg-dropzone {
  border: 1px dashed var(--line-soft);
  border-radius: 7px;
  padding: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.bg-dropzone.is-over {
  border-color: var(--accent);
  color: var(--text);
}

.insp-section-title {
  margin: 10px 0 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.insp-cue-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.insp-cue-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  text-align: left;
  justify-content: flex-start;
}

.insp-cue-item.is-disabled {
  opacity: 0.55;
}

.insp-cue-time {
  flex: none;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.insp-cue-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insp-cue-count {
  flex: none;
  font-size: 11px;
  color: var(--muted);
}

.ctrl-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.ctrl-color-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ctrl-multiselect {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mood-chips .btn.is-active {
  background: var(--card);
  border-color: var(--accent);
  color: var(--accent);
}

/* Settings → Fonts… */
.fonts-dialog {
  width: 920px;
  max-height: calc(100vh - 60px);
}

.fonts-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: min(620px, calc(100vh - 170px));
  min-height: 0;
}

.fonts-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.fonts-heading {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fonts-col > .fonts-heading:first-child {
  color: var(--text);
  font-size: 14px;
}

.font-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.font-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
}

.font-row.is-used {
  opacity: 0.55;
}

.font-sample {
  width: 150px;
  height: 30px;
  flex: 0 1 150px;
  min-width: 80px;
  object-fit: contain;
  object-position: left center;
}

.font-name {
  flex: 1;
  min-width: 72px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.font-name small {
  color: var(--muted);
  font-size: 11px;
}

.font-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.font-tools select {
  width: 92px;
  padding: 3px 4px;
}

.font-badge {
  flex: none;
  min-width: 34px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.font-badge.is-missing {
  color: #ff7a7a;
}

.fonts-exclusive {
  font-size: 13px;
}

/* Filler preset editor: the preset row and the editable layer stack. */
.filler-preset-row {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.filler-filter {
  flex: 1 1 40%;
  min-width: 70px;
}

.filler-preset-select {
  flex: 1 1 60%;
  min-width: 100px;
}

.filler-layer {
  border: 1px solid var(--line, #2a3040);
  border-radius: 6px;
  padding: 6px;
  margin: 6px 0;
}

.filler-layer summary {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
}

.filler-layer summary::-webkit-details-marker {
  display: none;
}

.filler-layer summary select {
  flex: 1;
  min-width: 0;
}

.filler-layer-index {
  flex: none;
  min-width: 22px;
  color: var(--muted, #8d96ab);
  font-size: 11px;
}

.filler-layer .ctrl-row {
  margin-top: 4px;
}

.filler-lib-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.filler-lib-row .ctrl-text {
  flex: 1 1 120px;
  min-width: 90px;
}

/* palette editing dialog */
.palette-body {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 4px 0 10px;
}

.palette-editor {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 280px;
}

.palette-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.palette-edit-row .palette-role {
  flex: 0 0 96px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-edit-row .ctrl-hex {
  flex: 1 1 90px;
  min-width: 76px;
}

.palette-edit-add {
  justify-content: flex-start;
}

.palette-side {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 240px;
}

.palette-cands {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.palette-card {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 6px;
  text-align: left;
  background: var(--card2, #182030);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.palette-card:hover {
  border-color: var(--accent);
}

.palette-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.palette-card-strip {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 4px;
}

.palette-card-strip i {
  display: block;
  width: 16px;
  height: 16px;
}

.palette-card-name {
  flex: 1 1 auto;
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-contrast {
  color: var(--muted);
  font-size: 11px;
}

.palette-contrast.warn {
  color: var(--warn, #ffc247);
}

/* --- preset palette browser (SA.colors.openPresetPicker) ------------------- */

.preset-popover {
  width: 320px;
  max-width: 92vw;
}

.preset-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.preset-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 2px 0;
  max-height: min(420px, 52vh);
  overflow-y: auto;
}

.preset-card {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 6px;
  text-align: left;
  background: var(--card2, #182030);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.preset-card:hover {
  border-color: var(--accent);
}

.preset-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.preset-strip {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 4px;
}

.preset-strip i {
  display: block;
  width: 14px;
  height: 16px;
}

.preset-name {
  flex: 1 1 auto;
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctrl-bool-row.is-disabled {
  opacity: 0.5;
}

/* --- theme profile editor (axes -> parameters -> generator) --------------- */

.theme-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.theme-tab.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.param-row {
  display: grid;
  grid-template-columns: minmax(90px, 1.1fr) minmax(70px, 1.8fr) 44px 42px 48px 24px;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.param-row .param-label {
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.param-row input[type='range'] {
  width: 100%;
}

.param-value {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.param-percent {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.param-chip {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 4px;
  text-align: center;
}

.param-chip.is-pinned {
  color: var(--accent);
  border-color: var(--accent);
}

.param-reset {
  padding: 0 4px;
  min-width: 0;
}

.size-curve {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 46px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 8px;
}

.size-curve i {
  flex: 1 1 0;
  display: block;
  min-height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  transition: height 0.12s ease;
}

.use-palette-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}

.use-palette-card {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
}

.use-palette-strip {
  display: inline-flex;
  overflow: hidden;
  border-radius: 4px;
}

.use-palette-strip i {
  display: block;
  width: 12px;
  height: 12px;
}

.use-palette-name {
  font-size: 11px;
  color: var(--text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chance-bar {
  grid-column: 2;
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.chance-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.fx-type-row {
  grid-template-columns: minmax(110px, 1.4fr) minmax(70px, 1fr) 40px 40px 48px 24px;
}

.scheme-row {
  align-items: center;
  gap: 6px;
}

/* Motion Preset Search & Dialog */
.motion-dialog {
  max-width: 820px;
  width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.motion-dialog-search-bar {
  display: flex;
  align-items: center;
  margin: 10px 0 8px;
}

.motion-dialog-search-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-deep, #141419);
  border: 1px solid var(--line, #2c2d38);
  border-radius: 6px;
  color: var(--text, #f0f1f5);
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.motion-dialog-search-input:focus {
  border-color: var(--accent, #4dc8ff);
  box-shadow: 0 0 0 2px rgba(77, 200, 255, 0.2);
}

.motion-dialog-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.motion-dialog-tabs {
  display: flex;
  gap: 4px;
}

.motion-dialog-tab {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--line, #2c2d38);
  border-radius: 12px;
  color: var(--muted, #8a8d9f);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.motion-dialog-tab:hover {
  color: var(--text, #f0f1f5);
  border-color: var(--accent, #4dc8ff);
}

.motion-dialog-tab.is-active {
  background: var(--accent, #4dc8ff);
  border-color: var(--accent, #4dc8ff);
  color: #0b0c10;
  font-weight: 600;
}

.motion-dialog-cat-select {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  background: var(--bg-deep, #141419);
  border: 1px solid var(--line, #2c2d38);
  color: var(--text, #f0f1f5);
}

.motion-dialog-count {
  font-size: 11px;
  color: var(--muted, #8a8d9f);
  margin-left: auto;
}

.motion-dialog-list {
  max-height: 56vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  padding: 4px 4px 4px 0;
  box-sizing: border-box;
}

.motion-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--panel-sub, #1e1f29);
  border: 1px solid var(--line, #2c2d38);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  user-select: none;
}

.motion-card:hover {
  background: var(--panel-hover, #262836);
  border-color: var(--accent, #4dc8ff);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.motion-card.is-active {
  border-color: #2ed573;
  background: rgba(46, 213, 115, 0.1);
}

.motion-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.motion-card-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
}

.motion-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #f0f1f5);
}

.motion-card-subname {
  font-size: 11px;
  color: var(--muted, #8a8d9f);
}

.motion-card-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.motion-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  white-space: nowrap;
}

.motion-badge-entrance {
  background: rgba(77, 200, 255, 0.15);
  color: #4dc8ff;
  border: 1px solid rgba(77, 200, 255, 0.3);
}

.motion-badge-emphasis {
  background: rgba(255, 170, 0, 0.15);
  color: #ffaa00;
  border: 1px solid rgba(255, 170, 0, 0.3);
}

.motion-badge-exit {
  background: rgba(255, 71, 87, 0.15);
  color: #ff4757;
  border: 1px solid rgba(255, 71, 87, 0.3);
}

.motion-badge-category {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted, #8a8d9f);
}

.motion-card-desc {
  font-size: 11px;
  color: var(--muted, #a0a3b5);
  line-height: 1.4;
  margin-top: 4px;
  flex: 1;
}

.motion-card-desc mark,
.motion-card-name mark,
.motion-card-subname mark {
  background: rgba(255, 215, 0, 0.3);
  color: #fff;
  border-radius: 2px;
  padding: 0 1px;
}

.motion-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.motion-card-meta {
  font-size: 10px;
  color: var(--muted, #6c6f80);
}

.motion-card-add-btn {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-deep, #141419);
  border: 1px solid var(--line, #2c2d38);
  color: var(--text, #f0f1f5);
  cursor: pointer;
}

.motion-card:hover .motion-card-add-btn {
  background: var(--accent, #4dc8ff);
  color: #0b0c10;
  border-color: var(--accent, #4dc8ff);
}

.motion-dialog-empty {
  grid-column: 1 / -1;
  padding: 30px 10px;
  text-align: center;
  color: var(--muted, #8a8d9f);
  font-size: 13px;
}

/* Page Dialog */
.page-dialog {
  max-width: 960px;
  width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.page-aspect-toggle {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--line, #2c2d38);
}

.page-aspect-tab {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
}

.page-dialog-grid {
  max-height: 60vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 4px 6px 6px 0;
  box-sizing: border-box;
}

.page-card {
  display: flex;
  flex-direction: column;
  padding: 10px;
  background: var(--panel-sub, #1e1f29);
  border: 1px solid var(--line, #2c2d38);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.page-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent, #4dc8ff);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.page-thumbnail-wrap {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1015;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.page-thumbnail-wrap.is-portrait {
  height: 150px;
}

.page-thumbnail-canvas {
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

.page-card-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.insp-page-notice {
  font-size: 11px;
  color: var(--accent, #4dc8ff);
  margin-top: 4px;
  padding: 2px 6px;
  background: rgba(77, 200, 255, 0.08);
  border-radius: 4px;
  display: inline-block;
}


.insp-stack-item.insp-track-off,
.insp-section.insp-track-off {
  opacity: 0.4;
  filter: grayscale(1);
}

/* Inspector high-density: vertical rhythm at ~1/3 (8px->3px, 5-6px->2px, etc).
   Scoped to .inspector-panel so dialogs sharing .ctrl-row stay untouched. */
.inspector-panel .panel-body {
  gap: 3px;
  padding-bottom: 4px;
}

.inspector-panel .insp-breadcrumb {
  gap: 1px;
  margin-bottom: 3px;
}

.inspector-panel .insp-regen {
  gap: 2px;
  margin-bottom: 3px;
  padding: 2px 6px;
}

.inspector-panel .insp-regen-group {
  gap: 1px;
  padding-right: 2px;
}

.inspector-panel .insp-regen-btn {
  padding: 1px 7px;
}

.inspector-panel .insp-orphans {
  gap: 3px;
  margin-bottom: 3px;
  padding: 2px 8px;
}

.inspector-panel .insp-section {
  margin-bottom: 2px;
}

.inspector-panel .insp-section > summary {
  padding: 1px 8px;
}

.inspector-panel .insp-summary-actions {
  gap: 1px;
  margin: -1px 0;
}

.inspector-panel .insp-body {
  padding: 2px 8px;
  gap: 2px;
}

.inspector-panel .ctrl-row {
  gap: 2px;
  min-height: 0;
  padding-left: 1px;
}

.inspector-panel .ctrl-row select,
.inspector-panel .ctrl-row input[type='number'],
.inspector-panel .ctrl-row input[type='text'],
.inspector-panel .ctrl-text,
.inspector-panel .ctrl-vec2 input {
  padding: 0 5px;
  line-height: 1.3;
}

/* Inspector combobox: black background / white foreground (including the opened list). */
.inspector-panel select {
  background-color: #000;
  color: #fff;
  color-scheme: dark;
}

.inspector-panel select option {
  background-color: #000;
  color: #fff;
}

.inspector-panel .ctrl-text {
  min-height: 16px;
  line-height: 1.3;
}

.inspector-panel .ctrl-number,
.inspector-panel .ctrl-vec2,
.inspector-panel .ctrl-color {
  gap: 1px;
}

.inspector-panel .ctrl-pair {
  gap: 2px;
}

.inspector-panel .ctrl-pair-tag {
  line-height: 1.15;
}

.inspector-panel .ctrl-pair-btns {
  gap: 1px;
}

.inspector-panel .btn-key,
.inspector-panel .btn-reset {
  padding: 0 3px;
  line-height: 1.2;
}

.inspector-panel .btn-mini {
  padding: 0 8px;
  line-height: 1.5;
}

.inspector-panel .insp-stack-item {
  padding: 2px;
  gap: 1px;
}

.inspector-panel .insp-stack-head {
  gap: 2px;
}

.inspector-panel .insp-motion {
  gap: 1px;
  margin-top: 1px;
  padding-top: 2px;
}

.inspector-panel .insp-beat-actions {
  gap: 2px;
}

.inspector-panel .insp-inherit {
  line-height: 1.2;
}

.inspector-panel .ctrl-label {
  line-height: 1.15;
}

.inspector-panel .layer-order {
  gap: 2px;
  margin-top: 2px;
}

.inspector-panel .palette-set-row {
  margin: 1px 0;
}

.inspector-panel .filler-layer {
  padding: 2px;
  margin: 2px 0;
}

.inspector-panel .filler-layer .ctrl-row {
  margin-top: 1px;
}

.inspector-panel .filler-lib-row {
  gap: 2px;
  margin-top: 3px;
}

/* candidate tab */
.cand-body { display: flex; flex-direction: column; gap: 6px; }
.cand-target { font-size: 12px; font-weight: 600; word-break: break-all; }
.cand-controls { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cand-select { font-size: 11px; background: var(--card); color: inherit; border: 1px solid var(--border, #444); border-radius: 4px; padding: 2px 4px; }
.cand-hint { font-size: 11px; }
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.cand-card { border: 1px solid var(--border, #444); border-radius: 6px; padding: 3px; cursor: pointer; background: var(--card); user-select: none; }
.cand-card:hover { border-color: var(--accent); }
.cand-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cand-thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; background: #000; border-radius: 4px; overflow: hidden; }
.cand-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cand-thumb-wait { font-size: 12px; opacity: 0.6; }
.cand-row { display: flex; align-items: center; gap: 2px; margin-top: 2px; font-size: 11px; }
.cand-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand-badge { color: var(--accent); }
.cand-btn { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 3px; opacity: 0.55; font-size: 12px; }
.cand-btn:hover, .cand-btn.is-on { opacity: 1; color: var(--accent); }
.cand-chip { border: 1px solid var(--border, #444); background: transparent; color: inherit; border-radius: 10px; padding: 1px 8px; font-size: 11px; cursor: pointer; opacity: 0.6; }
.cand-chip:hover { opacity: 1; }
.cand-chip.is-on { opacity: 1; border-color: var(--accent); color: var(--accent); background: rgba(255, 138, 61, 0.12); }
.cand-axes { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.cand-axes-label { font-size: 11px; opacity: 0.7; }
.cand-mix { border: 1px solid var(--border, #444); border-radius: 6px; padding: 6px; display: flex; flex-direction: column; gap: 4px; background: var(--card); }
.cand-mix-title { font-size: 12px; font-weight: 600; }
.cand-mix-row { display: flex; align-items: center; gap: 6px; }
.cand-mix-label { font-size: 11px; opacity: 0.8; min-width: 84px; }
.cand-mix-apply { align-self: flex-start; }
.btn.is-on { border-color: var(--accent); color: var(--accent); }

.cand-card.is-touring { border-color: #ffb454; box-shadow: 0 0 0 2px #ffb454; }
.cand-tour-btn.is-on { border-color: #ffb454; color: #ffb454; }

/* the timeline title row carries its own hide button, like the board pane */
.timeline-panel .timeline-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px 4px;
}

/* a thin strip that brings a hidden timeline / board pane back */
.dock-bar {
  grid-row: 7;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.dock-bar[hidden] {
  display: none;
}

.board-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 8px;
}

.board-tools .cand-select {
  font-size: 11px;
}

/* candidate player: laid over the main preview, never the main transport */
/* `.preview-frame canvas { display: block }` outranks the UA [hidden] rule, so
   a hidden player must be switched off explicitly or it stays on top, frozen */
.preview-frame .preview-aux[hidden],
.preview-aux-badge[hidden] {
  display: none;
}

.preview-frame .preview-aux {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.preview-aux-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 6;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(220, 70, 40, 0.92);
  pointer-events: none;
}

/* the adopted slot: a band above row 1 that stays in view */
.board-cell.board-adopted {
  z-index: 3;
  background: rgba(255, 138, 61, 0.12);
  border-color: rgba(255, 138, 61, 0.55);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  cursor: default;
}

.board-cell.board-adopted.is-empty .board-name {
  opacity: 0.6;
}

.board-adopt-label {
  z-index: 4;
  color: var(--accent);
  font-weight: 600;
}

/* the three per-beat icon buttons in a column head */
.board-gen-row {
  display: flex;
  gap: 2px;
  justify-content: center;
}

.board-gen.board-icon {
  min-width: 22px;
  padding: 0 3px;
  font-size: 11px;
  line-height: 1.25;
}
