/* ================================================================
   voice.css — Android-style Phone PWA
   Extends ttstyles.css.  No inline styles in HTML/JS.
   ================================================================ */

/* ── Boot / iOS screens (unchanged) ─────────────────────────── */
.v_icon_lg {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 10px;
}

/* ── Hidden metadata divs ──────────────────────────────────────*/
.v_config { display: none !important; }

/* ── Permanently hidden utility (non-JS-toggled elements) ─────*/
.v_hidden { display: none !important; }

/* ── Locked state (pre-auth) — call controls greyed out ────── */
.v_phone_locked .v_green_call_btn .v_cbb_ic,
.v_phone_locked .v_kp_call_btn {
  background: #e0e0e0 !important;
  color: #9aa0a6 !important;
  box-shadow: none !important;
  pointer-events: none;
}
.v_phone_locked .v_green_call_btn .v_cbb_lbl,
.v_phone_locked .v_kp_call_btn {
  pointer-events: none;
}
.v_phone_locked .v_green_call_btn {
  pointer-events: none;
}

/* ── Install PWA banner (fixed, shown by JS) ─────────────────── */
.v_install_banner {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
}

.v_install_btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: #1a73e8;
  color: #fff;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(26,115,232,.5);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}
.v_install_btn:active { opacity: 0.85; }

.v_install_btn_ic { font-size: 20px; }

/* ── Profile — save button row ───────────────────────────────── */
.v_pp_save_row { padding: 20px 16px; }

/* ── Message / dialog content blocks ────────────────────────── */
.v_msg_wrap {
  text-align: center;
  padding: 8px 0;
}

.v_msg_icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.v_msg_title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}

.v_msg_body {
  font-size: 14px;
  color: #5f6368;
  line-height: 1.7;
}

.v_msg_phone_lbl {
  margin-top: 16px;
  font-size: 14px;
  color: #5f6368;
}

.v_msg_phone_num {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 600;
  color: #1a73e8;
}

/* ================================================================
   1. PHONE APP SHELL
   ================================================================ */
.v_phone_app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

/* ── Tab panels ──────────────────────────────────────────────── */
.v_panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Top header strip ────────────────────────────────────────── */
.v_phone_header {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: #1a73e8;
  color: #fff;
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

.v_ph_title {
  font-size: 20px;
  font-weight: 500;
  flex: 1;
  letter-spacing: 0.01em;
}

.v_ph_icon_btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 22px;
  opacity: 0.9;
  transition: background 0.15s;
}
.v_ph_icon_btn:active { background: rgba(255,255,255,0.2); }

.v_ph_save {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  letter-spacing: 0.02em;
}
.v_ph_save:active { background: rgba(255,255,255,0.3); }

/* ================================================================
   2. BOTTOM TAB BAR
   ================================================================ */
