/* ============================================
   CEM888 — TELEGRAM WEB Z CLONE v6
   Leopard Background · Zero Borders · Mobile-First
   ============================================ */

:root{
  --bg-base:#0e0f11;
  --header-bg:rgba(33,33,33,0.92);
  --header-border:rgba(255,255,255,0.06);
  --bubble-incoming:#2a2a35;
  --bubble-outgoing:#005c4b;
  --text-primary:#ffffff;
  --text-secondary:#aaaaaa;
  --text-tertiary:#888888;
  --input-bg:rgba(42,42,42,0.92);
  --input-border:rgba(255,255,255,0.08);

  --cem-teal:#00d4c8;
  --cem-merlot:#8b1a3a;
  --cem-burnt:#e05a2b;
  --cem-gold:#d4a017;
  --cem-purple:#7b3fa0;

  --bubble-radius:16px;
  --bubble-tail:4px;
  --header-h:56px;
  --input-h:52px;
}

[data-theme="light"]{
  --bg-base:#e8ede8;
  --header-bg:rgba(255,255,255,0.92);
  --header-border:rgba(0,0,0,0.06);
  --bubble-incoming:#ffffff;
  --bubble-outgoing:#d9fdd3;
  --text-primary:#111111;
  --text-secondary:#666666;
  --text-tertiary:#999999;
  --input-bg:rgba(255,255,255,0.92);
  --input-border:rgba(0,0,0,0.08);
}

*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%;overflow:hidden;-webkit-font-smoothing:antialiased}
body{
  font-family:-apple-system,BlinkMacSystemFont,'SF Pro Display','Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg-base);
  color:var(--text-primary);
}

/* === LEOPARD SPOTS — pure CSS, mobile-safe === */
body::before{
  content:'';
  position:fixed;
  inset:0;
  z-index:0;
  background:
    radial-gradient(ellipse 28px 20px at 18% 22%, rgba(224,90,43,0.42) 0%, transparent 72%),
    radial-gradient(ellipse 22px 16px at 28% 48%, rgba(0,212,200,0.38) 0%, transparent 72%),
    radial-gradient(ellipse 30px 22px at 68% 18%, rgba(139,26,58,0.48) 0%, transparent 72%),
    radial-gradient(ellipse 24px 18px at 82% 58%, rgba(212,160,23,0.38) 0%, transparent 72%),
    radial-gradient(ellipse 28px 20px at 42% 72%, rgba(123,63,160,0.42) 0%, transparent 72%),
    radial-gradient(ellipse 22px 16px at 78% 82%, rgba(0,212,200,0.38) 0%, transparent 72%),
    radial-gradient(ellipse 30px 22px at 12% 82%, rgba(224,90,43,0.42) 0%, transparent 72%),
    radial-gradient(ellipse 24px 18px at 52% 38%, rgba(139,26,58,0.38) 0%, transparent 72%),
    radial-gradient(ellipse 28px 20px at 92% 32%, rgba(123,63,160,0.42) 0%, transparent 72%),
    radial-gradient(ellipse 22px 16px at 38% 92%, rgba(212,160,23,0.38) 0%, transparent 72%),
    radial-gradient(ellipse 28px 20px at 58% 58%, rgba(0,212,200,0.35) 0%, transparent 72%),
    radial-gradient(ellipse 22px 16px at 22% 62%, rgba(123,63,160,0.38) 0%, transparent 72%),
    radial-gradient(ellipse 30px 22px at 88% 12%, rgba(224,90,43,0.38) 0%, transparent 72%),
    radial-gradient(ellipse 24px 18px at 48% 8%, rgba(212,160,23,0.35) 0%, transparent 72%),
    radial-gradient(ellipse 28px 20px at 8% 52%, rgba(139,26,58,0.38) 0%, transparent 72%),
    var(--bg-base);
  background-size:380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,100% 100%;
  pointer-events:none;
}

