/* SKINS (js/ui/skin.js): the colours of the app around the video, never the video's own.
   Every colour below is a role; a skin is one set of values, on <html data-skin="…">.
   Electric = the app's original look; Concrete, Midnight, Slate and Console take their colours
   from the DAWs people know (Ableton, Logic, FL Studio, Pro Tools).
   --stage (around the video) is always neutral grey / black, so the video's colours read true.
   Track colours (--clip-…): one per kind of track, the same in the timeline, the track headers'
   strip and the Media strip: Song grey · Lyrics yellow · Text overlay orange · Image green ·
   Video blue · Camera red · Background dark grey · Sections lilac (Electric keeps its own). */
:root, :root[data-skin="electric"] {
  --select: #a8c8ff; --select-text: #111111; /* a selected track's header / clip's title (like Ableton's light blue) */
  --font: Helvetica, Arial, sans-serif;
  --bg: #ece8e2;            /* the window */
  --panel: #e2ded6;         /* the columns, the toolbar, the timeline area */
  --raised: #f6f4f0;        /* boxes, buttons, lanes */
  --lane: #eeebe5;          /* the Arrangement and Lyrics lanes */
  --input: #fbfaf8;
  --line: #111111;          /* outlines */
  --rule: #c9c3b8;          /* thin dividers */
  --rule-soft: #e3dfd8;
  --btn-line: #555555;      /* outlined buttons */
  --text: #111111;
  --text-2: #222222;        /* labels */
  --muted: #8a857c;         /* notes, greyed text */
  --muted-strong: #5f5a52;
  --disabled: #b5b0a6;
  --accent: #1f4fbf;        /* selected / active / playing / the main action (the website's blue) */
  --accent-ink: var(--accent); /* the accent as text (a skin whose accent is only a fill sets a darker one) */
  --fold: var(--accent);    /* the fold buttons (« » on the columns, the Media strip, the timeline) */
  --fold-text: var(--accent-text);
  --accent-text: #FFFFFF;   /* text on the accent */
  --accent-soft: #e6ecf8;   /* a selected row's background */
  --solid: #111111;         /* filled buttons (Play), clips */
  --solid-text: #f6f4f0;
  --record: #E0261B;
  --switch-on: #cfcac2;     /* a track's on / off button, lit (grey, like the fold buttons) */
  --switch-off: transparent;
  --marker: #00a050;        /* lyric markers */
  --ok: #3a7d2c;
  --warn: #c77700;
  --stage: #e4e4e4;         /* around the video: neutral grey in every skin */
  --stage-edge: #111111;    /* the video's outline */
  /* drawn on canvases (js/ui/ruler.js, js/ui/timeline.js) */
  --tick-beat: #9a958d;
  --grid-sub: #c4bfb6;
  --wave-empty: #2f2d2a;    /* before / after the song */
  --wave-flat: #d6d2cb;     /* no song yet */
  --texture: none;
  --ruler: #cfcac1;         /* the ruler's background (a shade darker than the panel, so its band shows) */
  --ruler-text: #111111;    /* its numbers and ticks */
  --type-strip: 0px;        /* the colour strip on a track's header (none in Electric) */
  --clip-edge: #111111;
  --clip-video: #111111;      --clip-video-text: #f6f4f0;
  --clip-image: #b9b5ae;      --clip-image-text: #111111;
  --clip-text: #f6f4f0;       --clip-text-text: #111111;
  --clip-camera: #f6f4f0;     --clip-camera-text: #E0261B;
  --clip-background: #dcd8d1; --clip-background-text: #555555;
  --clip-lyrics: #111111;
  --clip-section: #9fb7ff;    --clip-section-text: #111111;
  --clip-song: #c9c4ba;
}
/* Concrete: Ableton Live. Warm mid greys, orange for what's on, pastel clips */
:root[data-skin="concrete"] {
  --select: #a6d0e4; --select-text: #111111; /* a selected track's header / clip's title (like Ableton's light blue) */
  --bg: #7a7778; --panel: #8a8788; --raised: #a6a3a4; --lane: #9a9798; --input: #b5b2b3;
  --line: #4a4748; --rule: #6e6b6c; --rule-soft: #807d7e; --btn-line: #4f4c4d;
  --text: #111111; --text-2: #1c1c1c; --muted: #3a3838; --muted-strong: #262424; --disabled: #6a6768;
  --accent: #ffa375; --accent-text: #1a1a1a; --accent-soft: #b89a8c; --accent-ink: #5a2200;
  --solid: #2a2829; --solid-text: #ececec;
  --record: #d8352a; --switch-on: #d0cecf; --switch-off: transparent;
  --marker: #00873a; --ok: #1f6a2a; --warn: #8a5200;
  --stage: #4a4a4a; --stage-edge: #2a2a2a;
  --tick-beat: #4a4748; --grid-sub: #6e6b6c; --wave-empty: #6e6b6c; --wave-flat: #6e6b6c;
  --ruler: #8e8a8b; --ruler-text: #111111;
  --type-strip: 4px; --clip-edge: rgba(0, 0, 0, 0.35);
  --clip-video: #97a8f8;      --clip-video-text: #1a1a1a;
  --clip-image: #a3d48e;      --clip-image-text: #1a1a1a;
  --clip-text: #ffb27a;       --clip-text-text: #1a1a1a;
  --clip-camera: #ff8a7a;     --clip-camera-text: #1a1a1a;
  --clip-background: #6e6b6c; --clip-background-text: #f0f0f0;
  --clip-lyrics: #f5dc6e;
  --clip-section: #c9b7e8;    --clip-section-text: #1a1a1a;
  --clip-song: #b4b0b0;
}
/* Midnight: Logic Pro. Dark slate lanes, grey headers, a gold ruler, deep clips with pale text */
:root[data-skin="midnight"] {
  --select: #4f7fbd; --select-text: #ffffff; /* a selected track's header / clip's title (like Ableton's light blue) */
  --bg: #2a3035; --panel: #4a4a4a; --raised: #616161; --lane: #2a3035; --input: #3a3f45;
  --line: #1c1f22; --rule: #3c4247; --rule-soft: #323a40; --btn-line: #7a7a7a;
  --text: #ececec; --text-2: #dcdcdc; --muted: #a8acb2; --muted-strong: #c8cace; --disabled: #6e7278;
  --accent: #6bb5ff; --accent-text: #0d1a26; --accent-soft: #2f4a63;
  --solid: #e8e8e8; --solid-text: #1b1e2a;
  --record: #e8443a; --switch-on: #b8bcc2; --switch-off: transparent;
  --marker: #3fcf7a; --ok: #6fcf8a; --warn: #f0b040;
  --stage: #1e1e1e; --stage-edge: #111111;
  --tick-beat: #5e5a4a; --grid-sub: #8a7a4a; --wave-empty: #1c2024; --wave-flat: #4a5056;
  --ruler: #bf9b43; --ruler-text: #1b1e2a;
  --type-strip: 4px; --clip-edge: rgba(0, 0, 0, 0.45);
  --clip-video: #355777;      --clip-video-text: #e6f0fa;
  --clip-image: #3f7a4a;      --clip-image-text: #e8f4ea;
  --clip-text: #a8642a;       --clip-text-text: #fbefe4;
  --clip-camera: #a8322c;     --clip-camera-text: #fbe8e6;
  --clip-background: #4a4f55; --clip-background-text: #e6e6e6;
  --clip-lyrics: #c9a227;
  --clip-section: #6e5a96;    --clip-section-text: #f0ecf8;
  --clip-song: #5a6068;
}
/* Slate: FL Studio. Slate blue-grey, grey-blue panels, green lights */
:root[data-skin="slate"] {
  --select: #5f93ad; --select-text: #ffffff; /* a selected track's header / clip's title (like Ableton's light blue) */
  --bg: #33434d; --panel: #485156; --raised: #5f686d; --lane: #33434d; --input: #2a363e;
  --line: #222c32; --rule: #4a5860; --rule-soft: #3d4b54; --btn-line: #7a868d;
  --text: #e4ecef; --text-2: #d2dce0; --muted: #a2b2ba; --muted-strong: #c2ced4; --disabled: #66757d;
  --accent: #6fd46c; --accent-text: #0f1a12; --accent-soft: #3b5a45;
  --solid: #c9d3d8; --solid-text: #1e282e;
  --record: #e8584e; --switch-on: #b8c4ca; --switch-off: transparent;
  --marker: #6fd46c; --ok: #8fe08a; --warn: #f0c060;
  --stage: #262626; --stage-edge: #111111;
  --tick-beat: #7a8a92; --grid-sub: #4e5e66; --wave-empty: #26323a; --wave-flat: #5a6a72;
  --ruler: #5f686d; --ruler-text: #e4ecef;
  --type-strip: 4px; --clip-edge: rgba(0, 0, 0, 0.4);
  --clip-video: #6a9fd8;      --clip-video-text: #10181c;
  --clip-image: #7fbf6a;      --clip-image-text: #10181c;
  --clip-text: #e0915a;       --clip-text-text: #10181c;
  --clip-camera: #e06a5a;     --clip-camera-text: #10181c;
  --clip-background: #6a767c; --clip-background-text: #eef2f4;
  --clip-lyrics: #d8c25a;
  --clip-section: #a690d0;    --clip-section-text: #10181c;
  --clip-song: #8a979e;
}
/* Console: Pro Tools. Light grey edit window, black buttons with green readouts, strong track colours */
:root[data-skin="console"] {
  --select: #8cbadb; --select-text: #111111; /* a selected track's header / clip's title (like Ableton's light blue) */
  --bg: #a8a8a8; --panel: #c4c4c4; --raised: #dcdcdc; --lane: #b7b7b7; --input: #eeeeee;
  --line: #4a4a4a; --rule: #8e8e8e; --rule-soft: #a6a6a6; --btn-line: #5a5a5a;
  --text: #111111; --text-2: #222222; --muted: #4f4f4f; --muted-strong: #333333; --disabled: #8a8a8a;
  --accent: #2f5fd0; --accent-text: #ffffff; --accent-soft: #c7d4f2;
  --solid: #1a1a1a; --solid-text: #6ef06e;
  --record: #d92b2b; --switch-on: #f0f0f0; --switch-off: transparent;
  --marker: #1a9a3a; --ok: #1a7a2a; --warn: #a86a00;
  --stage: #7a7a7a; --stage-edge: #2a2a2a;
  --tick-beat: #5a5a5a; --grid-sub: #8a8a8a; --wave-empty: #8e8e8e; --wave-flat: #8a8a8a;
  --ruler: #c8c8c8; --ruler-text: #111111;
  --type-strip: 4px; --clip-edge: rgba(0, 0, 0, 0.45);
  --clip-video: #2f55d4;      --clip-video-text: #ffffff;
  --clip-image: #2f9a42;      --clip-image-text: #ffffff;
  --clip-text: #e8801a;       --clip-text-text: #111111;
  --clip-camera: #d42a2a;     --clip-camera-text: #ffffff;
  --clip-background: #5a5a5a; --clip-background-text: #ffffff;
  --clip-lyrics: #e8c21a;
  --clip-section: #8a5ad0;    --clip-section-text: #ffffff;
  --clip-song: #7a7a7a;
}

/* Print: the website (anewsong.club, ans-website/BRAND.md). Print blue, off-white ink, worn-paper
   grain on the panels (never around the video), Inter Tight; buttons off-white with blue text */
:root[data-skin="print"] {
  --select: #f5f3ee; --select-text: #1f4fbf; /* a selected track's header / clip's title (like Ableton's light blue) */
  --bg: #1f4fbf; --panel: #1f4fbf; --raised: #2a59c6; --lane: #2554c2; --input: #2a59c6;
  --line: rgba(245, 243, 238, 0.6); --rule: rgba(245, 243, 238, 0.35); --rule-soft: rgba(245, 243, 238, 0.18); --btn-line: rgba(245, 243, 238, 0.6);
  --text: #f5f3ee; --text-2: #f5f3ee; --muted: rgba(245, 243, 238, 0.62); --muted-strong: rgba(245, 243, 238, 0.8); --disabled: rgba(245, 243, 238, 0.35);
  --accent: #f5f3ee; --accent-text: #1f4fbf; --accent-soft: rgba(245, 243, 238, 0.16); --accent-ink: #f5f3ee;
  --solid: #f5f3ee; --solid-text: #1f4fbf;
  --record: #ff6b5e; --switch-on: rgba(245, 243, 238, 0.9); --switch-off: transparent;
  --marker: #5dffa0; --ok: #9dffb8; --warn: #ffd27a;
  --stage: #1c1c1c; --stage-edge: #000000;
  --tick-beat: rgba(245, 243, 238, 0.6); --grid-sub: rgba(245, 243, 238, 0.3); --wave-empty: #173d96; --wave-flat: rgba(245, 243, 238, 0.35);
  --ruler: #1f4fbf; --ruler-text: #f5f3ee;
  --type-strip: 4px; --clip-edge: rgba(10, 30, 110, 0.5);
  --clip-video: #c5d3ff;      --clip-video-text: #1f4fbf;
  --clip-image: #a8dba0;      --clip-image-text: #12306f;
  --clip-text: #ffc08f;       --clip-text-text: #12306f;
  --clip-camera: #ff9a8f;     --clip-camera-text: #12306f;
  --clip-background: #5a7fd6; --clip-background-text: #f5f3ee;
  --clip-lyrics: #f5e27a;
  --clip-section: #d6c8f2;    --clip-section-text: #1f4fbf;
  --clip-song: #8fa6e0;
  --texture:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.45'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='1400'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004' numOctaves='5' seed='7'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='1.4' intercept='-0.2'/%3E%3CfeFuncG type='linear' slope='1.4' intercept='-0.2'/%3E%3CfeFuncB type='linear' slope='1.4' intercept='-0.2'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)' opacity='0.6'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 65% 55% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 70%),
    radial-gradient(ellipse 55% 45% at 0% 100%, rgba(255, 255, 255, 0.14), transparent 70%);
}
/* …and the website's type: labels bold, uppercase, tight */
:root[data-skin="print"] .insp-tab, :root[data-skin="print"] .layer-name, :root[data-skin="print"] .media-strip-name,
:root[data-skin="print"] .tool-btn, :root[data-skin="print"] .action-btn { letter-spacing: -0.01em; }
:root[data-skin="print"] ::selection { background: #f5f3ee; color: #1f4fbf; }

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  height: 100vh;
  display: flex;
  flex-direction: column; /* the three panels, then the bottom bar */
  overflow: hidden;
}

