/* =============================================
   Liberdus styles.css
   Architecture: ITCSS-style layering (docs/css-architecture.md)
   Layers: Settings, Tools, Generic, Elements, Objects, Components, Utilities
   Note: Organizational headers only; no visual changes
   ============================================= */

/* ========== Settings (tokens/variables) ========== */
/* Unstake lock info under the Unstake button */
#unstake-lock-info,
.unstake-lock-info {
  font-size: 0.85em;
  color: #dc3545;
  margin-top: 6px;
  min-height: 1em; /* keep layout stable when empty */
}
:root {
  /* Original color tokens (keeping your existing values) */
  --border-color: #dee2e6;
  --background-color: white;
  --hover-background: #f8f9fa;
  --hover-background-purple: rgba(61, 61, 206, 0.08);
  --focus-ring-primary: 0 0 0 2px rgba(61, 61, 206, 0.1);
  --elev-1: 0 1px 3px rgba(0, 0, 0, 0.05);
  --elev-2: 0 2px 10px rgba(0, 0, 0, 0.1);
  --text-color: #1c1c21;
  --secondary-text-color: #65676b;
  --highlight-color: rgba(216, 119, 0, 0.444);
  --input-background: #e4e6e9;
  --hover-background-dark: #d0d2d6;
  --primary-color: #3d3dce;
  --primary-hover: #3535b8;
  --danger-color: #dc3545;
  --success-color: #28a745;
  --warning-color: #ef6c00;
  --info-color: #0066cc;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --button-background: #f8f9fa;
  --button-text: #1c1c21;
  --button-hover-background: #e4e6e9;

  /* Icon SVGs */
  --icon-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E");
  --icon-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'%3E%3C/path%3E%3C/svg%3E");
  --icon-contacts: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='9' cy='7' r='4'%3E%3C/circle%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'%3E%3C/path%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'%3E%3C/path%3E%3C/svg%3E");
  --icon-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
  --icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'%3E%3C/line%3E%3C/svg%3E");

  /* Typography tokens */
  --font-primary: 'Inter', sans-serif;
  --font-monospace: monospace;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 20px;
  --font-size-xl: 24px;
  --font-size-xxl: 48px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Icon/button tokens */
  --icon-size-20: 20px;
  --icon-size-24: 24px;
  --icon-button-width: 30px;
  --icon-button-height: 40px;
  --icon-button-radius: 8px;
  --icon-opacity-default: 0.7;
  --icon-opacity-hover: 1;

  /* Overlay/modal tokens */
  --overlay-backdrop-color: rgba(0, 0, 0, 0.5);
  --overlay-border-radius: 8px;
  --overlay-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  --overlay-shadow-large: 0 10px 40px rgba(0, 0, 0, 0.3);
  --overlay-z-index-base: 1000;
  --overlay-z-index-high: 9999;
  --overlay-transition: opacity 0.2s ease-in-out;

  /* Shadows and skeletons */
  --shadow-primary: 0 4px 12px rgba(61, 61, 206, 0.3);
  --skeleton-bg: #e0e0e0;
  --surface-muted: #f0f0f0;
  --muted-text-color: #999;

  /* Additional tokens for consistent tints and system chrome */
  --primary-tint-12: rgba(61, 61, 206, 0.12);
  --primary-tint-20: rgba(61, 61, 206, 0.2);
  --primary-tint-04: rgba(61, 61, 206, 0.04);
  --primary-tint-40: rgba(61, 61, 206, 0.4);
  --scrollbar-thumb: rgba(0, 0, 0, 0.3);
  --scrollbar-track: rgba(0, 0, 0, 0.05);
  --elev-3: 0 4px 8px rgba(0, 0, 0, 0.1);

  /* Extended palette */
  --neutral-600: #666;
  --primary-muted: #8a8ad8; /* Slightly desaturated primary */
  --accent-bright-blue: #4a4aff;
  --accent-blue-10: rgba(0, 123, 255, 0.1);
  --accent-blue-20: rgba(0, 123, 255, 0.2);
  --danger-strong: #c82333;
  --surface-accent: #ccd3e0;
  --skeleton-pulse-bg: #d0d0d0;
}

/* ========== Generic (reset/normalize, globals) ========== */

/* ========== Screen/Modal Base Layout ========== */

/* Shared scrollbar styles for screens and modals */
.app-screen::-webkit-scrollbar,
.modal::-webkit-scrollbar {
  width: 6px;
}

.app-screen::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track {
  background: transparent;
}

.app-screen::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.app-screen::-webkit-scrollbar-thumb:hover,
.modal::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

/* Base screen layout */
.app-screen {
  flex: 1;
  display: none;
  padding: 0;
  overflow-y: auto;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  margin-bottom: env(safe-area-inset-bottom, 0px);
}

.app-screen.active {
  display: block;
}

/* Screen-specific padding for main screens */
#contactsScreen,
#chatsScreen,
#walletScreen {
  padding-bottom: 80px;
}

/* Toast close button for error toasts */
.toast-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5em;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 1;
  padding: 0;
  line-height: 1;
  position: absolute;
  top: 8px;
  right: 12px;
}

.toast-close-btn:hover,
.toast-close-btn:focus {
  opacity: 1;
  outline: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-primary);
background-color: var(--surface-muted);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Refined Scrollbar Styling */
/* For Webkit browsers (Chrome, Safari, newer versions of Opera) */
.app-screen::-webkit-scrollbar,
.messages-container::-webkit-scrollbar,
.modal::-webkit-scrollbar,
#chatsScreen::-webkit-scrollbar,
#contactsScreen::-webkit-scrollbar,
#walletScreen::-webkit-scrollbar,
.chat-list::-webkit-scrollbar,
#chatList::-webkit-scrollbar,
.container::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 6px; /* Slightly thinner for elegance */
  height: 6px;
}

.app-screen::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track,
#chatsScreen::-webkit-scrollbar-track,
#contactsScreen::-webkit-scrollbar-track,
#walletScreen::-webkit-scrollbar-track,
.chat-list::-webkit-scrollbar-track,
#chatList::-webkit-scrollbar-track,
.container::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: transparent; /* Completely transparent track */
  margin: 4px 0; /* Add some margin for a floating effect */
}

.app-screen::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb,
#chatsScreen::-webkit-scrollbar-thumb,
#contactsScreen::-webkit-scrollbar-thumb,
#walletScreen::-webkit-scrollbar-thumb,
.chat-list::-webkit-scrollbar-thumb,
#chatList::-webkit-scrollbar-thumb,
.container::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2); /* Lighter for subtlety */
  border-radius: 10px;
  border: 1px solid transparent; /* Thinner border */
  background-clip: padding-box;
  transition: background-color 0.3s ease; /* Smooth transition on hover */
}

.app-screen::-webkit-scrollbar-thumb:hover,
.messages-container::-webkit-scrollbar-thumb:hover,
.modal::-webkit-scrollbar-thumb:hover,
#chatsScreen::-webkit-scrollbar-thumb:hover,
#contactsScreen::-webkit-scrollbar-thumb:hover,
#walletScreen::-webkit-scrollbar-thumb:hover,
.chat-list::-webkit-scrollbar-thumb:hover,
#chatList::-webkit-scrollbar-thumb:hover,
.container::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-tint-40); /* Brand color on hover with transparency */
}

/* For Firefox */
.app-screen,
.messages-container,
.modal,
#chatsScreen,
#contactsScreen,
#walletScreen,
.chat-list,
#chatList,
.container,
body {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Specific styling for chat list container */
.chat-list::-webkit-scrollbar,
#chatList::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.chat-list::-webkit-scrollbar-track,
#chatList::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.chat-list::-webkit-scrollbar-thumb,
#chatList::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.chat-list::-webkit-scrollbar-thumb:hover,
#chatList::-webkit-scrollbar-thumb:hover {
  background-color: var(--overlay-backdrop-color);
}

/* For Firefox */
.chat-list,
#chatList {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Direct targeting of the container */
.container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.container::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.container::-webkit-scrollbar-thumb:hover {
  background-color: var(--overlay-backdrop-color);
}

.container {
  background-color: var(--background-color);
  border-radius: 8px;
  box-shadow: var(--elev-2);
  text-align: center;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  /* for firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  body {
    padding: 0;
    background-color: var(--background-color);
  }
}

@media (min-width: 769px) {
  .container {
    width: 400px;
    height: 800px;
  }
}

.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 2rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px) + 100px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 100vh;
}

.welcome-screen .welcome-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.welcome-screen .welcome-buttons button {
  width: 358px;
  height: 48px;
  margin: 0;
  border-radius: 24px;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: 24px;
  min-width: 84px;
  max-width: 480px;
  padding: 0 20px;
  text-align: center;
}

.welcome-screen .welcome-buttons button.btn.btn--primary {
  background-color: var(--primary-color);
  color: var(--background-color);
  border: none;
}

.welcome-screen .welcome-buttons button.btn.btn--secondary {
  background-color: var(--hover-background);
  color: var(--text-color);
  border: none;
}

.welcome-screen .welcome-buttons button:hover {
  opacity: 0.9;
}

.header {
  display: none;
  align-items: center;
  width: 100%;
  /* padding only on the sides */
  padding: 0 16px;
  background-color: var(--background-color);
  color: var(--text-color);
  position: sticky;
  top: env(safe-area-inset-top, 0);
  /* z-index: 1000; */
  margin-top: env(safe-area-inset-top, 0);
}

#logo {
  display: flex;
  align-items: center;
  height: 100%;
}

#logo img {
  width: 40px;
  height: 40px;
  padding: 1px;
  object-fit: contain;
}

.logo-link {
  display: block;
  text-decoration: none;
}

.logo-link:hover {
  opacity: 0.8;
}

.header.active {
  height: 56px;
  /* only want margin-top on desktop */
  @media (min-width: 769px) {
    margin-top: 16px;
  }
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-name {
  font-family: var(--font-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 140px);
  cursor: pointer;
}

.header-icons {
  display: flex;
  gap: 16px;
  align-items: center;
}

.icon-button {
  background: none;
  border: none;
  color: var(--muted-text-color);
  font-size: var(--font-size-lg);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--icon-button-radius);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: var(--icon-size-20);
}

.icon-button:active {
  transform: translateY(1px);
}

/* Shared sizing/layout for standard icon buttons used in chat/contact contexts */
.icon-button.chat-icon,
.icon-button.add-friend-icon,
.icon-button.send-money-icon,
.icon-button.edit-icon,
.icon-button.phone-icon {
  width: var(--icon-button-width);
  height: var(--icon-button-height);
  padding: 8px;
  border-radius: var(--icon-button-radius);
  opacity: var(--icon-opacity-default);
}

.icon-button#toggleSettings::before {
  content: '';
  width: 19px;
  height: 19px;
  display: block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 19px 19px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1Z'%3E%3C/path%3E%3C/svg%3E");
  margin: 1px;
}

.icon-button#toggleMenu::before {
  content: '';
  width: 20px;
  height: 20px;
  display: block;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='12' x2='21' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='21' y2='18'%3E%3C/line%3E%3C/svg%3E");
}


.chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 12px;
  background-color: var(--light-color);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Base chat list styles */
.chat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto; /* Ensure scrolling is enabled */
}

/* Main chat list items */
#chatList .chat-item {
  display: flex;
  padding: 12px 16px;
  background: var(--background-color);
  cursor: pointer;
}

/* Search Results Container */
#searchResults {
  padding: 0;
  margin: 0;
}

/* Search Results List */
#searchResults .chat-list {
  padding: 0;
  margin: 0;
}

/* Search result items */
#searchResults .chat-list .chat-item {
  display: flex;
  padding: 12px 16px;
  background: var(--background-color);
  cursor: pointer;
}

/* Hover effects for both */
.chat-item:hover {
  background: var(--hover-background);
}

.chat-content {
  flex: 1;
  min-width: 0;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

/* Calls list specific enhancements */
#callsModal .chat-item {
  position: relative;
  border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.06));
}


/* Group call styling */
.group-call {
  cursor: pointer;
}

.group-call:hover {
  background-color: var(--hover-background) !important;
}

/* Group call avatars */
.call-group-avatars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 48px;
  height: 48px;
  padding: 2px;
  box-sizing: border-box;
}

/* Group call participant avatars */
.call-group-avatars .participant-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-group-avatars .participant-avatar svg {
  width: 100%;
  height: 100%;
}

/* 2 participants: side-by-side */
.call-group-avatars:has(.participant-avatar:nth-child(2):last-child) {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 3px;
  padding: 6px;
}

.call-group-avatars:has(.participant-avatar:nth-child(2):last-child) .participant-avatar {
  width: 16px;
  height: 16px;
}

/* 3 participants: triangle layout */
.call-group-avatars:has(.participant-avatar:nth-child(3):last-child) {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  padding: 4px;
}

.call-group-avatars:has(.participant-avatar:nth-child(3):last-child) .participant-avatar {
  width: 16px;
  height: 16px;
}

.call-group-avatars:has(.participant-avatar:nth-child(3):last-child) .participant-avatar:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  align-self: end;
}

