/* ==========================================================================
   CARBON // IM — 200% Scaled Proton Carbon Dark + Zano Privacy Suite Stylesheet
   - All buttons, fonts, and text scaled 200% bigger
   - Random 16-bit pixelated <canvas> avatars everywhere
   - Group chat auto-delete locked at 1h
   - Full Zano.fun/chat Privacy Bar, 9-Section Privacy FAQ & Pixelation Wave Nuke
   ========================================================================== */

:root,
body[data-theme="carbon"] {
  --bg-app: #121017;
  --bg-sidebar: #16141d;
  --bg-main: #181621;
  --bg-drawer: #15131c;
  --bg-card: #201d2b;
  --bg-card-hover: #282437;
  --bg-input: #23202e;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-active: rgba(109, 74, 255, 0.20);
  --bg-active-pill: #2c2740;

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text-primary: #f5f4f8;
  --text-secondary: #bdb8ce;
  --text-muted: #857f99;

  --accent: #6d4aff;
  --accent-hover: #7e5fff;
  --accent-active: #5a37eb;
  --accent-soft: rgba(109, 74, 255, 0.18);
  --accent-text: #a892ff;

  --status-online: #2ec27e;
  --status-away: #f5a623;
  --status-offline: #6e6a80;
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, 0.18);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --row-py: 18px;
}

body[data-theme="midnight"] {
  --bg-app: #0c101d;
  --bg-sidebar: #101626;
  --bg-main: #131a2c;
  --bg-drawer: #101626;
  --bg-card: #192238;
  --bg-input: #1b253d;
  --accent: #4c6ef5;
  --accent-hover: #5c7cfa;
  --accent-text: #84a0ff;
}

body[data-theme="obsidian"] {
  --bg-app: #050507;
  --bg-sidebar: #0a0a0e;
  --bg-main: #0d0d12;
  --bg-drawer: #0a0a0e;
  --bg-card: #15151d;
  --bg-input: #171720;
  --accent: #7c5cff;
  --accent-hover: #8f73ff;
}

body[data-theme="slate"] {
  --bg-app: #181a1f;
  --bg-sidebar: #1e2127;
  --bg-main: #22252c;
  --bg-drawer: #1e2127;
  --bg-card: #282c34;
  --bg-input: #2b303a;
  --accent: #6366f1;
  --accent-hover: #818cf8;
}

body[data-theme="snow"] {
  --bg-app: #f4f3f8;
  --bg-sidebar: #eceaf3;
  --bg-main: #ffffff;
  --bg-drawer: #f6f5fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f2f0f9;
  --bg-input: #eae8f2;
  --bg-hover: rgba(0, 0, 0, 0.045);
  --bg-active: rgba(109, 74, 255, 0.12);
  --bg-active-pill: #e2ddf5;
  --border-subtle: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text-primary: #191724;
  --text-secondary: #4a4659;
  --text-muted: #726d85;
  --accent: #6d4aff;
  --accent-hover: #5b3ae6;
  --accent-text: #5b3ae6;
}

body[data-theme="classic"] {
  --bg-app: #141c24;
  --bg-sidebar: #18232d;
  --bg-main: #1c2833;
  --bg-drawer: #18232d;
  --bg-card: #233240;
  --bg-input: #263747;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-text: #7dd3fc;
}

body[data-density="compact"] {
  --row-py: 12px;
}

/* ==========================================================================
   BASE RESET & 200% SCALED TYPOGRAPHY
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 26px; /* 200% bigger base font (was 13px) */
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  transition: transform 0.14s cubic-bezier(0.22, 1.2, 0.36, 1), background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

button:active {
  transform: scale(0.95);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.30);
}

#app-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100dvh;
  background: var(--bg-app);
}

/* ==========================================================================
   1. TOP HEADER BAR (200% Scaled)
   ========================================================================== */

#top-header {
  height: 86px;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  gap: 20px;
  z-index: 40;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b6eff 0%, #5835e8 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 26px;
  box-shadow: 0 4px 14px rgba(109, 74, 255, 0.4);
  flex-shrink: 0;
}

.brand-logo svg {
  width: 28px;
  height: 28px;
}

.brand-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
}

.header-search-wrap {
  flex: 1;
  max-width: 480px;
  margin-right: auto;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  pointer-events: none;
  display: inline-flex;
}

.search-icon svg {
  width: 24px;
  height: 24px;
}

#search-input {
  width: 100%;
  height: 56px;
  padding: 0 18px 0 50px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 23px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

#search-input::placeholder {
  color: var(--text-muted);
}

#search-input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
}

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

.icon-btn {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
}

.icon-btn svg {
  width: 28px;
  height: 28px;
}

.icon-btn:hover,
.icon-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent);
}

.random-face-btn {
  height: 56px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 21px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.random-face-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #ffffff;
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 12px 6px 16px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
}

