:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --accent: #0f766e;
  --danger: #c2410c;
  --ok: #15803d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.shell { width: min(1120px, calc(100vw - 32px)); margin: 32px auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(24px, 4vw, 36px); letter-spacing: 0; }
h2 { font-size: 18px; }
p, dd, dt { color: var(--muted); }
button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: not-allowed; }
.ghost { color: var(--ink); background: #edf2f7; }
.danger { background: var(--danger); }
.hidden { display: none !important; }
.grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: start; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .06);
}
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button { background: #edf2f7; color: var(--ink); }
.tabs .active { background: var(--accent); color: white; }
.form { display: grid; gap: 12px; max-width: 420px; }
label { display: grid; gap: 6px; font-weight: 700; color: #344054; }
input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
}
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.list { display: grid; gap: 10px; }
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.row small { display: block; color: var(--muted); margin-top: 2px; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #e6f4f1;
  color: #115e59;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.offline { background: #f2f4f7; color: #667085; }
.incoming { border: 1px solid #fed7aa; background: #fff7ed; border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.actions, .call-actions, .inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.call-actions { margin-bottom: 12px; }
.status { display: grid; gap: 8px; margin: 0; }
.status div { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.status dd { margin: 0; text-align: right; }
.event-log {
  min-height: 44px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.compact .row { align-items: start; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #17202a;
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  max-width: min(520px, calc(100vw - 32px));
}

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1120px); margin: 18px auto; }
  .topbar, .grid, .row { display: grid; grid-template-columns: 1fr; }
  .section-title { align-items: start; }
}
