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

:root {
  --primary: #075e54;
  --primary-dark: #054d44;
  --primary-light: #128C7E;
  --accent: #25D366;
  --bg: #ece5dd;
  --sidebar-bg: #ffffff;
  --chat-bg: #e5ddd5;
  --text: #111b21;
  --text-light: #667781;
  --msg-sent: #d9fdd3;
  --msg-received: #ffffff;
  --header-dark: #075e54;
  --danger: #e53935;
  --shadow: rgba(0,0,0,0.08);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app { height: 100%; }

.page { display: none; height: 100%; }
.page.active { display: block; }
.hidden { display: none !important; }

/* AUTH PAGE */
#auth-page {
  background: url('../bg.gif') center/cover no-repeat;
  display: none;
  align-items: center;
  justify-content: center;
}
#auth-page.active { display: flex; }

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.auth-box {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 40px 32px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.auth-footer { text-align: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid #eee; font-size: 12px; color: #999; line-height: 1.6; }
.indesign-link { color: var(--primary); text-decoration: none; font-weight: 600; transition: opacity 0.2s; }
.indesign-link:hover { opacity: 0.8; }

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo p { color: var(--text-light); font-size: 14px; margin-top: 4px; }

.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; background: #f0f2f5; border-radius: 10px; overflow: hidden; }
.auth-tab {
  flex: 1; padding: 12px; border: none; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--text-light); cursor: pointer;
  transition: 0.2s;
}
.auth-tab.active { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; }

.auth-form { display: none; }
.auth-form.active { display: block; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-light); margin-bottom: 6px; }
.form-group input, .form-group select {
  width: 100%; padding: 12px 14px; border: 2px solid #e0e0e0; border-radius: 10px;
  font-size: 14px; outline: none; transition: 0.2s; background: white;
}
.form-group input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(18,140,126,0.12); }

.auth-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white; border: none; border-radius: 10px; font-size: 16px;
  font-weight: 600; cursor: pointer; transition: 0.3s; letter-spacing: 0.3px;
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(7,94,84,0.35); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.error-msg { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; min-height: 20px; }
.success-msg { color: #2e7d32; font-size: 13px; margin-top: 10px; text-align: center; }

.id-status { font-size: 12px; margin-top: 4px; }
.id-status.available { color: #2e7d32; }
.id-status.taken { color: var(--danger); }

/* MAIN LAYOUT */
.app-layout { display: flex; height: 100%; }

/* SIDEBAR */
.sidebar {
  width: 380px; min-width: 320px; background: var(--sidebar-bg);
  display: flex; flex-direction: column; border-right: 1px solid #e0e0e0;
}

.sidebar-header {
  background: linear-gradient(135deg, var(--header-dark) 0%, var(--primary-light) 100%);
  color: white; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); position: relative; z-index: 2;
}

.current-user { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

.header-actions { display: flex; gap: 8px; }
.header-actions button {
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.5));
  background: none; border: none; color: white; font-size: 20px;
  cursor: pointer; padding: 6px 10px; border-radius: 50%; transition: 0.2s;
}
.header-actions button:hover { background: rgba(255,255,255,0.15); }
.header-actions .dl-android { color:white; font-size:20px; text-decoration:none; padding:6px 10px; border-radius:50%; display:flex; align-items:center; }
.header-actions .dl-android:hover { background:rgba(255,255,255,0.15); }
.header-actions .dl-android img { width:36px; height:36px; object-fit:contain; filter:drop-shadow(0 0 1px rgba(0,0,0,0.6)); }

