:root {
  --blue: #1a73e8;
  --blue-h: #1557b0;
  --green: #1e8e3e;
  --red: #d93025;
  --text: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --bg: #f8f9fa;
  --white: #fff;
  --chip: #e8f0fe;
  --rail: 220px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
svg { fill: currentColor; width: 22px; height: 22px; display: block; }
.hidden { display: none !important; }
.lock {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top));
}
.lock-card {
  width: min(92vw, 420px);
  background: var(--white);
  border-radius: 28px;
  padding: 32px 24px 24px;
  box-shadow: 0 8px 24px rgba(60,64,67,.15);
  text-align: center;
}
.lock-mark {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--chip); color: var(--blue);
  display: grid; place-items: center;
  font-weight: 700; margin: 0 auto 12px;
}
.lock h1 { margin: 0 0 8px; font-weight: 500; }
.lock p { color: var(--muted); margin: 0 0 16px; }
.lock input[type="password"] {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); font: inherit; margin-bottom: 12px;
}
.stay { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.primary {
  border: 0; background: var(--blue); color: #fff;
  border-radius: 24px; padding: 12px 22px; font: inherit; font-weight: 500; cursor: pointer;
  width: 100%;
}
.ghost {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer; padding: 8px 10px;
}
#phone {
  display: flex;
  height: 100dvh;
  background: var(--white);
}
.rail {
  width: var(--rail);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 12px 10px;
}
.wordmark {
  font-size: 22px;
  font-weight: 500;
  color: var(--muted);
  padding: 12px 16px 20px;
}
.wordmark::first-letter { color: var(--blue); }
.rail nav { display: flex; flex-direction: column; gap: 4px; }
.rail nav button {
  display: flex; align-items: center; gap: 14px;
  border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 14px;
  padding: 12px 16px; border-radius: 0 24px 24px 0;
  cursor: pointer; text-align: left;
}
.rail nav button.active {
  background: var(--chip);
  color: var(--blue);
  font-weight: 500;
}
.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  padding-top: calc(16px + env(safe-area-inset-top));
}
.identity { flex: 1; min-width: 0; }
.identity .label { font-size: 13px; color: var(--muted); }
.identity .number { font-size: 20px; font-weight: 500; }
.notice { color: var(--red); font-size: 13px; margin: 0; min-height: 1em; }
.avail {
  border: 0; border-radius: 16px; padding: 8px 16px;
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  background: var(--chip); color: var(--blue);
}
.avail.off { background: #fce8e6; color: var(--red); }
.avail.busy { background: #fef7e0; color: #b06000; }
.avail.ready { background: #e6f4ea; color: var(--green); }
.callbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin: 0 24px 8px; padding: 14px 18px;
  background: #0b57d0; color: #fff; border-radius: 20px;
}
.call-meta #callPeer { font-weight: 500; font-size: 16px; }
.call-meta .muted { opacity: .85; font-size: 13px; margin-top: 2px; }
.call-controls { display: flex; gap: 8px; align-items: center; }
.ctrl {
  border: 0; background: rgba(255,255,255,.16); color: #fff;
  border-radius: 20px; padding: 8px 14px; font: inherit; cursor: pointer;
}
.ctrl[aria-pressed="true"] { background: #fff; color: var(--blue); }
.end {
  border: 0; background: var(--red); color: #fff;
  border-radius: 24px; padding: 10px 18px; font: inherit; font-weight: 500; cursor: pointer;
}
main { flex: 1; min-height: 0; overflow: auto; position: relative; }
.panel { display: none; padding: 8px 24px 28px; }
.panel.active { display: block; }
.dial {
  min-height: 56px; font-size: 32px; text-align: center;
  letter-spacing: .5px; margin-top: 12px;
}
.hint { text-align: center; color: var(--muted); margin: 4px 0 20px; font-size: 14px; }
.keypad {
  display: grid; grid-template-columns: repeat(3, 76px); gap: 14px;
  justify-content: center;
}
.keypad button {
  width: 76px; height: 76px; border-radius: 50%;
  border: 0; background: #f1f3f4; color: var(--text); cursor: pointer;
}
.keypad button:hover { background: #e8eaed; }
.keypad span { display: block; font-size: 26px; line-height: 1.1; }
.keypad i { display: block; font-style: normal; font-size: 10px; color: var(--muted); letter-spacing: 2px; }
.dial-actions {
  display: flex; gap: 24px; justify-content: center; align-items: center; margin-top: 22px;
}
.icon-round {
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: #f1f3f4; cursor: pointer; font-size: 18px;
}
.icon-round.spacer { visibility: hidden; }
.btn-call {
  width: 64px; height: 64px; border-radius: 50%; border: 0;
  background: var(--green); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.btn-call:disabled { opacity: .4; cursor: not-allowed; }
.btn-call svg { width: 26px; height: 26px; }
.fab {
  position: absolute; right: 24px; bottom: 24px;
  width: 56px; height: 56px; border-radius: 16px; border: 0;
  background: var(--blue); color: #fff; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15);
}
.list { display: flex; flex-direction: column; }
.row-item {
  display: grid; grid-template-columns: 40px 1fr auto;
  gap: 12px; align-items: center;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
  background: transparent; cursor: pointer; text-align: left; width: 100%;
  border-left: 0; border-right: 0; border-top: 0; font: inherit; color: inherit;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--chip); color: var(--blue);
  display: grid; place-items: center; font-weight: 500;
}
.peer { font-weight: 500; }
.muted, .empty { color: var(--muted); font-size: 13px; }
.empty { padding: 48px 8px; text-align: center; }
.dir { font-size: 12px; color: var(--muted); }
.transcript {
  white-space: pre-wrap;
  margin-top: 6px;
  color: var(--text);
  font-size: 14px;
}
.composer {
  position: sticky; bottom: 0; background: var(--white);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  display: grid; gap: 8px;
}
.composer input, .composer textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; font: inherit;
}
.modal {
  position: fixed; inset: 0; background: rgba(32,33,36,.5);
  display: grid; place-items: center; z-index: 40;
}
.modal-card {
  background: #fff; padding: 28px 24px 22px; border-radius: 28px;
  width: min(90vw, 360px); text-align: center;
  box-shadow: 0 8px 24px rgba(60,64,67,.2);
}
.modal-card h2 { font-size: 28px; margin: 8px 0 22px; font-weight: 500; }
.incoming-actions { display: flex; justify-content: center; gap: 28px; align-items: center; }
.incoming-actions .end, .incoming-actions .btn-call {
  width: 64px; height: 64px; border-radius: 50%; padding: 0;
}

@media (max-width: 800px) {
  #phone { flex-direction: column; }
  .rail {
    order: 2; width: 100%; display: flex;
    border-right: 0; border-top: 1px solid var(--line);
    padding: 0 0 env(safe-area-inset-bottom);
  }
  .wordmark { display: none; }
  .rail nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .rail nav button {
    flex-direction: column; gap: 2px; border-radius: 0; padding: 8px 6px 10px;
    font-size: 11px; flex: 1;
  }
  .rail nav button.active { background: transparent; }
  .fab { bottom: 84px; }
  .callbar { flex-direction: column; align-items: stretch; }
  .call-controls { justify-content: flex-end; }
  .topbar { flex-wrap: wrap; align-items: center; }
  .identity { flex: 1 1 auto; min-width: 0; }
  .identity .number { white-space: nowrap; font-size: 18px; }
  .notice { flex: 1 1 100%; order: 5; }
}