.call-group-avatars:has(.participant-avatar:nth-child(3):last-child) .participant-avatar:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  align-self: end;
}

.call-group-avatars:has(.participant-avatar:nth-child(3):last-child) .participant-avatar:nth-child(3) {
  grid-column: 1 / 3;
  grid-row: 2;
  justify-self: center;
  align-self: start;
}

/* 4+ participants: 2x2 grid */
.call-group-avatars:has(.participant-avatar:nth-child(4)) .participant-avatar {
  width: 100%;
  height: 100%;
}

#callsModal .chat-name {
  font-weight: 600;
  font-size: 0.98rem;
}

/* Group Call Participants Modal */
.participants-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.participant-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.participant-item:hover {
  background-color: var(--hover-background);
}

.participant-item:last-child {
  margin-bottom: 0;
}

.participant-item .participant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.participant-item .participant-avatar svg {
  width: 36px;
  height: 36px;
}

.participant-info {
  flex: 1;
  min-width: 0;
}

.participant-name {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-color);
}


#callsModal .chat-content {
  padding-right: 64px; /* room for the floating call button */
}

#callsModal .call-join.call-message-phone-button {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background-color: var(--primary-color, #3b82f6);
}

#callsModal .chat-message {
  display: flex;
  align-items: center;
  gap: 8px;
}

#callsModal .call-time {
  font-size: 0.88rem;
  color: var(--secondary-text-color);
}

#callsModal .call-join.call-message-phone-button.call-join--future {
  background-color: var(--button-hover-background);
  opacity: 0.85;
}

#callsModal .call-join.call-message-phone-button.call-join--active {
  background-color: var(--success-color);
}

.chat-name {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  color: var(--text-color);
  margin-right: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color);
  white-space: nowrap;
}

#searchResults .chat-message {
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color);
  white-space: normal; /* Allow wrapping */
  overflow: visible; /* Show overflow (or remove line) */
  word-break: break-all; /* Allow breaking long words/URLs */
  text-align: left;
  /* text-overflow: ellipsis; Removed */
}

.chat-message {
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.chat-unread {
  background-color: var(--primary-color);
  color: var(--background-color);
  font-family: var(--font-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: 1px 8px;
  border-radius: 12px;
  margin-left: 8px;
}

/* Orange draft indicator shown when there is a saved draft and no unread messages */
.chat-draft {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--warning-color);
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--secondary-text-color);
  display: none;
}

.empty-state > div:first-child {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.empty-state > div:nth-child(2) {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.empty-state::before {
  content: '';
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.5;
}

#callInviteModal .empty-state {
  display: none; /* Hidden by default */
  padding: 0;
}
#callInviteModal .empty-state::before {
  width: 0;
  height: 0;
}

/* Chats empty state - using chat bubble SVG */
#chatsScreen .empty-state::before {
  background-image: var(--icon-chat);
}

/* Contacts empty state - using contacts SVG */
#contactsScreen .empty-state::before {
  background-image: var(--icon-contacts);
}

/* Assets empty state - using wallet SVG */
#walletScreen .empty-state::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'/%3E%3Cpath d='M2 10h20'/%3E%3Cpath d='M7 15h0'/%3E%3C/svg%3E");
}

/* History empty state - using clock SVG */
#historyModal .empty-state::before {
  background-image: var(--icon-clock);
}
/* Calls empty state - using phone SVG */
#callsModal .empty-state::before {
  background-image: var(--icon-phone);
}

h1 {
  font-family: var(--font-primary);
  font-size: 50px;
  font-weight: var(--font-weight-bold);
  line-height: 35px;
  color: var(--text-color);
  text-align: center;
  text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
  margin-bottom: 2rem;
}

button {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  background-color: #007bff; /* leaving Bootstrap legacy literal; no token use site */
  color: var(--background-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

/* Common button hover behavior */
button:not(:disabled):hover {
  opacity: 0.9;
  transition: all 0.2s ease;
}

/* Button variants – shared base (typography, interaction) */
.btn {
  border: none;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Mobile vertical centering fix */
  line-height: 1;
  text-align: center;
}

/* Primary buttons */
.btn--primary {
  background-color: var(--primary-color);
  color: var(--background-color);
}

/* Primary buttons hover */
.btn--primary:not(:disabled):hover {
  background-color: var(--primary-hover);
  opacity: 0.9;
}

/* Secondary buttons */
.btn--secondary {
  background-color: var(--hover-background);
  color: var(--text-color);
  width: 100%;
  width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 24px;
  height: 48px;
}

/* Button danger */
.btn--danger {
  background-color: var(--danger-color);
  color: var(--background-color);
}

/* Hover effect specifically for the Unstake button within the Validator Modal */
.btn--danger:not(:disabled):hover {
  opacity: 0.9;
}


/* Icon buttons */
.icon-button:hover {
  background-color: var(--hover-background-purple);
  color: var(--primary-color);
  opacity: 1;
}

/* Keep disabled state */
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Button sizing and shape for primary/secondary buttons */
.btn--fixed {
  width: 240px;
  padding: 12px 20px;
  border-radius: 5px;
}

/* Specific hover states */
.btn--primary:hover {
  background-color: var(--primary-hover);
  opacity: 0.9;
}

.btn--secondary:not(:disabled):hover {
  background-color: var(--hover-background-dark);
  opacity: 0.9;
}

/* Common button styles - pill full width */
.btn--pill.btn--full {
  width: calc(100% - 32px);
  height: 48px;
  border-radius: 24px;
  margin: 1rem 16px;
}

.btn--pill {
  border-radius: 24px;
}

.btn.btn--primary:disabled,
.btn.btn--secondary:disabled,
.btn.btn--danger:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.footer {
  display: none;
  width: 100%;
  padding: 4px 0;
  background-color: var(--background-color);
  position: fixed;
  bottom: 0;
  left: 0;
  height: 72px;
  margin-bottom: env(safe-area-inset-bottom, 0);
}

.footer.active {
  display: block;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  max-width: 390px;
  margin: 0 auto;
  width: 100%;
}

.nav-button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 8px;
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  color: var(--muted-text-color);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  border-radius: 8px;
  position: relative; /* Added for positioning the notification indicator */
}

/* Notification indicator */
.nav-button::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 25%;
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Show notification when has-notification class is present */
.nav-button.has-notification::after {
  opacity: 1;
}

.nav-button::before {
  content: '';
  width: var(--icon-size-24);
  height: var(--icon-size-24);
  background-position: center;
  background-repeat: no-repeat;
  background-size: var(--icon-size-24);
  opacity: 0.5;
  transition: all 0.2s ease;
}

.nav-button#switchToChats::before {
  background-image: var(--icon-chat);
}

.nav-button#switchToContacts::before {
  background-image: var(--icon-contacts);
}

.nav-button#switchToWallet::before {
  /* Simple billfold */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='2'/%3E%3Cpath d='M2 12h20'/%3E%3C/svg%3E");
}

/* Hover state */
.nav-button:hover {
  color: var(--accent-bright-blue);
  background-color: var(--hover-background-purple);
}

.nav-button:hover::before {
  opacity: 0.7;
}

/* Active state - modified to use bottom border instead of background */
.nav-button.active {
  color: var(--primary-color);
  font-weight: 600;
  background-color: var(--primary-tint-20); /* tokenized */
}

.nav-button.active::before {
  opacity: 1;
}

/* Focus state */
.nav-button:focus-visible {
  color: var(--accent-bright-blue);
  background-color: var(--hover-background-purple);
  outline: none;
}

@media (min-width: 769px) {
  .footer {
    position: absolute;
    margin-bottom: 0;
  }

  .header {
    margin-top: 0;
  }
}

/* ========== Overlay/Modal Base Styles ========== */

/* Base modal styles - slide-in from right */
.modal {
  position: absolute;
  top: 0;
  left: 100%;
  width: 100%;
  height: 100%;
  background-color: var(--background-color);
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain; /* prevent scroll chaining to parent when keyboard pushes */
}

.modal.fixed-header {
  overflow: hidden;
  flex-direction: column;
}

.modal.fixed-header .form-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-100%);
}

/* ========== Modal Header Consolidation ========== */

/* Base modal header styles */
.modal-header {
  height: 56px;
  display: flex;
  align-items: center;
  padding-top: calc(env(safe-area-inset-top));
  margin-bottom: 8px;
  background-color: var(--background-color);
  position: relative;
}

/* Desktop modal header adjustments */
@media (min-width: 769px) {
  .modal-header {
    padding-top: calc(env(safe-area-inset-top) + 16px);
  }
}

.back-button {
  position: absolute;
  left: 16px;
  /* z-index: 1; */
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-button::before {
  content: '';
  width: var(--icon-size-24);
  height: var(--icon-size-24);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'%3E%3C/polyline%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}

.chat-user-info {
  display: flex;
  align-items: center;
  margin-left: 56px;
  margin-right: 140px; /* Reserve space for header actions */
  gap: 12px;
  cursor: pointer;
  flex: 1;
  min-width: 180px; /* Minimum width for the container */
  max-width: calc(100vw - 200px); /* Responsive max width */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
  .chat-user-info {
    min-width: 120px; /* Smaller minimum on mobile */
    margin-right: 100px; /* Less margin on smaller screens */
  }
}

.chat-user-info:hover {
  opacity: 0.8;
}

.modal-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--light-color);
  /* shift slight to the right */
  margin-left: 4px;
}

.modal-avatar svg {
  width: 100%;
  height: 100%;
}

.modal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
  margin: 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0; /* Allow flex item to shrink below content size */
  max-width: 100%; /* Allow full width when possible */
}

/* Current time display in modal headers */
.current-time {
  position: absolute;
  right: 16px;
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--secondary-text-color);
  white-space: nowrap;
  user-select: none;
  /* Ensure it doesn't overlap with back button on smaller screens */
  max-width: calc(100% - 80px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-item {
  padding: 1rem 1.25rem;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--text-color);
  position: relative;
}

.menu-item:hover {
  background-color: var(--hover-background-purple);
}

.sign-out {
  color: var(--danger-color);
  font-weight: var(--font-weight-semibold);
}

.menu-item:last-child {
  border-bottom: none;
  margin-top: auto;
}


/* Form Container Base Styles */
.form-container {
  padding: 16px;
  width: 100%;
  box-sizing: border-box;
}

.modal-content {
  flex: 1;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-control {
  width: 100%;
  height: 56px;
  padding: 15px;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--background-color);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--focus-ring-primary);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
  padding-right: 45px;
}

textarea.form-control {
  min-height: 100px;
  resize: none;
  overflow-y: auto; /* Allow scrolling when needed */
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  -ms-overflow-style: none; /* Hide scrollbar for IE/Edge (older versions) */
}

input[type='file'].form-control {
  padding: 0;
  height: auto;
}

input[type='file'].form-control::file-selector-button {
  height: 56px;
  padding: 0 20px;
  margin-right: 15px;
  border: none;
  background-color: var(--light-color);
  color: var(--text-color);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  border-radius: 12px 0 0 12px;
}

/* ========== Utilities (non-invasive) ========== */
.u-mt-5 {
  margin-top: 5px;
}

.u-mt-20 {
  margin-top: 20px;
}

/* ========== Form Component Modifiers ========== */

.form--narrow {
  width: 100%;
  max-width: 390px;
  padding: 0 16px;
  margin: 0 auto;
  box-sizing: border-box;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 480px) {
  .form-actions.form-actions--inline {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }
}

/* Developer Options Styling */
.developer-options {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  background-color: var(--hover-background);
  transition: all 0.3s ease;
}

/* Developer options form groups - tighter spacing */
.developer-options .form-group {
  margin-bottom: 12px;
}

.developer-options label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-color);
  margin-bottom: 6px;
}

.developer-options .form-control {
  font-size: var(--font-size-sm);
}

.developer-options .form-control:disabled {
  background-color: var(--input-background);
  color: var(--secondary-text-color);
  cursor: not-allowed;
  opacity: 0.7;
}

.developer-options .form-control:disabled::placeholder {
  color: var(--secondary-text-color);
  opacity: 0.6;
}

/* Developer Options Toggle Checkbox */
#developerOptionsToggle {
  margin-right: 8px;
  transform: scale(1.1);
}

/* Developer Options Section Animation */
#developerOptionsSection {
  overflow: hidden;
  transition: all 0.3s ease;
}

#developerOptionsSection.show {
  animation: fadeInSlide 0.3s ease forwards;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 200px;
    transform: translateY(0);
  }
}

/* Floating Button Styles */
.floating-button {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 16px);
  right: 16px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: var(--background-color);
  font-size: 24px;
  font-weight: 400;
  border: none;
  box-shadow: var(--shadow-primary);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s,
    background-color 0.2s;
  padding: 0;
}

.floating-button.visible {
  display: flex;
  /* iOS Safari vertical centering fix */
  -webkit-box-align: center;
  -webkit-box-pack: center;
  /* Mobile vertical centering fix */
  line-height: 1;
  text-align: center;
}

.floating-button:hover {
  background-color: var(--primary-hover);
  transform: scale(1.05);
}

@media (min-width: 769px) {
  .floating-button {
    position: absolute;
    right: 16px;
    bottom: 120px;
  }
}

