/* =========================================================================
   ClearChats Web — Complete Desktop Styles
   Dark navy theme · 3-4 panel architecture · Screenshot-accurate
   ========================================================================= */

/* ── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  --cc-bg:           #01050D;
  --cc-surface:      #030A1B;
  --cc-surface-2:    #0B111D;
  --cc-surface-3:    #0f1520;
  --cc-surface-4:    #141c2a;
  --cc-divider:      #0C1625;
  --cc-border:       #111827;
  --cc-text:         #F1F3F6;
  --cc-text-2:       #6B7280;
  --cc-text-3:       #747D8D;
  --cc-accent:       #0DA2E7;
  --cc-accent-soft:  rgba(13,162,231,0.13);
  --cc-accent-hover: #3cb8f0;
  --cc-online:       #23D36B;
  --cc-incoming:     #0f1520;
  --cc-outgoing:     #0DA2E7;
  --cc-danger:       #EF4444;
  --cc-warn:         #F59E0B;
  --cc-radius:       12px;
  --cc-anim-speed:   0.15s; /* overridden to 0s by power-saving mode */
  --cc-nav-width:        76px;
  --cc-chatlist-width:  320px;
  --cc-info-width:      360px;
  --cc-settings-menu-width: 320px;
}

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%; width: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--cc-bg);
  color: var(--cc-text);
  font-size: 15px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cc-accent); text-decoration: none; }
a:hover { color: var(--cc-accent-hover); }

/* Scrollbars */
::-webkit-scrollbar            { width: 4px; height: 4px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: #1a2535; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover{ background: #263347; }

/* =========================================================================
   APP SHELL
   ========================================================================= */
.cc-app {
  display: flex;
  height: 100vh;
  width:  100vw;
  overflow: hidden;
  background: var(--cc-bg);
}

/* =========================================================================
   LEFT NAVIGATION SIDEBAR  (76px)
   ========================================================================= */
.cc-nav {
  width: var(--cc-nav-width);
  min-width: var(--cc-nav-width);
  background: var(--cc-surface);
  border-right: 1px solid var(--cc-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  z-index: 20;
  flex-shrink: 0;
  overflow: hidden;
}

.cc-nav-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform .15s;
}
.cc-nav-logo img   { width: 45px; height: 45px; object-fit: contain; }

.cc-nav-item {
  width: 56px;
  height: 56px;
  line-height: 56px;
  padding: 9px;
  margin: 5px 0px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--cc-text-2);
  cursor: pointer;
  transition: background var(--cc-anim-speed), color .14s;
  border: none;
  background: transparent;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .2px;
  position: relative;
}
.cc-nav-item i    { font-size: 20px; line-height: 1; }
.cc-nav-item span { font-size: 10px; line-height: 1.2; color:#BEBEBE; }
.cc-nav-item.active {color: #fff;background: #9A9C9D66;border-radius: 50%;}

/* Nav avatar */
.cc-nav-item .cc-avatar { width: 26px; height: 26px; font-size: 10px; }

.cc-nav-spacer { flex: 1; }

/* =========================================================================
   MAIN AREA  (everything right of nav)
   ========================================================================= */
.cc-main-area {
  flex: 1;
  display: flex;
  min-width: 0;
  overflow: hidden;
}

/* ── hidden utility ── */
.hidden { display: none !important; }

/* =========================================================================
   CHAT SECTION  (chatlist + chat + optional info panel)
   ========================================================================= */
.cc-chat-section {
  flex: 1;
  display: flex;
  min-width: 0;
  overflow: hidden;
}

/* =========================================================================
   CHAT LIST PANEL  (320px)
   ========================================================================= */
.cc-chatlist {
  width: var(--cc-chatlist-width);
  min-width: 240px;
  max-width: var(--cc-chatlist-width);
  background: var(--cc-surface-2);
  border-right: 1px solid var(--cc-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

/* Header row: title + search + new-chat button */
.cc-chatlist-header {
  padding: 14px 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cc-chatlist-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--cc-text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Search box */
.cc-search-box {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 34px;
  background: var(--cc-surface-3);
  border-radius: 18px;
  padding: 0 10px;
  gap: 6px;
  border: 1px solid transparent;
  transition: border .15s;
}
.cc-search-box:focus-within { border-color: rgba(13,162,231,.45); }
.cc-search-box i             { color: var(--cc-text-3); font-size: 13px; flex-shrink: 0; }
.cc-search-box input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--cc-text); font-size: 13px;
}
.cc-search-box input::placeholder { color: var(--cc-text-3); }

/* New-chat / edit icon button */
.cc-edit-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--cc-accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background var(--cc-anim-speed), transform .1s;
}
.cc-edit-icon:hover   { background: var(--cc-accent-hover); }
.cc-edit-icon:active  { transform: scale(.93); }
.cc-edit-icon img     { width: 17px; height: 17px; display: block; filter: brightness(10); }

/* Filter chips */
.cc-filters {
  display: flex;
  gap: 5px;
  padding: 6px 12px 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  flex-shrink: 0;
}
.cc-filters::-webkit-scrollbar { height: 0; }

.cc-filter-chip {
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--cc-surface-3);
  color: var(--cc-text-3);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--cc-anim-speed), color .14s, border-color .14s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}
.cc-filter-chip:hover  { color: var(--cc-text); background: rgba(255,255,255,.07); }
.cc-filter-chip.active { background: var(--cc-accent); color: #fff; border-color: transparent; }
.cc-chip-count {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255,255,255,.22);
  border-radius: 8px;
  padding: 0 5px;
  min-width: 16px;
  text-align: center;
  line-height: 16px;
}
.cc-filter-chip.active .cc-chip-count { background: rgba(255,255,255,.3); }

/* Chat list body */
.cc-chatlist-body {
  flex: 1;
  overflow-y: auto;
  padding: 2px 0 20px;
}

/* ── Chat row ── */
.cc-chat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background var(--cc-anim-speed);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  color: inherit;
  position: relative;
}
.cc-chat-row:hover  { background: rgba(255,255,255,.03); }
.cc-chat-row.active { background: var(--cc-accent-soft); }
.cc-chat-row.active .cc-chat-name { color: var(--cc-accent); }

/* Avatar wrap */
.cc-avatar-wrap { position: relative; flex-shrink: 0; }

/* Avatars */
.cc-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--cc-surface-3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff;
  overflow: hidden; flex-shrink: 0;
}
.cc-avatar img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.cc-avatar .cc-avatar-initials {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.cc-avatar-sm { width: 34px; height: 34px; font-size: 12px; }
.cc-avatar-lg { width: 72px; height: 72px; font-size: 26px; }
.cc-avatar-xl { width: 88px; height: 88px; font-size: 32px; }

/* Online indicator */
.cc-online-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--cc-online);
  border: 2px solid var(--cc-surface-2);
}

/* Group/channel badge */
.cc-group-badge {
  position: absolute; bottom: -1px; right: -3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #21C45D;
  color: #fff; font-size: 9px;
  display: flex; align-items: center; justify-content: center;
}

/* Row text block */
.cc-chat-row-main  { flex: 1; min-width: 0; }
.cc-chat-row-top   { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cc-chat-name      {
  font-size: 14.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.cc-chat-time      { font-size: 11px; color: var(--cc-text-3); white-space: nowrap; flex-shrink: 0; }
.cc-chat-row-bottom{ display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; }
.cc-chat-preview   {
  font-size: 12.5px; color: #ffffff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 3px;
}

/* Unread badge */
.cc-chat-unread {
  min-width: 19px; height: 19px;
  border-radius: 10px;
  background: var(--cc-accent);
  color: #fff; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px; flex-shrink: 0;
}
.cc-chat-unread.muted { background: var(--cc-surface-4); color: var(--cc-text-3); }

/* Icon helpers in rows */
.cc-muted-icon    { color: var(--cc-text-3); font-size: 12px; }
.cc-pin-icon      { color: var(--cc-text-3); font-size: 11px; margin-right: 2px; }
.cc-verified-icon { color: var(--cc-accent); font-size: 12px; margin-left: 3px; }
.cc-row-tick      { font-size: 12px; color: var(--cc-text-3); margin-right: 2px; }
.cc-row-tick.blue { color: #5dbfee; }

/* ClearChats brand SVG icon helper (assets/img/Icons/*.svg) */
.cc-ico {
  width: 16px; height: 16px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.cc-nav-item .cc-ico { width: 20px; height: 20px; }
.cc-nav-item.active .cc-ico {
  filter: brightness(0) invert(47%) sepia(93%) saturate(3483%) hue-rotate(173deg) brightness(98%) contrast(93%);
}
.cc-search-box .cc-ico { width: 13px; height: 13px; }
.cc-header-action .cc-ico { width: 17px; height: 17px; }
.cc-group-badge .cc-ico { width: 10px; height: 10px; filter: brightness(0) invert(1); }
.cc-muted-icon.cc-ico { width: 12px; height: 12px; opacity: .85; }
.cc-list-empty .cc-ico { width: 34px; height: 34px; opacity: .4; display: block; margin: 0 auto 10px; }
.cc-menu-item .cc-ico { width: 18px; height: 18px; }
.cc-menu-item.danger .cc-ico { filter: brightness(0) invert(26%) sepia(89%) saturate(3796%) hue-rotate(347deg) brightness(99%) contrast(96%); }
.cc-info-stat-icon .cc-ico { width: 17px; height: 17px; }
.cc-idr-icon .cc-ico { width: 15px; height: 15px; }
.cc-info-danger-row .cc-ico { width: 15px; height: 15px; filter: brightness(0) invert(26%) sepia(89%) saturate(3796%) hue-rotate(347deg) brightness(99%) contrast(96%); }
.cc-avatar-edit-btn .cc-ico { width: 12px; height: 12px; }
.cc-settings-edit-btn .cc-ico { width: 14px; height: 14px; }
.cc-settings-nav-icon .cc-ico { width: 17px; height: 17px; }
.cc-settings-placeholder .cc-ico { width: 40px; height: 40px; opacity: .25; }
.cc-stub-section .cc-ico { width: 48px; height: 48px; opacity: .25; }

/* Empty / loading states */
.cc-list-empty   { padding: 50px 20px; text-align: center; color: var(--cc-text-3); font-size: 13.5px; line-height: 1.7; }
.cc-list-loading { padding: 40px; text-align: center; color: var(--cc-text-3); }

/* =========================================================================
   CHAT VIEW  (flex: 1)
   ========================================================================= */
.cc-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--cc-bg);
  overflow: hidden;
  position: relative;
}

/* Placeholder (no chat selected) */
.cc-chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--cc-text-3);
  padding: 40px;
  text-align: center;
}
.cc-chat-placeholder .cc-logo-big {
  width: 80px; height: 80px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0DA2E7, #0a7fc4);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800; color: #fff;
}

