:root {
  color-scheme: dark;
  --bg: #0b1420;
  --surface: #101b2b;
  --surface-soft: #16243a;
  --text: #f3f7fb;
  --muted: #a8bdd6;
  --line: #29405c;
  --accent: #2dd4bf;
  --accent-dark: #14b8a6;
  --danger: #ef4444;
  --warn: #f59e0b;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.08), rgba(11, 20, 32, 0) 160px),
    var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body.embedded-mode {
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

.recorder {
  display: grid;
  gap: 10px;
  width: min(100vw, 430px);
  max-width: 100%;
  margin: 0 auto;
  padding: 10px;
}

.embedded-mode .recorder {
  width: 100%;
  height: 100vh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 9px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand actions"
    "summary summary";
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 68px;
}

.topbar > div:first-child {
  grid-area: brand;
  min-width: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 13px;
  line-height: 1.2;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 850;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
  line-height: 1.25;
}

.topbar p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.top-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

.embedded-mode .topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "summary actions";
  min-height: 34px;
  gap: 7px;
}

.embedded-mode .topbar > div:first-child {
  display: none;
}

.embedded-mode .topbar p {
  display: none;
}

.embedded-mode h1 {
  font-size: 12px;
}

.embedded-mode .compact-summary {
  width: auto;
  min-width: 0;
}

.embedded-mode .top-actions {
  gap: 5px;
  min-width: 0;
}

.embedded-mode .top-actions .ghost,
.embedded-mode .top-actions .danger {
  min-height: 26px;
  padding: 4px 6px;
  font-size: 10px;
}

.embedded-mode .top-actions #hideButton {
  display: none;
}

.compact-summary {
  grid-area: summary;
  display: grid;
  grid-template-columns: auto auto minmax(32px, 1fr);
  grid-template-areas:
    "status duration meter"
    "progress progress progress"
    "mic mic mic";
  align-items: center;
  column-gap: 6px;
  row-gap: 3px;
  min-width: 0;
  width: 100%;
}

.compact-status {
  grid-area: status;
  min-width: 48px;
  border-radius: 7px;
  padding: 4px 6px;
  background: #1e293b;
  color: #cbd5e1;
  text-align: center;
  font-size: 10px;
  font-weight: 850;
}

.compact-status.recording {
  background: #7f1d1d;
  color: #fecaca;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.28), 0 0 18px rgba(239, 68, 68, 0.16);
}

.compact-status.processing,
.compact-status.stopped {
  background: #78350f;
  color: #fde68a;
}

#compactDuration {
  grid-area: duration;
  min-width: 38px;
  color: #f8fafc;
  font: 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

.compact-meter {
  grid-area: meter;
  position: relative;
  display: block;
  height: 8px;
  min-width: 64px;
  overflow: hidden;
  border-radius: 999px;
  background: #1e293b;
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.16);
}

