:root {
  --bg-dark: #0f1115;
  --panel-bg: #1a1d23;
  --accent: #14b8a6;
  --accent-glow: rgba(20, 184, 166, 0.4);
  --text-main: #e2e8f0;
  --text-dim: #94a3b8;
  --border: #2d333f;
  --radius: 12px;
  --editor-block-gap: 28px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: "Pretendard", sans-serif;
  margin: 0;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  max-width: 1288px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  gap: 16px;
}

.logo-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.logo-title-row h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.accent {
  color: var(--accent);
}

.badge {
  display: inline-block;
  font-size: 10px;
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 700;
}

.header-tagline {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
}

.btn-to-dashboard {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-to-dashboard:hover {
  border-color: rgba(20, 184, 166, 0.55);
  background: rgba(20, 184, 166, 0.12);
  color: #5eead4;
}

.btn-to-dashboard::before {
  content: "←";
  font-size: 12px;
  opacity: 0.85;
}

.header-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}

.compute-capability {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  white-space: nowrap;
}

.compute-capability.is-gpu {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.12);
}

.compute-capability.is-cpu {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
}

.compute-capability.is-pending {
  color: var(--text-dim);
  font-weight: 600;
}

.compute-capability.is-warn {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
}

.status-dot {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.bin-readiness {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-dim);
  max-width: min(360px, 48vw);
}

.bin-readiness.is-ok {
  color: #34d399;
}

.bin-readiness.is-warn {
  color: #fbbf24;
}

.bin-readiness.is-err {
  color: #f87171;
}

.editor-ad {
  margin: 0 0 var(--editor-block-gap);
  min-height: var(--itz-ad-height, 90px);
  border-radius: var(--radius);
  background: var(--bg-control, #0a0c10);
  border: 1px dashed var(--border);
  display: block;
  overflow: hidden;
  line-height: 0;
}

.vocal-editor-shell {
  position: relative;
}

.drop-zone {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: var(--editor-block-gap);
}

.path-input-group label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
}

.path-input-group--second {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.path-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 6px 0 0;
  line-height: 1.45;
}

.path-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 8px;
}

