:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #10202a;
  --muted: #60717d;
  --line: #d9e2e8;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --accent: #2563eb;
  --danger: #b42318;
  --success: #13795b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(15, 118, 110, .14), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(37, 99, 235, .10), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { font-weight: 800; font-size: 20px; color: var(--text); }
nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
nav a { color: var(--text); font-weight: 600; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid #111827;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-weight: 800;
  padding: 0 10px;
  cursor: pointer;
}
.install-band {
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.install-qr {
  width: 120px;
  height: 120px;
}
.page { width: min(1120px, calc(100% - 32px)); margin: 32px auto; }
.hero { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 28px; align-items: center; min-height: 520px; }
h1 { font-size: clamp(34px, 6vw, 68px); line-height: 1.02; margin: 8px 0 18px; letter-spacing: 0; }
h2 { margin: 0 0 14px; }
.lead { font-size: 20px; color: var(--muted); max-width: 620px; line-height: 1.55; }
.eyebrow { color: var(--primary); text-transform: uppercase; font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.panel, .auth-card, .grid3 article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}
.home-visual {
  position: relative;
  min-height: 430px;
  display: grid;
  place-items: center;
}
.visual-panel {
  width: min(100%, 360px);
  text-align: center;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
}
.floating-card {
  position: absolute;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
  color: var(--muted);
  font-size: 13px;
}
.floating-card strong { color: var(--text); font-size: 18px; }
.call-card-one { top: 34px; left: 0; }
.call-card-two { right: 0; bottom: 44px; }
.narrow, .auth-card { max-width: 520px; margin: 0 auto; }
label { display: block; font-weight: 700; margin: 14px 0 6px; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
}
textarea { min-height: 120px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.button.wide { width: 100%; margin-top: 12px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.big-id { font-size: 36px; font-weight: 900; letter-spacing: 0; margin: 12px 0; }
.muted { color: var(--muted); }
.alert { background: #fff1f0; color: var(--danger); padding: 12px; border-radius: 6px; }
.success { background: #e8f7f1; color: var(--success); padding: 12px; border-radius: 6px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 24px; }
.grid3 article {
  transition: transform .18s ease, box-shadow .18s ease;
}
.grid3 article:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 48px rgba(15, 23, 42, .10);
}
.room-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 14px;
}
.call-stage {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 420px;
  gap: 46px;
  align-items: center;
  min-height: calc(100vh - 130px);
}
.call-copy {
  max-width: 620px;
}
.mini-stats {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0 16px;
}
.mini-stats span { color: var(--muted); }
.mini-stats strong { font-size: 22px; }
.phone-shell {
  width: min(100%, 390px);
  min-height: 720px;
  justify-self: center;
  border-radius: 42px;
  padding: 14px;
  background: linear-gradient(145deg, #17212b, #030712);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
  position: relative;
}
.phone-speaker {
  width: 92px;
  height: 6px;
  background: #293548;
  border-radius: 999px;
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}
.phone-screen {
  min-height: 692px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, .16), transparent 36%),
    #ffffff;
  padding: 42px 22px 24px;
  overflow: hidden;
  position: relative;
}
.phone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 5px rgba(22, 163, 74, .12);
}
.caller-avatar {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: linear-gradient(145deg, #0f766e, #2563eb);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 36px auto 18px;
  font-size: 42px;
  box-shadow: 0 18px 38px rgba(15, 118, 110, .24);
}
.phone-label {
  text-align: center;
  color: var(--muted);
  margin: 0;
  font-weight: 700;
}
.phone-id {
  text-align: center;
  font-size: 34px;
  font-weight: 900;
  margin: 4px 0 28px;
}
.phone-input-label {
  font-size: 13px;
  color: var(--muted);
}
.phone-input {
  min-height: 54px;
  border-radius: 14px;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .04em;
}
.phone-input.compact {
  min-height: 46px;
  font-size: 18px;
}
.phone-call-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  margin-top: 14px;
  background: #16a34a;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}
.phone-action-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.message-round {
  text-decoration: none;
  background: #2563eb;
  color: #fff;
}
.message-link {
  position: relative;
}
.unread-dot {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
}
.phone-message {
  min-height: 24px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}
.error-text { color: var(--danger) !important; }
.incoming-phone {
  position: absolute;
  inset: 110px 22px auto;
  z-index: 3;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .18);
}
.phone-active {
  position: absolute;
  inset: 82px 16px 16px;
  background: #fff;
  z-index: 4;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
}
.round-control {
  min-width: 72px;
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  background: #e2e8f0;
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}
.round-control.accept { background: #16a34a; color: #fff; }
.round-control.reject { background: var(--danger); color: #fff; }
.call-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.hidden { display: none !important; }
.incoming { margin-top: 22px; padding: 18px; border-radius: 8px; background: #ecfeff; border: 1px solid #a5f3fc; }
.active-call { margin-top: 22px; }
.call-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }
.video-tile, .local-video { min-height: 180px; background: #111827; border-radius: 8px; overflow: hidden; }
.local-video { margin-top: 12px; max-width: 220px; }
.profile-row { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; }
.avatar { width: 96px; height: 96px; border-radius: 8px; object-fit: cover; background: #e2e8f0; }
.share-box {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 18px 0;
  background: #f8fafc;
}
.qr {
  width: 160px;
  height: 160px;
  display: block;
  margin-top: 12px;
  border-radius: 8px;
}
.room-people { margin-top: 24px; }
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.person-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}
.person-card audio,
.panel audio {
  width: 100%;
  margin-top: 10px;
}
.global-call-pop {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(340px, calc(100% - 36px));
  z-index: 50;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
  padding: 16px;
  display: grid;
  gap: 10px;
}
.contact-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.message-thread {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.message-thread p {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0;
}
.message-thread .mine { background: #dcfce7; }
.message-thread .theirs { background: #e0f2fe; }
.message-thread span { color: var(--muted); font-size: 12px; }
.share-home { margin-top: 24px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
.table th, .table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.adminbar { border-bottom-color: #b7c6cf; }

@media (max-width: 780px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 14px 16px; gap: 10px; }
  .hero, .call-layout, .call-stage, .grid3 { grid-template-columns: 1fr; min-height: auto; }
  .inline-form { grid-template-columns: 1fr; }
  h1 { font-size: 42px; }
  .phone-shell { min-height: 660px; }
  .phone-screen { min-height: 632px; }
  .floating-card { position: static; margin: 10px; }
  .install-band { flex-direction: column; align-items: stretch; }
  .contact-row { grid-template-columns: 1fr; }
}

/* TalkID phone-style user interface */
.phone-os-body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #0b0b0f;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Arial, sans-serif;
}

.phone-device {
  width: min(390px, 100vw);
  height: min(932px, 100dvh);
  position: relative;
}

.phone-viewport {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, .72);
}

.desktop-speaker { display: none; }

.ios-status {
  position: relative;
  z-index: 4;
  height: 54px;
  padding: max(13px, env(safe-area-inset-top)) 24px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  font-weight: 800;
  font-size: 18px;
}

.ios-page-title {
  font-size: 13px;
  color: rgba(0, 0, 0, .52);
  align-self: center;
}

.ios-icons {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
}

.signal-bars {
  width: 24px;
  height: 16px;
  display: inline-block;
  background: linear-gradient(to right, #111 4px, transparent 4px 7px, #111 7px 11px, transparent 11px 14px, #111 14px 18px, transparent 18px 21px, #111 21px);
  border-radius: 4px;
}

.wifi-mark {
  font-size: 24px;
  line-height: 1;
  transform: rotate(180deg);
}

.battery-mark {
  min-width: 34px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.ios-nav {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  padding: 8px 18px 10px;
}

.ios-nav h1 {
  margin: 0;
  text-align: center;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 900;
}

.ios-nav-btn {
  width: 44px;
  height: 44px;
  border: 1.5px solid rgba(0, 0, 0, .72);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #111;
  background: rgba(255, 255, 255, .58);
  backdrop-filter: blur(12px);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

.home-screen {
  height: 100%;
  color: #fff;
  background:
    radial-gradient(circle at 32% 13%, rgba(255, 238, 142, .8), transparent 28%),
    radial-gradient(circle at 78% 36%, rgba(183, 43, 124, .7), transparent 35%),
    radial-gradient(circle at 26% 73%, rgba(120, 192, 255, .48), transparent 33%),
    linear-gradient(145deg, #e7c86e, #aa3e86 62%, #465fc4);
  padding: 0 22px 24px;
  overflow-y: auto;
}

.talkid-widget {
  margin: 12px 0 22px;
  padding: 18px;
  border-radius: 28px;
  background: rgba(255, 255, 255, .78);
  color: #111;
  box-shadow: 0 20px 45px rgba(0, 0, 0, .14);
  backdrop-filter: blur(18px);
}

.talkid-widget .eyebrow {
  color: #007aff;
  letter-spacing: 0;
  text-transform: none;
}

.talkid-widget h1 {
  font-size: 34px;
  margin: 4px 0 8px;
}

.talkid-widget p {
  margin: 0;
  color: #555;
  line-height: 1.38;
}

.home-id-pill {
  display: inline-flex;
  margin-top: 14px;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(0, 122, 255, .12);
  color: #0a4ea3;
  font-weight: 900;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 4.7vw, 24px) 15px;
  padding-bottom: 122px;
}

.app-icon-link {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .36);
  font-size: 13px;
  font-weight: 700;
}

.app-icon {
  position: relative;
  width: clamp(58px, 18vw, 74px);
  aspect-ratio: 1;
  border-radius: 23%;
  display: grid;
  place-items: center;
  font-size: clamp(25px, 8vw, 34px);
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, .48), 0 10px 22px rgba(0, 0, 0, .22);
  animation: iconFloat .62s ease both;
}

.app-badge,
.tab-badge {
  position: absolute;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ff3b30;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .18);
}

.app-badge {
  top: -7px;
  right: -8px;
}

.app-icon.calendar {
  background: #fff;
  color: #111;
  font-size: 18px;
  align-content: center;
}

.app-icon.calendar strong {
  display: block;
  color: #ff2d55;
  font-size: 13px;
}

.app-dock {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 20px;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 13px 16px;
  border-radius: 36px;
  background: rgba(255, 255, 255, .32);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, .32);
}

.app-dock .app-icon {
  width: clamp(44px, 12vw, 58px);
}

.app-dock .app-icon-link {
  font-size: 11px;
  gap: 4px;
}

@keyframes iconFloat {
  from { opacity: 0; transform: translateY(18px) scale(.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ios-screen {
  height: 100%;
  overflow-y: auto;
  background: #fff;
  color: #08080a;
  padding-bottom: 112px;
}

.ios-content {
  padding: 8px 22px 96px;
}

.ios-card,
.ios-list,
.ios-form {
  background: rgba(255, 255, 255, .9);
  border: 1px solid #e9e9ee;
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .06);
}

.ios-list {
  padding: 0 0 0 16px;
  overflow: hidden;
}

.ios-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 10px 13px 0;
  border-bottom: 1px solid #ececf0;
  color: #111;
}

.ios-row:last-child { border-bottom: 0; }

.ios-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  object-fit: cover;
  background: linear-gradient(145deg, #9ab7e5, #7786cd);
  color: #fff;
  font-weight: 900;
  font-size: 20px;
}

.ios-row h3,
.ios-row p {
  margin: 0;
}

.ios-row h3 {
  font-size: 17px;
}

.ios-row p {
  color: #73737b;
  margin-top: 4px;
  line-height: 1.28;
}

.ios-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.mini-round {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  display: inline-grid;
  place-items: center;
  background: #f1f1f4;
  color: #007aff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.mini-round.call { color: #0a8f35; }
.mini-round.msg { color: #007aff; }
.mini-round.danger { color: #fff; background: #ff3b30; }

.ios-button,
.ios-form .button,
.ios-card .button {
  min-height: 46px;
  border-radius: 16px;
  border: 0;
  padding: 0 16px;
  background: #007aff;
  color: #fff;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ios-button.secondary {
  background: #f1f1f4;
  color: #111;
}

.ios-button.danger {
  background: #ff3b30;
}

.ios-form input,
.ios-form select,
.ios-form textarea,
.ios-card input,
.ios-card select,
.ios-card textarea {
  border-radius: 16px;
  border: 0;
  background: #f2f2f7;
}

.keypad-screen {
  height: 100%;
  background: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dial-display {
  min-height: 132px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 0 18px 6px;
}

.dial-value {
  width: 100%;
  min-height: 46px;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: clamp(24px, 8vw, 40px);
  font-weight: 400;
  letter-spacing: 0;
  color: #111;
  outline: none;
}

.dial-subtitle {
  color: #777;
  font-weight: 700;
  margin-top: 2px;
  text-align: center;
}

.dial-tools {
  width: min(100%, 330px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.dial-tools .ios-button {
  min-height: 38px;
  border-radius: 18px;
  padding: 0 10px;
  font-size: 12px;
}

.instruction-link {
  margin-top: 7px;
  color: #007aff;
  font-size: 13px;
  font-weight: 800;
}

.dialer-body {
  flex: 1;
  min-height: 0;
  padding: 18px 0 92px;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  align-items: center;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: center;
  gap: clamp(10px, 2.2vh, 18px) clamp(18px, 5.5vw, 30px);
  padding: 0 18px;
}

.key {
  width: clamp(66px, 18vw, 86px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: #e5e5e7;
  color: #050505;
  display: grid;
  place-items: center;
  align-content: center;
  font-size: clamp(30px, 8.5vw, 44px);
  font-weight: 400;
  cursor: pointer;
}

.key small {
  display: block;
  margin-top: -2px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
}

.dial-actions {
  padding: 6px 28px 0;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 1fr 76px 1fr;
  align-items: center;
  justify-items: center;
}

.home-round {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  justify-self: center;
  margin-top: 6px;
  background: #f1f1f4;
  color: #111;
  font-size: 23px;
  font-weight: 900;
}

.phone-tabbar {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: max(10px, env(safe-area-inset-bottom));
  margin: 0;
  border: 1.5px solid #3c3c43;
  border-radius: 30px;
  min-height: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  background: rgba(255, 255, 255, .82);
}

.phone-tabbar a {
  position: relative;
  color: #111;
  display: grid;
  justify-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
}

.tab-icon-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 18px;
}

.tab-badge {
  top: -10px;
  right: -16px;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
}

.phone-tabbar .active {
  color: #007aff;
  background: #ededee;
  border-radius: 28px;
  padding: 8px 0;
  margin: 0 4px;
}

.call-fab {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0;
  background: #078b32;
  color: #fff;
  font-size: 29px;
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(0, 118, 42, .28);
}

.call-fab small {
  display: block;
  margin-top: -3px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
}

.call-mobile-icon {
  line-height: 1;
}

.call-fab.end { background: #ff3b30; }

.message-fab,
.backspace-fab {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: #f1f1f4;
  color: #111;
  font-size: 25px;
  display: grid;
  place-items: center;
}

.dial-message {
  min-height: 20px;
  color: #c12720;
  text-align: center;
  font-weight: 800;
  padding: 0 22px;
}

.active-call-sheet {
  position: absolute;
  inset: 88px 18px 92px;
  z-index: 6;
  border-radius: 34px;
  background: linear-gradient(180deg, #1d2939, #060a12);
  color: #fff;
  padding: 24px 18px;
  text-align: center;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .32);
}

.message-list-row {
  grid-template-columns: 12px 52px 1fr auto;
}

.ios-row.is-unread h3,
.ios-row.is-unread p,
.message-list-row.is-unread h3,
.message-list-row.is-unread p {
  color: #c12720;
  font-weight: 900;
}

.unread-blue {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #007aff;
}

.chat-thread {
  height: calc(100dvh - 235px);
  min-height: 360px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px 0;
}

.bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 19px;
  margin: 0;
  line-height: 1.32;
}

.bubble.mine {
  justify-self: end;
  background: #34c759;
  color: #fff;
}

.bubble.theirs {
  justify-self: start;
  background: #e9e9eb;
  color: #111;
}

.bubble span {
  display: block;
  margin-top: 4px;
  opacity: .72;
  font-size: 11px;
}

.message-compose {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
  align-items: end;
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 5;
  padding: 8px 0 6px;
  background: #fff;
}

.message-compose textarea {
  min-height: 44px;
  max-height: 96px;
  border-radius: 22px;
  resize: vertical;
}

.room-card {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #ececf0;
}

.room-card:last-child { border-bottom: 0; }

.room-icon.ios-room {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  margin: 0;
}

.install-instructions {
  display: grid;
  gap: 12px;
}

.store-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 0;
  background: #f2f2f7;
  border-radius: 20px;
  padding: 12px;
  color: #111;
  cursor: pointer;
}

.ios-install-popup {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .32);
  backdrop-filter: blur(12px);
}

.ios-install-card {
  position: relative;
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  border-radius: 28px;
  background: #fff;
  color: #050505;
  text-align: center;
  padding: 26px 20px;
  box-shadow: 0 28px 75px rgba(0, 0, 0, .28);
}

.ios-install-card h2 {
  margin: 0 0 18px;
  font-size: 30px;
}

.ios-install-card ol {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: grid;
  gap: 8px;
  font-size: 20px;
}

.ios-install-card li strong {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  margin-right: 8px;
  background: linear-gradient(145deg, #9ab7e5, #5f789a);
  color: #fff;
}

.ios-install-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f2f2f7;
  font-size: 24px;
}

.ios-install-demo {
  margin: 18px auto 0;
  padding: 14px;
  border-radius: 18px;
  background: #f1f2f6;
  display: grid;
  gap: 11px;
}

.demo-bar,
.demo-menu,
.demo-add {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 10px;
  background: #fff;
  color: #444;
}

.demo-share {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border: 3px solid #ff3b30;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #007aff;
  font-size: 26px;
}

.demo-menu img,
.demo-add img {
  width: 32px;
  height: 32px;
}

.demo-add button {
  border: 0;
  border-radius: 8px;
  background: #007aff;
  color: #fff;
  padding: 7px 10px;
}

.store-icon {
  width: 58px;
  aspect-ratio: 1;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 25px;
  font-weight: 900;
  box-shadow: inset 0 1px rgba(255, 255, 255, .48), 0 10px 22px rgba(0, 0, 0, .16);
}

.play-store-icon {
  background: conic-gradient(from 35deg, #34a853, #fbbc05, #ea4335, #4285f4, #34a853);
}

.app-store-icon {
  background: linear-gradient(145deg, #34c8ff, #007aff 62%, #5856d6);
}

.global-call-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .28);
  backdrop-filter: blur(14px);
}

.global-call-pop {
  position: fixed;
  inset: 0;
  z-index: 91;
  width: auto;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 20px;
}

.incoming-phone-card {
  width: min(360px, calc(100vw - 40px));
  min-height: 470px;
  border-radius: 38px;
  background: linear-gradient(180deg, rgba(23, 32, 45, .96), rgba(7, 10, 16, .98));
  color: #fff;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .42);
}

.incoming-state {
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-weight: 700;
}

.incoming-avatar {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  background: linear-gradient(145deg, #9ab7e5, #7786cd);
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
}

.incoming-subtitle {
  color: rgba(255, 255, 255, .62);
}

.incoming-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.call-circle {
  border: 0;
  background: transparent;
  color: #fff;
  display: grid;
  justify-items: center;
  gap: 8px;
  cursor: pointer;
}

.call-circle span {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
}

.call-circle small { font-weight: 700; }
.call-circle.accept span { background: #34c759; }
.call-circle.reject span { background: #ff3b30; }
.call-circle.message span { background: #007aff; }

@media (min-width: 760px) {
  .phone-device {
    width: 360px;
    height: min(780px, calc(100vh - 32px));
    border: 10px solid #111827;
    border-radius: 48px;
    padding: 0;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .32);
    overflow: hidden;
    background: #111827;
  }

  .desktop-speaker {
    display: block;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 6px;
    border-radius: 999px;
    background: #293548;
    z-index: 10;
  }

  .phone-viewport {
    border-radius: 36px;
  }

  .ios-status {
    height: 42px;
    padding: 10px 18px 0;
    font-size: 15px;
  }

  .ios-page-title {
    font-size: 11px;
  }

  .battery-mark {
    min-width: 28px;
    height: 17px;
    font-size: 10px;
  }

  .dial-display {
    min-height: 108px;
    padding: 0 16px 4px;
  }

  .dial-value {
    min-height: 34px;
    font-size: 27px;
  }

  .dial-subtitle {
    font-size: 12px;
  }

  .dial-tools {
    width: min(100%, 280px);
    gap: 6px;
    margin-top: 6px;
  }

  .dial-tools .ios-button {
    min-height: 30px;
    border-radius: 14px;
    font-size: 10px;
    padding: 0 8px;
  }

  .instruction-link {
    margin-top: 5px;
    font-size: 11px;
  }

  .dialer-body {
    padding-bottom: 82px;
  }

  .keypad-grid {
    gap: 8px 20px;
    padding: 0 14px;
  }

  .key {
    width: clamp(54px, 8.5vh, 68px);
    font-size: 32px;
  }

  .key small {
    font-size: 8px;
    letter-spacing: 1.5px;
  }

  .home-round {
    width: 36px;
    height: 36px;
    margin-top: 5px;
    font-size: 17px;
  }

  .dial-message {
    min-height: 16px;
    font-size: 11px;
    padding: 0 14px;
  }

  .dial-actions {
    grid-template-columns: 1fr 60px 1fr;
    padding: 5px 28px 8px;
  }

  .call-fab {
    width: 58px;
    height: 58px;
    font-size: 27px;
  }

  .message-fab,
  .backspace-fab {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .active-call-sheet {
    inset: 62px 14px 70px;
    border-radius: 26px;
    padding: 16px 12px;
  }

  .active-call-sheet h2 {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .active-call-sheet .call-controls {
    gap: 7px;
    justify-content: center;
  }

  .active-call-sheet .round-control {
    min-width: 54px;
    min-height: 42px;
    border-radius: 14px;
    font-size: 12px;
  }

  .phone-tabbar {
    left: 14px;
    right: 14px;
    bottom: 8px;
    min-height: 56px;
    border-radius: 28px;
  }

  .phone-tabbar a {
    font-size: 10px;
    gap: 2px;
  }

  .phone-tabbar .active {
    padding: 7px 0;
    margin: 0 3px;
  }

  .home-screen {
    padding: 0 16px 18px;
  }

  .talkid-widget {
    margin: 8px 0 14px;
    padding: 14px;
    border-radius: 22px;
  }

  .talkid-widget h1 {
    font-size: 25px;
    margin: 3px 0 6px;
  }

  .talkid-widget p {
    font-size: 13px;
    line-height: 1.32;
  }

  .home-id-pill {
    margin-top: 10px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .app-grid {
    gap: 13px 9px;
    padding-bottom: 98px;
  }

  .app-icon-link {
    gap: 4px;
    font-size: 10px;
  }

  .app-icon {
    width: 52px;
    font-size: 24px;
    box-shadow: inset 0 1px rgba(255, 255, 255, .48), 0 7px 15px rgba(0, 0, 0, .18);
  }

  .app-icon.calendar {
    font-size: 14px;
  }

  .app-icon.calendar strong {
    font-size: 10px;
  }

  .app-dock {
    left: 12px;
    right: 12px;
    bottom: 14px;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 28px;
  }

  .app-dock .app-icon {
    width: 42px;
  }

  .app-dock .app-icon-link {
    font-size: 9px;
    gap: 3px;
  }
}

@media (max-width: 430px) {
  .phone-device {
    width: 100vw;
    height: 100dvh;
  }

  .app-grid {
    gap: 15px 10px;
  }

  .dialer-body {
    padding-top: 14px;
    padding-bottom: 92px;
  }

  .keypad-grid {
    gap: clamp(9px, 1.8vh, 15px) clamp(16px, 4.8vw, 24px);
    padding-inline: 16px;
  }

  .key small {
    font-size: 11px;
    letter-spacing: 2px;
  }
}

@media (max-height: 760px) {
  .ios-status {
    height: 44px;
    padding-top: max(9px, env(safe-area-inset-top));
    font-size: 16px;
  }

  .dial-display {
    min-height: 118px;
  }

  .dialer-body {
    padding-top: 10px;
    padding-bottom: 84px;
  }

  .key {
    width: clamp(58px, 15.5vw, 74px);
  }

  .keypad-grid {
    gap: 9px 18px;
  }

  .call-fab {
    width: 64px;
    height: 64px;
  }

  .dial-actions {
    padding-top: 4px;
    margin-bottom: 4px;
  }

  .home-round {
    margin-top: 4px;
  }

  .phone-tabbar {
    min-height: 58px;
  }
}

/* Cross-device consistency and bottom-bar clearance */
.phone-os-body {
  overflow: auto;
}

.ios-screen {
  padding-bottom: 170px;
}

.ios-content {
  padding-bottom: 170px;
}

.home-screen {
  padding-bottom: 156px;
}

.app-grid {
  padding-bottom: 156px;
}

.talkid-widget:last-of-type,
.ios-card:last-child,
.ios-list:last-child,
.ios-form:last-child {
  margin-bottom: 34px;
}

.ios-row {
  grid-template-columns: 52px minmax(0, 1fr) auto;
}

.ios-row > div,
.ios-row h3,
.ios-row p,
.talkid-widget,
.ios-card,
.ios-form,
.ios-list {
  min-width: 0;
}

.ios-row h3,
.ios-row p,
.big-id,
.dial-value,
.talkid-widget input,
.ios-card input {
  overflow-wrap: anywhere;
}

.ios-actions {
  flex-wrap: nowrap;
}

.big-id {
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.08;
}

.profile-row {
  align-items: center;
}

.dial-target-blink,
.dial-notice {
  text-align: center;
  color: #60717d;
  font-weight: 800;
  padding: 0 22px;
}

.dial-target-blink {
  margin-top: -2px;
  min-height: 20px;
  color: #007aff;
}

.dial-value-blink {
  animation: dialPulse 1.45s ease-in-out infinite;
}

@keyframes dialPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

.dial-notice {
  margin: 2px 0 4px;
  font-size: 12px;
  line-height: 1.25;
}

.message-limit-card {
  margin-bottom: 12px;
}

@media (min-width: 760px) {
  .phone-device {
    width: min(370px, calc(100vw - 24px));
    height: min(812px, calc(100dvh - 24px));
  }

  .ios-status {
    height: 54px;
    padding: max(13px, env(safe-area-inset-top)) 24px 0;
    font-size: 18px;
  }

  .ios-page-title {
    font-size: 13px;
  }

  .ios-nav h1 {
    font-size: 22px;
  }

  .ios-row h3 {
    font-size: 17px;
  }

  .ios-row p,
  .talkid-widget p,
  .ios-card p,
  .ios-form,
  .ios-card input,
  .ios-form input {
    font-size: 16px;
  }

  .phone-tabbar {
    left: 14px;
    right: 14px;
    bottom: max(10px, env(safe-area-inset-bottom));
    min-height: 58px;
  }

  .phone-tabbar a {
    font-size: 10px;
  }

  .phone-tabbar .tab-icon-wrap {
    font-size: 13px;
  }

  .phone-tabbar .active {
    padding: 6px 0;
    margin: 0 3px;
  }

  .app-dock {
    bottom: 20px;
  }
}

@media (max-width: 380px) {
  .ios-content {
    padding-inline: 16px;
  }

  .ios-row {
    gap: 9px;
  }

  .mini-round {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
}

/* Call screen must stay fully visible in narrow, short, and rotated windows. */
.keypad-screen .ios-status {
  height: clamp(32px, 6dvh, 54px);
}

.keypad-screen .dial-display {
  min-height: auto;
  padding: 0 18px clamp(1px, .5dvh, 5px);
  gap: clamp(2px, .45dvh, 7px);
  transform: translateY(-6px);
}

.keypad-screen .dial-value {
  min-height: clamp(30px, 5dvh, 46px);
  font-size: clamp(24px, min(7vw, 5.6dvh), 40px);
}

.keypad-screen .dial-subtitle {
  font-size: clamp(12px, 2.1dvh, 16px);
  margin-top: 0;
}

.keypad-screen .dial-tools {
  margin-top: 0;
}

.keypad-screen .instruction-link {
  margin-top: 0;
}

.keypad-screen .dialer-body {
  padding: 0 0 clamp(86px, 12dvh, 104px);
  align-content: stretch;
  grid-template-rows: 1fr auto;
  transform: translateY(-8px);
}

.keypad-screen .keypad-grid {
  align-content: center;
  gap: clamp(6px, 1.35dvh, 16px) clamp(12px, 4vw, 28px);
  padding-inline: 14px;
}

.keypad-screen .key {
  width: clamp(48px, min(18vw, 10.4dvh), 86px);
  font-size: clamp(24px, min(8vw, 5.7dvh), 44px);
}

.keypad-screen .key small {
  font-size: clamp(8px, 1.5dvh, 11px);
}

.keypad-screen .dial-message {
  min-height: clamp(12px, 2.2dvh, 20px);
  margin: 0;
}

.keypad-screen .dial-actions {
  padding-top: clamp(1px, .45dvh, 6px);
  margin-bottom: 0;
  grid-template-columns: 1fr clamp(54px, 9dvh, 72px) 1fr;
  transform: translateY(-6px);
}

.keypad-screen .call-fab {
  width: clamp(54px, 9dvh, 72px);
  height: clamp(54px, 9dvh, 72px);
}

.keypad-screen .message-fab,
.keypad-screen .backspace-fab {
  width: clamp(34px, 6dvh, 46px);
  height: clamp(34px, 6dvh, 46px);
}

@media (orientation: landscape) and (max-height: 620px) {
  .keypad-screen .dial-tools,
  .keypad-screen .instruction-link {
    display: none;
  }

  .keypad-screen .dial-display {
    padding-top: 0;
  }

  .keypad-screen .phone-tabbar {
    min-height: 52px;
  }
}

@media (max-height: 700px) {
  .keypad-screen .dial-tools {
    width: min(100%, 290px);
  }

  .keypad-screen .dial-tools .ios-button {
    min-height: 30px;
    font-size: 11px;
  }

  .keypad-screen .phone-tabbar {
    min-height: 54px;
  }
}

/* Compact two-line rows for message/contact lists. */
.ios-list .ios-row {
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-right: 12px;
}

.ios-list .ios-row .ios-avatar {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.ios-list .ios-row h3 {
  font-size: 15px;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.ios-list .ios-row p {
  font-size: 13px;
  line-height: 1.22;
  margin-top: 3px;
}

.ios-list .ios-row .ios-actions {
  grid-column: 2;
  justify-self: end;
  margin-top: 4px;
}

.message-list-row {
  grid-template-columns: 10px 42px minmax(0, 1fr) !important;
}

.message-list-row > .muted:last-child {
  grid-column: 3;
  justify-self: start;
  font-size: 12px;
  line-height: 1.2;
}

.message-list-row h3,
.message-list-row p {
  white-space: normal;
}

.chat-thread {
  height: auto;
  min-height: 0;
  padding-bottom: 88px;
}

.chat-thread .bubble {
  font-size: 14px;
}

@media (min-width: 760px) {
  .ios-list .ios-row h3 {
    font-size: 14px;
  }

  .ios-list .ios-row p {
    font-size: 12px;
  }

  .mini-round {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
}