#app-container {
  display: flex;
  width: 100vw;
  flex: 1;
  min-height: 0; /* the bottom bar takes its 60px, the panels get the rest */
  overflow: hidden;
}

/* LEFT WORKSPACE (CANVAS & PLAYER) */
#workspace-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--stage);
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.brand-header-bar {
  width: 100%;
  padding: 12px 20px 4px 20px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 50;
  flex-shrink: 0;
}
.brand-title {
  color: var(--accent-ink);
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  font-family: var(--font);
  white-space: nowrap;
}
.brand-sub {
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: var(--font);
  white-space: nowrap;
}

.canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.8rem 1rem;
  position: relative;
  overflow: hidden;
}

#visualizer-stage {
  position: relative;
  background-color: #fcfbfa; /* the video itself: the same in every skin */
  background-size: cover;
  background-position: center;
  border: 3px solid var(--stage-edge);
  overflow: hidden !important;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* DISABLE TRANSITIONS DURING ACTIVE DRAG/RESIZE FOR INSTANT REFLOW */
#visualizer-stage.is-dragging,
.universal-stage-container.is-dragging {
  transition: none !important;
}

/* The guides and the snap lines (js/ui/stageGuides.js), over the picture, under the frames */
#stage-guides {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 15;
}

/* Stage size is set in js/stageSize.js: the largest box of the exact chosen ratio
   that fits the workspace. The ratio-* classes just name the current choice.
   This is only a fallback until that code has measured the workspace. */
#visualizer-stage { width: 45vh; height: 80vh; }

/* UNIVERSAL BOUNDING CONTAINER FOR ALL MODES */
/* Renderer layer: draws the lyrics; sits under the draggable frame and the grid */
#preview-canvas {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9;
}

.universal-stage-container {
  position: absolute;
  padding: 0.5rem;
  z-index: 10;
  transform: translate(-50%, -50%);
  cursor: grab;
  border: 1.5px dashed transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  pointer-events: none;
}
/* The text frame shows (and can be grabbed) while the Lyrics layer is selected */
#visualizer-stage.editing-lyrics .universal-stage-container { border-color: var(--accent); pointer-events: auto; }
#visualizer-stage.editing-lyrics .universal-stage-container .stage-resize-handle { display: block; }
.universal-stage-container.is-dragging { cursor: grabbing; }

.stage-resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 1px solid var(--input);
  z-index: 20;
  display: none;
}
.handle-tl { top: -7px; left: -7px; cursor: nwse-resize; }
.handle-tr { top: -7px; right: -7px; cursor: nesw-resize; }
.handle-bl { bottom: -7px; left: -7px; cursor: nesw-resize; }
.handle-br { bottom: -7px; right: -7px; cursor: nwse-resize; }


#phrase-display {
  position: absolute;
  font-weight: 700;
  text-align: center;
  user-select: none;
  pointer-events: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
  overflow: hidden !important;
  z-index: 10;
  paint-order: stroke fill;
}

#starmap-container {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%; /* set to the layout size and zoomed (js/modes/starMap.js) */
  transform-origin: 0 0;
  pointer-events: none;
  z-index: 10;
  display: none;
  overflow: hidden !important;
}

.starmap-word {
  position: absolute;
  font-weight: 700;
  white-space: nowrap;
  transform: translate3d(-50%, -50%, 0);
  paint-order: stroke fill;
  max-width: 100%;
  word-break: break-word;
  pointer-events: auto;
  cursor: grab;
}
.starmap-word:active { cursor: grabbing; }

/* CENTER LYRIC TELEPROMPTER */
#teleprompter-panel {
  width: 320px;
  height: 100%;
  background: var(--panel);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex-shrink: 0;
  overflow: hidden;
}


.lyrics-apply-bar {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding-bottom: 0.6rem; border-bottom: 1.5px solid var(--accent); flex-shrink: 0;
}

#teleprompter-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.3rem;
}

.teleprompter-line {
  background: var(--raised);
  border: 1px solid var(--line);
  padding: 0.5rem;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  user-select: none;
  position: relative;
}

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

.teleprompter-line.selected {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
}

.teleprompter-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.teleprompter-time {
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--accent-ink);
  font-weight: bold;
}

.teleprompter-edit-btn {
  font-size: 0.6rem;
  padding: 0.1rem 0.3rem;
  background: var(--raised);
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: bold;
  border-radius: 0px;
}
.teleprompter-edit-btn:hover { border-color: var(--accent); color: var(--accent-ink); }

.teleprompter-text {
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}

.teleprompter-line.active {
  background: var(--accent);
  border-color: var(--accent);
}

.teleprompter-line.active .teleprompter-time,
.teleprompter-line.active .teleprompter-text {
  color: var(--accent-text);
}

.teleprompter-edit-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0.2rem;
  border: 1px solid var(--accent);
  background: var(--input);
  color: var(--text);
}

/* RIGHT PARAMETER DRAWER */
#settings-panel {
  width: 370px;
  height: 100%;
  background: var(--panel);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  color: var(--text);
  flex-shrink: 0;
  position: relative;
}

.sticky-top-toolbar {
  position: sticky;
  top: -1.2rem;
  background: var(--panel);
  padding: 0.8rem 0;
  z-index: 100;
  border-bottom: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: -1.2rem;
}


#settings-panel h3 {
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 0.25rem;
}

.setting-group { display: flex; flex-direction: column; gap: 0.2rem; }
.setting-group label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  color: var(--text-2);
}
.setting-group select, 
.setting-group input[type="color"], 
.setting-group input[type="file"],
.setting-group input[type="text"],
.setting-group textarea,
.setting-group input[type="range"] {
  width: 100%;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.35rem;
  border-radius: 0px;
  font-size: 0.75rem;
  font-family: var(--font);
}

.setting-group textarea { box-sizing: border-box; resize: vertical; line-height: 1.35; }

.checkbox-group { display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; cursor: pointer; color: var(--text); }
.checkbox-group input { accent-color: var(--text); }

.action-btn-row { display: flex; gap: 0.3rem; }

.action-btn, .btn, .reset-btn-danger, .btn-blue-screen, .fmt-btn {
  font-family: var(--font);
  border-radius: 0px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.action-btn:active, .btn:active, .reset-btn-danger:active, .btn-blue-screen:active, .fmt-btn:active {
  transform: translateY(1px);
}

.action-btn {
  flex: 1;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.45rem 0.1rem;
  font-size: 0.65rem;
  font-weight: 800;
}
.action-btn:hover {
  background: var(--raised);
  color: var(--text);
  border-color: var(--accent);
}

.action-btn.active-mode {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.action-btn.grid-active {
  background: var(--raised);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 900;
}

/* TYPOGRAPHY FORMATTING TOOLBAR */
.typography-toolbar {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.fmt-btn {
  flex: 1;
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.4rem;
  font-size: 0.75rem;
  font-weight: bold;
}
.fmt-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.fmt-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.btn-blue-screen {
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  margin-top: 0.2rem;
}
.btn-blue-screen.active {
  background: #00FF00;
  color: #111111;
  border-color: #00FF00;
}

.reset-btn-danger {
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.5rem;
  font-size: 0.68rem;
  font-weight: 800;
  margin-top: 0.3rem;
}
.reset-btn-danger:hover {
  background: var(--raised);
  color: var(--text);
  border-color: var(--accent);
}

#control-bar {
  width: 100%;
  background-color: var(--panel);
  display: flex;
  flex-direction: column; /* the toolbar, then the timeline */
  padding: 6px 1rem 8px;
  gap: 6px;
  z-index: 100;
  flex-shrink: 0;
  overflow: hidden;
  max-height: 45vh; /* the tracks scroll inside; drag the divider above to change it */
}

/* Under the stage: undo / redo, play, loop, record, the time, ratio, grid */
#player-bar {
  width: 100%; display: flex; align-items: center; gap: 0.45rem;
  padding: 6px 1rem 10px; flex-shrink: 0;
}
#player-bar .btn.icon-btn { width: 34px; height: 34px; }
.btn.plain-btn { background: var(--raised); color: var(--text); font-size: 1.05rem; font-weight: 700; }
.btn.plain-btn:hover { background: var(--raised); color: var(--text); border-color: var(--accent); }
.btn.plain-btn.grid-active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.bar-gap { width: 0.4rem; }
.bar-spacer { flex: 1; }
.bar-label { font-size: 0.62rem; font-weight: 800; color: var(--text-2); }
.bar-select {
  max-width: 190px; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 0;
  padding: 0.35rem 0.3rem; font-size: 0.7rem; font-weight: 700;
}

/* Above the timeline: ＋ Audio, ＋ Media, ＋ Camera */
#timeline-toolbar { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.tool-btn { flex: 0 0 auto; padding: 0.35rem 0.75rem; font-size: 0.66rem; cursor: pointer; display: inline-flex; align-items: center; }
.toolbar-note { font-size: 0.6rem; color: var(--muted); font-style: italic; }

/* Top of the right panel: Sessions ▾ and Export ▾, each opening a pop-over */
.panel-top-bar { display: flex; gap: 0.3rem; justify-content: flex-end; flex-shrink: 0; }
.panel-top-bar .action-btn { flex: 0 0 auto; padding: 0.4rem 0.8rem; }
.export-main-btn { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.export-main-btn:hover { background: var(--accent); color: var(--accent-text); }
.pop-over {
  display: flex; flex-direction: column; gap: 0.5rem;
  position: absolute; top: 3.2rem; right: 1rem; width: min(340px, calc(100% - 2rem)); z-index: 300;
  border: 2px solid var(--accent); background: var(--raised); padding: 0.7rem;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.18);
}

/* The middle column: Lyrics | Media tabs, « to fold it away */
.middle-tabs { display: flex; align-items: center; gap: 0.9rem; border-bottom: 1.5px solid var(--accent); flex-shrink: 0; }
.middle-page { display: flex; flex-direction: column; gap: 0.85rem; min-height: 0; flex: 1; }
/* Text overlay tab: the list of overlays (click one to edit it) */
#middle-overlay > * { flex: 0 0 auto; }
#middle-overlay { justify-content: flex-start; }
.overlay-list { display: flex; flex-direction: column; gap: 0.25rem; overflow-y: auto; max-height: 40%; }
.overlay-row { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.35rem 0.5rem; border: 1px solid var(--line); background: var(--raised); cursor: pointer; font-size: 0.75rem; text-align: left; }
.overlay-row:hover { border-color: var(--accent); }
.overlay-row.selected { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.overlay-row .overlay-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.overlay-row .overlay-time { font-size: 0.65rem; opacity: 0.75; font-variant-numeric: tabular-nums; }
.overlay-empty { font-size: 0.72rem; color: var(--muted); }
#teleprompter-panel.collapsed { width: 34px !important; padding: 0.8rem 0.3rem; }
#teleprompter-panel.collapsed > :not(.middle-expand) { display: none !important; }
.middle-expand { width: 24px; }

/* Media tab (js/ui/mediaBin.js): the song, clips and pictures brought in */
.media-bin { display: flex; flex-direction: column; gap: 0.7rem; overflow-y: auto; min-height: 0; flex: 1; }
.media-bin.drop-target { outline: 2px dashed var(--accent); outline-offset: -4px; }
.bin-section h4 {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.66rem; font-weight: 900; color: var(--accent-ink);
  border-bottom: 1px solid var(--rule); padding-bottom: 0.2rem; margin-bottom: 0.3rem;
}
.bin-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0.35rem; }
.bin-item {
  display: flex; flex-direction: column; gap: 0.15rem; background: var(--raised); border: 1px solid var(--line);
  padding: 0.25rem; cursor: grab; font-size: 0.58rem; font-weight: 700; text-align: left; color: var(--text);
}
.bin-item:hover { border-color: var(--accent); }
.bin-thumb { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--rule-soft); display: block; }
.bin-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bin-audio { display: flex; align-items: center; gap: 0.4rem; font-size: 0.66rem; font-weight: 700; padding: 0.35rem; border: 1px solid var(--line); background: var(--raised); }
.bin-empty { font-size: 0.62rem; color: var(--muted); font-style: italic; }