/* Chat Modal Styles */
#chatModal {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.messages-container {
  overflow-y: auto;
  padding: 1rem 1rem 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  overscroll-behavior: contain; /* stop scroll chaining to modal/body */
  touch-action: pan-y; /* allow vertical panning only */
}

.message-input-container {
  min-height: 80px;
  padding: 8px 14px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: white;
  display: flex;
  flex-direction: column; /* Change to column layout */
  width: 100%;
  pointer-events: none; /* Make the container itself non-interactive */
}

.message-input-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.message-byte-counter {
  font-size: 12px;
  color: var(--neutral-600);
  text-align: right;
  margin-bottom: 4px;
  display: none;
  width: 100%;
  padding-right: 63px;
}

.message-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  font-size: var(--font-size-base);
  font-family: var(--font-primary);
  resize: none;
  height: 48px;
  min-height: unset;
  line-height: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  align-items: center;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.message-input::-webkit-scrollbar {
  display: none;
}

.message-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--focus-ring-primary);
}

.send-button {
  background: var(--primary-color);
  color: var(--background-color);
  border: none;
  width: 48px; /* Changed from 45px to match message-input height */
  height: 48px; /* Changed from 45px to match message-input height */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  pointer-events: auto; /* Ensure the button is interactive */
}

.send-button svg {
  width: var(--icon-size-24);
  height: var(--icon-size-24);
  fill: currentColor;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  position: relative;
  text-align: left;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.message:hover {
  filter: brightness(95%);
}

.message.received {
  align-self: flex-start;
  background-color: var(--surface-muted);
  border-bottom-left-radius: 0.25rem;
}

.message.sent {
  align-self: flex-end;
  background-color: var(--primary-color);
  color: var(--background-color);
}

/* Make links white in sent messages for contrast */
.message.sent a {
  color: white;
  text-decoration: underline; /* Add underline for better visibility */
}

/* Optional: Style links in received messages if needed (default blue might be ok) */
.message.received a {
  /* color: darkblue; */ /* Example: Make links darker blue */
  text-decoration: underline;
}

.message.sent .message-time {
  color: rgba(255, 255, 255, 0.7);
  align-self: flex-end;
  margin-top: 2px;
}

.message-time {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
  text-align: left;
}

/* Dot indicating a message was edited since last read */
.edited-new-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  margin-left: 6px;
  box-shadow: 0 0 0 2px var(--primary-tint-12);
  vertical-align: middle;
}

@keyframes editedDotPulse {
  0% { transform: scale(0.6); opacity: 0.4; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.6); opacity: 0.4; }
}

.edited-new-dot {
  animation: editedDotPulse 2s ease-in-out 2;
}

.message-content {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

/* Wrapper for the send button and the toll information */
.message-input-wrapper {
  position: relative; /* For absolute positioning of .toll-container */
  flex: 1; /* Allows wrapper to grow */
  display: flex; /* Make wrapper a flex container */
  align-items: center; /* Vertically center its children (the textarea) */
  pointer-events: auto; /* Make this wrapper (and its children by default) interactive */
}

.toll-container {
  position: absolute;
  top: 100%;
  left: 17px; /* This aligns the container's right edge with the parent's right edge */
  margin-top: 1px; /* Keeping your existing margin */
  font-size: 0.8rem; /* Keeping your existing font size */
  line-height: 1.3; /* Keeping your existing line height */
  color: var(--secondary-text-color); /* Keeping your existing color */
  font-weight: 500; /* Keeping your existing font weight */
  white-space: nowrap; /* Essential to keep it on one line and allow overflow to the left */
  text-align: left; /* Aligns the text content itself to the right within the container */
  text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1); /* Keeping your existing text shadow */
}

/* .toll-label {
  Specific styles for the "Toll:" part if you want it to differ from the value.
     For example, if you wanted the label to be normal weight:
     font-weight: normal;
     Or a slightly different color:
     color: #555;
}
 */

.toll-value {
  /* Specific styles for the value part (e.g., "0 LIB").
     It will inherit from .toll-container.
     If you want the value to be even bolder than the label (which is now 500 weight): */
  /* font-weight: bold;  */ /* or  */
  font-weight: 500;
  /* Or a different color to make it stand out: */
  color: var(--secondary-text-color);
}

.toll-info-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  vertical-align: middle;
  transform: translateY(-1px);
}

.toll-info-icon:hover {
  opacity: 1;
}

.toll-info-icon[data-icon="info"]::before {
  content: '';
  width: 14px;
  height: 14px;
  background-image: var(--icon-info);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  display: block;
}
/* Wallet Styles */
.wallet-balance {
  padding: 2rem;
  text-align: center;
  background-color: var(--hover-background-purple);
  color: #1c1c21;
  border-radius: 8px;
  margin: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.balance-label {
  font-family: var(--font-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--primary-color);
}

.balance-amount {
  font-family: var(--font-primary);
  font-size: var(--font-size-xxl);
  font-weight: var(--font-weight-semibold);
  color: var(--primary-color);
  display: flex; /* Use Flexbox */
  align-items: center; /* Center items vertically */
  justify-content: center; /* Center items horizontally */
}

.balance-amount::before {
  content: '';
  width: 32px;
  height: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233d3dce' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='1' x2='12' y2='23'%3E%3C/line%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'%3E%3C/path%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.refresh-button {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 12px;
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.refresh-button::before {
  content: '';
  width: var(--icon-size-24);
  height: var(--icon-size-24);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.refresh-button.active {
  background-color: var(--primary-tint-12); /* tokenized */
  transform: rotate(180deg);
}

.wallet-actions {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  gap: 8px;
}

.wallet-action-button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background-color: var(--light-color);
  border: none;
  color: #1c1c21;
  padding: 16px;
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative; /* Added for notification dot */
}

/* Notification indicator for wallet action buttons */
.wallet-action-button::after {
  content: '';
  position: absolute;
  top: 4px; /* Adjust vertical position if needed */
  right: 10px; /* Adjust horizontal position if needed */
  width: 8px;
  height: 8px;
  background-color: var(--primary-color); /* Same blue color as nav buttons */
  border-radius: 50%;
  opacity: 0; /* Hidden by default */
  transition: opacity 0.2s ease;
  pointer-events: none; /* Prevent the dot interfering with clicks */
}

/* Show notification for wallet action button */
.wallet-action-button.has-notification::after {
  opacity: 1;
}

.wallet-action-button:hover {
  background-color: var(--hover-background-purple);
}

.action-icon {
  width: var(--icon-size-24);
  height: var(--icon-size-24);
  display: inline-block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.9;
}

/* Send icon (up chevron) */
#openSendAssetFormModal .action-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 15 12 9 6 15'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Receive icon (down chevron) */
#openReceiveModal .action-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* History icon (clock) */
#openHistoryModal .action-icon {
  background-image: var(--icon-clock);
}

/* Profile Sharing Note */
#accountModal .profile-sharing-note {
  text-align: center;
  color: var(--neutral-600);
  font-size: 14px;
  margin-bottom: 16px;
  font-family: var(--font-primary);
}

.action-label {
  font-weight: 500;
}

.section-title {
  font-family: var(--font-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
  margin: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.wallet-assets {
  padding: 1rem;
}

.asset-item {
  display: flex;
  align-items: center;
  padding: 1rem;
}

.asset-logo {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  margin-right: 1rem;
  background-color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.asset-info {
  flex: 1;
}

.asset-name {
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
  margin-bottom: 0.25rem;
  font-size: var(--font-size-base);
}

.asset-symbol {
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color);
}

.asset-balance {
  text-align: right;
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
  font-size: var(--font-size-base);
}

/* Transaction History Styles */
.transaction-list {
  margin-top: 1rem;
  max-width: 390px;
  margin: 0 auto;
}

.transaction-item {
  padding: 1rem;
}

.transaction-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.transaction-type {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
}

.transaction-type.send {
  color: var(--danger-color);
}

.transaction-type.receive {
  color: var(--success-color);
}

.transaction-type.stake {
  color: var(--warning-color); /* Orange color for stake transactions */
}

.transaction-type.unstake-positive {
  color: var(--info-color); /* Blue color for positive unstake transactions */
}

.transaction-type.unstake-negative {
  color: var(--danger-color); /* Red color for negative unstake transactions */
}

/* Add visual distinction for stake transactions */
.transaction-item[data-memo="stake"] {
  border-left: 3px solid var(--warning-color);
  padding-left: calc(1rem - 3px); /* Adjust padding to account for border */
}

/* Add visual distinction for unstake transactions */
.transaction-item[data-memo="unstake"] {
  border-left: 3px solid var(--info-color); /* Default blue border for unstake */
  padding-left: calc(1rem - 3px); /* Adjust padding to account for border */
}

/* Override border color for negative unstake transactions */
.transaction-item[data-memo="unstake"][data-amount-negative="true"] {
  border-left-color: var(--danger-color);
}

.transaction-amount {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-semibold);
}

.transaction-details {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color);
  font-family: var(--font-primary);
}

.transaction-address {
  word-break: break-all;
  flex: 1;
  margin-right: 1rem;
}

.transaction-time {
  white-space: nowrap;
  color: var(--secondary-text-color);
}

.transaction-memo {
  margin-top: 0.5rem;
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color);
  font-style: italic;
  font-family: var(--font-primary);
  overflow-wrap: break-word; /* Allow breaking long words */
  word-break: break-word; /* Ensure words break correctly */
  white-space: normal; /* Ensure text wraps */
}

/* Style the text that shows the selected file */
input[type='file'].form-control {
  color: var(--secondary-text-color);
  padding-right: 15px;
  display: flex;
  align-items: center;
}

#receiveModal .form-group div[style*='display: flex']:has(#displayAddress) {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  min-height: auto;
}

#displayAddress {
  background-color: var(--light-color) !important;
  font-family: var(--font-primary);
  font-size: 0.8rem !important;
  line-height: 1.3 !important;
  padding: 6px 10px !important;
  height: auto;
  cursor: default;
  color: var(--text-color);
  flex: 1;
  word-break: break-all;
  white-space: normal;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

/* Reduce bottom margin for the form-group containing the address */
#receiveModal .form-group:has(#displayAddress) {
  margin-bottom: 0.5rem;
}

#copyAddress {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Adjust vertical position for better centering */
  position: relative;
  top: -5px;
}

#copyAddress::before {
  content: '';
  width: 20px;
  height: 20px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  transition: background-image 0.2s ease;
}

/* Shared copy icon styling - used by both context menu copy icon and copy address button */
.context-menu-option[data-icon="copy"] .context-menu-icon,
#copyAddress::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E");
}

/* Edit icon styling */
.context-menu-option[data-icon="edit"] .context-menu-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.375 2.625a1.767 1.767 0 0 1 2.5 2.5L12 14l-4 1 1-4 9.375-8.375Z'/%3E%3C/svg%3E");
}

/* Edited label next to message */
.message-edited-label {
  font-size: 0.65rem;
  font-style: italic;
  color: var(--secondary-text-color);
  margin-left: 6px;
  opacity: 0.8;
}
.message.sent .message-edited-label {
  color: rgba(255, 255, 255, 0.7);
}

/* Success checkmark icon */
#copyAddress.success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
}

/* QR code container */
#qrcode {
  margin: 0.75rem auto !important;
  padding: 0.75rem;
  background-color: var(--light-color);
  border-radius: 8px;
  width: fit-content;
  display: flex;
  justify-content: center;
  align-items: center;
}

#qrcode img,
#qrcode canvas {
  display: block;
  width: 200px;
  height: 200px;
  max-width: 100%;
}

#availableBalance {
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color) !important;
  margin-bottom: 0.5rem;
}

.available-balance {
  margin-bottom: 0.5rem;
}

.balance-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--secondary-text-color);
}

.fee-info {
  color: var(--secondary-text-color);
}

.balance-warning,
#stakeAmountWarning,
#stakeNodeAddressWarning {
  font-size: 0.8em;
  color: var(--danger-color);
  display: none;
}

#sendToAddressError {
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
}

/* Number input specific styles */
/* Number input styles - consolidated from multiple modals */
input[type='number'].form-control {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type='number'].form-control::-webkit-outer-spin-button,
input[type='number'].form-control::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#backupModal p {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--text-color);
  margin-bottom: 1rem;
  line-height: 1.5;
  text-align: left;
}

#backupModal p:last-of-type {
  margin-bottom: 1.5rem;
}

#backupModal .checkbox-label {
  display: flex;
  align-items: center;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--text-color);
  cursor: pointer;
  margin-bottom: 0;
}

#backupModal .checkbox-label input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#removeAccountModal p {
  text-align: center;
  margin-bottom: 1rem;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--text-color);
}

/* Remove Account Modal Content Styling */
#removeAccountModal .modal-content-wrapper {
  padding: 1rem;
}

#removeAccountModal .modal-text-content {
  text-align: center;
  line-height: 1.5;
  margin-bottom: 1rem;
}

#removeAccountModal .modal-heading {
  margin: 0 0 1rem 0;
  color: var(--text-color);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-primary);
  font-size: var(--font-size-lg);
}