/* ── Chat header ── */
.cc-chat-header {
  height: 58px; min-height: 58px;
  background: var(--cc-surface-2);
  border-bottom: 1px solid var(--cc-border);
  display: flex; align-items: center;
  padding: 0 10px; gap: 8px;
  flex-shrink: 0;
  z-index: 5;
}
.cc-chat-header-info {
  flex: 1; min-width: 0; cursor: pointer;
}
.cc-chat-header-name {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 5px;
}
.cc-chat-header-sub {
  font-size: 12px; color: var(--cc-text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.cc-header-action {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none; background: transparent;
  color: var(--cc-text-2); font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--cc-anim-speed), color .14s;
  flex-shrink: 0;
}
.cc-header-action:hover { background: rgba(255,255,255,.06); color: var(--cc-text); }
.cc-header-action.cc-back { display: none; }

/* ── Messages area ── */
.cc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 5% 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Message row */
.cc-msg {
  display: flex;
  max-width: 70%;
  margin: 1px 0;
}
.cc-msg.out { align-self: flex-end; }
.cc-msg.in  { align-self: flex-start; }

/* Bubble */
.cc-bubble {
  border-radius: 24px;
  padding: 10px;
  margin-bottom: 10px;
  position: relative;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  word-break: break-word;
  min-width: 50px;
  max-width: 100%;
}
.cc-msg.out .cc-bubble {
  background: var(--cc-outgoing);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.cc-msg.in .cc-bubble {
  background: var(--cc-incoming);
  color: var(--cc-text);
}
.cc-msg-failed .cc-bubble { opacity: .7; }

/* Group sender name in bubble */
.cc-bubble .cc-sender-name {
  font-size: 12px; font-weight: 700;
  margin-bottom: 2px; display: block;
}

/* Message meta (time + tick) */
.cc-msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  float: right;
  margin-left: 10px;
  margin-bottom: -2px;
  margin-top: 2px;
  font-size: 10px;
  opacity: .85;
}
.cc-msg.out .cc-msg-meta { color: rgba(255,255,255,.8); }
.cc-msg.in  .cc-msg-meta { color: var(--cc-text-3); }
.cc-msg-tick       { font-size: 13px; }
.cc-msg-tick.blue  { color: #a8dff5; }

/* Links inside bubbles */
.cc-bubble .msg-link { color: #a8dff5; text-decoration: underline; }
.cc-msg.in .cc-bubble .msg-link { color: var(--cc-accent-hover); }

/* Date separator */
.cc-date-sep {
  align-self: center;
  background: var(--cc-surface-3);
  color: var(--cc-text-3);
  font-size: 11.5px;
  padding: 3px 12px;
  border-radius: 12px;
  margin: 10px 0;
  user-select: none;
}

/* System event message */
.cc-system-msg {
  align-self: center;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.5);
  font-size: 12px;
  font-style: italic;
  padding: 4px 14px;
  border-radius: 12px;
  margin: 5px 0;
}

/* Reply quote inside bubble */
.cc-reply-quote {
  border-left: 3px solid rgba(255,255,255,.5);
  padding: 3px 8px;
  margin-bottom: 5px;
  border-radius: 0 6px 6px 0;
  background: rgba(0,0,0,.15);
  cursor: pointer;
  overflow: hidden;
}
.cc-msg.in .cc-reply-quote { border-left-color: var(--cc-accent); background: rgba(255,255,255,.05); }
.cc-reply-quote .cc-rq-name { font-size: 11.5px; font-weight: 700; color: var(--cc-accent); display: block; }
.cc-msg.out .cc-reply-quote .cc-rq-name { color: #fff; }
.cc-reply-quote .cc-rq-text {
  font-size: 12px; opacity: .8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px;
}

/* Media */
.cc-media {
  border-radius: 12px; overflow: hidden;
  max-width: 280px; cursor: pointer; display: block;
  margin-bottom: 4px;
}
.cc-media img, .cc-media video { max-width: 280px; max-height: 260px; display: block; }
.cc-bubble .cc-media { margin: -3px -5px 5px; border-radius: 14px 14px 0 0; }
.cc-msg.out .cc-bubble .cc-media { border-radius: 14px 5px 0 14px; }
.cc-msg.in  .cc-bubble .cc-media { border-radius: 5px 14px 0 14px; }

/* Document card */
.cc-doc-card {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 2px; color: inherit;
}
.cc-doc-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.cc-doc-name { font-size: 12.5px; font-weight: 600; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cc-doc-size { font-size: 11px; opacity: .7; }

/* Link preview card */
.cc-link-card {
  border-radius: 10px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden; margin: 4px 0; max-width: 260px; cursor: pointer;
}
.cc-link-card img { width: 100%; max-height: 120px; object-fit: cover; display: block; }
.cc-link-card .cc-lc-body    { padding: 6px 8px; }
.cc-link-card .cc-lc-title   { font-size: 12.5px; font-weight: 600; }
.cc-link-card .cc-lc-desc    { font-size: 11px; opacity: .75; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.cc-link-card .cc-lc-url     { font-size: 10px; opacity: .5; margin-top: 2px; }

/* Reactions */
.cc-reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.cc-reaction-pill {
  background: var(--cc-surface-3);
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
  transition: background var(--cc-anim-speed);
}
.cc-reaction-pill:hover { background: var(--cc-surface-4); }
.cc-msg.out .cc-reaction-pill { background: rgba(0,0,0,.25); border-color: rgba(255,255,255,.18); }
.cc-reaction-pill.mine { border-color: var(--cc-accent); }
.cc-reaction-pill .cc-r-count { font-size: 10.5px; opacity: .75; }

/* ── Reply preview bar (above composer) ── */
.cc-reply-preview {
  background: var(--cc-surface-3);
  border-left: 3px solid var(--cc-accent);
  padding: 7px 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; flex-shrink: 0;
}
.cc-reply-preview .cc-rp-name  { color: var(--cc-accent); font-weight: 600; display: block; font-size: 12px; }
.cc-reply-preview .cc-rp-text  { color: var(--cc-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-reply-preview button        { background: none; border: none; color: var(--cc-text-3); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; }
.cc-reply-preview button:hover  { background: rgba(255,255,255,.07); color: var(--cc-text); }

/* ── Blocked banner ── */
.cc-blocked-banner {
  background: rgba(245,158,11,.1);
  color: #fcd34d;
  font-size: 13px;
  padding: 9px 16px;
  text-align: center;
  border-top: 1px solid rgba(245,158,11,.2);
  flex-shrink: 0;
}

/* ── Composer ── */
.cc-composer {
  background: var(--cc-surface-2);
  border-top: 1px solid var(--cc-border);
  padding: 8px 10px;
  display: flex; align-items: flex-end; gap: 6px;
  flex-shrink: 0; position: relative;
}
.cc-composer-btn {
  width: 38px; height: 38px;
  border-radius: 50%; border: none;
  background: transparent; color: var(--cc-text-2);
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background var(--cc-anim-speed), color .14s;
}
.cc-composer-btn:hover { background: rgba(255,255,255,.05); color: var(--cc-text); }
.cc-composer-input-wrap {
  flex: 1;
  background: var(--cc-surface-3);
  border-radius: 22px;
  padding: 7px 14px;
  border: 1px solid transparent;
  transition: border .15s;
  display: flex; align-items: center; gap: 5px;
  min-height: 38px;
}
.cc-composer-input-wrap:focus-within { border-color: rgba(13,162,231,.45); }
.cc-composer-input-wrap textarea {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--cc-text); font-size: 14px; resize: none;
  max-height: 120px; font-family: inherit; padding: 1px 0;
  line-height: 1.45;
}
.cc-composer-input-wrap textarea::placeholder { color: var(--cc-text-3); }

/* Typing banner inside input wrap */
.cc-typing-banner {
  font-size: 11.5px; color: #4FC3F7; font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; flex-shrink: 0;
}

/* Send button */
.cc-send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--cc-accent); border: none;
  color: #fff; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: transform .1s, background .14s;
}
.cc-send-btn:hover  { background: var(--cc-accent-hover); }
.cc-send-btn:active { transform: scale(.92); }
.cc-send-btn:disabled { opacity: .45; cursor: default; }

/* ── Emoji picker ── */
.cc-emoji-picker {
  position: absolute;
  bottom: 60px; left: 10px;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  width: 320px; max-height: 280px;
  overflow-y: auto; padding: 8px;
  z-index: 1100;
  box-shadow: 0 12px 44px rgba(0,0,0,.6);
}
.cc-emoji-grid { display: grid; grid-template-columns: repeat(8,1fr); gap: 2px; }
.cc-emoji-cell {
  font-size: 20px; padding: 4px;
  border: none; background: none; cursor: pointer;
  border-radius: 6px; text-align: center;
}
.cc-emoji-cell:hover { background: rgba(255,255,255,.07); }
.cc-emoji-cell .cc-emoji-img { width: 30px; height: 30px; object-fit: contain; margin: 0 auto; }
.cc-emoji-fall { font-style: normal; }

/* Large animated emoji message (App parity: single-emoji messages render
   without a bubble background, as a big animated WebP). */
.cc-bubble-emoji {
  background: none !important;
  box-shadow: none;
  padding: 6px 8px 2px;
  border-bottom-right-radius: 18px !important;
  border-bottom-left-radius: 18px !important;
}
.cc-bubble-emoji .cc-emoji-solo { display: flex; }
.cc-bubble-emoji img.cc-emoji-lg { width: 88px; height: 88px; object-fit: contain; display: block; }
.cc-bubble-emoji .cc-emoji-lg-char { font-size: 84px; line-height: 1.05; display: block; }
.cc-reaction-pill .cc-emoji-img { width: 17px; height: 17px; object-fit: contain; vertical-align: -3px; }
.cc-emoji-inline { width: 20px; height: 20px; object-fit: contain; vertical-align: -4px; }
.cc-rq-text .cc-emoji-inline { width: 15px; height: 15px; vertical-align: -2px; }
.cc-reply-preview .cc-emoji-inline { width: 15px; height: 15px; vertical-align: -2px; }
.cc-mb-emoji-item .cc-emoji-img { width: 26px; height: 26px; object-fit: contain; pointer-events: none; }

/* =========================================================================
   RIGHT INFO PANEL  (300px, slides in from right)
   ========================================================================= */
.cc-info-panel {
  width: var(--cc-info-width);
  min-width: var(--cc-info-width);
  background: var(--cc-surface-2);
  border-left: 1px solid var(--cc-border);
  display: flex; flex-direction: column;
  overflow-y: auto; flex-shrink: 0;
  animation: cc-panel-slide-in .2s ease;
}
@keyframes cc-panel-slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Info header */
.cc-info-header {
  display: flex; align-items: center;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--cc-border);
  flex-shrink: 0; gap: 8px;
}
.cc-info-header-title { font-size: 16px; font-weight: 700; flex: 1; }
.cc-info-close-btn {
  width: 30px; height: 30px;
  border-radius: 50%; border: none;
  background: transparent; color: var(--cc-text-2);
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--cc-anim-speed);
}
.cc-info-close-btn:hover { background: rgba(255,255,255,.07); color: var(--cc-text); }

/* Info profile section */
.cc-info-profile {
  display: flex; flex-direction: column; align-items: center;
  padding: 22px 14px 16px; text-align: center;
  border-bottom: 1px solid var(--cc-border);
}
.cc-info-profile .cc-avatar { width: 78px; height: 78px; font-size: 28px; margin-bottom: 11px; }
.cc-info-profile-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.cc-info-profile-sub  { font-size: 12.5px; color: var(--cc-text-3); line-height: 1.5; display:none; }

/* Stats row */
.cc-info-stats {
  display: grid; grid-template-columns: repeat(4,1fr);
  padding: 12px 8px; border-bottom: 1px solid var(--cc-border);
}
.cc-info-stat-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; padding: 6px 2px;
  background: rgba(255,255,255,.04); 
  border-radius: 18px; margin:0px 5px;transition: background var(--cc-anim-speed);
}
.cc-info-stat-item:hover { background: rgba(255,255,255,.04); }
.cc-info-stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--cc-text-2);
}
.cc-info-stat-count { font-size: 13px; font-weight: 700; color: var(--cc-text); }
.cc-info-stat-label { font-size: 10px; color: var(--cc-text-3); }

/* Detail rows */
.cc-info-detail-section { padding: 4px 0; border-bottom: 1px solid var(--cc-border); }
.cc-info-detail-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px; cursor: pointer;
  transition: background var(--cc-anim-speed);
}
.cc-info-detail-row:hover { background: rgba(255,255,255,.03); }
.cc-idr-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--cc-surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--cc-text-2); flex-shrink: 0;
}
.cc-idr-text { flex: 1; min-width: 0; }
.cc-idr-label { font-size: 13.5px; color: var(--cc-text); }
.cc-idr-sub   { font-size: 11.5px; color: var(--cc-text-3); margin-top: 1px; }
.cc-idr-arrow { color: var(--cc-text-3); font-size: 12px; }

/* Danger row */
.cc-info-danger-row {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; cursor: pointer;
  color: var(--cc-danger); transition: background var(--cc-anim-speed);
}
.cc-info-danger-row:hover { background: rgba(239,68,68,.07); }
.cc-info-danger-row i    { font-size: 15px; }
.cc-info-danger-row span { font-size: 13.5px; font-weight: 500; }

/* =========================================================================
   SETTINGS SECTION  (2-column)
   ========================================================================= */
.cc-settings-section {
  flex: 1; display: flex; min-width: 0; overflow: hidden;
}

/* Settings left menu */
.cc-settings-menu {
  width: var(--cc-settings-menu-width);
  min-width: var(--cc-settings-menu-width);
  background: var(--cc-surface-2);
  border-right: 1px solid var(--cc-border);
  display: flex; flex-direction: column;
  overflow-y: auto; flex-shrink: 0;
}
.cc-settings-menu-header { padding: 16px 16px 12px; border-bottom: 1px solid var(--cc-border); flex-shrink: 0; }
.cc-settings-menu-title  { font-size: 20px; font-weight: 700; margin-bottom: 14px; }
.cc-settings-header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.cc-settings-header-row .cc-settings-menu-title { margin-bottom: 0; }
.cc-settings-header-pills { display: flex; align-items: center; gap: 6px; }
.cc-settings-add-story-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--cc-accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer; flex-shrink: 0;
  transition: background var(--cc-anim-speed);
}
.cc-settings-add-story-btn:hover { background: var(--cc-accent-hover); }
.cc-settings-edit-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  border: none; background: var(--cc-accent-soft); color: var(--cc-accent);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background var(--cc-anim-speed);
}
.cc-settings-edit-pill:hover { background: rgba(13, 162, 231, 0.25); }
.cc-settings-edit-pill i { font-size: 14px; }