/* Draggable dividers between the columns, and above the timeline (js/ui/layout.js) */
.divider { flex-shrink: 0; background: var(--line); z-index: 120; }
.divider-v { width: 4px; cursor: col-resize; }
.divider-h { height: 4px; width: 100%; cursor: row-resize; }
.divider:hover, .divider.dragging { background: var(--accent); }
/* Play / Loop / Record and the time, lined up with the waveform row */
.transport { display: flex; align-items: center; gap: 0.6rem; height: 44px; flex-shrink: 0; }
/* The waveform, with the layer tracks under it */
#timeline-area { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
#timeline-area.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }
.btn {
  background: var(--solid);
  color: var(--solid-text);
  border: 1px solid var(--line);
  padding: 0.5rem 1.2rem;
  font-weight: 800;
}
.btn:hover {
  background: var(--solid);
  color: var(--solid-text);
  border-color: var(--accent);
}

/* Play / Pause and Loop: small square icon buttons. Play shows ▶ while stopped and ❚❚ while
   playing (js/audioClock.js); Loop is outlined while off, blue while on (js/ui/loopPlayback.js) */
.btn.icon-btn { width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.icon-btn .icon-pause, .icon-btn.playing .icon-play { display: none; }
.icon-btn.playing .icon-pause { display: block; }
.btn.loop-btn { background: var(--raised); color: var(--text); }
.btn.loop-btn svg { fill: none; }
.btn.loop-btn:hover { background: var(--raised); color: var(--text); border-color: var(--accent); }
.btn.loop-btn.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* Record: a red dot; red with a white square while counting in / recording (js/ui/recordTake.js) */
.btn.record-btn { background: var(--raised); color: var(--record); }
.btn.record-btn:hover { background: var(--raised); color: var(--record); border-color: var(--accent); }
.icon-btn .icon-stop, .record-btn.recording .icon-record { display: none; }
.record-btn.recording .icon-stop { display: block; }
.btn.record-btn.recording { background: var(--record); color: var(--accent-text); border-color: var(--record); }
.btn.record-btn.counting { border-color: var(--record); animation: record-blink 1s steps(2, start) infinite; }
@keyframes record-blink { to { background: var(--record); color: var(--accent-text); } }

/* The 3-2-1 count-in over the canvas */
.count-in {
  position: absolute; inset: 0; z-index: 60; pointer-events: none;
  align-items: center; justify-content: center;
  font-family: var(--font); font-weight: 900; font-size: 9rem; color: var(--accent-ink);
  background: rgba(252, 251, 250, 0.55);
}

#time-display { font-family: monospace; font-size: 0.8rem; color: var(--text); min-width: 140px; text-align: center; flex-shrink: 0; }
/* Timeline: waveform drawing with the (invisible) playhead slider on top */
#timeline { position: relative; flex: 1; min-width: 0; height: 44px; background: var(--raised); border: 1px solid var(--line); }

/* Layer tracks: one row per image / video layer, a bar where it shows (js/ui/layerTracks.js) */
#layer-tracks {
  position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}
/* A track: its header (eye, name, ▲▼) then its lane in time */
.track-row { display: flex; align-items: stretch; flex-shrink: 0; height: 28px; }
.track-row + .track-row { border-top: 1px solid var(--rule-soft); }
.track-head.layer-row {
  width: 190px; flex-shrink: 0; padding: 0.15rem 0.4rem; gap: 0.35rem; font-size: 0.62rem;
  border: 1px solid var(--line); border-right-width: 2px; background: var(--raised);
}
.track-head .layer-eye { width: 14px; }
.track-head .layer-move { width: 1.1rem; }
.track-lane { position: relative; flex: 1; min-width: 0; background: var(--raised); border: 1px solid var(--line); border-left-color: transparent; }
.track-row.selected-track .track-lane { background: var(--accent-soft); }
.track-row.hidden-layer .track-lane > * { opacity: 0.35; }
.song-row { height: 48px; margin-top: 4px; }
.song-head { cursor: default; }
.song-icon { font-size: 0.9rem; color: var(--accent-ink); }
.song-head .layer-name { flex: 1; }
.song-replace { cursor: pointer; text-align: center; }
/* Lyrics track: a plain block per lyric line */
.lyric-block { position: absolute; top: 5px; bottom: 5px; background: var(--clip-lyrics); cursor: pointer; }
.lyric-block.selected { background: var(--accent); }
.track-bar.whole { cursor: pointer; }
.track-bar.camera { --bar-bg: var(--clip-camera); --bar-text: var(--clip-camera-text); background: var(--bar-bg); color: var(--bar-text); border-color: var(--clip-edge); }
:root[data-skin="electric"] .track-bar.camera { border-color: var(--record); }
.track-bar.background { --bar-bg: var(--clip-background); --bar-text: var(--clip-background-text); background: var(--bar-bg); color: var(--bar-text); border-color: var(--clip-edge); }
:root[data-skin="electric"] .track-bar.background { border-color: #b9b5ae; }
.layer-track { position: relative; height: 19px; border-top: 1px solid var(--rule-soft); }
.track-bar {
  position: absolute; top: 4px; bottom: 4px; min-width: 2px; box-sizing: border-box;
  padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 0.6rem; font-weight: 700; line-height: 18px;
  cursor: pointer; border: 1px solid var(--clip-edge);
}
.track-bar.video { --bar-bg: var(--clip-video); --bar-text: var(--clip-video-text); background: var(--bar-bg); color: var(--bar-text); }
.track-bar.image { --bar-bg: var(--clip-image); --bar-text: var(--clip-image-text); background: var(--bar-bg); color: var(--bar-text); }
.track-bar.text { --bar-bg: var(--clip-text); --bar-text: var(--clip-text-text); background: var(--bar-bg); color: var(--bar-text); text-transform: none; }
.track-bar.selected { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.layer-track.hidden-layer .track-bar { opacity: 0.35; }
.track-bar { cursor: grab; }
.track-bar:active { cursor: grabbing; }
/* Trim handles: a thin line with half an arrowhead at its foot, like the export zone's
   (the start handle has the left half, the end handle the right half) */
.trim-handle { position: absolute; top: 0; bottom: 0; width: 12px; z-index: 1; cursor: ew-resize; touch-action: none; }
.trim-start { margin-left: -11px; }
.trim-end { margin-left: -1px; }
.trim-grip { position: absolute; top: 2px; bottom: 2px; width: 2px; background: var(--solid); }
.trim-grip::after { content: ""; position: absolute; bottom: 0; width: 0; height: 0; border-bottom: 7px solid var(--solid); }
.trim-start .trim-grip { right: 0; }
.trim-start .trim-grip::after { right: 0; border-left: 6px solid transparent; }
.trim-end .trim-grip { left: 0; }
.trim-end .trim-grip::after { left: 0; border-right: 6px solid transparent; }
.trim-handle:hover .trim-grip { background: var(--accent); }
.trim-handle:hover .trim-grip::after { border-bottom-color: var(--accent); }
.tracks-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; z-index: 2; }
#timeline:focus-within { border-color: var(--accent); }
#timeline-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#scrubber {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; background: transparent;
}
/* A 2px-wide thumb, so where you click is where the playhead goes (the timeline draws it) */
#scrubber::-webkit-slider-thumb { -webkit-appearance: none; width: 2px; height: 44px; }
#scrubber::-moz-range-thumb { width: 2px; height: 44px; border: 0; }

/* Export zone handles on the timeline: a thin line with half an arrowhead at its foot, the start
   handle the left half and the end handle the right half (together they make one arrowhead) */
.zone-handle {
  position: absolute; top: -1px; bottom: -1px; width: 14px; z-index: 2;
  cursor: ew-resize; touch-action: none; display: none;
}
.zone-start { margin-left: -13px; }
.zone-end { margin-left: -1px; }
.zone-grip { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--solid); }
.zone-grip::after {
  content: ""; position: absolute; bottom: 0; width: 0; height: 0;
  border-bottom: 10px solid var(--solid);
}
.zone-start .zone-grip { right: 0; }
.zone-start .zone-grip::after { right: 0; border-left: 8px solid transparent; }
.zone-end .zone-grip { left: 0; }
.zone-end .zone-grip::after { left: 0; border-right: 8px solid transparent; }
.zone-handle:hover .zone-grip, .zone-handle.dragging .zone-grip { background: var(--accent); }
.zone-handle:hover .zone-grip::after, .zone-handle.dragging .zone-grip::after { border-bottom-color: var(--accent); }
.zone-label {
  position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 3; display: none;
  background: var(--solid); color: var(--solid-text); font-family: monospace; font-size: 0.7rem;
  padding: 0.1rem 0.35rem; pointer-events: none; white-space: nowrap;
}

/* COMPACT BOTTOM EXPORT OVERLAY */
#render-modal {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 38px;
  background: var(--solid);
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.8rem;
  gap: 0.5rem;
  z-index: 200;
  pointer-events: none;
  border-top: 2px solid var(--accent);
}
.render-title { font-size: 0.62rem; font-weight: 900; letter-spacing: 0.5px; color: var(--solid-text); font-family: monospace; }
.render-stats { font-family: monospace; font-size: 0.68rem; font-weight: bold; color: var(--accent-ink); }
/* LAYERS LIST (js/ui/layersPanel.js): top of the stack first */
.layers-list { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.4rem; }
.layer-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.5rem; border: 1px solid var(--line); background: var(--raised);
  cursor: pointer; font-size: 0.72rem; font-weight: 800;
}
.layer-row:hover { border-color: var(--accent); }
.layer-row.selected { border: 2px solid var(--accent); background: var(--accent-soft); }
.layer-row.hidden-layer .layer-name { opacity: 0.4; text-decoration: line-through; }
/* A layer's on / off button (like Ableton's track activator): lit when on, grey when off */
.layer-eye {
  width: 14px; height: 14px; flex: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: 2px;
  background: var(--switch-off); cursor: pointer;
}
.layer-eye.on { background: var(--switch-on); }
.layer-eye:hover { border-color: var(--accent); }
.layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-shortcut { font-size: 0.62rem; font-weight: 600; color: var(--muted); }
.layer-move {
  width: 1.3rem; border: 1px solid var(--line); background: var(--input); cursor: pointer;
  font-size: 0.55rem; line-height: 1.2; padding: 0.1rem 0;
}
.layer-move:hover:not(:disabled) { border-color: var(--accent); }
.layer-move:disabled { opacity: 0.25; cursor: default; }
.media-note { font-size: 0.62rem; color: var(--muted); margin-top: 0.2rem; font-style: italic; }

/* EFFECTS on an image layer (js/ui/effectsPanel.js): one card per effect, top = first */
/* THE SELECTED LAYER'S TABS (js/ui/inspector.js): top tabs, then sub-tabs */
.inspector-tabs { display: flex; flex-direction: column; gap: 0.45rem; }
.insp-tabs { display: flex; gap: 0.9rem; flex-wrap: wrap; border-bottom: 1.5px solid var(--accent); }
.insp-tab {
  background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -1.5px;
  padding: 0.3rem 0 0.25rem; cursor: pointer; color: var(--text);
  font-size: 0.72rem; font-weight: 900; letter-spacing: 0.5px;
}
.insp-tab:hover { color: var(--accent-ink); }
.insp-tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.insp-subtabs { display: flex; gap: 0.3rem; }
.insp-tab:disabled { color: var(--disabled); cursor: default; }
.insp-tab:disabled:hover { color: var(--disabled); }
.insp-picker {
  background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 0;
  padding: 0.3rem; font-size: 0.7rem; font-weight: 700;
}
.insp-subtab {
  flex: 1; background: var(--raised); border: 1px solid var(--line); cursor: pointer; color: var(--text);
  padding: 0.3rem 0.2rem; font-size: 0.66rem; font-weight: 800;
}
.insp-subtab:hover { border-color: var(--accent); }
.insp-subtab.active { background: var(--accent-soft); border: 2px solid var(--accent); color: var(--accent-ink); }
.insp-page { display: flex; flex-direction: column; gap: 0.5rem; }
.sub-heading {
  margin-top: 0.4rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--rule);
  font-size: 0.66rem; font-weight: 900; color: var(--accent-ink);
}