[data-theme="light"] body::before{
  background:
    radial-gradient(ellipse 28px 20px at 18% 22%, rgba(224,90,43,0.50) 0%, transparent 72%),
    radial-gradient(ellipse 22px 16px at 28% 48%, rgba(0,212,200,0.45) 0%, transparent 72%),
    radial-gradient(ellipse 30px 22px at 68% 18%, rgba(139,26,58,0.55) 0%, transparent 72%),
    radial-gradient(ellipse 24px 18px at 82% 58%, rgba(212,160,23,0.45) 0%, transparent 72%),
    radial-gradient(ellipse 28px 20px at 42% 72%, rgba(123,63,160,0.50) 0%, transparent 72%),
    radial-gradient(ellipse 22px 16px at 78% 82%, rgba(0,212,200,0.45) 0%, transparent 72%),
    radial-gradient(ellipse 30px 22px at 12% 82%, rgba(224,90,43,0.50) 0%, transparent 72%),
    radial-gradient(ellipse 24px 18px at 52% 38%, rgba(139,26,58,0.45) 0%, transparent 72%),
    radial-gradient(ellipse 28px 20px at 92% 32%, rgba(123,63,160,0.50) 0%, transparent 72%),
    radial-gradient(ellipse 22px 16px at 38% 92%, rgba(212,160,23,0.45) 0%, transparent 72%),
    radial-gradient(ellipse 28px 20px at 58% 58%, rgba(0,212,200,0.40) 0%, transparent 72%),
    radial-gradient(ellipse 22px 16px at 22% 62%, rgba(123,63,160,0.45) 0%, transparent 72%),
    radial-gradient(ellipse 30px 22px at 88% 12%, rgba(224,90,43,0.45) 0%, transparent 72%),
    radial-gradient(ellipse 24px 18px at 48% 8%, rgba(212,160,23,0.40) 0%, transparent 72%),
    radial-gradient(ellipse 28px 20px at 8% 52%, rgba(139,26,58,0.45) 0%, transparent 72%),
    var(--bg-base);
  background-size:380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,380px 380px,100% 100%;
}

#app{
  display:flex;
  height:100%;
  height:100dvh;
  height:-webkit-fill-available;
  width:100vw;
  overflow:hidden;
  position:relative;
  z-index:1;
}

/* === THREAD SIDEBAR === */
.thread-sidebar{
  width:320px;
  min-width:320px;
  background:var(--header-bg);
  backdrop-filter:blur(24px) saturate(1.8);
  -webkit-backdrop-filter:blur(24px) saturate(1.8);
  border-right:1px solid var(--header-border);
  display:flex;
  flex-direction:column;
  z-index:30;
}
.thread-sidebar .header{
  height:var(--header-h);
  padding:0 16px;
  display:flex;
  align-items:center;
  border-bottom:1px solid var(--header-border);
  flex-shrink:0;
}
.thread-sidebar .header .logo-text{
  font-size:20px;
  font-weight:700;
  letter-spacing:-0.3px;
  background:linear-gradient(135deg,var(--cem-teal) 0%,var(--cem-burnt) 50%,var(--cem-merlot) 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
}
.thread-list{flex:1;overflow-y:auto;padding:8px}
.thread-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
  transition:background 0.12s;
  margin-bottom:2px;
}
.thread-item:hover{background:rgba(128,128,128,0.08)}
.thread-item.active{background:rgba(128,128,128,0.14);position:relative}
.thread-item.active::before{
  content:'';
  position:absolute;
  left:0;
  top:8px;
  bottom:8px;
  width:3px;
  border-radius:2px;
  background:linear-gradient(180deg,var(--cem-teal),var(--cem-burnt));
}
.thread-avatar{
  width:48px;
  height:48px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
  font-size:16px;
  flex-shrink:0;
  background:linear-gradient(135deg,var(--cem-teal),var(--cem-burnt));
  color:#fff;
}
.thread-info{flex:1;min-width:0}
.thread-name{font-size:15px;font-weight:600;color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thread-preview{font-size:13px;color:var(--text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.thread-meta{font-size:12px;color:var(--text-tertiary);flex-shrink:0;text-align:right}

/* === CHAT AREA === */
.chat-area{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
  position:relative;
  background:transparent;
}

/* === CHAT HEADER === */
.chat-header{
  height:var(--header-h);
  padding:0 14px;
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--header-bg);
  backdrop-filter:blur(24px) saturate(1.8);
  -webkit-backdrop-filter:blur(24px) saturate(1.8);
  border-bottom:1px solid var(--header-border);
  flex-shrink:0;
  z-index:10;
}
.back-btn{
  width:34px;
  height:34px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  border:none;
  color:var(--text-primary);
  cursor:pointer;
  font-size:18px;
}
.chat-header-avatar{
  width:38px;
  height:38px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--cem-teal),var(--cem-burnt));
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  flex-shrink:0;
}
.chat-header-info{flex:1;min-width:0}
.chat-header-name{font-size:16px;font-weight:600;color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-header-status{font-size:13px;color:var(--cem-teal);line-height:1.3}
.chat-header-status.online::before{
  content:'';
  display:inline-block;
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--cem-teal);
  margin-right:6px;
  box-shadow:0 0 6px rgba(0,212,200,0.35);
}