#removeAccountModal .modal-text-content p {
  margin: 0 0 0.75rem 0;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--text-color);
}

#removeAccountModal .modal-text-content p:last-child {
  margin: 0;
}

/* Migrate Accounts Modal styles */
#migrateAccountsModal .account-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 0.5rem;
}

#migrateAccountsModal .account-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--text-color);
  cursor: pointer;
}

#migrateAccountsModal .account-list label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color, #007bff);
  margin: 0;
}


#migrateAccountsModal .modal-summary {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--text-color);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  text-align: left;
}

.migrate-section {
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
}

/* Inconsistencies styles */
.migrate-inconsistencies {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.migrate-inconsistencies h3 {
  margin-bottom: 0.5rem;
}

.inconsistency-section {
  margin-bottom: 1.5rem;
}

.inconsistency-section h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.inconsistency-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0.5rem;
}

.inconsistency-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background-color: var(--background-light);
  border-radius: 6px;
  font-size: 0.9rem;
}

.migrate-section h3 {
  margin-top: 0;
  color: var(--text-color);
}

.section-description {
  font-size: 0.9rem;
  color: var(--neutral-600);
  margin-bottom: 1rem;
}

/* Remove Accounts Modal styles */
#removeAccountsModal .account-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

#removeAccountsModal .remove-accounts-section + .remove-accounts-section {
  margin-top: 1rem;
  border-top: 1px solid var(--border-color, #2d2d2d);
  padding-top: 0.75rem;
}

#removeAccountsModal .remove-accounts-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  opacity: 0.8;
  letter-spacing: 0.5px;
}

#removeAccountsModal .account-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#removeAccountsModal label.remove-account-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--surface-muted-alt, rgba(255,255,255,0.02));
  border: 1px solid var(--border-color, #2d2d2d);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}

#removeAccountsModal label.remove-account-row:hover {
  background: var(--surface-hover, rgba(255,255,255,0.06));
}

#removeAccountsModal label.remove-account-row input[type="checkbox"] {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: var(--primary-color, #007bff);
}

#removeAccountsModal .remove-account-username {
  font-weight: 600;
  flex: 0 0 auto;
}

#removeAccountsModal .remove-account-stats {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.7;
}

#removeAccountsModal .modal-summary {
  font-size: 0.8rem;
  line-height: 1.2rem;
  opacity: 0.9;
}

/* Common label styles */
.form-group label {
  display: block;
  text-align: left;
  width: 100%;
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--text-color);
} /* Specific style for search icon to ensure consistent size */

/* Sign In Modal specific styles */
#removeAccountButton {
  width: calc(100% - 32px);
  height: 48px;
  margin: 8px 16px;
  background-color: var(--hover-background);
  color: var(--danger-color);
  border: none;
  border-radius: 24px;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: background-color 0.2s;
}

#removeAccountButton:hover {
  background-color: var(--hover-background);
}

/* About Modal Content Styles */
#aboutModal #netIdAbout {
  word-wrap: break-word;
}

.about-content {
  padding: 1rem;
}

.about-logo {
  margin-bottom: 20px;
  width: 100%;
  max-width: 200px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.about-description {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--text-color);
  margin-bottom: 2rem;
  text-align: center;
}

.about-info-section {
  margin-bottom: 2rem;
}

.about-info-item {
  font-family: var(--font-primary);
  font-size: var(--font-size-xs);
  color: var(--secondary-text-color);
  margin-top: 10px;
  text-align: center;
}

.about-net-id {
  font-family: var(--font-primary);
  font-size: var(--font-size-xs);
  color: var(--secondary-text-color);
  word-wrap: break-word;
}

.about-links-section {
  margin-bottom: 1rem;
  text-align: center;
}

.about-source-links {
  margin-bottom: 1rem;
  text-align: center;
}

.about-external-links {
  text-align: center;
}

.about-link {
  display: inline-block;
  margin: 0.25rem 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  transition: opacity 0.2s ease;
}

.about-link:hover {
  opacity: 0.7;
}

.about-link:visited {
  color: var(--primary-color);
}

button.about-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

#checkForUpdatesBtn {
  display: none; /* Hidden by default, shown only in React Native app */
}

/* Contact Info Modal Styles */
.contact-info-list {
  padding: 0 1rem;
  overflow-y: auto;
  max-height: 100%;
  -webkit-overflow-scrolling: touch;
}

/* Contact Info Link Styles */
.contact-info-link {
  display: inline-block;
  color: var(--primary-color);
  text-decoration: none;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  transition: opacity 0.2s ease;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.contact-info-link:hover {
  opacity: 0.7;
}

.contact-info-link:visited {
  color: var(--primary-color);
}

/* Contact Avatar Section */
.contact-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  margin-bottom: 1rem;
  background-color: var(--hover-background-purple);
  border-radius: 16px;
}

.contact-avatar-section .avatar {
  width: 96px;
  height: 96px;
  margin-bottom: 1rem;
  border-radius: 50%;
  background-color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.contact-avatar-section .name {
  font-family: var(--font-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
  margin-bottom: 0.25rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.contact-avatar-section .subtitle {
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color);
  word-break: break-all;
  word-wrap: break-word;
  max-width: 100%;
  text-align: center;
}

.contact-info-item {
  padding: 0.5rem;
}

.contact-info-item:last-child {
  border-bottom: none;
}

.contact-info-label {
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color);
  margin-bottom: 4px;
}

.contact-info-value {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--text-color);
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}
/* Logs Textarea Styles */
#logsTextarea {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  font-size: 0.9em;
}

/* Search Bar Container */
.search-bar-container {
  padding: 8px 16px;
  background: var(--background-color);
}

/* Search Bar - Common styles for all search bars */
.search-bar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--hover-background-purple);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: none;
}

.search-bar:hover {
  background: var(--hover-background-dark);
}

/* Search input styles - Common for all search inputs */
.search-input {
  border: none;
  background: transparent;
  width: 100%;
  color: var(--text-color);
  cursor: pointer;
  font-size: var(--font-size-base); /* This is 16px */
  padding: 0;
  -webkit-appearance: none; /* Disable default iOS styling */
  appearance: none;
  -webkit-text-size-adjust: 100%; /* Prevent iOS font scaling */
  text-size-adjust: 100%;
  height: 24px; /* Fixed height */
  line-height: 24px; /* Match height for vertical centering */
  min-height: unset; /* Prevent iOS from enforcing a minimum height */
}

.search-input::placeholder {
  color: var(--secondary-text-color);
  opacity: 1;
  font-size: var(--font-size-base); /* Ensure placeholder also has 16px */
}

.search-input:focus {
  outline: none;
}

/* Search icon */
.search-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  opacity: 0.7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='22' y1='22' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* Modal specific search bar container */
.modal .form-container .search-bar {
  margin-bottom: 16px;
}

/* Search Modal */
.search-modal {
  display: none;
}

.search-modal.active {
  display: flex;
}

/* Remove any conflicting styles */
#messageSearch,
#contactSearch {
  padding-left: 0; /* Reset padding since it's handled by search bar */
  border-radius: 0; /* Reset border radius since it's handled by search bar */
  background: transparent; /* Reset background since it's handled by search bar */
}

/* Message Highlight Animation */
.message.highlighted {
  animation: highlight-message 2s ease;
}

@keyframes highlight-message {
  0%,
  100% {
    background: transparent;
  }
  20%,
  80% {
    background: var(--highlight-color);
  }
}

/* Style for failed sent messages */
.message.sent[data-status='failed'] {
  background-color: var(--primary-muted); /* Slightly desaturated blue */
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative; /* Needed for absolute positioning of the icon */
  /* Removed padding-left: 35px; */
  margin-right: 32px; /* Add margin to push bubble left */
}

/* Change ::before to ::after and adjust positioning */
.message.sent[data-status='failed']::after {
  content: '!';
  position: absolute;
  left: 100%; /* Position at the right edge */
  margin-left: 8px; /* Add space to the right */
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-color: var(--danger-color); /* Red background */
  color: var(--background-color); /* White exclamation mark */
  border-radius: 50%; /* Make it a circle */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

/* Style for highlighted search matches */
mark {
  background-color: var(--highlight-color);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* ========== Chat List Consolidation ========== */

/* Base chat item styles - consolidated from multiple instances */
.chat-list .chat-item,
#searchResults .chat-list .chat-item {
  display: flex;
  padding: 12px 16px;
  background: var(--background-color);
  cursor: pointer;
}

/* Hover effects for all chat items */
.chat-list .chat-item:hover,
#searchResults .chat-list .chat-item:hover {
  background: var(--hover-background);
}

/* Search result specific overrides */
.chat-list .search-result-item {
  border: none;
}

.chat-list .search-result-item:last-child {
  border: none;
}

.chat-list .search-result-item:hover {
  background: var(--hover-background);
}

/* Search Results Container */
#searchResults {
  padding: 0;
  margin: 0;
}

/* Search Results List */
#searchResults .chat-list {
  padding: 0;
  margin: 0;
}

/* Header actions container */
.header-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  position: absolute;
  right: 16px;
}

/* Icon button styles (for chat button) */
.icon-button.chat-icon {
  color: var(--text-color);
  background-image: var(--icon-chat);
}

/* Contact section headers */
.contact-section-header {
  padding: 3.5px 16px;
  font-size: var(--font-size-s);
  font-weight: var(--font-weight-normal);
  color: var(--secondary-text-color);
  background-color: var(--background-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Edit mode styles */
.contact-info-value.editing {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-direction: row;
  min-width: 0; /* Allow flex items to shrink below their content size */
  width: 100%; /* Ensure it takes full width of parent */
}

.edit-field-input {
  flex: 1;
  min-width: 0; /* Allow input to shrink below its content size */
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease;
  margin-right: 4px; /* Add margin to create space between input and button */
}

.edit-field-input:focus {
  border-color: var(--primary-color);
  box-shadow: var(--focus-ring-primary);
}

.field-action-button {
  width: 60px;
  height: 32px;
  border-radius: 6px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  padding: 0;
  transition: all 0.2s ease;
  position: relative;
}

.field-action-button::before {
  content: '';
  width: 60px;
  height: 32px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.field-action-button.clear::before {
  width: 60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='32' viewBox='0 0 60 32'%3E%3Crect x='2' y='2' width='56' height='28' rx='6' fill='%23ffffff' stroke='%23dc3545' stroke-width='2'/%3E%3Ctext x='30' y='21' text-anchor='middle' font-family='system-ui, -apple-system, sans-serif' font-size='14' font-weight='600' fill='%23dc3545'%3EClear%3C/text%3E%3C/svg%3E");
}

.field-action-button.add::before {
  width: 54px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='54' height='32' viewBox='0 0 54 32'%3E%3Crect x='2' y='2' width='50' height='28' rx='6' fill='%2328a745' stroke='%2328a745' stroke-width='2'/%3E%3Ctext x='27' y='21' text-anchor='middle' font-family='system-ui, -apple-system, sans-serif' font-size='14' font-weight='600' fill='%23ffffff'%3ESave%3C/text%3E%3C/svg%3E");
}

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

.field-action-button:hover::before {
  opacity: 1;
}

/* Toast Notification Styles */
.toast-container {
  position: fixed;
  top: 25%;
  left: 50%;
  transform: translate(-50%, 0);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 85%;
  max-width: 320px;
  /* Add iOS specific improvements */
  -webkit-transform: translate3d(-50%, 0, 0);
  transform: translate3d(-50%, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000;
  perspective: 1000;
}

.toast {
  background: rgba(0, 0, 0, 0.8); /* keep literal for high contrast overlay */
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  pointer-events: none;
  text-align: center;
  max-width: 280px;
  margin: 0 auto;
  /* Add iOS specific improvements */
  -webkit-transform: translateY(-20px) translate3d(0, 0, 0);
  transform: translateY(-20px) translate3d(0, 0, 0);
  -webkit-transition: all 0.3s ease;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000;
  perspective: 1000;
  will-change: transform, opacity;
  word-break: break-word;
}

/* Toast type styles */
.toast.success {
  background: rgba(40, 167, 69, 0.9);
}

.toast.error {
  background: rgba(220, 53, 69, 0.9);
  padding-top: 32px; /* Add more padding at the top to accommodate the close button */
  padding-bottom: 32px;
  cursor: pointer; /* Add cursor pointer for the whole toast */
}

.toast.warning {
  background: rgba(239, 108, 0, 0.9);
}

.toast.info {
  background: rgba(0, 123, 255, 0.9);
}

/* Update available toast content */
.toast-update-title {
  text-align: center;
  line-height: 1.4;
  font-size: 16px;
  font-weight: 700;
  margin-top: 9px;
  margin-bottom: 18px;
}

.toast-update-button {
  display: block;
  margin-top: 6px;
  padding: 8px 12px;
  background: #ffffff;
  color: #0056b3;
  border-radius: 16px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
}

.toast.toll {
  background: rgba(0, 123, 255, 0.9);
  text-align: left;
  max-width: 400px;
  width: 90%;
  padding: 16px 20px;
  line-height: 1.4;
}

/* Styling for toll info message content */
.toll-info-message h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: bold;
  color: white;
}

.toll-info-message h5 {
  margin: 16px 0 8px 0;
  font-size: 14px;
  font-weight: bold;
  color: white;
}

.toll-info-message p {
  margin: 0 0 12px 0;
  color: white;
}

.toll-info-message ul {
  margin: 8px 0;
  padding-left: 20px;
  color: white;
}

.toll-info-message li {
  margin: 4px 0;
  color: white;
}

.toll-info-message strong {
  font-weight: bold;
}

.toast.online {
  background: rgba(0, 102, 204, 0.9);
}

.toast.offline {
  background: rgba(108, 117, 125, 0.9);
}

.toast.loading {
  background: rgba(0, 0, 0, 0.7); /* keep literal for high contrast overlay */
  position: relative; /* Keep for potential future absolute elements if needed */
  display: flex; /* Use flexbox */
  align-items: center; /* Vertically center items */
  gap: 10px; /* Add gap between spinner and text */
  padding-left: 15px; /* Add some padding back for the left edge */
}

.toast.loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0; /* Prevent spinner from shrinking */
  /* No margin needed now as gap is used on parent */
}

@keyframes spin {
  0% {
    transform: translateY(-50%) rotate(0deg);
  }
  100% {
    transform: translateY(-50%) rotate(360deg);
  }
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  -webkit-transform: translateY(0) translate3d(0, 0, 0);
}

@media (min-width: 769px) {
  .toast-container {
    position: absolute;
  }
}

/* Offline States */
.offline-disabled {
  opacity: 0.6;
  cursor: not-allowed !important;
  position: relative;
  pointer-events: none;
}

/* Offline indicator in header */
.offline-indicator {
  color: var(--danger-color);
  font-size: 12px;
  font-weight: 600;
  border-radius: 12px;
  transition:
    opacity 0.3s ease,
    width 0.3s ease,
    padding 0.3s ease;
  animation: pulse 2s infinite;
  /* Keep in the normal flow but with zero width when hidden */
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  margin-right: 4px;
  width: 0;
  padding: 0;
  overflow: hidden;
}

/* When visible, restore width and padding */
.offline-indicator[style*='opacity: 1'] {
  width: auto;
  padding: 4px 8px;
  overflow: visible;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

/* Exception for floating button - don't apply position:relative */
.floating-button.offline-disabled {
  position: fixed; /* Keep the original positioning */
}

@media (min-width: 769px) {
  .floating-button.offline-disabled {
    position: absolute; /* Match the media query from the original floating-button */
  }
}

.offline-disabled::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(0, 0, 0, 0.228) 10px,
    rgba(0, 0, 0, 0.153) 20px
  );
  pointer-events: none;
  border-radius: inherit; /* Match the target element's radius (works for circles and rectangles) */
}

.offline-disabled:hover::after {
  content: 'Requires internet connection';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8); /* keep literal for high contrast overlay */
  color: white;
  padding: 8px 12px;
  border-radius: 28px;
  font-size: 12px;
  white-space: nowrap;
  /* z-index: 1000; */
  pointer-events: none;
}

