/**
 * ============================================================================
 * Azima Foundation - Master Stylesheet (style.css)
 * Features:
 *   - RTL Urdu registration portal
 *   - WhatsApp-style chat UI (professional, sticky input for PWA + browser)
 *   - 10-second countdown ring, glassmorphism, animations
 *   - Fully responsive (mobile + desktop)
 *   - Install instructions modal (PWA fallback)
 * ============================================================================
 */

/* ============================================================================
   1. CSS VARIABLES
   ============================================================================ */
:root {
  /* Brand */
  --primary-green: #0b6623;
  --primary-green-dark: #074718;
  --primary-green-light: #128c7e;
  --accent-green: #25d366;
  --accent-hover: #1eaa53;

  /* WhatsApp Chat Theme */
  --chat-header-bg: #075e54;
  --chat-bg: #efeae2;
  --chat-bg-pattern: rgba(0, 0, 0, 0.04);
  --bubble-outgoing: #dcf8c6;
  --bubble-incoming: #ffffff;
  --chat-input-bg: #f0f2f5;
  --chat-footer-bg: #f0f2f5;
  --tick-blue: #53bdeb;

  /* Neutral */
  --bg-light: #f4f7f6;
  --card-bg: #ffffff;
  --text-dark: #222222;
  --text-muted: #666666;
  --text-light: #ffffff;
  --border-color: #e0e0e0;
  --danger-color: #ea4335;
  --warning-color: #fbbc05;
  --success-color: #34a853;

  /* Fonts */
  --font-urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Segoe UI', Tahoma, sans-serif;
  --font-english: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.18);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   2. GLOBAL RESET
   ============================================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-light);
  color: var(--text-dark);
  font-family: var(--font-urdu);
  overflow-x: hidden;
  line-height: 1.8;
}

body {
  overflow-y: auto;
}

body.chat-active {
  overflow: hidden;
  height: 100dvh;
}

body.modal-open {
  overflow: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.4); }

.hidden { display: none !important; }

.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================================================
   3. REGISTRATION PORTAL (RTL URDU)
   ============================================================================ */
#registration-portal-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  direction: rtl;
}

/* Header */
.main-header {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
  color: var(--text-light);
  padding: 16px 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Content */
.content-wrapper {
  flex: 1;
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-step {
  width: 100%;
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
  text-align: center;
}

/* Owner */
.owner-image-wrapper {
  width: 120px;
  height: 120px;
  margin: 0 auto 18px auto;
}

.owner-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary-green);
  box-shadow: var(--shadow-md);
}

.welcome-card h2 {
  color: var(--primary-green-dark);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.welcome-msg {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
  line-height: 2.1;
}

/* Form */
.form-card { text-align: right; }

.form-header {
  text-align: center;
  margin-bottom: 22px;
  border-bottom: 2px dashed var(--border-color);
  padding-bottom: 14px;
}

.form-header h2 {
  color: var(--primary-green);
  font-size: 1.4rem;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-urdu);
  font-size: 1rem;
  background: #f9fbf9;
  transition: var(--transition-fast);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary-green);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(11, 102, 35, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  font-family: var(--font-urdu);
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.btn-primary { background: var(--primary-green); color: var(--text-light); }
.btn-primary:hover { background: var(--primary-green-dark); transform: translateY(-2px); }
.btn-success { background: var(--accent-green); color: var(--text-light); }
.btn-success:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-chat-primary {
  background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
  color: var(--text-light);
}
.btn-install-secondary {
  background: #ffffff;
  color: var(--primary-green-dark);
  border: 2px solid var(--primary-green);
  margin-top: 12px;
}

/* Loading */
.loading-card { padding: 40px 20px; }

.spinner-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 6px solid #e0e0e0;
  border-top: 6px solid var(--primary-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.countdown-circle {
  font-family: var(--font-english);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary-green-dark);
  z-index: 2;
}

.loading-msg { color: var(--text-muted); margin-bottom: 20px; }

.progress-bar-container {
  width: 100%;
  height: 10px;
  background: #e0e0e0;
  border-radius: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-green), var(--primary-green));
  transition: width 1s linear;
}

/* Success */
.success-icon {
  font-size: 4rem;
  color: var(--accent-green);
  margin-bottom: 12px;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.success-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-green-dark);
  margin-bottom: 10px;
}