/* FOLD-OUTS (Project, Sessions & Export): click the heading to fold / unfold */
.fold-head { cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.fold-head::after { content: "▾"; font-size: 0.8rem; }
.fold.folded .fold-head::after { content: "▸"; }
.fold-body { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.fold.folded .fold-body { display: none; }

.effects-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-top: 0.8rem; padding-bottom: 0.25rem; border-bottom: 1.5px solid var(--accent);
}
.effects-title { color: var(--accent-ink); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.5px; }
.effects-row { display: flex; gap: 0.3rem; margin-top: 0.4rem; }
.effects-row select {
  flex: 1; min-width: 0; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 0;
  padding: 0.3rem; font-size: 0.7rem; font-weight: 700; cursor: pointer;
}
.effects-row .action-btn { flex: 0 0 auto; padding: 0.3rem 0.5rem; }
.effects-head select {
  background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 0;
  padding: 0.2rem 0.3rem; font-size: 0.68rem; font-weight: 700; cursor: pointer;
}
#effects-list { display: flex; flex-direction: column; gap: 0; margin-top: 0.2rem; border-top: 1px solid var(--rule); }
.effect-card { border-bottom: 1px solid var(--rule); padding: 0.4rem 0.1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.effect-card.folded > :not(.effect-head) { display: none; }
.effect-card .effect-switch { flex: 0 0 auto; }
.effect-card .effect-name {
  flex: 1; text-align: left; background: none; border: none; padding: 0; cursor: pointer; color: var(--text);
  font-size: 0.72rem; font-weight: 800;
}
.effect-card .effect-name::after { content: "  ▾"; color: var(--muted); }
.effect-card.folded .effect-name::after { content: "  ▸"; }
.effect-card .effect-name:hover { color: var(--accent-ink); }
.effect-card.effect-is-on .effect-name { color: var(--accent-ink); }
.effect-card .effect-about { margin-top: 0; }
.effect-head { display: flex; align-items: center; gap: 0.3rem; }
.effect-switch { flex: 1; display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.72rem; font-weight: 800; }
.effect-switch input { accent-color: var(--accent); }
.effect-card select {
  background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 0;
  padding: 0.25rem; font-size: 0.7rem;
}
.effect-card input[type="color"] { width: 100%; height: 1.6rem; border: 1px solid var(--line); padding: 0; background: var(--raised); cursor: pointer; }
.effect-card .effect-driver { padding-bottom: 0.3rem; border-bottom: 1px dashed var(--accent); }
.effect-card .effect-driver label { color: var(--accent-ink); }
.effect-card.effect-off .setting-group, .effect-card.effect-off .effect-toggle { opacity: 0.55; }

/* Export length: Start / End rows (time box + "Set to playhead") */
.export-range-note { font-size: 0.72rem; font-weight: 700; color: var(--text); margin: 0.15rem 0 0.35rem; }
.export-range-row { display: flex; align-items: center; gap: 0.3rem; margin-bottom: 0.3rem; }
.export-range-row label { width: 2.6rem; font-size: 0.68rem; font-weight: 700; color: var(--text-2); }
.export-range-row input[type="text"] {
  width: 4.8rem; background: var(--raised); color: var(--text); border: 1px solid var(--line);
  padding: 0.3rem; border-radius: 0px; font-size: 0.75rem; font-family: var(--font);
}
.export-range-row .action-btn { padding: 0.35rem 0.3rem; }
.export-range-row input[type="number"] {
  width: 4.2rem; background: var(--raised); color: var(--text); border: 1px solid var(--line);
  padding: 0.3rem; border-radius: 0px; font-size: 0.75rem; font-family: var(--font);
}
.take-sync-unit { font-size: 0.68rem; color: var(--text-2); white-space: nowrap; }

/* IMAGE / VIDEO LAYER FRAME (js/ui/mediaFrame.js): drag to move, corners to resize */
.media-frame {
  position: absolute;
  z-index: 12;
  border: 1.5px dashed var(--accent);
  cursor: move;
  box-sizing: border-box;
}
.media-frame .stage-resize-handle { display: block; }
/* Only seen while the pointer is over it or it's being dragged (it's still there to grab) */
.media-frame:not(:hover):not(.dragging) { border-color: transparent; }
.media-frame:not(:hover):not(.dragging) .stage-resize-handle { opacity: 0; }

/* While the Background layer is being edited, the lyrics can't be grabbed */
#visualizer-stage:not(.editing-lyrics) .starmap-word {
  pointer-events: none !important;
}

/* ---- The timeline, Ableton-style (js/ui/ruler.js, js/ui/timelineView.js, js/ui/tempo.js) ---- */
#timeline-area { position: relative; }
#scrubber { display: none; }           /* holds the playhead's place; the ruler does the seeking */
.track-lane, #timeline { overflow: hidden; }
#timeline { cursor: text; }

/* The ruler: bar numbers (or minutes), the loop brace, the playhead's handle */
.ruler-row { height: 30px; }
.ruler-head {
  width: 190px; flex-shrink: 0; display: flex; align-items: flex-end; padding: 0 0.4rem 0.2rem;
  font-size: 0.55rem; color: var(--muted); font-style: italic;
}
#timeline-ruler {
  position: relative; flex: 1; min-width: 0; background: var(--ruler); cursor: pointer;
  border-bottom: 1px solid var(--line); overflow: hidden;
  /* the same 1 px sides as the Song lane, so the ruler, grid, waveform and tracks share one width */
  border-left: 1px solid transparent; border-right: 1px solid transparent;
}
#ruler-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* The loop brace: the loop / export zone (blue while Loop is on, grey while it's off) */
#loop-brace { position: absolute; top: 2px; height: 9px; z-index: 2; }
#loop-brace .brace-body { position: absolute; inset: 0; background: var(--disabled); cursor: grab; }
#loop-brace.on .brace-body { background: var(--accent); }
#loop-brace .zone-handle {
  display: block; position: absolute; top: -2px; bottom: -2px; width: 10px; margin: 0; z-index: 3;
  cursor: ew-resize; background: none;
}
#loop-brace .zone-start { left: -5px; }
#loop-brace .zone-end { right: -5px; left: auto; }
#loop-brace .zone-grip { position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: var(--solid); }
#loop-brace .zone-grip::after { display: none; }
#timeline-ruler .zone-label { top: 12px; z-index: 4; }

/* The playhead: a bold blue line through every track, with a handle in the ruler */
.playhead { position: absolute; top: 0; bottom: 0; width: 0; z-index: 6; pointer-events: none; }
.playhead::before { content: ""; position: absolute; top: 12px; bottom: 0; left: -1px; width: 2px; background: var(--accent); }
.playhead-grip {
  position: absolute; top: 12px; left: -7px; width: 14px; height: 16px; pointer-events: auto; cursor: ew-resize;
  background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%);
}

/* Bar / beat lines through the tracks */
.grid-overlay { position: absolute; pointer-events: none; z-index: 5; }

/* The Song track sits right under the ruler */
.song-row { margin-top: 0; height: 52px; }
.track-row.selected-track .track-lane { background: var(--accent-soft); }
body.dragging-track, body.dragging-track * { cursor: grabbing !important; }
.track-head.layer-row { cursor: grab; }

/* Tempo, metronome, grid, zoom in the toolbar */
.tool-group { display: inline-flex; align-items: center; gap: 0.3rem; padding-right: 0.4rem; border-right: 1px solid var(--rule); }
.tempo-box {
  width: 4.4rem; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 0;
  padding: 0.3rem; font-size: 0.75rem; font-weight: 800; font-family: monospace; text-align: right;
}
.tool-unit { font-size: 0.6rem; font-weight: 800; color: var(--text-2); }
.toggle-btn.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* One toolbar row above the timeline: uploads · undo / redo · transport · tempo · bar 1 · grid · ratio */
/* One line, always (a narrow window scrolls it sideways rather than wrapping) */
#timeline-toolbar { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
#timeline-toolbar .tool-btn { padding: 0.3rem 0.5rem; }
#timeline-toolbar .bar-label { margin: 0; }
#timeline-toolbar .tool-group { display: inline-flex; align-items: center; gap: 0.3rem; padding-right: 0.45rem; border-right: 1px solid var(--rule); }
#timeline-toolbar .tool-group:last-child { border-right: none; }
#timeline-toolbar .btn.icon-btn { width: 32px; height: 32px; }
#timeline-toolbar #time-display { min-width: 0; font-size: 0.72rem; padding: 0 0.2rem; }
.nudge-btn { padding: 0.35rem 0.4rem; }
.offset-readout { font-family: monospace; min-width: 3.6rem; text-align: center; }
.division-select { max-width: 70px; padding: 0.3rem 0.2rem; }
.song-row.selected-song .song-head, .song-row.selected-song #timeline { border-color: var(--accent); }
#timeline { cursor: ew-resize; }

/* Ableton-style drag boxes (song and click volumes): drag up / down */
.drag-box {
  display: inline-block; min-width: 3.6rem; padding: 0.15rem 0.3rem; font-family: monospace; font-size: 0.62rem;
  text-align: center; background: var(--input); border: 1px solid var(--rule); color: var(--text);
  cursor: ns-resize; user-select: none; touch-action: none; flex-shrink: 0;
}
.drag-box:hover, .drag-box.dragging, .drag-box:focus-visible { border-color: var(--accent); outline: none; }
.song-head .drag-box { min-width: 3.2rem; font-size: 0.58rem; text-transform: none; }
.song-lock { cursor: pointer; background: none; border: none; font-size: 0.75rem; padding: 0 0.15rem; opacity: 0.55; }
.song-lock.active { opacity: 1; }
.meter-select { max-width: 56px; padding: 0.3rem 0.2rem; }
.nudge-btn:disabled, #tempo-bar-one:disabled { opacity: 0.35; cursor: not-allowed; }

/* Folding the settings panel away (») and the timeline down to its toolbar (▾): js/ui/layout.js */
#settings-panel.collapsed { width: 34px !important; padding: 0.8rem 0.3rem; overflow: hidden; }
#settings-panel.collapsed > :not(.panel-expand) { display: none !important; }
.panel-expand { width: 24px; }
#control-bar.folded { height: auto !important; }
#control-bar.folded #timeline-area { display: none !important; }
body.timeline-folded .divider-h { display: none; }
.fold-btn { padding: 0.3rem 0.45rem !important; }
#teleprompter-panel.drop-target { outline: 2px dashed var(--accent); outline-offset: -4px; }

/* Parameter fold-outs in the panel (Stage frame, Grid offset, Article's More), like the FX rows */
.param-fold { border-bottom: 1px solid var(--rule); padding: 0.4rem 0.1rem; }
.param-fold:first-child, .param-fold + :not(.param-fold) { border-top: 1px solid var(--rule); }
.param-fold > .fold-head { font-size: 0.72rem; font-weight: 800; color: var(--text); justify-content: flex-start; gap: 0.4rem; }
.param-fold > .fold-head::after { color: var(--muted); }
.param-fold > .fold-head:hover { color: var(--accent-ink); }
body.mode-no-frame #insp-mode-frame { display: none !important; }

/* The Song track's bottom edge: drag to make the waveform taller / shorter (js/ui/timeline.js) */
.song-row { position: relative; }
.song-row #timeline { height: auto; align-self: stretch; }
.song-resize { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; z-index: 7; }
.song-resize:hover, .song-resize.dragging { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* The one pixel rule (js/ui/ruler.js): the playhead and the loop brace are painted on canvases
   that share the lanes' left edge; the elements on top are invisible handles for dragging */
.playhead-canvas { position: absolute; pointer-events: none; z-index: 6; }
.playhead { z-index: 7; }
.playhead::before { display: none; }
.playhead-grip { background: transparent; }
#loop-brace .brace-body, #loop-brace.on .brace-body { background: transparent; }
#loop-brace .zone-grip { background: transparent; }

/* One height for everything in the toolbar (the ＋ Audio / ＋ Media buttons' height) */
#timeline-toolbar { --tool-h: 26px; }
#timeline-toolbar .tool-btn, #timeline-toolbar .bar-select, #timeline-toolbar .tempo-box,
#timeline-toolbar .btn.icon-btn, #timeline-toolbar #time-display {
  height: var(--tool-h); min-height: var(--tool-h); box-sizing: border-box; padding-top: 0; padding-bottom: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
#timeline-toolbar .btn.icon-btn { width: var(--tool-h); padding: 0; }
#timeline-toolbar .btn.icon-btn svg { width: 15px; height: 15px; }
#timeline-toolbar .tempo-box { width: 58px; }
/* The nudge arrows sit together */
.nudge-group { gap: 2px !important; }
.nudge-group .nudge-btn { padding: 0 0.35rem; }

/* The Click button is also its volume: a thin level bar along its bottom */
.click-btn { position: relative; overflow: hidden; cursor: ns-resize; }
.click-btn .click-level { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); opacity: 0.55; pointer-events: none; }
.click-btn.active .click-level { background: var(--input); opacity: 0.8; }

/* Bottom right of the stage area: ＋ Camera, 📷 Snapshot, Ratio, Guides */
.stage-tools {
  position: absolute; right: 12px; bottom: 10px; z-index: 60; display: flex; align-items: center; gap: 0.3rem;
  --tool-h: 26px;
}
.stage-tools .tool-btn, .stage-tools .bar-select, .stage-tools .btn.icon-btn {
  height: var(--tool-h); box-sizing: border-box; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center;
}
.stage-tools .btn.icon-btn { width: var(--tool-h); justify-content: center; padding: 0; }
.stage-tools .bar-select { max-width: 76px; }

/* The Arrangement lane (js/ui/arrangement.js): named sections above the Song track */
.arrangement-row { height: 24px; }
.arrangement-lane { overflow: hidden; background: var(--lane); }
.arr-section {
  position: absolute; top: 2px; bottom: 2px; box-sizing: border-box; border: 1px solid rgba(17, 17, 17, 0.55);
  color: var(--clip-section-text); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.3px;
  display: flex; align-items: center; overflow: hidden; white-space: nowrap; cursor: grab; user-select: none;
}
.arr-section.light { color: var(--accent-text); }
.arr-section.selected { outline: 2px solid var(--text); outline-offset: -1px; z-index: 2; }
.arr-label { padding: 0 6px; pointer-events: none; overflow: hidden; text-overflow: clip; }
.arr-handle { position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; z-index: 3; }
.arr-start { left: -1px; }
.arr-end { right: -1px; }
.arr-rename { position: absolute; inset: 1px; font-size: 0.65rem; padding: 0 4px; border: 1px solid var(--accent); z-index: 4; }

/* The lyric-markers slider on the Lyrics track's header */
.lyric-marks { width: 56px; height: 12px; margin: 0 0.2rem; accent-color: var(--marker); cursor: pointer; }