/* Add friend icon button in chat modal */
.icon-button.add-friend-icon {
  color: var(--success-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2328a745' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='9' cy='7' r='4'%3E%3C/circle%3E%3Cline x1='19' y1='8' x2='19' y2='14'%3E%3C/line%3E%3Cline x1='22' y1='11' x2='16' y2='11'%3E%3C/line%3E%3C/svg%3E");
}

.icon-button.add-friend-icon:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2328a745' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='9' cy='7' r='4'%3E%3C/circle%3E%3Cline x1='19' y1='8' x2='19' y2='14'%3E%3C/line%3E%3Cline x1='22' y1='11' x2='16' y2='11'%3E%3C/line%3E%3C/svg%3E");
}

.icon-button.add-friend-icon.removing:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23dc3545' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='9' cy='7' r='4'%3E%3C/circle%3E%3Cline x1='22' y1='11' x2='16' y2='11'%3E%3C/line%3E%3C/svg%3E");
}

.icon-button.add-friend-icon.status-0 {
  /* Red user icon for status 0 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='red' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20v-2a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v2'/%3E%3C/svg%3E");
}
.icon-button.add-friend-icon.status-1 {
  /* Black user icon for status 1 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20v-2a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v2'/%3E%3C/svg%3E");
}
.icon-button.add-friend-icon.status-2 {
  /* Blue user icon for status 2 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='blue' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20v-2a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v2'/%3E%3C/svg%3E");
}
.icon-button.add-friend-icon.status-3 {
  /* Green user icon for status 3 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='green' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20v-2a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v2'/%3E%3C/svg%3E");
}

/* Add attachment button */
.icon-button.add-attachment-button {
  width: 44px;
  height: 48px;
  padding: 0;
  flex-shrink: 0;
  pointer-events: auto;
  opacity: 0.7;
  min-width: 44px; /* iOS recommended minimum touch target */
}

/* Cancel edit button - appears to the left of message input when editing */
.icon-button.cancel-edit-button {
  width: 20px;
  height: 48px;
  padding: 0;
  flex-shrink: 0;
  pointer-events: auto;
  color: var(--danger-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23dc3545' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: var(--icon-size-24) var(--icon-size-24);
  opacity: 0.8;
}

.icon-button.add-attachment-button::before {
  content: '';
  width: var(--icon-size-24);
  height: var(--icon-size-24);
  display: block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: var(--icon-size-24) var(--icon-size-24);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

/* If you're not using Font Awesome, we can create a custom chevron icon */
.chat-time-chevron {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2365676b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  vertical-align: middle;
}

/* QR Code Payment Styles */
.qr-data-preview {
  font-size: 0.875rem;
  padding: 10px 15px;
  word-break: keep-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  background-color: var(--light-color);
  cursor: default;
  height: auto;
  margin-top: 1rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  position: relative;
  transition: none;
}

/* QR Code Scan Button */
#scanQRButton {
  background-color: transparent;
  border: none;
  color: var(--info-color);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

#scanQRButton svg {
  display: block;
}

/* Match New Chat QR buttons to Send Asset styles */
#newChatScanQRButton,
#newChatUploadQRButton {
  color: var(--info-color);
}

#newChatScanQRButton::before,
#newChatUploadQRButton::before {
  content: '';
  width: 24px;
  height: 24px;
  background-color: currentColor;
  display: block;
}

/* Adjust media query styles */
@media (max-width: 400px), (max-height: 700px) {
  #receiveModal .qr-data-preview {
    font-size: 0.8rem;
    padding: 8px 12px;
    min-height: auto;
    height: auto;
  }

  #receiveModal #displayAddress {
    font-size: 0.75rem !important;
    padding: 5px 8px !important;
    line-height: 1.25 !important;
  }

  #receiveModal .form-group div[style*='display: flex']:has(#displayAddress) {
    gap: 6px !important;
  }
}
/* start of scanner stuff added by DB */
.qr-data-preview {
  font-size: 0.875rem;
  padding: 12px 15px;
  word-break: break-all;
  line-height: 1.5;
  background-color: var(--light-color);
  cursor: default;
  max-height: 150px;
  overflow-y: auto;
  margin-top: 1rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}



.qr-data-preview {
  font-size: 0.875rem;
  padding: 15px;
  word-break: break-all;
  line-height: 1.5;
  background-color: var(--light-color);
  cursor: default;
  height: auto;
  max-height: none;
  overflow: visible;
  margin-top: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  transition: all 0.3s ease;
  position: relative;
}

.qr-data-preview.minimized {
  height: 60px !important;
  max-height: 60px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 10px 40px 10px 15px;
}

/* QR Scanner Styles */
.qr-scanner-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  /* z-index: 1000; */
  display: flex;
  flex-direction: column;
}

#qrVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.scanner-guide {
  width: 70%;
  height: 70%;
  max-width: 500px;
  max-height: 500px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 0 0 100vmax var(--overlay-backdrop-color);
  position: relative;
}

.scanner-guide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8) inset;
  animation: scan-animation 2s infinite;
}

@keyframes scan-animation {
  0% {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8) inset;
  }
  50% {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.8) inset;
  }
  100% {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8) inset;
  }
}

.scanner-controls {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  padding: 0 20px;
}

.scanner-button {
  padding: 12px 24px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  font-size: 16px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.scanner-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Ensure the scanner is properly positioned on iOS */
@supports (-webkit-touch-callout: none) {
  .qr-scanner-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    /* Fix for iOS 100vh issue */
    height: -webkit-fill-available;
  }
}
/* end of scanner stuff added by DB */

/* the following qr code scan stuff was added by Omar */
.scanner-container {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: var(--elev-3);
  background-color: var(--background-color);
  aspect-ratio: 4/3;
}

/* QR Scan video element */
#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.scan-region-highlight {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border: 2px dashed var(--info-color);
  border-radius: 8px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
}



/* QR Scan canvas element (kept hidden; used for frame processing) */
#canvas {
  display: none;
}

/* ========= MyInfo: Username QR ========= */
#myInfoQR {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#myInfoQR img {
  display: block;
  width: 160px;
  height: 160px;
  image-rendering: pixelated;
}

/* ========= New Chat: QR Scan/Upload icons next to input ========= */
.input-append-icons {
  display: inline-flex;
  flex-shrink: 0;
  gap: 8px;
  margin-left: 8px;
  vertical-align: middle;
}

#newChatForm #chatRecipient {
  padding-right: 0.5rem;
}

#newChatScanQRButton::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M3,3 L10,3 L10,10 L3,10 Z M5,5 L5,8 L8,8 L8,5 Z M14,3 L21,3 L21,10 L14,10 Z M16,5 L16,8 L19,8 L19,5 Z M3,14 L10,14 L10,21 L3,21 Z M5,16 L5,19 L8,19 L8,16 Z M14,14 L21,14 L21,21 L14,21 Z M16,16 L16,19 L19,19 L19,16 Z M11,3 L13,3 L13,10 L11,10 Z M11,14 L13,14 L13,21 L11,21 Z M3,11 L10,11 L10,13 L3,13 Z M14,11 L21,11 L21,13 L14,13 Z'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M3,3 L10,3 L10,10 L3,10 Z M5,5 L5,8 L8,8 L8,5 Z M14,3 L21,3 L21,10 L14,10 Z M16,5 L16,8 L19,8 L19,5 Z M3,14 L10,14 L10,21 L3,21 Z M5,16 L5,19 L8,19 L8,16 Z M14,14 L21,14 L21,21 L14,21 Z M16,16 L16,19 L19,19 L19,16 Z M11,3 L13,3 L13,10 L11,10 Z M11,14 L13,14 L13,21 L11,21 Z M3,11 L10,11 L10,13 L3,13 Z M14,11 L21,11 L21,13 L14,13 Z'/%3E%3C/svg%3E") no-repeat center / contain;
}

#newChatUploadQRButton::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99 0-2h3V2h2v3h3v2h-3zm-3 4V8h-3V5H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8h-3zM5 19l3-4 2 3 3-4 4 5H5z'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99 0-2h3V2h2v3h3v2h-3zm-3 4V8h-3V5H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8h-3zM5 19l3-4 2 3 3-4 4 5H5z'/%3E%3C/svg%3E") no-repeat center / contain;
}

small {
  font-size: 0.8rem;
  color: var(--secondary-text-color);
  text-align: left;
  display: block;
  padding: 8px;
  border-radius: 4px;
  margin-top: 8px;
}

#sendAssetConfirmModal .confirmation-details {
  margin-bottom: 24px;
  background-color: var(--hover-background-purple);
  border-radius: 12px;
  padding: 16px;
}

#sendAssetConfirmModal label {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color);
  margin-bottom: 8px;
  font-weight: var(--font-weight-medium);
}

#sendAssetConfirmModal .confirm-value {
  font-size: var(--font-size-base);
  color: var(--text-color);
  padding: 12px 16px;
  background-color: var(--background-color);
  border-radius: 8px;
  word-break: break-all;
  font-weight: var(--font-weight-medium);
  border: 1px solid var(--border-color);
}

#sendAssetConfirmModal .btn,
#sendAssetConfirmModal .btn.btn--secondary {
  width: calc(100% - 32px);
  height: 48px;
  border-radius: 24px;
  margin: 8px 16px;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  transition: all 0.2s ease;
}

#sendAssetConfirmModal .btn.btn--primary {
  background-color: var(--primary-color);
  color: var(--background-color);
  border: none;
}

#sendAssetConfirmModal #confirmAmount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-color);
}

#sendAssetConfirmModal #confirmMemoGroup {
  opacity: 0.8;
}

#sendAssetConfirmModal #confirmMemo {
  font-style: italic;
  background-color: var(--primary-tint-04);
}

#sendAssetConfirmModal .usd-equivalent {
  font-size: 0.92em;
  color: var(--secondary-text-color);
  opacity: 0.7;
  margin-top: 2px;
  margin-left: 2px;
  font-weight: var(--font-weight-medium);
}

