* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0d0d0d;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: #fff;
}

.phone {
  width: 375px;
  height: 780px;
  background: #1a1a1a;
  border-radius: 48px;
  box-shadow: 0 0 0 10px #111, 0 30px 80px rgba(0,0,0,0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── Header ── */
.call-header {
  padding: 48px 24px 20px;
  text-align: center;
  background: linear-gradient(180deg, #1e1e1e 0%, #1a1a1a 100%);
}

.call-label {
  font-size: 13px;
  color: #888;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.school-name {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
}

.agent-name {
  font-size: 14px;
  color: #34c759;
  font-weight: 500;
}

.call-timer {
  font-size: 13px;
  color: #666;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* ── Stage Progress ── */
.stage-progress {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
}

.stage-label {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}

.stage-label span {
  color: #aaa;
  font-weight: 500;
}

.progress-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
  transition: background 0.3s;
}

.dot.active {
  background: #34c759;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.5);
}

.dot.done {
  background: #555;
}

/* ── Transcript ── */
.transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.transcript::-webkit-scrollbar {
  width: 3px;
}
.transcript::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}

.turn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.turn-label {
  font-size: 10px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 4px;
}

.bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 90%;
}

.turn.agent .bubble {
  background: #2a2a2a;
  color: #e0e0e0;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.turn.user .bubble {
  background: #0a84ff;
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.turn.user .turn-label {
  align-self: flex-end;
}

/* ── Status bar ── */
.status-bar {
  padding: 10px 24px;
  text-align: center;
  font-size: 13px;
  color: #666;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.status-bar.listening {
  color: #34c759;
}

.status-bar.thinking {
  color: #ff9f0a;
}

.status-bar.speaking {
  color: #0a84ff;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot.pulse {
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ── Controls ── */
.controls {
  padding: 16px 40px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  background: #1a1a1a;
}

.btn {
  border: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.93);
}

.btn-reset {
  width: 52px;
  height: 52px;
  background: #2a2a2a;
  color: #aaa;
  font-size: 18px;
}

.btn-reset:hover {
  background: #333;
}

.btn-mic {
  width: 72px;
  height: 72px;
  background: #34c759;
  box-shadow: 0 4px 20px rgba(52, 199, 89, 0.35);
  position: relative;
}

.btn-mic.recording {
  background: #ff3b30;
  box-shadow: 0 4px 20px rgba(255, 59, 48, 0.45);
  animation: recording-pulse 1.5s ease infinite;
}

.btn-mic:disabled {
  background: #2a2a2a;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.5;
}

@keyframes recording-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 59, 48, 0.45); }
  50%       { box-shadow: 0 4px 40px rgba(255, 59, 48, 0.8); }
}

/* ── Start overlay ── */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-radius: 48px;
  z-index: 10;
}

.overlay h2 {
  font-size: 20px;
  color: #fff;
  font-weight: 600;
}

.overlay p {
  font-size: 14px;
  color: #666;
  text-align: center;
  max-width: 240px;
  line-height: 1.5;
}

.btn-start {
  margin-top: 8px;
  padding: 14px 36px;
  background: #34c759;
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-start:hover {
  opacity: 0.88;
}

.incoming-icon {
  font-size: 48px;
  animation: ring 1s ease infinite;
}

@keyframes ring {
  0%, 100% { transform: rotate(0deg); }
  20%       { transform: rotate(-15deg); }
  40%       { transform: rotate(15deg); }
  60%       { transform: rotate(-8deg); }
  80%       { transform: rotate(8deg); }
}
