:root {
  color-scheme: light;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #14203a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 10%, #d8ebff 0%, rgba(216, 235, 255, 0) 45%),
    radial-gradient(circle at 85% 80%, #ffe9d9 0%, rgba(255, 233, 217, 0) 50%),
    #f5f7fb;
}

.shell {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

h1 {
  margin: 0;
  letter-spacing: 0.01em;
}

h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.subtitle {
  margin: 0;
  opacity: 0.8;
}

.panel {
  border: 1px solid #d4deee;
  border-radius: 12px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 4px 14px rgba(27, 47, 86, 0.05);
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #c4cfe2;
  margin-bottom: 12px;
  font: inherit;
}

.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

button {
  border: none;
  border-radius: 9px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#startBtn {
  background: #0e6dfd;
  color: #fff;
}

#stopBtn {
  background: #e9edf5;
  color: #112349;
}

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

.status {
  margin-bottom: 12px;
}

audio {
  width: 100%;
}

.transcript,
.events,
.calls {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.transcript li,
.events li,
.calls li {
  border: 1px solid #dfe6f3;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fbfcff;
  font-size: 0.95rem;
}

.call-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.intent-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #e9edf5;
  color: #112349;
}

.intent-pill.pay_now,
.intent-pill.promise_to_pay,
.intent-pill.partial_plan {
  background: #d6f2df;
  color: #10552a;
}

.intent-pill.dispute,
.intent-pill.refuse {
  background: #fadada;
  color: #7a1d1d;
}

.intent-pill.callback_requested {
  background: #fdecc8;
  color: #7a4e10;
}

.intent-pill.unclear {
  background: #e6e8ef;
  color: #3a4566;
}

.call-meta {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-left: auto;
}

.call-summary {
  margin: 4px 0;
}

.call-keypoints {
  margin: 4px 0 4px 18px;
  padding: 0;
  font-size: 0.9rem;
}

.call-transcript {
  margin-top: 6px;
  border-top: 1px dashed #dfe6f3;
  padding-top: 6px;
  font-size: 0.88rem;
  white-space: pre-wrap;
}

details > summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: #0e6dfd;
}

.speaker {
  font-weight: 700;
  margin-right: 6px;
}

.hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
  opacity: 0.8;
}

.hint code {
  background: #eef2fa;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.82rem;
}

.defaults-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.defaults-grid label {
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.defaults-grid input {
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid #c4cfe2;
  font: inherit;
  font-weight: 400;
}

.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.upload-row input[type="file"] {
  flex: 1 1 220px;
  padding: 8px;
  border: 1px dashed #c4cfe2;
  border-radius: 7px;
  background: #fbfcff;
}

#importBtn {
  background: #0e6dfd;
  color: #fff;
}

.preview-wrap {
  border: 1px solid #dfe6f3;
  border-radius: 8px;
  background: #fbfcff;
  padding: 8px;
  margin-bottom: 8px;
}

.preview-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.preview-meta span:last-child {
  color: #a04a10;
}

.preview-scroll {
  max-height: 260px;
  overflow: auto;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.preview-table th,
.preview-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #eaeef7;
  white-space: nowrap;
}

.preview-table thead th {
  background: #eef2fa;
  position: sticky;
  top: 0;
}

.preview-table .row-issue {
  background: #fff5f0;
}

.preview-table .bad {
  color: #b03a1a;
  font-weight: 600;
}

.import-log {
  font-size: 0.85rem;
  min-height: 1.2em;
  color: #2a3a64;
}

@media (max-width: 700px) {
  body {
    padding: 12px;
  }
}

