@charset "UTF-8";
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --ai-webview-bg: #0e091c;
  --chat-bg: var(--ai-webview-bg);
  --bubble-ai-bg: #321c6a;
  --bubble-user-bg: #5425cd;
  --bubble-padding-chat: 24px;
  --chat-message-gap: 10px;
  --font-inter: "Inter", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ai-form-input-bg: #3b3350;
  --ai-form-radius: 12px;
  --ai-form-padding-y: 12px;
  --ai-form-padding-x: 16px;
  --ai-form-gap: 10px;
  --ai-btn-primary-bg: #5425cd;
  --ai-btn-primary-hover: #6842e0;
  --ai-btn-primary-fg: #ffffff;
  --ai-checkbox-on: #5425cd;
  --ai-checkbox-off: #2a2a2a;
  --ai-modal-surface: #211b36;
  --ai-tooltip-bg: #3c1997;
  --ai-tooltip-border: #5425cd;
  --ai-examples-accent: #5425cd;
  --ai-examples-code-bg: #1a1528;
  --ai-examples-card-bg: #2a2438;
}

html {
  height: 100%;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  height: calc(var(--vh, 1vh) * 100); /* JavaScript fallback for mobile Chrome */
  overflow: hidden;
}

body {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #ffffff;
  margin: 0;
  padding: 0;
  /* Mobile defaults - will be overridden by media queries */
  background: #000000;
  height: 100%;
  height: 100dvh;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
}

/* Phone Frame Wrapper - Base styles */
.phone-frame-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  position: relative;
}

/* Android Container - Base styles */
.android-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  height: calc(var(--vh, 1vh) * 100); /* JavaScript fallback for mobile Chrome */
  max-height: 100dvh;
  max-height: calc(var(--vh, 1vh) * 100); /* JavaScript fallback */
  background: #000000;
  min-height: 0; /* Allow flex children to shrink */
  overflow: hidden;
  flex: 1;
  position: relative;
  /* Ensure container doesn't grow beyond viewport */
  contain: layout style;
}