/* Profile card */
.cc-settings-profile-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 0 16px; text-align: center;
}
.cc-settings-profile-avatar {
  position: relative; width: 80px; height: 80px; margin-bottom: 10px;
}
.cc-settings-profile-avatar .cc-avatar { width: 80px; height: 80px; font-size: 30px; }
.cc-avatar-edit-btn {
  position: absolute; bottom: 0; right: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--cc-accent); color: #fff;
  border: 2px solid var(--cc-surface-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 11px;
  transition: background var(--cc-anim-speed);
}
.cc-avatar-edit-btn:hover { background: var(--cc-accent-hover); }

.cc-settings-profile-name     { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.cc-settings-profile-username { font-size: 14px; color: var(--cc-text-3); margin-bottom: 2px; }
.cc-settings-profile-phone    { font-size: 14px; color: var(--cc-accent); margin-bottom: 2px; }
.cc-settings-profile-bio      { font-size: 14px; color: var(--cc-text-3); max-width: 220px; line-height: 1.4; }

.cc-settings-edit-btn {
  display: none; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 20px;
  border: 1px solid var(--cc-accent);
  background: transparent; color: var(--cc-accent);
  font-size: 13px; font-weight: 600; cursor: pointer;
  margin-top: 10px; transition: background var(--cc-anim-speed);
}
.cc-settings-edit-btn:hover { background: var(--cc-accent-soft); }

/* Settings nav list */
.cc-settings-nav-list { padding: 6px 0 16px; }
.cc-settings-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; cursor: pointer;
  transition: background var(--cc-anim-speed);
  border: none; background: transparent;
  width: 100%; text-align: left; color: var(--cc-text);
}
.cc-settings-nav-item:hover  { background: rgba(255,255,255,.04); }
.cc-settings-nav-item.active { background: var(--cc-accent-soft); }
.cc-settings-logout { margin-top: 8px; border-top: 1px solid var(--cc-border); }
.cc-settings-nav-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: #0DA2E7;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.cc-settings-nav-text  { flex: 1; min-width: 0; }
.cc-settings-nav-label { font-size: 14px; font-weight: 500; }
.cc-settings-nav-sub   { font-size: 11.5px; color: var(--cc-text-3); margin-top: 1px; }
.cc-settings-nav-arrow { color: var(--cc-text-3); font-size: 12px; }

/* Settings right content */
.cc-settings-content {
  flex: 1; background: var(--cc-bg);
  overflow-y: auto; display: flex; flex-direction: column; min-width: 0;
}
.cc-settings-content-inner { padding: 28px 30px; max-width: 620px; width: 100%; }
.cc-settings-content-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.cc-settings-placeholder {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: var(--cc-text-3); font-size: 14px;
}
.cc-settings-placeholder i { font-size: 40px; opacity: .25; }

/* Settings cards */
.cc-settings-card {
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 14px; overflow: hidden; margin-bottom: 16px;
}
.cc-settings-card-title {
  font-size: 11.5px; font-weight: 600; color: var(--cc-text-3);
  text-transform: uppercase; letter-spacing: .6px;
  padding: 13px 16px 7px;
}
.cc-settings-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--cc-border);
  transition: background var(--cc-anim-speed); cursor: default;
}
.cc-settings-row:last-child { border-bottom: none; }
.cc-settings-row:hover      { background: rgba(255,255,255,.03); }
.cc-settings-row-label { flex: 1; font-size: 14px; }
.cc-settings-row-value { font-size: 13px; color: var(--cc-text-3); }
.cc-settings-actions {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 0 4px;
}

/* =========================================================================
   STUB SECTION  (Contacts / Calls / Nearby)
   ========================================================================= */
.cc-stub-section {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 40px; text-align: center; color: var(--cc-text-3);
}
.cc-stub-section i           { font-size: 48px; opacity: .25; }
.cc-stub-section .cc-stub-title { font-size: 18px; font-weight: 700; color: var(--cc-text); }
.cc-stub-section .cc-stub-body  { font-size: 13.5px; max-width: 360px; line-height: 1.75; }

/* =========================================================================
   SIDE-PANEL VIEW AREA  (right of the chat list)
   ========================================================================= */
.cc-view-area {
  flex: 1;
  display: flex;
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--cc-bg);
}
.cc-view-stub {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 40px; text-align: center; color: var(--cc-text-3);
}
.cc-view-stub i              { font-size: 48px; opacity: .25; }
.cc-view-stub .cc-stub-title { font-size: 18px; font-weight: 700; color: var(--cc-text); }
.cc-view-stub .cc-stub-body  { font-size: 13.5px; max-width: 360px; line-height: 1.75; }

/* =========================================================================
   CONTEXT MENU
   ========================================================================= */