.compact-mic {
  grid-area: mic;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-processing {
  grid-area: progress;
  position: relative;
  display: block;
  height: 4px;
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.compact-processing-total,
.compact-processing-done {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.compact-processing-total {
  background: rgba(148, 163, 184, 0.38);
}

.compact-processing-done {
  background: linear-gradient(90deg, #2dd4bf, #22d3ee);
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.24);
}

.compact-meter-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--compact-audio-level, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #2dd4bf, #84cc16);
  transition: width 80ms linear;
}

.badge {
  min-width: 72px;
  border-radius: 7px;
  padding: 5px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.badge.idle {
  background: #1e293b;
  color: #cbd5e1;
}

.badge.recording {
  background: #7f1d1d;
  color: #fecaca;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3), 0 0 22px rgba(239, 68, 68, 0.16);
}

.badge.processing {
  background: #78350f;
  color: #fde68a;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 27, 43, 0.98), rgba(11, 20, 32, 0.98));
  box-shadow: var(--shadow);
  padding: 10px;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) 86px;
}

.grid.compact {
  grid-template-columns: 86px;
  justify-content: end;
}

.device-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
  margin-top: 8px;
}

.device-row small {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.device-row button {
  min-height: 34px;
}

label {
  display: grid;
  gap: 6px;
  color: #d9e7f7;
  font-size: 11px;
  font-weight: 700;
}

label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

input,
select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #0b1220;
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.inline-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.inline-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(45, 212, 191, 0.24);
  outline-offset: 2px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  background: #17243a;
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  font-size: 11px;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary {
  border-color: var(--accent);
  background: #0f766e;
  color: #ecfeff;
}

.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.ghost {
  min-height: 26px;
  border: 0;
  background: #334155;
  color: #e2e8f0;
  padding: 4px 6px;
}

.danger {
  min-height: 26px;
  border: 0;
  background: var(--danger);
  color: #fff7ed;
  padding: 4px 6px;
}

.danger-outline {
  border-color: rgba(239, 68, 68, 0.48);
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
}

.status {
  min-height: 18px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.embedded-mode .status {
  max-height: 44px;
  overflow: auto;
}

.status.error {
  color: var(--danger);
}

.readiness-status {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 7px;
  background: rgba(120, 53, 15, 0.18);
  color: #fde68a;
  font-size: 11px;
  line-height: 1.3;
}

.readiness-status[data-state="ok"] {
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(15, 118, 110, 0.18);
  color: #ccfbf1;
}

.readiness-status[data-state="bad"] {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(127, 29, 29, 0.24);
  color: #fecaca;
}

.readiness-status strong {
  flex: 0 0 auto;
}

.readiness-status span {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.audio-meter {
  display: grid;
  gap: 7px;
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
}

.audio-meter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.audio-meter-label strong {
  min-width: 92px;
  color: #d9e7f7;
  text-align: right;
  font-size: 11px;
}

.audio-meter-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #1e293b;
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.1);
}

.audio-meter-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--audio-level, 0%);
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #2dd4bf, #84cc16);
  transition: width 80ms linear;
}