#sendAssetConfirmModal .usd-equivalent {
  position: absolute;
  right: 16px;           /* Align to the right edge */
  left: auto;            /* Ensure left is not set */
  top: calc(100% - 0px); /* Just below the amount box */
  font-size: 0.92em;
  color: var(--secondary-text-color);
  opacity: 0.7;
  font-weight: var(--font-weight-medium);
  margin: 0;
  pointer-events: none;
  text-align: right;     /* Align text to the right */
  width: calc(100% - 32px); /* Ensure it doesn't overflow the input */
}

.icon-button.edit-icon {
  color: var(--text-color);
  opacity: 0.7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'%3E%3C/path%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'%3E%3C/path%3E%3C/svg%3E");
}

.contact-info-value-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px; /* space between value and icon */
  width: 100%;
  position: relative;
}

.contact-info-value-container .contact-info-value {
  text-align: center;
}

.contact-info-value-container .icon-button {
  width: var(--icon-size-24);
  height: var(--icon-size-24);
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s;
  position: absolute;
  left: calc(50% + 30px);
  top: -25px; /* Move the icon up slightly */
}

.contact-info-value-container .icon-button:hover {
  opacity: 1;
}

/* Send money icon button */
.icon-button.send-money-icon {
  border: none;
  cursor: pointer;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px;
  opacity: 0.7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='1' x2='12' y2='23'%3E%3C/line%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'%3E%3C/path%3E%3C/svg%3E");
}

/* Phone icon button for calls */
.icon-button.phone-icon {
  border: none;
  cursor: pointer;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px;
  opacity: 0.7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E");
}

.hidden {
  display: none;
}

/* Explicitly prevent background change on :active for iOS quirks */
#uploadQRButton:hover,
#scanQRButton:hover {
  background-color: transparent !important;
}

/* Add these styles for the password visibility toggle */
.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: var(--icon-size-20); /* SVG width */
  height: var(--icon-size-20); /* SVG height */
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* Default eye icon (stroke: #6c757d) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='var(--icon-size-20)' height='var(--icon-size-20)' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'%3E%3C/path%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3C/svg%3E");
  z-index: 2;
}

/* Eye icon hover (stroke: #343a40) */
.password-toggle-btn:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='var(--icon-size-20)' height='var(--icon-size-20)' viewBox='0 0 24 24' fill='none' stroke='%23343a40' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'%3E%3C/path%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3C/svg%3E");
}

/* Eye-slash icon when toggled (stroke: #6c757d) */
.password-toggle-btn.toggled-visible {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='var(--icon-size-20)' height='var(--icon-size-20)' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'%3E%3C/path%3E%3Cline x1='1' y1='1' x2='23' y2='23'%3E%3C/line%3E%3C/svg%3E");
}

/* Eye-slash icon when toggled and hovered (stroke: #343a40) */
.password-toggle-btn.toggled-visible:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='var(--icon-size-20)' height='var(--icon-size-20)' viewBox='0 0 24 24' fill='none' stroke='%23343a40' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'%3E%3C/path%3E%3Cline x1='1' y1='1' x2='23' y2='23'%3E%3C/line%3E%3C/svg%3E");
}

/* Optional: Adjust input padding if the icon overlaps text */
#newPrivateKey {
  padding-right: 40px; /* Add padding to prevent text from going under the icon */
}

/* Style adjustments for focus or hover if desired */
.password-toggle-btn:hover {
  color: var(--dark-color);
}

.error-message {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: none;
}

.contact-list-info {
  font-family: var(--font-monospace);
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  letter-spacing: 0.5px;
}

/* Call Invite Modal Styles */
.call-invite-modal-container {
  min-height: 250px;
}

.call-invite-contacts-scroll {
  overflow: auto;
  flex: 1 1 auto;
  padding: 8px 0;
  max-height: calc(72vh - 120px);
}

.call-invite-section-header {
  padding: 8px 12px;
  font-weight: var(--font-weight-bold);
  color: var(--primary-text-color);
  background: transparent;
  border-top: 1px solid rgba(0,0,0,0.04);
}

.call-invite-contact-row {
  padding: 8px 12px;
  display: flex;
  align-items: center;
}

.call-invite-contact-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
}

.call-invite-contact-checkbox {
  width: 18px;
  height: 18px;
}

.call-invite-contact-name {
  flex: 1 1 auto;
  text-align: left;
  font-size: var(--font-size-base);
}

.call-invite-modal-footer {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--modal-footer-bg, #fff);
  /* pin to bottom of modal content */
  position: sticky;
  bottom: 0;
}

.call-invite-counter {
  font-size: 0.9rem;
  color: var(--secondary-text-color);
}

.call-invite-footer-actions {
  display: flex;
  gap: 8px;
}

.context-menu-option[data-icon="call-invite"] .context-menu-icon{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='9' cy='7' r='4'%3E%3C/circle%3E%3Cline x1='19' y1='8' x2='19' y2='14'%3E%3C/line%3E%3Cline x1='22' y1='11' x2='16' y2='11'%3E%3C/line%3E%3C/svg%3E");
}
.context-menu-option[data-icon="call"] .context-menu-icon{
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E"); 
}

/* Edit & Resend icon for context menu */
.context-menu-option[data-icon="retry"] .context-menu-icon {
  background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='currentColor' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='1 4 1 10 7 10'/%3E%3Cpath d='M3.51 15a9 9 0 1 0 2.13-9.36L1 10'/%3E%3C/svg%3E");
}

/* Styles for Payment Messages in Chat */

/* Base styles for payment header (center, monospace, gap) */
.payment-header {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  padding: 30px 0; /* User adjusted */
  font-family: Georgia, serif; /* Changed font family */
  font-size: var(--font-size-sm); /* Base size for header */
  text-align: center;
}

/* Styles for the direction/amount spans within the header */
.payment-amount,
.payment-direction {
  font-weight: var(--font-weight-bold); /* Keep bold */
  font-size: var(--font-size-base); /* Keep large */
  /* Font family inherited from .payment-header */
}

/* Base styles for payment memo (italic, top border) */
.payment-memo {
  font-size: var(--font-size-sm);
  font-style: italic;
  opacity: 0.9;
  margin-top: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.1); /* User changed to solid */
  padding-top: 4px;
  white-space: normal;
  overflow: hidden;
  word-wrap: break-word;
  word-break: break-all;
}

/* Make direction and amount stand out */
.payment-amount,
.payment-direction {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
}

/* Common bubble padding */
.message.sent.payment-info,
.message.received.payment-info {
  padding: 0.75rem 1rem;
  /* Bubble background/color/border inherited from .message.sent/.received */
  max-width: 85%; /* Set maximum width (adjust percentage if needed) */
  width: 85%; /* Force width to max */
  box-sizing: border-box; /* Include padding/border in width */
}

/* --- Styling for elements INSIDE SENT payments --- */
.message.sent.payment-info .payment-header {
  color: white;
  /* No bottom border needed */
}
.message.sent.payment-info .payment-memo {
  color: rgba(255, 255, 255, 0.9);
  border-top-color: rgba(255, 255, 255, 0.2);
}
.message.sent.payment-info .payment-memo a {
  color: white;
  text-decoration: underline;
}
.message.sent.payment-info .message-time {
  color: rgba(255, 255, 255, 0.7);
}

/* --- Styling for elements INSIDE RECEIVED payments --- */
.message.received.payment-info .payment-header {
  color: var(--text-color);
  width: 100%; /* Keep full width */
  /* No bottom border needed (user removed) */
}
.message.received.payment-info .payment-memo {
  color: var(--secondary-text-color);
  border-top-color: rgba(0, 0, 0, 0.15);
}
.message.received.payment-info .payment-memo a {
  color: var(--primary-color);
  text-decoration: underline;
}
.message.received.payment-info .message-time {
  color: var(--secondary-text-color);
  opacity: 0.7;
}

/* Styles for Payment Previews in Chat List */
.chat-item .chat-message .payment-preview {
  font-weight: var(--font-weight-bold);
  /* color: var(--text-color); */ /* Or a distinct color */
}

.chat-item .chat-message .memo-preview {
  font-style: italic;
  /* color: var(--secondary-text-color); */ /* Or a muted color */
}

/* --- Validator Modal --- */
#validatorModal .modal-content {
  padding: 16px;
  padding-top: 24px; /* Add more top padding */
  display: flex;
  flex-direction: column;
  align-items: center; /* Center items */
  gap: 24px; /* Increase space between action items */
  overflow-y: auto;
}

#validatorModal .modal-content p {
  text-align: center; /* Center the text */
  color: var(--secondary-text-color);
  margin-bottom: 8px; /* Reduced space below main paragraph */
  font-size: var(--font-size-base);
}

#validatorModal .action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%; /* Take full width */
  gap: 8px; /* Space between button and its description */
}

.action-description {
  font-size: var(--font-size-sm); /* Smaller font */
  color: var(--secondary-text-color);
  text-align: center;
  margin: 0 16px; /* Horizontal margin */
  line-height: 1.4;
  max-width: 360px; /* Limit width */
}

#validatorModal .btn.btn--pill.btn--full {
  width: calc(100% - 32px);
  max-width: 360px; /* Max width for larger screens */
  height: 48px;
  border-radius: 24px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  margin: 0; /* Remove margin as it's handled by action-item */
  /* Inherit background/color from .btn */
}

/* Ensure primary button style */
#validatorModal #openStakeModal {
  background-color: var(--primary-color);
  color: var(--background-color);
  border: none;
}
#validatorModal #openStakeModal:hover {
  background-color: var(--primary-hover);
}

#validatorModal #validator-learn-more {
  background-color: var(--primary-color);
  color: var(--background-color);
  border: none;
}
#validatorModal #validator-learn-more:hover {
  background-color: var(--primary-hover);
}

/* --- Validator Modal Details --- */
.validator-info-container {
  padding: 0 1rem; /* Add horizontal padding */
  margin-bottom: 1rem; /* Space before action buttons */
  width: 100%; /* Ensure it takes available width */
}

.info-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.info-section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.info-section h4 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-color);
  margin-bottom: 0.75rem;
  text-align: left;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0; /* Vertical padding for spacing */
  gap: 1rem; /* Space between label and value */
  border-bottom: 1px solid var(--border-color); /* Lighter border for items */
}

.info-section .info-item:last-child {
  border-bottom: none; /* Remove border from last item in section */
}

.info-label {
  font-weight: var(--font-weight-medium);
  color: var(--secondary-text-color);
  font-size: var(--font-size-sm);
  flex-shrink: 0; /* Prevent label from shrinking */
  text-align: left;
}

.info-value {
  color: var(--text-color);
  font-size: var(--font-size-sm);
  text-align: right;
  word-break: break-all; /* Allow long values to wrap */
}

.info-value.code {
  font-family: var(--font-monospace);
  font-size: var(--font-size-xs); /* Smaller for code */
}

/* Specific layout for Nominated Validator */
.info-item.vertical-layout {
  flex-direction: column; /* Stack label and value vertically */
  align-items: flex-start; /* Align items to the start (left) */
  gap: 0.25rem; /* Reduce gap between label and value */
  padding: 0.75rem 0; /* Adjust padding if needed */
}

.info-item.vertical-layout .info-label {
  font-weight: var(--font-weight-bold); /* Make label bold */
  margin-bottom: 2px; /* Small space below label */
}

.info-item.vertical-layout .info-value {
  text-align: left; /* Align value to the left */
  font-size: var(--font-size-sm); /* Slightly larger for readability */
  line-height: 1.3; /* Improve line spacing if it wraps */
}

/* --- Spinner (if needed) --- */
.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: var(--primary-color);
  margin: 0 auto 1rem auto; /* Center spinner */
  animation: spin 1s ease infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#stakeAvailableBalanceDisplay {
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  color: var(--secondary-text-color) !important;
  margin-bottom: 0.5rem;
  text-align: left;
}

/* Style for failed transactions in history */
.transaction-item[data-status='failed'] {
  background-color: rgba(220, 53, 69, 0.08); /* Light red background */
  border-left: 3px solid var(--danger-color); /* Red border on the left */
  position: relative; /* Needed for absolute positioning of the icon */
  padding-right: 32px; /* Space for the icon on the right */
}