/* === MESSAGES — transparent, leopard shows through === */
.messages{
  flex:1;
  overflow-y:auto;
  padding:10px 0 6px;
  display:flex;
  flex-direction:column;
  gap:2px;
  background:transparent;
  scrollbar-width:thin;
  scrollbar-color:rgba(128,128,128,0.2) transparent;
}
.messages::-webkit-scrollbar{width:4px}
.messages::-webkit-scrollbar-track{background:transparent}
.messages::-webkit-scrollbar-thumb{background:rgba(128,128,128,0.2);border-radius:2px}

/* === MESSAGE GROUPS === */
.msg-group{
  display:flex;
  flex-direction:column;
  gap:2px;
  margin-bottom:2px;
  max-width:78%;
  min-width:60px;
  animation:msgPop 0.18s cubic-bezier(0.16,1,0.3,1);
}
.msg-group.me{align-self:flex-end;margin-right:10px}
.msg-group.them{align-self:flex-start;margin-left:10px}

/* === MESSAGE BUBBLES — ZERO borders, ZERO shadows === */
.msg-bubble{
  padding:8px 13px;
  font-size:16px;
  line-height:1.38;
  word-wrap:break-word;
  position:relative;
}

/* First/only bubble — rounded with tail */
.msg-group.me .msg-bubble:first-child,
.msg-group.me .msg-bubble:only-child{
  background:var(--bubble-outgoing);
  color:var(--text-primary);
  border-radius:var(--bubble-radius);
  border-bottom-right-radius:var(--bubble-tail);
}
.msg-group.them .msg-bubble:first-child,
.msg-group.them .msg-bubble:only-child{
  background:var(--bubble-incoming);
  color:var(--text-primary);
  border-radius:var(--bubble-radius);
  border-bottom-left-radius:var(--bubble-tail);
}

/* Middle bubbles — rounded both sides, no tail */
.msg-group.me .msg-bubble:not(:first-child):not(:last-child){
  background:var(--bubble-outgoing);
  color:var(--text-primary);
  border-radius:var(--bubble-radius);
  border-top-right-radius:var(--bubble-tail);
  border-bottom-right-radius:var(--bubble-tail);
}
.msg-group.them .msg-bubble:not(:first-child):not(:last-child){
  background:var(--bubble-incoming);
  color:var(--text-primary);
  border-radius:var(--bubble-radius);
  border-top-left-radius:var(--bubble-tail);
  border-bottom-left-radius:var(--bubble-tail);
}

/* Last bubble — rounded with opposite tail */
.msg-group.me .msg-bubble:last-child:not(:first-child){
  background:var(--bubble-outgoing);
  color:var(--text-primary);
  border-radius:var(--bubble-radius);
  border-top-right-radius:var(--bubble-tail);
}
.msg-group.them .msg-bubble:last-child:not(:first-child){
  background:var(--bubble-incoming);
  color:var(--text-primary);
  border-radius:var(--bubble-radius);
  border-top-left-radius:var(--bubble-tail);
}

