:root {
  --teal: #087f89;
  --teal-dark: #066c75;
  --teal-soft: #e9f6f6;
  --navy: #071a35;
  --ink: #101828;
  --muted: #667085;
  --line: #d8e0e8;
  --soft: #f6f9fb;
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body { margin: 0; background: #f8fafb; font-size: 15px; line-height: 1.6; letter-spacing: -.02em; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button, label.file-picker { cursor: pointer; }
button:disabled, input:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #77c8ce; outline-offset: 3px; }
button { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { color: var(--navy); font-size: clamp(26px, 3.1vw, 36px); line-height: 1.35; letter-spacing: -.05em; }
h2 { color: var(--navy); font-size: 20px; line-height: 1.4; }
h3 { color: var(--navy); font-size: 16px; }
a { color: var(--teal-dark); }
.app-header { height: 68px; display: flex; align-items: center; gap: 18px; padding: 0 36px; background: white; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 9px; align-items: center; color: var(--teal-dark); text-decoration: none; font-weight: 800; font-size: 21px; letter-spacing: .015em; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 31px; border: 2px solid var(--teal); border-radius: 9px 9px 9px 2px; font-size: 23px; line-height: 1; }
.header-divider { width: 1px; height: 20px; background: var(--line); }
.header-title { color: #445970; font-size: 14px; font-weight: 600; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: #44656a; font-size: 12px; white-space: nowrap; }
.local-badge > span { width: 7px; height: 7px; background: var(--teal); border-radius: 50%; }
main { max-width: 1120px; margin: 0 auto; padding: 44px 28px 28px; }
.page-heading { display: flex; align-items: flex-start; gap: 20px; justify-content: space-between; margin-bottom: 25px; }
.eyebrow { margin-bottom: 8px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.lede { color: #52657a; margin-top: 10px; }
.experiment-badge { flex-shrink: 0; padding: 5px 11px; margin-top: 33px; border: 1px solid #c7d6db; border-radius: 6px; font-size: 12px; color: #50646b; font-weight: 600; }
.notice { padding: 17px 20px; background: #edf6f6; border: 1px solid #cfe5e6; border-radius: 10px; color: #31575e; }
.notice strong { font-size: 14px; }
.notice p { margin-top: 4px; font-size: 13px; line-height: 1.65; }
.engine-status { display: flex; align-items: center; gap: 8px; padding: 13px 2px 17px; color: #53636e; font-size: 12px; }
.engine-status .text-button { margin-left: auto; white-space: nowrap; font-size: 12px; padding: 3px 7px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #99a5ae; flex-shrink: 0; }
.status-dot.ready { background: var(--teal); }
.status-dot.error { background: #c9872c; }
.surface-card { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 26px; margin-bottom: 20px; }
.section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
.section-heading p { font-size: 13px; color: var(--muted); margin-top: 4px; word-break: break-word; }
.step-number { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; margin-top: 1px; color: var(--teal-dark); background: var(--teal-soft); border-radius: 7px; font-size: 14px; font-weight: 800; }
.upload-zone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 1.5px dashed #b7cbd3; border-radius: 10px; background: #fafcfd; text-align: center; transition: border-color .15s, background .15s; }
.upload-zone.drag-over { border-color: var(--teal); background: var(--teal-soft); }
.upload-zone strong { max-width: 100%; word-break: break-word; color: #294353; font-size: 15px; }
.upload-zone > span { color: var(--muted); font-size: 12px; }
.upload-icon { width: 29px; height: 29px; margin-bottom: 3px; fill: none; stroke: #5c929a; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.file-picker { position: relative; margin-top: 9px; overflow: hidden; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-picker:focus-within { outline: 3px solid #77c8ce; outline-offset: 3px; }
.primary-button, .outline-button { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 42px; padding: 9px 17px; border: 1px solid var(--line); border-radius: 7px; background: white; font-size: 13px; font-weight: 700; text-decoration: none; line-height: 1.45; }
.primary-button { background: var(--teal); color: white; border-color: var(--teal); }
.primary-button:hover:not(:disabled) { background: var(--teal-dark); }
.outline-button:hover:not(:disabled) { border-color: #9aafb9; background: #f9fbfc; }
.text-button { border: 0; background: transparent; padding: 6px 9px; color: var(--teal-dark); font-size: 13px; font-weight: 600; border-radius: 4px; }
.text-button:hover:not(:disabled) { background: var(--teal-soft); }
.text-button.is-active { color: #fff; background: var(--teal); }
.target-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 14px; }
.target-heading h3 { display: flex; align-items: center; gap: 8px; }
.count-badge { color: var(--teal-dark); font-size: 12px; padding: 0 7px; border-radius: 5px; background: var(--teal-soft); }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.button-row { display: flex; align-items: center; gap: 4px; }
.target-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.target-option { display: flex; align-items: center; gap: 8px; min-height: 45px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-size: 13px; color: #48566a; transition: border-color .1s, background .1s; }
.target-option:has(input:checked) { border-color: #8ec2c5; color: var(--teal-dark); background: #eff8f8; font-weight: 700; }
.target-option:has(input:disabled) { cursor: not-allowed; }
.target-option input { width: 15px; height: 15px; accent-color: var(--teal); flex-shrink: 0; margin: 0; }
.advanced-targets { border: 1px solid var(--line); border-radius: 7px; margin-top: 14px; padding: 0 15px; }
summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #475a6b; padding: 13px 0; }
.advanced-targets summary span { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.search-label { display: flex; align-items: center; gap: 12px; font-size: 12px; margin: 14px 0 16px; color: #52657a; }
.search-label input { min-width: 0; flex: 1; max-width: 360px; height: 35px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 5px; font-size: 13px; }
.target-group { margin-bottom: 18px; }
.target-group h4 { margin: 0 0 8px; color: #50606d; font-size: 12px; }
.target-group .target-option { min-height: 39px; font-size: 12px; padding: 7px 9px; }
.selection-hint { min-height: 20px; color: #71634a; margin-top: 9px; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; padding-top: 19px; border-top: 1px solid #e9eef1; }
.action-row .primary-button { min-width: 210px; }
.progress-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.progress-top h2 { font-size: 17px; }
.progress-top p { margin-top: 5px; }
.progress-value { font-size: 24px; color: var(--teal); font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 8px; display: block; margin: 18px 0 13px; border: 0; border-radius: 10px; overflow: hidden; accent-color: var(--teal); background: #e8eef0; }
progress::-webkit-progress-bar { background: #e8eef0; border-radius: 10px; }
progress::-webkit-progress-value { background: var(--teal); border-radius: 10px; transition: width .3s; }
progress::-moz-progress-bar { background: var(--teal); }
.progress-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.progress-footer .outline-button { min-height: 32px; padding: 5px 12px; }
.error-message { margin-bottom: 20px; padding: 15px 18px; color: #a13227; background: #fff4f1; border: 1px solid #f0c9c2; border-radius: 8px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.reset-mix { margin-left: auto; flex-shrink: 0; }
.mixer-help { margin: -8px 0 20px; }
.preset-buttons { flex-wrap: wrap; justify-content: flex-end; }
.stage-panel { margin-bottom: 26px; padding: 18px; background: #f5f9fa; border: 1px solid #d8e6e9; border-radius: 10px; }
.stage-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stage-heading h3 { font-size: 15px; }
.stage-heading p { margin-top: 3px; }
.stage-direction-note { flex-shrink: 0; color: #6e858c; font-size: 10px; margin-top: 3px; }
.stage-axis { display: flex; justify-content: space-between; padding: 15px 30px 7px; font-size: 10px; color: #71848f; }
.stage-scroll { max-height: 414px; overflow: auto; border: 1px solid #cedfe4; border-radius: 8px; background: white; }
.stage-field { position: relative; min-height: 300px; overflow: hidden; background: linear-gradient(90deg, transparent calc(50% - .5px), #b4d4d7 calc(50% - .5px), #b4d4d7 calc(50% + .5px), transparent calc(50% + .5px)), linear-gradient(180deg, #f0f6f8 0, #fafcfd 30%, #ecf3f4 100%); }
.stage-field::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent, transparent calc(25% - 1px), #e0ebee 25%); }
.stage-lane { position: absolute; left: 0; right: 0; height: 43px; border-bottom: 1px solid #e2ecee; }
.stage-lane-name { display: inline-block; padding: 10px 12px; font-size: 10px; color: #899aa2; max-width: 30%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-track { position: absolute; display: inline-flex; align-items: center; gap: 5px; transform: translateX(-50%); min-width: 72px; max-width: 126px; min-height: 35px; padding: 4px 8px; border: 1px solid #b9cdd4; border-radius: 7px; background: #fff; color: #385763; box-shadow: 0 2px 3px #193f4912; cursor: grab; touch-action: none; user-select: none; z-index: 1; }
.stage-track:active { cursor: grabbing; }
.stage-track span { font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-track svg { width: 23px; height: 23px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stage-track.is-selected { border: 2px solid var(--teal); padding: 3px 7px; color: var(--teal-dark); background: #ecf9f8; z-index: 2; }
.stage-track.is-muted { opacity: .43; }
.stage-field.is-compact .stage-track { min-height: 27px; padding-block: 2px; }
.stage-field.is-compact .stage-track.is-selected { padding-block: 1px; }
.stage-field.is-compact .stage-track svg { width: 20px; height: 20px; }
.stage-field.is-compact .stage-lane-name { padding-block: 5px; }
.stage-caption { margin-top: 7px; color: #778b94; font-size: 10px; }
.stage-selection { display: grid; grid-template-columns: minmax(95px, 1fr) minmax(150px, 1.2fr) minmax(130px, 1fr) 115px; align-items: center; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #d7e4e8; }
.selected-track-name { display: flex; flex-direction: column; }
.selected-track-name strong { color: var(--teal-dark); font-size: 14px; }
.selected-preview { display: flex; gap: 18px; align-items: center; margin-top: 16px; padding: 12px 13px; background: #fff; border: 1px solid #d8e6e9; border-radius: 7px; }
.selected-preview > div { flex: 1 1 40%; }
.selected-preview strong { display: block; color: #345d66; font-size: 12px; }
.selected-preview span { display: block; color: #7b8c96; font-size: 10px; margin-top: 2px; }
.selected-preview audio { flex: 1 1 60%; min-width: 0; }
.stage-selection .slider-control { flex-wrap: wrap; }
.stage-selection .slider-control::before { content: attr(data-label); width: 100%; font-size: 10px; color: var(--muted); }
.mix-selection-notice { min-height: 20px; margin: 7px 0 11px; color: #547580; }
.mix-selection-notice:empty { display: none; }
.all-channel-details { border-top: 1px solid var(--line); }
.all-channel-details > summary { padding-block: 12px; font-size: 12px; }
.track-row.is-selected { background: #eff8f8; border-radius: 6px; }
.mixer-table-head, .track-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(180px, 1.3fr) minmax(150px, 1.1fr) 140px; column-gap: 23px; align-items: center; }
.mixer-table-head { padding: 0 10px 9px; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); }
.track-row { padding: 18px 10px; border-bottom: 1px solid #e9eef1; }
.track-row.is-muted { background: #fafbfc; }
.track-name { font-size: 14px; font-weight: 700; color: #294353; }
.track-meta { display: block; color: var(--muted); font-size: 10px; font-weight: 400; margin-top: 1px; }
.track-row.is-muted .track-name { color: #8a939d; }
.slider-control { display: flex; gap: 9px; align-items: center; }
input[type="range"] { min-width: 0; flex: 1; width: 100%; accent-color: var(--teal); cursor: pointer; height: 20px; margin: 0; }
.slider-control output { flex-shrink: 0; width: 60px; color: #566a7a; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.pan-control output { width: 39px; }
.track-actions { display: flex; justify-content: flex-end; gap: 5px; }
.toggle-button { min-height: 30px; padding: 5px 9px; border: 1px solid #d6e0e5; border-radius: 5px; background: white; font-size: 11px; }
.toggle-button[aria-pressed="true"] { color: var(--teal-dark); background: var(--teal-soft); border-color: #84babe; font-weight: 700; }
.toggle-button.mute[aria-pressed="true"] { color: #825b2c; background: #fbf4e9; border-color: #d7bd95; }
.master-strip { display: flex; align-items: center; justify-content: flex-end; gap: 18px; padding: 19px 10px; border-bottom: 1px solid var(--line); }
.master-strip label { font-size: 12px; color: #52657a; }
.master-strip input { flex: 0 1 210px; }
.master-strip output { width: 62px; text-align: right; color: var(--teal-dark); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.render-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 0 1px; }
.render-row strong { font-size: 13px; color: #31505f; }
.render-row p { margin-top: 3px; }
.render-row .primary-button { flex-shrink: 0; }
.preview-panel { margin-top: 25px; padding: 20px; border-radius: 9px; background: #f4f8f9; border: 1px solid #dfe9ec; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.preview-heading h3 { font-size: 14px; }
audio { display: block; width: 100%; height: 40px; }
.original-preview { margin-top: 7px; }
.original-preview summary { font-size: 12px; padding: 9px 0; }
.original-preview p { margin-top: 7px; }
.export-row { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 21px; padding-top: 18px; border-top: 1px solid #dfe9ec; }
.export-row a[aria-disabled="true"] { pointer-events: none; opacity: .45; }
.workbench-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 28px; }
.workbench-footer > p { font-size: 13px; color: #627b8a; }
.workbench-footer .export-row { margin-top: 0; padding-top: 0; border-top: 0; flex-shrink: 0; }
.footer-note { text-align: center; color: #87949e; font-size: 11px; padding: 12px 0; }
@media (max-width: 850px) {
  .stage-selection { grid-template-columns: 1fr 1fr; gap: 10px 18px; }
  .stage-selection > .track-actions { grid-column: 2; grid-row: 1; }
  .mixer-table-head, .track-row { column-gap: 14px; grid-template-columns: minmax(85px, 1fr) minmax(135px, 1.3fr) minmax(120px, 1fr) 100px; }
  .toggle-button { padding-inline: 7px; }
  .slider-control { gap: 5px; }
  .slider-control output { width: 52px; }
  .pan-control output { width: 33px; }
}
@media (max-width: 640px) {
  .app-header { padding: 0 18px; height: 60px; gap: 11px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 24px; height: 27px; font-size: 20px; }
  .header-title { font-size: 11px; }
  .local-badge { font-size: 10px; gap: 4px; }
  main { padding: 28px 14px 18px; }
  .page-heading { gap: 8px; margin-bottom: 20px; }
  .lede { font-size: 13px; }
  .experiment-badge { padding: 4px 7px; font-size: 10px; margin-top: 30px; }
  .surface-card { padding: 19px 16px; }
  .notice { padding: 14px 15px; }
  .engine-status { font-size: 11px; }
  .section-heading { gap: 9px; margin-bottom: 19px; }
  .section-heading h2 { font-size: 18px; }
  .section-heading p { font-size: 12px; }
  .target-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .target-heading { align-items: flex-start; }
  .target-heading .button-row { gap: 0; }
  .target-heading .text-button { font-size: 11px; padding-inline: 5px; white-space: nowrap; }
  .preset-buttons { max-width: 135px; }
  .target-heading > div > p { max-width: 180px; margin-top: 3px; }
  .action-row, .render-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .action-row .primary-button { width: 100%; }
  .progress-footer { align-items: flex-start; }
  .mixer-table-head { display: none; }
  .track-row { grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 17px 0; }
  .track-name { grid-column: 1; grid-row: 1; }
  .track-actions { grid-column: 2; grid-row: 1; }
  .slider-control { flex-wrap: wrap; gap: 3px 7px; }
  .slider-control::before { content: attr(data-label); width: 100%; color: var(--muted); font-size: 10px; }
  .master-strip { padding-inline: 0; gap: 10px; }
  .master-strip input { flex-basis: 140px; }
  .reset-mix { font-size: 11px; padding-inline: 0; }
  .stage-panel { padding: 12px 10px; }
  .stage-heading { display: block; }
  .stage-direction-note { display: none; }
  .stage-scroll { max-height: 414px; }
  .selected-preview { display: block; padding: 10px; }
  .selected-preview audio { margin-top: 9px; }
  .stage-lane-name { padding-left: 5px; font-size: 9px; }
  .stage-track { min-width: 66px; }
  .preview-panel { padding: 15px 12px; }
  .preview-heading { flex-wrap: wrap; gap: 3px; }
  .export-row { justify-content: stretch; }
  .export-row > * { flex: 1 1 100%; }
  .workbench-footer { flex-direction: column; align-items: stretch; }
  .workbench-footer .export-row { flex-wrap: nowrap; }
  .workbench-footer .export-row > * { flex: 1 1 auto; padding-inline: 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