.transaction-item[data-status='failed']::after {
  content: '!';
  position: absolute;
  right: 8px; /* Position at the right of the transaction item */
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-color: var(--danger-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

/* Style for failed payment messages in chat */
.message.sent.payment-info[data-status='failed'] {
  background-color: var(--primary-muted); /* Slightly desaturated blue */
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative; /* Needed for absolute positioning of the icon */
  margin-right: 32px; /* Add margin to push bubble left */
}

.message.sent.payment-info[data-status='failed']::after {
  content: '!';
  position: absolute;
  left: 100%; /* Position at the right edge */
  margin-left: 8px; /* Add space to the right */
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-color: var(--danger-color); /* Red background */
  color: white; /* White exclamation mark */
  border-radius: 50%; /* Make it a circle */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

#stakeAvailableBalanceDisplay {
  font-size: 0.85em;
  color: var(--secondary-text-color);
  margin-bottom: 8px;
  text-align: left;
}

/* Styles for the failed message pop-up dialog */
.modal-dialog .modal-header {
  /* Assuming .modal-header already has flex and alignment for title and back button */
  /* We might want to ensure it fits the smaller dialog width */
  padding: 12px 16px; /* Adjust padding if needed */
}

/* Dialog form container (single canonical rule) */
.modal-dialog .form-container {
  background-color: var(--background-color);
  padding: 20px;
  border-radius: var(--overlay-border-radius);
  box-shadow: var(--overlay-shadow);
  width: auto;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-dialog .modal-actions {
  display: flex;
  flex-direction: column; /* Stack buttons vertically */
  align-items: center; /* Center buttons horizontally in the column */
  gap: 10px; /* Space between buttons vertically */
}

.modal-dialog .modal-actions .btn {
  padding: 8px 16px; /* Adjust button padding for a more compact look */
  font-size: var(--font-size-sm);
  width: 300px; /* Override general button widths */
  height: 48px; /* Let padding and content determine height */
  margin: 0; /* Reset margin, rely on flex gap */
}

.transaction-item[data-status='failed'] {
  border-left: 4px solid var(--danger-color);
  padding-left: 10px; /* Add some padding so content doesn't touch the border */
}

/* Styles for the failed message pop-up dialog */

/* Dialog overlay - centered with backdrop */
.modal.modal-dialog {
  display: none; /* Hidden by default */
  position: fixed; /* Fixed position to overlay everything */
  top: 0;
  left: 0; /* Start from left, no slide-in */
  width: 100%;
  height: 100%;
  background-color: var(--overlay-backdrop-color); /* Semi-transparent backdrop */
  justify-content: center; /* Center direct child (dialog-box-content) horizontally */
  align-items: center; /* Center direct child (dialog-box-content) vertically */
  z-index: var(--overlay-z-index-base); /* Ensure it's on top */
  opacity: 0;
  transition: var(--overlay-transition);
  /* Override general .modal transition if it interferes */
  transform: none !important; /* Prevent slide-in */
}

.modal.modal-dialog.active {
  display: flex; /* Show and use flex for centering */
  opacity: 1;
  transform: none !important; /* Ensure no slide-in even when active */
}

/* The actual dialog box appearance */
.modal-dialog .dialog-box-content {
  background-color: var(--background-color);
  border-radius: var(--overlay-border-radius);
  box-shadow: var(--overlay-shadow);
  width: auto;
  max-width: 400px; /* Max width of the dialog */
  display: flex;
  flex-direction: column; /* Stack header and form-container */
  overflow: hidden; /* Clip children to border-radius */
}

.modal-dialog .modal-header {
  padding: 12px 16px;
  /* display: flex, align-items: center are inherited or default */
  /* Ensure its width is not 100% of screen if it was before */
  width: 100%;
}

/* Validator Modal Pending Transaction Skeleton */

.skeleton-item {
  background-color: var(--skeleton-bg); /* Light grey for skeleton */
  border-radius: 4px; /* Optional: for rounded corners */
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    background-color: var(--skeleton-bg); /* Initial color */
  }
  50% {
    background-color: var(--skeleton-pulse-bg); /* Slightly darker or different shade for pulse effect */
  }
  100% {
    background-color: var(--skeleton-bg); /* Return to initial color */
  }
}

.amount-container {
  display: flex;
  align-items: center;
  gap: 18px; /* Add spacing between input and button */
}

/* Updated to separate the input and button */
.amount-container .form-control {
  flex: 1; /* Allows the input to take available space */
  min-width: 0; /* Important for flex item shrinkage */
  border-right: 1px solid #ccc; /* Restore right border */
  /* width: auto; /* Overrides the default form-control width: 100% */
}

/* Styles for the static USD label in toll modal */
.usd-amount {
  height: 56px; /* Match the form-control height */
  padding: 0 16px; /* Horizontal padding */
  background-color: var(--button-background);
  color: var(--button-text);
  border-radius: 12px; /* Full border radius to match form-control */
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: none;
  white-space: nowrap; /* Prevent text like "USD" from wrapping */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px
}

/* Preserve interactive styling for real toggle buttons (e.g., send form) */
.toggle-balance {
  height: 56px; /* Match the form-control height */
  padding: 0 16px; /* Horizontal padding */
  background-color: var(--button-background);
  color: var(--button-text);
  border: 1.5px solid var(--border-color);
  border-radius: 12px; /* Full border radius to match form-control */
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
  white-space: nowrap; /* Prevent text like "USD" from wrapping */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px
}
.toggle-balance:hover { background-color: var(--button-hover-background); }

/* Toll Modal Specific Styles */

.toll-display-area {
  margin-bottom: 1.5rem; /* Space below the display area, retained */
}

.toll-display-area label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.25rem;
  color: var(--primary-text-color);
  text-align: left;
}

.current-toll-value-box {
  background-color: var(--surface-accent); /* Light, distinct background */
  border: 1px solid var(--border-color); /* Subtle border */
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  color: var(--primary-text-color); /* Darker text for the value */
  text-align: center; /* Center the N/A or value */
  width: 100%; /* Take full width */
  box-sizing: border-box;
}

/* Ensure the update button in the toll modal applies full-width correctly and has some top margin */
#tollModal .btn.btn--primary {
  margin-top: 0.25rem; /* Reduced space above the button */
  padding: 0.75rem 1rem; /* Consistent padding, adjust if needed */
  box-sizing: border-box;
  border-radius: 25px; /* Rounded button to match image */
}

/* Help text or subtext for form elements */
.help-text {
  font-size: 0.8rem; /* Smaller than the main label */
  color: var(--secondary-text-color); /* Muted text color (similar to bootstrap's text-muted) */
  display: block; /* Ensures it takes its own line */
  margin-bottom: 0.5rem; /* Space before the element below it (the value box) */
  text-align: left; /* Align text to the left, assuming labels are left-aligned */
}

/* Specific adjustment for help text under the toll display label */
.toll-display-area .help-text {
  margin-top: 0.1rem; /* Fine-tune spacing if needed */
  margin-bottom: 0.35rem; /* Space before the current-toll-value-box */
}

.modal-summary {
  font-size: 0.9em;
  color: var(--neutral-600);
  margin-bottom: 15px;
  text-align: center;
}

/* Warning text styling */
.warning-text {
  color: var(--danger-color); /* Bootstrap's danger color */
  font-size: 0.8rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  min-height: 1.2em; /* Reserve space for the warning message */
  visibility: hidden; /* Hidden by default but space is reserved */
  opacity: 0;
  transition: opacity 0.2s ease;
}

.warning-text.show {
  visibility: visible;
  opacity: 1;
}

.warning-text-migrate-accounts {
  color: var(--danger-color); /* Bootstrap's danger color */
  font-size: 0.8rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  min-height: 1.2em; /* Reserve space for the warning message */
}

/* Friend Modal Styles */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
  margin-top: 30px;
  width: 95%;
  margin-left: auto;
  margin-right: auto;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-option:hover {
  background-color: var(--hover-color);
}

.radio-option input[type='radio'] {
  margin: 0;
  margin-right: 12px;
  margin-top: 2px;
}

.radio-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.radio-label {
  font-weight: 700;
  text-align: left;
  margin-bottom: 4px;
}

.radio-description {
  font-size: 0.9em;
  color: var(--text-secondary);
  text-align: left;
  padding-left: 8px;
}

.radio-option input[type='radio']:checked {
  accent-color: var(--primary-color);
}

.radio-option input[type='radio']:checked + .radio-content .radio-label {
  color: var(--primary-color);
}

/* Friend Status Color Coding */
.radio-option.status-0 {
  border-left: 6px solid #e53935; /* Red for Blocked */
  background: rgba(229, 57, 53, 0.06);
}
.radio-option.status-1 {
  border-left: 6px solid var(--text-color); /* Black/Gray for Other */
  background: rgba(51, 51, 51, 0.04);
}
.radio-option.status-2 {
  border-left: 6px solid var(--info-color); /* Blue for Acquaintance */
  background: rgba(25, 118, 210, 0.06);
}
.radio-option.status-3 {
  border-left: 6px solid var(--success-color); /* Green for Friend */
  background: rgba(67, 160, 71, 0.06);
}

#minTollDisplay {
  font-size: 0.9em;
  color: var(--neutral-600);
  margin-top: 4px;
  text-align: left;
}

#sendAssetFormModal #memoTollContainer {
  position: relative;
  top: 0;
  left: 0;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--secondary-text-color);
  font-weight: 500;
  white-space: nowrap;
  text-align: left;
  text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1);
  min-height: 1.3em; /* Add minimum height to match line-height */
  display: block; /* Ensure it's always displayed */
}

#sendAssetFormModal #tollMemo {
  font-weight: 500;
  color: var(--secondary-text-color);
  display: inline-block; /* Ensure consistent layout */
}

.last-item {
  display: block;
  width: 0;
  height: 0;
  border: none;
  background: none;
}

.last-item:focus {
  outline: none;
}


/* Add subtle spacing between emoji and text */
.menu-item:first-letter {
  margin-right: 0.5rem;
}

/* Menu item icons using SVG like footer */
.menu-item::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px;
  margin-right: 12px;
  transition: opacity 0.2s ease;
}

/* Individual icon definitions */
.menu-item[data-icon="user"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E");
}

.menu-item[data-icon="dollar-sign"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='1' x2='12' y2='23'%3E%3C/line%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'%3E%3C/path%3E%3C/svg%3E");
}

.menu-item[data-icon="download"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'%3E%3C/path%3E%3Cpolyline points='7,10 12,15 17,10'%3E%3C/polyline%3E%3Cline x1='12' y1='15' x2='12' y2='3'%3E%3C/line%3E%3C/svg%3E");
}

.menu-item[data-icon="rotate-ccw"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1,4 1,10 7,10'%3E%3C/polyline%3E%3Cpath d='M3.51,15A9,9 0 1 0 8,5'%3E%3C/path%3E%3C/svg%3E");
}

.menu-item[data-icon="shield"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'%3E%3C/path%3E%3C/svg%3E");
}

.menu-item[data-icon="mail"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'%3E%3C/path%3E%3Cpolyline points='22,6 12,13 2,6'%3E%3C/polyline%3E%3C/svg%3E");
}

.menu-item[data-icon="search"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='M21 21l-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
}

.menu-item[data-icon="globe"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='2' y1='12' x2='22' y2='12'%3E%3C/line%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'%3E%3C/path%3E%3C/svg%3E");
}

.menu-item[data-icon="trash-2"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3,6 5,6 21,6'%3E%3C/polyline%3E%3Cpath d='M19,6v14a2,2,0,0,1-2,2H7a2,2,0,0,1-2-2V6m3,0V4a2,2,0,0,1,2-2h4a2,2,0,0,1,2,2V6'%3E%3C/path%3E%3Cline x1='10' y1='11' x2='10' y2='17'%3E%3C/line%3E%3Cline x1='14' y1='11' x2='14' y2='17'%3E%3C/line%3E%3C/svg%3E");
}

.menu-item[data-icon="github"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22'%3E%3C/path%3E%3C/svg%3E");
}

.menu-item[data-icon="info"]::before {
  background-image: var(--icon-info);
}

.menu-item[data-icon="log-out"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'%3E%3C/path%3E%3Cpolyline points='16,17 21,12 16,7'%3E%3C/polyline%3E%3Cline x1='21' y1='12' x2='9' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

.menu-item[data-icon="lock"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
}
/* Calls icon for settings menu - reuse existing phone icon */
.menu-item[data-icon="call"]::before {
  background-image: var(--icon-phone);
}

.menu-item[data-icon="arrow-right-arrow-left"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 8l-4 4 4 4'%3E%3C/path%3E%3Cpath d='M17 8l4 4-4 4'%3E%3C/path%3E%3Cpath d='M3 12h18'%3E%3C/path%3E%3C/svg%3E");
}

/* migrate icon for menu item */
.menu-item[data-icon="shuffle"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='16,3 21,3 21,8'%3E%3C/polyline%3E%3Cline x1='4' y1='20' x2='21' y2='3'%3E%3C/line%3E%3Cline x1='4' y1='4' x2='9' y2='9'%3E%3C/line%3E%3Cpolyline points='21,16 21,21 16,21'%3E%3C/polyline%3E%3Cline x1='4' y1='20' x2='9' y2='15'%3E%3C/line%3E%3C/svg%3E");
}

/* launch modal icon for menu item */
.menu-item[data-icon="launch"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'%3E%3C/line%3E%3Cpolyline points='7,7 17,7 17,17'%3E%3C/polyline%3E%3C/svg%3E");
}

/* stake modal icon for menu item */
.menu-item[data-icon="trending-up"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22,7 13.5,15.5 8.5,10.5 2,17'%3E%3C/polyline%3E%3Cpolyline points='16,7 22,7 22,13'%3E%3C/polyline%3E%3C/svg%3E");
}

/* logs modal icon for menu item */
.menu-item[data-icon="file-text"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'%3E%3C/path%3E%3Cpolyline points='14,2 14,8 20,8'%3E%3C/polyline%3E%3Cline x1='16' y1='13' x2='8' y2='13'%3E%3C/line%3E%3Cline x1='16' y1='17' x2='8' y2='17'%3E%3C/line%3E%3Cpolyline points='10,9 9,9 8,9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* update icon for menu item */
.menu-item[data-icon="smartphone"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='2' width='14' height='20' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='12' y1='18' x2='12' y2='18'%3E%3C/line%3E%3C/svg%3E");
}

#lockModal p {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--text-color);
  margin-bottom: 1rem;
  line-height: 1.5;
  text-align: left;
}

#lockModal p:last-of-type {
  margin-bottom: 1.5rem;
}