/* Allow scrolling when container has closed testing signup screen */
.android-container:has(.closed-testing-signup-screen) {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Fallback for browsers that don't support :has() */
.android-container .closed-testing-signup-screen {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Desktop: Show phone frame */
@media screen and (min-width: 769px) {
  html {
    overflow: auto !important;
    height: auto !important;
  }
  body {
    background: #1a1a1a !important;
    overflow: auto !important;
    position: relative !important;
    height: auto !important;
    min-height: 100vh !important;
    width: 100% !important;
    top: auto !important;
    left: auto !important;
    display: block !important;
    flex-direction: row !important;
  }
  .phone-frame-wrapper {
    width: 100% !important;
    min-height: 100vh !important;
    height: auto !important;
    padding: 40px 20px !important;
    background: #1a1a1a !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
  }
  .android-container {
    width: 420px !important;
    max-width: 420px !important;
    height: 912px !important;
    max-height: calc(100vh - 80px) !important;
    min-height: 600px !important;
    border-radius: 40px !important;
    border: 8px solid #2a2a2a !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
    flex: none !important;
    display: flex !important;
    flex-direction: column !important;
  }
  /* Allow scrolling for closed testing signup screen on desktop */
  .android-container:has(.closed-testing-signup-screen) {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  /* Phone notch simulation */
  .android-container::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 150px !important;
    height: 30px !important;
    background: #000000 !important;
    border-radius: 0 0 20px 20px !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
  }
}
/* Tablet: Show phone frame but smaller */
@media screen and (min-width: 481px) and (max-width: 768px) {
  html {
    overflow: auto !important;
    height: auto !important;
  }
  body {
    background: #000000 !important;
    overflow: auto !important;
    position: relative !important;
    height: auto !important;
    min-height: 100vh !important;
    width: 100% !important;
    top: auto !important;
    left: auto !important;
    display: block !important;
  }
  .phone-frame-wrapper {
    padding: 20px !important;
    height: auto !important;
    min-height: 100vh !important;
  }
  .android-container {
    width: 100% !important;
    max-width: 480px !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    flex: 1 !important;
    height: auto !important;
    max-height: none !important;
  }
  /* Allow scrolling for closed testing signup screen on tablet */
  .android-container:has(.closed-testing-signup-screen) {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .android-container::before {
    display: none !important;
  }
}
/* Mobile: No frame, full screen */
@media screen and (max-width: 480px) {
  html {
    overflow: hidden !important;
    height: 100% !important;
    height: 100dvh !important;
    height: calc(var(--vh, 1vh) * 100) !important;
  }
  body {
    background: #000000 !important;
    overflow: hidden !important;
    position: fixed !important;
    height: 100% !important;
    height: 100dvh !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .phone-frame-wrapper {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    background: #000000 !important;
  }
  .android-container {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    flex: 1 !important;
  }
  /* Allow scrolling for closed testing signup screen on mobile */
  .android-container:has(.closed-testing-signup-screen) {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .android-container::before {
    display: none !important;
  }
}
/* Return to Website Button */
.return-to-website-container {
  padding: 12px 16px;
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.return-to-website-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: #1a1a1a;
  color: #ffffff;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
  width: 100%;
}

.return-to-website-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: #4a4a4a;
  background: #2a2a2a;
}

.return-to-website-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Caller Info Card - Top */
.caller-card {
  background: #1a1a1a;
  border-radius: 16px;
  margin: 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  flex-shrink: 0; /* Prevent caller card from shrinking */
}

.caller-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.caller-avatar-link {
  text-decoration: none;
  display: flex;
  cursor: pointer;
}

.caller-avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.caller-avatar-link:hover .caller-avatar {
  transform: scale(1.05);
}

.caller-avatar-link:active .caller-avatar {
  transform: scale(0.95);
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.caller-info {
  flex: 1;
}

.caller-name {
  font-size: 20px;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 4px;
}

.caller-status {
  font-size: 14px;
  color: #999999;
}

.caller-icons {
  display: flex;
  gap: 12px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #2a2a2a;
  color: #B8450E;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.icon-button:hover:not(.disabled) {
  background: #3a3a3a;
}

.icon-button.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

#info-button {
  background: #000000;
  color: #ffffff;
}

#info-button:hover:not(.disabled) {
  background: #1a1a1a;
}

#video-info-button {
  background: #000000;
  color: #ffffff;
}

#video-info-button:hover:not(.disabled) {
  background: #1a1a1a;
}

/* Chat Area - Middle */
.chat-container {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0; /* Allow flex item to shrink below content size */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  position: relative;
}

.chat-container::-webkit-scrollbar {
  width: 4px;
}

.chat-container::-webkit-scrollbar-track {
  background: #000000;
}

.chat-container::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 2px;
}

.message {
  display: none;
  margin-bottom: 8px;
}