.cc-menu {
  background: var(--cc-surface-3);
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  padding: 20px!important;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
  padding: 4px;
  min-width: 200px;
  z-index: 1050;
  position: fixed;
}
.cc-menu-item {
  display: flex; align-items: center; gap: 9px;
  border-radius: 7px;
  font-size: 13.5px; 
  color: var(--cc-text);
  cursor: pointer; border: none;
  background: transparent; width: 100%; text-align: left;
}
.cc-menu-icon { background:#fff!important; }
.cc-menu-item i  { font-size: 15px; color: #fff; width: 18px; flex-shrink: 0; }
.cc-menu-item.danger  { color: #fff; }
.cc-menu-item.danger i  { color: #fff; }
.cc-menu-sep  { height: 1px; background: var(--cc-border); margin: 3px 8px; }

/* =========================================================================
   MODAL
   ========================================================================= */
.cc-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.68);
  z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.cc-modal {
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  width: 460px; max-width: 92vw; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.65);
}
.cc-modal-header {
  padding: 14px 16px; border-bottom: 1px solid var(--cc-border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; flex-shrink: 0;
}
.cc-modal-body   { padding: 16px; overflow-y: auto; flex: 1; }
.cc-modal-footer { padding: 12px 16px; border-top: 1px solid var(--cc-border); display: flex; justify-content: flex-end; gap: 9px; flex-shrink: 0; }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.cc-btn {
  padding: 8px 18px; border-radius: 20px; border: none;
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background var(--cc-anim-speed), opacity .14s; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.cc-btn-primary   { background: var(--cc-accent); color: #fff; }
.cc-btn-primary:hover { background: var(--cc-accent-hover); }
.cc-btn-secondary { background: var(--cc-surface-3); color: var(--cc-text); }
.cc-btn-secondary:hover { background: var(--cc-surface-4); }
.cc-btn-danger    { background: var(--cc-danger); color: #fff; }
.cc-btn-danger:hover { background: #dc2626; }
.cc-btn-ghost     { background: transparent; color: var(--cc-text-2); border: none; }
.cc-btn-ghost:hover { color: var(--cc-text); }
.cc-btn:disabled  { opacity: .45; cursor: default; pointer-events: none; }

/* =========================================================================
   FORM CONTROLS
   ========================================================================= */
.cc-field       { margin-bottom: 14px; }
.cc-field-row   { display: flex; gap: 12px; }
.cc-label       { display: block; font-size: 12px; color: var(--cc-text-2); margin-bottom: 5px; font-weight: 500; }
.cc-input, .cc-textarea {
  width: 100%;
  background: var(--cc-surface-3);
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  padding: 9px 12px; color: var(--cc-text);
  font-size: 13.5px; outline: none; font-family: inherit;
  transition: border .15s;
}
.cc-input:focus, .cc-textarea:focus { border-color: rgba(13,162,231,.55); }
.cc-input::placeholder, .cc-textarea::placeholder { color: var(--cc-text-3); }
.cc-textarea { min-height: 72px; resize: vertical; }
.cc-check-hint          { font-size: 12px; margin-top: 4px; color: var(--cc-online); display: none; }
.cc-check-hint.show     { display: block; }
.cc-check-hint.error    { color: var(--cc-danger); }

/* =========================================================================
   TOAST
   ========================================================================= */
.cc-toast-wrap {
  position: fixed; top: 16px; right: 16px;
  z-index: 1400; display: flex; flex-direction: column; gap: 7px;
  pointer-events: none;
}
.cc-toast {
  background: var(--cc-surface-3);
  border: 1px solid var(--cc-border);
  border-left: 3px solid var(--cc-accent);
  color: var(--cc-text);
  padding: 11px 14px; border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 30px rgba(0,0,0,.55);
  max-width: 320px;
  animation: cc-toast-in .2s ease;
  pointer-events: auto;
}
.cc-toast.error   { border-left-color: var(--cc-danger); }
.cc-toast.success { border-left-color: var(--cc-online); }
@keyframes cc-toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* =========================================================================
   LOADING SPINNER
   ========================================================================= */
.cc-loading-spinner {
  width: 26px; height: 26px;
  border: 3px solid var(--cc-surface-3);
  border-top-color: var(--cc-accent);
  border-radius: 50%;
  animation: cc-spin .7s linear infinite;
  display: inline-block;
}
@keyframes cc-spin { to { transform: rotate(360deg); } }

/* =========================================================================
   MISC UTILITIES
   ========================================================================= */
.cc-info-row  { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.cc-info-name { font-size: 16px; font-weight: 700; }
.cc-info-meta { font-size: 13px; color: var(--cc-text-3); margin-top: 2px; }

/* Media grid in info panel */
.cc-media-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; padding: 8px 14px; }
.cc-media-grid img, .cc-media-grid video {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 7px; cursor: pointer; display: block;
}

/* cc-pos-absolute for context menus */
.cc-pos-absolute { position: fixed; }

/* =========================================================================
   RESPONSIVE — TABLET  (≤ 1100px)
   ========================================================================= */
@media (max-width: 1100px) {
  :root {
    --cc-info-width: 270px;
    --cc-settings-menu-width: 280px;
  }
}

/* =========================================================================
   RESPONSIVE — SMALL TABLET  (≤ 900px)
   ========================================================================= */
@media (max-width: 900px) {
  :root {
    --cc-chatlist-width: 280px;
    --cc-info-width: 0px;
    --cc-settings-menu-width: 260px;
  }
  .cc-info-panel { display: none !important; }
}

/* =========================================================================
   RESPONSIVE — MOBILE  (≤ 768px)
   ========================================================================= */
@media (max-width: 768px) {
  :root {
    --cc-nav-width: 58px;
    --cc-chatlist-width: 100vw;
  }

  /* Nav */
  .cc-nav-item {width: 48px;height: 48px;line-height: 48px;font-size: 9px;}
  .cc-nav-item i { font-size: 18px; }
  .cc-nav-item .cc-ico { width: 18px; height: 18px; }

  /* Chat list takes full width */
  .cc-chatlist { width: 100%; max-width: 100vw; border-right: none; }

  /* Chat view hidden until selected */
  .cc-chat { display: none; }
  .cc-info-panel { display: none !important; }

  /* When chat is open */
  .cc-app.show-chat .cc-chatlist { display: none; }
  .cc-app.show-chat .cc-chat     { display: flex; }
  .cc-header-action.cc-back      { display: flex; }
  .cc-messages { padding: 10px 8px 6px; }
  .cc-msg { max-width: 88%; }

  /* Settings — single column on mobile */
  .cc-settings-menu    { width: 100%; min-width: 100%; border-right: none; }
  .cc-settings-content { display: none; }
  .cc-settings-section.show-content .cc-settings-menu    { display: none; }
  .cc-settings-section.show-content .cc-settings-content { display: flex; }
}

/* =========================================================================
   PHASE 9 — CONNECTION STATUS BAR
   ========================================================================= */
.cc-conn-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 500;
  z-index: 2000;
  transition: background .3s, opacity .3s;
  letter-spacing: .2px;
}
.cc-conn-connected    { background: var(--cc-online);  color: #fff; }
.cc-conn-disconnected { background: #7C3AED;            color: #fff; }
.cc-conn-reconnecting { background: var(--cc-warn);     color: #000; }

/* =========================================================================
   PHASE 10 — UPLOAD PROGRESS
   ========================================================================= */
.cc-upload-progress {
  position: fixed;
  bottom: 80px; right: 20px;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 220px;
  z-index: 1300;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  font-size: 13px;
}
.cc-upload-progress-label { color: var(--cc-text-2); margin-bottom: 7px; font-size: 12px; }
.cc-upload-bar-wrap {
  height: 5px; background: var(--cc-surface-3);
  border-radius: 3px; overflow: hidden;
}
.cc-upload-bar {
  height: 100%; background: var(--cc-accent);
  border-radius: 3px; width: 0%;
  transition: width .2s ease;
}

/* =========================================================================
   PHASE 12 — MESSAGE SELECTION MODE
   ========================================================================= */
.cc-select-toolbar {
  background: var(--cc-surface-2);
  border-top: 1px solid var(--cc-border);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.cc-select-count {
  flex: 1; font-size: 14px; font-weight: 600; color: var(--cc-text);
}
.cc-select-action {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px;
  border: none; background: var(--cc-surface-3);
  color: var(--cc-text-2); font-size: 13px; cursor: pointer;
  transition: background var(--cc-anim-speed), color .13s;
}
.cc-select-action:hover { background: var(--cc-accent-soft); color: var(--cc-accent); }
.cc-select-action.danger { color: var(--cc-danger); }
.cc-select-action.danger:hover { background: rgba(239,68,68,.1); }

/* Message selected state */
.cc-msg.selected .cc-bubble {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}
.cc-msg-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--cc-border);
  background: var(--cc-surface-3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; align-self: flex-end;
  margin: 0 6px 4px;
  cursor: pointer; transition: background var(--cc-anim-speed), border-color .12s;
  font-size: 11px; color: transparent;
}
.cc-msg.selected .cc-msg-check {
  background: var(--cc-accent); border-color: var(--cc-accent); color: #fff;
}

/* =========================================================================
   PHASE 13 — SETTINGS TOGGLE SWITCH
   ========================================================================= */
.cc-toggle-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--cc-border);
  transition: background var(--cc-anim-speed);
}
.cc-toggle-row:last-child { border-bottom: none; }
.cc-toggle-row:hover      { background: rgba(255,255,255,.03); }
.cc-toggle-label  { flex: 1; font-size: 14px; color: var(--cc-text); }
.cc-toggle-sub    { font-size: 11.5px; color: var(--cc-text-3); margin-top: 1px; }

/* Toggle switch */
.cc-toggle {
  position: relative; width: 42px; height: 24px; flex-shrink: 0;
}
.cc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.cc-toggle-slider {
  position: absolute; inset: 0;
  background: var(--cc-surface-4);
  border-radius: 12px; cursor: pointer;
  transition: background .2s;
}
.cc-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.cc-toggle input:checked + .cc-toggle-slider { background: var(--cc-accent); }
.cc-toggle input:checked + .cc-toggle-slider::before { transform: translateX(18px); }

/* Color accent pickers */
.cc-accent-grid {
  display: flex; gap: 10px; flex-wrap: wrap; padding: 4px 0 12px;
}
.cc-accent-dot {
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; border: 3px solid transparent;
  transition: transform .12s, border-color .12s;
}
.cc-accent-dot:hover   { transform: scale(1.12); }
.cc-accent-dot.active  { border-color: #fff; }

/* Picker option (modal list items) */
.cc-picker-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 13px 16px;
  background: transparent; border: none; border-bottom: 1px solid var(--cc-border);
  color: var(--cc-text); font-size: 14px; text-align: left; cursor: pointer;
  transition: background var(--cc-anim-speed);
}
.cc-picker-option:hover { background: rgba(255,255,255,.04); }
.cc-picker-option.active { color: var(--cc-accent); font-weight: 600; }
.cc-picker-option:last-child { border-bottom: none; }

/* Devices / Active Sessions */
.cc-devices-body { padding: 2px; }
.cc-devices-group-label {
  padding: 12px 16px 4px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.6px;
  color: var(--cc-text-3);
}
.cc-devices-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--cc-border);
}
.cc-devices-row:last-child { border-bottom: none; }
.cc-devices-row:hover { background: rgba(255,255,255,.03); }
.cc-devices-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 19px; color: var(--cc-accent);
  background: var(--cc-accent-soft);
}
.cc-devices-name { font-size: 14px; color: var(--cc-text); font-weight: 500; }
.cc-devices-badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border-radius: 10px; font-size: 10.5px; font-weight: 600;
  color: var(--cc-accent); background: var(--cc-accent-soft);
  vertical-align: middle;
}

/* =========================================================================
   PHASE 14 — ADDITIONAL RESPONSIVE FIXES
   ========================================================================= */

/* Ensure conn-bar doesn't push app content when visible */
.cc-app { transition: padding-top var(--cc-anim-speed); }
body.cc-conn-visible .cc-app { padding-top: 30px; }

/* Fluid message widths on small screens */
@media (max-width: 600px) {
  .cc-msg { max-width: 92%; }
  .cc-bubble { font-size: 13.5px; }
  .cc-composer { padding: 6px 8px; }
  .cc-chat-header { height: 52px; min-height: 52px; }
}

/* Info panel hidden on narrow desktops — show only on wide */
@media (min-width: 901px) and (max-width: 1200px) {
  :root { --cc-info-width: 260px; }
}

/* Prevent chatlist from shrinking below readable width */
@media (min-width: 769px) {
  .cc-chatlist { min-width: 240px; }
}

/* Smooth nav tooltip on hover */
.cc-nav-item[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: calc(var(--cc-nav-width) - 4px);
  background: var(--cc-surface-3);
  border: 1px solid var(--cc-border);
  color: var(--cc-text);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

/* Skeleton loading for chat list */
.cc-skeleton {
  background: linear-gradient(90deg, var(--cc-surface-3) 25%, var(--cc-surface-4) 50%, var(--cc-surface-3) 75%);
  background-size: 200% 100%;
  animation: cc-skeleton-shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes cc-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.cc-skeleton-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
}
.cc-skeleton-avatar { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; }
.cc-skeleton-lines  { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.cc-skeleton-line   { height: 11px; border-radius: 5px; }
.cc-skeleton-line.short { width: 55%; }
.cc-skeleton-line.xshort { width: 30%; }

/* =========================================================================
   NEARBY VIEW
   ========================================================================= */
.cc-nearby-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.cc-nearby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--cc-divider);
}
.cc-nearby-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--cc-text);
}
.cc-nearby-visibility {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cc-nearby-visibility select {
  background: var(--cc-surface-3);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.cc-nearby-controls {
  padding: 12px 20px;
  border-bottom: 1px solid var(--cc-divider);
}
.cc-nearby-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cc-nearby-filter-btn {
  background: var(--cc-surface-3);
  color: var(--cc-text-3);
  border: 1px solid var(--cc-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.cc-nearby-filter-btn:hover {
  background: var(--cc-surface-4);
  color: var(--cc-text);
}
.cc-nearby-filter-btn.active {
  background: var(--cc-accent);
  color: #fff;
  border-color: var(--cc-accent);
}
.cc-nearby-radius {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--cc-text-2);
}
.cc-nearby-radius input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--cc-surface-4);
  border-radius: 2px;
  outline: none;
}
.cc-nearby-radius input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cc-accent);
  cursor: pointer;
}
.cc-nearby-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}
.cc-nearby-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--cc-radius);
  background: var(--cc-surface-2);
  margin-bottom: 8px;
  transition: background .15s;
}
.cc-nearby-user-card:hover {
  background: var(--cc-surface-3);
}
.cc-nearby-user-info {
  flex: 1;
  min-width: 0;
}
.cc-nearby-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-nearby-user-meta {
  font-size: 12px;
  color: var(--cc-text-3);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cc-nearby-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cc-online);
  flex-shrink: 0;
}
.cc-nearby-offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cc-text-3);
  opacity: 0.5;
  flex-shrink: 0;
}
.cc-nearby-user-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.cc-nearby-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--cc-text-3);
  text-align: center;
}
.cc-nearby-location-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 30px;
  text-align: center;
}
.cc-nearby-location-prompt i {
  font-size: 48px;
  color: var(--cc-text-3);
  opacity: 0.5;
  margin-bottom: 16px;
}
.cc-nearby-location-prompt p {
  font-size: 14px;
  color: var(--cc-text-3);
  max-width: 300px;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* =========================================================================
   CALLS VIEW
   ========================================================================= */
.cc-calls-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.cc-calls-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--cc-divider);
}
.cc-calls-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--cc-text);
}
.cc-calls-filters {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--cc-divider);
  flex-wrap: wrap;
}
.cc-calls-filter-btn {
  background: var(--cc-surface-3);
  color: var(--cc-text-3);
  border: 1px solid var(--cc-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.cc-calls-filter-btn:hover {
  background: var(--cc-surface-4);
  color: var(--cc-text);
}
.cc-calls-filter-btn.active {
  background: var(--cc-accent);
  color: #fff;
  border-color: var(--cc-accent);
}
.cc-calls-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}
.cc-calls-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--cc-radius);
  background: var(--cc-surface-2);
  margin-bottom: 8px;
  transition: background .15s;
}
.cc-calls-item:hover {
  background: var(--cc-surface-3);
}
.cc-calls-item.missed {
  background: rgba(239,68,68,0.06);
}
.cc-calls-item.missed:hover {
  background: rgba(239,68,68,0.1);
}
.cc-calls-avatar {
  flex-shrink: 0;
}
.cc-calls-info {
  flex: 1;
  min-width: 0;
}
.cc-calls-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-calls-meta {
  font-size: 12px;
  color: var(--cc-text-3);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cc-calls-duration {
  font-size: 12px;
  color: var(--cc-text-2);
  flex-shrink: 0;
}
.cc-calls-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.cc-calls-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cc-surface-3);
  border: 1px solid var(--cc-border);
  color: var(--cc-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
  font-size: 14px;
}
.cc-calls-action-btn:hover {
  background: var(--cc-accent);
  color: #fff;
}
.cc-calls-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

/* =========================================================================
   THEME BUTTONS (Appearance Settings)
   ========================================================================= */
.cc-theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: var(--cc-surface-3);
  border: 2px solid var(--cc-border);
  border-radius: 10px;
  color: var(--cc-text-3);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  min-width: 60px;
}
.cc-theme-btn i {
  font-size: 18px;
}
.cc-theme-btn:hover {
  background: var(--cc-surface-4);
  color: var(--cc-text);
  border-color: var(--cc-text-3);
}
.cc-theme-btn.active {
  background: var(--cc-accent-soft);
  color: var(--cc-accent);
  border-color: var(--cc-accent);
}

/* =========================================================================
   NEARBY � MAP + LIST (Leaflet on OpenStreetMap + user cards)
   Theme uses the app CSS vars so it matches the dark UI.
   ========================================================================= */
.cc-nearby-wrap {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cc-bg);
}
.cc-nearby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--cc-divider);
  flex-shrink: 0;
}
.cc-nearby-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--cc-text);
  white-space: nowrap;
}
.cc-nearby-view-toggle {
  display: flex;
  gap: 4px;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}
.cc-nearby-view-btn {
  border: none;
  background: transparent;
  color: var(--cc-text-3);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, color .15s;
}
.cc-nearby-view-btn:hover { color: var(--cc-text); }
.cc-nearby-view-btn.active { background: var(--cc-accent); color: #fff; }

.cc-nearby-filters {
  display: flex;
  gap: 8px;
  padding: 12px 18px 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Radius + visibility row */
.cc-nearby-radius-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 18px 12px;
  flex-shrink: 0;
}
.cc-nearby-radius-label {
  font-size: 12.5px;
  color: var(--cc-text-2);
  white-space: nowrap;
}
.cc-nearby-slider {
  flex: 1;
  min-width: 60px;
  accent-color: var(--cc-accent);
  cursor: pointer;
}
.cc-nearby-radius-value {
  font-size: 12.5px;
  color: var(--cc-text);
  font-weight: 600;
  min-width: 44px;
  white-space: nowrap;
}
.cc-nearby-visibility-spacer { flex: 1; }

.cc-nearby-visibility-wrap { position: relative; flex-shrink: 0; }
.cc-nearby-visibility-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cc-surface-3);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.cc-nearby-visibility-btn:hover { background: var(--cc-surface-4); }
.cc-nearby-visibility-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--cc-surface-3);
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.55);
  min-width: 150px;
  padding: 4px;
  z-index: 2000;
}
.cc-nearby-vis-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--cc-text-2);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}
.cc-nearby-vis-option:hover { background: rgba(255,255,255,.07); color: var(--cc-text); }
.cc-nearby-vis-option.active { color: var(--cc-accent); }

/* Content area: map OR list */
.cc-nearby-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* -- MAP mode -- */
.cc-nearby-map-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--cc-surface);
}
.cc-nearby-map {
  flex: 1;
  min-height: 0;
  z-index: 1;
  isolation: isolate;
  background: #0d141f;
}
.cc-nearby-map-empty,
.cc-nearby-map-loading {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 2;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--cc-text-3);
  font-size: 14px;
  background: var(--cc-bg);
  pointer-events: none;
}
.cc-nearby-map-empty i { font-size: 42px; opacity: .3; }
.cc-nearby-map-note {
  position: absolute;
  bottom: 6px;
  right: 10px;
  z-index: 3;
  font-size: 11px;
  color: var(--cc-text-3);
  opacity: .8;
  pointer-events: none;
}

/* Markers */
.cc-nearby-marker { background: transparent; border: none; }
.cc-marker-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cc-surface-4);
  border: 2.5px solid var(--cc-accent);
  box-shadow: 0 2px 10px rgba(0,0,0,.55);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cc-marker-avatar.online { border-color: var(--cc-online); }
