:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #65727d;
  --line: #d9e0e5;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: #e6fffb;
  --warning: #b45309;
  --danger: #b91c1c;
  --success: #15803d;
  --blue: #2563eb;
  --shadow: 0 12px 32px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  padding: 10px 14px;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  background: #e7ecef;
  color: var(--text);
}

button.danger-button {
  background: #fee2e2;
  color: var(--danger);
}

button.danger-button:hover {
  background: #fecaca;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 9px 12px;
  background: #e7ecef;
  color: var(--text);
  text-decoration: none;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: #1f2933;
  color: #f8fafc;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #14b8a6;
  color: #052e2b;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
}

.brand p,
.api-box span {
  color: #b7c2cc;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  background: transparent;
  color: #dbe4ea;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.api-box,
.model-box {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.model-box {
  margin-top: 0;
  border-top: 1px solid #344150;
  padding-top: 14px;
}

.api-box input {
  background: #111827;
  color: #f8fafc;
  border-color: #344150;
}

.model-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #b7c2cc;
  font-size: 13px;
}

.icon-button {
  background: #344150;
  color: #f8fafc;
  padding: 5px 8px;
  font-size: 12px;
}

.model-status {
  border: 1px solid #344150;
  border-radius: 6px;
  background: #111827;
  color: #dbe4ea;
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.model-status.ok {
  border-color: #14b8a6;
}

.model-status.bad {
  border-color: #f97316;
}

.main {
  padding: 30px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar h2 {
  font-size: 26px;
  letter-spacing: 0;
}

.topbar p {
  color: var(--muted);
  margin-top: 4px;
}

.alert {
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff7ed;
  color: var(--warning);
  border: 1px solid #fed7aa;
}

.hidden,
.view {
  display: none;
}

.view.active {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 18px;
}

.dashboard-hero {
  min-height: 156px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  color: #f8fafc;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.96), rgba(31, 41, 51, 0.96)),
    url("data:image/svg+xml,%3Csvg width='900' height='240' viewBox='0 0 900 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.14'%3E%3Cpath d='M0 160 C130 110 220 210 350 150 S580 70 720 135 860 150 900 120'/%3E%3Cpath d='M0 95 C160 40 260 120 390 85 S620 15 790 75 900 70 940 50'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.demo-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 18px;
}

.demo-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.provider-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.provider-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.provider-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.provider-card span {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: #eef2f5;
  color: #344150;
}

.provider-card.ready span {
  color: var(--success);
  background: #ecfdf3;
}

.provider-card.blocked span {
  color: var(--warning);
  background: #fff7ed;
}

.provider-card p,
.provider-card small {
  display: block;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.continuous-call-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px auto;
  align-items: end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.continuous-call-box p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.continuous-call-box label {
  gap: 5px;
}

.continuous-fallback {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.customer-simulator {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 12px 12px;
}

.customer-simulator label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.customer-simulator .inline-check {
  display: inline-flex;
  align-items: center;
  align-self: end;
  gap: 8px;
}

.customer-simulator .inline-check input {
  width: auto;
}

.simulator-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 38px;
}

.simulator-actions span {
  color: var(--muted);
  font-size: 13px;
}

.scenario-preview {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 12px 12px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  line-height: 1.55;
}

.scenario-preview li + li {
  margin-top: 6px;
}

.dashboard-hero h3 {
  margin: 8px 0 8px;
  font-size: 24px;
  letter-spacing: 0;
}

.dashboard-hero p {
  max-width: 680px;
  margin: 0;
  color: #dbeafe;
  line-height: 1.6;
}

.section-kicker {
  color: #99f6e4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.hero-status {
  min-width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.hero-status span {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
  margin-bottom: 6px;
}

.hero-status strong {
  display: block;
  font-size: 20px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -30px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.09);
}

.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.metric-head b {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.panel-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.hidden-form {
  display: none;
}

.metric-card strong {
  font-size: 34px;
  line-height: 1;
}

.metric-green .metric-head b,
.metric-green::after {
  background: rgba(21, 128, 61, 0.12);
}

.metric-green .metric-head b {
  background: var(--success);
}

.metric-orange .metric-head b,
.metric-orange::after {
  background: rgba(180, 83, 9, 0.12);
}

.metric-orange .metric-head b {
  background: var(--warning);
}

.metric-slate .metric-head b,
.metric-slate::after {
  background: rgba(37, 99, 235, 0.1);
}

.metric-slate .metric-head b {
  background: var(--blue);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) 1.35fr;
  gap: 18px;
}

.benchmark-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 18px;
  align-items: start;
}

.benchmark-report-row {
  margin-top: 18px;
  grid-template-columns: minmax(320px, 0.8fr) 1.2fr;
}

.benchmark-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.benchmark-readiness {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 9px 10px;
  line-height: 1.35;
}

.benchmark-readiness.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.benchmark-readiness.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.benchmark-readiness.fail {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.benchmark-sample-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.benchmark-sample {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.benchmark-sample div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.benchmark-sample span,
.benchmark-sample small {
  color: var(--muted);
}

.benchmark-sample p {
  min-height: 44px;
  margin: 0 0 8px;
  color: #344150;
  line-height: 1.45;
}

.benchmark-weights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.benchmark-weights span {
  border-radius: 999px;
  background: #eef2f5;
  color: #344150;
  padding: 5px 9px;
  font-size: 12px;
}

.benchmark-table td:nth-child(2) {
  min-width: 220px;
}

.benchmark-table td:nth-child(9) {
  min-width: 260px;
}

.benchmark-gates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.gate-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #d8e0e7;
  border-radius: 999px;
  background: #f8fafc;
  color: #344150;
  padding: 4px 7px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.gate-chip b {
  color: #64748b;
  font-weight: 700;
}

.gate-chip.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.gate-chip.fail {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.benchmark-detail-row > td {
  padding: 0 8px 12px;
  background: #f8fafc;
}

.benchmark-run-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.benchmark-run-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 10px 12px;
  color: #344150;
  font-weight: 700;
}

.benchmark-run-details summary small {
  color: var(--muted);
  font-weight: 500;
}

.benchmark-detail-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.benchmark-detail-table {
  min-width: 1080px;
}

.benchmark-detail-table th,
.benchmark-detail-table td {
  padding: 8px;
  font-size: 12px;
}

.data-table.benchmark-detail-table td:nth-child(1) {
  min-width: 140px;
}

.data-table.benchmark-detail-table td:nth-child(2),
.data-table.benchmark-detail-table td:nth-child(3),
.data-table.benchmark-detail-table td:nth-child(4),
.data-table.benchmark-detail-table td:nth-child(5) {
  min-width: 130px;
}

.data-table.benchmark-detail-table td:nth-child(6),
.data-table.benchmark-detail-table td:nth-child(7) {
  min-width: 220px;
  color: #344150;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}

.panel-title {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h3 {
  font-size: 16px;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

.panel-title button + button {
  margin-left: 8px;
}

.modal-lock {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.48);
}

.modal-backdrop.active {
  display: grid;
}

.modal-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.24);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
}

.modal-body {
  padding: 18px;
}

.compact-input {
  max-width: 220px;
}

.toolbar-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.small-note {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.audio-player {
  width: 100%;
  margin-top: 12px;
}

.voice-lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  align-items: start;
}

.voice-lab-grid,
.voice-lab-preview-grid,
.voice-lab-ab {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.voice-lab-batch {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px;
  margin: 10px 0 14px;
}

.voice-lab-batch-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 12px;
  align-items: start;
}

.voice-lab-batch-head .small-note {
  margin: 4px 0 0;
}

.voice-lab-case-goal {
  margin: 10px 0;
  color: #344150;
  line-height: 1.6;
}

.voice-lab-variant,
.voice-lab-preview article,
.voice-lab-review {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 12px;
}

.voice-lab-variant p,
.voice-lab-preview p,
.voice-lab-review p {
  margin: 8px 0 0;
  color: #344150;
  line-height: 1.6;
}

.voice-lab-preview {
  display: grid;
  gap: 14px;
}

.voice-lab-preview ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #344150;
  line-height: 1.7;
}

.voice-lab-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-lab-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafb;
  padding: 7px 10px;
  color: #344150;
  font-size: 13px;
}

.voice-lab-tag input {
  width: auto;
}

.voice-lab-history {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.voice-lab-review small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.voice-lab-env {
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: #dbe4ea;
  padding: 12px;
  font-size: 12px;
  line-height: 1.6;
}

.voice-profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

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

.voice-profile-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.voice-profile-card.is-default {
  border-color: #0f766e;
  background: #f0fdfa;
}

.voice-profile-card p {
  margin: 6px 0;
  color: #344150;
  line-height: 1.5;
}

.voice-profile-card small {
  color: var(--muted);
  line-height: 1.45;
}

.checkbox-line {
  display: inline-flex;
  width: auto;
  align-items: center;
  gap: 8px;
  color: #344150;
}

.checkbox-line input {
  width: auto;
}

.recording-archive {
  display: grid;
  gap: 10px;
}

.recording-archive audio {
  width: 100%;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 10px 14px;
  background: #e7ecef;
  color: var(--text);
  text-decoration: none;
}

.voice-test-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.voice-test-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.test-card-title {
  display: grid;
  gap: 3px;
}

.test-card-title strong {
  color: var(--text);
  font-size: 15px;
}

.test-card-title span,
.pipeline-note {
  color: var(--muted);
  font-size: 13px;
}

.small-note[data-ready="false"] {
  color: var(--warning);
}

.pipeline-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.tts-mode-card {
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
  color: #0f3f5f;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.tts-mode-card[data-mode="disabled"] {
  border-color: #fed7aa;
  background: #fff7ed;
  color: var(--warning);
}

.tts-mode-card[data-mode="end2end"] {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.stage-trace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  margin-bottom: 14px;
  display: grid;
  gap: 8px;
}

.stage-trace-empty {
  color: var(--muted);
  font-size: 13px;
}

.stage-trace-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  border-bottom: 1px solid #edf1f5;
  padding-bottom: 7px;
}

.stage-trace-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.stage-trace-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.stage-trace-meta {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.realtime-mode-box {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.realtime-mode-box .pipeline-note {
  margin-bottom: 0;
}

.advanced-debug {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 0;
}

.advanced-debug summary {
  cursor: pointer;
  padding: 12px;
  color: var(--text);
  font-weight: 700;
}

.advanced-debug > .stack,
.advanced-debug > .continuous-call-box,
.advanced-debug > form {
  margin: 0 12px 12px;
}

.advanced-debug .advanced-debug {
  margin: 0 0 12px;
  background: #fff;
}

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

.import-box {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.stack label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.stack .inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stack .inline-check input {
  width: auto;
}

.voice-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}

.voice-controls span,
.recording-controls span {
  color: var(--muted);
  font-size: 13px;
}

.voice-controls.listening span {
  color: var(--accent);
}

.recording-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 38px;
}

.tts-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.tts-controls label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.tts-controls input {
  width: auto;
}

.speak-button {
  margin-top: 10px;
  padding: 7px 10px;
}

.messages,
.list {
  display: grid;
  gap: 10px;
}

.event-log {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
}

.event-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.event-item pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #344150;
  font-size: 12px;
  line-height: 1.5;
}

.stat-list {
  display: grid;
  gap: 14px;
}

.stat-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}

.stat-row-head strong {
  color: var(--text);
}

.stat-bar {
  height: 10px;
  border-radius: 999px;
  background: #e7ecef;
  overflow: hidden;
}

.stat-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

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

.call-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto 64px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.call-row strong {
  display: block;
  margin-bottom: 4px;
}

.call-row p {
  margin: 0;
  color: #344150;
  line-height: 1.45;
}

.call-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.call-row button {
  padding: 8px 10px;
}

.call-result {
  display: grid;
  gap: 14px;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.result-summary div,
.result-block,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.result-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.result-summary strong {
  font-size: 16px;
}

.result-block h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.result-block p {
  margin: 0;
  color: #344150;
  line-height: 1.5;
  white-space: pre-wrap;
}

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

.candidate-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.candidate-item strong {
  display: block;
  margin-bottom: 5px;
}

.candidate-item span {
  justify-self: end;
  color: var(--accent);
  font-weight: 700;
}

.review-form {
  display: grid;
  grid-template-columns: 150px 180px 1fr auto;
  gap: 10px;
  align-items: start;
}

.review-form textarea {
  min-height: 42px;
}

.embed-code {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
  margin-bottom: 14px;
}

.embed-code p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.5;
}

.embed-code pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #344150;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.channel-config-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.channel-config-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.channel-config-form .inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.channel-config-form .inline-check input {
  width: auto;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #344150;
  font-size: 12px;
  line-height: 1.5;
}

.messages {
  min-height: 360px;
  align-content: start;
}

.message,
.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.message.user {
  background: #ecfeff;
}

.message.assistant {
  background: #f0fdf4;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.item-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.item-body {
  color: #344150;
  line-height: 1.5;
  white-space: pre-wrap;
}

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

.compact-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.item-actions button {
  padding: 7px 10px;
}

.table-wrap {
  overflow-x: auto;
}

.route-config-group {
  display: grid;
  gap: 10px;
}

.route-config-group + .route-config-group {
  margin-top: 22px;
}

.route-config-head {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 12px 14px;
}

.route-config-head h4,
.route-config-head p {
  margin: 0;
}

.route-config-head h4 {
  font-size: 15px;
}

.route-config-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

.data-table th {
  color: var(--muted);
  font-weight: 700;
  background: #f8fafc;
}

.data-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.data-table td:nth-child(3),
.data-table td:nth-child(5),
.data-table td:nth-child(6) {
  min-width: 160px;
}

.table-action {
  white-space: nowrap;
  padding: 6px 9px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: #eef2f5;
  color: #344150;
  margin-right: 6px;
}

.pill.open {
  color: var(--warning);
  background: #fff7ed;
}

.pill.resolved,
.pill.closed {
  color: var(--success);
  background: #ecfdf3;
}

.pill.ticket_created {
  color: var(--danger);
  background: #fef2f2;
}

.pill.answered {
  color: var(--success);
  background: #ecfdf3;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .split,
  .benchmark-layout,
  .benchmark-report-row,
  .dashboard-grid,
  .metrics-grid,
  .result-summary,
  .call-row,
  .review-form,
  .candidate-item,
  .continuous-call-box,
  .continuous-fallback,
  .benchmark-fields,
  .benchmark-sample-list,
  .customer-simulator,
  .voice-lab-layout,
  .voice-lab-grid,
  .voice-lab-preview-grid,
  .voice-lab-ab,
  .voice-lab-batch-head,
  .voice-profile-layout,
  .voice-test-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .call-row-meta {
    justify-content: flex-start;
  }
}