.message.visible {
  display: flex;
  animation: fadeIn 0.3s ease-in forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Typing indicator / Spinner */
.typing-indicator {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeIn 0.3s ease-in forwards;
}

.typing-indicator.hidden {
  display: none;
}

.typing-spinner {
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  align-self: center;
  margin-right: -2rem;
  z-index: 1;
}

.typing-spinner::before {
  content: "";
  width: 2rem;
  height: 2rem;
  border: 2px solid #2a2a2a;
  border-top-color: var(--bubble-ai-bg);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.typing-dots {
  display: flex;
  gap: 8px;
  padding: 0.875rem 1.25rem;
  background: #2a2a2a;
  border-radius: 20px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  position: relative;
  margin-left: 2rem;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999999;
  animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}
.message.user {
  justify-content: flex-end;
  align-items: flex-end;
  gap: 0.75rem;
}

.message.ai {
  justify-content: flex-start;
  align-items: flex-end;
}

.message-bubble {
  max-width: 75%;
  padding: 0.5rem 1.125rem;
  border-radius: 20px;
  font-size: 1.0625rem;
  line-height: 1.4;
  word-wrap: break-word;
  text-align: left;
}

.message.user .message-bubble {
  background: #B8450E;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  align-self: flex-start;
}

.message.ai .message-bubble {
  background: #000000;
  color: #ffffff;
  border: 1px solid #333333;
  border-bottom-left-radius: 4px;
  text-align: left;
  align-self: flex-start;
  margin-bottom: 0.5rem;
}

.message-avatar {
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  object-fit: contain;
  object-position: bottom;
  border-radius: 50%;
  background: #000000;
  align-self: flex-end;
}

.user-avatar {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  align-self: flex-end;
}

.user-avatar.question-mark {
  background: #666666;
}

.user-avatar.initials {
  background: #B8450E;
}

.message-text {
  display: block;
}

/* Simulated chat views: unified solid background */
body:has(.chat-container) {
  background: var(--chat-bg) !important;
  background-image: none !important;
}

body:has(.chat-container) .phone-frame-wrapper {
  background: var(--chat-bg) !important;
  background-image: none !important;
}

body:has(.chat-container) .android-container {
  background: var(--chat-bg) !important;
  background-image: none !important;
}

body:has(.chat-container) .caller-card {
  background: var(--chat-bg) !important;
  background-image: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
}

body:has(.chat-container) .chat-container {
  background: var(--chat-bg) !important;
  background-image: none !important;
}

/* WebKit: piilota scrollbar */
body:has(.chat-container) .chat-container::-webkit-scrollbar {
  display: none;
}

body:has(.chat-container) .action-bar {
  background: var(--chat-bg) !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Chat example styling from htmlForClientBlackRedExample - colors, padding, icon sizes */
body:has(.chat-container) .caller-card {
  padding: 1rem 1.25rem !important;
}

body:has(.chat-container) .caller-header {
  gap: 12px !important;
  margin-bottom: 0 !important;
}

body:has(.chat-container) .caller-avatar {
  width: 80px !important;
  height: 80px !important;
  background: #5425cd !important;
}

body:has(.chat-container) .caller-status {
  color: #AAAAAA !important;
}

body:has(.chat-container) .caller-name {
  font-family: var(--font-inter);
  font-weight: 600;
  font-size: 22px;
}

/* Chat pages: flex layout + scrollable middle */
body:has(.chat-container) .android-container {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  contain: none !important;
}

body:has(.chat-container) .caller-card {
  flex-shrink: 0 !important;
}

/* chat-container: scroll when content overflows */
body:has(.chat-container) .chat-container {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  scrollbar-width: none; /* Firefox: piilota scrollbar */
  -ms-overflow-style: none; /* IE/Edge: piilota scrollbar */
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 1rem !important;
}

body:has(.chat-container) .chat-messages {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  background: transparent !important;
  overflow: visible !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column-reverse !important;
  gap: 10px !important;
  justify-content: flex-end !important;
}

body:has(.chat-container) .action-bar {
  flex-shrink: 0 !important;
}

/* Newest bubble animates in when .visible is added (matches client theme JS) */
body:has(.chat-container) .chat-container .message.user:last-child.visible {
  animation: slideInFromBottomRight 0.5s ease-out forwards;
  transform-origin: bottom right;
}

body:has(.chat-container) .chat-container .message.ai:last-child.visible {
  animation: slideInFromBottomLeft 0.5s ease-out forwards;
  transform-origin: bottom left;
}

@keyframes slideInFromBottomRight {
  from {
    opacity: 0;
    transform: translate(20px, 20px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}
@keyframes slideInFromBottomLeft {
  from {
    opacity: 0;
    transform: translate(-20px, 20px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}
body:has(.chat-container) .message-bubble {
  padding: var(--bubble-padding-chat) !important;
  font-family: var(--font-inter);
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 24px !important;
  letter-spacing: normal !important;
}

body:has(.chat-container) .message.ai {
  gap: 0.6rem !important;
}

body:has(.chat-container) .message.ai .message-bubble {
  border: none !important;
  background: var(--bubble-ai-bg) !important;
  color: #ffffff !important;
}

body:has(.chat-container) .message.user .message-bubble {
  background: var(--bubble-user-bg) !important;
}

body:has(.chat-container) .typing-dots {
  background: #1a1a1a !important;
}

body:has(.chat-container) .message-avatar {
  width: 50px !important;
  height: 50px !important;
  background: transparent !important;
}

body:has(.chat-container) .user-avatar {
  width: 40px !important;
  height: 40px !important;
  font-size: 0.9rem !important;
}

body:has(.chat-container) .user-avatar.question-mark {
  background: var(--bubble-user-bg) !important;
}

body:has(.chat-container) .user-avatar.initials {
  background: var(--bubble-user-bg) !important;
}

/* Bottom Action Bar */
.action-bar {
  background: #2a2a2a;
  padding: 32px 16px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); /* Account for safe area on mobile */
  display: flex;
  justify-content: center;
  gap: 40px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5);
  flex-shrink: 0; /* Prevent action bar from shrinking */
  position: relative;
  z-index: 10;
  margin-top: auto; /* Push to bottom of flex container */
}

.action-bar--single {
  gap: 0;
}

.action-bar-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: #4CAF50;
  color: #ffffff;
  border-radius: 24px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: transform 0.2s, background 0.2s;
}

.action-bar-back-link:hover {
  background: #45a049;
  transform: scale(1.02);
}

.action-bar-back-link:active {
  transform: scale(0.98);
}

.action-bar-back-link svg {
  width: 24px;
  height: 24px;
}

.action-button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.action-button:hover {
  transform: scale(1.1);
}

.action-button:active {
  transform: scale(0.95);
}

.action-button.answer {
  background: #4CAF50;
  color: #ffffff;
}

.action-button.speaker {
  background: #FFC107;
  color: #ffffff;
}

.action-button.reject {
  background: #F44336;
  color: #ffffff;
}

.action-button svg {
  width: 36px;
  height: 36px;
  display: block;
  margin: 0 auto;
  transform-origin: center center;
}

.action-button.reject svg {
  transform: rotate(135deg);
  transform-origin: center center;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease-in;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #1a1a1a;
  border-radius: 16px;
  padding: 32px;
  max-width: 90%;
  width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.modal-phone-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #4CAF50;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.modal-phone-button svg {
  width: 28px;
  height: 28px;
}

.modal-speaker-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #FFC107;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.modal-speaker-button svg {
  width: 28px;
  height: 28px;
}

.modal-reject-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #F44336;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.modal-reject-button svg {
  width: 28px;
  height: 28px;
  transform: rotate(135deg);
  transform-origin: center center;
}

.modal-info-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.modal-info-button svg {
  width: 28px;
  height: 28px;
}

.modal-video-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.modal-video-button svg {
  width: 28px;
  height: 28px;
}

.modal-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  background: #000000;
}

.modal-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.modal-title {
  font-size: 24px;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
}

.modal-body {
  margin-bottom: 24px;
}

.modal-body p {
  font-size: 16px;
  line-height: 1.6;
  color: #cccccc;
  margin: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

.modal-close-button {
  background-color: #4CAF50;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  text-decoration: none;
  display: inline-block;
}

.modal-close-button:hover {
  background-color: #45a049;
  transform: scale(1.05);
}

.modal-close-button:active {
  transform: scale(0.95);
}

.modal-close-button.speaker {
  background-color: #FFC107;
}

.modal-close-button.speaker:hover {
  background-color: #ffb300;
}

.modal-close-button.reject {
  background-color: #F44336;
}

.modal-close-button.reject:hover {
  background-color: #e53935;
}

@media (max-width: 480px) {
  .caller-card {
    margin: 0.75rem;
    margin-bottom: 0.5rem; /* Reduce bottom margin to save space */
    padding: 1rem;
    flex-shrink: 0; /* Prevent caller card from shrinking */
  }
  .chat-container {
    padding: 0;
  }
  body:has(.chat-container) .chat-container {
    padding: 0.75rem !important;
    padding-top: 0.5rem !important;
  }
  .message-bubble {
    font-size: 1rem;
    padding: 0.5rem 0.9rem;
    line-height: 1.4;
  }
  .action-bar {
    padding: 1.5rem 0.75rem; /* Reduced top padding */
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); /* Account for safe area on mobile */
    gap: 2rem;
    min-height: auto; /* Allow natural height */
  }
  .action-button {
    width: 68px;
    height: 68px;
  }
  .action-button svg {
    width: 34px;
    height: 34px;
  }
  .modal-content {
    padding: 24px;
    max-width: 95%;
  }
  .modal-title {
    font-size: 20px;
  }
  .modal-body p {
    font-size: 14px;
  }
  .modal-phone-button {
    width: 48px;
    height: 48px;
  }
  .modal-phone-button svg {
    width: 24px;
    height: 24px;
  }
  .modal-speaker-button {
    width: 48px;
    height: 48px;
  }
  .modal-speaker-button svg {
    width: 24px;
    height: 24px;
  }
  .modal-reject-button {
    width: 48px;
    height: 48px;
  }
  .modal-reject-button svg {
    width: 24px;
    height: 24px;
  }
  .modal-video-button {
    width: 48px;
    height: 48px;
  }
  .modal-video-button svg {
    width: 24px;
    height: 24px;
  }
  .modal-video-container {
    margin-bottom: 16px;
  }
}
@media (min-width: 481px) and (max-width: 768px) {
  .message-bubble {
    font-size: 1.0625rem;
  }
}
@media (min-width: 769px) {
  .message-bubble {
    font-size: 1.25rem;
  }
}
/* Android AI settings + examples simulation (android_ai_settings_*.html.erb) */
.android-ai-settings-screen .status-bar,
.android-ai-settings-examples-screen .status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 14px;
  background: #000000;
  height: 24px;
  flex-shrink: 0;
}
.android-ai-settings-screen .status-left,
.android-ai-settings-screen .status-right,
.android-ai-settings-examples-screen .status-left,
.android-ai-settings-examples-screen .status-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.android-ai-settings-screen .time,
.android-ai-settings-examples-screen .time {
  font-weight: 500;
}
.android-ai-settings-screen .wifi-icon,
.android-ai-settings-screen .signal-icon,
.android-ai-settings-examples-screen .wifi-icon,
.android-ai-settings-examples-screen .signal-icon {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}
.android-ai-settings-screen .battery,
.android-ai-settings-examples-screen .battery {
  font-size: 12px;
}
.android-ai-settings-screen .network-type,
.android-ai-settings-examples-screen .network-type {
  font-size: 12px;
  font-weight: 500;
}
.android-ai-settings-screen .nav-bar,
.android-ai-settings-examples-screen .nav-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  padding: 8px 16px;
  background: #000000;
  flex-shrink: 0;
}
.android-ai-settings-screen .nav-button,
.android-ai-settings-examples-screen .nav-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  cursor: pointer;
}
.android-ai-settings-screen .nav-button::before,
.android-ai-settings-examples-screen .nav-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.android-ai-settings-screen .nav-button:first-child::before,
.android-ai-settings-examples-screen .nav-button:first-child::before {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 10px solid rgba(255, 255, 255, 0.8);
}
.android-ai-settings-screen .nav-button.home::before,
.android-ai-settings-examples-screen .nav-button.home::before {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}
.android-ai-settings-screen .nav-button.recent::before,
.android-ai-settings-examples-screen .nav-button.recent::before {
  width: 20px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 -4px 0 rgba(255, 255, 255, 0.8), 0 4px 0 rgba(255, 255, 255, 0.8);
}
.android-ai-settings-screen .nav-button.disabled,
.android-ai-settings-examples-screen .nav-button.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.android-ai-settings-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  background: var(--ai-webview-bg);
  color: #ffffff;
  font-family: var(--font-inter);
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.android-ai-settings-screen .ai-settings-modal {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--ai-webview-bg);
}