/* The Lyrics slider in the toolbar (lyric markers) */
.lyric-marks-tool { display: inline-flex; align-items: center; gap: 0.3rem; height: var(--tool-h, 26px); font-size: 0.62rem; font-weight: 800; color: var(--text); flex-shrink: 0; }
.lyric-marks-tool .lyric-marks { width: 70px; }

/* The Camera button while the camera is on: a red outline */
#add-camera-btn.camera-live { outline: 2px solid var(--record); outline-offset: -2px; }

/* The Click button: small, just the metronome symbol */
#timeline-toolbar .click-btn { width: var(--tool-h); padding: 0; cursor: pointer; }
#timeline-toolbar .click-btn svg { width: 15px; height: 15px; }
#timeline-toolbar #click-volume.drag-box { height: var(--tool-h); box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }

/* Sessions / Export pop-overs open upwards from their buttons in the toolbar (js/ui/layout.js) */
.pop-over { position: fixed; top: auto; right: auto; width: 340px; max-height: 70vh; overflow-y: auto; }
.pop-over > * { flex-shrink: 0; } /* (a tall pop-over scrolls instead of squashing its parts) */
#timeline-toolbar .export-main-btn { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* The settings panel's tabs sit on the same line as the middle column's Lyrics | Media, with »
   (fold it away) at the right like the middle column's « */
#settings-panel { padding-top: 1rem; }
.middle-tabs, .panel-head .insp-tabs { height: 30px; box-sizing: border-box; align-items: flex-end; }
.middle-tabs .insp-tab, .panel-head .insp-tabs .insp-tab { padding-bottom: 0.3rem; }
.middle-tabs .layer-move { align-self: center; }
.panel-head { position: relative; }
.panel-head .insp-tabs { padding-right: 30px; flex-wrap: nowrap; }
.panel-collapse { position: absolute; right: 0; top: 4px; }

/* Track heights (js/ui/layerTracks.js): drag a track's bottom edge; ⇕ resets them all */
#layer-tracks .track-row { position: relative; }
.track-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: row-resize; z-index: 7; }
.track-resize::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; }
.track-resize:hover::after, body.resizing-track .track-resize::after { background: var(--accent); }
body.resizing-track, body.resizing-track * { cursor: row-resize !important; }
.ruler-head { justify-content: space-between; align-items: center; }
.tracks-squash { font-size: 0.7rem; padding: 0 0.3rem; line-height: 1.2; }

/* Clips on the timeline: little pictures along the bar (js/ui/clipThumbs.js), the name on top */
.track-bar.image, .track-bar.video { padding: 0; }
.track-bar .bar-thumbs { position: absolute; top: 0; left: 0; height: 100%; display: block; pointer-events: none; opacity: 0.9; }
.track-bar .bar-name {
  position: absolute; left: 0; top: 0; max-width: 100%; padding: 0 5px; overflow: hidden; text-overflow: ellipsis;
  font-size: 0.56rem; line-height: 12px; background: rgba(17, 17, 17, 0.72); color: #fcfbfa; pointer-events: none;
}
.track-bar.selected .bar-name { background: var(--accent); }
.track-bar.selected { box-shadow: inset 0 0 0 2px var(--accent); }

/* Bottom right of the stage area, small like CapCut's: Camera, Snap, zoom, ratio, guides */
.stage-tools { gap: 6px; right: 14px; bottom: 8px; }
.mini-btn {
  height: 18px; padding: 0 5px; box-sizing: border-box; border: 1px solid var(--btn-line); border-radius: 3px;
  background: transparent; color: var(--text-2); font-size: 0.58rem; font-weight: 700; line-height: 16px;
  cursor: pointer; display: inline-flex; align-items: center; font-family: inherit;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.mini-select { appearance: none; -webkit-appearance: none; padding: 0 5px; text-align: center; }
#btn-toggle-grid.mini-btn { width: 18px; justify-content: center; padding: 0; font-size: 0.7rem; }
#btn-toggle-grid.grid-active, #btn-magnet.grid-active { border-color: var(--accent); color: var(--accent-ink); }
#btn-magnet:not(.grid-active) { opacity: 0.5; }
#add-camera-btn.camera-live { outline: none; border: 1.5px solid var(--record); color: var(--record); }

/* Zoomed in, the stage area scrolls (js/ui/canvasZoom.js) */
.canvas-wrapper.zoomed { overflow: auto; justify-content: safe center; align-items: safe center; }
.canvas-wrapper.zoomed #visualizer-stage { flex-shrink: 0; }

/* The lyrics' eye, by the Lyric editor tab */
.insp-tabs .tab-eye { align-self: center; margin-left: -0.6rem; font-size: 0.7rem; padding: 0 0.2rem; background: none; border: none; cursor: pointer; }

/* Section ends: wider grips to stretch them, shown on hover */
.arr-handle { width: 10px; }
.arr-start { left: -2px; }
.arr-end { right: -2px; }
.arr-section:hover .arr-handle::after { content: ""; position: absolute; top: 3px; bottom: 3px; left: 4px; width: 2px; background: currentColor; opacity: 0.7; }

/* The start guide on a blank canvas (js/ui/startGuide.js) */
.start-guide { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 6%; pointer-events: none; }
.guide-card {
  pointer-events: auto; position: relative; max-width: 360px; width: 100%; max-height: 100%; overflow: auto;
  background: var(--raised); border: 2px solid var(--accent); padding: 14px 16px; box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
  font-family: var(--font); color: var(--text);
}
.guide-title { font-size: 0.8rem; font-weight: 900; color: var(--accent-ink); letter-spacing: 0.5px; margin-bottom: 8px; }
.guide-close { position: absolute; top: 6px; right: 8px; border: none; background: none; font-size: 1rem; cursor: pointer; color: var(--muted-strong); }
.guide-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 8px; }
.guide-steps li { display: flex; gap: 8px; align-items: flex-start; counter-increment: step; font-size: 0.66rem; line-height: 1.35; }
.guide-steps li b { display: block; font-size: 0.7rem; }
.guide-tick { flex: 0 0 18px; height: 18px; border: 1.5px solid var(--accent); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 900; color: var(--accent-ink); }
.guide-tick::before { content: counter(step); }
.guide-steps li.done .guide-tick { background: var(--accent); color: var(--accent-text); }
.guide-steps li.done .guide-tick::before { content: "✓"; }
.guide-steps li.done span { opacity: 0.55; }

/* Undo / redo: thin line icons, no box (like CapCut) */
.line-icon-btn { height: var(--tool-h, 26px); width: 24px; padding: 0; border: none; background: none; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.line-icon-btn svg { width: 18px; height: 18px; }
.line-icon-btn:hover:not(:disabled) { color: var(--accent-ink); }
.line-icon-btn:disabled { color: var(--disabled); cursor: default; }

/* The lyrics' show / hide box, left of the Lyrics slider */
.lyrics-visible { width: 13px; height: 13px; margin: 0 -0.1rem 0 0; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }

/* Sections in the teleprompter (js/ui/teleprompterSections.js) */
.tp-section {
  margin: 0.4rem 0 0.15rem; padding: 2px 6px; background: var(--clip-section); color: var(--clip-section-text); cursor: pointer;
  font-size: 0.58rem; font-weight: 900; letter-spacing: 0.4px; user-select: none;
}
.tp-section:hover { outline: 1.5px solid var(--accent); }
.teleprompter-line.in-section { border-left: 3px solid var(--clip-section); }

/* The Lyrics tab as a text page, with the built-in LRC tool (js/ui/lyricSync.js) */
.lyric-views { display: flex; align-items: center; gap: 4px; }
.lyric-views .mini-btn.active, .lyric-speed.active { border-color: var(--accent); color: var(--accent-text); background: var(--accent); }
.lyric-write { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
.lyric-write-box { flex: 1; min-height: 240px; resize: vertical; font: 0.8rem/1.6 var(--font); padding: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--text); }
.lyric-tidy { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.done-btn { border-color: var(--accent); color: var(--accent-ink); }
.lyric-sync-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.sync-label { font-size: 0.58rem; font-weight: 800; color: var(--muted-strong); }
.sync-snap { display: inline-flex; align-items: center; gap: 3px; font-size: 0.58rem; font-weight: 700; margin-left: 4px; }
.sync-count { width: 100%; font-size: 0.58rem; color: var(--muted-strong); }
.tp-empty { font-size: 0.7rem; color: var(--muted); padding: 0.5rem; }
/* the page: lines as plain text, no boxes */
#teleprompter-list .teleprompter-line { border: none; background: none; padding: 1px 4px; margin: 0; box-shadow: none; }
#teleprompter-list .teleprompter-header-row { display: none; }
#teleprompter-list .teleprompter-text { font-size: 0.85rem; line-height: 1.55; color: inherit; font-weight: 500; }
#teleprompter-list .teleprompter-line.selected { background: var(--accent-soft); }
.tp-word { padding: 0 2px; border-radius: 2px; color: var(--muted); cursor: pointer; }
.tp-word.tp-synced { color: var(--text); }
.tp-word.tp-next { outline: 1.5px solid var(--accent); outline-offset: 0; color: var(--accent-ink); }
.tp-word.tp-sung { background: var(--accent); color: var(--accent-text); }

.tap-btn.active { background: var(--record); border-color: var(--record); color: var(--accent-text); }

.text-apply { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.4rem; }

.start-sync-btn { border-color: var(--record); color: var(--record); }
.start-sync-btn.active { background: var(--record); color: var(--accent-text); }
.sync-speed { display: inline-flex; align-items: center; gap: 4px; font-size: 0.58rem; font-weight: 800; color: var(--muted-strong); }
.sync-speed input { width: 90px; accent-color: var(--accent); }
#lyric-speed-val { min-width: 2.4rem; font-family: monospace; color: var(--text); }

/* The Media strip under the stage (js/ui/mediaBin.js, js/ui/layout.js) */
#workspace-area { justify-content: flex-start; }
.media-strip { width: 100%; flex-shrink: 0; background: var(--panel); border-top: 1px solid var(--rule); display: flex; flex-direction: column; }
.media-strip-bar { display: flex; align-items: center; gap: 6px; padding: 4px 10px; cursor: pointer; user-select: none; }
.media-strip-bar:hover .media-strip-name { color: var(--accent-ink); }
.media-strip-name { font-size: 0.66rem; font-weight: 900; letter-spacing: 0.5px; color: var(--text); }
.media-strip .stage-tools { position: static; cursor: default; }
.media-strip-body { height: 150px; padding: 0 10px 8px; overflow: hidden; }
.media-strip.collapsed .media-strip-body { display: none; }
.media-strip .media-bin { flex-direction: row; overflow: hidden; height: 100%; gap: 10px; }
.media-strip .bin-section { flex: 1 1 0; min-width: 150px; display: flex; flex-direction: column; overflow: hidden; }
.media-strip .bin-items { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 1; }
.media-strip.drop-target { outline: 2px dashed var(--accent); outline-offset: -4px; }

/* Fold buttons: blue; a folded column is one tall strip reading its name (click anywhere on it) */
.fold-arrow, #middle-collapse-btn, #panel-collapse-btn {
  background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); cursor: pointer;
}
/* a folded column: the panel's beige, its name in dark text */
.fold-strip { background: var(--panel); color: var(--text); border: none; cursor: pointer; }
.fold-strip:hover { color: var(--accent-ink); }
.fold-strip .fold-arrow-text { color: var(--accent-text); background: var(--accent); border-radius: 2px; padding: 0 4px; }
.fold-arrow { width: 20px; height: 18px; padding: 0; font-size: 0.6rem; line-height: 1; border-radius: 2px; }
.fold-strip { width: 100% !important; height: 100%; display: flex !important; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; border-radius: 0; }
.fold-strip[style*="display: none"] { display: none !important; }
.fold-label { writing-mode: vertical-rl; font-size: 0.66rem; font-weight: 900; letter-spacing: 2px; }
.fold-arrow-text { font-size: 0.75rem; }
#teleprompter-panel.collapsed, #settings-panel.collapsed { padding: 0; }

/* Small tiles in the Media strip */
.media-strip .bin-item { width: 92px; flex: 0 0 auto; }
.media-strip .bin-thumb { width: 92px; height: 52px; }
.media-strip .bin-section h4 { margin: 0 0 4px; }

/* Words selected on the page (Apply Selected styles just these) */
.tp-word.tp-selected { outline: 1.5px solid var(--accent); outline-offset: 0; border-radius: 3px; color: var(--accent-ink); background: none; }
.tp-word.tp-selected.tp-sung { background: var(--accent); color: var(--accent-text); }
#teleprompter-list .teleprompter-line.selected { background: none; }
#teleprompter-list { user-select: none; }

/* Apply Selected · Apply All · Relative: one row under the tabs (Text and Text FX) */
.text-apply-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 0.5rem; }
.text-apply-row .action-btn { width: 100%; padding: 0.35rem 0.2rem; font-size: 0.6rem; white-space: nowrap; }

