.topbar {
  gap: 14px;
}

.topbar-subtitle {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 2px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr);
  gap: 20px;
  align-items: stretch;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr);
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

.upload-panel,
.status-panel,
.result-panel,
.history-panel {
  padding: 22px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.section-head h1,
.section-head h2 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

.section-head h1 {
  font-size: 24px;
  line-height: 1.2;
}

.section-head h2 {
  font-size: 17px;
  line-height: 1.25;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--text-2);
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 280px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
  padding: 28px;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-md);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.dropzone-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--accent-text);
  box-shadow: var(--shadow-sm);
}

.dropzone-icon svg {
  width: 28px;
  height: 28px;
}

.dropzone-title {
  display: block;
  margin-top: 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.dropzone-note {
  display: block;
  margin-top: 6px;
  color: var(--text-2);
  max-width: 440px;
  overflow-wrap: anywhere;
}

.upload-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.upload-actions {
  margin-top: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-2);
}

.status-pill.processing {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.status-pill.completed {
  background: var(--success-soft);
  color: var(--success-text);
}

.status-pill.failed {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--t-base);
}

.job-meta {
  margin: 0;
  display: grid;
  gap: 12px;
}

.job-meta div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.job-meta dt {
  margin: 0 0 3px;
  color: var(--text-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}

.job-meta dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.transcript-output {
  min-height: 420px;
  max-height: 68vh;
  overflow: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
  line-height: 1.65;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.history-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.history-title {
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

.history-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-3);
  font-size: 12px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 50;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
}

@media (max-width: 1020px) {
  .workspace-grid,
  .result-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .topbar-subtitle {
    display: none;
  }

  .upload-panel,
  .status-panel,
  .result-panel,
  .history-panel {
    padding: 18px;
  }

  .section-head {
    display: grid;
  }

  .dropzone {
    min-height: 220px;
  }

  .result-actions {
    width: 100%;
  }
}