.add-contact-bar { padding: 10px 12px; background: #f0f2f5; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.add-contact-bar input {
  flex: 1; padding: 10px 14px; border: none; border-radius: 10px;
  background: white; font-size: 14px; outline: none; min-width: 0; transition: box-shadow 0.2s;
}
.add-contact-bar input:focus { box-shadow: 0 0 0 3px rgba(37,211,102,0.15); }
.add-contact-btn { background: linear-gradient(135deg, var(--accent) 0%, #1ebe5d 100%); color: white; border: none; border-radius: 50%; width: 40px; height: 40px; font-size: 22px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s; box-shadow: 0 2px 6px rgba(37,211,102,0.25); }
.add-contact-btn:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(37,211,102,0.35); }
.add-status { width: 100%; font-size: 12px; min-height: 18px; padding: 2px 4px; }
.add-status.success { color: #2e7d32; }
.add-status.error { color: var(--danger); }

.contacts-list { flex: 1; overflow-y: auto; }

.contact-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  cursor: pointer; transition: 0.15s; border-bottom: 1px solid #f0f2f5;
}
.contact-item:hover { background: #f0f2f5; box-shadow: inset 3px 0 0 var(--accent); }
.contact-item.active { background: #e8f5e9; border-left: 3px solid var(--accent); padding-left: 13px; }
.contact-item .contact-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.contact-item .contact-info { flex: 1; min-width: 0; }
.contact-item .contact-name { font-weight: 500; font-size: 15px; }
.contact-item .contact-preview { font-size: 13px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-item .contact-meta { text-align: right; }
.contact-item .contact-time { font-size: 11px; color: var(--text-light); }
.contact-item .unread-badge { background: var(--accent); color: white; font-size: 11px; padding: 2px 6px; border-radius: 10px; font-weight: 600; }

.remove-contact-btn { background: none; border: none; color: #ccc; font-size: 18px; cursor: pointer; padding: 4px; border-radius: 50%; line-height: 1; }
.remove-contact-btn:hover { color: var(--danger); background: rgba(0,0,0,0.05); }

.badge { position:absolute; top:-4px; right:-4px; background:var(--danger); color:white; font-size:10px; font-weight:700; min-width:18px; height:18px; border-radius:9px; display:flex; align-items:center; justify-content:center; padding:0 4px; }
.badge.hidden { display:none; }

.request-item { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid #f0f2f5; }
.request-item:last-child { border-bottom:none; }
.request-item img { width:44px; height:44px; border-radius:50%; object-fit:cover; }
.request-info { flex:1; }
.request-info .req-name { font-weight:600; font-size:14px; }
.request-info .req-id { font-size:12px; color:var(--text-light); }
.request-actions { display:flex; gap:8px; }
.request-actions button { border:none; border-radius:8px; padding:8px 16px; font-size:13px; font-weight:600; cursor:pointer; }
.req-accept { background:linear-gradient(135deg,var(--accent) 0%,#1ebe5d 100%); color:white; box-shadow:0 2px 6px rgba(37,211,102,0.2); }
.req-accept:hover { transform:translateY(-1px); box-shadow:0 4px 12px rgba(37,211,102,0.35); }
.req-reject { background:#f0f2f5; color:var(--text); }
.req-reject:hover { background:#e0e0e0; }
.req-accept, .req-reject { transition:all 0.2s; }

/* CHAT AREA */
.chat-area { flex: 1; display: flex; flex-direction: column; background: url('../chat-bg.png') center/cover no-repeat; }

.no-chat {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fafafa 0%, #f0f2f5 100%);
}
.no-chat-content { text-align: center; padding: 40px; }
.no-chat p { color: var(--text-light); font-size: 14px; }
.no-chat .subtitle { font-size: 12px; margin-top: 16px; opacity: 0.6; }

.chat-view { display: flex; flex-direction: column; height: 100%; }

.chat-header {
  background: linear-gradient(135deg, var(--header-dark) 0%, var(--primary-light) 100%);
  color: white; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); position: relative; z-index: 2;
}
.chat-header .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; cursor: pointer; }
.chat-partner-info { flex: 1; min-width: 0; overflow: hidden; }
.chat-partner-name { font-weight: 600; font-size: 16px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-text { font-size: 12px; opacity: 0.85; display:flex; align-items:center; gap:4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-text.online { opacity:1; }
.chat-actions { display: flex; gap: 8px; }
.chat-actions button { background: none; border: none; color: white; font-size: 22px; cursor: pointer; padding: 6px; border-radius: 50%; transition: 0.2s; }
.chat-actions button:hover { background: rgba(255,255,255,0.15); }

.messages-container {
  flex: 1; overflow-y: auto; padding: 20px 60px;
}

.message {
  display: flex; margin-bottom: 8px; animation: msgIn 0.2s ease;
}
.message.sent { justify-content: flex-end; }
.message.received { justify-content: flex-start; }

.message .bubble {
  max-width: 70%; padding: 8px 14px; border-radius: 10px;
  position: relative; word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.message.sent .bubble { background: linear-gradient(135deg, var(--msg-sent) 0%, #c8f7c2 100%); border-top-right-radius: 2px; }
.message.received .bubble { background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%); border-top-left-radius: 2px; }

.message .bubble .msg-text { font-size: 14px; line-height: 1.4; }
.message .bubble audio { max-width:100%; border-radius:6px; display:block; margin-top:4px; }
.message .bubble .msg-image { max-width: 100%; max-height: 300px; border-radius: 6px; display: block; margin-top: 4px; }
.message .bubble .msg-time { font-size: 11px; color: var(--text-light); text-align: right; margin-top: 4px; display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.message.sent .bubble .msg-time { color: rgba(0,0,0,0.45); }

@keyframes msgIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.message.sent { animation: msgIn 0.25s ease; }
.message.received { animation: msgIn 0.3s ease; }

.message-input-area {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: #f0f2f5; box-shadow: 0 -1px 4px rgba(0,0,0,0.06); position:relative; z-index:2;
}
.attach-btn, .send-btn {
  background: none; border: none; font-size: 24px; cursor: pointer;
  padding: 8px; border-radius: 50%; transition: 0.2s; color: var(--text-light);
  display: flex; align-items: center; justify-content: center;
}
.attach-btn:hover, .send-btn:hover { background: rgba(0,0,0,0.05); color: var(--primary); }
.send-btn { color: white; font-size: 20px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); width: 40px; height: 40px; box-shadow: 0 2px 8px rgba(7,94,84,0.25); }
.send-btn:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(7,94,84,0.35); }
.send-btn:active { transform: scale(0.92); }

.input-wrapper { flex: 1; }
.input-wrapper input {
  width: 100%; padding: 11px 14px; border: none; border-radius: 10px;
  font-size: 14px; outline: none; background: white;
}

.recording-indicator { display:flex; align-items:center; gap:6px; padding:8px 12px; background:#ffe0e0; border-radius:8px; font-size:13px; color:var(--danger); white-space:nowrap; }
.recording-indicator.hidden { display:none; }
.rec-dot { width:10px; height:10px; background:var(--danger); border-radius:50%; animation:pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.image-preview { padding: 8px 16px; background: #f0f2f5; position: relative; }
.image-preview img { max-height: 120px; border-radius: 8px; }
.cancel-img { position: absolute; top: 6px; left: 16px; background: rgba(0,0,0,0.5); color: white; border: none; border-radius: 50%; width: 26px; height: 26px; font-size: 16px; cursor: pointer; display:flex; align-items:center; justify-content:center; padding:0; line-height:1; }

.loading, .loading-msg { text-align: center; padding: 40px; color: var(--text-light); font-size: 14px; }
.loading::after, .loading-msg::after { content: '...'; animation: dots 1.5s infinite; display: inline-block; width: 20px; text-align: left; }
@keyframes dots { 0% { content: '.'; } 33% { content: '..'; } 66% { content: '...'; } 100% { content: '.'; } }

/* CALL OVERLAY */
.call-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  animation: callFadeIn 0.3s ease;
}
.call-overlay.hidden { display: none; }

.logout-overlay { position:fixed; top:0; left:0; width:100%; height:100%; z-index:2000; background:black; display:flex; align-items:center; justify-content:center; }
.logout-overlay.hidden { display:none; }
.logout-overlay img { width:100%; height:100%; object-fit:cover; }
@keyframes callFadeIn { from { opacity:0; } to { opacity:1; } }
.call-overlay .call-container { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 20px; }
.call-overlay .call-header { text-align: center; color: white; z-index: 2; }
.call-overlay .call-user-info img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; }
.call-overlay .call-user-info h2 { font-size: 24px; margin-bottom: 4px; }
.call-overlay .call-user-info p { opacity: 0.7; font-size: 14px; }
.call-timer { font-size: 36px; font-weight: 300; margin-top: 12px; font-variant-numeric: tabular-nums; }

.call-videos { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.remote-video { width: 100%; height: 100%; object-fit: cover; }
.local-video { position: absolute; bottom: 100px; right: 20px; width: 160px; height: 120px; border-radius: 12px; object-fit: cover; border: 2px solid rgba(255,255,255,0.3); }

.call-actions { display: flex; gap: 24px; z-index: 2; margin-top: auto; padding-bottom: 40px; }
.call-btn {
  width: 60px; height: 60px; border-radius: 50%; border: none;
  font-size: 24px; cursor: pointer; transition: 0.2s;
  background: rgba(255,255,255,0.15); color: white;
}
.call-btn:hover { background: rgba(255,255,255,0.25); }
.call-btn.active { background: var(--primary-light); }
.end-call-btn { background: var(--danger); width: 72px; height: 72px; font-size: 28px; }
.end-call-btn:hover { background: #c62828; }

/* MODAL */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 500;
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }

.modal-content {
  background: white; border-radius: 16px; width: 90%; max-width: 400px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 0; }
.modal-header h2 { font-size: 20px; color: var(--primary); }
.close-modal { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--text-light); padding: 4px 8px; line-height: 1; display:flex; align-items:center; justify-content:center; }

.modal-body { padding: 20px 24px 24px; }

.profile-avatar-section { text-align: center; margin-bottom: 20px; }
.profile-avatar-section img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; }
.change-photo-btn { background: none; border: none; color: var(--primary); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 12px; border-radius: 4px; }
.change-photo-btn:hover { background: #e8f5e9; }

.save-btn { width: 100%; padding: 12px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 8px; transition: all 0.2s; }
.save-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(7,94,84,0.3); }
.save-btn:active { transform: translateY(0); }

.context-menu { position:fixed; z-index:600; background:white; border-radius:14px; box-shadow:0 8px 30px rgba(0,0,0,0.18); padding:8px; min-width:200px; animation:modalIn 0.15s ease; }
.context-menu.hidden { display:none; }
.context-reactions { display:flex; gap:4px; justify-content:center; padding:4px; }
.context-reactions button { background:none; border:none; font-size:28px; cursor:pointer; padding:6px 8px; border-radius:8px; transition:0.15s; }
.context-reactions button:hover { background:#f0f2f5; transform:scale(1.2); }
.context-divider { height:1px; background:#e0e0e0; margin:4px 0; }
.context-delete { width:100%; background:none; border:none; padding:10px 16px; font-size:14px; cursor:pointer; border-radius:8px; text-align:left; color:var(--danger); }
.context-delete:hover { background:#fce4e4; }
.context-btn { width:100%; background:none; border:none; padding:10px 16px; font-size:14px; cursor:pointer; border-radius:8px; text-align:left; color:var(--text); }
.context-btn:hover { background:#f0f2f5; }

.reactions-bar { display:flex; gap:2px; margin-top:4px; flex-wrap:wrap; }
.reaction-tag { font-size:16px; background:rgba(0,0,0,0.04); border-radius:10px; padding:2px 6px; display:inline-flex; align-items:center; gap:2px; }
.reaction-tag .r-count { font-size:11px; color:var(--text-light); font-weight:600; }
.reaction-tag.highlight { background:rgba(37,211,102,0.15); }

.contact-name-large { font-size: 20px; font-weight: 600; text-align: center; }

.forward-item { display:flex; align-items:center; gap:12px; padding:12px; border-radius:10px; cursor:pointer; transition:0.15s; }
.forward-item:hover { background:#f0f2f5; }
.forward-item img { width:40px; height:40px; border-radius:50%; object-fit:cover; }
.forward-item .f-name { font-weight:500; font-size:15px; }
.forward-item .f-id { font-size:12px; color:var(--text-light); }
.contact-id-text { text-align: center; color: var(--text-light); font-size: 14px; margin-top: 4px; }
.contact-status-text { text-align: center; font-size: 14px; margin-top: 8px; }

.lightbox-content { position:relative; display:flex; align-items:center; justify-content:center; width:90vw; height:90vh; }
.lightbox-content img { max-width:100%; max-height:100%; border-radius:8px; object-fit:contain; }
.lightbox-close { position:absolute; top:0; right:0; background:rgba(0,0,0,0.5); color:white; border:none; font-size:32px; width:48px; height:48px; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; line-height:1; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.12) transparent; }

/* CGU MODAL */
.cgu-modal-content { max-width: 600px; max-height: 85vh; }
.cgu-body h3 { font-size: 15px; color: var(--primary); margin: 16px 0 6px; }
.cgu-body p { font-size: 13px; line-height: 1.6; color: #444; margin-bottom: 10px; }
.cgu-body ul { margin: 6px 0 12px 20px; }
.cgu-body li { font-size: 13px; line-height: 1.6; color: #444; margin-bottom: 4px; list-style: disc; }

/* GIF PICKER */
.gif-modal-content { max-width: 420px; }
#gif-grid img { width:100%; border-radius:8px; cursor:pointer; transition:0.15s; }
#gif-grid img:hover { transform:scale(1.03); box-shadow:0 2px 8px rgba(0,0,0,0.15); }
#gif-grid img:active { transform:scale(0.97); }

/* BACK BUTTON (mobile) */
.back-btn { display: none; background: none; border: none; color: white; font-size: 24px; cursor: pointer; padding: 4px 8px; border-radius: 50%; }
.back-btn:hover { background: rgba(255,255,255,0.15); }

/* RESPONSIVE */
/* ANIMATIONS BOUTONS */
.auth-btn, .save-btn, .add-contact-btn, .send-btn, .attach-btn, .req-accept, .req-reject, .change-photo-btn { transition: all 0.2s ease; position:relative; overflow:hidden; }
.auth-btn:active, .save-btn:active, .add-contact-btn:active, .send-btn:active, .req-accept:active, .req-reject:active { transform: scale(0.95); }
.attach-btn:active { transform: scale(0.9); }
.contact-item { transition: background 0.15s ease, transform 0.1s ease; }
.contact-item:active { transform: scale(0.98); }
.message .bubble { transition: box-shadow 0.2s ease; }
.message .bubble:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.chat-actions button, .header-actions button, .header-actions .dl-android { transition: all 0.2s ease; }
.chat-actions button:active, .header-actions button:active, .header-actions .dl-android:active { transform: scale(0.88); }
.call-btn { transition: all 0.2s ease; }
.call-btn:active { transform: scale(0.9); }
.end-call-btn:active { transform: scale(0.92); }
.context-reactions button { transition: transform 0.15s ease, background 0.15s ease; }
.context-reactions button:active { transform: scale(0.85); }
.auth-tab { transition: all 0.2s ease; }
.auth-tab:active { transform: scale(0.96); }
.header-actions button img { width:36px; height:36px; object-fit:contain; pointer-events:none; transition: transform 0.2s ease; image-rendering:auto; filter:drop-shadow(0 0 1px rgba(0,0,0,0.6)); }
.attach-btn img, .dl-android img { width:28px; height:28px; object-fit:contain; transition: transform 0.2s ease; pointer-events:none; }
.attach-btn:hover img, .dl-android:hover img, .header-actions button:hover img { transform: scale(1.1); }

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; min-width: unset; flex: 1; }
  .sidebar.hide-mobile { display: none; }
  .chat-area { width: 100%; height: 100%; }
  .chat-area.hide-mobile { display: none; }
  .back-btn { display: block; }
  .messages-container { padding: 12px; }
  .message .bubble { max-width: 90%; }
  .local-video { width: 100px; height: 80px; bottom: 80px; }
  .auth-box { padding: 24px 16px; border-radius: 12px; }
  .contact-item { padding: 12px 12px; }
  .contact-item.active { padding-left: 9px; }
  .message-input-area { padding: 6px 8px; gap: 4px; }
  .input-wrapper input { padding: 8px 10px; font-size: 16px; }
  .modal-content { width: 95%; margin: 10px; }
  .call-container { padding: 10px; }
  .call-btn { width: 50px; height: 50px; font-size: 20px; }
  .end-call-btn { width: 60px; height: 60px; font-size: 24px; }
  .call-actions { gap: 16px; }
  .chat-header .avatar { width: 36px; height: 36px; }
  .chat-header { padding: 10px 10px; gap: 8px; }
  .chat-actions { gap: 2px; }
  .chat-actions button { padding: 4px; }
  .chat-actions button img { width: 26px; height: 26px; }
  .forward-item { padding: 14px; }
  .modal-body { padding: 16px; }
  .lightbox-content { width: 96vw; height: 96vh; }
  .lightbox-close { width: 44px; height: 44px; font-size: 28px; top: 8px; right: 8px; }
  .sidebar-header { padding: 10px 10px; }
  .header-actions button { padding: 4px 6px; }
  .header-actions button img { width: 28px; height: 28px; }
  .current-user .avatar { width: 34px; height: 34px; }
  .add-contact-bar { padding: 8px 10px; }
  .no-chat-content { padding: 20px; }
  .context-btn, .context-delete { padding: 12px 16px; }
}