.success-desc { color: var(--text-muted); margin-bottom: 24px; }

/* Footer */
.main-footer {
  background: #ffffff;
  text-align: center;
  padding: 14px 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}


/* ============================================================================
   4. LIVE CHAT — WHATSAPP STYLE
   ============================================================================ */

#chat-interface-wrapper {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--chat-bg);
  z-index: 1000;
  font-family: var(--font-english);
  direction: ltr;
  overflow: hidden;
}

/* ---------- Chat Header ---------- */
.chat-header {
  flex: 0 0 auto;
  height: 64px;
  background-color: var(--chat-header-bg);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.chat-back-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.15rem;
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.chat-back-btn:hover { background: rgba(255, 255, 255, 0.15); }

.chat-avatar-container {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.chat-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--chat-header-bg);
}

.status-dot.online { background-color: var(--accent-green); }

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

.chat-user-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-user-info p {
  font-size: 0.75rem;
  opacity: 0.85;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Install button (prominent, always visible in chat header) */
.btn-install-chat {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--font-english);
}

.btn-install-chat:hover {
  background: rgba(255, 255, 255, 0.28);
}

.btn-install-chat i { font-size: 0.85rem; }

.icon-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.15); }

.connection-status-badge {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--danger-color);
  transition: var(--transition-fast);
}

.connection-status-badge.online { background-color: var(--accent-green); }

/* ---------- Messages Area ---------- */
.chat-messages-area {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: var(--chat-bg);
  background-image:
    radial-gradient(var(--chat-bg-pattern) 1px, transparent 0);
  background-size: 18px 18px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Message Bubbles ---------- */
.message-card {
  display: flex;
  max-width: 80%;
  animation: messageSlide 0.22s ease-out;
}

@keyframes messageSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-card.outgoing {
  align-self: flex-end;
  justify-content: flex-end;
}

.message-card.incoming {
  align-self: flex-start;
}

.msg-bubble {
  padding: 6px 10px 4px 10px;
  border-radius: 10px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.13);
  position: relative;
  word-break: break-word;
  max-width: 100%;
  text-align: left;
}

.outgoing .msg-bubble {
  background-color: var(--bubble-outgoing);
  border-top-right-radius: 2px;
}

.incoming .msg-bubble {
  background-color: var(--bubble-incoming);
  border-top-left-radius: 2px;
}

.msg-text {
  font-size: 0.95rem;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
  text-align: left;
}

.msg-time {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  color: var(--text-muted);
  float: right;
  margin: 2px 0 0 8px;
  line-height: 1;
}

.msg-ticks {
  font-size: 0.75rem;
  color: #999;
}

.msg-ticks.read { color: var(--tick-blue); }

/* Media inside bubble */
.msg-media-img img {
  max-width: 100%;
  max-height: 250px;
  border-radius: 6px;
  margin-bottom: 4px;
  object-fit: cover;
  cursor: pointer;
  display: block;
}

.msg-media-audio audio {
  width: 220px;
  height: 36px;
  margin-bottom: 2px;
}

.msg-media-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  margin-bottom: 4px;
}

.msg-media-file i { color: var(--primary-green-dark); }

.msg-media-file a {
  color: var(--primary-green-dark);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
  word-break: break-all;
}

/* ---------- Typing Indicator ---------- */
.typing-bar {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border-color);
}