.v_tabbar {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: stretch;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

.v_tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: #9aa0a6;
  transition: color 0.15s;
}
.v_tab:active { background: #f5f5f5; }

.v_tab_act {
  color: #1a73e8;
}

.v_tab_ic {
  font-size: 22px;
  line-height: 1;
}

.v_tab_lbl {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ================================================================
   3. RECENTS LIST
   ================================================================ */
.v_recents_wrap {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.v_recents_section_lbl {
  font-size: 12px;
  font-weight: 600;
  color: #1a73e8;
  padding: 12px 16px 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Single call row ─────────────────────────────────────────── */
.v_call_row {
  display: flex;
  align-items: center;
  padding: 10px 4px 10px 16px;
  border-bottom: 1px solid #f1f3f4;
  transition: background 0.12s;
  -webkit-user-select: none;
  user-select: none;
}
.v_call_row:active { background: #f5f5f5; }

/* Avatar circle */
.v_cr_avatar {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  margin-right: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.v_cr_avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Avatar color classes — picked from first letter of biz name */
.v_avt_c0 { background: #e53935; }
.v_avt_c1 { background: #8e24aa; }
.v_avt_c2 { background: #1e88e5; }
.v_avt_c3 { background: #00897b; }
.v_avt_c4 { background: #43a047; }
.v_avt_c5 { background: #f4511e; }
.v_avt_c6 { background: #6d4c41; }
.v_avt_c7 { background: #00acc1; }

/* Body: name + meta */
.v_cr_body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.v_cr_name {
  font-size: 15px;
  font-weight: 500;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v_cr_meta {
  font-size: 12px;
  color: #5f6368;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v_cr_type_ic {
  font-size: 12px;
  font-weight: bold;
  color: #1a73e8;
}

.v_cr_caller_lbl {
  font-size: 11px;
  color: #9aa0a6;
  display: block;
  margin-top: 1px;
}

/* Right: phone call button */
.v_cr_call_btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 20px;
  color: #1a73e8;
  flex-shrink: 0;
  transition: background 0.12s;
}
.v_cr_call_btn:active { background: #e8f0fe; }

/* ── Empty state ─────────────────────────────────────────────── */
.v_empty_calls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #9aa0a6;
}

.v_empty_ic  { font-size: 50px; margin-bottom: 14px; }
.v_empty_txt { font-size: 16px; font-weight: 500; color: #5f6368; margin-bottom: 6px; }
.v_empty_sub { font-size: 13px; }

/* ================================================================
   4. ACTIVE CALL OVERLAY  — full-screen, dark background
   ================================================================ */
.v_active_call {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #1c2333;
  color: #fff;
  overflow: hidden;
}

/* Top bar */
.v_ac_top {
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 8px 0 4px;
  flex-shrink: 0;
}

.v_ac_back {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: rgba(255,255,255,0.75);
  border-radius: 50%;
  transition: background 0.12s;
}
.v_ac_back:active { background: rgba(255,255,255,0.1); }

.v_ac_top_title {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  text-align: center;
  margin-right: 44px; /* balance back button */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Identity section */
.v_ac_identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 14px;
  flex-shrink: 0;
}

.v_ac_avatar_lg {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 38px;
  font-weight: 700;
  margin-bottom: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.v_ac_avatar_lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v_ac_biz_name {
  font-size: 22px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  margin-bottom: 4px;
}

.v_ac_status {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  text-align: center;
}

.v_ac_timer {
  font-size: 20px;
  font-weight: 300;
  color: #34a853;
  letter-spacing: 0.06em;
  margin-top: 6px;
}

/* Chat area (scrollable thread during call) */
.v_ac_chat_area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px;
}

.v_ac_chat_area .k_chatline { margin-bottom: 6px; }

/* Control buttons row */
.v_ac_controls {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 16px 8px 28px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
}

.v_ac_ctl_btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

.v_ac_ctl_ic {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(255,255,255,0.12);
  transition: background 0.12s;
}
.v_ac_ctl_btn:active .v_ac_ctl_ic { background: rgba(255,255,255,0.22); }

.v_ac_ctl_end .v_ac_ctl_ic {
  background: #ea4335;
  font-size: 26px;
  width: 68px;
  height: 68px;
}
.v_ac_ctl_end:active .v_ac_ctl_ic { background: #c62828; }

.v_ac_ctl_mic_on .v_ac_ctl_ic {
  background: #34a853;
}
.v_ac_ctl_mic_on:active .v_ac_ctl_ic { background: #2e7d32; }

.v_ac_ctl_lbl {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}

/* Pulse animation on mic when listening */
.v_ac_listening .v_ac_ctl_ic {
  background: #34a853;
  animation: v_ac_pulse 1.3s infinite;
}

@keyframes v_ac_pulse {
  0%   { box-shadow: 0 0 0 0   rgba(52,168,83,0.6); }
  70%  { box-shadow: 0 0 0 18px rgba(52,168,83,0); }
  100% { box-shadow: 0 0 0 0   rgba(52,168,83,0); }
}

/* ================================================================
   5. PROFILE PANEL
   ================================================================ */
.v_pp_body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
}

/* Avatar area */
.v_pp_avt_wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.v_pp_avt_circle {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #9aa0a6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  color: #fff;
  overflow: hidden;
  margin-bottom: 8px;
  cursor: pointer;
  position: relative;
}

.v_pp_avt_img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.v_pp_change_lbl {
  font-size: 12px;
  color: #1a73e8;
  margin-top: 4px;
}

/* Viewer ID row */
.v_pp_vid_row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.v_pp_vid_lbl {
  font-size: 12px;
  color: #9aa0a6;
  font-weight: 500;
}

.v_pp_vid_val {
  font-size: 12px;
  color: #5f6368;
  font-family: monospace;
}

/* Form fields */
.v_pp_fields {
  padding: 8px 0;
}

.v_pp_field {
  padding: 6px 16px 10px;
  border-bottom: 1px solid #f1f3f4;
}

.v_pp_label {
  font-size: 11px;
  font-weight: 600;
  color: #1a73e8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

.v_pp_input {
  width: 100%;
  font-size: 15px;
  color: #202124;
  border: none;
  outline: none;
  border-bottom: 1px solid #e0e0e0;
  padding: 4px 0;
  background: transparent;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.v_pp_input:focus { border-bottom-color: #1a73e8; }

/* ================================================================
   6. PASTE-LINK DIALOG
   ================================================================ */
.v_dlg_btn_row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px;
  box-sizing: border-box;
}

.v_dl_input {
  width: 100%;
  height: 40px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font-size: 14px;
  padding: 0 10px;
  box-sizing: border-box;
  outline: none;
  -webkit-appearance: none;
}
.v_dl_input:focus { border-color: #1a73e8; }

.v_dl_open_btn {
  flex: 1;
  height: 40px;
  background: #1a73e8;
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.v_dl_open_btn:active { background: #1558b0; }

.v_dl_cancel_btn {
  flex: 1;
  height: 40px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #5f6368;
  cursor: pointer;
  transition: background 0.12s;
}
.v_dl_cancel_btn:active { background: #f5f5f5; }
/* ================================================================
   7. HEADER — business avatar + name
   ================================================================ */
.v_ph_biz_avt {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-right: 10px;
  border: 2px solid rgba(255,255,255,0.5);
  flex-shrink: 0;
  overflow: hidden;
}

/* ================================================================
   8. CALL BAR (recents panel bottom)
   ================================================================ */
.v_call_bar {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 14px 24px 18px;
  background: #fff;
  border-top: 1px solid #e8eaed;
  flex-shrink: 0;
}

.v_call_bar_btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.v_cbb_ic {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: transform 0.12s, opacity 0.12s;
}

.v_cbb_lbl {
  font-size: 12px;
  font-weight: 500;
  color: #5f6368;
}

/* Green call button */
.v_green_call_btn .v_cbb_ic {
  background: #34a853;
  color: #fff;
  box-shadow: 0 4px 14px rgba(52,168,83,0.45);
}
.v_green_call_btn:active .v_cbb_ic {
  background: #2e7d32;
  transform: scale(0.94);
}

/* Red hangup button */
.v_red_hangup_btn .v_cbb_ic {
  background: #ea4335;
  color: #fff;
  box-shadow: 0 4px 14px rgba(234,67,53,0.45);
}
.v_red_hangup_btn:active .v_cbb_ic {
  background: #c62828;
  transform: scale(0.94);
}

/* Disabled state for hangup (idle) */
.v_hangup_disabled {
  pointer-events: none;
}
.v_hangup_disabled .v_cbb_ic {
  background: #e0e0e0 !important;
  color: #9aa0a6 !important;
  box-shadow: none !important;
}
.v_hangup_disabled .v_cbb_lbl {
  color: #bdbdbd !important;
}

/* ================================================================
   9. KEYPAD PANEL
   ================================================================ */
.v_kp_display_row {
  display: flex;
  align-items: center;
  padding: 16px 20px 8px;
  min-height: 56px;
  box-sizing: border-box;
  border-bottom: 1px solid #e8eaed;
  flex-shrink: 0;
}

.v_kp_display {
  flex: 1;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: #202124;
  text-align: center;
  min-height: 38px;
  line-height: 1.2;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v_kp_del_btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #5f6368;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.12s;
  flex-shrink: 0;
  visibility: hidden; /* shown by JS when display has content */
}
.v_kp_del_btn:active { background: #f5f5f5; }

.v_keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 8px 0;
  flex-shrink: 0;
}

.v_kp_key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 72px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  border-radius: 6px;
  transition: background 0.1s;
}
.v_kp_key:active { background: #f1f3f4; }

.v_kp_num {
  font-size: 28px;
  font-weight: 300;
  color: #202124;
  line-height: 1;
}

.v_kp_sub {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #5f6368;
  margin-top: 2px;
  min-height: 11px;
  text-transform: uppercase;
}

.v_kp_call_row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0 18px;
  flex-shrink: 0;
}

.v_kp_call_btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #34a853;
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(52,168,83,0.45);
  transition: background 0.12s, transform 0.12s;
  -webkit-user-select: none;
  user-select: none;
}
.v_kp_call_btn:active {
  background: #2e7d32;
  transform: scale(0.93);
}

/* ================================================================
   10. ACTIVE CALL — improved status + timer
   ================================================================ */
.v_ac_status_calling { color: rgba(255,255,255,0.75) !important; }
.v_ac_status_ringing { color: #fbbc04 !important; }
.v_ac_status_live    { color: #34a853 !important; }