.user-profile-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.user-profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.user-profile-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-profile-sub {
  font-size: 18px;
  font-family: var(--font-mono);
  color: var(--accent-text);
}

.monogram-badge {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #14111d;
  border: 2px solid var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.monogram-badge canvas {
  width: 48px !important;
  height: 48px !important;
  image-rendering: pixelated;
}

/* ==========================================================================
   2. MAIN WORKSPACE ROW (Sidebar + Main View + Settings Drawer + Right Rail)
   ========================================================================== */

#workspace-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Left Sidebar */
#left-sidebar {
  width: 330px;
  min-width: 330px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  gap: 16px;
  user-select: none;
  z-index: 30;
}

.btn-primary-cta {
  width: 100%;
  min-height: 62px;
  padding: 10px 20px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(109, 74, 255, 0.32);
}

.btn-primary-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary-outline {
  width: 100%;
  min-height: 58px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-secondary-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.nav-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mini-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 22px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mini-icon-btn:hover {
  background: var(--danger-soft);
  color: #ff8589;
  border-color: var(--danger);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  min-height: 58px;
  border-radius: 12px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 23px;
  font-weight: 600;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.is-active {
  background: var(--bg-active-pill);
  border-color: rgba(109, 74, 255, 0.45);
  color: var(--text-primary);
  font-weight: 700;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.nav-item-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #13101c;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.nav-item-avatar canvas {
  width: 34px !important;
  height: 34px !important;
  image-rendering: pixelated;
}

.nav-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-badge {
  font-size: 18px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9px;
  background: var(--accent);
  color: #ffffff;
  flex-shrink: 0;
}

.nav-badge.muted {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online { background: var(--status-online); box-shadow: 0 0 8px var(--status-online); }
.status-dot.away { background: var(--status-away); }
.status-dot.offline { background: var(--status-offline); }

.empty-buddies-note {
  padding: 12px 12px;
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1.4;
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 18px;
  color: var(--text-muted);
}

.sidebar-footer-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.sidebar-footer-fill {
  width: 50%;
  height: 100%;
  background: var(--accent);
}

.sidebar-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

/* ==========================================================================
   3. CENTER CONVERSATION PANE & ZANO PRIVACY BAR (200% Scaled)
   ========================================================================== */

#main-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-main);
}

/* Conversation Toolbar */
#conv-header {
  min-height: 82px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.conv-title-area {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-wrap: wrap;
}

#active-room-name {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}

.e2ee-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 19px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid rgba(109, 74, 255, 0.35);
  white-space: nowrap;
}

.e2ee-pill.badge-public {
  background: rgba(46, 194, 126, 0.14);
  color: #5ce6a0;
  border-color: rgba(46, 194, 126, 0.35);
}

.locked-ttl-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 19px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 10px;
  background: rgba(245, 166, 35, 0.16);
  color: #ffc46b;
  border: 1px solid rgba(245, 166, 35, 0.4);
  white-space: nowrap;
}

#room-topic-text {
  font-size: 20px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-pill-btn,
.toolbar-select {
  height: 52px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 21px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
}

.toolbar-pill-btn:hover,
.toolbar-select:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.toolbar-pill-btn.privacy-pill-btn {
  background: rgba(109, 74, 255, 0.16);
  border-color: rgba(109, 74, 255, 0.48);
  color: #c7b8ff;
}

.toolbar-pill-btn.nuke-pill-btn {
  background: rgba(229, 72, 77, 0.20);
  border-color: rgba(229, 72, 77, 0.65);
  color: #ff9ea2;
  box-shadow: 0 0 14px rgba(229, 72, 77, 0.25);
}

.toolbar-pill-btn.nuke-pill-btn:hover {
  background: #e5484d;
  color: #ffffff;
  box-shadow: 0 0 24px rgba(229, 72, 77, 0.65);
  transform: scale(1.04);
}

/* Zano.fun/chat Channel Info & Privacy Strip */
#channel-privacy-strip {
  margin: 8px 20px 2px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(32, 29, 43, 0.85);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 18px;
}

.privacy-strip-facts {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--text-secondary);
}

.privacy-fact-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.privacy-fact-item strong {
  color: var(--text-primary);
  font-weight: 700;
}

.privacy-how-link {
  flex-shrink: 0;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
  color: #ffffff;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.privacy-how-link:hover {
  background: var(--accent);
}

/* Offline Message Queue Banner (from zano.fun/chat) */
#offline-queue-banner {
  margin: 6px 20px 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(245, 166, 35, 0.16);
  border: 1px solid rgba(245, 166, 35, 0.4);
  color: #ffd085;
  font-size: 20px;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Away Banner inside DM */
#dm-away-notice {
  margin: 8px 20px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(245, 166, 35, 0.14);
  border: 1px solid rgba(245, 166, 35, 0.35);
  color: #f7b955;
  font-size: 22px;
  display: none;
  align-items: center;
  gap: 10px;
}

