:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #111111);
  --hint: var(--tg-theme-hint-color, #8a8a8e);
  --key: var(--tg-theme-secondary-bg-color, #f0f0f3);
  --green: #2fb65a;
  --red: #e5484d;
  --amber: #f5a524;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
}

body { display: flex; flex-direction: column; padding: 12px 16px 24px; }

.status { display: flex; align-items: center; gap: 8px; color: var(--hint); font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.dot.ok { background: var(--green); }
.dot.err { background: var(--red); }

.screen { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 20px; max-width: 360px; width: 100%; margin: 0 auto; }
.hidden { display: none !important; }

#number {
  width: 100%; border: 0; outline: 0; background: transparent; color: var(--text);
  text-align: center; font-size: 30px; letter-spacing: 1px; padding: 8px 0;
}

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; justify-items: center; }
.key {
  width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--key); color: var(--text);
  font-size: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.key small { font-size: 10px; letter-spacing: 2px; color: var(--hint); }
.key:active { filter: brightness(0.85); }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); justify-items: center; align-items: center; }
.round { width: 72px; height: 72px; border-radius: 50%; border: 0; font-size: 28px; color: #fff; }
.round:active { filter: brightness(0.85); }
.round:disabled { opacity: 0.4; }
.call { background: var(--green); }
.hangup { background: var(--red); }
.ghost { background: var(--key); color: var(--text); font-size: 24px; }
.ghost.on { background: var(--text); color: var(--bg); }

.peer { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.peer .label { color: var(--hint); }
.peer .who { font-size: 30px; word-break: break-all; }
.peer .timer { color: var(--hint); font-variant-numeric: tabular-nums; min-height: 1.3em; }
