:root {
  --bg: #0b1f1d;
  --panel: #12302d;
  --line: #1d4440;
  --text: #ecfdf8;
  --muted: #9cc5bd;
  --teal: #14b8a6;
  --teal-dark: #0f766e;
  --red: #e5484d;
  --green: #22c55e;
  --amber: #f5a524;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }

.logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--teal-dark);
  color: #fff;
  font-weight: 800;
}

.pill {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}
.pill.online { color: var(--green); }
.pill.connecting { color: var(--amber); }
.pill.offline { color: var(--muted); }
.pill.error { color: var(--red); }

main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 8px 0 24px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 22px;
  text-align: center;
}

.card h1 { font-size: 24px; margin: 12px 0 6px; }
.muted { color: var(--muted); margin: 0 0 12px; }
.note { color: var(--muted); font-size: 13px; margin: 24px 0 0; opacity: .8; }

.ring-icon, .avatar {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--teal-dark);
  font-size: 38px;
}
.call.incoming .avatar { animation: pulse 1.6s ease-out infinite; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(20, 184, 166, .55); }
  100% { box-shadow: 0 0 0 26px rgba(20, 184, 166, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .call.incoming .avatar { animation: none; }
}

.elapsed { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 20px; }

.actions { display: flex; justify-content: center; gap: 28px; margin-top: 28px; flex-wrap: wrap; }

button { font: inherit; cursor: pointer; border: 0; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.round {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.round.answer { background: var(--green); }
.round.decline { background: var(--red); }
.round.mute { background: var(--line); }
.round.mute.on { background: var(--amber); color: #1a1300; }

.primary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: var(--teal);
  color: #04201c;
  font-weight: 700;
  margin-top: 8px;
}

.link { background: none; color: var(--muted); text-decoration: underline; padding: 8px; }

.settings { text-align: left; }
.settings h1 { margin-top: 0; }
label { display: block; margin: 14px 0; }
label span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.error { color: var(--red); min-height: 1.4em; margin: 4px 0; font-size: 14px; }

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 0 20px;
}
.install-btn {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--teal-dark);
  color: #fff;
  font-weight: 600;
}
.hint, .version { color: var(--muted); font-size: 12px; text-align: center; }