.android-ai-settings-screen .modal-content {
  background: transparent;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: none;
}

.android-ai-settings-screen .modal-title {
  font-size: 24px;
  font-weight: 600;
  font-family: var(--font-inter);
  color: #ffffff;
  margin: 0 0 8px 0;
  opacity: 1;
}

.android-ai-settings-screen .form-group {
  display: flex;
  flex-direction: column;
  gap: var(--ai-form-gap);
  margin-bottom: 20px;
}

.android-ai-settings-screen .form-group:first-of-type .form-input-wrapper {
  margin-top: 0;
}

.android-ai-settings-screen .form-input-wrapper,
.android-ai-settings-screen .save-button-wrapper {
  position: relative;
}

.android-ai-settings-screen .form-label {
  display: block;
  font-size: 16px;
  line-height: 24px;
  font-family: var(--font-inter);
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0;
  color: #ffffff;
  margin: 0;
  opacity: 1;
}

.android-ai-settings-screen .form-input,
.android-ai-settings-screen .form-select,
.android-ai-settings-screen .form-textarea {
  width: 100%;
  padding: var(--ai-form-padding-y) var(--ai-form-padding-x);
  background: var(--ai-form-input-bg);
  border: none;
  border-radius: var(--ai-form-radius);
  color: #ffffff;
  font-size: 16px;
  line-height: 24px;
  font-family: var(--font-inter);
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0;
  outline: none;
  box-sizing: border-box;
  opacity: 1;
  box-shadow: none;
}