/* Message Stream */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Empty Conversation State */
.conv-empty-state {
  margin: auto;
  text-align: center;
  max-width: 580px;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
}

.conv-empty-illustration {
  width: 136px;
  height: 114px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.conv-empty-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
}

.conv-empty-sub {
  font-size: 22px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Message Rows (200% Scaled + 56x56 Pixelated Avatar) */
.chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: var(--row-py) 24px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease, transform 0.15s ease;
  animation: rj-msg-bounce-in 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.18);
}

.chat-msg-row:hover {
  background: var(--bg-hover);
}

.chat-msg-row.system-msg {
  padding: 14px 24px;
  color: var(--accent-text);
  font-size: 22px;
  font-weight: 600;
  background: rgba(109, 74, 255, 0.07);
}

.chat-msg-row.burn-msg {
  background: rgba(229, 72, 77, 0.10);
  border-left: 5px solid var(--danger);
}

.msg-avatar-badge {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: #13101d;
  border: 2px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.msg-avatar-badge canvas {
  width: 52px !important;
  height: 52px !important;
  image-rendering: pixelated;
}

.msg-content-col {
  flex: 1;
  min-width: 0;
}

.msg-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}

.msg-handle {
  font-weight: 800;
  font-size: 26px;
  color: var(--text-primary);
  cursor: pointer;
}

.msg-handle.is-self {
  color: var(--accent-text);
}

.msg-contact-tag {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 6px;
}

.msg-time {
  font-size: 20px;
  color: var(--text-muted);
  margin-left: auto;
}

.msg-ttl-pill {
  font-size: 18px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: #ff9ea2;
  font-family: var(--font-mono);
}

.msg-body {
  color: var(--text-primary);
  font-size: 28px; /* 200% bigger chat message text! */
  line-height: 1.45;
  word-break: break-word;
}

.msg-body canvas {
  width: 32px !important;
  height: 32px !important;
  vertical-align: middle;
  margin: 0 4px;
  image-rendering: pixelated;
}

.burn-fuse-bar {
  height: 6px;
  background: linear-gradient(90deg, var(--danger), #ff9f1c);
  border-radius: 3px;
  margin-top: 10px;
  transition: width 0.9s linear;
}

/* Typing Indicator & Emoticon Tray */
#typing-indicator-bar {
  min-height: 34px;
  padding: 4px 24px;
  font-size: 20px;
  color: var(--accent-text);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

#emoticon-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 22px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-subtle);
}

#emoticon-tray.tray-collapsed {
  display: none;
}

.emoticon-btn {
  width: 54px;
  height: 52px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.emoticon-btn canvas {
  width: 32px !important;
  height: 32px !important;
}

.emoticon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: scale(1.1);
}

/* Bottom Composer Bar (200% Scaled) */
#chat-form {
  margin: 6px 20px 18px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 2px solid var(--border-strong);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#chat-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

#chat-input {
  flex: 1;
  height: 60px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 26px; /* 200% bigger composer font */
  outline: none;
  padding: 0 8px;
  min-width: 120px;
}

#chat-input::placeholder {
  color: var(--text-muted);
}

#chat-char-counter {
  font-family: var(--font-mono);
  font-size: 19px;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0 6px;
}

.composer-burn-label {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  white-space: nowrap;
}

.composer-burn-label input[type="checkbox"] {
  width: 22px;
  height: 22px;
}

.composer-burn-label.is-visible {
  display: inline-flex;
}

.composer-burn-label.is-burn-on {
  background: var(--danger-soft);
  color: #ff9ea2;
  border-color: var(--danger);
}

#chat-send-btn {
  height: 60px;
  padding: 0 28px;
  border-radius: 13px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  font-size: 25px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(109, 74, 255, 0.35);
}

#chat-send-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   4. RIGHT SETTINGS DRAWER (200% Scaled + Zano Privacy Controls)
   ========================================================================== */

#settings-drawer {
  width: 430px;
  min-width: 430px;
  background: var(--bg-drawer);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 35;
}

#settings-drawer.drawer-closed {
  display: none;
}

.drawer-header {
  height: 76px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-label {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-subtext {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.35;
}

.info-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-text);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-link-select {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--accent-text);
  font-weight: 700;
  font-size: 20px;
  cursor: pointer;
  padding: 6px 12px;
  outline: none;
}

.settings-sublink {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

/* 200% Scaled Purple Pill Toggle Switch */
.pill-switch {
  appearance: none;
  -webkit-appearance: none;
  width: 72px;
  height: 40px;
  border-radius: 999px;
  background: #3d394d;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background 0.18s ease;
  flex-shrink: 0;
  margin: 0;
}

.pill-switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #b0abc2;
  transition: transform 0.18s ease, background 0.18s ease;
}