/* Sync tools on the Write | Sync line (only with Sync); the speed slider across underneath */
.lyric-views { flex-wrap: wrap; }
.lyric-sync-tools { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.sync-speed-wide { display: flex; width: 100%; }
.sync-speed-wide input { flex: 1; width: auto; }

/* A selected line: all its words boxed, the same as selected words */
#teleprompter-list .teleprompter-line.selected .tp-word { outline: 1.5px solid var(--accent); outline-offset: 0; border-radius: 3px; color: var(--accent-ink); }

/* One button shape everywhere (like Camera / Snap / Fit): a thin outline, slightly rounded corners.
   Buttons that are lit (on / chosen / Export / Play) keep their fill. */
.action-btn, .tool-btn, .insp-subtab, .fmt-btn, .reset-btn-danger, .btn.icon-btn, .mini-btn, .layer-move, .bar-select, .tempo-box {
  border-radius: 3px;
  border-width: 1px;
}
.action-btn:not(.active-mode):not(.active):not(.export-main-btn):not(.grid-active),
.tool-btn:not(.active):not(.export-main-btn),
.insp-subtab:not(.active),
.fmt-btn:not(.active) {
  background: transparent; border-color: var(--btn-line); color: var(--text-2); box-shadow: none;
}
.action-btn:hover, .tool-btn:hover, .insp-subtab:hover, .fmt-btn:hover { border-color: var(--accent); color: var(--accent-ink); }

/* The Lyrics column's steps and hint */
.lyric-steps { display: flex; align-items: center; gap: 4px; }
.lyric-step { background: none; border: none; padding: 2px 4px; font-size: 0.62rem; font-weight: 800; color: var(--muted); cursor: pointer; }
.lyric-step b { display: inline-flex; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid currentColor; align-items: center; justify-content: center; font-size: 0.55rem; margin-right: 3px; }
.lyric-step.current { color: var(--accent-ink); }
.lyric-step.done { color: var(--text); }
.lyric-step-arrow { color: var(--disabled); font-size: 0.6rem; }
.lyric-hint { font-size: 0.66rem; line-height: 1.4; color: var(--text); background: var(--raised); border-left: 3px solid var(--accent); padding: 5px 8px; }
.sync-keys { width: 100%; font-size: 0.55rem; color: var(--muted); }
.tp-empty .tp-empty-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* The word being sung: underlined (not filled) */
.tp-word.tp-sung, .tp-word.tp-selected.tp-sung { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
/* The Write tools: evenly spaced */
.lyric-tidy { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 4px; }
.lyric-tidy .mini-btn { justify-content: center; }
.lyric-steps { margin-bottom: 2px; }
.lyric-step { font-size: 0.7rem; }
/* Dividers: thinner; the one above the timeline stays when it's folded */
.divider-v { width: 2px; }
.divider-h { height: 2px; }
body.timeline-folded .divider-h { display: block; cursor: default; }
#timeline-fold-btn { width: 22px; height: 22px; font-size: 0.65rem; }
/* The user guide covers the whole canvas */
.start-guide { padding: 0; }
.guide-card { max-width: none; width: 100%; height: 100%; box-shadow: none; border-width: 0; padding: 7% 8%; display: flex; flex-direction: column; justify-content: center; }
.guide-title { font-size: 1rem; margin-bottom: 14px; }
.guide-steps { gap: 14px; }
.guide-steps li { font-size: 0.75rem; }
.guide-steps li b { font-size: 0.8rem; }

/* The Lyrics lane (js/ui/lyricLane.js): a ▼ per word's moment, under the Arrangement */
.lyric-lane-row { height: 24px; } /* (as tall as the Arrangement) */
.lyric-lane { overflow: hidden; background: var(--lane); touch-action: none; }
.lyric-mark {
  position: absolute; top: 3px; width: 0; height: 0; margin-left: -5px; cursor: ew-resize;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 9px solid var(--marker);
}
.lyric-mark::after { content: ""; position: absolute; left: -5px; top: -12px; width: 10px; height: 14px; } /* (an easier target) */
.lyric-mark.selected { border-top-color: var(--accent); z-index: 2; }

/* The old Write / Sync switches: the numbered steps do it now */
#lyric-write-btn[hidden], #lyric-sync-btn[hidden] { display: none !important; }

/* Labels on one line (never stacked): the Lyrics steps and the editor's tabs */
.lyric-step, .insp-subtab, .insp-tab { white-space: nowrap; }
/* The Write tools: two even rows — Paste · UPPER · lower · Title / Glitch · Split words · No empty lines (double width) */
.lyric-tidy { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lyric-tidy .mini-btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lyric-tidy #lyric-remove-empty { grid-column: span 2; }
/* The user guide's text grows and shrinks with the canvas, so it always fits (no scrolling) */
.start-guide { container-type: size; }
.guide-card { overflow: hidden; padding: 6cqh 7cqw; }
.guide-title { font-size: min(3.2cqh, 5.6cqw); margin-bottom: 2.2cqh; }
.guide-steps { gap: 2cqh; }
.guide-steps li { font-size: min(2.05cqh, 3.7cqw); gap: 1.6cqh; }
.guide-steps li b { font-size: min(2.3cqh, 4.1cqw); }
.guide-tick { flex-basis: min(3.2cqh, 5.6cqw); width: min(3.2cqh, 5.6cqw); height: min(3.2cqh, 5.6cqw); font-size: min(1.8cqh, 3.2cqw); }
.guide-close { font-size: min(3cqh, 5cqw); }

/* The Txt effects tab (js/ui/textFxPanel.js) */
.anim-slot { margin-top: 0.7rem; padding-top: 0.5rem; border-top: 1px solid var(--rule); }
.fx-head { display: block; font-size: 0.68rem; font-weight: 800; margin-bottom: 0.3rem; }
.fx-head span { text-transform: none; font-weight: 400; color: var(--muted); }
.fx-look .setting-group { margin-bottom: 0.25rem; }
.fx-look label, .anim-slot label { display: flex; align-items: center; gap: 0.3rem; }
.fx-colour { margin-left: auto; width: 1.6rem; height: 1.1rem; padding: 0; border: 1px solid var(--rule); background: none; cursor: pointer; }
.anim-note { margin: 0.1rem 0 0.3rem; font-size: 0.65rem; color: var(--muted-strong); line-height: 1.35; }

/* The Sessions pop-over (js/ui/sessionsPanel.js) */
.session-library { margin-bottom: 0.6rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--rule); }
.session-current { display: grid; grid-template-columns: auto 1fr auto; gap: 0.4rem; align-items: center; font-size: 0.7rem; }
.session-current label { font-weight: 800; font-size: 0.62rem; }
.session-current input { min-width: 0; font-size: 0.75rem; padding: 0.25rem 0.35rem; }
.session-status { font-size: 0.62rem; color: var(--ok); white-space: nowrap; }
.session-status.error { color: var(--record); }
.session-actions { margin-top: 0.4rem; }
.session-list { margin-top: 0.4rem; max-height: 220px; overflow-y: auto; border: 1px solid var(--rule); background: var(--raised); }
.session-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--rule-soft); }
.session-row:last-child { border-bottom: none; }
.session-row.open { background: var(--accent-soft); }
.session-open { flex: 1; min-width: 0; text-align: left; background: none; border: none; padding: 0.35rem 0.5rem; cursor: pointer; display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.72rem; }
.session-open b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-open span { color: var(--muted); font-size: 0.62rem; white-space: nowrap; }
.session-delete { background: none; border: none; cursor: pointer; padding: 0 0.5rem; opacity: 0.6; }
.session-delete:hover { opacity: 1; }
.session-empty { margin: 0.4rem 0.5rem; font-size: 0.68rem; color: var(--muted); }
.session-storage { margin-top: 0.3rem; font-size: 0.62rem; color: var(--muted); }
.looks-head { margin: 0.2rem 0 0.3rem; font-size: 0.68rem; }
.looks-head span { text-transform: none; font-weight: 400; color: var(--muted); }
.session-where { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.45rem; font-size: 0.65rem; color: var(--muted-strong); }
.session-where span { flex: 1 1 100%; font-weight: 700; }
.session-status.unsaved { color: var(--warn); }
.session-actions .action-btn { flex: 1; }

/* A question with buttons (js/ui/askDialog.js) */
.ask-back { position: fixed; inset: 0; z-index: 1000; background: rgba(17, 17, 17, 0.25); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.ask-box { background: var(--raised); border: 2px solid var(--line); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2); padding: 1rem 1.1rem; width: min(420px, 90vw); font-family: var(--font); }
.ask-title { margin: 0 0 0.35rem; font-weight: 800; font-size: 0.85rem; }
.ask-text { margin: 0 0 0.9rem; font-size: 0.72rem; color: var(--muted-strong); }
.ask-text:empty { display: none; }
.ask-buttons { display: flex; gap: 0.4rem; justify-content: flex-end; }
.ask-buttons .ask-main { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.export-note { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100; background: var(--solid); color: var(--accent-text); padding: 0.5rem 0.8rem; font-size: 0.72rem; font-family: var(--font); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2); }
.variations-head { font-size: 0.68rem; font-weight: 800; margin-bottom: 0.35rem; }
.variations-head span { text-transform: none; font-weight: 400; color: var(--muted); }