.android-ai-settings-screen .form-input:focus,
.android-ai-settings-screen .form-select:focus,
.android-ai-settings-screen .form-textarea:focus {
  box-shadow: 0 0 0 2px var(--bubble-user-bg);
}

.android-ai-settings-screen .form-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 48px;
  background-color: var(--ai-form-input-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 24px 24px;
}

.android-ai-settings-screen .form-group--checkbox .form-input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--ai-form-gap);
  flex-wrap: wrap;
}

.android-ai-settings-screen .form-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--ai-checkbox-off);
  border: none;
  transition: background 0.15s ease;
}

.android-ai-settings-screen .form-checkbox:checked {
  background-color: var(--ai-checkbox-on);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 13' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6.5l5.5 5L19 2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 21px 13px;
}

.android-ai-settings-screen .form-label--inline {
  margin: 0;
  cursor: pointer;
  flex: 1;
}

.android-ai-settings-screen .form-textarea {
  resize: vertical;
  min-height: 120px;
}

.android-ai-settings-screen .form-textarea--compact {
  min-height: 60px;
}

.android-ai-settings-screen .save-button {
  width: 100%;
  padding: var(--ai-form-padding-y) var(--ai-form-padding-x);
  background: var(--ai-btn-primary-bg);
  color: var(--ai-btn-primary-fg);
  border: none;
  border-radius: var(--ai-form-radius);
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-inter);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
  text-decoration: none;
  display: block;
  text-align: center;
  opacity: 1;
}

