/* The demo phones: a realistic frame, the Bot / App tabs, a push banner, a Telegram-like chat. */
.phone {
  --ph: max(620px, min(780px, calc(100dvh - 215px)));
  position: relative; display: flex; flex-direction: column; height: var(--ph); width: calc(var(--ph) * 392 / 832);
  max-width: 100%; min-width: 0; border-radius: 56px; padding: 11px; background: #050506;
  box-shadow: 0 0 0 1.5px #5d6168, 0 0 0 3.5px #24262a, 0 0 0 4.5px #6e737b, inset 0 0 0 1px #1c1d20,
    0 50px 90px -35px rgba(0, 0, 0, 0.8), 0 18px 40px -20px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.3s;
}
.phone::before, .phone::after { content: ""; position: absolute; width: 4px; border-radius: 2px; background: linear-gradient(90deg, #3b3e44, #6e737b 50%, #3b3e44); }
.phone::before { left: -8px; top: 18%; height: 7%; box-shadow: 0 calc(var(--ph) * 0.1) 0 #4d5157; }
.phone::after { right: -8px; top: 26%; height: 10%; }
.phone.ring {
  box-shadow: 0 0 0 1.5px #5d6168, 0 0 0 3.5px #24262a, 0 0 0 4.5px #6e737b, inset 0 0 0 1px #1c1d20,
    0 0 0 14px rgba(227, 155, 45, 0.5), 0 50px 90px -35px rgba(20, 26, 51, 0.6);
}
.phone-island { position: absolute; z-index: 6; top: 22px; left: 50%; transform: translateX(-50%); width: 31%; max-width: 118px; height: 30px; border-radius: 20px; background: #000; }
.phone-island::after { content: ""; position: absolute; right: 11px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #2a3a55 0 25%, #0b0f18 60%); }
.phone-status {
  flex: none; height: 46px; padding: 2px 28px 0 32px; display: flex; align-items: center; justify-content: space-between;
  border-radius: 45px 45px 0 0; background: #fff; color: #111; font: 600 15px/1 var(--font); letter-spacing: -0.01em;
}
.phone-icons { display: flex; align-items: center; gap: 5px; }
.phone-icons svg { height: 11px; width: auto; fill: currentColor; }
.phone-batt { position: relative; width: 24px; height: 11.5px; border-radius: 3.5px; border: 1.3px solid currentColor; opacity: 0.9; }
.phone-batt::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; border-radius: 0 1px 1px 0; background: currentColor; }
.phone-batt i { position: absolute; inset: 1.5px; right: 22%; border-radius: 1.5px; background: currentColor; }
.phone-homebar { position: absolute; z-index: 6; left: 50%; bottom: 18px; transform: translateX(-50%); width: 34%; height: 5px; border-radius: 3px; background: #111; opacity: 0.45; pointer-events: none; }
.phone-screen {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 0 0 45px 45px;
  overflow: hidden; background: #fff; color: #111; transform: translateZ(0);
}
.ptabs { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px 12px 8px; background: #fff; border-bottom: 1px solid #e6ebf1; }
.ptab { position: relative; border: 0; background: transparent; padding: 7px; border-radius: 10px; font-weight: 650; font-size: 14px; color: #6b7280; }
.ptab.on { background: #dfeaf3; color: #10284f; }
.ptab .badge { position: absolute; top: 4px; right: 18%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; }
.ptabs.one { grid-template-columns: 1fr; }
.pane { flex: 1; min-height: 0; display: none; }
.pane.on { display: flex; flex-direction: column; }
.pane.app { position: relative; overflow: hidden; height: auto; }
.pane.app .g-app { height: 100%; }
.pane.app .g-tabs { padding-bottom: 18px; }
.push {
  position: absolute; z-index: 15; left: 10px; right: 10px; top: 6px; display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 18px; background: rgba(250, 250, 250, 0.96); color: #111;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22); font-size: 13px; line-height: 1.35; cursor: pointer;
  transform: translateY(-140%); transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
.push.show { transform: translateY(0); }
.push .tg-ava { width: 34px; height: 34px; flex: none; }
.push b { display: block; font-size: 13.5px; }
.push span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tg-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #fff; border-bottom: 1px solid #e6ebf1; }
.tg-head div { display: grid; line-height: 1.2; }
.tg-head small { color: #6b7280; font-size: 12.5px; }
.tg-ava { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #10284f; color: #2bb3c4; flex: none; }
.tg-ava svg { width: 22px; height: 22px; }
.tg-scroll {
  flex: 1; min-height: 0; overflow: auto; padding: 12px 10px 16px; display: flex; flex-direction: column; gap: 6px;
  background-color: #d9e4e6; scrollbar-width: none; overscroll-behavior: contain;
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1.4px), radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1.4px);
  background-size: 22px 22px, 22px 22px; background-position: 0 0, 11px 11px;
}
.tg-scroll::-webkit-scrollbar { display: none; }
.msg { max-width: 90%; display: grid; gap: 4px; align-self: flex-start; }
.msg.new { animation: msg-in 0.22s ease both; }
.msg.me { align-self: flex-end; }
.bubble {
  position: relative; background: #fff; border-radius: 16px 16px 16px 5px; padding: 8px 11px 18px; font-size: 13.5px; line-height: 1.42;
  white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); color: #111;
}
.msg.me .bubble { background: #e2f7cf; border-radius: 16px 16px 5px 16px; }
.bubble time { position: absolute; right: 9px; bottom: 3px; font-size: 10.5px; color: #8b95a1; }
.kb { display: grid; gap: 4px; }
.kb-row { display: flex; gap: 4px; }
.kb-btn {
  flex: 1; min-width: 0; border: 0; border-radius: 10px; padding: 8px 6px; font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(16, 40, 79, 0.42); backdrop-filter: blur(3px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kb-btn:hover { background: rgba(16, 40, 79, 0.58); }
.kb-btn.app::after { content: " ↗"; opacity: 0.8; }
.kb-btn.pressing { background: rgba(217, 164, 65, .95); color: #2b1d00; }
.g-app .pressing { outline: 3px solid rgba(217, 164, 65, .95); outline-offset: 2px; }
.tg-input { flex: none; display: flex; gap: 8px; padding: 8px 10px 26px; background: #fff; border-top: 1px solid #e6ebf1; }
.tg-input input { flex: 1; min-width: 0; border: 1px solid #dfe5ea; border-radius: 18px; padding: 9px 14px; font: inherit; font-size: 14px; background: #fff; color: #111; outline: none; }
.tg-input input:focus { border-color: #1f9fb0; }
.tg-input button { border: 0; width: 40px; height: 40px; border-radius: 50%; background: #10284f; color: #fff; flex: none; display: grid; place-items: center; padding: 0; }
.tg-input button svg { width: 20px; height: 20px; }
.tg-alert {
  position: absolute; z-index: 25; left: 50%; top: 40%; transform: translate(-50%, -50%); width: 78%; padding: 14px 16px;
  border-radius: 14px; background: rgba(28, 30, 36, 0.94); color: #fff; font-size: 14px; text-align: center; animation: msg-in 0.2s ease both;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