/* Batch export (js/ui/batchExport.js) */
.batch-export { margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.batch-head { margin: 0 0 0.35rem; font-size: 0.68rem; }
.batch-head span { text-transform: none; font-weight: 400; color: var(--muted); }
.batch-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.batch-sub { font-size: 0.6rem; font-weight: 800; color: var(--muted-strong); margin-bottom: 0.2rem; }
.batch-list { max-height: 150px; overflow-y: auto; font-size: 0.7rem; }
.batch-list .checkbox-group { margin: 0.1rem 0; }
.batch-go { width: 100%; margin-top: 0.5rem; }
.session-autosave { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; font-size: 0.65rem; font-weight: 700; }
.session-autosave select { font-size: 0.7rem; text-transform: none; }
.session-row { position: relative; }
.rename-box { position: absolute; inset: 2px 40px 2px 2px; font-size: 0.72rem; padding: 0 0.4rem; border: 1px solid var(--accent); z-index: 2; }

/* The Media strip's Media | Project tabs, and the Project view (js/ui/projectFiles.js) */
.strip-tabs { display: inline-flex; gap: 2px; }
.strip-tab { font-size: 0.66rem; font-weight: 900; letter-spacing: 0.5px; padding: 1px 7px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.strip-tab.active { color: var(--text); border-color: var(--line); background: var(--raised); }
.strip-tab:hover { color: var(--accent-ink); }
.project-files { height: 100%; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.project-files-head { font-size: 0.62rem; font-weight: 800; color: var(--muted-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-files-cols { display: flex; gap: 10px; flex: 1; min-height: 0; }
.project-files .bin-section { flex: 1 1 0; min-width: 120px; display: flex; flex-direction: column; overflow: hidden; }
.project-files .bin-section h4 { margin: 0 0 4px; }
.project-count { font-weight: 400; color: var(--muted); }
.project-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; flex: 1; }
.project-file { display: flex; align-items: center; gap: 5px; width: 100%; text-align: left; font-size: 0.64rem; padding: 2px 5px; border: 1px solid var(--rule); background: var(--raised); cursor: pointer; }
.project-file:hover { border-color: var(--accent); }
.project-icon { color: var(--accent-ink); flex: 0 0 auto; }
.project-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-size { flex: 0 0 auto; color: var(--muted); font-size: 0.58rem; }

/* Media → Audio: the song's ✕ (js/ui/mediaBin.js) */
.bin-audio-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bin-remove { flex: 0 0 auto; border: none; background: none; cursor: pointer; font-size: 0.7rem; color: var(--muted); padding: 0 2px; }
.bin-remove:hover { color: var(--record); }


/* The skin's texture (Print's paper grain) on the app's surfaces, one sheet across the window
   (fixed); never on the area around the video */
body, #teleprompter-panel, #settings-panel, #control-bar, .media-strip, .sticky-top-toolbar, .fold-strip, #timeline-ruler {
  background-image: var(--texture);
  background-attachment: fixed;
  background-size: 240px 240px, cover, auto, auto;
  background-blend-mode: soft-light;
}
#workspace-area .canvas-wrapper { background: var(--stage); }
/* The skin picker (stage tools) */
/* The skin menu: reads "Skin"; the real menu sits invisibly on top of it */
.skin-pick { position: relative; }
.skin-pick select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
/* The Song track's on / off button: off = silent while you work (exports keep the song) */
.song-row.song-off #timeline { opacity: 0.4; }
/* Sliders take the skin's accent (not the browser's blue) */
input[type="range"] { accent-color: var(--accent); }

/* Track colours (the DAW skins): a selected clip keeps its colour with the accent round it, and
   each track's header has a strip of its kind's colour; Media strip tiles are edged the same */
:root:not([data-skin="electric"]) .track-bar.selected { background: var(--bar-bg); color: var(--bar-text); border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
:root:not([data-skin="electric"]) .track-bar.selected .bar-name { background: var(--accent); color: var(--accent-text); }
.track-video { --type: var(--clip-video); }
.track-image { --type: var(--clip-image); }
.track-text { --type: var(--clip-text); }
.track-camera { --type: var(--clip-camera); }
.track-background { --type: var(--clip-background); }
.arrangement-row { --type: var(--clip-section); }
.lyric-lane-row { --type: var(--clip-lyrics); }
.song-row { --type: var(--clip-song); }
.track-row > .track-head { box-shadow: inset var(--type-strip) 0 0 var(--type, transparent); }
:root:not([data-skin="electric"]) .bin-kind-video .bin-item { border-color: var(--clip-video); }
:root:not([data-skin="electric"]) .bin-kind-image .bin-item { border-color: var(--clip-image); }
:root:not([data-skin="electric"]) .bin-kind-audio .bin-audio { border-left: 4px solid var(--clip-song); }

/* Quick notes on hover (js/ui/tooltips.js) */
.tip {
  position: fixed; z-index: 3000; pointer-events: none; max-width: 300px; padding: 4px 7px; border-radius: 3px;
  background: var(--solid); color: var(--solid-text); font: 600 11px/1.35 var(--font); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.tip[hidden] { display: none; }

/* Arrangement off: sections greyed, their headers gone from the lyrics */
body.sections-off .arrangement-lane .arr-section { opacity: 0.3; }
body.sections-off .tp-section { display: none; }
body.sections-off .teleprompter-line.in-section { border-left-color: transparent; }

/* Track headers split like Ableton's: the name, a thin line, then the track's controls, the line in
   the same place on every track */
.track-head.layer-row, .ruler-head { width: 236px; }
.track-head.layer-row { position: relative; }
.track-head.layer-row::after { content: ""; position: absolute; top: 0; bottom: 0; left: 128px; width: 1px; background: var(--rule); pointer-events: none; }
.track-head.layer-row > .layer-name { flex: 0 0 auto; width: 92px; margin-right: 8px; }

/* Fold buttons, all one size (Lyrics, Editor, Media, Timeline; open or folded) with the same « » arrows;
   Media's and the Timeline's turned on their side, and lined up */
#middle-collapse-btn, #panel-collapse-btn, .fold-strip .fold-arrow-text, #media-strip-toggle, #timeline-fold-btn {
  width: 20px !important; height: 18px !important; min-height: 18px; padding: 0 !important; box-sizing: border-box; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem !important; line-height: 1; border-radius: 2px;
}
.fold-glyph { display: inline-block; transform: rotate(90deg); }
.media-strip-bar { padding-left: 1rem; }

/* The tempo question when a song comes in */
.tempo-ask-row { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.9rem; }
.tempo-ask-row .tempo-box { width: 5rem; font-size: 1rem; padding: 0.35rem; }

/* The Lyrics and Editor arrows sit at one height, open or folded */
.middle-tabs #middle-collapse-btn { align-self: flex-start; margin-top: 4px; }
.fold-strip { padding-top: 20px !important; }
/* Variations stays one line inside its box */
#variations-btn { white-space: nowrap; flex-shrink: 0; }
/* Fold buttons take --fold / --fold-text (the accent, but a soft grey in Electric) */
.fold-arrow, #middle-collapse-btn, #panel-collapse-btn, .fold-strip .fold-arrow-text { background: var(--fold); color: var(--fold-text); border-color: var(--fold); }

/* The Write tools: two rows of four, all one size: Paste · UPPER · lower · Title / Glitch · Split Words · No Empty Lines · Upload */
.lyric-tidy { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.lyric-tidy > *, .lyric-tidy #lyric-remove-empty, .lyric-tidy #lyric-upload { grid-column: span 1; justify-content: center; }
.lyric-tidy .mini-btn { display: block; text-align: center; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The Media tab: the same look as the buttons on its row */
.strip-tab, .strip-tab.active { height: 18px; padding: 0 5px; box-sizing: border-box; border: 1px solid var(--btn-line); border-radius: 3px;
  background: transparent; color: var(--text-2); font-size: 0.58rem; font-weight: 700; letter-spacing: 0; line-height: 16px; display: inline-flex; align-items: center; }

/* Track on / off buttons: grey when on, empty when off (every skin) */

/* The Arrangement's ＋ at the right, lined up with the Song track's */
.arrangement-head #arrangement-add { margin-left: auto; }
#arrangement-add, .song-head .song-replace { width: 18px !important; flex: 0 0 18px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
.song-head .drag-box { min-width: 3rem; } /* (room for the ＋, lined up with the Arrangement's) */
.song-head .song-replace { margin-left: auto; }

/* The Media strip: Audio narrower, more room for Video and Image */
.media-strip .bin-section.bin-kind-audio { flex: 0.55 1 0; min-width: 120px; }

/* Thin arrows at a bar's ends while there's more to scroll to (js/ui/scrollHints.js): small blue boxes */
.scroll-hints { position: relative; flex-shrink: 0; }
.scroll-hint {
  position: absolute; top: 50%; transform: translateY(-50%); width: 12px; height: var(--tool-h, 26px); z-index: 5; padding: 0;
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 2px; cursor: pointer;
  background: var(--fold); color: var(--fold-text); font-size: 0.75rem; font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 3px var(--panel); /* (a little gap from what scrolls under it) */
}
.scroll-hint[hidden] { display: none; }
.scroll-hint-left { left: 0; }
.scroll-hint-right { right: 0; }
/* The Media strip's bar scrolls sideways too (one line, never squashed; no arrows) */
#media-strip-bar { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; flex-wrap: nowrap; }
#media-strip-bar::-webkit-scrollbar { display: none; }
#media-strip-bar > *, #media-strip-bar .stage-tools > * { flex-shrink: 0; }
#media-strip-bar .bar-spacer { flex: 1 0 8px; }
.strip-tab[hidden] { display: none; }

/* The install card (js/ui/install.js), bottom right */
.install-card {
  position: fixed; right: 16px; bottom: 16px; z-index: 900; width: min(320px, calc(100vw - 32px)); padding: 0.9rem 1rem;
  background: var(--raised); color: var(--text); border: 2px solid var(--accent); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.18); font-family: var(--font);
}
.install-title { margin: 0 0 0.3rem; font-weight: 800; font-size: 0.85rem; }
.install-text { margin: 0 0 0.8rem; font-size: 0.72rem; color: var(--muted-strong); line-height: 1.4; }
.install-buttons { display: flex; gap: 0.4rem; justify-content: flex-end; }
.ask-buttons .ask-main { background: var(--accent) !important; color: var(--accent-text) !important; border-color: var(--accent) !important; }

/* Sessions ▴: install the app; the browser it's best in */
.session-app { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.session-app-note { font-size: 0.62rem; color: var(--muted-strong); }
/* The user guide's note */
.guide-note { margin-top: 2.2cqh; font-size: min(1.8cqh, 3.2cqw); color: var(--muted-strong); }

/* Looks, at the top of the editor: Looks ▾ · Save Look… · Delete */
.looks-row { display: flex; align-items: center; gap: 4px; margin: -0.2rem 0 0.2rem; flex-shrink: 0; }
.looks-row select { flex: 1; min-width: 0; height: 22px; padding: 0 0.3rem; font: 700 0.66rem var(--font); background: var(--raised); color: var(--text); border: 1px solid var(--btn-line); border-radius: 3px; }
.looks-row .mini-btn { height: 22px; flex-shrink: 0; }
#settings-panel.collapsed .looks-row { display: none; }
/* ↺ Reset … to Default, at the bottom of the editor */
.insp-reset-row { margin-top: 1rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.insp-reset-row .action-btn { width: 100%; }
#settings-panel.collapsed .insp-reset-row { display: none !important; }

/* ⚙ Settings (js/ui/settingsWindow.js): the cog at the top left of the stage area, and the window */
.settings-btn { position: absolute; top: 8px; left: 8px; z-index: 70; width: 26px; height: 22px; padding: 0; border-radius: 3px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); font-size: 0.9rem; line-height: 1; cursor: pointer; }
.set-back { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; }
.set-window { width: min(760px, calc(100vw - 32px)); height: min(560px, calc(100vh - 32px)); display: flex; flex-direction: column;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35); overflow: hidden; font-family: var(--font); }
.set-title { position: relative; flex-shrink: 0; padding: 9px 12px; text-align: center; font-weight: 800; font-size: 0.85rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.set-close { position: absolute; left: 10px; top: 6px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--record); color: #fff; font-size: 0.65rem; cursor: pointer; }
.set-body { flex: 1; display: flex; min-height: 0; }
.set-nav { width: 170px; flex-shrink: 0; padding: 8px 0; background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto; }
.set-nav-item { display: block; width: 100%; padding: 8px 16px; border: 0; background: none; color: var(--text); font: 700 0.75rem var(--font); text-align: left; cursor: pointer; }
.set-nav-item:hover { color: var(--accent-ink); }
.set-nav-item.active { background: var(--raised); color: var(--accent-ink); }
.set-pane { flex: 1; overflow-y: auto; padding: 6px 20px 20px; }
.set-heading { display: flex; align-items: center; gap: 10px; margin: 16px 0 8px; font-size: 0.75rem; font-weight: 800; }
.set-heading::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.set-row { display: grid; grid-template-columns: 1fr 200px; align-items: center; gap: 4px 16px; padding: 4px 0; font-size: 0.72rem; font-weight: 600; }
.set-control { display: flex; justify-content: flex-start; }
.set-note { grid-column: 1 / -1; font-size: 0.62rem; color: var(--muted); font-weight: 500; margin-top: -2px; }
.set-text { margin: 4px 0; font-size: 0.7rem; color: var(--muted-strong); line-height: 1.4; }
.set-select, .set-number { width: 100%; height: 24px; padding: 0 6px; font: 700 0.7rem var(--font); background: var(--raised); color: var(--text); border: 1px solid var(--btn-line); border-radius: 3px; }
.set-range { width: 100%; }
.set-toggle { min-width: 70px; height: 22px; border: 1px solid var(--btn-line); border-radius: 3px; background: var(--raised); color: var(--text); font: 700 0.7rem var(--font); cursor: pointer; }
.set-toggle.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.set-row kbd { font: 700 0.7rem var(--font); padding: 2px 7px; border: 1px solid var(--btn-line); border-radius: 3px; background: var(--raised); }
.set-pane .session-library, .set-borrowed { display: flex; flex-direction: column; gap: 0.5rem; }
.set-pane .action-btn { padding: 0.4rem 0.8rem; }

/* Sessions, Export, User Guide and Skin live in ⚙ Settings now: their old buttons are hidden (kept in
   the page: Settings borrows their panels, and the tests use them) */
#sessions-btn, #export-btn, #guide-btn, .skin-pick, .old-pop-btns { display: none !important; }

/* A selected picture's frame and handles show past the canvas's edges (like Canva), with the
   picture faint out there (js/ui/mediaFrame.js); the export only ever has what's inside */
#workspace-area #visualizer-stage { overflow: visible !important; }
.media-ghost { position: absolute; z-index: 1; opacity: 0.3; pointer-events: none; display: none; }
#media-frame { z-index: 30; }

/* The export's progress card, bottom right (js/ui/exportProgress.js) */
.export-card { position: fixed; right: 16px; bottom: 16px; z-index: 1200; width: min(320px, calc(100vw - 32px)); padding: 0.75rem 0.9rem;
  background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); font-family: var(--font); }
.export-card-head { display: flex; align-items: center; gap: 0.5rem; }
.export-card-title { flex: 1; min-width: 0; font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.export-card-stop { flex: 0 0 auto; padding: 0.2rem 0.6rem !important; }
.export-card-detail { margin: 0.35rem 0; font-size: 0.68rem; color: var(--muted-strong); }
.export-card-bar { height: 6px; border-radius: 3px; background: var(--rule-soft); overflow: hidden; }
.export-card-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.export-card-bar.thin { height: 3px; margin-top: 0.25rem; }
.export-card-batch { margin-top: 0.55rem; font-size: 0.62rem; color: var(--muted); }
#render-modal { display: none !important; } /* (the old bottom bar: the card says it now) */

/* Clips like Ableton's (js/ui/layerTracks.js): a title strip in the clip's colour with its name, a
   lighter body under it (the thumbnails), square corners, a thin darker edge; notches where a
   looping clip starts again; a video's end handle loops (top half) or trims (lower half) */
#layer-tracks .track-bar { border-radius: 0; padding: 0; background: color-mix(in srgb, var(--bar-bg, var(--raised)) 55%, var(--lane)); border: 1px solid var(--clip-edge); }
#layer-tracks .track-bar .bar-name { left: 0; right: 0; top: 0; max-width: none; height: 13px; line-height: 13px; padding: 0 4px;
  background: var(--bar-bg, var(--raised)); color: var(--bar-text, var(--text)); border-bottom: 1px solid var(--clip-edge); font-weight: 700; }
#layer-tracks .track-bar .bar-thumbs { top: 13px; height: calc(100% - 13px); opacity: 0.85; }
#layer-tracks .track-bar.text { display: block; }
#layer-tracks .track-bar.selected { box-shadow: inset 0 0 0 2px var(--accent); }
#layer-tracks .track-bar.selected .bar-name { background: var(--accent); color: var(--accent-text); }
.loop-seam { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--clip-edge); pointer-events: none; z-index: 1; }
.loop-repeat { position: absolute; top: 13px; bottom: 0; background: rgba(0, 0, 0, 0.16); pointer-events: none; }
.trim-handle.loop-zone { cursor: alias; }
.trim-handle.loop-zone .trim-grip { background: var(--accent); }
.track-rename { flex: 0 0 auto; width: 92px; margin-right: 8px; font: 700 0.62rem var(--font); padding: 1px 3px; border: 1px solid var(--accent); background: var(--input); color: var(--text); }

/* ↺ at the end of the editor's sub-tabs: that tab back to its defaults */
.insp-tab-reset { flex: 0 0 26px; border: 1px solid var(--btn-line); border-radius: 3px; background: transparent; color: var(--text-2); cursor: pointer; font-size: 0.8rem; }
.insp-tab-reset:hover { border-color: var(--accent); color: var(--accent-ink); }
#layer-tracks .track-row { height: 52px; } /* (new tracks: as tall as the Song track; drag the bottom edge to change) */

/* Nothing selected (a click on the empty canvas or around it): no frames until something is clicked */
#visualizer-stage.deselected .universal-stage-container { border-color: transparent !important; pointer-events: none !important; }
#visualizer-stage.deselected .universal-stage-container .stage-resize-handle { display: none !important; }

/* (hidden rows stay hidden, whatever their own display says) */
.export-range-row[hidden], .action-btn-row[hidden] { display: none !important; }

/* Right-click a clip (js/ui/layerTracks.js): Lock / Duplicate / Delete; a locked clip */
.clip-menu { position: fixed; z-index: 1300; min-width: 150px; padding: 4px 0; background: var(--raised); color: var(--text); border: 1px solid var(--line);
  border-radius: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); font: 600 0.72rem var(--font); }
.clip-menu button { display: block; width: 100%; padding: 5px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; white-space: pre; }
.clip-menu button:hover:not(:disabled) { background: var(--accent); color: var(--accent-text); }
.clip-menu button:disabled { color: var(--muted); cursor: default; }
#layer-tracks .track-bar.locked { cursor: not-allowed; }
#layer-tracks .trim-handle.locked { pointer-events: none; }
/* a muted clip (0): greyed, like Ableton's deactivated clips */
#layer-tracks .track-bar.muted { filter: grayscale(1); opacity: 0.45; }

/* Clean clips: no arrowheads on their trim handles; the handle's line only shows on hover */
#layer-tracks .trim-grip::after { display: none !important; }
#layer-tracks .trim-handle .trim-grip { background: transparent; }
#layer-tracks .trim-handle:hover .trim-grip { background: var(--accent); }

/* Trim handles straddle the clip's edge (half inside, half outside), easier to catch */
#layer-tracks .trim-start { margin-left: -6px; }
#layer-tracks .trim-end { margin-left: -6px; }
#layer-tracks .trim-start .trim-grip { right: 5px; }
#layer-tracks .trim-end .trim-grip { left: 5px; }
/* A video's loop corner (js/ui/layerTracks.js): top right of its title strip, shown on hover */
#layer-tracks .loop-corner { position: absolute; top: 0; right: 4px; height: 13px; line-height: 13px; padding: 0 3px; font-size: 11px; font-weight: 700;
  color: var(--accent-text); background: var(--accent); border-radius: 0 0 3px 3px; cursor: alias; opacity: 0; z-index: 2; touch-action: none; }
#layer-tracks .track-bar:hover .loop-corner, #layer-tracks .track-bar.selected .loop-corner { opacity: 1; }
/* A clip's body selects time (like Ableton); its title strip moves it */
#layer-tracks .track-bar:not(.whole) { cursor: text; }
#layer-tracks .track-bar:not(.whole) .bar-name { cursor: grab; }
/* Apply Selected / All lives in the Lyrics column now ("Selected Words Only"); always relative */
#insp-text-apply { display: none !important; }
#selected-only-btn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
/* A text overlay's format, under its text box in the Lyrics column (js/ui/overlayPanel.js) */
.overlay-heading { margin: 0.7rem 0 0.25rem; padding-top: 0.45rem; border-top: 1px solid var(--line); font: 700 0.68rem var(--font); color: var(--text); }
#middle-overlay { overflow-y: auto; }
/* Turning a picture / clip / text on the canvas (js/ui/mediaFrame.js): just outside each corner,
   and a ↻ knob under the middle (like Canva) */
.media-frame { transform-origin: 50% 50%; }
.rotate-zone { position: absolute; width: 22px; height: 22px; cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='M19 12a7 7 0 1 1-2.05-4.95' fill='none' stroke='white' stroke-width='4' stroke-linecap='round'/><path d='M19 12a7 7 0 1 1-2.05-4.95' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/><path d='M20 3v6h-6z' fill='black' stroke='white' stroke-width='1'/></svg>") 12 12, alias; }
.rotate-tl { left: -24px; top: -24px; } .rotate-tr { right: -24px; top: -24px; }
.rotate-bl { left: -24px; bottom: -24px; } .rotate-br { right: -24px; bottom: -24px; }
.rotate-knob { position: absolute; left: 50%; bottom: -30px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%;
  background: var(--raised); color: var(--text); border: 1px solid var(--accent); font: 700 13px/18px var(--font); text-align: center; cursor: grab; box-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.media-frame:not(:hover):not(.dragging) .rotate-knob { opacity: 0; }
.rotate-badge { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(var(--unturn, 0deg)); padding: 2px 6px; border-radius: 3px;
  background: var(--accent); color: var(--accent-text); font: 700 11px var(--font); pointer-events: none; white-space: nowrap; }

/* Selected, like Ableton (js/ui/layerTracks.js): a track (its header clicked) lights its header in
   the highlight colour and its lane a little lighter; a clip (the clip clicked) fills its title */
#layer-tracks .track-head.layer-row.selected { border: 1px solid var(--line); border-right-width: 2px; background: var(--raised); }
#layer-tracks .track-row.selected-track > .track-head.layer-row { background: var(--select); color: var(--select-text); }
#layer-tracks .track-row.selected-track > .track-head.layer-row .layer-name { color: var(--select-text); }
#layer-tracks .track-row.selected-track .track-lane { background: color-mix(in srgb, var(--raised), white 30%); }
#layer-tracks .track-bar.selected { box-shadow: inset 0 0 0 2px var(--select); }
#layer-tracks .track-bar.selected .bar-name { background: var(--select); color: var(--select-text); }
/* The text overlay's bubble buttons and alignment pictures (js/ui/overlayPanel.js) */
.bubble-buttons { display: flex; flex-wrap: wrap; gap: 4px; }
.bubble-btn { width: auto !important; padding: 0 8px; font-size: 0.66rem; }
.align-btn svg { display: block; margin: auto; }
#caption-content { resize: none; overflow: hidden; min-height: 1.6rem; }
/* An effect's one slider, on its line (js/ui/effectsPanel.js) */
.effect-head .effect-vibe { flex: 0 1 110px; width: 110px; min-width: 60px; margin: 0 8px 0 auto; accent-color: var(--accent); }
.effect-off .effect-vibe { opacity: 0.55; }
/* A fold in the editor (Basic → Size & Position) */
.insp-fold { margin: 0.4rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 0.25rem 0; }
.insp-fold > summary { cursor: pointer; font: 700 0.68rem var(--font); color: var(--text); padding: 0.2rem 0; list-style: none; }
.insp-fold > summary::before { content: "▸ "; color: var(--muted); }
.insp-fold[open] > summary::before { content: "▾ "; }
.insp-fold > summary::-webkit-details-marker { display: none; }
#media-replace-btn[hidden] { display: none !important; }
/* The FX tab's one row: Presets ▾ · Save Preset… · 🎲, and the Presets list (js/ui/effectsPanel.js).
   The Presets button looks like the menus it replaced (same box, a chevron at the right). */
.fx-preset-row { display: flex; gap: 0.3rem; align-items: stretch; margin-top: 0; }
.fx-preset-pick { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.fx-preset-row .fx-preset-button, #looks-row .fx-preset-button { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--raised) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23777' stroke-width='1.5'/></svg>") no-repeat right 7px center;
  color: var(--text); border: 1px solid var(--line); border-radius: 0; padding: 0.3rem 22px 0.3rem 0.3rem; font-size: 0.7rem; font-weight: 700; cursor: pointer; }
.fx-preset-row #fx-preset-save { flex: 0 0 auto; white-space: nowrap; }
.fx-preset-row .fx-dice { flex: 0 0 auto; padding: 0.3rem 0.5rem; font-size: 0.65rem; line-height: inherit; }
.fx-preset-list { position: absolute; left: 0; right: -120px; top: calc(100% + 3px); z-index: 1200; max-height: 360px; overflow-y: auto; padding: 4px 0;
  background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); }
.fx-preset-heading { padding: 6px 10px 3px; font: 700 0.64rem var(--font); color: var(--muted); }
.fx-preset-item { display: flex; align-items: center; }
.fx-preset-item.picked { background: var(--select); color: var(--select-text); }
.fx-preset-name { flex: 1; border: 0; background: none; color: inherit; font: 600 0.72rem var(--font); text-align: left; padding: 5px 10px 5px 16px; cursor: pointer; }
.fx-preset-item:hover { background: var(--accent); color: var(--accent-text); }
.fx-preset-delete { border: 0; background: none; cursor: pointer; padding: 2px 8px; font-size: 0.8rem; opacity: 0.7; }
.fx-preset-delete:hover { opacity: 1; }
.fx-preset-empty { padding: 4px 16px 8px; font: italic 0.66rem var(--font); color: var(--muted); }
.nothing-shown { display: none !important; }
/* Image / Video FX: the Adjust section (Light, Colour with Colour tint inside) above the Effects */
.effects-heading { margin: 0.5rem 0 0.1rem; font: 700 0.7rem var(--font); color: var(--text); }
.effect-card.effect-adjust.effect-off .setting-group, .effect-card.effect-adjust.effect-off .effect-toggle { opacity: 1; }
.effect-card.effect-adjust .effect-name { color: var(--text); }
.effect-card.effect-inside { margin: 0.2rem 0 0 0.6rem; padding-left: 0.5rem; border-left: 2px solid var(--rule); border-bottom: 0; }
.effect-segment { display: flex; gap: 4px; }
.effect-segment .fmt-btn { flex: 1; width: auto; }
/* (sliders that are 0 in the middle: a little mark there) */
.effect-adjust input[type="range"][min="-100"] { background: linear-gradient(var(--muted), var(--muted)) no-repeat center / 1px 9px; }
/* The FX row lines up with the sub-tabs above it: Presets under the first two, Save Preset… under
   the third, 🎲 under ↺ */
#insp-fx .fx-preset-row { display: grid; grid-template-columns: 1fr 1fr 1fr 26px; gap: 0.3rem; }
#insp-fx .fx-preset-pick { grid-column: 1 / span 2; }
#insp-fx .fx-preset-row #fx-preset-save, #insp-fx .fx-preset-row .fx-dice { width: 100%; min-width: 0; padding-left: 0; padding-right: 0; overflow: hidden; text-overflow: ellipsis; }
/* The sync tools fill the column's width (between the blue lines) */
.lyric-views .lyric-sync-tools { display: flex; flex: 1 1 100%; width: 100%; margin-left: 0; }
.lyric-views .lyric-sync-tools > * { flex: 1 1 auto; justify-content: center; white-space: nowrap; }
.lyric-views .lyric-sync-tools .sync-speed { flex: 0 0 auto; }

/* ---- The editor's boxes, all alike (2026-10-24): the size, corners and border of the Basic /
   Image FX / Background tabs — 26 px tall, 3 px corners, a 1 px outline */
#settings-panel :is(.action-btn, .mini-btn, .fmt-btn, .layer-move.effect-reset, .insp-picker, .fx-preset-button, select, input[type="text"], input[type="number"], input[type="color"]) {
  height: 26px; min-height: 26px; box-sizing: border-box; border: 1px solid var(--btn-line); border-radius: 3px; }
#settings-panel :is(.action-btn, .mini-btn, .fmt-btn) { padding-top: 0; padding-bottom: 0; font-size: 0.66rem; font-weight: 800; line-height: 24px; }
#settings-panel :is(select, .insp-picker, .fx-preset-button, input[type="text"], input[type="number"]) { background-color: var(--raised); font: 700 0.66rem var(--font); }
#settings-panel :is(.action-btn.active-mode, .fmt-btn.active) { border-color: var(--accent); }
#settings-panel .layer-move.effect-reset { width: 26px; flex: 0 0 26px; font-size: 0.8rem; background: transparent; }
#settings-panel input[type="color"] { padding: 2px; cursor: pointer; }
#settings-panel .fx-colour { height: 20px; min-height: 20px; width: 26px; } /* (a colour box inside a slider's label line) */
/* The Text tab's presets row lines up with its tabs: menu under the first two, Save Preset… under
   the third, 🗑 under ↺ */
#looks-row.looks-row { display: grid; grid-template-columns: 1fr 1fr 1fr 26px; gap: 0.3rem; }
#looks-row #section-preset-select { grid-column: 1 / span 2; width: 100%; min-width: 0; }
#looks-row .mini-btn { width: 100%; min-width: 0; padding-left: 0; padding-right: 0; }
/* Shadow's Soft · Hard · Long */
.fx-shadow-styles { display: flex; gap: 0.3rem; margin: -0.15rem 0 0.2rem; }
.fx-shadow-styles .fmt-btn { flex: 1; width: auto; }
.insp-subtabs > .insp-subtab { flex: 1 1 0; min-width: 0; } /* (equal widths, so the rows below line up exactly) */
#settings-panel input[type="file"] { height: 26px; box-sizing: border-box; border: 1px solid var(--btn-line); border-radius: 3px; padding: 2px; font: 700 0.62rem var(--font); background: var(--raised); }
/* (the Text tab's row: Presets ▾ under the first two tabs, Save Preset… across the rest) */
#looks-row .fx-preset-pick { grid-column: 1 / span 2; }
#looks-row #section-preset-save { grid-column: 3; text-align: center; justify-content: center; } /* (as wide as the third tab, like the FX row) */
#looks-row #section-preset-delete { display: none !important; } /* (delete is in the list now) */
#looks-row #section-preset-random { grid-column: 4; padding: 0; font-size: 0.65rem; } /* (🎲 under ↺, like the FX row) */