.android-ai-settings-screen .save-button:hover:not(.disabled) {
  background: var(--ai-btn-primary-hover);
}

.android-ai-settings-screen .save-button:active:not(.disabled) {
  transform: scale(0.98);
}

.android-ai-settings-screen .save-button.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.android-ai-settings-screen .examples-link {
  display: block;
  width: 100%;
  padding: 12px 16px;
  color: #b8b0c8;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-family: var(--font-inter);
  font-weight: 400;
  transition: color 0.2s;
  margin-top: 8px;
}

.android-ai-settings-screen .examples-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.android-ai-settings-screen .field-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%) translateY(8px);
  background: var(--ai-tooltip-bg);
  border: 1px solid var(--ai-tooltip-border);
  border-radius: var(--ai-form-radius);
  padding: 0;
  min-width: 200px;
  max-width: 280px;
  width: calc(100% - 40px);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  white-space: normal;
}

.android-ai-settings-screen .field-tooltip.show {
  z-index: 100000;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.android-ai-settings-screen .field-tooltip .tooltip-content {
  padding: var(--ai-form-padding-y) var(--ai-form-padding-x);
  position: relative;
}

.android-ai-settings-screen .field-tooltip .tooltip-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  font-family: var(--font-inter);
  color: #ffffff;
  padding-right: 24px;
}

.android-ai-settings-screen .field-tooltip .tooltip-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  opacity: 0.7;
}

.android-ai-settings-screen .field-tooltip .tooltip-close:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.android-ai-settings-screen .field-tooltip .tooltip-arrow {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--ai-tooltip-bg);
}

.android-ai-settings-screen .save-button-wrapper .field-tooltip {
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%) translateY(8px);
}

.android-ai-settings-screen .save-button-wrapper .field-tooltip.show {
  transform: translateX(-50%) translateY(0);
}

.android-ai-settings-screen .save-button-wrapper .field-tooltip .tooltip-arrow {
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border-top: 8px solid var(--ai-tooltip-bg);
  border-bottom: none;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

@media (max-width: 480px) {
  .android-ai-settings-screen .modal-content {
    padding: 20px;
    border-radius: var(--ai-form-radius);
  }
  .android-ai-settings-screen .modal-title {
    font-size: 20px;
  }
  .android-ai-settings-screen .form-label {
    font-size: 15px;
    line-height: 22px;
  }
  .android-ai-settings-screen .form-input,
  .android-ai-settings-screen .form-select,
  .android-ai-settings-screen .form-textarea {
    font-size: 15px;
    line-height: 22px;
  }
  .android-ai-settings-screen .save-button {
    padding: 14px var(--ai-form-padding-x);
    font-size: 16px;
  }
}
/* Examples scroll view */
.android-ai-settings-examples-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  background: var(--ai-webview-bg);
  color: #ffffff;
  font-family: var(--font-inter);
  overflow: hidden;
  position: relative;
}

.android-ai-settings-examples-screen .examples-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.android-ai-settings-examples-screen .examples-header {
  padding: 20px 20px 16px 20px;
  flex-shrink: 0;
}