/* Rainbow text for CEM */
.msg-group.them .rainbow-text{
  background:linear-gradient(90deg,var(--cem-teal) 0%,var(--cem-gold) 25%,var(--cem-burnt) 50%,var(--cem-merlot) 75%,var(--cem-purple) 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  font-weight:500;
}

.msg-meta{
  font-size:11px;
  color:var(--text-tertiary);
  margin-top:2px;
  padding:0 4px;
  display:flex;
  gap:4px;
  align-items:center;
  align-self:flex-end;
}
.msg-group.me .msg-meta{justify-content:flex-end}

@keyframes msgPop{
  from{opacity:0;transform:scale(0.94) translateY(5px)}
  to{opacity:1;transform:scale(1) translateY(0)}
}

/* === DATE DIVIDER === */
.date-divider{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin:18px 0;
  font-size:12px;
  color:var(--text-tertiary);
  text-transform:uppercase;
  letter-spacing:0.5px;
  font-weight:500;
}
.date-divider::before,.date-divider::after{
  content:'';
  flex:1;
  height:1px;
  background:rgba(128,128,128,0.18);
  max-width:120px;
}

/* === INPUT AREA === */
.input-area{
  padding:6px 10px 10px;
  background:var(--header-bg);
  backdrop-filter:blur(24px) saturate(1.8);
  -webkit-backdrop-filter:blur(24px) saturate(1.8);
  border-top:1px solid var(--header-border);
  flex-shrink:0;
  padding-bottom:max(8px, env(safe-area-inset-bottom));
}
.input-row{
  display:flex;
  gap:6px;
  align-items:flex-end;
}

/* Attach button — white/light like Telegram */
.attach-btn{
  width:42px;
  height:42px;
  border-radius:50%;
  border:none;
  background:rgba(255,255,255,0.12);
  color:rgba(255,255,255,0.6);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  flex-shrink:0;
  transition:all 0.12s;
}
.attach-btn:active{transform:scale(0.92)}
.attach-btn:hover{background:rgba(255,255,255,0.22);color:rgba(255,255,255,0.85)}
.attach-btn svg{width:22px;height:22px;stroke-width:2}

/* Message input */
.input-row textarea{
  flex:1;
  border:none;
  border-radius:22px;
  background:var(--input-bg);
  color:var(--text-primary);
  padding:11px 16px;
  font-size:16px;
  font-family:inherit;
  resize:none;
  outline:none;
  min-height:42px;
  max-height:120px;
  line-height:1.4;
}
.input-row textarea::placeholder{color:var(--text-tertiary)}

/* Send button — only visible when typing */
.send-btn{
  width:42px;
  height:42px;
  border-radius:50%;
  border:none;
  background:var(--cem-teal);
  color:#000;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  flex-shrink:0;
  transition:all 0.12s;
}
.send-btn:active{transform:scale(0.92)}
.send-btn.hidden{display:none}
.send-btn.spinning{background:var(--input-bg);pointer-events:none}
.send-btn.spinning::after{
  content:'';width:18px;height:18px;border:2px solid var(--cem-teal);
  border-top-color:transparent;border-radius:50%;
  animation:spin 0.8s linear infinite;
}
.send-btn svg{width:20px;height:20px}

/* Microphone button (shown when not typing) */
.mic-btn{
  width:42px;
  height:42px;
  border-radius:50%;
  border:none;
  background:rgba(255,255,255,0.12);
  color:rgba(255,255,255,0.6);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  flex-shrink:0;
  transition:all 0.12s;
}
.mic-btn:active{transform:scale(0.92)}
.mic-btn.hidden{display:none}
.mic-btn svg{width:22px;height:22px;stroke-width:2}

@keyframes spin{to{transform:rotate(360deg)}}

/* === TYPING INDICATOR === */
.typing-wrap{
  display:flex;
  flex-direction:column;
  gap:4px;
  align-self:flex-start;
  margin-bottom:8px;
  margin-left:10px;
  width:fit-content;
}
.typing{
  display:flex;
  gap:4px;
  padding:14px 18px;
  background:var(--bubble-incoming);
  border-radius:var(--bubble-radius);
  border-bottom-left-radius:var(--bubble-tail);
}
.typing span{
  width:7px;
  height:7px;
  border-radius:50%;
  animation:typingBounce 1.4s infinite;
}
.typing span:nth-child(1){background:var(--cem-teal);animation-delay:0s}
.typing span:nth-child(2){background:var(--cem-burnt);animation-delay:0.2s}
.typing span:nth-child(3){background:var(--cem-merlot);animation-delay:0.4s}
@keyframes typingBounce{
  0%,60%,100%{transform:translateY(0)}
  30%{transform:translateY(-6px)}
}

/* === CONNECTION STATUS === */
.connection-status{
  position:fixed;
  bottom:10px;
  left:50%;
  transform:translateX(-50%);
  padding:6px 14px;
  border-radius:9999px;
  background:var(--header-bg);
  backdrop-filter:blur(10px);
  font-size:12px;
  color:var(--text-tertiary);
  z-index:60;
  display:none;
  gap:6px;
  align-items:center;
}
.connection-status.show{display:flex}
.connection-status .reconnect-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--cem-burnt);
  animation:pulse 1s infinite;
}
@keyframes pulse{
  0%,100%{opacity:0.5}
  50%{opacity:1}
}

