/* GetMixable - single-screen workspace: files on the left, the current step (with its own
   controls) filling the rest. Dark, booth-style theme on top of Bootstrap 4. */
:root {
	color-scheme: dark;
	--bg: #101216;
	--rail: #14171c;
	--panel: #181b21;
	--edge: #272b34;
	--well: #0c0e11;
	--text: #e8eaee;
	--muted: #9aa1b0;
	--accent: #ff6a2b;
	--accent-soft: rgba(255, 106, 43, 0.22);
	--phrase: #2ecc71;
	--boost: #4da3ff;
	--body-wave: #e2c5b8;
	--kick: #ff6a2b;
	--tops: #f2c14e;
	--bass: #4da3ff;
	--other: #b58cff;
	--vocals: #2ecc71;
	--playhead: #a6ff2e;
}
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; overflow: hidden; }

/* ---- frame */
.app { display: flex; height: 100vh; min-width: 1000px; }
.rail { width: 250px; flex: none; background: var(--rail); border-right: 1px solid var(--edge); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.stage { flex: 1; min-width: 0; padding: 16px 22px 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }

.gm-logo { display: inline-flex; align-items: center; gap: 9px; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.gm-logo img { flex: none; border-radius: 7px; }
.rail-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#rail-toggle { display: none; }
.rail-lists { display: flex; flex-direction: column; gap: 14px; }
.gm-logo:hover { color: var(--text); text-decoration: none; }
.gm-logo .word > span { color: var(--accent); }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }
h2 small { color: var(--muted); font-size: 0.85rem; margin-left: 8px; overflow-wrap: anywhere; }
h3 { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 8px; }
.gm-hint { color: var(--muted); font-size: 0.86rem; }
.gm-label, .field label { font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.gm-check { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--text) !important; cursor: pointer; min-height: 28px; }
.gm-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.gm-empty { border: 1px dashed var(--edge); border-radius: 8px; padding: 40px; text-align: center; color: var(--muted); }

/* ---- rail */
.btn-add { border: 1px dashed #4a5263; color: var(--text); padding: 10px; border-radius: 6px; cursor: pointer; }
.btn-add:hover { border-color: var(--accent); color: var(--text); }
.rail-list { display: flex; flex-direction: column; gap: 2px; }
.rail-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 9px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; }
.rail-row:hover { background: #1e222a; }
.rail-row.active { background: #1e222a; border-color: var(--accent); }
.rail-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-row .meta { color: var(--muted); font-size: 0.78rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rail-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--phrase); flex: none; }
.rail-row .gm-delete { color: var(--muted); padding: 0 2px; border: 0; background: none; font-size: 1.1rem; line-height: 1; visibility: hidden; }
.rail-row:hover .gm-delete { visibility: visible; }
.rail-row .gm-delete:hover { color: #ff6b6b; }

/* ---- step selector */
.steps { list-style: none; display: flex; gap: 0; margin: 0; padding: 0; border: 1px solid var(--edge); border-radius: 8px; background: var(--panel); overflow: hidden; flex: none; }
.steps li { flex: 1; }
.steps li + li { border-left: 1px solid var(--edge); }
.steps button { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: transparent; color: var(--text); font-size: 0.9rem; padding: 0 8px; }
.steps button:hover:not(:disabled) { background: #1e222a; }
.steps button:disabled { color: #5d6678; cursor: default; }
.steps .n { width: 22px; height: 22px; line-height: 22px; border-radius: 50%; background: #2a2f39; font-size: 0.78rem; font-weight: 700; flex: none; }
.steps button.done .n { background: var(--phrase); color: #0c1a12; }
.steps button.current { background: #22262e; box-shadow: inset 0 -3px 0 var(--accent); font-weight: 700; }
.steps button.current .n { background: var(--accent); color: #14100d; }

/* ---- panes */
.pane { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--edge); border-radius: 10px; padding: 18px 20px; flex: 1 0 auto; }
.pane-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.gm-drop { border: 2px dashed var(--edge); border-radius: 8px; padding: 60px 26px; text-align: center; transition: border-color 0.15s, background 0.15s; }
.gm-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.gm-facts { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.gm-facts div { font-variant-numeric: tabular-nums; }
.gm-facts b { display: block; color: var(--muted); font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.gm-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gm-time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 60px; }
.gm-keys { margin-left: auto; font-size: 0.78rem; }
.zoom-btn { min-width: 38px; }
.gm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 0.8rem; color: #c3c8d2; }
.gm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gm-legend i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }

/* ---- waveforms */
.gm-wave-wrap { position: relative; }
.gm-wave { background: var(--well); border: 1px solid var(--edge); border-radius: 6px 6px 0 0; min-height: 112px; cursor: pointer; }
#mix-wave { border-radius: 6px; }
.gm-wave.gm-wave-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.gm-wave ::part(region-content) { font-size: 11px; padding: 2px 5px; color: #d8f5e4; white-space: nowrap; overflow: hidden; }

/* Region ends: a line on the exact start/end point, carets top and bottom, and a grip to drag.
   wavesurfer draws regions in a shadow tree, hence ::part. */
.gm-wave ::part(region-handle) { width: 16px !important; border-radius: 0 !important; cursor: ew-resize; }
.gm-wave ::part(region-handle-left) { border-left: 2px solid var(--accent) !important; }
.gm-wave ::part(region-handle-right) { border-right: 2px solid var(--accent) !important; }
.gm-wave ::part(region-handle)::after {
	content: ""; position: absolute; top: 0; bottom: 0; width: 16px; background: var(--accent);
	clip-path: polygon(0 0, 100% 0, 50% 9px, 50% calc(100% - 9px), 100% 100%, 0 100%, 50% calc(100% - 9px), 50% 9px);
}
.gm-wave ::part(region-handle)::before {
	content: ""; position: absolute; top: 50%; width: 12px; height: 40px; margin-top: -20px; border-radius: 4px;
	background: var(--accent) repeating-linear-gradient(to bottom, transparent 0 4px, rgba(20, 16, 13, 0.55) 4px 6px) center / 6px 22px no-repeat;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.gm-wave ::part(region-handle-left)::after { left: -9px; }
.gm-wave ::part(region-handle-right)::after { right: -9px; }
.gm-wave ::part(region-handle-left)::before { left: 0; }
.gm-wave ::part(region-handle-right)::before { right: 0; }
.gm-wave ::part(region-handle):hover::before { background-color: #ff8450; height: 48px; margin-top: -24px; }

/* ---- phrases over a waveform, and the bar ruler under it */
.gm-phrase-lines { position: absolute; top: 1px; bottom: 1px; left: 1px; right: 1px; overflow: hidden; pointer-events: none; z-index: 3; }
.gm-phrase { position: absolute; top: 0; bottom: 0; box-sizing: border-box; }
.gm-phrases-bands .gm-phrase, .gm-phrases-both .gm-phrase { background: rgba(0, 0, 0, 0.22); }
.gm-phrases-bands .gm-phrase.alt, .gm-phrases-both .gm-phrase.alt { background: rgba(255, 255, 255, 0.13); }
.gm-phrases-carets .gm-phrase.starts { border-left: 1px solid rgba(46, 204, 113, 0.45); }
.gm-phrases-carets .gm-phrase.starts::before { content: ""; position: absolute; top: 0; left: -6px; width: 11px; height: 7px; background: var(--phrase); clip-path: polygon(0 0, 100% 0, 50% 100%); }
/* where another track overlaps a mixed end */
.gm-hatch { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(77, 163, 255, 0.2) 0 6px, transparent 6px 12px); }

.gm-ruler { position: relative; height: 24px; background: var(--well); border: 1px solid var(--edge); border-top: 0; border-radius: 0 0 6px 6px; overflow: hidden; font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gm-ruler .tick { position: absolute; top: 0; width: 1px; height: 5px; background: #3a4150; }
.gm-ruler .tick.out { background: #262b35; }
.gm-ruler .tick.phrase { height: 100%; background: #4a5263; }
.gm-ruler .tick.phrase span { position: absolute; left: 4px; top: 6px; white-space: nowrap; }
.gm-phrases-both + .gm-ruler .tick.phrase, .arr-ruler .tick.phrase { background: rgba(46, 204, 113, 0.55); }
.gm-phrases-both + .gm-ruler .tick.phrase::before, .arr-ruler .tick.phrase::before { content: ""; position: absolute; top: 0; left: -5px; width: 11px; height: 7px; background: var(--phrase); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.gm-phrases-both + .gm-ruler .tick.phrase span, .arr-ruler .tick.phrase span { top: 8px; left: 8px; }

/* ---- track structure lane */
.gm-sections { position: relative; height: 44px; background: var(--well); border: 1px solid var(--edge); border-radius: 6px; overflow: hidden; }
.gm-section { position: absolute; top: 4px; bottom: 4px; box-sizing: border-box; padding: 0 1px; border: 0; background: none; }
.gm-section > div { height: 100%; border-radius: 4px; padding: 3px 7px; overflow: hidden; white-space: nowrap; font-size: 0.72rem; line-height: 1.25; text-align: left; }
.gm-section b { display: block; font-size: 0.78rem; }
.sec-full, .gm-section.full > div { background: #ffb38f; color: #2a1408; }
.sec-groove, .gm-section.groove > div { background: #a8552e; color: #fff; }
.sec-build, .gm-section.build > div { background: #2f5f8f; color: #fff; }
.sec-breakdown, .gm-section.breakdown > div { background: #1c3350; color: #dbe6f3; }

/* ---- end inspector */
.inspector { margin-top: 4px; border-top: 1px solid var(--edge); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.inspector-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.inspector-chart { position: relative; height: 150px; background: var(--well); border: 1px solid var(--edge); border-radius: 6px; overflow: hidden; display: flex; align-items: flex-end; gap: 5px; padding: 0 8px; }
.inspector-chart .line { position: absolute; left: 0; right: 0; border-top: 1px dashed #c3c8d2; pointer-events: none; }
.inspector-chart .line { z-index: 2; }
.inspector-chart .line span { position: absolute; right: 8px; top: 3px; font-size: 0.68rem; color: #c3c8d2; background: rgba(12, 14, 17, 0.85); padding: 0 5px; border-radius: 3px; }
.inspector-chart .line.limit { border-color: var(--boost); }
.inspector-chart .line.limit span { color: #7fbcff; }
.inspector-chart .col { flex: 1; height: 100%; position: relative; border: 0; background: none; padding: 0; cursor: pointer; }
.inspector-chart .col:hover { background: rgba(255, 255, 255, 0.05); }
.inspector-chart .col .now, .inspector-chart .col .ghost { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 3px 3px 0 0; }
.inspector-chart .col .ghost { box-sizing: border-box; border: 2px dashed #7fbcff; border-bottom: 0; }
.inspector-chart .col.out .now, .col-out { background: #4a5263; }
.inspector-chart .col.boost .now, .col-boost { background: var(--boost); }
.inspector-chart .col.in .now, .col-in { background: var(--body-wave); }
.col-ghost { box-sizing: border-box; border: 2px dashed #7fbcff; }
.inspector-chart .marker { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; }
.inspector-chart .marker::before { content: ""; position: absolute; top: 0; left: -7px; width: 16px; height: 9px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.inspector-labels { display: flex; gap: 5px; padding: 0 9px; font-size: 0.68rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.inspector-labels div { flex: 1; min-width: 0; }
.inspector-labels b { display: block; color: var(--text); font-weight: 400; }

/* ---- arrangement strip */
.arr-head { display: flex; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.arr-head div { box-sizing: border-box; padding-left: 6px; white-space: nowrap; overflow: hidden; border-left: 2px solid var(--phrase); }
.arr-head div.body { border-left-color: var(--accent); }
.arr { position: relative; height: 150px; background: var(--well); border: 1px solid var(--edge); border-radius: 6px 6px 0 0; overflow: hidden; }
.arr canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.arr #arr-marks { position: absolute; top: 0; bottom: 0; left: 0; right: 0; }
.arr-add { background: #6fd69a; }
.arr .band { position: absolute; top: 0; bottom: 0; box-sizing: border-box; border-left: 1px solid rgba(46, 204, 113, 0.45); }
.arr .band.alt { background: rgba(255, 255, 255, 0.09); }
.arr .join { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); z-index: 2; }
.io-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.io-group { display: flex; align-items: center; gap: 8px; }
.io-group .gm-label { margin: 0; font-weight: 600; color: var(--text); }
.io-group .custom-select { width: auto; }

/* ---- layer lanes */
.lane-presets { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.lane-presets > div { display: flex; align-items: center; gap: 8px; }
.lane-presets .gm-label { margin: 0; }
.lanes { display: flex; flex-direction: column; gap: 3px; user-select: none; }
.lane-row { display: flex; align-items: center; gap: 10px; }
.lane-name { width: 86px; flex: none; display: flex; align-items: center; gap: 6px; font-size: 0.8rem; height: 26px; padding: 0 4px; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--text); text-align: left; }
.lane-name:hover:not(:disabled) { border-color: #4a5263; background: #1e222a; }
.lane-name span { margin-left: auto; font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.lane-row.off .lane-name { color: var(--muted); }
.lane-row.off .lane-name i { background: #4a5263 !important; }
.lane-row.off .lane-name span { color: #f2c14e; }
.lane-row.off .lane .area:not(.body) .shape { opacity: 0.15; }
.lane-row.off .lane .area:not(.body) .dot { display: none; }
.lane-name i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lane { flex: 1; display: flex; height: 26px; background: var(--well); border: 1px solid var(--edge); border-radius: 4px; }
.lane .area { position: relative; }
.lane .area.body { background: rgba(255, 106, 43, 0.10); }
.lane .area + .area { box-shadow: inset 2px 0 0 var(--accent); }
.lane .shape { position: absolute; top: 4px; bottom: 4px; left: 0; right: 0; }
.lane .gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.1); }
.lane .dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; padding: 0; border-radius: 50%; border: 2px solid #101216; background: #fff; cursor: ew-resize; z-index: 2; touch-action: none; }
.lane .dot.top { top: 4px; }
.lane .dot.bottom { top: calc(100% - 4px); }
.lane-head { display: flex; gap: 10px; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lane-head .spacer { width: 96px; flex: none; }
.lane-head .cols { flex: 1; display: flex; border: 1px solid transparent; }
.lane-head .cols div { box-sizing: border-box; padding-left: 6px; border-left: 2px solid var(--phrase); white-space: nowrap; overflow: hidden; }
.lane-head .cols div.body { flex: 0 0 150px; border-left-color: var(--accent); }
.lane-bars { display: flex; gap: 10px; font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lane-bars .spacer { width: 96px; flex: none; }
.lane-bars .cols { flex: 1; display: flex; border: 1px solid transparent; }
.lane-bars .area { position: relative; height: 16px; }
.lane-bars .area.body { flex: 0 0 150px; }
.lane-bars span { position: absolute; top: 0; margin-left: 3px; }

/* ---- step 1: what is loaded */
.loaded { display: flex; align-items: center; gap: 16px; background: rgba(46, 204, 113, 0.08); border: 1px solid rgba(46, 204, 113, 0.5); border-radius: 8px; padding: 16px 18px; }
.loaded-tick { width: 34px; height: 34px; line-height: 34px; flex: none; border-radius: 50%; background: var(--phrase); color: #0c1a12; font-weight: 700; text-align: center; font-size: 1.1rem; }
.loaded-text { flex: 1; min-width: 0; }
.loaded-text h3 { margin-bottom: 2px; color: var(--phrase); }
.loaded-name { font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.loaded-track { margin-top: 4px; }
.loaded + .gm-drop { padding: 30px 26px; }

/* ---- controls under a step's waveform */
.pane-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.pane-actions .field { display: flex; flex-direction: column; }
.pane-actions .field label { margin-bottom: 4px; }
.pane-actions .field input { width: 110px; }
.pane-actions .mark-help { align-self: center; max-width: 150px; font-size: 0.76rem; line-height: 1.3; }
.pane-actions .field input.mark-time { width: 132px; font-variant-numeric: tabular-nums; }
.pane-actions .field.grow input { width: 100%; }
.pane-actions .grow { flex: 1; min-width: 200px; }
.pane-actions .btn { min-height: 38px; }
#downloads { display: inline-flex; gap: 12px; }
.pane-actions .gm-progress.below { flex: 1 0 100%; order: 20; }

/* ---- step 3: the two ends */
.ends { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 250px; gap: 12px; align-items: stretch; }
.ends-side { display: flex; flex-direction: column; gap: 10px; }
.ends-side .checks { flex: 1; }
.gm-end { background: var(--rail); border: 1px solid var(--edge); border-radius: 8px; padding: 12px; }
.gm-end h3 { color: var(--text); font-size: 0.9rem; text-transform: none; letter-spacing: 0; font-weight: 700; }
.gm-end h3 span { color: var(--muted); font-weight: 400; margin-left: 6px; font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.gm-end .end-note { margin: 8px 0; min-height: 1.4em; }
.gm-end .btn-group { display: flex; }
.gm-end .btn-group .btn { flex: 1; padding-left: 2px; padding-right: 2px; }
.gm-seg { display: inline-flex; border: 1px solid #353b47; border-radius: 6px; overflow: hidden; }
.gm-end .gm-seg { display: flex; }
.seg-btn { flex: 1; min-height: 36px; border: 0; border-left: 1px solid #353b47; background: #2a2f39; color: var(--text); font-size: 0.84rem; padding: 0 12px; white-space: nowrap; }
.seg-btn:first-child { border-left: 0; }
.seg-btn:hover:not(:disabled) { background: #353b47; }
.seg-btn.on, .seg-btn.on:hover:not(:disabled), .seg-btn.on:focus { background: var(--accent); color: #14100d; font-weight: 700; }
.seg-btn:disabled { color: #5d6678; cursor: default; }
.seg-btn .det { display: block; font-size: 0.62rem; font-weight: 400; line-height: 1; margin-top: -2px; }
.gm-seg-sm .seg-btn { min-height: 32px; }
.checks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; font-size: 0.84rem; }
.checks h3 { margin: 0; }
.checks .ok { color: var(--phrase); }
.checks .warn { color: #f2c14e; }

/* ---- shared controls */
.gm-progress-label { color: var(--muted); font-size: 0.82rem; margin-bottom: 5px; }
.progress { background: var(--well); height: 8px; }
.progress-bar { background: var(--accent); transition: width 0.4s; }
.alert { margin: 0; padding: 8px 12px; font-size: 0.88rem; }
.form-control, .custom-select { background-color: var(--well); border-color: var(--edge); color: var(--text); }
.form-control:focus, .custom-select:focus { background-color: var(--well); color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 0.15rem var(--accent-soft); }
.custom-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%239aa1b0' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e"); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #14100d; font-weight: 600; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:not(:disabled):not(.disabled):active { background: #ff8450; border-color: #ff8450; color: #14100d; }
.btn-primary:disabled { background: #2a2f39; border-color: #353b47; color: #7d8594; opacity: 1; cursor: default; }
.btn-secondary { background: #2a2f39; border-color: #353b47; }
.btn-secondary:hover { background: #353b47; border-color: #424a59; }
input[type=range] { accent-color: var(--accent); }

/* ---- step 3: the start and end of the finished track, with the preview that plays them */
.pv-bar, .ev-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pv-bar .grow { flex: 1; min-width: 220px; }
.pv-bar .custom-select, .ev-head .custom-select { width: auto; }
.ev-gap { flex: 1; }
.endviews { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; border-top: 1px solid var(--edge); padding-top: 12px; }
@media (max-width: 1250px) { .endviews { grid-template-columns: minmax(0, 1fr); } }
.endview { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.endview .ev-head { min-height: 32px; }
.endview .seg-btn { padding: 0 9px; font-size: 0.8rem; }
.endview .end-note { flex: 1; min-width: 0; font-size: 0.8rem; }
.ev-head h3 { color: var(--text); font-size: 0.95rem; text-transform: none; letter-spacing: 0; font-weight: 700; margin: 0; margin-right: auto; }
.ev-head h3 span { color: var(--muted); font-weight: 400; margin-left: 6px; font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.ev-head .gm-label { font-weight: 600; color: var(--text); }
.ev-track { margin-left: 96px; }
.ev-labels { display: flex; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.ev-labels div { box-sizing: border-box; padding-left: 6px; white-space: nowrap; overflow: hidden; border-left: 2px solid var(--accent); }
.ev-labels div.add { border-left-color: var(--phrase); }
.pv-wave { position: relative; height: 110px; background: var(--well); border: 1px solid var(--edge); border-radius: 6px 6px 0 0; overflow: hidden; cursor: pointer; }
.pv-wave.pv-ov { height: 54px; border-radius: 6px; }
.pv-active .pv-wave { border-color: var(--accent); }
.pv-wave canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.pv-marks { position: absolute; top: 0; bottom: 0; left: 0; right: 0; }
.pv-marks .band { position: absolute; top: 0; bottom: 0; box-sizing: border-box; background: rgba(0, 0, 0, 0.25); }
.pv-marks .band.alt { background: rgba(255, 255, 255, 0.10); }
.pv-marks .band.starts { border-left: 1px solid rgba(46, 204, 113, 0.5); }
.pv-marks .join { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); z-index: 2; }
.pv-marks .window { position: absolute; top: 0; bottom: 0; box-sizing: border-box; border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 3px; z-index: 2; }
.pv-wave .playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--playhead); box-shadow: 0 0 4px rgba(166, 255, 46, 0.6); z-index: 3; display: none; pointer-events: none; }
.pv-ruler .tick.phrase { background: rgba(46, 204, 113, 0.55); }
.pv-ruler .tick.phrase::before { content: ""; position: absolute; top: 0; left: -5px; width: 11px; height: 7px; background: var(--phrase); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.pv-ruler .tick.phrase span { top: 8px; left: 8px; }
.pv-ruler { height: 22px; }
.ev-track .gm-sections { margin-top: 4px; height: 38px; }
.band-a, .band-b { border: 1px solid var(--edge); }
.band-a { background: #0c0e11; margin-right: -4px; }
.band-b { background: #2a2d33; }

/* the next thing to press on step 2 */
@keyframes gm-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 106, 43, 0.0), 0 0 6px 1px rgba(255, 106, 43, 0.35); } 50% { box-shadow: 0 0 0 4px rgba(255, 106, 43, 0.25), 0 0 18px 4px rgba(255, 106, 43, 0.6); } }
#crop-btn.glow { background: var(--accent); border-color: var(--accent); color: #14100d; font-weight: 700; animation: gm-glow 1.6s ease-in-out infinite; }
#crop-btn.glow:hover { background: #ff8450; }
@media (prefers-reduced-motion: reduce) { #crop-btn.glow { animation: none; box-shadow: 0 0 0 3px rgba(255, 106, 43, 0.4); } }

/* ---- phones and small tablets: one column, the file lists folded under a button */
@media (max-width: 820px) {
	body { overflow: auto; font-size: 15px; }
	.app { flex-direction: column; height: auto; min-height: 100vh; min-width: 0; }
	.rail { width: auto; border-right: 0; border-bottom: 1px solid var(--edge); padding: 10px 12px; gap: 10px; overflow: visible; }
	.gm-logo { font-size: 1.25rem; }
	#rail-toggle { display: inline-block; }
	.rail-lists { display: none; }
	.rail.open .rail-lists { display: flex; }
	.btn-add { padding: 8px; }
	.stage { padding: 10px; gap: 10px; overflow: visible; }
	.steps li:has(button.current) { flex: 2.4; }
	.steps button { min-height: 44px; gap: 6px; font-size: 0.82rem; padding: 0 4px; }
	.steps button:not(.current) .t { display: none; }
	.pane { padding: 12px; gap: 10px; }
	.pane-head { gap: 8px 16px; }
	.pane-head .next-btn, .pane-actions .next-btn { order: 10; width: 100%; margin-left: 0 !important; }
	.pane-actions { gap: 10px; }
	.pane-actions .field { flex: 1 1 40%; }
	.pane-actions .field input.mark-time, .pane-actions .field input { width: 100%; }
	.pane-actions .mark-help { flex-basis: 100%; max-width: none; order: 1; }
	.pane-actions > .btn { flex: 1 1 auto; }
	#downloads { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; }
	#downloads .btn { flex: 1 1 auto; }
	h2 small { display: block; margin: 2px 0 0; }
	.gm-drop { padding: 30px 14px; }
	.loaded { flex-wrap: wrap; }
	#loaded-go { width: 100%; }
	.gm-keys { display: none; }
	.gm-controls .btn { flex: 1 1 auto; }
	.gm-facts { gap: 4px 16px; }
	.pv-bar .ev-gap, .pv-bar #pv-status { display: none; }
	.pv-bar > .btn { flex: 1 1 auto; }
	.endviews { gap: 18px; }
	.ev-track { margin-left: 70px; }
	.lane-row { gap: 8px; }
	.lane-name { width: 62px; font-size: 0.72rem; gap: 4px; padding: 0 2px; }
	.lane-name span { display: none; }
	.lane-row.off .lane-name { text-decoration: line-through; }
	.endview .seg-btn { padding: 0 7px; font-size: 0.76rem; }
	.ev-head { gap: 6px 8px; }
	.ev-labels { font-size: 0.6rem; letter-spacing: 0.04em; }
	.pv-wave { height: 90px; }
	.gm-legend { font-size: 0.74rem; }
	.checks { font-size: 0.78rem; gap: 2px 12px; }
}
/* touch screens: no hover, so the delete crosses are always on show; bigger things to grab */
@media (hover: none) {
	.rail-row .gm-delete { visibility: visible; font-size: 1.3rem; padding: 0 6px; }
}
@media (pointer: coarse) {
	.gm-wave ::part(region-handle)::before { width: 18px; height: 54px; margin-top: -27px; }
	.lane .dot { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
	.lane { height: 30px; }
	.lane-name { height: 30px; }
}

#pv-play.waiting { border-color: var(--accent); color: var(--accent); }
.len-step { display: inline-flex; align-items: center; gap: 4px; }
.len-step .custom-select { width: auto; }

/* ---- footer */
.gm-footer { flex: none; text-align: center; color: var(--muted); font-size: 0.78rem; padding: 2px 0; }

/* ---- dialogs */
.modal-content { background: var(--panel); border: 1px solid var(--edge); color: var(--text); border-radius: 10px; }
.modal-header, .modal-footer { border-color: var(--edge); }
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal .close { color: var(--text); text-shadow: none; opacity: 0.7; }
.modal .close:hover { color: var(--text); opacity: 1; }
.modal-backdrop.show { opacity: 0.7; }
.delete-name { font-weight: 600; overflow-wrap: anywhere; margin-bottom: 6px; }
.btn-danger { background: #d9463b; border-color: #d9463b; font-weight: 600; }

/* ---- an animated stand-in waveform while audio is on its way */
.gm-wave, .pv-wave, .gm-empty { position: relative; }
.wave-loading { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(12, 14, 17, 0.72); pointer-events: none; border-radius: inherit; }
.wave-loading .bars { display: flex; align-items: center; gap: 3px; width: 72%; max-width: 560px; height: 58%; }
.wave-loading i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--accent); opacity: 0.85; transform-origin: center; animation: gm-bars 1.2s ease-in-out infinite; }
.wave-loading span { font-size: 0.8rem; color: var(--muted); }
.pv-ov .wave-loading span { display: none; }
.pv-ov .wave-loading .bars { height: 70%; }
.gm-empty .wave-loading { position: static; background: none; height: 130px; }
.gm-empty:has(.wave-loading) { padding: 14px; }
.gm-empty:has(.wave-loading) > .empty-text { display: none; }
@keyframes gm-bars { 0%, 100% { transform: scaleY(0.25); opacity: 0.55; } 50% { transform: scaleY(1); opacity: 0.95; } }
@media (prefers-reduced-motion: reduce) { .wave-loading i { animation: none; transform: scaleY(0.6); } }

/* Step 1: page heading and the "How it works" / questions block under the dropzone */
.gm-h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 4px; line-height: 1.25; }
.gm-about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 32px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--edge); }
.gm-about h2 { font-size: 1rem; grid-row: 1; }
.about-steps { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.55; grid-row: 2; }
.about-steps li { margin-bottom: 6px; }
.about-steps strong { color: var(--text); }
.about-faq { grid-row: 2; }
.about-faq details { border-bottom: 1px solid var(--edge); padding: 8px 0; }
.about-faq summary { cursor: pointer; font-weight: 600; color: var(--text); }
.about-faq summary:hover { color: var(--accent); }
.about-faq p { color: var(--muted); margin: 6px 0 2px; line-height: 1.55; }
@media (max-width: 820px) {
	.gm-h1 { font-size: 1.25rem; }
	.gm-about { grid-template-columns: minmax(0, 1fr); }
	.gm-about h2, .about-steps, .about-faq { grid-row: auto; }
}