.cc-marker-avatar .cc-avatar,
.cc-marker-avatar .cc-avatar-sm,
.cc-marker-avatar .cc-avatar-lg { width: 100%; height: 100%; }
.cc-marker-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.cc-nearby-marker-you { background: transparent; border: none; }
.cc-marker-you {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cc-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
}

.cc-nearby-radius-circle {
  transition: none;
}

/* Leaflet dark-theme overlays */
.cc-nearby-map-wrap .leaflet-container { font-family: inherit; }
.cc-nearby-map-wrap .leaflet-tile-pane { filter: saturate(.85) brightness(.86) contrast(1.02); }
.cc-nearby-map-wrap .leaflet-container { background: #0d141f; }
.cc-nearby-map-wrap .leaflet-popup-content-wrapper {
  background: var(--cc-surface-3);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.cc-nearby-map-wrap .leaflet-popup-content { margin: 14px 16px; }
.cc-nearby-map-wrap .leaflet-popup-tip { background: var(--cc-surface-3); border: 1px solid var(--cc-border); }
.cc-nearby-map-wrap .leaflet-popup-close-button { color: var(--cc-text-3) !important; }
.cc-nearby-map-wrap .leaflet-popup-close-button:hover { color: var(--cc-text) !important; }
.cc-nearby-map-wrap .leaflet-control-attribution {
  background: rgba(3,10,27,.8) !important;
  color: var(--cc-text-3) !important;
  font-size: 10px;
}
.cc-nearby-map-wrap .leaflet-control-attribution a { color: var(--cc-accent) !important; }
.cc-nearby-map-wrap .leaflet-bar a {
  background: var(--cc-surface-3);
  color: var(--cc-text);
  border-color: var(--cc-border);
}
.cc-nearby-map-wrap .leaflet-bar a:hover { background: var(--cc-surface-4); }

/* Popup contents */
.cc-nearby-popup { min-width: 210px; }
.cc-nearby-popup-top { display: flex; gap: 10px; align-items: flex-start; }
.cc-nearby-popup-id { min-width: 0; }
.cc-nearby-popup-name { font-size: 14.5px; font-weight: 700; color: var(--cc-text); }
.cc-nearby-popup-username { font-size: 12px; color: var(--cc-text-3); margin-top: 1px; }
.cc-nearby-popup-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--cc-text-2);
}
.cc-nearby-popup-dist { display: inline-flex; align-items: center; gap: 3px; }
.cc-nearby-popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.cc-nearby-popup-actions .cc-btn { font-size: 12.5px; padding: 7px 12px; }

/* -- LIST mode -- */
.cc-nearby-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 14px 16px;
  display: none;
}
.cc-nearby-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  margin-bottom: 10px;
  transition: background .15s, border-color .15s;
}
.cc-nearby-card:hover { background: var(--cc-surface-3); border-color: var(--cc-divider); }
.cc-nearby-card-left { flex-shrink: 0; }
.cc-nearby-card-main { flex: 1; min-width: 0; }
.cc-nearby-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.cc-nearby-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--cc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-nearby-distance {
  font-size: 12px;
  color: var(--cc-text-2);
  white-space: nowrap;
}
.cc-nearby-card-mid {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
}
.cc-nearby-username { font-size: 12.5px; color: var(--cc-text-3); }
.cc-nearby-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.cc-nearby-status.online  { color: var(--cc-online); background: rgba(35,211,107,.12); }
.cc-nearby-status.offline { color: var(--cc-text-3); background: rgba(255,255,255,.06); }
.cc-nearby-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.cc-nearby-card-actions .cc-btn { font-size: 12.5px; padding: 7px 12px; }

.cc-nearby-empty,
.cc-nearby-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 20px;
  color: var(--cc-text-3);
  font-size: 14px;
}
.cc-nearby-empty i { font-size: 42px; opacity: .3; }

/* Location prompt overlay */
.cc-nearby-location-prompt {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
  background: var(--cc-bg);
}
.cc-nearby-location-prompt > i { font-size: 46px; color: var(--cc-accent); opacity: .9; }
.cc-nearby-location-prompt > div:nth-of-type(1) { font-size: 18px; font-weight: 700; color: var(--cc-text); }
.cc-nearby-location-sub { font-size: 13.5px; color: var(--cc-text-3); max-width: 300px; line-height: 1.6; }
.cc-nearby-location-prompt .cc-btn { margin-top: 6px; }

/* -- Nearby full screen: hide chat list so the map fills the whole area -- */
.cc-app.nearby-open .cc-chatlist { display: none; }

/* =========================================================================
   NEARBY � USER PROFILE DRAWER (opens over the map, from the right)
   Shows the REAL profile fetched from users/get_profile.php.
   ========================================================================= */
.cc-nearby-profile {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(340px, 92vw);
  background: var(--cc-surface-2);
  border-left: 1px solid var(--cc-border);
  display: none;
  flex-direction: column;
  z-index: 600;
  animation: cc-panel-slide-in .2s ease;
  box-shadow: -12px 0 32px rgba(0,0,0,.4);
}
.cc-nearby-profile.open { display: flex; }
.cc-nearby-profile-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--cc-border);
  flex-shrink: 0;
}
.cc-nearby-profile-header .cc-nearby-profile-title {
  font-size: 18px; font-weight: 700; flex: 1;
}
.cc-nearby-profile-back { margin-right: 2px; }
.cc-nearby-profile-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cc-nearby-prof-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--cc-divider);
}
.cc-nearby-prof-avatar .cc-avatar-wrap { position: relative; }
.cc-nearby-prof-name {
  font-size: 20px; font-weight: 700; color: var(--cc-text);
  text-align: center;
}
.cc-nearby-prof-username {
  font-size: 13.5px; color: var(--cc-text-3); text-align: center;
}
.cc-nearby-prof-status {
  font-size: 12.5px; padding: 3px 12px; border-radius: 999px;
}
.cc-nearby-prof-status.online  { color: var(--cc-online); background: rgba(35,211,107,.12); }
.cc-nearby-prof-status.offline { color: var(--cc-text-3); background: rgba(255,255,255,.06); }

.cc-nearby-prof-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--cc-divider);
}
.cc-nearby-prof-actions .cc-btn {
  justify-content: center;
  font-size: 14px;
  padding: 11px 14px;
}
.cc-nearby-prof-actions .cc-btn-primary {
  background: var(--cc-accent);
  color: #fff;
  border: 1px solid var(--cc-accent);
}
.cc-nearby-prof-actions .cc-btn-primary:hover { background: var(--cc-accent-hover); }

.cc-nearby-prof-details { padding: 12px 0 0; }
.cc-nearby-prof-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 4px;
}
.cc-nearby-prof-row + .cc-nearby-prof-row { border-top: 1px solid var(--cc-divider); }
.cc-nearby-prof-row > i {
  color: var(--cc-text-3);
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}
.cc-nearby-prof-row-main { flex: 1; min-width: 0; }
.cc-nearby-prof-row-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--cc-text-3);
  margin-bottom: 3px;
}
.cc-nearby-prof-row-value {
  font-size: 14px;
  color: var(--cc-text);
  word-break: break-word;
}
.cc-nearby-prof-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  flex: 1;
}

/* -- Profile: location mini-map -- */
.cc-nearby-prof-map-card {
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--cc-surface-2);
}
.cc-nearby-prof-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--cc-divider);
}
.cc-nearby-prof-map-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cc-text);
}
.cc-nearby-prof-map-head i { color: var(--cc-accent); }
.cc-nearby-prof-map-dist {
  font-size: 12px;
  color: var(--cc-text-2);
  white-space: nowrap;
}
.cc-nearby-prof-map {
  height: 240px;
  width: 100%;
  background: #0d141f;
  z-index: 1;
}
.cc-nearby-prof-map-card .leaflet-container { background: #0d141f; font-family: inherit; }
.cc-nearby-prof-map-card .leaflet-tile-pane { filter: saturate(.85) brightness(.86) contrast(1.02); }
.cc-nearby-prof-map-card .leaflet-control-attribution {
  background: rgba(3,10,27,.8) !important;
  color: var(--cc-text-3) !important;
  font-size: 10px;
}
.cc-nearby-prof-map-card .leaflet-control-attribution a { color: var(--cc-accent) !important; }
.cc-nearby-prof-map-city {
  font-size: 12.5px;
  color: var(--cc-text-2);
  padding: 8px 14px;
  border-top: 1px solid var(--cc-divider);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* -- Profile: about -- */
.cc-nearby-prof-about {
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  padding: 13px 15px;
}
.cc-nearby-prof-about-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--cc-accent);
  margin-bottom: 5px;
}
.cc-nearby-prof-about-text {
  font-size: 14px;
  color: var(--cc-text);
  line-height: 1.6;
  word-break: break-word;
}

/* -- Profile: option list (mobile-app style rows) -- */
.cc-nearby-prof-list {
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  overflow: hidden;
}
.cc-nearby-prof-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--cc-divider);
  color: var(--cc-text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background var(--cc-anim-speed);
}
.cc-nearby-prof-option:last-child { border-bottom: none; }
.cc-nearby-prof-option:hover { background: var(--cc-surface-3); }
.cc-nearby-prof-option > i:first-child { font-size: 18px; color: var(--cc-accent); width: 22px; text-align: center; }
.cc-nearby-prof-option > span { flex: 1; }
.cc-nearby-prof-option-arrow { font-size: 13px; color: var(--cc-text-3); }

.cc-nearby-prof-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

/* -- Map safety net: Leaflet needs a non-zero container to render -- */
.cc-nearby-map { min-height: 220px; }

/* =========================================================================
   CONTACTS VIEW  (right-side panel; same list as the mobile app)
   ========================================================================= */
.cc-contacts-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--cc-surface-2);
  border-left: 1px solid var(--cc-border);
  min-width: 0;
}
.cc-contacts-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--cc-border);
  flex-shrink: 0;
}
.cc-contacts-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--cc-text);
}
.cc-contacts-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 16px;
}
.cc-contacts-section {
  padding: 12px 10px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cc-accent);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.cc-contacts-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--cc-anim-speed);
}
.cc-contacts-row:hover { background: var(--cc-surface-3); }
.cc-contacts-row .cc-avatar-wrap { position: relative; flex-shrink: 0; }
.cc-contacts-row-main { flex: 1; min-width: 0; }
.cc-contacts-row-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cc-contacts-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--cc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-contacts-blocked { color: var(--cc-danger); font-size: 12px; }
.cc-contacts-row-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
}
.cc-contacts-username {
  font-size: 12.5px;
  color: var(--cc-text-3);
}
.cc-contacts-status {
  font-size: 12.5px;
  color: var(--cc-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-contacts-status.online { color: var(--cc-online); }
.cc-contacts-msg-btn {
  font-size: 12.5px;
  padding: 7px 12px;
  flex-shrink: 0;
}
.cc-view-area .cc-contacts-wrap.cc-contacts-inline {
  border-left: none;
}
.cc-contacts-row-muted .cc-contacts-name { color: var(--cc-text-2); }
.cc-contacts-row-muted .cc-avatar-wrap .cc-avatar { opacity: .65; filter: grayscale(.35); }
.cc-contacts-section-muted { color: var(--cc-text-3); }
/* =========================================================================
   NEARBY 4-STEP SETUP WIZARD  (allow location -> preference -> radius -> map)
   Map is hidden until all three setup steps are completed.
   ========================================================================= */
.cc-nearby-view-toggle {
  display: flex;
  gap: 4px;
  background: var(--cc-surface-3);
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  padding: 3px;
}

.cc-nearby-wizard {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--cc-bg);
  overflow: hidden;
}

.cc-nearby-wizard-steps {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--cc-divider);
  flex-shrink: 0;
}

.cc-wiz-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cc-text-3);
  font-size: 13px;
  font-weight: 600;
  opacity: .55;
  transition: opacity .2s;
}
.cc-wiz-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cc-surface-4);
  border: 1px solid var(--cc-border);
  color: var(--cc-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all .2s;
}
.cc-wiz-step.active { opacity: 1; color: var(--cc-text); }
.cc-wiz-step.active .cc-wiz-num {
  background: var(--cc-accent);
  border-color: var(--cc-accent);
  color: #fff;
}
.cc-wiz-step.done { opacity: .9; }
.cc-wiz-step.done .cc-wiz-num {
  background: var(--cc-online);
  border-color: var(--cc-online);
  color: #fff;
}

.cc-nearby-wizard-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 24px 32px;
  display: flex;
  justify-content: center;
}