/* File attachment preview */
.attachment-preview {
  padding: 0px 16px 0;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(25, 118, 210, 0.186);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 8px;
}

.attachment-icon {
  font-size: 16px;
}

.attachment-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-color);
}

.remove-attachment {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--muted-text-color);
  padding: 2px 4px;
  border-radius: 3px;
  pointer-events: auto;
}

.remove-attachment:hover {
  color: var(--danger-color);
  background: rgba(244, 67, 54, 0.1);
}

/* Context menu base styles */
.message-context-menu {
  width: 200px;
  min-width: 0;
  max-width: 200px;
  white-space: nowrap;
  position: fixed;
  background: var(--background-color);
  backdrop-filter: blur(20px);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--overlay-shadow-large);
  z-index: var(--overlay-z-index-high);
  animation: contextMenuAppear 0.2s ease-out;
}

/* Context menu option base styles */
.context-menu-option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--overlay-border-radius);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.context-menu-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.context-menu-option[data-action="delete"]:hover,
.context-menu-option[data-action="delete-for-all"]:hover {
  background: rgba(255, 59, 48, 0.2);
}

.context-menu-option[data-action="delete"] .context-menu-text,
.context-menu-option[data-action="delete-for-all"] .context-menu-text {
  color: var(--danger-color);
}

.context-menu-icon {
  width: var(--icon-size-20);
  height: var(--icon-size-20);
  display: inline-block;
  background-size: var(--icon-size-20) var(--icon-size-20);
  background-repeat: no-repeat;
  margin-right: 12px;
  vertical-align: middle;
}

.context-menu-text {
  color: var(--text-color);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Shared delete icon styling - used by both regular and failed message context menus */
.context-menu-option[data-icon="delete"] .context-menu-icon,
.failed-message-context-menu .context-menu-option[data-icon="delete"] .context-menu-icon {
  background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='currentColor' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
}

@keyframes contextMenuAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Deleted message styling */
.deleted-message {
  opacity: 0.6;
}

.deleted-content {
  font-style: italic;
  color: var(--secondary-text-color) !important;
  font-size: 0.9em;
}

/* Deleted transaction styling in history modal */
.deleted-transaction {
  opacity: 0.6;
}

.deleted-transaction .transaction-type.deleted {
  color: var(--secondary-text-color) !important;
  font-style: italic;
  display: flex;
  gap: 6px;
}

.deleted-transaction .delete-icon {
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='%23888' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2'/%3E%3Cline x1='10' y1='11' x2='10' y2='17'/%3E%3Cline x1='14' y1='11' x2='14' y2='17'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.deleted-transaction .transaction-amount {
  color: var(--secondary-text-color) !important;
  font-style: italic;
}

.deleted-transaction .transaction-address {
  color: var(--secondary-text-color) !important;
  font-style: italic;
}

.deleted-transaction .transaction-memo {
  color: var(--secondary-text-color) !important;
  font-style: italic;
}

/* Failed message context menu - inherits from base context menu */
.failed-message-context-menu {
  width: 200px;
  min-width: 0;
  max-width: 200px;
  white-space: nowrap;
  position: fixed;
  background: var(--background-color);
  backdrop-filter: blur(20px);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--overlay-shadow-large);
  z-index: var(--overlay-z-index-high);
  animation: contextMenuAppear 0.2s ease-out;
}

.failed-message-context-menu .context-menu-option[data-icon="retry"] .context-menu-icon {
  background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='currentColor' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='1 4 1 10 7 10'/%3E%3Cpath d='M3.51 15a9 9 0 1 0 2.13-9.36L1 10'/%3E%3C/svg%3E");
}
.failed-message-context-menu .context-menu-option[data-icon="info"] .context-menu-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'%3E%3C/line%3E%3C/svg%3E");
}

/* Update Warning Modal Styles */
#updateWarningModal .warning-content p {
  margin-bottom: 20px;
}

#updateWarningModal .warning-content p:first-child {
  color: var(--danger-color);
  font-weight: bold;
}

#updateWarningModal .warning-content p:last-child {
  margin-bottom: 30px;
}

/* Launch Modal specific styles */
.launch-warning {
  color: var(--danger-color);
  font-weight: bold;
  margin-bottom: 1rem;
}

.backup-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.backup-note {
  margin-bottom: 1rem;
  color: var(--text-color);
}

#stakeModal .btn {
  margin-top: 0;
  margin-bottom: 0;
}

/* ========== Voice Recording Styles ========== */

/* Voice record button */
.icon-button.voice-record-button {
  width: 32px;
  height: 48px;
  padding: 0;
  flex-shrink: 0;
  pointer-events: auto;
  opacity: 0.7;
}

.icon-button.voice-record-button::before {
  content: '';
  width: var(--icon-size-24);
  height: var(--icon-size-24);
  display: block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: var(--icon-size-24) var(--icon-size-24);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='currentColor'%3E%3Cpath d='m439.5,236c0-11.3-9.1-20.4-20.4-20.4s-20.4,9.1-20.4,20.4c0,70-64,126.9-142.7,126.9-78.7,0-142.7-56.9-142.7-126.9 0-11.3-9.1-20.4-20.4-20.4s-20.4,9.1-20.4,20.4c0,86.2 71.5,157.4 163.1,166.7v57.5h-23.6c-11.3,0-20.4,9.1-20.4,20.4 0,11.3 9.1,20.4 20.4,20.4h88c11.3,0 20.4-9.1 20.4-20.4 0-11.3-9.1-20.4-20.4-20.4h-23.6v-57.5c91.6-9.3 163.1-80.5 163.1-166.7z'/%3E%3Cpath d='m256,323.5c51,0 92.3-41.3 92.3-92.3v-127.9c0-51-41.3-92.3-92.3-92.3s-92.3,41.3-92.3,92.3v127.9c0,51 41.3,92.3 92.3,92.3zm-52.3-220.2c0-28.8 23.5-52.3 52.3-52.3s52.3,23.5 52.3,52.3v127.9c0,28.8-23.5,52.3-52.3,52.3s-52.3-23.5-52.3-52.3v-127.9z'/%3E%3C/svg%3E");
}

/* Voice recording modal */
#voiceRecordingModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-recording-content {
  background: var(--background-color);
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.voice-recording-header {
  text-align: center;
  margin-bottom: 2rem;
}

.voice-recording-header h3 {
  margin: 0;
  color: var(--primary-text-color);
  font-size: 1.5rem;
  font-weight: 600;
}

.voice-recording-body {
  text-align: center;
}

.voice-recording-visual {
  margin-bottom: 2rem;
}

.recording-indicator {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}

.microphone-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 3;
}

.microphone-icon svg {
  width: 40px;
  height: 40px;
  fill: white;
}

/* Pulse animation rings */
.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border: 3px solid var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  animation: pulse-ring 1.25s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.pulse-ring:nth-child(2) {
  animation-delay: 0.4s;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(0.33);
    opacity: 1;
  }
  80%, 100% {
    transform: translate(-50%, -50%) scale(2.4);
    opacity: 0;
  }
}

.recording-timer {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-text-color);
  font-family: 'Courier New', monospace;
}

/* Base styles for all voice recording control containers */
.voice-recording-controls,
.listening-controls,
.recorded-controls,
.initial-controls {
  display: flex;
  justify-content: center;
  min-width: 0;
  width: 100%;
  flex-wrap: wrap;
}

/* Two-button layouts (Start Recording + Cancel, Pause/Resume + Stop) */
.initial-controls,
.listening-controls {
  gap: 1rem;
}

/* Three-button layout (Cancel + Listen + Send) */
.recorded-controls {
  gap: 0.5rem; /* Smaller gap for three buttons */
}

.recorded-controls .voice-btn {
  max-width: 100px; /* Smaller max-width for three buttons */
  font-size: 0.9rem; /* Slightly smaller font for better fit */
  padding: 10px 16px; /* Slightly smaller padding */
}

.voice-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
  min-width: 0; /* Allow buttons to shrink below 100px on narrow screens */
  flex: 1; /* Allow buttons to grow/shrink equally */
  max-width: 120px; /* Base max-width for most buttons */
  text-align: center; /* Center text within the button */
  display: flex; /* Use flexbox for better centering */
  align-items: center; /* Vertical centering */
  justify-content: center; /* Horizontal centering */
  overflow: hidden; /* Prevent text from overflowing button */
  text-overflow: ellipsis; /* Show ... if text is too long */
}
.voice-btn-primary {
  background: var(--primary-color);
  color: white;
}

.voice-btn-primary:hover {
  background: var(--accent-bright-blue);
}

.voice-btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.voice-btn-secondary:hover {
  background: var(--bg-hover);
}

.voice-btn-danger {
  background: #dc3545;
  color: white;
}

.voice-btn-danger:hover {
  background: #c82333;
}

/* Voice message display in chat */
.voice-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin: 4px 0;
  min-width: 0; /* Allow shrinking */
  overflow: hidden; /* Prevent overflow */
}

/* Voice message controls container */
.voice-message-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0; /* Allow shrinking */
  width: 100%; /* Take full width of parent */
  overflow: hidden; /* Prevent overflow */
}

.voice-message-play-button {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.message.sent .voice-message-play-button {
  background: rgba(255, 255, 255, 0.18);
}

.voice-message-play-button:hover {
  background: var(--accent-bright-blue);
}

.voice-message-play-button svg {
  width: 16px;
  height: 16px;
  fill: white;
}

.call-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bg-secondary);
  margin: 4px 0;
}

.call-message-phone-button {
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.08s ease;
  flex-shrink: 0;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.call-message-phone-button:hover {
  opacity: 0.9;
  transition: all 0.2s ease;
}

.call-message-text {
  color: var(--text-color);
}

.call-message-schedule {
  font-size: 0.82rem;
  color: var(--secondary-text-color);
  margin-top: 2px;
}

/* Improve contrast for scheduled label in sent message bubbles */
.message.sent .call-message-schedule {
  color: rgba(255, 255, 255, 0.85);
}

.call-message-phone-button {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E"); 
  background-position:center; 
  background-repeat:no-repeat; 
  background-size:20px;
}

.message.sent .call-message-text {
  color: white;
}

.message.sent .call-message-phone-button {
  background-color: rgba(255,255,255,0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'%3E%3C/path%3E%3C/svg%3E");
  background-position:center;
  background-repeat:no-repeat;
  background-size:20px;
  color: white;
}

/* Utility: screen-reader only text (for accessibility) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.voice-message-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  overflow: hidden; /* Prevent content from overflowing */
  width: 100%; /* Take full available width */
  max-width: 100%; /* Don't exceed parent width */
}

/* Voice message header row - make it wrap on small screens */
.voice-message-info > div:first-child {
  flex-wrap: wrap !important; /* Override inline style */
  gap: 8px !important; /* Reduce gap when wrapping */
  min-width: 0;
  overflow: hidden;
  width: 100%;
}

.voice-message-text {
  color: var(--text-color);
  margin-bottom: 4px;
  flex: 1 1 auto; /* Allow text to grow and shrink */
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-message-info > div:first-child .voice-message-time-display {
  flex: 0 0 auto; /* Don't grow or shrink */
  margin-top: 0; /* Remove top margin when on same line */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Make duration text white on sent messages */
.message.sent .voice-message-text {
  color: white;
}

.voice-message-time-display {
  color: var(--text-color);
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
  margin-top: 4px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Make time display white on sent messages */
.message.sent .voice-message-time-display {
  color: rgba(255, 255, 255, 0.9);
}

/* Hide pulse rings when not recording */
.recording-indicator:not(.recording) .pulse-ring {
  display: none;
}

/* Call Schedule Form Styles */
.call-schedule-form-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.call-schedule-form-row:not(:first-child) {
  margin-top: 8px;
}

.call-schedule-date-input {
  flex: 1;
  width: 100%;
}

.call-schedule-time-select {
  width: 90px;
}

/* === mobile keyboard / sticky header CSS patch === */

/* === MOBILE KEYBOARD PATCH (cross-device, web-only) === */

/* Prevent sideways scroll but allow vertical */
html, body {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* Let container shrink with keyboard, no clipping sticky header */
.container {
  min-height: 100%;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  max-width: 100vw; /* clamp width, no sideways scroll */
  box-sizing: border-box;
}

/* Scrollable screens */
.app-screen,
.welcome-screen {
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px));
}

/* Keep header pinned */
.header {
  position: sticky;
  top: env(safe-area-inset-top, 0);
  z-index: 1000;
  background: var(--background-color);
}

/* Inputs leave space below header when auto-scrolled */
:focus {
  scroll-margin-top: 88px; /* adjust if header height differs */
}