.android-ai-settings-examples-screen .examples-title {
  font-size: 24px;
  font-weight: 600;
  font-family: var(--font-inter);
  color: #ffffff;
  margin: 0 0 8px 0;
}

.android-ai-settings-examples-screen .examples-subtitle {
  font-size: 14px;
  font-family: var(--font-inter);
  color: #b8b0c8;
  margin: 0;
  line-height: 1.5;
}

.android-ai-settings-examples-screen .examples-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px 20px;
}

.android-ai-settings-examples-screen .example-section {
  margin-bottom: 32px;
}

.android-ai-settings-examples-screen .section-title {
  font-size: 20px;
  font-weight: 600;
  font-family: var(--font-inter);
  color: #ffffff;
  margin: 0 0 8px 0;
}

.android-ai-settings-examples-screen .section-description {
  font-size: 14px;
  font-family: var(--font-inter);
  color: #b8b0c8;
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.android-ai-settings-examples-screen .example-card {
  background: var(--ai-examples-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--ai-form-radius);
  padding: 16px;
  margin-bottom: 16px;
}

.android-ai-settings-examples-screen .example-label {
  font-size: 12px;
  color: var(--ai-examples-accent);
  font-weight: 600;
  font-family: var(--font-inter);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.android-ai-settings-examples-screen .example-code {
  background: var(--ai-examples-code-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--ai-form-radius);
  padding: var(--ai-form-padding-y) var(--ai-form-padding-x);
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  opacity: 1;
}

.android-ai-settings-examples-screen .example-effect {
  font-size: 14px;
  font-family: var(--font-inter);
  color: #d4cfe0;
  line-height: 1.6;
}

.android-ai-settings-examples-screen .example-effect strong {
  color: #ffffff;
}

.android-ai-settings-examples-screen .scenario-card {
  background: var(--ai-examples-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--ai-form-radius);
  padding: 20px;
  margin-bottom: 16px;
}

.android-ai-settings-examples-screen .scenario-title {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-inter);
  color: var(--ai-examples-accent);
  margin: 0 0 16px 0;
}

.android-ai-settings-examples-screen .scenario-content {
  font-size: 14px;
  font-family: var(--font-inter);
  color: #d4cfe0;
  line-height: 1.6;
}

.android-ai-settings-examples-screen .scenario-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.android-ai-settings-examples-screen .scenario-content li {
  margin-bottom: 8px;
}

.android-ai-settings-examples-screen .scenario-content strong {
  color: #ffffff;
}

.android-ai-settings-examples-screen .tips-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.android-ai-settings-examples-screen .tip-item {
  background: var(--ai-examples-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--ai-form-radius);
  padding: 16px;
}

.android-ai-settings-examples-screen .tip-item strong {
  display: block;
  color: var(--ai-examples-accent);
  font-size: 15px;
  font-family: var(--font-inter);
  margin-bottom: 8px;
}

.android-ai-settings-examples-screen .tip-item p {
  font-size: 14px;
  font-family: var(--font-inter);
  color: #d4cfe0;
  margin: 0;
  line-height: 1.6;
}

.android-ai-settings-examples-screen .warning-box {
  background: rgba(84, 37, 205, 0.12);
  border: 1px solid rgba(84, 37, 205, 0.35);
  border-radius: var(--ai-form-radius);
  padding: var(--ai-form-padding-y) var(--ai-form-padding-x);
  margin-top: 12px;
  font-size: 13px;
  font-family: var(--font-inter);
  color: #d4c4f5;
  line-height: 1.5;
}

.android-ai-settings-examples-screen .back-button-container {
  padding: 16px 20px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.android-ai-settings-examples-screen .back-button {
  display: inline-block;
  color: var(--ai-examples-accent);
  font-size: 16px;
  font-family: var(--font-inter);
  text-decoration: none;
  padding: 12px 0;
  transition: color 0.2s;
}

.android-ai-settings-examples-screen .back-button:hover {
  color: #7c5ce7;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .android-ai-settings-examples-screen .examples-title {
    font-size: 20px;
  }
  .android-ai-settings-examples-screen .section-title {
    font-size: 18px;
  }
  .android-ai-settings-examples-screen .example-code {
    font-size: 13px;
  }
  .android-ai-settings-examples-screen .scenario-title {
    font-size: 16px;
  }
}