.cc-wiz-step-pane {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  animation: cc-panel-slide-in .22s ease;
}
.cc-wiz-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(13,162,231,.12);
  color: var(--cc-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 4px;
}
.cc-wiz-title { font-size: 19px; font-weight: 700; color: var(--cc-text); }
.cc-wiz-sub { font-size: 13.5px; color: var(--cc-text-3); line-height: 1.6; max-width: 320px; }
.cc-wiz-error {
  font-size: 13px;
  color: var(--cc-danger);
  background: rgba(244,67,54,.1);
  border: 1px solid rgba(244,67,54,.25);
  border-radius: 10px;
  padding: 9px 12px;
  width: 100%;
  margin-top: 4px;
}
.cc-wiz-primary-btn {
  margin-top: 14px;
  width: 100%;
  justify-content: center;
  font-size: 14.5px;
  padding: 12px 14px;
}
.cc-wiz-primary-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.cc-wiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}
.cc-wiz-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  cursor: pointer;
  transition: all .15s;
}
.cc-wiz-opt:hover { background: var(--cc-surface-3); }
.cc-wiz-opt.active {
  background: rgba(13,162,231,.14);
  border-color: var(--cc-accent);
  box-shadow: 0 0 0 1px var(--cc-accent);
}
.cc-wiz-opt-label { font-size: 14px; font-weight: 700; color: var(--cc-text); }
.cc-wiz-opt-desc { font-size: 11px; color: var(--cc-text-3); }

.cc-wiz-vis-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
}
.cc-wiz-vis-label { font-size: 13px; color: var(--cc-text-2); }
.cc-wiz-vis-label b { color: var(--cc-text); }
.cc-wiz-vis-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cc-surface-3);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.cc-wiz-vis-btn:hover { background: var(--cc-surface-4); }
.cc-wiz-vis-btn i { color: var(--cc-accent); }

.cc-wiz-radius {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 18px 16px;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
}
.cc-wiz-radius-slider {
  width: 100%;
  accent-color: var(--cc-accent);
  cursor: pointer;
}
.cc-wiz-radius-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--cc-text);
  text-align: center;
}
/* -- Contacts: info banner -- */
.cc-contacts-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 12px 0;
  padding: 10px 12px;
  background: rgba(13,162,231,.1);
  border: 1px solid rgba(13,162,231,.25);
  border-radius: 12px;
  flex-shrink: 0;
}
.cc-contacts-note > i { color: var(--cc-accent); font-size: 15px; margin-top: 2px; flex-shrink: 0; }
.cc-contacts-note-text { flex: 1; font-size: 12.5px; line-height: 1.55; color: var(--cc-text-2); }
.cc-contacts-note-close {
  background: transparent;
  border: none;
  color: var(--cc-text-3);
  font-size: 13px;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}
.cc-contacts-note-close:hover { color: var(--cc-text); }

/* =========================================================================
   USER INFO PANEL  (App ContactInfoScreen 1:1)
   Mirrors lib/screens/Users_info/user_Info_new.dart (_buildCompactInfoScreen)
   ========================================================================= */
