:root {
  color-scheme: light;
  --bg: #f5f7f9;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #617080;
  --line: #d9e0e7;
  --accent: #126b5a;
  --accent-weak: #dff3ef;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

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

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

.eyebrow,
.label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0;
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

button.secondary {
  background: #2f3f4f;
}

.status-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.status-panel,
.settings-section,
.calls-section,
.transcript {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-section {
  margin-bottom: 16px;
  padding: 16px;
}

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

h2 {
  font-size: 18px;
  line-height: 1.3;
  margin: 0;
}

.token-row {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: 120px minmax(180px, 280px) auto;
}

.token-row label,
.field-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 40px;
  min-width: 0;
  padding: 8px 10px;
  width: 100%;
}

input:read-only {
  background: #f0f3f6;
}

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

.field {
  display: grid;
  gap: 6px;
}

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

.notice {
  background: #eef5ff;
  border: 1px solid #cfe3ff;
  border-radius: 6px;
  color: #214b77;
  font-weight: 700;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.notice.success {
  background: #eef8f1;
  border-color: #ccebd6;
  color: #1f6a3a;
}

.notice.error {
  background: #fff1f0;
  border-color: #ffd1cd;
  color: var(--danger);
}

.status-panel {
  padding: 16px;
}

.status-panel strong {
  font-size: 22px;
}

.calls-section {
  overflow: hidden;
}

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

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr:focus {
  background: #f0f5f4;
  outline: none;
}

.pill {
  background: var(--accent-weak);
  border-radius: 999px;
  color: var(--accent);
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.empty {
  color: var(--muted);
  padding: 24px 14px;
  text-align: center;
}

.error {
  background: #fff1f0;
  border-bottom: 1px solid #ffd1cd;
  color: var(--danger);
  font-weight: 700;
  padding: 12px 14px;
}

.transcript {
  margin: 16px;
  padding: 14px;
}

pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding: 20px 0;
  }

  .topbar,
  .status-row,
  .settings-grid,
  .section-head,
  .token-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head,
  .actions,
  .form-actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
