body { margin: 0; }

.sidebar {
  width: 240px;
  flex: none;
  background: #0F2A4A;
}
.sidebar .nav-link {
  color: rgba(235, 240, 255, .65);
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
.sidebar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.sidebar .nav-link.active { color: #fff; background: rgba(255, 255, 255, .1); }
.session-box { background: rgba(255, 255, 255, .05); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #F3F6FA;
  font-size: .875rem;
  font-weight: 600;
}
.status-dot { width: 8px; height: 8px; border-radius: 999px; background: #6B7480; }
.status-pill.listening .status-dot { background: #2F6BEB; animation: pulse 1.2s ease-in-out infinite; }
.status-pill.processing .status-dot { background: #6B7480; }
.status-pill.error .status-dot { background: #C0392B; }
.status-pill.loading .status-dot { background: #6B7480; animation: pulse 1.2s ease-in-out infinite; }
.status-pill.paused .status-dot { background: #9AA3AE; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }

.transcript-seg {
  max-width: 640px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #E4E8ED;
}
.transcript-seg .ts { font-family: 'JetBrains Mono', monospace; font-size: .75rem; color: #6B7480; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.speaker-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .02em;
}
.speaker-badge.speaker-unknown { background: #9AA3AE; }
.overlap-tag {
  font-weight: 600;
  color: #C0392B;
  font-size: .7rem;
}

.vocab-tag { display: inline-flex; align-items: center; gap: 6px; }

.upload-dropzone {
  border: 2px dashed #C6CDD6;
  border-radius: 16px;
  padding: 48px 24px;
  background: #fff;
  transition: border-color .15s ease-out, background .15s ease-out;
}
.upload-dropzone.dragover { border-color: #2F6BEB; background: #F0F5FF; }
.status-pill.done .status-dot { background: #2FA84F; }

.status-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6B7480;
}

.waveform { display: flex; align-items: center; gap: 3px; height: 28px; }
.waveform .bar {
  width: 3px;
  border-radius: 2px;
  background: #E4E8ED;
  transform-origin: center;
  transform: scaleY(.04);
  transition: transform .08s ease-out, background .2s ease-out;
}
.waveform.active .bar { background: #2F6BEB; }

.level-track { width: 120px; height: 6px; border-radius: 999px; background: #E4E8ED; overflow: hidden; }
.level-fill { height: 100%; background: #2F6BEB; width: 0%; transition: width .15s ease-out; }
.level-label { font-family: 'JetBrains Mono', monospace; font-size: .7rem; color: #6B7480; width: 46px; text-align: right; }

@media (max-width: 768px) {
  .d-flex.vh-100 { flex-direction: column; }

  .sidebar {
    width: auto;
    flex-direction: row !important;
    align-items: center;
    padding: .5rem .75rem !important;
    gap: .5rem;
  }
  .sidebar > div:first-child { display: none !important; }
  .sidebar #nav-tabs {
    flex-direction: row !important;
    flex: 1;
    gap: 0 !important;
  }
  .sidebar .nav-link { flex: 1; text-align: center; padding: .5rem; font-size: .7rem; }
  .sidebar .nav-link i { margin-right: 0 !important; display: block; font-size: 1.1rem; margin-bottom: 2px; }
  .session-box { display: none; }

  #screen-live .px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
  #screen-live .py-3 { padding-top: .5rem !important; padding-bottom: .5rem !important; }
  #status-meta { display: none; }
  .waveform { display: none; }
  .level-track { width: 60px; }

  #transcript { padding: 1rem !important; }
  .transcript-seg { max-width: 100%; padding: 10px 12px; }

  section.screen.p-4 { padding: 1rem !important; }

  #screen-history { flex-direction: column; }
  #screen-history > div:first-child {
    width: auto !important;
    max-height: 35vh;
    border-inline-end: none !important;
    border-bottom: 1px solid var(--bs-border-color);
  }
  #history-detail { padding: 1rem !important; }
}