.cc-ui-panel { display: flex; flex-direction: column; flex: 1; overflow-y: auto; background: #040D1A; }

.cc-ui-panel-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: rgba(4, 13, 26, 0.92); backdrop-filter: blur(8px);
}
.cc-ui-back-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none; flex-shrink: 0;
  background: #071223; color: #F1F3F6; font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--cc-anim-speed);
}
.cc-ui-back-btn:hover { background: #0D1B2E; }
.cc-ui-panel-title { font-size: 15px; font-weight: 600; color: #F1F3F6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cc-ui-loader { display: flex; align-items: center; justify-content: center; padding: 90px 0; }

/* ── shared primitives ── */
.cc-ui-card {
  background: #071223; border-radius: 20px;
  border: 1px solid transparent;
}
.cc-ui-divider { height: 1px; background: #0E1C30; }

.cc-ui-section { padding: 0 16px; margin-top: 24px; }
.cc-ui-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cc-ui-section-title {
  font-size: 13px; font-weight: 700; letter-spacing: .6px;
  color: #F1F3F6; font-family: "Inter", sans-serif; flex: 1; text-transform: uppercase;
}
.cc-ui-section-title .bi { color: #0DA2E7; margin-right: 8px; }

/* ── 1. profile card ── */
.cc-ui-profile-card { padding: 16px; }
.cc-ui-profile-top { display: flex; align-items: center; gap: 14px; }
.cc-ui-avatar {
  position: relative; width: 90px; height: 90px; flex-shrink: 0;
  border-radius: 18px; overflow: hidden;
  border: 1.5px solid #0E1C30; background: #0D1B2E;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cc-ui-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-ui-avatar .cc-ui-avatar-ico { color: #6B7280; font-size: 38px; }
.cc-ui-avatar-dot {
  position: absolute; top: -3px; right: -3px; width: 14px; height: 14px;
  border-radius: 50%; background: #23D36B;
  border: 2px solid #071223; display: none;
}
.cc-ui-avatar.is-offline .cc-ui-avatar-dot { background: #6B7280; }
.cc-ui-avatar.is-online .cc-ui-avatar-dot { display: block; }
.cc-ui-avatar.is-offline .cc-ui-avatar-dot { display: block; }
.cc-ui-profile-info { flex: 1; min-width: 0; }
.cc-ui-name { font-size: 18px; font-weight: 700; color: #F1F3F6; line-height: 1.25; }
.cc-ui-name .bi-patch-check-fill { color: #0DA2E7; font-size: 16px; margin-left: 4px; }
.cc-ui-username { font-size: 13px; color: #6B7280; margin-top: 3px; }
.cc-ui-location { display: flex; align-items: center; gap: 3px; color: #6B7280; font-size: 11px; font-weight: 600; letter-spacing: .5px; margin-top: 6px; }
.cc-ui-location .bi { font-size: 13px; }
.cc-ui-status { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-size: 11px; font-weight: 700; letter-spacing: .6px; }
.cc-ui-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #6B7280; }
.cc-ui-status.online { color: #23D36B; }
.cc-ui-status.online .cc-ui-status-dot { background: #23D36B; }
.cc-ui-status.offline { color: #6B7280; }

/* transient verified badge (server may not flag it) */
.cc-ui-name .cc-ui-verified { color: #0DA2E7; font-size: 16px; margin-left: 4px; }

/* stats row */
.cc-ui-stats { display: flex; align-items: stretch; margin-top: 16px; }
.cc-ui-stat-divider { width: 1px; background: #0E1C30; margin: 2px 0; }
.cc-ui-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.cc-ui-stat-top { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 18px; font-weight: 700; color: #F1F3F6; font-family: "Inter", sans-serif; }
.cc-ui-stat-top .bi { font-size: 16px; }
.cc-ui-stat-top .bi-star-fill { color: #FFC107; }
.cc-ui-stat-label { font-size: 10px; color: #6B7280; font-weight: 600; letter-spacing: .4px; text-align: center; white-space: nowrap; }

/* ── 2. message + call ── */
.cc-ui-actions { display: flex; gap: 12px; padding: 0 16px; margin-top: 16px; }
.cc-ui-msg-btn {
  flex: 1; height: 52px; border: none; border-radius: 16px; cursor: pointer;
  background: linear-gradient(135deg, #0DA2E7 0%, #0085C2 100%);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: #fff; font-size: 16px; font-weight: 600; font-family: "Inter", sans-serif;
  transition: opacity var(--cc-anim-speed);
}
.cc-ui-msg-btn:hover { opacity: .9; }
.cc-ui-call-btn {
  width: 52px; height: 52px; border-radius: 16px; cursor: pointer;
  background: #071223; border: 1px solid #0E1C30; color: #F1F3F6; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--cc-anim-speed);
}
.cc-ui-call-btn:hover { background: #0D1B2E; }

/* ── 3. bio ── */
.cc-ui-bio { padding: 0 16px; margin-top: 16px; font-size: 14px; line-height: 1.55; color: #F1F3F6; font-family: "Inter", sans-serif; }

/* ── 4. rating card ── */
.cc-ui-rating-card { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.cc-ui-rating-label { flex: 1; font-size: 13px; font-weight: 700; line-height: 1.5; letter-spacing: .4px; color: #F1F3F6; white-space: pre-line; }
.cc-ui-stars { display: flex; }
.cc-ui-stars .bi { font-size: 26px; cursor: pointer; color: #6B7280; margin-left: 4px; transition: transform .1s; }
.cc-ui-stars .bi.filled { color: #FFC107; }
.cc-ui-stars .bi:hover { transform: scale(1.15); }

/* ── 5. shared in chat ── */
.cc-ui-pills { display: flex; gap: 10px; margin: 14px 0; }
.cc-ui-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px;
  border-radius: 30px; border: 1px solid #0E1C30; background: #071223;
  color: #6B7280; font-size: 13px; font-weight: 600; font-family: "Inter", sans-serif;
  cursor: pointer; transition: all .18s;
}
.cc-ui-pill.active { background: #0DA2E7; border-color: #0DA2E7; color: #fff; }
.cc-ui-pill .bi { font-size: 14px; }
.cc-ui-slots {
  min-height: 0;
}
.cc-ui-media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.cc-ui-media-grid img, .cc-ui-media-grid video {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px;
  background: #0D1B2E; cursor: pointer; display: block;
}
.cc-ui-mediagridslot { aspect-ratio: 1; border-radius: 10px; background: #0D1B2E; display: flex; align-items: center; justify-content: center; color: #6B7280; cursor: pointer; }
.cc-ui-slots-empty { padding: 24px 0; text-align: center; color: #6B7280; font-size: 13px; }
.cc-ui-link-item, .cc-ui-doc-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: #071223; border: 1px solid #0E1C30; border-radius: 14px;
  margin-bottom: 8px; cursor: pointer; transition: background var(--cc-anim-speed);
}
.cc-ui-link-item:hover, .cc-ui-doc-item:hover { background: #0D1B2E; }
.cc-ui-item-icon {
  width: 36px; height: 36px; border-radius: 10px; background: #0D1B2E;
  display: flex; align-items: center; justify-content: center; color: #0DA2E7; font-size: 17px; flex-shrink: 0;
}
.cc-ui-item-text { flex: 1; min-width: 0; }
.cc-ui-item-title { font-size: 13px; color: #F1F3F6; font-family: "Inter", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-ui-link-item .cc-ui-item-title { color: #0DA2E7; }
.cc-ui-item-meta { font-size: 11.5px; color: #6B7280; margin-top: 2px; }
.cc-ui-item-arrow { color: #6B7280; font-size: 16px; }

/* ── 6. mutual communities ── */
.cc-ui-chip {
  padding: 3px 8px; border-radius: 20px; background: #0D1B2E; color: #6B7280;
  font-size: 11px; font-family: "Inter", sans-serif; white-space: nowrap;
}
.cc-ui-mutual-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cc-ui-mutual-item {
  padding: 14px; background: #071223; border: 1px solid #0E1C30;
  border-radius: 18px; cursor: pointer;
}
.cc-ui-mutual-item:hover { background: #0D1B2E; }
.cc-ui-mutual-av {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.cc-ui-mutual-name { font-size: 13px; font-weight: 600; color: #F1F3F6; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-ui-mutual-meta { font-size: 11px; color: #6B7280; margin-top: 3px; }

/* ── 8. about ── */
.cc-ui-about-card { border-radius: 18px; background: #071223; overflow: hidden; }
.cc-ui-about-row { display: flex; align-items: center; gap: 16px; padding: 14px 16px; }
.cc-ui-about-row + .cc-ui-about-row { border-top: 1px solid #0E1C30; }
.cc-ui-about-ic { color: #0DA2E7; font-size: 20px; width: 22px; text-align: center; flex-shrink: 0; }
.cc-ui-about-body { flex: 1; min-width: 0; }
.cc-ui-about-label { font-size: 11px; font-weight: 600; letter-spacing: .4px; color: #6B7280; text-transform: uppercase; }
.cc-ui-about-value { font-size: 15px; color: #F1F3F6; font-family: "Inter", sans-serif; word-break: break-word; }
.cc-ui-about-row .cc-ui-chev { color: #6B7280; font-size: 18px; flex-shrink: 0; }

/* ── 9. privacy & security ── */
.cc-ui-e2e-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: #071223; cursor: pointer; }
.cc-ui-e2e-ic { width: 52px; height: 52px; border-radius: 50%; background: #0DA2E7; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; flex-shrink: 0; }
.cc-ui-e2e-body { flex: 1; min-width: 0; }
.cc-ui-e2e-title { font-size: 14px; font-weight: 700; color: #F1F3F6; }
.cc-ui-e2e-sub { font-size: 12px; line-height: 1.4; color: #6B7280; margin-top: 4px; }
.cc-ui-e2e-link { display: flex; align-items: center; gap: 3px; color: #0DA2E7; font-size: 13px; font-weight: 600; margin-top: 8px; }

/* ── 10. secret chat / starred ── */
.cc-ui-star-red {
  width: 46px; height: 46px; border-radius: 14px; background: #3A2F0A;
  display: flex; align-items: center; justify-content: center; color: #FFC107; font-size: 24px; flex-shrink: 0;
}
.cc-ui-list-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: #071223; cursor: pointer; }
.cc-ui-list-card:hover { background: #0D1B2E; }
.cc-ui-list-title { font-size: 14px; font-weight: 600; color: #F1F3F6; }
.cc-ui-list-sub { font-size: 12px; color: #6B7280; margin-top: 3px; }
.cc-ui-list-chev { color: #6B7280; font-size: 20px; flex-shrink: 0; }

/* ── 11. preserve replies + chat settings rows ── */
.cc-ui-rows-card { border-radius: 18px; background: #071223; overflow: hidden; }
.cc-ui-row { display: flex; align-items: center; gap: 14px; padding: 14px; cursor: pointer; transition: background var(--cc-anim-speed); }
.cc-ui-row:hover { background: #0D1B2E; }
.cc-ui-row + .cc-ui-row { border-top: 1px solid #0E1C30; }
.cc-ui-row-ic {
  width: 40px; height: 40px; border-radius: 50%; background: #0D1B2E;
  display: flex; align-items: center; justify-content: center; color: #0DA2E7; font-size: 20px; flex-shrink: 0;
}
.cc-ui-row-label { flex: 1; font-size: 15px; color: #F1F3F6; font-family: "Inter", sans-serif; }
.cc-ui-row-right { font-size: 13px; color: #6B7280; }
.cc-ui-toggle {
  position: relative; width: 40px; height: 24px; border-radius: 24px;
  background: #6B7280; border: none; cursor: pointer; flex-shrink: 0;
  transition: background .18s; padding: 0;
}
.cc-ui-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .18s;
}
.cc-ui-toggle.on { background: #0DA2E7; }
.cc-ui-toggle.on::after { transform: translateX(16px); }

/* ── 13. safety ── */
.cc-ui-safety-card { border-radius: 18px; background: #120808; border: 1px solid #3A1010; overflow: hidden; }
.cc-ui-danger-row { display: flex; align-items: center; gap: 14px; padding: 14px; cursor: pointer; transition: background var(--cc-anim-speed); color: #EF4444; }
.cc-ui-danger-row:hover { background: rgba(239,68,68,.06); }
.cc-ui-danger-row + .cc-ui-danger-row { border-top: 1px solid #3A1010; }
.cc-ui-danger-ic {
  width: 40px; height: 40px; border-radius: 50%; background: #2A0A0A;
  display: flex; align-items: center; justify-content: center; color: #EF4444; font-size: 20px; flex-shrink: 0;
}
.cc-ui-danger-label { flex: 1; font-size: 15px; font-family: "Inter", sans-serif; }
.cc-ui-danger-chev { color: #EF4444; font-size: 20px; }

/* ── Shared media modal (tabs) ── */
.cc-ui-modal-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--cc-border); padding: 8px 12px; }
.cc-ui-mtab {
  padding: 7px 14px; border-radius: 30px; border: 1px solid var(--cc-border);
  background: var(--cc-surface-2); color: var(--cc-text-2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.cc-ui-mtab.active { background: var(--cc-accent); border-color: var(--cc-accent); color: #fff; }
.cc-ui-mtab-body { max-height: 470px; overflow-y: auto; }
.cc-ui-empty { padding: 44px 20px; text-align: center; color: var(--cc-text-3); font-size: 13.5px; }

/* shimmer (loading) */
@keyframes cc-ui-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.cc-ui-shimmer-block {
  border-radius: 14px; background: linear-gradient(90deg, #071223 25%, #0D1B2E 37%, #071223 63%);
  background-size: 800px 100%; animation: cc-ui-shimmer 1.2s infinite linear;
}

/* scrollable modal body fix */
.cc-ui-mtab-body { max-height: 470px; }
.cc-ui-mtab-body .cc-modal-body { max-height: none; }

/* =========================================================================
   CHAT HEADER 3-DOT MENU  (App floating_bubble_menu.dart 1:1)
   bg #0C121D, radius 25, padding 20, gap 8, 18px icon + 13.5px label
   ========================================================================= */
.cc-hm-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 2000; }

.cc-hm-menu {
  position: fixed; z-index: 2001;
  background: #0C121D;
  border-radius: 25px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  min-width: 160px;
  max-width: 200px;
  transform-origin: top right;
  animation: cc-hm-in 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes cc-hm-in {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

.cc-hm-item { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.cc-hm-item + .cc-hm-item { margin-top: 8px; }

.cc-hm-icon {
  width: 18px; height: 18px; flex: 0 0 18px;
  background: #fff;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center;  mask-position: center;
  -webkit-mask-size: contain;     mask-size: contain;
}
.cc-hm-item.danger .cc-hm-icon { background: #fff; }

.cc-hm-label {
  font-size: 13.5px; font-weight: 400; color: #fff; line-height: 1.2;
  white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.cc-hm-item.danger .cc-hm-label { color: #fff; }
.cc-hm-item:hover .cc-hm-label { opacity: 0.85; }

/* ── Message long-press / right-click bubble (app message_context_menu) ── */
.cc-mb-menu { min-width: 187px; max-width: 220px; }

.cc-mb-emoji {
  position: fixed; z-index: 2001;
  display: flex; align-items: center;
  background: #0C121D;
  border-radius: 27px;
  padding: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  animation: cc-hm-in 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.cc-mb-emoji-item {
  width: 40px; height: 40px;
  border: none; background: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.cc-mb-emoji-item:hover { background: #0D1B2E; }
.cc-mb-emoji-more {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  width: 48px; height: 48px;
  border: none; background: transparent;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  color: #8A94A6; font-size: 11px;
  cursor: pointer;
}
.cc-mb-emoji-more i { font-size: 16px; color: rgba(255, 255, 255, 0.75); }

.cc-mb-item-ic {
  font-size: 18px; width: 18px; flex: 0 0 18px;
  text-align: center;
  color: #fff;
}
.cc-hm-item.danger .cc-mb-item-ic { color: #EF4444; }

/* ── Edit Profile full-screen screen (app edit_profile_screen.dart) ─────── */
.cc-ep-overlay {
  position: fixed; inset: 0; z-index: 2100;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
}
.cc-ep-shell {
  width: 100%; height: 100%;
  max-width: 560px;
  background: #0A0F1E;
  display: flex; flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: cc-hm-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.cc-ep-appbar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px;
  background: #0A0F1E;
  border-bottom: 1px solid #1F2937;
}
.cc-ep-back {
  width: 40px; height: 40px; border: none; background: transparent;
  color: #fff; font-size: 20px; cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cc-ep-back:hover { background: rgba(255, 255, 255, 0.06); }
.cc-ep-titles { display: flex; flex-direction: column; gap: 1px; }
.cc-ep-title    { color: #fff; font-size: 18px; font-weight: 700; }
.cc-ep-subtitle { color: #9CA3AF; font-size: 12px; }
.cc-ep-body { flex: 1; overflow-y: auto; }
.cc-ep-inner {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 20px 20px 30px;
  box-sizing: border-box;
}

/* Avatar card */
.cc-ep-avatar-card {
  background: #111827; border-radius: 16px;
  padding: 24px 16px;
  display: flex; flex-direction: column; align-items: center;
}
.cc-ep-avatar-wrap { position: relative; }
.cc-ep-avatar {
  width: 90px; height: 90px; border-radius: 50%; overflow: hidden;
  background: rgba(13, 162, 231, 0.3);
  display: flex; align-items: center; justify-content: center;
}
.cc-ep-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cc-ep-initials {
  color: #fff; font-weight: 700; font-size: 26px;
  width: 100%; height: 100%;
  background: #1B4F72; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cc-ep-camera-badge {
  position: absolute; bottom: 2px; right: 2px;
  width: 32px; height: 32px; border-radius: 50%;
  background: #0DA2E7; border: 2px solid #0A0F1E;
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px;
}
.cc-ep-camera-badge:hover { background: #3cb8f0; }
.cc-ep-photo-row {
  display: flex; gap: 10px; margin-top: 16px;
  align-items: center; justify-content: center; flex-wrap: wrap;
}
.cc-ep-change, .cc-ep-remove {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; border-radius: 20px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 0 16px;
}
.cc-ep-change {
  border: none; background: #0DA2E7; color: #fff;
}
.cc-ep-change:hover { background: #3cb8f0; }
.cc-ep-remove {
  border: 1px solid #1F2937; background: transparent; color: #9CA3AF;
}
.cc-ep-remove:hover { background: rgba(255, 255, 255, 0.04); }
.cc-ep-remove.disabled, .cc-ep-remove:disabled {
  opacity: 0.4; cursor: default;
}

/* Labels / sections */
.cc-ep-section-label {
  color: #9CA3AF; font-size: 11px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  margin: 26px 0 10px;
}
.cc-ep-field-label { color: #9CA3AF; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.cc-ep-gap14 { height: 14px; }
.cc-ep-gap16 { height: 16px; }
.cc-ep-gap28 { height: 28px; }
.cc-ep-gap8  { height: 8px; }

/* Inputs */
.cc-ep-field {
  background: #1C2433; border-radius: 12px;
  overflow: hidden;
}
.cc-ep-field:focus-within { box-shadow: 0 0 0 1.5px #0DA2E7; }
.cc-ep-input {
  width: 100%; box-sizing: border-box;
  background: transparent; border: none; outline: none;
  padding: 14px 16px;
  color: #fff; font-size: 15px;
}
.cc-ep-input::placeholder { color: #4B5563; }
.cc-ep-input.disabled { color: #9CA3AF; }
.cc-ep-bio { resize: none; font-family: inherit; line-height: 1.45; }
.cc-ep-bio-field { display: flex; }
.cc-ep-bio-count { text-align: right; color: #9CA3AF; font-size: 11px; margin-top: 4px; }

/* DOB field */
.cc-ep-dob-row {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  background: #1C2433; border-radius: 12px;
  padding: 14px 16px; cursor: pointer;
  overflow: hidden;
}
.cc-ep-dob-icon { color: #9CA3AF; font-size: 17px; }
.cc-ep-dob-row:has(.cc-ep-dob-text.set) .cc-ep-dob-icon { color: #0DA2E7; }
.cc-ep-dob-text { color: #9CA3AF; font-size: 15px; flex: 1; }
.cc-ep-dob-text.set { color: #fff; }
.cc-ep-dob-caret { color: #9CA3AF; font-size: 16px; }
.cc-ep-dob-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; pointer-events: none;
}

/* Info notes */
.cc-ep-note {
  display: flex; align-items: flex-start; gap: 6px;
  margin-top: 6px;
  color: #9CA3AF; font-size: 12px; line-height: 1.45;
}
.cc-ep-note i { font-size: 13px; margin-top: 1px; }
.cc-ep-privacy-note {
  display: flex; align-items: flex-start; gap: 8px;
  background: #111827; border-radius: 12px;
  padding: 14px;
  color: #9CA3AF; font-size: 12px; line-height: 1.5;
}
.cc-ep-privacy-note i { color: #0DA2E7; font-size: 16px; margin-top: 1px; }

/* Gender grid */
.cc-ep-gender-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.cc-ep-gender {
  height: 44px; border-radius: 12px;
  border: 1.5px solid transparent; background: #1C2433;
  color: #9CA3AF; font-size: 14px; cursor: pointer;
  transition: all 0.15s;
}
.cc-ep-gender:hover { background: #222c3f; }
.cc-ep-gender.sel {
  background: rgba(13, 162, 231, 0.15);
  border-color: #0DA2E7; color: #0DA2E7; font-weight: 600;
}

/* Footer bar */
.cc-ep-footer {
  flex-shrink: 0;
  display: flex; gap: 12px;
  padding: 12px 16px;
  background: #0A0F1E;
  border-top: 1px solid #1F2937;
}
.cc-ep-cancel, .cc-ep-save {
  height: 50px; border-radius: 30px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.cc-ep-cancel {
  flex: 1;
  background: transparent; border: 1.5px solid #1F2937; color: #9CA3AF;
}
.cc-ep-cancel:hover { background: rgba(255, 255, 255, 0.04); }
.cc-ep-save {
  flex: 2;
  border: none; background: #0DA2E7; color: #fff; font-weight: 700;
}
.cc-ep-save:hover:not(:disabled) { background: #3cb8f0; }
.cc-ep-save:disabled { background: rgba(13, 162, 231, 0.5); cursor: default; }
.cc-ep-save.loading span { opacity: 0.5; }

@media (max-width: 600px) {
  .cc-ep-overlay { align-items: stretch; }
  .cc-ep-shell { box-shadow: none; }
}

/* ── Call overlay (WebRTC — WhatsApp Web style) ─────────────────────────── */
.cc-call-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, #0e1930 0%, #04070f 70%);
  color: #fff; overflow: hidden;
}
.cc-call-video-wrap {
  position: absolute; inset: 0; display: none;
}
.cc-call-video-wrap.visible { display: block; }
.cc-call-video-remote {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #000;
}
.cc-call-video-local {
  position: absolute; top: 18px; right: 18px;
  width: 122px; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.25);
  background: #000; z-index: 5;
}
.cc-call-avatar-layer {
  position: relative; z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 0 24px; text-align: center; max-width: 92vw;
}
.cc-call-avatar-layer.video { opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.cc-call-avatar .cc-avatar {
  width: 150px; height: 150px; font-size: 52px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.cc-call-name { font-size: 22px; font-weight: 600; }
.cc-call-status { font-size: 14px; color: rgba(255, 255, 255, 0.66); }
.cc-call-duration { font-size: 56px; font-weight: 300; font-variant-numeric: tabular-nums; margin-top: 10px; }
.cc-call-controls {
  position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%);
  z-index: 6; display: flex; gap: 22px; align-items: center;
}
.cc-call-ctl {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; width: 82px; height: 84px;
  border: none; border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff; font-size: 13px; cursor: pointer;
  transition: background 0.15s;
}
.cc-call-ctl i { font-size: 26px; }
.cc-call-ctl span { font-size: 12.5px; opacity: 0.9; }
.cc-call-ctl:hover { background: rgba(255, 255, 255, 0.16); }
.cc-call-ctl.active { background: rgba(13, 162, 231, 0.3); }
.cc-call-ctl.danger { background: #EA3B4B; width: 92px; height: 96px; border-radius: 50%; }
.cc-call-ctl.danger:hover { background: #e55a66; }
.cc-call-ctl.success { background: #23D36B; width: 92px; height: 96px; border-radius: 50%; }
.cc-call-ctl.success:hover { background: #35e67f; }
.cc-call-close {
  position: fixed; top: 18px; right: 18px; z-index: 7;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.1);
  color: #fff; font-size: 18px; cursor: pointer;
}
.cc-call-close:hover { background: rgba(255, 255, 255, 0.2); }
.cc-call-audio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
@media (max-width: 640px) {
  .cc-call-ctl { width: 70px; height: 72px; }
  .cc-call-ctl.danger, .cc-call-ctl.success { width: 80px; height: 84px; }
  .cc-call-video-local { width: 92px; }
  .cc-call-controls { gap: 14px; }
}

/* =========================================================================
   STORIES
   ========================================================================= */
.cc-modal-wide { width: 760px; max-width: 94vw; }

/* ── Avatar ring ───────────────────────────────────────────────────────── */
.cc-story-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  position: relative; display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--cc-surface-3); overflow: hidden;
  flex-shrink: 0;
}
.cc-story-avatar img, .cc-story-avatar-initials {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 18px; color: #fff;
}
.cc-story-avatar.ring { padding: 3px; background: #3a4354; }
.cc-story-avatar.ring img, .cc-story-avatar.ring .cc-story-avatar-initials { border: 3px solid var(--cc-bg); }
.cc-story-avatar.ring.unviewed {
  background: conic-gradient(from 0deg, #37b6f0, #7f65c8, #ec4e86, #f59e0b, #37b6f0);
}
.cc-story-avatar.viewer { width: 42px; height: 42px; }
.cc-story-avatar.viewer .cc-story-avatar-initials { font-size: 15px; }

/* ── Contacts: "Add New Story" tile ───────────────────────────────────── */
.cc-story-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin: 10px 12px 0;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-border); border-radius: 14px;
  cursor: pointer; transition: background .14s;
}
.cc-story-tile:hover { background: var(--cc-surface-3); }
.cc-story-tile-ico {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--cc-accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.cc-story-tile-txt { display: flex; flex-direction: column; line-height: 1.3; }
.cc-story-tile-txt b { font-size: 14px; color: var(--cc-text); }
.cc-story-tile-txt small { font-size: 12px; color: var(--cc-text-3); }

/* ── Contacts: story tray ─────────────────────────────────────────────── */
.cc-story-tray {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px 0;
}
.cc-story-tray-scroll {
  display: flex; gap: 8px; overflow-x: auto; flex: 1;
  scrollbar-width: none;
}
.cc-story-tray-scroll::-webkit-scrollbar { display: none; }
.cc-story-tray-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  min-width: 66px; padding: 6px 4px;
  background: none; border: none; cursor: pointer;
}
.cc-story-tray-name {
  max-width: 66px; font-size: 10.5px; color: var(--cc-text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-story-tray-view {
  flex-shrink: 0; padding: 6px 12px;
  background: var(--cc-accent); color: #fff;
  border: none; border-radius: 16px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .14s;
}
.cc-story-tray-view:hover { background: var(--cc-accent-hover); }
.cc-story-tray-loading {
  display: flex; align-items: center; justify-content: center;
  height: 74px; flex: 1;
}

/* ── Story composer (source picker) ───────────────────────────────────── */
.cc-story-sources { display: flex; flex-direction: column; gap: 9px; }
.cc-story-source-tile {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 14px; width: 100%;
  background: var(--cc-surface-3); color: var(--cc-text);
  border: 1px solid var(--cc-border); border-radius: 13px;
  cursor: pointer; text-align: left; transition: background .14s;
  font-family: inherit;
}
.cc-story-source-tile:hover { background: var(--cc-surface-4); }
.cc-story-source-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(13,162,231,.16); color: var(--cc-accent);
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  flex-shrink: 0;
}
.cc-story-source-txt { display: flex; flex-direction: column; line-height: 1.3; flex: 1; }
.cc-story-source-txt b { font-size: 14px; }
.cc-story-source-txt small { font-size: 12px; color: var(--cc-text-3); }
.cc-story-source-arrow { color: var(--cc-text-3); }

/* ── Media composer ───────────────────────────────────────────────────── */
.cc-story-composer { display: flex; gap: 18px; flex-wrap: wrap; }
.cc-story-composer-media { flex: 1 1 300px; min-height: 220px; display: flex; align-items: center; justify-content: center; }
.cc-story-preview-el {
  max-width: 100%; max-height: 400px; border-radius: 12px;
  object-fit: contain; background: #000;
}
.cc-story-composer-fields { flex: 1 1 260px; display: flex; flex-direction: column; justify-content: center; }

/* ── Text composer ────────────────────────────────────────────────────── */
.cc-story-text-composer { display: flex; flex-direction: column; gap: 12px; }
.cc-story-textarea {
  width: 100%; min-height: 170px;
  border: none; border-radius: 14px; padding: 20px;
  font-size: 21px; font-weight: 600; color: #fff; resize: none;
  outline: none; font-family: inherit; line-height: 1.4;
  background: #0DA2E7;
}
.cc-story-textarea::placeholder { color: rgba(255,255,255,.72); }
.cc-story-color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-story-color {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; transition: transform .12s;
}
.cc-story-color:hover { transform: scale(1.12); }
.cc-story-color.active { border-color: #fff; box-shadow: 0 0 0 2px var(--cc-accent); }

/* ── Story feed (modal) ───────────────────────────────────────────────── */
.cc-story-feed-loading { display: flex; flex-direction: column; align-items: center; padding: 44px 0; }
.cc-story-own-card {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 14px; border: 1px solid var(--cc-border);
  border-radius: 14px; cursor: pointer; background: var(--cc-surface-2);
  transition: background .14s;
}
.cc-story-own-card:hover { background: var(--cc-surface-3); }
.cc-story-own-info { display: flex; flex-direction: column; flex: 1; line-height: 1.35; }
.cc-story-own-info b { font-size: 14.5px; color: var(--cc-text); }
.cc-story-own-info small { font-size: 12px; color: var(--cc-text-3); }
.cc-story-own-add {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--cc-accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  flex-shrink: 0;
}
.cc-story-feed-sec { margin-top: 18px; }
.cc-story-feed-sec-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .4px; color: var(--cc-text-3); margin-bottom: 10px;
}
.cc-story-users { display: flex; gap: 14px; flex-wrap: wrap; }
.cc-story-user {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 80px; cursor: pointer; background: none; border: none; padding: 0;
  font-family: inherit;
}
.cc-story-user-name {
  font-size: 11.5px; color: var(--cc-text-2); max-width: 80px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-story-feed-empty { text-align: center; color: var(--cc-text-3); padding: 26px 0; font-size: 13px; }

/* ── My story list ────────────────────────────────────────────────────── */
.cc-story-mine-list { display: flex; flex-direction: column; gap: 8px; }
.cc-story-mine {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 11px; border: 1px solid var(--cc-border);
  border-radius: 12px; cursor: pointer; background: var(--cc-surface-2);
  transition: background .14s;
}
.cc-story-mine:hover { background: var(--cc-surface-3); }
.cc-story-mine-thumb {
  width: 46px; height: 46px; border-radius: 10px; overflow: hidden;
  background: var(--cc-surface-3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cc-story-mine-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cc-story-mine-text { color: #fff; font-size: 20px; }
.cc-story-mine-info { flex: 1; display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.cc-story-mine-info b { font-size: 13.5px; color: var(--cc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-story-mine-info small { font-size: 12px; color: var(--cc-text-3); }
.cc-story-mine-views { font-size: 12px; color: var(--cc-text-2); display: flex; align-items: center; gap: 5px; }
.cc-story-mine-del {
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: transparent; color: var(--cc-text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  transition: background .14s, color .14s; flex-shrink: 0;
}
.cc-story-mine-del:hover { background: rgba(220,38,38,.14); color: var(--cc-danger); }

/* ── Story viewer (full screen) ───────────────────────────────────────── */
.cc-story-viewer {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(4, 8, 20, 0.94);
  display: flex; align-items: center; justify-content: center;
  animation: cc-fade-in .18s ease;
}
@keyframes cc-fade-in { from { opacity: 0; } to { opacity: 1; } }
.cc-story-viewer-stage {
  position: relative; width: min(440px, 92vw); height: min(820px, 92vh);
  background: #000; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column;
  user-select: none; -webkit-user-select: none;
}
.cc-story-viewer-progress { display: flex; gap: 4px; padding: 10px 12px 4px; flex-shrink: 0; }
.cc-story-prog {
  flex: 1; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.24); position: relative; overflow: hidden;
}
.cc-story-prog.done { background: rgba(255,255,255,.85); }
.cc-story-prog.current { background: rgba(255,255,255,.24); }
.cc-story-prog.current::after {
  content: ''; position: absolute; inset: 0;
  background: #fff; transform-origin: left;
  animation: cc-story-progress 5s linear forwards;
}
@keyframes cc-story-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.cc-story-viewer-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px 6px 14px; flex-shrink: 0;
}
.cc-story-viewer-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cc-story-viewer-id { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.cc-story-viewer-id b { font-size: 13.5px; color: #fff; }
.cc-story-viewer-id small { font-size: 11px; color: rgba(255,255,255,.6); }
.cc-story-viewer-close {
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  flex-shrink: 0;
}
.cc-story-viewer-close:hover { background: rgba(255,255,255,.2); }
.cc-story-viewer-media { flex: 1; position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; }
.cc-story-viewer-photo { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.cc-story-viewer-photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cc-story-viewer-video-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.cc-story-video { max-width: 100%; max-height: 100%; }
.cc-story-viewer-text {
  width: 100%; height: 100%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 34px; font-size: 24px; font-weight: 600;
  line-height: 1.45; word-break: break-word;
}
.cc-story-lost { color: rgba(255,255,255,.7); font-size: 13px; padding: 30px; text-align: center; }
.cc-story-viewer-caption {
  padding: 6px 24px 2px; color: rgba(255,255,255,.88); font-size: 13.5px;
  text-align: center; word-break: break-word;
}
.cc-story-viewer-bottom {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px 16px; flex-shrink: 0;
}
.cc-story-viewer-reply {
  flex: 1; padding: 8px 14px; border-radius: 18px;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.85);
  font-size: 13px; cursor: pointer; user-select: none;
}
.cc-story-viewer-react {
  width: 38px; height: 38px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #ec4e86; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  flex-shrink: 0;
}
.cc-story-viewer-react:hover { background: rgba(255,255,255,.2); }
.cc-story-viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 46px; border: none; background: rgba(255,255,255,.08);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 16px; transition: background .14s;
  z-index: 3;
}
.cc-story-viewer-nav:hover { background: rgba(255,255,255,.2); }
.cc-story-viewer-nav.left { left: 8px; }
.cc-story-viewer-nav.right { right: 8px; }

/* ── Story reactions ──────────────────────────────────────────────────── */

.cc-story-reactions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cc-story-reaction {
  width: 52px; height: 52px; font-size: 24px;
  background: var(--cc-surface-3); border: 1px solid var(--cc-border);
  border-radius: 14px; cursor: pointer; transition: transform .12s, background .14s;
}
.cc-story-reaction:hover { transform: scale(1.12); background: var(--cc-surface-4); }
