* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #1a1d23;
  color: #e6e9ef;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.phone {
  width: 100%;
  max-width: 480px;
  background: #242830;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 0.75rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle {
  margin: 0;
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.toggle--connect    { background: #16a34a; }
.toggle--connect:hover:not(:disabled)    { background: #15803d; }
.toggle--disconnect { background: #dc2626; }
.toggle--disconnect:hover:not(:disabled) { background: #b91c1c; }

h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.status {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.call-timer {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.8rem;
  color: #e6e9ef;
  font-variant-numeric: tabular-nums;
}

.status--idle      { background: #3a3f4a; color: #9ca3af; }
.status--connecting{ background: #4a3a1a; color: #f59e0b; }
.status--ready     { background: #1a3a2a; color: #34d399; }
.status--ringing   { background: #2a2a4a; color: #60a5fa; }
.status--in-call   { background: #1a3a2a; color: #34d399; }
.status--error     { background: #4a1a1a; color: #f87171; }

details {
  background: #1d2027;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: #9ca3af;
}
.config label {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.75rem;
}

input[type="text"], input[type="password"] {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-top: 0.25rem;
  background: #2d323b;
  border: 1px solid #3a3f4a;
  border-radius: 6px;
  color: #e6e9ef;
  font-size: 0.875rem;
}
input:focus { outline: none; border-color: #60a5fa; }

button {
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
  margin-right: 0.5rem;
  background: #3a3f4a;
  border: none;
  border-radius: 6px;
  color: #e6e9ef;
  font-size: 0.875rem;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #4a4f5a; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

#call-btn    { background: #16a34a; }
#call-btn:hover:not(:disabled)    { background: #15803d; }
#hangup-btn  { background: #dc2626; }
#hangup-btn:hover:not(:disabled)  { background: #b91c1c; }

.dialer {
  background: #1d2027;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.dialer input { font-size: 1.25rem; text-align: center; }
.buttons { display: flex; gap: 0.5rem; margin-top: 1rem; }
.buttons button { flex: 1; padding: 0.75rem; font-size: 1rem; }

.log {
  background: #1d2027;
  border-radius: 8px;
  padding: 1rem;
}
.log h2 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#log {
  margin: 0;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.75rem;
  color: #9ca3af;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
}
