.editor-shell { width: min(1040px, calc(100% - 36px)); margin: 0 auto; padding: 46px 0; }
.editor-intro { margin-bottom: 24px; display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.editor-intro h1 { margin: 4px 0 0; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(42px, 7vw, 66px); font-weight: 400; letter-spacing: -.045em; line-height: 1; }
.editor-intro > p { max-width: 390px; margin: 0 0 5px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.editor-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); box-shadow: 0 28px 85px var(--shadow); }
.page-drop-overlay { position: fixed; inset: 12px; z-index: 1000; display: grid; place-content: center; justify-items: center; gap: 10px; border: 1px solid var(--gold); border-radius: 12px; color: var(--ink); background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 24px 90px var(--shadow), inset 0 0 80px rgba(210,166,77,.08); opacity: 0; pointer-events: none; transform: scale(.995); transition: opacity .16s, transform .16s; backdrop-filter: blur(12px); }
.page-drop-overlay .page-drop-icon { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-size: 27px; }
.page-drop-overlay strong { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(24px, 4vw, 38px); font-weight: 400; }
.page-drop-overlay small { color: var(--muted); font-size: 12px; }
body.file-drag-active .page-drop-overlay { opacity: 1; transform: scale(1); }
.drop-zone { min-height: 340px; padding: 42px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; cursor: pointer; background: radial-gradient(circle at 50% 48%, rgba(210,166,77,.09), transparent 35%); transition: background .2s; }
.drop-zone:hover { background-color: rgba(210,166,77,.035); }
.drop-zone input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.drop-icon { width: 54px; height: 54px; margin-bottom: 6px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-size: 25px; }
.drop-zone strong { font-family: Georgia, 'Times New Roman', serif; font-size: 25px; font-weight: 400; }
.drop-zone small { color: var(--muted); font-size: 10px; }
.drop-zone.has-file { min-height: 88px; padding: 14px 20px; flex-direction: row; justify-content: flex-start; gap: 12px; text-align: left; background: rgba(210,166,77,.025); }
.drop-zone.has-file .drop-icon { width: 34px; height: 34px; margin: 0; flex: 0 0 auto; font-size: 18px; }
.drop-zone.has-file strong { font-size: 16px; }
.drop-zone.has-file small { margin-left: 2px; }
.editor-tabs { padding: 8px 10px 0; display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; }
.editor-tabs[hidden] { display: none !important; }
.editor-tab-item { min-width: 132px; max-width: 240px; height: 36px; display: flex; align-items: stretch; border: 1px solid transparent; border-bottom: 0; border-radius: 7px 7px 0 0; color: var(--muted); background: transparent; }
.editor-tab-item:hover { color: var(--ink); background: var(--raised); }
.editor-tab-item.is-active { color: var(--ink); border-color: var(--line); background: var(--panel); box-shadow: inset 0 2px 0 var(--gold); }
.editor-tab-item.is-dragging { opacity: .45; }
.editor-tab { min-width: 0; flex: 1; padding: 0 5px 0 12px; overflow: hidden; border: 0; color: inherit; background: transparent; cursor: pointer; font-size: 10px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.editor-tab-dirty { margin-right: 5px; color: var(--gold); }
.editor-tab-close { width: 30px; flex: 0 0 30px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 15px; }
.editor-tab-close:hover { color: var(--ink); }
.editor-workspace { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.editor-workspace[hidden] { display: none !important; }
.file-bar, .transport, .export-bar { padding: 16px 20px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.file-bar > div, .export-bar > div { display: grid; gap: 3px; }
.file-bar small, .export-bar small, .selection-readout small { color: var(--gold); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 7px; letter-spacing: .12em; }
.file-bar strong, .export-bar strong { font-size: 11px; }
.file-bar > span { margin-left: auto; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.persistence-status { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; white-space: nowrap; }
.persistence-status[data-state="writing"], .persistence-status[data-state="pending"], .persistence-status[data-state="recovering"] { border-color: rgba(210,166,77,.45); color: var(--gold); }
.persistence-status[data-state="error"] { border-color: rgba(183,92,80,.55); color: #e1a39b; }
.history-actions { display: flex; gap: 7px; }
.file-bar button, .transport button, .button-grid button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); cursor: pointer; font-size: 9px; }
.file-bar button:disabled, .transport button:disabled, .button-grid button:disabled, .export-button:disabled, .batch-export-button:disabled { cursor: not-allowed; opacity: .42; }
.waveform-card { min-height: 300px; padding: 14px 20px 16px; background: linear-gradient(180deg, rgba(210,166,77,.025), transparent); }
.waveform-toolbar { min-height: 34px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.waveform-toolbar button { min-width: 32px; height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--raised); cursor: pointer; }
.waveform-toolbar input { width: min(180px, 28vw); accent-color: var(--gold); }
.waveform-toolbar output { min-width: 42px; color: var(--gold); font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.waveform-toolbar .waveform-engine-status { min-width: 92px; margin-left: auto; color: var(--quiet-ink); letter-spacing: .06em; }
.waveform-viewport { width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-color: var(--gold) var(--surface); scrollbar-width: thin; overscroll-behavior-x: contain; }
.waveform-content { position: relative; min-width: 100%; padding-bottom: 50px; }
.waveform-stage { position: sticky; left: 0; width: 100%; height: 200px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.waveform-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.waveform-grid-layer, .waveform-audio-layer { pointer-events: none; }
.waveform-overlay-layer { cursor: crosshair; touch-action: none; }
.selection-marker-times { position: absolute; top: 206px; right: 0; left: 0; height: 42px; pointer-events: none; }
.selection-marker-time { position: absolute; top: 0; min-width: 76px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--gold); background: var(--surface); font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; white-space: nowrap; transform: translateX(-50%); }
.selection-marker-time::before { position: absolute; bottom: 100%; left: 50%; width: 1px; height: 7px; content: ''; background: var(--gold); }
.selection-marker-time.is-left { transform: translateX(0); }
.selection-marker-time.is-left::before { left: 5px; }
.selection-marker-time.is-right { transform: translateX(-100%); }
.selection-marker-time.is-right::before { left: calc(100% - 5px); }
.selection-marker-times.is-tight .selection-end-time { top: 25px; }
.waveform-footer { margin-top: 9px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.waveform-times { min-width: 120px; display: flex; gap: 7px; color: var(--quiet-ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.waveform-times span + span::before { content: '/ '; }
.timecode-fields { display: flex; gap: 8px; }
.timecode-fields label { display: grid; gap: 4px; color: var(--muted); font-size: 8px; }
.timecode-fields input { width: 102px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.timecode-fields input:focus { border-color: var(--gold); outline: 1px solid var(--gold); }
.selection-reset { align-self: end; min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--raised); cursor: pointer; font-size: 9px; white-space: nowrap; }
.selection-reset:hover { border-color: var(--gold); }
.region-panel { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.region-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.region-heading > div { display: grid; gap: 3px; }
.region-heading small { color: var(--gold); font: 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.region-heading strong { font-size: 10px; font-weight: 600; }
.region-heading button { min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--raised); cursor: pointer; font-size: 9px; }
.region-heading .region-heading-actions { display: flex; gap: 7px; }
.region-heading button:disabled { cursor: not-allowed; opacity: .42; }
.region-list { margin-top: 10px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
.region-item { min-width: 220px; height: 42px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: grab; transition: opacity .12s ease, transform .12s ease; }
.region-item.is-active { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.region-item.is-dragging { opacity: .36; transform: scale(.98); }
.region-select { min-width: 0; height: 100%; padding: 0 8px 0 11px; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 2px; border: 0; color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.region-name { overflow: hidden; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.region-time { color: var(--muted); font: 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.region-actions { display: flex; align-self: stretch; }
.region-actions button { width: 30px; border: 0; border-left: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; }
.region-actions button:hover { color: var(--ink); background: var(--raised); }
.region-rename { width: 100%; height: 28px; padding: 0 7px; border: 1px solid var(--gold); border-radius: 4px; color: var(--ink); background: var(--panel); font-size: 9px; }
.region-empty { padding: 8px 0; color: var(--muted); font-size: 9px; }
.fade-hint { margin: 8px 0 0; color: var(--muted); font-size: 8px; line-height: 1.4; }
.source-sample-shelf { margin-top: 12px; padding: 10px; border: 1px dashed color-mix(in srgb, var(--line) 85%, var(--gold)); border-radius: 7px; background: color-mix(in srgb, var(--raised) 55%, transparent); transition: border-color .14s ease, background .14s ease, box-shadow .14s ease; }
.source-sample-shelf.is-drop-target { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent), 0 0 22px color-mix(in srgb, var(--gold) 12%, transparent); }
.source-sample-shelf .clip-palette-heading > div { display: grid; gap: 4px; }
.source-sample-shelf .clip-palette-heading button { min-height: 32px; padding: 0 11px; border: 1px solid var(--gold); border-radius: 5px; color: var(--ink); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); cursor: pointer; font-size: 9px; }
@media (max-width: 540px) {
  .region-heading { align-items: stretch; flex-direction: column; }
  .region-heading .region-heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
}
.transport { justify-content: space-between; gap: 22px; background: rgba(210,166,77,.018); }
.transport-controls { display: grid; grid-template-columns: repeat(3, 42px); gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: inset 0 1px 0 rgba(255,255,255,.025); }
.transport .transport-control { position: relative; width: 42px; min-height: 42px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 7px; color: var(--muted); background: transparent; transition: color .16s, background .16s, transform .16s; }
.transport .transport-control:hover { color: var(--ink); background: var(--raised); }
.transport .transport-control:active { transform: scale(.94); }
.transport .transport-primary { color: #090909; background: var(--gold); }
.transport .transport-primary:hover { color: #090909; background: #e0bb69; }
.transport-control svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.transport-control svg.is-hidden { display: none; }
.transport-control::after { position: absolute; top: calc(100% + 9px); left: 50%; z-index: 8; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; content: attr(aria-label); color: var(--ink); background: var(--raised); box-shadow: 0 8px 24px var(--shadow); font-size: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(-50%, -3px); transition: opacity .15s, transform .15s; }
.transport-control:hover::after, .transport-control:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.selection-readout { margin-left: auto; display: grid; gap: 3px; text-align: right; }
.selection-readout strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.editor-grid { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; border-bottom: 1px solid var(--line); }
.editor-grid section { min-width: 0; }
.section-number { margin: 0 0 10px; color: var(--gold); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; letter-spacing: .12em; }
.button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.button-grid button { min-width: 0; }
.gain-control { margin-top: 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; color: var(--muted); font-size: 9px; }
.gain-control input { width: 100%; accent-color: var(--gold); }
.gain-control output { min-width: 48px; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.silence-panel { padding: 18px 20px 20px; border-bottom: 1px solid var(--line); background: rgba(210,166,77,.012); }
.silence-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.silence-heading .section-number { margin-bottom: 5px; }
.silence-heading strong { font-size: 12px; font-weight: 600; }
.silence-heading > output { color: var(--gold); font: 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.silence-controls { margin-top: 15px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.silence-controls label { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px 10px; color: var(--muted); font-size: 9px; }
.silence-controls input { grid-column: 1 / -1; width: 100%; accent-color: var(--gold); }
.silence-controls output { color: var(--ink); font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.silence-actions { margin-top: 16px; display: flex; gap: 8px; }
.silence-actions button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--raised); cursor: pointer; font-size: 9px; }
.silence-actions button:last-child:not(:disabled) { border-color: var(--gold); color: #090909; background: var(--gold); font-weight: 700; }
.silence-actions button:disabled { cursor: not-allowed; opacity: .42; }
.silence-hint { margin: 10px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.channel-panel { padding: 18px 20px 20px; border-bottom: 1px solid var(--line); background: rgba(210,166,77,.025); }
.channel-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.channel-heading .section-number { margin-bottom: 5px; }
.channel-heading strong { font-size: 12px; font-weight: 600; }
.channel-heading > output { color: var(--gold); font: 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.channel-groups { margin-top: 15px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, .5fr); gap: 18px; }
.channel-groups small { display: block; margin-bottom: 7px; color: var(--muted); font: 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.channel-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.channel-actions button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--raised); cursor: pointer; font-size: 9px; }
.channel-actions button:hover:not(:disabled) { border-color: var(--gold); }
.channel-actions button:disabled { cursor: not-allowed; opacity: .42; }
.channel-polarity-actions { display: grid; grid-template-columns: 1fr 1fr; }
.channel-hint { margin: 10px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.history-panel { padding: 18px 20px 20px; border-bottom: 1px solid var(--line); background: rgba(210,166,77,.012); }
.history-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.history-heading .section-number { margin-bottom: 5px; }
.history-heading strong { font-size: 12px; font-weight: 600; }
.history-heading > output { color: var(--gold); font: 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.history-timeline { margin-top: 15px; display: flex; gap: 7px; overflow-x: auto; padding: 0 0 8px; scrollbar-color: var(--gold) var(--surface); scrollbar-width: thin; }
.history-step { position: relative; min-width: 150px; max-width: 220px; min-height: 52px; padding: 9px 11px 9px 29px; display: grid; align-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface); cursor: pointer; text-align: left; }
.history-step::before { position: absolute; left: 11px; width: 7px; height: 7px; border: 1px solid var(--gold); border-radius: 50%; content: ''; background: var(--surface); }
.history-step:hover { border-color: var(--gold); color: var(--ink); }
.history-step.is-future { opacity: .55; }
.history-step.is-current { border-color: var(--gold); color: var(--ink); background: rgba(210,166,77,.08); box-shadow: inset 0 0 0 1px rgba(210,166,77,.12); }
.history-step.is-current::before { background: var(--gold); }
.history-step strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.history-step small { color: var(--muted); font: 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.history-hint { margin: 3px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.multitrack-panel { min-width: 0; max-width: 100%; padding: 18px 20px 20px; overflow: hidden; border-bottom: 1px solid var(--line); background: rgba(210,166,77,.025); }
.multitrack-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.multitrack-heading .section-number { margin-bottom: 5px; }
.multitrack-heading strong { font-size: 12px; font-weight: 600; }
.multitrack-actions { display: flex; align-items: center; gap: 8px; }
.multitrack-actions output { color: var(--gold); font: 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.multitrack-actions output[data-state="fallback"] { color: var(--muted); }
.multitrack-actions button { min-height: 38px; padding: 0 14px; border: 1px solid var(--gold); border-radius: 6px; color: var(--ink); background: rgba(210,166,77,.08); cursor: pointer; font-size: 9px; font-weight: 700; }
.clip-palette { margin-top: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: color-mix(in srgb, var(--raised) 70%, transparent); }
.clip-palette-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.clip-palette-heading small { color: var(--gold); font: 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; }
.clip-palette-heading span { color: var(--muted); font-size: 8px; }
.clip-palette-list { margin-top: 9px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
.clip-palette-empty { padding: 9px 2px; color: var(--muted); font-size: 8px; }
.clip-palette-item { min-width: 220px; padding: 8px 9px; display: grid; grid-template-columns: minmax(0, 1fr) 60px; gap: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); cursor: grab; text-align: left; touch-action: none; transition: opacity .12s ease, transform .12s ease, box-shadow .12s ease; }
.clip-palette-item[aria-selected="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(210,166,77,.3); background: rgba(210,166,77,.1); }
.clip-palette-item:hover { box-shadow: 0 4px 14px rgba(0,0,0,.16); }
.clip-palette-item.is-dragging { opacity: .32; transform: scale(.98); }
.clip-palette-item strong { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.clip-palette-item small { color: var(--muted); font: 7px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.clip-palette-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 4px; }
.clip-palette-actions button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--raised); cursor: pointer; }
.clip-palette-actions button:hover { border-color: var(--gold); color: var(--ink); }
.timeline-grid-toolbar { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.timeline-grid-toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 8px; }
.timeline-grid-toolbar select { min-height: 32px; padding: 0 26px 0 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); font-size: 8px; }
.timeline-grid-toolbar small { color: var(--muted); font-size: 7px; }
.timeline-zoom-controls { display: flex; align-items: center; gap: 5px; }
.timeline-zoom-controls > button { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); cursor: pointer; font-size: 9px; }
.timeline-zoom-controls label { gap: 6px; }
.timeline-zoom-controls input { width: 110px; accent-color: var(--gold); }
.timeline-zoom-controls output { min-width: 30px; color: var(--gold); font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.timeline-loop-controls { display: flex; align-items: center; gap: 5px; }
.timeline-loop-controls button { min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 7px; }
.timeline-loop-controls button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.multitrack-timeline-viewport { --timeline-lane-width: 800px; width: 100%; max-width: 100%; min-width: 0; margin-top: 10px; overflow-x: auto; overflow-y: visible; overscroll-behavior-x: contain; scrollbar-color: var(--gold) var(--surface); scrollbar-width: thin; }
.multitrack-ruler-row { width: max-content; min-width: 100%; display: grid; grid-template-columns: 190px var(--timeline-lane-width); }
.multitrack-ruler-spacer { position: sticky; left: 0; z-index: 7; border-bottom: 1px solid var(--line); background: var(--surface); }
.multitrack-ruler { height: 26px; position: relative; border-bottom: 1px solid var(--line); color: var(--muted); font: 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; cursor: crosshair; touch-action: none; }
.multitrack-ruler:focus-visible { outline: 1px solid var(--gold); outline-offset: -1px; }
.multitrack-ruler-tick { height: 7px; position: absolute; bottom: 0; border-left: 1px solid var(--line); }
.multitrack-ruler-tick span { position: absolute; bottom: 10px; left: 4px; white-space: nowrap; }
.multitrack-ruler-tick.is-end span { left: auto; right: 4px; }
.multitrack-list { width: max-content; min-width: 100%; margin-top: 7px; display: grid; gap: 7px; }
.multitrack-track { width: max-content; min-width: 100%; min-height: 58px; display: grid; grid-template-columns: 190px var(--timeline-lane-width); border: 1px solid var(--line); border-radius: 7px; overflow: clip; background: var(--surface); content-visibility: auto; contain-intrinsic-size: auto 64px; }
.multitrack-track-controls { padding: 8px 10px; position: sticky; left: 0; z-index: 6; display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, 30px); align-items: center; gap: 5px; border-right: 1px solid var(--line); background: var(--surface); }
.multitrack-track-controls strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.multitrack-track-controls button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--raised); cursor: pointer; font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.multitrack-track-controls button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: rgba(210,166,77,.12); }
.multitrack-track-controls button:disabled { opacity: .3; cursor: not-allowed; }
.multitrack-mixer-strip { grid-column: 1 / -1; padding-top: 5px; display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 5px 7px; border-top: 1px solid var(--line); }
.multitrack-mixer-strip label { min-width: 0; display: grid; grid-template-columns: 22px minmax(44px, 1fr) 43px; align-items: center; gap: 4px; color: var(--muted); font: 6px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.multitrack-mixer-strip input { width: 100%; min-width: 0; accent-color: var(--gold); }
.multitrack-mixer-strip output { color: var(--ink); font: 6px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; white-space: nowrap; }
.multitrack-track-meter { width: 34px; height: 5px; grid-column: 2; grid-row: 1 / span 2; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--line) 75%, transparent); }
.multitrack-track-meter i { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--gold), #df6d58); transition: width .06s linear; }
.multitrack-lane { min-width: 0; min-height: 64px; position: relative; overflow: hidden; background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 10% 100%; transition: background-color .14s ease, box-shadow .14s ease; }
.multitrack-lane.is-drop-target { background-color: rgba(210,166,77,.1); box-shadow: inset 0 0 0 1px var(--gold); }
.multitrack-clip { --fade-in: 0%; --fade-out: 0%; min-width: 86px; max-width: 100%; padding: 7px 9px; position: absolute; top: 7px; bottom: 7px; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; gap: 3px 6px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--gold) 58%, var(--line)); border-radius: 5px; color: var(--ink); background: linear-gradient(115deg, transparent 0 var(--fade-in), color-mix(in srgb, var(--surface) 78%, var(--gold)) var(--fade-in) calc(100% - var(--fade-out)), transparent calc(100% - var(--fade-out)) 100%), color-mix(in srgb, var(--surface) 88%, var(--gold)); cursor: grab; touch-action: none; transition: opacity .12s ease, transform .12s ease, box-shadow .12s ease; }
.multitrack-clip:hover, .multitrack-clip:focus-visible { z-index: 2; box-shadow: 0 4px 14px rgba(0,0,0,.16); }
.multitrack-clip.is-selected { z-index: 4; border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 34%, transparent), 0 5px 16px rgba(0,0,0,.2); }
.multitrack-clip.is-grouped { border-bottom-color: #77b9c8; }
.multitrack-clip.is-locked { cursor: not-allowed; opacity: .76; background-image: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--line) 30%, transparent) 8px 9px); }
.multitrack-clip.is-dragging { z-index: 3; opacity: .2; cursor: grabbing; transform: scale(.985); }
.multitrack-drag-ghost, .buffered-clip-drag-ghost { position: fixed; z-index: 1000; margin: 0; pointer-events: none; opacity: .96; cursor: grabbing; box-shadow: 0 12px 32px rgba(0,0,0,.34), 0 0 0 2px color-mix(in srgb, var(--gold) 55%, transparent); transform: translateZ(0) scale(1.015); transition: left .045s linear, top .08s cubic-bezier(.2,.8,.2,1), box-shadow .12s ease; will-change: left, top; }
.multitrack-drag-ghost .multitrack-clip-actions, .multitrack-drag-ghost :is(.clip-trim-handle, .clip-fade-handle) { opacity: 0; }
.buffered-clip-drag-ghost { display: grid; }
.multitrack-snap-guide { width: 1px; position: fixed; z-index: 999; display: block; pointer-events: none; background: var(--gold); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 18%, transparent), 0 0 12px color-mix(in srgb, var(--gold) 62%, transparent); transform: translateX(-.5px); }
.multitrack-drag-ghost[hidden], .buffered-clip-drag-ghost[hidden], .multitrack-snap-guide[hidden] { display: none; }
.multitrack-snap-guide::before, .multitrack-snap-guide::after { width: 7px; height: 7px; position: absolute; left: 50%; border: 1px solid var(--gold); background: var(--surface); content: ''; transform: translateX(-50%) rotate(45deg); }
.multitrack-snap-guide::before { top: -4px; }
.multitrack-snap-guide::after { bottom: -4px; }
body.is-moving-audio-clip, body.is-moving-audio-clip * { cursor: grabbing !important; user-select: none !important; }
.multitrack-clip.is-slip-mode { border-style: dashed; border-color: var(--gold); background: color-mix(in srgb, var(--surface) 70%, var(--gold)); }
.multitrack-clip.is-slipping { z-index: 3; opacity: .7; cursor: ew-resize; box-shadow: inset 0 0 0 1px var(--gold); }
.multitrack-clip.is-trimming { z-index: 4; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.multitrack-clip.is-fading { z-index: 5; box-shadow: 0 4px 16px rgba(0,0,0,.22), inset 0 0 0 1px var(--gold); }
.multitrack-clip strong { position: relative; z-index: 1; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.multitrack-clip small { position: relative; z-index: 1; grid-column: 1; color: var(--muted); font: 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.multitrack-clip-actions { position: relative; z-index: 2; grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 3px; }
.multitrack-clip-actions button { width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: var(--raised); cursor: pointer; font-size: 10px; }
.multitrack-clip-actions button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: rgba(210,166,77,.14); }
.multitrack-clip-actions button:disabled { opacity: .25; cursor: not-allowed; }
.multitrack-clip-waveform { position: absolute; inset: 5px 4px; z-index: 0; width: calc(100% - 8px); height: calc(100% - 10px); opacity: .26; pointer-events: none; }
.multitrack-clip-waveform polygon { fill: var(--gold); }
.clip-trim-handle { width: 14px; height: 100%; position: absolute; top: 0; z-index: 5; border: 0; color: var(--gold); background: transparent; cursor: ew-resize; touch-action: none; }
.clip-trim-handle::after { width: 2px; height: 18px; position: absolute; top: 50%; left: 50%; border-radius: 2px; background: currentColor; content: ''; opacity: .7; transform: translate(-50%, -50%); }
.clip-trim-handle.is-start { left: 0; }
.clip-trim-handle.is-end { right: 0; }
.clip-fade-handle { width: 20px; height: 20px; position: absolute; top: 0; z-index: 6; border: 0; color: var(--gold); background: transparent; cursor: ew-resize; touch-action: none; }
.clip-fade-handle::after { width: 7px; height: 7px; position: absolute; top: 3px; border: 1px solid currentColor; border-radius: 50%; background: var(--surface); content: ''; }
.clip-fade-handle.is-in { left: 4px; }
.clip-fade-handle.is-in::after { left: 3px; }
.clip-fade-handle.is-out { right: 4px; }
.clip-fade-handle.is-out::after { right: 3px; }
.multitrack-crossfade { height: 34px; min-width: 2px; position: absolute; top: 15px; z-index: 3; pointer-events: none; border-left: 1px solid rgba(255,255,255,.7); border-right: 1px solid rgba(255,255,255,.7); background: linear-gradient(135deg, transparent 48%, rgba(255,255,255,.8) 49% 51%, transparent 52%), linear-gradient(45deg, transparent 48%, rgba(255,255,255,.62) 49% 51%, transparent 52%); filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.multitrack-loop-region { position: absolute; top: 0; bottom: 0; z-index: 0; pointer-events: none; border-left: 1px solid color-mix(in srgb, var(--gold) 75%, transparent); border-right: 1px solid color-mix(in srgb, var(--gold) 75%, transparent); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.multitrack-loop-region.is-ruler { z-index: 0; background: color-mix(in srgb, var(--gold) 16%, transparent); }
.multitrack-automation-lanes { width: 100%; height: 100%; position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: visible; }
.multitrack-automation-lanes polyline { fill: none; stroke: color-mix(in srgb, var(--gold) 74%, transparent); stroke-width: .7; vector-effect: non-scaling-stroke; }
.multitrack-automation-lanes polyline.is-pan { stroke: color-mix(in srgb, #77b9c8 78%, transparent); stroke-dasharray: 3 2; }
.multitrack-automation-point { width: 12px; height: 12px; padding: 0; position: absolute; z-index: 5; pointer-events: auto; border: 2px solid var(--surface); border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 72%, transparent); cursor: move; touch-action: none; transform: translate(-50%, -50%); }
.multitrack-automation-point:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.multitrack-automation-point.is-pan { width: 6px; height: 6px; background: #77b9c8; box-shadow: 0 0 0 1px color-mix(in srgb, #77b9c8 72%, transparent); }
.multitrack-playhead { width: 1px; position: absolute; top: 0; bottom: 0; z-index: 5; pointer-events: none; background: var(--gold); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 20%, transparent); transform: translateX(-.5px); }
.multitrack-playhead::before { width: 7px; height: 7px; position: absolute; top: 0; left: 50%; border-radius: 1px 1px 50% 50%; background: var(--gold); content: ''; transform: translateX(-50%); }
.multitrack-playhead.is-ruler { top: 0; bottom: -7px; z-index: 6; }
.multitrack-delivery { margin-top: 10px; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.multitrack-edit-actions { margin-top: 10px; display: flex; justify-content: flex-end; gap: 6px; }
.multitrack-edit-actions { flex-wrap: wrap; }
.multitrack-edit-actions button { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); cursor: pointer; font-size: 8px; }
.multitrack-edit-actions button:last-child { color: #df8b80; }
.multitrack-edit-actions button:disabled { opacity: .35; cursor: not-allowed; }
.multitrack-delivery > div { display: flex; align-items: center; gap: 8px; }
.multitrack-delivery output { color: var(--gold); font: 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.multitrack-delivery output[data-state="overload"] { color: #df6d58; }
.multitrack-delivery button { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--raised); cursor: pointer; font-size: 8px; }
.multitrack-master-meter { width: 92px; height: 5px; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--line) 72%, transparent); }
.multitrack-master-meter i { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--gold) 0 72%, #df6d58 92%); transition: width .06s linear; }
.multitrack-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 8px; }
.multitrack-hint { margin: 10px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.diagnostics-panel { border-bottom: 1px solid var(--line); background: rgba(210,166,77,.02); }
.diagnostics-panel summary { min-height: 58px; padding: 13px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; list-style: none; }
.diagnostics-panel summary::-webkit-details-marker { display: none; }
.diagnostics-panel summary::before { width: 7px; height: 7px; flex: 0 0 auto; border-right: 1px solid var(--gold); border-bottom: 1px solid var(--gold); content: ''; transform: rotate(-45deg); transition: transform .18s ease; }
.diagnostics-panel[open] summary::before { transform: rotate(45deg); }
.diagnostics-panel summary > span { margin-right: auto; display: grid; gap: 3px; }
.diagnostics-panel summary small { color: var(--gold); font: 7px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
.diagnostics-panel summary strong { font-size: 11px; font-weight: 600; }
.diagnostics-panel summary output { color: var(--gold); font: 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.diagnostics-grid { padding: 0 20px 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.diagnostics-grid > div { min-height: 55px; padding: 10px 11px; display: grid; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.diagnostics-grid span { color: var(--muted); font-size: 8px; }
.diagnostics-grid output { color: var(--ink); font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.diagnostics-panel > p { margin: -3px 20px 16px; color: var(--muted); font-size: 8px; }
.message-bar { padding: 11px 20px; border-bottom: 1px solid var(--line); color: var(--muted); background: rgba(210,166,77,.04); font-size: 9px; text-align: center; }
.export-bar { justify-content: space-between; border-bottom: 0; background: rgba(210,166,77,.035); }
.depth-control { margin-left: auto; display: grid; gap: 4px; color: var(--muted); font-size: 8px; }
.depth-control select { min-width: 120px; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--raised); font-size: 9px; }
.export-actions { display: flex; align-items: stretch; gap: 8px; }
.batch-export-button { min-height: 44px; padding: 0 16px; border: 1px solid var(--gold); border-radius: 6px; color: var(--ink); background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }
.batch-export-button:not(:disabled):hover { background: rgba(210,166,77,.1); }
.export-button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 6px; color: #090909; background: var(--gold); cursor: pointer; font-size: 10px; font-weight: 700; }
.editor-privacy { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 10px; }
.editor-privacy b { color: var(--ink); }

/* Workstation layout ----------------------------------------------------- */
body:has(.drop-zone.has-file) .editor-shell { width: min(1480px, calc(100% - 28px)); padding: 18px 0 34px; }
body:has(.drop-zone.has-file) .editor-intro { display: none; }
body:has(.drop-zone.has-file) .editor-panel { border-radius: 10px; box-shadow: 0 22px 70px var(--shadow); }
.drop-zone.has-file { min-height: 48px; padding: 7px 14px; gap: 9px; border-bottom: 1px solid var(--line); background: var(--surface); }
.drop-zone.has-file .drop-icon { width: 27px; height: 27px; font-size: 14px; }
.drop-zone.has-file strong { font-family: inherit; font-size: 10px; font-weight: 650; }
.drop-zone.has-file small { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.editor-tabs { padding: 5px 8px 0; background: color-mix(in srgb, var(--surface) 90%, #000); }
.editor-tab-item { height: 32px; }
.editor-workspace { background: color-mix(in srgb, var(--panel) 96%, #000); }
.editor-workspace > .file-bar { order: 1; }
.editor-workspace > .transport { order: 2; }
.editor-workspace > .waveform-card { order: 3; }
.editor-workspace > .editor-grid { order: 4; }
.editor-workspace > .multitrack-panel { order: 5; }
.editor-workspace > .silence-panel { order: 6; }
.editor-workspace > .channel-panel { order: 7; }
.editor-workspace > .history-panel { order: 8; }
.editor-workspace > .diagnostics-panel { order: 9; }
.editor-workspace > .message-bar { order: 10; }
.editor-workspace > .export-bar { order: 11; }
.file-bar { min-height: 64px; padding: 9px 14px; gap: 12px; background: color-mix(in srgb, var(--surface) 94%, #000); }
.file-identity { min-width: 180px; max-width: 300px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 3px 12px; }
.file-identity small { grid-column: 1 / -1; }
.file-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-identity #file-meta { margin: 0; color: var(--muted); font: 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.workspace-view-switch { margin: 0 auto; padding: 3px; display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel) 76%, #000); }
.workspace-view-switch button { min-width: 92px; min-height: 34px; padding: 0 14px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; font-weight: 650; letter-spacing: .025em; }
.workspace-view-switch button:hover { color: var(--ink); background: var(--raised); }
.workspace-view-switch button[aria-selected="true"] { color: #090909; background: var(--gold); box-shadow: 0 3px 12px rgba(0,0,0,.2); }
.file-bar .persistence-status { margin-left: auto; }
.file-bar .history-actions { display: flex; grid-auto-flow: column; gap: 6px; }
.file-bar .history-actions button { min-height: 34px; padding: 0 10px; background: transparent; }
.editor-workspace[data-view="source"] > :is(.multitrack-panel, .silence-panel, .channel-panel, .history-panel, .diagnostics-panel) { display: none !important; }
.editor-workspace[data-view="arrange"] > :is(.waveform-card, .transport, .editor-grid, .silence-panel, .channel-panel, .history-panel, .diagnostics-panel, .export-bar) { display: none !important; }
.editor-workspace[data-view="tools"] > :is(.waveform-card, .transport, .editor-grid, .multitrack-panel) { display: none !important; }
.editor-workspace[data-view="source"] .transport { min-height: 66px; padding: 9px 18px; justify-content: center; position: relative; background: color-mix(in srgb, var(--surface) 88%, #000); }
.editor-workspace[data-view="source"] .selection-readout { position: absolute; right: 18px; }
.editor-workspace[data-view="source"] .waveform-card { min-height: 430px; padding: 12px 18px 14px; }
.editor-workspace[data-view="source"] .waveform-stage { height: 300px; border-radius: 4px; background: color-mix(in srgb, var(--surface) 92%, #000); }
.editor-workspace[data-view="source"] .selection-marker-times { top: 306px; }
.editor-workspace[data-view="source"] .waveform-content { padding-bottom: 50px; }
.editor-workspace[data-view="source"] .editor-grid { padding: 13px 18px 16px; background: color-mix(in srgb, var(--surface) 72%, transparent); }
.editor-workspace[data-view="source"] .button-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.editor-workspace[data-view="source"] .editor-grid section + section { padding-left: 20px; border-left: 1px solid var(--line); }
.editor-workspace[data-view="arrange"] .multitrack-panel { min-height: 560px; padding: 14px 16px 18px; background: color-mix(in srgb, var(--panel) 96%, #000); }
.editor-workspace[data-view="arrange"] .multitrack-heading { min-height: 44px; align-items: center; }
.editor-workspace[data-view="arrange"] .clip-palette { margin-top: 9px; padding: 7px 9px; }
.editor-workspace[data-view="arrange"] .timeline-grid-toolbar { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.editor-workspace[data-view="arrange"] .multitrack-timeline-viewport { min-height: 320px; border: 1px solid var(--line); border-radius: 6px; background: color-mix(in srgb, var(--surface) 94%, #000); }
.editor-workspace[data-view="arrange"] .multitrack-track { min-height: 88px; border-width: 0 0 1px; border-radius: 0; }
.editor-workspace[data-view="arrange"] .multitrack-lane { min-height: 88px; }
.editor-workspace[data-view="arrange"] .multitrack-clip { top: 9px; bottom: 9px; }
.editor-workspace[data-view="arrange"] .multitrack-edit-actions { justify-content: flex-start; }
.editor-workspace[data-view="tools"] { padding: 0 12px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.editor-workspace[data-view="tools"] > .file-bar { grid-column: 1 / -1; margin: 0 -12px; }
.editor-workspace[data-view="tools"] > :is(.silence-panel, .diagnostics-panel, .message-bar, .export-bar) { grid-column: 1 / -1; }
.editor-workspace[data-view="tools"] > :is(.silence-panel, .channel-panel, .history-panel, .diagnostics-panel) { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.editor-workspace[data-view="tools"] > .silence-panel { margin-top: 0; }
.editor-workspace[data-view="tools"] .channel-groups { grid-template-columns: 1fr; }
.editor-workspace[data-view="tools"] .history-timeline { flex-direction: column; max-height: 245px; }
.editor-workspace[data-view="tools"] .history-step { width: 100%; max-width: none; }
.editor-workspace[data-view="tools"] > .message-bar { border: 1px solid var(--line); border-radius: 6px; }
.export-bar { position: sticky; bottom: 0; z-index: 20; box-shadow: 0 -12px 35px color-mix(in srgb, var(--shadow) 45%, transparent); backdrop-filter: blur(12px); }
.close-dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--panel); box-shadow: 0 34px 110px rgba(0,0,0,.55); }
.close-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.close-dialog-card { padding: clamp(24px, 5vw, 38px); }
.close-dialog h2 { margin: 5px 0 12px; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(28px, 5vw, 38px); font-weight: 400; letter-spacing: -.035em; }
.close-dialog p:not(.section-number) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.close-dialog-file { margin-top: 18px; padding: 11px 13px; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font: 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.close-dialog-actions { margin-top: 24px; display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.close-dialog-actions button { min-height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--raised); cursor: pointer; font-size: 10px; }
.close-dialog-actions .close-save { border-color: var(--gold); color: #090909; background: var(--gold); font-weight: 700; }
.close-dialog-actions .close-discard { grid-column: 1 / -1; color: #e1a39b; background: transparent; }
.close-dialog-actions .close-discard:not(:disabled):hover { border-color: #b75c50; color: #ffd2cc; background: rgba(183,92,80,.08); }
.close-dialog-actions button:disabled { cursor: not-allowed; opacity: .46; }
@media (max-width: 700px) {
  body:has(.drop-zone.has-file) .editor-shell { width: min(100% - 16px, 1480px); padding-top: 10px; }
  .file-bar { align-items: center; }
  .file-identity { max-width: none; flex: 1 1 210px; }
  .workspace-view-switch { order: 4; width: 100%; }
  .workspace-view-switch button { min-width: 0; flex: 1; }
  .editor-workspace[data-view="tools"] { grid-template-columns: 1fr; }
  .editor-workspace[data-view="tools"] > :is(.file-bar, .silence-panel, .channel-panel, .history-panel, .diagnostics-panel, .message-bar, .export-bar) { grid-column: 1; }
  .editor-workspace[data-view="source"] .button-grid { grid-template-columns: 1fr 1fr; }
  .editor-workspace[data-view="source"] .editor-grid section + section { padding-left: 0; border-left: 0; }
  .editor-workspace[data-view="source"] .selection-readout { position: static; }
  .editor-intro { align-items: flex-start; flex-direction: column; gap: 14px; }
  .editor-grid { grid-template-columns: 1fr; }
  .silence-controls { grid-template-columns: 1fr; }
  .channel-groups { grid-template-columns: 1fr; }
  .file-bar { align-items: flex-start; flex-wrap: wrap; }
  .file-bar > span { order: 3; width: 100%; margin: 0; }
  .history-actions { margin-left: auto; }
  .transport { flex-wrap: wrap; }
  .selection-readout { width: auto; margin: 0 0 0 auto; text-align: right; }
}
@media (max-width: 540px) {
  .editor-shell { width: min(100% - 22px, 1040px); padding-top: 30px; }
  .header-tools .local-badge { display: none; }
  .header-tools { gap: 9px; }
  .header-link { display: none; }
  .drop-zone { min-height: 280px; }
  .drop-zone.has-file { min-height: 48px; padding: 8px 12px; align-items: center; flex-wrap: nowrap; gap: 7px; }
  .drop-zone.has-file small { width: auto; margin: 0; }
  .editor-page .theme-toggle { width: 44px; height: 44px; }
  .editor-page .language-picker select { min-height: 44px; }
  .editor-tabs { padding-top: 6px; scroll-padding-inline: 10px; }
  .editor-tab-item { height: 46px; }
  .editor-tab, .editor-tab-close { min-height: 44px; }
  .editor-tab-close { width: 44px; flex-basis: 44px; }
  .file-bar button, .button-grid button, .silence-actions button, .channel-actions button { min-height: 44px; }
  .file-bar .history-actions { width: 100%; margin: 0; display: grid; grid-template-columns: 1fr 1fr 1.4fr; }
  .button-grid { grid-template-columns: 1fr; }
  .transport { gap: 12px; }
  .transport-controls { grid-template-columns: repeat(3, 48px); }
  .transport .transport-control { width: 48px; min-height: 48px; }
  .selection-readout { width: 100%; margin: 0; text-align: left; }
  .waveform-toolbar { flex-wrap: wrap; }
  .waveform-toolbar button { min-width: 44px; height: 44px; }
  .waveform-toolbar input[type="range"] { min-height: 44px; }
  .waveform-toolbar .waveform-engine-status { width: 100%; margin-left: 0; text-align: left; }
  .waveform-footer { align-items: stretch; flex-direction: column; gap: 10px; }
  .timecode-fields { width: 100%; }
  .timecode-fields label { flex: 1; }
  .timecode-fields input { width: 100%; height: 44px; }
  .selection-reset { min-height: 44px; flex: 0 0 auto; }
  .region-heading button { min-height: 44px; }
  .region-item { min-height: 48px; height: auto; }
  .region-actions button { width: 44px; }
  .gain-control input[type="range"], .silence-controls input[type="range"] { min-height: 44px; }
  .export-bar { align-items: stretch; flex-direction: column; }
  .export-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .silence-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .silence-heading > output { text-align: left; }
  .silence-actions { flex-direction: column; }
  .channel-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .channel-heading > output { text-align: left; }
  .channel-actions { display: grid; grid-template-columns: 1fr; }
  .channel-polarity-actions { grid-template-columns: 1fr 1fr; }
  .history-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .history-heading > output { text-align: left; }
  .history-step { min-width: 138px; min-height: 56px; }
  .multitrack-heading { align-items: stretch; flex-direction: column; gap: 10px; }
  .multitrack-actions { justify-content: space-between; }
  .multitrack-actions button { min-height: 44px; }
  .multitrack-track { grid-template-columns: 1fr; }
  .clip-palette-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .clip-palette-item { min-width: 220px; min-height: 52px; }
  .timeline-grid-toolbar { align-items: stretch; flex-direction: column; gap: 7px; }
  .timeline-grid-toolbar label { justify-content: space-between; }
  .timeline-grid-toolbar select { min-height: 44px; }
  .timeline-zoom-controls { width: 100%; }
  .timeline-zoom-controls label { flex: 1; }
  .timeline-zoom-controls input { width: 100%; }
  .timeline-zoom-controls > button { min-width: 44px; height: 44px; }
  .multitrack-ruler-row, .multitrack-track { grid-template-columns: 190px var(--timeline-lane-width); }
  .multitrack-track { min-height: 108px; }
  .multitrack-track-controls { grid-template-columns: repeat(4, 38px); grid-template-rows: auto 44px auto; align-content: center; border-right: 1px solid var(--line); border-bottom: 0; }
  .multitrack-track-controls strong { grid-column: 1 / -1; }
  .multitrack-track-controls button { width: 44px; height: 44px; }
  .multitrack-mixer-strip { grid-template-columns: 1fr; gap: 8px; }
  .multitrack-mixer-strip label { grid-template-columns: 26px 1fr 48px; }
  .multitrack-track-meter { width: 100%; grid-column: 1; grid-row: auto; }
  .multitrack-lane { min-height: 106px; }
  .multitrack-clip-actions button { width: 44px; height: 44px; }
  .clip-trim-handle { width: 28px; }
  .clip-fade-handle { width: 32px; height: 32px; }
  .multitrack-delivery { align-items: stretch; flex-direction: column; }
  .multitrack-delivery > div { justify-content: space-between; }
  .multitrack-delivery button { min-height: 44px; flex: 1; }
  .multitrack-edit-actions { display: grid; grid-template-columns: 1fr; }
  .multitrack-edit-actions button { min-height: 44px; }
  .diagnostics-grid { grid-template-columns: repeat(2, 1fr); }
  .close-dialog-actions { grid-template-columns: 1fr; }
  .close-dialog-actions .close-discard { grid-column: auto; }
  .close-dialog-actions button { min-height: 44px; }
  .depth-control { margin: 0; }
  .depth-control select { height: 44px; }
}

@media (pointer: coarse) {
  .editor-tabs { scroll-snap-type: x proximity; }
  .editor-tab-item { height: 46px; scroll-snap-align: start; }
  .editor-tab, .editor-tab-close { min-height: 44px; }
  .editor-tab-close { width: 44px; flex-basis: 44px; }
  .file-bar button, .button-grid button, .silence-actions button, .channel-actions button,
  .region-heading button, .selection-reset, .export-actions button, .close-dialog-actions button, .multitrack-actions button { min-height: 44px; }
  .multitrack-clip-actions button { width: 44px; height: 44px; }
  .clip-trim-handle { width: 28px; }
  .clip-fade-handle { width: 32px; height: 32px; }
  .multitrack-delivery button { min-height: 44px; }
  .multitrack-edit-actions button { min-height: 44px; }
  .waveform-toolbar button { min-width: 44px; height: 44px; }
  .timecode-fields input, .depth-control select { min-height: 44px; }
  input[type="range"] { min-height: 44px; touch-action: pan-y; }
  .region-item { min-height: 48px; height: auto; }
  .region-actions button { width: 44px; }
  .transport-controls { grid-template-columns: repeat(3, 48px); }
  .transport .transport-control { width: 48px; min-height: 48px; }
  .transport-control::after { display: none; }
}