/* === AUTH SCREEN === */
#auth-screen{
  position:fixed;
  inset:0;
  z-index:100;
  background:var(--bg-base);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.auth-card{
  width:100%;
  max-width:360px;
  background:var(--header-bg);
  backdrop-filter:blur(30px);
  border:1px solid var(--header-border);
  border-radius:20px;
  padding:32px 24px;
}
.auth-logo{
  font-size:42px;
  font-weight:800;
  text-align:center;
  letter-spacing:-1px;
  background:linear-gradient(135deg,var(--cem-teal) 0%,var(--cem-burnt) 40%,var(--cem-merlot) 70%,var(--cem-purple) 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  margin-bottom:6px;
}
.auth-subtitle{
  text-align:center;
  color:var(--text-secondary);
  font-size:14px;
  margin-bottom:28px;
}

.input-field{
  width:100%;
  padding:12px 14px;
  margin-bottom:12px;
  border:1px solid var(--input-border);
  border-radius:10px;
  background:var(--input-bg);
  color:var(--text-primary);
  font-size:15px;
  font-family:inherit;
  outline:none;
  transition:border-color 0.2s;
}
.input-field:focus{border-color:rgba(0,212,200,0.5)}
.input-field::placeholder{color:var(--text-tertiary)}

.btn-primary{
  width:100%;
  padding:14px;
  border:none;
  border-radius:12px;
  background:linear-gradient(135deg,var(--cem-teal),var(--cem-burnt));
  color:#000;
  font-size:15px;
  font-weight:700;
  cursor:pointer;
  transition:filter 0.15s,transform 0.1s;
}
.btn-primary:hover{filter:brightness(1.1)}
.btn-primary:active{transform:scale(0.98)}

.tab-switch{
  display:flex;
  gap:4px;
  margin-bottom:20px;
  background:var(--input-bg);
  padding:4px;
  border-radius:10px;
  border:1px solid var(--input-border);
}
.tab-switch button{
  flex:1;
  padding:10px;
  border:none;
  border-radius:8px;
  background:transparent;
  color:var(--text-secondary);
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition:all 0.15s;
}
.tab-switch button.active{
  background:var(--bubble-incoming);
  color:var(--text-primary);
}

.auth-footer{
  text-align:center;
  margin-top:16px;
  font-size:13px;
  color:var(--text-secondary);
}
.auth-footer button{
  background:none;
  border:none;
  color:var(--cem-teal);
  cursor:pointer;
  font-size:13px;
  font-weight:500;
}
.auth-footer button:hover{text-decoration:underline}

.status-msg{
  padding:10px 12px;
  border-radius:10px;
  margin-bottom:12px;
  font-size:13px;
  font-weight:500;
  display:none;
}
.status-msg.ok{
  background:rgba(0,212,200,0.1);
  color:var(--cem-teal);
  border:1px solid rgba(0,212,200,0.2);
}
.status-msg.err{
  background:rgba(139,26,58,0.08);
  color:var(--cem-merlot);
  border:1px solid rgba(139,26,58,0.2);
}

.sidebar-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.4);
  z-index:40;
  opacity:0;
  pointer-events:none;
  transition:opacity 0.2s;
}
.sidebar-overlay.open{opacity:1;pointer-events:auto}