.path-row input {
  flex: 1;
  min-width: 0;
  background: var(--bg-control, #000);
  border: 1px solid var(--border);
  color: var(--text-main, #fff);
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
}

.btn-pick-file,
.btn-new-job {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-pick-file {
  border: 1px solid var(--border);
  background: var(--bg-control-muted, #252a33);
  color: var(--text-main);
}

.btn-pick-file:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-control, #2d333f);
}

.btn-new-job {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
}

.btn-new-job:hover:not(:disabled) {
  border-color: #f87171;
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.08);
}

.options-layout {
  display: flex;
  gap: 15px;
  margin-bottom: var(--editor-block-gap);
  align-items: stretch;
}

.options-main {
  flex: 1;
  min-width: 0;
}

.options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.option-card {
  background: var(--panel-bg);
  padding: 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.option-card label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.option-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 10px;
  line-height: 1.4;
}

.option-select {
  width: 100%;
  background: var(--bg-control, #0a0c10);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.option-card--check .check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  margin-bottom: 8px;
}

.media-summary-panel {
  width: 200px;
  flex-shrink: 0;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.media-summary-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.media-summary-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-summary-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.media-summary-item dt {
  color: var(--text-dim);
  margin: 0;
}

.media-summary-item dd {
  margin: 0;
  font-weight: 600;
}

.preview-section {
  margin-bottom: var(--editor-block-gap);
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.preview-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.preview-card--result {
  border-color: rgba(20, 184, 166, 0.45);
}

.preview-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
}

.preview-file {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
}

.preview-card audio {
  width: 100%;
  height: 36px;
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--editor-block-gap);
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-action--secondary {
  background: var(--bg-control-muted, #252a33);
  border-color: var(--border);
  color: var(--text-main);
}

.btn-action--primary {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #042f2e;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-action--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-action--download {
  background: rgba(20, 184, 166, 0.12);
  border-color: rgba(20, 184, 166, 0.4);
  color: #5eead4;
}

.btn-action--download.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.enhancer-busy-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 17, 21, 0.72);
  backdrop-filter: blur(4px);
  border-radius: var(--radius);
}

.enhancer-busy-overlay[hidden] {
  display: none !important;
}

.enhancer-busy-panel {
  width: min(420px, 92%);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-align: center;
}

.enhancer-busy-panel h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.loading-step {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.loading-message {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
}

.loading-percent {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
}

.loading-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-control, #0a0c10);
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #14b8a6, #2dd4bf);
  transition: width 0.25s ease;
}

.vocal-editor-shell.is-busy {
  pointer-events: none;
}

@media (max-width: 860px) {
  .options-layout {
    flex-direction: column;
  }

  .media-summary-panel {
    width: auto;
  }

  .options-row,
  .preview-grid {
    grid-template-columns: 1fr;
  }
}

/* itz-theme-contrast */
html[data-theme="light"] .option-card label,
html[data-theme="light"] .option-hint,
html[data-theme="light"] .path-hint,
html[data-theme="light"] .range-val,
html[data-theme="light"] .preset-label,
html[data-theme="light"] .chips-label,
html[data-theme="light"] .size-pill {
  color: #0f172a !important;
}
html[data-theme="light"] .chip:not(.active):not(.is-on),
html[data-theme="light"] .preset-btn:not(.active) {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .chip.active {
  background: var(--accent, #3b82f6) !important;
  color: #ffffff !important;
}
html[data-theme="light"] .path-row input,
html[data-theme="light"] .option-card input[type="number"],
html[data-theme="light"] .option-card input[type="text"] {
  background: #ffffff !important;
  color: #0f172a !important;
}
html[data-theme="light"] .btn-pick-file {
  background: #ffffff !important;
  color: #0f172a !important;
}
html[data-theme="light"] .media-summary-panel {
  background: #f1f5f9;
}
html[data-theme="light"] .media-summary-title,
html[data-theme="light"] .media-summary-hint,
html[data-theme="light"] .media-summary-item dt,
html[data-theme="light"] .media-summary-item dd {
  color: #0f172a;
}
html[data-theme="dark"] .chip:not(.active):not(.is-on) {
  color: #e2e8f0;
}
html[data-theme="dark"] .chip.active {
  color: #ffffff;
}
html[data-theme="dark"] .range-val {
  color: #e2e8f0;
}
html[data-theme="dark"] .path-row input,
html[data-theme="dark"] .option-card input[type="number"],
html[data-theme="dark"] .option-card input[type="text"] {
  color: #ffffff;
}

/* itz-theme-controls */
html[data-theme="light"] .toggle-card {
  background: var(--bg-control, #f8fafc) !important;
  border-color: var(--border, #d8dee8);
  color: #0f172a;
}
html[data-theme="light"] .toggle-card-title,
html[data-theme="light"] .option-label,
html[data-theme="light"] .check-label {
  color: #0f172a !important;
}
html[data-theme="light"] .toggle-card-desc,
html[data-theme="light"] .option-hint,
html[data-theme="light"] .choice small,
html[data-theme="light"] .check-line small {
  color: #475569 !important;
}
html[data-theme="light"] .toggle-card:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 12%, #ffffff) !important;
  border-color: color-mix(in srgb, var(--accent) 42%, #d8dee8);
}
html[data-theme="light"] .toggle-card.is-disabled,
html[data-theme="light"] .toggle-card.is-disabled:has(input:checked) {
  opacity: 0.72;
  background: var(--bg-control-muted, #e8eef4) !important;
}
html[data-theme="light"] .toggle-card.is-disabled .toggle-card-title,
html[data-theme="light"] .toggle-card.is-disabled .toggle-card-desc {
  color: #64748b !important;
}
html[data-theme="light"] .option-select,
html[data-theme="light"] .option-field select {
  background: #ffffff !important;
  color: #0f172a !important;
}
html[data-theme="light"] .choice,
html[data-theme="light"] .check-line {
  background: var(--bg-control, #f8fafc) !important;
  color: #0f172a;
}
html[data-theme="light"] .mode-chip:not(.active):not(.is-on) {
  background: var(--bg-control, #f8fafc) !important;
  color: #334155 !important;
}
html[data-theme="light"] .mode-chip.active,
html[data-theme="light"] .mode-chip.is-on {
  background: var(--accent, #3b82f6) !important;
  color: #ffffff !important;
}
html[data-theme="light"] .size-pill:not(:has(input:checked)) {
  background: #f8fafc !important;
  color: #334155 !important;
}
html[data-theme="light"] .size-pill:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 16%, #ffffff) !important;
  color: #0c4a6e !important;
}
html[data-theme="light"] .btn-pick-file:hover:not(:disabled) {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .toast {
  background: #ffffff !important;
  color: #0f172a !important;
}
html[data-theme="light"] .preview-dialog {
  background: #ffffff !important;
  color: #0f172a !important;
}
html[data-theme="light"] .howto code {
  background: #e8eef4 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .btn-action--download:not(.is-disabled) {
  color: #0f766e !important;
}
html[data-theme="dark"] .toggle-card-title,
html[data-theme="dark"] .option-label {
  color: var(--text-main, #e2e8f0);
}
html[data-theme="dark"] .toggle-card-desc,
html[data-theme="dark"] .option-hint,
html[data-theme="dark"] .choice small,
html[data-theme="dark"] .check-line small {
  color: var(--text-subtle, #94a3b8);
}
html[data-theme="dark"] .option-select {
  background: var(--bg-control, #0f1318);
  color: var(--text-main, #e2e8f0);
}
html[data-theme="dark"] .path-row input {
  background: var(--bg-control, #0f1318);
  color: var(--text-main, #ffffff);
}
html[data-theme="dark"] .mode-chip:not(.active):not(.is-on) {
  color: #cbd5e1;
}
html[data-theme="dark"] .size-pill:has(input:checked) {
  color: #e0f2fe;
}
