/* MoAHZ — iOS-style dark UI */
@font-face { font-family:'Inter'; src:url('fonts/inter-latin-400-normal.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Inter'; src:url('fonts/inter-latin-500-normal.woff2') format('woff2'); font-weight:500; font-display:swap; }
@font-face { font-family:'Inter'; src:url('fonts/inter-latin-600-normal.woff2') format('woff2'); font-weight:600; font-display:swap; }
@font-face { font-family:'Inter'; src:url('fonts/inter-latin-700-normal.woff2') format('woff2'); font-weight:700; font-display:swap; }

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { height:100%; }
body {
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'SF Pro Text','Segoe UI','Noto Sans Arabic',Roboto,sans-serif;
  background:#000; color:#fff; font-size:16px; line-height:1.45;
  -webkit-font-smoothing:antialiased;
}
.hidden { display:none !important; }
button { font-family:inherit; border:0; background:none; color:inherit; cursor:pointer; }
input { font-family:inherit; border:0; outline:0; background:none; color:#fff; font-size:16px; }
input::placeholder { color:#8e8e93; }

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

/* Apple emoji sprites */
.em { display:inline-block; vertical-align:-4px; width:20px; height:20px;
  background-image:url('emoji-sheet.png'); background-repeat:no-repeat; }
.em.lg { width:26px; height:26px; vertical-align:-6px; }

/* ===== Auth ===== */
#auth { align-items:center; justify-content:center; padding:24px;
  background:radial-gradient(120% 90% at 50% 0%, #14202b 0%, #000 62%); }
.auth-wrap { width:100%; max-width:340px; display:flex; flex-direction:column; align-items:stretch; }
.auth-logo { width:76px; height:76px; border-radius:22px; margin:0 auto 14px;
  background:linear-gradient(145deg,#0a84ff,#5e5ce6);
  display:flex; align-items:center; justify-content:center;
  font-size:40px; font-weight:700; color:#fff;
  box-shadow:0 10px 30px rgba(10,132,255,.35); }
.auth-title { text-align:center; font-size:32px; font-weight:700; letter-spacing:.5px; }
.auth-tag { text-align:center; color:#8e8e93; font-size:14px; margin:6px 0 26px; }
.group { background:#1c1c1e; border-radius:14px; overflow:hidden; }
.group .cell { padding:13px 16px; }
.group .cell input { width:100%; text-align:right; }
.group .cell input[dir=ltr] { text-align:left; }
.sep { height:.5px; background:rgba(255,255,255,.14); margin:0 16px; }
.btn-primary { margin-top:18px; background:#0a84ff; color:#fff; font-size:17px; font-weight:600;
  padding:14px; border-radius:14px; }
.btn-primary:active { opacity:.8; }
.auth-msg { min-height:22px; text-align:center; font-size:13.5px; margin-top:10px; color:#ff453a; }
.auth-msg.ok { color:#30d158; }
.auth-note { text-align:center; color:#636366; font-size:12.5px; margin-top:18px; line-height:1.8; }

/* ===== Nav bars ===== */
.navbar { background:rgba(22,22,23,.86); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
  border-bottom:.5px solid rgba(255,255,255,.14); padding:calc(env(safe-area-inset-top,0px) + 8px) 16px 10px; }
.nav-row { display:flex; align-items:center; justify-content:space-between; }
.nav-title-small { font-weight:700; font-size:16px; letter-spacing:.4px; color:#0a84ff; }
.nav-link { color:#0a84ff; font-size:16px; }
.large-title { font-size:30px; font-weight:700; margin:6px 0 10px; }
.search-wrap { display:flex; align-items:center; gap:6px; background:#1c1c1e; border-radius:11px; padding:8px 12px; }
.search-wrap .search-ic { opacity:.55; font-size:14px; }
.search-wrap input { flex:1; font-size:15.5px; }

/* ===== Chat list ===== */
.list-body { flex:1; overflow-y:auto; }
.cell-row { display:flex; align-items:center; gap:12px; padding:10px 16px; }
.cell-row:active { background:#1c1c1e; }
.cell-row + .cell-row { border-top:.5px solid rgba(255,255,255,.08); }
.avatar { width:52px; height:52px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  font-size:22px; font-weight:600; color:#fff; }
.avatar.sm { width:36px; height:36px; font-size:16px; }
.av0 { background:linear-gradient(145deg,#0a84ff,#5e5ce6); }
.av1 { background:linear-gradient(145deg,#30d158,#00c7be); }
.av2 { background:linear-gradient(145deg,#ff9f0a,#ff453a); }
.av3 { background:linear-gradient(145deg,#bf5af2,#ff375f); }
.av4 { background:linear-gradient(145deg,#64d2ff,#0a84ff); }
.av5 { background:linear-gradient(145deg,#ffd60a,#ff9f0a); }
.cell-info { flex:1; min-width:0; }
.cell-top { display:flex; align-items:baseline; gap:8px; }
.cell-name { font-size:16px; font-weight:600; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cell-time { color:#8e8e93; font-size:12.5px; flex:none; }
.cell-prev { color:#8e8e93; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:1px; }
.chevron { color:#48484a; font-size:18px; flex:none; }
.list-empty { text-align:center; color:#636366; font-size:14px; padding:44px 30px; line-height:2; }
.sec-label { color:#8e8e93; font-size:13px; padding:14px 16px 4px; }

/* ===== Chat ===== */
.chat-nav { display:flex; align-items:center; gap:10px; padding-top:calc(env(safe-area-inset-top,0px) + 10px); }
.back { font-size:17px; flex:none; }
.chat-peer { flex:1; display:flex; align-items:center; gap:10px; justify-content:center; }
.peer-name { font-size:15.5px; font-weight:600; }
.peer-sub { font-size:11.5px; color:#30d158; }
.nav-spacer { width:64px; flex:none; }
.msgs { flex:1; overflow-y:auto; padding:14px 12px; display:flex; flex-direction:column; gap:3px; background:#000; }
.msg { max-width:74%; padding:7px 12px; border-radius:18px; font-size:16px; position:relative; word-break:break-word; }
.msg .t { display:block; font-size:10.5px; margin-top:2px; opacity:.65; text-align:left; direction:ltr; }
.msg.in  { align-self:flex-start; background:#26262a; border-bottom-left-radius:18px; border-bottom-right-radius:5px; }
.msg.out { align-self:flex-end; background:#0a84ff; border-bottom-right-radius:18px; border-bottom-left-radius:5px; }
.msg .t { text-align:end; }
.msg img.photo { display:block; max-width:230px; max-height:300px; border-radius:14px; margin:2px 0; cursor:pointer; }
.day-sep { align-self:center; color:#8e8e93; font-size:12px; margin:10px 0 6px; background:#1c1c1e; padding:3px 12px; border-radius:10px; }

.emoji-row { display:flex; gap:4px; padding:6px 10px; background:#0d0d0d; overflow-x:auto; border-top:.5px solid rgba(255,255,255,.1); }
.badge { background:#0a84ff; color:#fff; font-size:13px; font-weight:600; min-width:21px; height:21px; border-radius:11px; display:flex; align-items:center; justify-content:center; padding:0 6px; }
.online-dot { position:absolute; bottom:1px; left:1px; width:13px; height:13px; border-radius:50%; background:#30d158; border:2.5px solid #000; }
.emoji-row .em { flex:none; cursor:pointer; }
.emoji-row::-webkit-scrollbar { display:none; }
.composer { display:flex; align-items:center; gap:9px; padding:8px 12px calc(env(safe-area-inset-bottom,0px) + 8px);
  background:#0d0d0d; }
.composer-ic { width:36px; height:36px; display:flex; align-items:center; justify-content:center; }
.composer input { flex:1; background:#1c1c1e; border-radius:19px; padding:9px 15px; font-size:16px; }
.send-btn { width:36px; height:36px; border-radius:50%; background:#0a84ff; color:#fff;
  font-size:18px; font-weight:700; display:flex; align-items:center; justify-content:center; flex:none; }
.send-btn:disabled { background:#2c2c2e; color:#636366; }

.viewer { position:fixed; inset:0; background:rgba(0,0,0,.94); display:flex; align-items:center; justify-content:center; z-index:50; }
.viewer img { max-width:96%; max-height:88%; border-radius:12px; }