.pill-switch:checked {
  background: rgba(109, 74, 255, 0.42);
}

.pill-switch:checked::after {
  transform: translateX(32px);
  background: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6.2L5 8.6 9.5 3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.settings-radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  color: var(--text-secondary);
  cursor: pointer;
}

.settings-radio-row input[type="radio"] {
  width: 26px;
  height: 26px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Theme Swatch Grid */
.theme-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.theme-swatch-btn {
  height: 64px;
  border-radius: 12px;
  border: 2.5px solid var(--border-subtle);
  padding: 0;
  overflow: hidden;
  display: flex;
  cursor: pointer;
  background: transparent;
}

.theme-swatch-btn.is-selected {
  border-color: var(--accent-text);
  box-shadow: 0 0 0 2px var(--accent);
}

.swatch-left {
  width: 36%;
  height: 100%;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.swatch-pill {
  height: 6px;
  width: 75%;
  border-radius: 3px;
}

.swatch-line {
  height: 3px;
  width: 60%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
}

.swatch-right {
  flex: 1;
  height: 100%;
}

/* Sound Scheme Grid (Chicago, Glass, Abyss, Drift, Thock, Blip) */
.sound-scheme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sound-scheme-btn {
  height: 48px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}

.sound-scheme-btn.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #ffffff;
}

/* ==========================================================================
   5. FAR-RIGHT UTILITY ICON RAIL (200% Scaled)
   ========================================================================== */

#right-rail {
  width: 68px;
  min-width: 68px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 18px;
  z-index: 36;
}

.rail-btn {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 22px;
}

.rail-btn:hover,
.rail-btn.is-active {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ==========================================================================
   6. MODALS & ZANO 9-SECTION PRIVACY FAQ SHEET (200% Scaled)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 10, 0.74);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-backdrop.window-closed {
  display: none !important;
}

.carbon-modal {
  width: 100%;
  max-width: 720px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rj-window-pop-open 0.26s cubic-bezier(0.18, 0.89, 0.32, 1.18);
}

.carbon-modal.modal-wide {
  max-width: 920px;
}

.modal-header {
  padding: 20px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-body {
  padding: 22px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 82dvh;
  overflow-y: auto;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-secondary);
}

.carbon-input,
.carbon-select {
  height: 58px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 23px;
  outline: none;
}

.carbon-input:focus,
.carbon-select:focus {
  border-color: var(--accent);
}

/* Safety Number Grid & 10-Emoji Verification Strip */
#safety-emoji-strip {
  font-size: 36px;
  letter-spacing: 6px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-strong);
  text-align: center;
  user-select: all;
}

#safety-grid {
  display: grid;
  grid-template-columns: repeat(8, 30px);
  grid-template-rows: repeat(8, 30px);
  gap: 3px;
  background: #0d0c12;
  padding: 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  margin: 4px auto;
  width: fit-content;
}

.safety-cell {
  width: 30px;
  height: 30px;
  border-radius: 4px;
}

#safety-digits-box {
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 1.5px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-input);
  color: #58e698;
  text-align: center;
  line-height: 1.55;
  border: 1px solid var(--border-subtle);
}

/* Avatar Picker Grid in Profile Modal */
#avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.avatar-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: 14px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 19px;
  font-weight: 600;
  cursor: pointer;
}

.avatar-choice-btn canvas {
  width: 48px !important;
  height: 48px !important;
  image-rendering: pixelated;
}

.avatar-choice-btn.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text-primary);
  font-weight: 800;
}

/* Zano.fun/chat 9-Section Privacy FAQ Details Accordion */
.privacy-faq-details {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px 18px;
}

.privacy-faq-details summary {
  font-size: 23px;
  font-weight: 800;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.privacy-faq-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 21px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.privacy-badge-cant-see {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(46, 194, 126, 0.18);
  color: #5ce6a0;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  margin-right: 8px;
}

.privacy-badge-sees {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(245, 166, 35, 0.18);
  color: #ffc46b;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  margin-right: 8px;
}

.privacy-badge-limit {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(229, 72, 77, 0.18);
  color: #ff9ea2;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  margin-right: 8px;
}

/* ==========================================================================
   7. MOBILE RESPONSIVENESS
   ========================================================================== */

@media (max-width: 960px) {
  html, body {
    font-size: 22px;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .user-profile-meta,
  .header-search-wrap {
    display: none;
  }
  #left-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(340px, 88vw);
    min-width: 0;
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.65);
    transition: transform 0.22s ease;
  }
  #left-sidebar.mobile-hidden {
    transform: translateX(-105%);
  }
  #settings-drawer {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(420px, 94vw);
    min-width: 0;
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.65);
  }
  #right-rail {
    display: none;
  }
  #room-topic-text {
    display: none;
  }
  .msg-body {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