/* === PWA INSTALL === */
.pwa-install-banner{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:100;
  background:var(--header-bg);
  backdrop-filter:blur(20px);
  border-bottom:1px solid var(--header-border);
  padding:10px 16px;
  display:none;
}
.pwa-install-content{
  display:flex;
  align-items:center;
  gap:12px;
  max-width:600px;
  margin:0 auto;
}
.pwa-install-icon{
  width:40px;
  height:40px;
  border-radius:10px;
  background:linear-gradient(135deg,var(--cem-teal),var(--cem-burnt));
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  flex-shrink:0;
}
.pwa-install-text{flex:1;min-width:0}
.pwa-install-title{font-size:14px;font-weight:600;color:var(--text-primary)}
.pwa-install-sub{font-size:12px;color:var(--text-secondary)}
.pwa-install-btn{
  padding:8px 16px;
  border-radius:9999px;
  border:none;
  background:linear-gradient(135deg,var(--cem-teal),var(--cem-burnt));
  color:#000;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  flex-shrink:0;
}
.pwa-install-close{
  width:28px;
  height:28px;
  border-radius:50%;
  border:none;
  background:transparent;
  color:var(--text-tertiary);
  cursor:pointer;
  font-size:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.ios-install-hint{
  position:fixed;
  bottom:80px;
  left:50%;
  transform:translateX(-50%);
  background:var(--header-bg);
  backdrop-filter:blur(20px);
  border:1px solid var(--header-border);
  border-radius:16px;
  padding:16px 20px;
  z-index:100;
  box-shadow:0 8px 32px rgba(0,0,0,0.15);
  text-align:center;
  max-width:280px;
  display:none;
}
.ios-install-arrow{font-size:28px;margin-bottom:6px}
.ios-install-text{font-size:13px;color:var(--text-secondary);line-height:1.5}
.ios-install-text strong{color:var(--cem-teal)}
.ios-install-close{
  margin-top:12px;
  padding:8px 20px;
  border-radius:9999px;
  border:none;
  background:rgba(0,212,200,0.1);
  color:var(--cem-teal);
  font-size:13px;
  font-weight:600;
  cursor:pointer;
}

/* === THEME TOGGLE === */
.theme-toggle{
  width:36px;
  height:36px;
  border-radius:50%;
  border:none;
  background:transparent;
  color:var(--text-tertiary);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:18px;
  transition:background 0.2s;
}
.theme-toggle:hover{background:rgba(128,128,128,0.1)}

/* === ACTIVITY LOG === */
.activity-log{
  padding:6px 16px;
  font-size:12px;
  color:var(--text-secondary);
  background:var(--header-bg);
  backdrop-filter:blur(10px);
  display:flex;
  align-items:center;
  gap:8px;
  min-height:28px;
  border-radius:8px;
  margin:0 8px 6px;
}

/* === PULL TO REFRESH === */
.ptr-spinner{
  position:absolute;
  top:-50px;
  left:50%;
  transform:translateX(-50%);
  width:36px;
  height:36px;
  border-radius:50%;
  background:var(--header-bg);
  border:1px solid var(--header-border);
  display:flex;
  align-items:center;
  justify-content:center;
  transition:top 0.2s;
  z-index:10;
}
.ptr-spinner.visible{top:12px}
.ptr-spinner .dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--cem-teal);
  animation:pulse 0.8s infinite;
}

/* === RESPONSIVE === */
@media (min-width:768px){
  .thread-sidebar{position:relative;transform:none!important}
  .back-btn{display:none}
  .sidebar-overlay{display:none}
}
@media (max-width:767px){
  :root{--thread-w:85vw}
  .thread-sidebar{position:absolute;inset:0;z-index:50;transform:translateX(-100%)}
  .thread-sidebar.open{transform:translateX(0)}
  .chat-area{position:relative}
}

/* === SHIMMER === */
.shimmer{
  background:linear-gradient(90deg, rgba(128,128,128,0.05) 25%, rgba(128,128,128,0.1) 50%, rgba(128,128,128,0.05) 75%);
  background-size:200% 100%;
  animation:shimmer 1.5s infinite;
  border-radius:8px;
}
@keyframes shimmer{
  0%{background-position:200% 0}
  100%{background-position:-200% 0}
}