.audio-signal-verdict {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.audio-signal-verdict[data-state="ok"] {
  color: #99f6e4;
}

.audio-signal-verdict[data-state="warn"] {
  color: #fecaca;
}

.audio-signal-verdict[data-state="wait"] {
  color: #fde68a;
}

.quality-summary {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(16, 27, 43, 0.72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.quality-summary strong {
  color: var(--text);
}

.quality-summary.ok {
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(13, 83, 74, 0.32);
  color: #bff7ed;
}

.quality-summary.warn {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(120, 74, 9, 0.25);
  color: #fde68a;
}

.quality-summary.bad {
  border-color: rgba(248, 113, 113, 0.46);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
}

.quality-summary.waiting {
  border-color: rgba(148, 163, 184, 0.28);
}

.safety-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(20, 184, 166, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
}

.safety-status strong {
  color: #d9fff7;
  white-space: nowrap;
}

.safety-status span {
  min-width: 0;
  text-align: right;
}

.audio-peak-mark {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: var(--audio-peak, 0%);
  width: 2px;
  border-radius: 999px;
  background: #f59e0b;
  opacity: var(--audio-peak-opacity, 0);
  transition: left 120ms linear, opacity 160ms linear;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.metrics div {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 7px;
}

.metrics div.metric-warn {
  border-color: #f59e0b;
  background: #fff7ed;
}

.metrics strong {
  font-size: 15px;
  line-height: 1.1;
}

.metrics span {
  color: var(--muted);
  font-size: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.processing-progress {
  display: grid;
  gap: 5px;
  margin: -2px 0 9px;
  padding: 7px 8px;
  border: 1px solid rgba(41, 64, 92, 0.72);
  border-radius: 8px;
  background: rgba(11, 18, 32, 0.66);
}

.processing-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.processing-progress-head strong {
  color: #dbeafe;
  font: 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.processing-progress-row {
  display: grid;
  grid-template-columns: minmax(96px, 124px) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.processing-progress-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
}

.processing-progress-label strong {
  flex: 0 0 auto;
  color: #e5edf7;
  font: 10px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.processing-progress-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #0b1220;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.14);
}

.processing-progress-total,
.processing-progress-done {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.processing-progress-total {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.36), rgba(203, 213, 225, 0.58));
}

.processing-progress-done {
  background: linear-gradient(90deg, #14b8a6, #22d3ee);
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.2);
}

.processing-progress-total.live,
.compact-processing-total.live {
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.32), rgba(203, 213, 225, 0.58)),
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(255, 255, 255, 0.1) 12px 18px);
}

.chunk-pipeline-status {
  margin: -2px 0 9px;
  border: 1px solid rgba(41, 64, 92, 0.72);
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(11, 18, 32, 0.74);
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.chunk-pipeline-status[data-state="recording"],
.chunk-pipeline-status[data-state="encoding"],
.chunk-pipeline-status[data-state="queued"],
.chunk-pipeline-status[data-state="sending"] {
  border-color: rgba(45, 212, 191, 0.34);
  color: #ccfbf1;
}

.chunk-pipeline-status[data-state="blocked"],
.chunk-pipeline-status[data-state="error"] {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(127, 29, 29, 0.18);
  color: #fecaca;
}

.chunk-pipeline-status[data-state="done"] {
  border-color: rgba(132, 204, 22, 0.32);
  color: #d9f99d;
}

.embedded-mode .processing-progress {
  margin-bottom: 8px;
  padding: 6px 7px;
}

.embedded-mode .processing-progress-row {
  grid-template-columns: minmax(88px, 112px) minmax(0, 1fr);
  gap: 6px;
}

.embedded-mode .processing-progress-label,
.embedded-mode .processing-progress-label strong,
.embedded-mode .processing-progress-head,
.embedded-mode .processing-progress-head strong {
  font-size: 9px;
}

.technical-log-panel {
  margin-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.technical-log-panel summary {
  cursor: pointer;
  list-style: none;
  padding-top: 8px;
}

.technical-log-panel summary::-webkit-details-marker {
  display: none;
}

.technical-log-panel summary::before {
  content: "▸ ";
}

.technical-log-panel[open] summary::before {
  content: "▾ ";
}

.event-log {
  display: grid;
  gap: 5px;
  max-height: 88px;
  overflow: auto;
  margin-top: 6px;
  padding-top: 6px;
  color: #dbeafe;
  font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.embedded-mode .event-log {
  max-height: 74px;
}

.event-log div {
  white-space: pre-wrap;
  word-break: break-word;
}

.event-log time {
  color: #cbd5e1;
  margin-right: 6px;
}

.event-log .error {
  color: #fecaca;
}

.live-transcript-preview {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(45, 212, 191, 0.06);
}

.live-transcript-preview div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-transcript-preview strong {
  color: #d9fff7;
  font-size: 11px;
  line-height: 1.2;
}

.live-transcript-preview span {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}

.live-transcript-preview p {
  color: #eaf2ff;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.live-transcript-preview.waiting p {
  color: var(--muted);
}

.new-transcript-pulse {
  animation: new-transcript-pulse 1.6s ease-out 1;
}

@keyframes new-transcript-pulse {
  0% {
    border-color: rgba(45, 212, 191, 0.72);
    box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.42);
  }
  55% {
    box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.12);
  }
  100% {
    box-shadow: none;
  }
}

.details-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  scroll-margin-top: 8px;
}

.details-panel summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 10px 10px;
  align-items: start;
}

.lakmus-review {
  margin: 0 10px 10px;
  box-shadow: none;
}

.lakmus-fields {
  display: grid;
  gap: 8px;
}

.embedded-mode .lakmus-fields {
  grid-template-columns: 1fr;
}

textarea {
  width: 100%;
  min-height: 72px;
  max-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #0b1220;
  color: var(--text);
  outline: none;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.draft-advice {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.66);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.draft-advice.ok {
  border-color: rgba(45, 212, 191, 0.42);
  background: rgba(13, 83, 74, 0.26);
  color: #bff7ed;
}

.draft-advice.warn {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(120, 74, 9, 0.22);
  color: #fde68a;
}

.draft-advice.bad {
  border-color: rgba(248, 113, 113, 0.46);
  background: rgba(127, 29, 29, 0.26);
  color: #fecaca;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.draft-evidence {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(45, 212, 191, 0.18);
  border-radius: 7px;
  background: rgba(45, 212, 191, 0.04);
}

.draft-evidence-empty {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.draft-evidence-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.draft-evidence-group {
  display: grid;
  gap: 5px;
}

.draft-evidence-group h3 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.draft-evidence-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  padding: 6px;
  border: 1px solid rgba(168, 189, 214, 0.16);
  border-radius: 6px;
  background: rgba(11, 18, 32, 0.78);
}

.draft-evidence-item > div {
  min-width: 0;
}

.draft-evidence-meta {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.draft-evidence-item p {
  margin-top: 2px;
  color: #dbeafe;
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.draft-evidence-replay {
  min-height: 24px;
  width: 28px;
  padding: 0;
  border-color: rgba(45, 212, 191, 0.4);
  color: var(--accent);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.section-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.section-heading-actions button {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 11px;
}

.transcript-list {
  min-height: 120px;
  max-height: 180px;
  margin: 0;
  overflow: auto;
  color: #e2e8f0;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  display: grid;
  gap: 7px;
}

.embedded-mode .transcript-list {
  max-height: 150px;
}

.transcript-empty {
  margin: 0;
  color: #e2e8f0;
  white-space: pre-wrap;
}

.transcript-segment {
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(41, 64, 92, 0.72);
  border-radius: 7px;
  background: rgba(11, 18, 32, 0.72);
}

.transcript-segment.needs-review {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(120, 53, 15, 0.14);
}

.transcript-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
}

.transcript-time {
  color: #bae6fd;
}

.transcript-speaker {
  color: #e2e8f0;
  font-weight: 800;
}

.transcript-speaker.doctor {
  color: #99f6e4;
}

.transcript-speaker.representative {
  color: #bfdbfe;
}

.transcript-badge {
  border-radius: 999px;
  padding: 1px 6px;
  font: 10px/1.6 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
}

.transcript-badge.term {
  background: rgba(45, 212, 191, 0.12);
  color: #99f6e4;
}

.transcript-badge.review {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

.transcript-replay {
  min-height: 22px;
  min-width: 26px;
  border-radius: 999px;
  padding: 1px 7px;
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(20, 184, 166, 0.18);
  color: #ccfbf1;
  font: 11px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.transcript-replay:disabled {
  opacity: 0.64;
}

.transcript-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.medical-term {
  border-radius: 4px;
  padding: 0 2px;
  background: rgba(45, 212, 191, 0.22);
  color: #f8fafc;
}

@media (max-width: 390px) {
  .embedded-mode .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "summary summary";
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.compact-mode {
  overflow: hidden;
}

.compact-mode .recorder {
  max-width: none;
  padding: 8px;
}

.compact-mode .topbar {
  display: flex;
  align-items: center;
  min-height: 36px;
}

.compact-mode .topbar > div:first-child p {
  display: none;
}

.compact-mode .topbar > div:first-child {
  flex: 0 1 82px;
}

.compact-mode h1 {
  font-size: 12px;
}

.compact-mode .compact-summary {
  width: auto;
  min-width: 112px;
  flex: 1 1 auto;
}

.compact-mode .compact-mic {
  max-width: min(42vw, 170px);
}

.compact-mode .panel,
.compact-mode .metrics {
  display: none;
}

.compact-mode .details-panel {
  display: block;
  max-height: calc(100vh - 54px);
  overflow: auto;
}

.compact-mode #hideButton {
  display: none;
}

.embedded-mode #hideButton {
  display: none;
}

.embedded-mode .topbar > div:first-child {
  min-width: 74px;
}

@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 410px) {
  .recorder {
    padding: 8px;
  }

  .topbar {
    gap: 6px;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  h1 {
    font-size: 12px;
  }

  .top-actions {
    gap: 4px;
  }

  .ghost,
  .danger {
    padding-inline: 5px;
    font-size: 10px;
  }

  .compact-summary {
    min-width: 96px;
    gap: 4px;
  }

  .compact-status {
    min-width: 42px;
    padding-inline: 4px;
  }

  #compactDuration {
    min-width: 34px;
    font-size: 11px;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