.typing-bubble {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 4px 8px;
  background: #e4e6eb;
  border-radius: 12px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #90949c;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

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

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---------- Voice Overlay ---------- */
.voice-overlay {
  flex: 0 0 auto;
  background: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

.recording-pulse {
  width: 14px;
  height: 14px;
  background-color: var(--danger-color);
  border-radius: 50%;
  animation: pulseRed 1s infinite;
  flex-shrink: 0;
}

@keyframes pulseRed {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(234, 67, 53, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(234, 67, 53, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(234, 67, 53, 0); }
}

.recording-time {
  font-weight: 700;
  color: var(--danger-color);
  font-family: var(--font-english);
  flex-shrink: 0;
}

.recording-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex: 1;
}

.btn-cancel-rec {
  background: none;
  border: none;
  color: var(--danger-color);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

/* ---------- Media Preview ---------- */
.media-preview-area {
  flex: 0 0 auto;
  background: #ffffff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.preview-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.img-preview {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.file-icon-preview {
  font-size: 1.6rem;
  color: var(--primary-green);
  flex-shrink: 0;
}

.preview-filename {
  font-size: 0.85rem;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-remove-preview {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

/* ---------- Chat Input Footer ---------- */
.chat-input-footer {
  flex: 0 0 auto;
  background-color: var(--chat-footer-bg);
  padding: 8px 10px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-color);
  position: relative;
  z-index: 5;
}

#chat-input-form {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.chat-btn-icon {
  background: none;
  border: none;
  color: #54656f;
  font-size: 1.25rem;
  padding: 8px;
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition-fast);
  flex-shrink: 0;
  line-height: 1;
}

.chat-btn-icon:hover { background: rgba(0, 0, 0, 0.08); }

.input-field-wrapper {
  flex: 1;
  background: #ffffff;
  border-radius: 20px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  min-width: 0;
}

#chat-text-input {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font-english);
  font-size: 0.95rem;
  max-height: 100px;
  min-height: 22px;
  background: transparent;
  line-height: 1.4;
  overflow-y: auto;
}

.btn-send { color: var(--chat-header-bg); }
.btn-send:hover { color: var(--accent-hover); }
.btn-send.sending-voice { color: var(--danger-color); animation: pulseRed 1s infinite; }
.btn-mic { color: #54656f; }
.btn-mic.recording { color: var(--danger-color); }


/* ============================================================================
   5. INSTALL INSTRUCTIONS MODAL (PWA fallback)
   ============================================================================ */
.install-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.install-modal-card {
  background: #ffffff;
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 28px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  position: relative;
  direction: ltr;
  font-family: var(--font-english);
  max-height: 85vh;
  overflow-y: auto;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.install-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f0f2f5;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1rem;
  color: #54656f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.install-modal-close:hover {
  background: #e4e6eb;
  color: #111b21;
}

.install-modal-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  color: #ffffff;
  font-size: 2rem;
  box-shadow: 0 8px 20px rgba(11, 102, 35, 0.3);
}

.install-modal-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #111b21;
  text-align: center;
  margin-bottom: 8px;
  font-family: var(--font-english);
}

.install-modal-card > p {
  text-align: center;
  color: #54656f;
  font-size: 0.9rem;
  margin-bottom: 22px;
  line-height: 1.6;
  font-family: var(--font-english);
}

.install-instructions {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.install-instructions li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: #f7f9fa;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: #111b21;
  line-height: 1.5;
  font-family: var(--font-english);
}

.install-instructions li .step-num {
  width: 26px;
  height: 26px;
  background: var(--primary-green);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.install-instructions li .step-text {
  flex: 1;
}

.install-instructions li .step-text strong {
  color: var(--primary-green-dark);
  font-weight: 600;
}

.install-instructions li i {
  color: var(--primary-green);
  margin-right: 4px;
}

.install-modal-action {
  width: 100%;
  padding: 14px;
  background: var(--accent-green);
  color: #111b21;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
  font-family: var(--font-english);
}

.install-modal-action:hover {
  background: var(--accent-hover);
}

.install-modal-note {
  font-size: 0.78rem;
  color: #8696a0;
  text-align: center;
  margin-top: 12px;
  font-family: var(--font-english);
  line-height: 1.5;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .install-modal-card {
    padding: 24px 18px;
    border-radius: 16px;
  }

  .install-modal-card h2 {
    font-size: 1.2rem;
  }

  .install-modal-icon {
    width: 64px;
    height: 64px;
    font-size: 1.7rem;
  }

  .install-instructions li {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}


/* ============================================================================
   6. RESPONSIVE
   ============================================================================ */
@media (max-width: 480px) {
  .card { padding: 20px 14px; }
  .logo-text { font-size: 1.1rem; }
  .message-card { max-width: 88%; }
  .msg-media-audio audio { width: 180px; }
  .chat-header { padding: 0 8px; }
  .chat-back-btn { font-size: 1rem; }
  .recording-hint { display: none; }
  .btn-install-chat span { display: none; }
  .btn-install-chat { padding: 6px 10px; }
}

/* Safe-area for iPhone notch */
@supports (padding: env(safe-area-inset-top)) {
  .chat-header {
    padding-top: env(safe-area-inset-top, 0);
    height: calc(64px + env(safe-area-inset-top, 0));
  }
}
