/* ========================================
   Indika Chat — Dark Futuristic Theme System
   ======================================== */

/* ═══ THEME VARIABLES ═══ */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 8px;
  --transition: 150ms ease;
  --primary: #0A84FF;
  --primary-hover: #0070E0;
  --danger: #E01E5A;
}

/* Default theme — Dark Blue Futuristic */
[data-theme="default"], :root {
  --workspace-bg: #0A0E1A;
  --workspace-text: rgba(160,200,255,.85);
  --workspace-hover: rgba(80,160,255,.1);
  --workspace-active: #111833;
  --sidebar-bg: #0F1528;
  --sidebar-text: #B0C8E8;
  --sidebar-text-muted: rgba(160,190,230,.45);
  --sidebar-hover: rgba(80,160,255,.08);
  --sidebar-active: #0A84FF;
  --sidebar-active-text: #fff;
  --sidebar-border: rgba(80,130,200,.12);
  --main-bg: #0C1220;
  --main-text: #C8D8F0;
  --main-text-muted: #6B80A0;
  --main-header-bg: #0C1220;
  --main-header-border: rgba(80,130,200,.15);
  --input-bg: #131B2E;
  --input-border: rgba(80,130,200,.25);
  --input-text: #C8D8F0;
  --msg-hover: rgba(80,160,255,.04);
  --badge-bg: #E01E5A;
  --badge-text: #fff;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(80,130,200,.2);
}

[data-theme="aubergine"] {
  --workspace-bg: #3F0E40;
  --workspace-text: rgba(255,255,255,.8);
  --workspace-hover: rgba(255,255,255,.1);
  --workspace-active: #4A154B;
  --sidebar-bg: #3F0E40;
  --sidebar-text: #ccc;
  --sidebar-text-muted: rgba(255,255,255,.5);
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-active: #1264A3;
  --sidebar-active-text: #fff;
  --sidebar-border: rgba(255,255,255,.1);
  --main-bg: #222529;
  --main-text: #D1D2D3;
  --main-text-muted: #ABABAD;
  --main-header-bg: #222529;
  --main-header-border: #393B3F;
  --input-bg: #36383D;
  --input-border: #565856;
  --input-text: #D1D2D3;
  --msg-hover: rgba(255,255,255,.03);
  --badge-bg: #E01E5A;
  --badge-text: #fff;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(255,255,255,.15);
}

[data-theme="midnight"] {
  --workspace-bg: #0D1B2A;
  --workspace-text: rgba(180,210,240,.9);
  --workspace-hover: rgba(100,180,255,.08);
  --workspace-active: #1B263B;
  --sidebar-bg: #1B263B;
  --sidebar-text: #B4D2F0;
  --sidebar-text-muted: rgba(180,210,240,.45);
  --sidebar-hover: rgba(100,180,255,.08);
  --sidebar-active: #415A77;
  --sidebar-active-text: #E0E8F0;
  --sidebar-border: rgba(100,150,200,.15);
  --main-bg: #0D1B2A;
  --main-text: #C8D8E8;
  --main-text-muted: #778DA9;
  --main-header-bg: #0D1B2A;
  --main-header-border: #1B263B;
  --input-bg: #1B263B;
  --input-border: #415A77;
  --input-text: #C8D8E8;
  --msg-hover: rgba(100,180,255,.04);
  --badge-bg: #E63946;
  --badge-text: #fff;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(100,150,200,.2);
}

[data-theme="ocean"] {
  --workspace-bg: #003B4F;
  --workspace-text: rgba(200,240,255,.9);
  --workspace-hover: rgba(0,200,255,.08);
  --workspace-active: #005F73;
  --sidebar-bg: #005F73;
  --sidebar-text: #A8DADC;
  --sidebar-text-muted: rgba(168,218,220,.5);
  --sidebar-hover: rgba(0,200,255,.08);
  --sidebar-active: #0A9396;
  --sidebar-active-text: #fff;
  --sidebar-border: rgba(0,200,255,.12);
  --main-bg: #001219;
  --main-text: #E0F4F5;
  --main-text-muted: #8ECAE6;
  --main-header-bg: #001219;
  --main-header-border: #005F73;
  --input-bg: #003B4F;
  --input-border: #0A9396;
  --input-text: #E0F4F5;
  --msg-hover: rgba(0,200,255,.04);
  --badge-bg: #EE6C4D;
  --badge-text: #fff;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(0,200,200,.2);
}

[data-theme="emerald"] {
  --workspace-bg: #1A3A2A;
  --workspace-text: rgba(200,240,200,.9);
  --workspace-hover: rgba(100,255,100,.06);
  --workspace-active: #2D5A3F;
  --sidebar-bg: #2D5A3F;
  --sidebar-text: #A8D5B8;
  --sidebar-text-muted: rgba(168,213,184,.5);
  --sidebar-hover: rgba(100,255,100,.06);
  --sidebar-active: #3B8B5F;
  --sidebar-active-text: #fff;
  --sidebar-border: rgba(100,200,100,.12);
  --main-bg: #0E1F15;
  --main-text: #D0E8D0;
  --main-text-muted: #7DB88F;
  --main-header-bg: #0E1F15;
  --main-header-border: #2D5A3F;
  --input-bg: #1A3A2A;
  --input-border: #3B8B5F;
  --input-text: #D0E8D0;
  --msg-hover: rgba(100,255,100,.04);
  --badge-bg: #E63946;
  --badge-text: #fff;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(100,200,100,.2);
}

[data-theme="sunset"] {
  --workspace-bg: #2D1B34;
  --workspace-text: rgba(255,200,200,.9);
  --workspace-hover: rgba(255,120,80,.08);
  --workspace-active: #4A2545;
  --sidebar-bg: #4A2545;
  --sidebar-text: #E8B4B4;
  --sidebar-text-muted: rgba(232,180,180,.5);
  --sidebar-hover: rgba(255,120,80,.08);
  --sidebar-active: #D35400;
  --sidebar-active-text: #fff;
  --sidebar-border: rgba(255,150,100,.12);
  --main-bg: #1A0F1E;
  --main-text: #F0D0D0;
  --main-text-muted: #C08080;
  --main-header-bg: #1A0F1E;
  --main-header-border: #4A2545;
  --input-bg: #2D1B34;
  --input-border: #D35400;
  --input-text: #F0D0D0;
  --msg-hover: rgba(255,120,80,.04);
  --badge-bg: #F39C12;
  --badge-text: #fff;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(255,150,100,.2);
}

[data-theme="light"] {
  --workspace-bg: #1A3A6A;
  --workspace-text: rgba(255,255,255,.9);
  --workspace-hover: rgba(255,255,255,.1);
  --workspace-active: #0F2850;
  --sidebar-bg: #F8F8F8;
  --sidebar-text: #333;
  --sidebar-text-muted: rgba(0,0,0,.5);
  --sidebar-hover: rgba(0,0,0,.04);
  --sidebar-active: #0A84FF;
  --sidebar-active-text: #fff;
  --sidebar-border: #E0E0E0;
  --main-bg: #FFFFFF;
  --main-text: #1D1C1D;
  --main-text-muted: #616061;
  --main-header-bg: #FFFFFF;
  --main-header-border: #E8E8E8;
  --input-bg: #F0F0F0;
  --input-border: #D0D0D0;
  --input-text: #1D1C1D;
  --msg-hover: rgba(0,0,0,.02);
  --badge-bg: #E01E5A;
  --badge-text: #fff;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(0,0,0,.15);
}

[data-theme="dracula"] {
  --workspace-bg: #21222C; --workspace-text: rgba(248,248,242,.85); --workspace-hover: rgba(189,147,249,.1); --workspace-active: #44475A;
  --sidebar-bg: #282A36; --sidebar-text: #F8F8F2; --sidebar-text-muted: rgba(248,248,242,.5); --sidebar-hover: rgba(189,147,249,.08); --sidebar-active: #BD93F9; --sidebar-active-text: #282A36; --sidebar-border: #44475A;
  --main-bg: #1E1F29; --main-text: #F8F8F2; --main-text-muted: #6272A4;
  --main-header-bg: #1E1F29; --main-header-border: #44475A;
  --input-bg: #282A36; --input-border: #44475A; --input-text: #F8F8F2;
  --msg-hover: rgba(189,147,249,.05); --badge-bg: #FF79C6; --badge-text: #282A36;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(189,147,249,.25);
}

[data-theme="nord"] {
  --workspace-bg: #242933; --workspace-text: rgba(216,222,233,.85); --workspace-hover: rgba(136,192,208,.1); --workspace-active: #3B4252;
  --sidebar-bg: #2E3440; --sidebar-text: #D8DEE9; --sidebar-text-muted: rgba(216,222,233,.5); --sidebar-hover: rgba(136,192,208,.08); --sidebar-active: #88C0D0; --sidebar-active-text: #2E3440; --sidebar-border: #3B4252;
  --main-bg: #242933; --main-text: #ECEFF4; --main-text-muted: #81A1C1;
  --main-header-bg: #242933; --main-header-border: #3B4252;
  --input-bg: #3B4252; --input-border: #4C566A; --input-text: #ECEFF4;
  --msg-hover: rgba(136,192,208,.04); --badge-bg: #BF616A; --badge-text: #fff;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(136,192,208,.2);
}

[data-theme="tokyonight"] {
  --workspace-bg: #16161E; --workspace-text: rgba(192,202,245,.85); --workspace-hover: rgba(122,162,247,.1); --workspace-active: #292E42;
  --sidebar-bg: #1A1B26; --sidebar-text: #C0CAF5; --sidebar-text-muted: rgba(192,202,245,.45); --sidebar-hover: rgba(122,162,247,.08); --sidebar-active: #7AA2F7; --sidebar-active-text: #1A1B26; --sidebar-border: #292E42;
  --main-bg: #16161E; --main-text: #C0CAF5; --main-text-muted: #565F89;
  --main-header-bg: #16161E; --main-header-border: #292E42;
  --input-bg: #1F2335; --input-border: #414868; --input-text: #C0CAF5;
  --msg-hover: rgba(122,162,247,.04); --badge-bg: #F7768E; --badge-text: #fff;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(122,162,247,.2);
}

[data-theme="monokai"] {
  --workspace-bg: #1E1F1C; --workspace-text: rgba(248,248,242,.85); --workspace-hover: rgba(249,38,114,.08); --workspace-active: #3E3D32;
  --sidebar-bg: #272822; --sidebar-text: #F8F8F2; --sidebar-text-muted: rgba(248,248,242,.5); --sidebar-hover: rgba(249,38,114,.08); --sidebar-active: #F92672; --sidebar-active-text: #fff; --sidebar-border: #3E3D32;
  --main-bg: #1E1F1C; --main-text: #F8F8F2; --main-text-muted: #75715E;
  --main-header-bg: #1E1F1C; --main-header-border: #3E3D32;
  --input-bg: #272822; --input-border: #3E3D32; --input-text: #F8F8F2;
  --msg-hover: rgba(166,226,46,.04); --badge-bg: #F92672; --badge-text: #fff;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(166,226,46,.2);
}

[data-theme="gruvbox"] {
  --workspace-bg: #1D2021; --workspace-text: rgba(235,219,178,.85); --workspace-hover: rgba(250,189,47,.08); --workspace-active: #3C3836;
  --sidebar-bg: #282828; --sidebar-text: #EBDBB2; --sidebar-text-muted: rgba(235,219,178,.5); --sidebar-hover: rgba(250,189,47,.08); --sidebar-active: #FABD2F; --sidebar-active-text: #282828; --sidebar-border: #3C3836;
  --main-bg: #1D2021; --main-text: #EBDBB2; --main-text-muted: #928374;
  --main-header-bg: #1D2021; --main-header-border: #3C3836;
  --input-bg: #32302F; --input-border: #504945; --input-text: #EBDBB2;
  --msg-hover: rgba(250,189,47,.04); --badge-bg: #FB4934; --badge-text: #1D2021;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(250,189,47,.2);
}

[data-theme="rosepine"] {
  --workspace-bg: #191724; --workspace-text: rgba(224,222,244,.85); --workspace-hover: rgba(235,188,186,.08); --workspace-active: #26233A;
  --sidebar-bg: #1F1D2E; --sidebar-text: #E0DEF4; --sidebar-text-muted: rgba(224,222,244,.5); --sidebar-hover: rgba(235,188,186,.08); --sidebar-active: #EBBCBA; --sidebar-active-text: #1F1D2E; --sidebar-border: #26233A;
  --main-bg: #191724; --main-text: #E0DEF4; --main-text-muted: #6E6A86;
  --main-header-bg: #191724; --main-header-border: #26233A;
  --input-bg: #26233A; --input-border: #403D52; --input-text: #E0DEF4;
  --msg-hover: rgba(235,188,186,.04); --badge-bg: #EB6F92; --badge-text: #fff;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(235,188,186,.2);
}

[data-theme="catppuccin"] {
  --workspace-bg: #11111B; --workspace-text: rgba(205,214,244,.85); --workspace-hover: rgba(203,166,247,.08); --workspace-active: #313244;
  --sidebar-bg: #181825; --sidebar-text: #CDD6F4; --sidebar-text-muted: rgba(205,214,244,.5); --sidebar-hover: rgba(203,166,247,.08); --sidebar-active: #CBA6F7; --sidebar-active-text: #1E1E2E; --sidebar-border: #313244;
  --main-bg: #1E1E2E; --main-text: #CDD6F4; --main-text-muted: #7F849C;
  --main-header-bg: #1E1E2E; --main-header-border: #313244;
  --input-bg: #313244; --input-border: #45475A; --input-text: #CDD6F4;
  --msg-hover: rgba(203,166,247,.04); --badge-bg: #F38BA8; --badge-text: #1E1E2E;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(203,166,247,.2);
}

[data-theme="solarized-dark"] {
  --workspace-bg: #002B36; --workspace-text: rgba(147,161,161,.9); --workspace-hover: rgba(38,139,210,.08); --workspace-active: #073642;
  --sidebar-bg: #073642; --sidebar-text: #93A1A1; --sidebar-text-muted: rgba(147,161,161,.6); --sidebar-hover: rgba(38,139,210,.08); --sidebar-active: #268BD2; --sidebar-active-text: #FDF6E3; --sidebar-border: #586E75;
  --main-bg: #002B36; --main-text: #EEE8D5; --main-text-muted: #657B83;
  --main-header-bg: #002B36; --main-header-border: #073642;
  --input-bg: #073642; --input-border: #586E75; --input-text: #EEE8D5;
  --msg-hover: rgba(38,139,210,.04); --badge-bg: #DC322F; --badge-text: #FDF6E3;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(38,139,210,.2);
}

[data-theme="cyberpunk"] {
  --workspace-bg: #0A0118; --workspace-text: rgba(255,0,229,.85); --workspace-hover: rgba(0,255,234,.1); --workspace-active: #1A0B2E;
  --sidebar-bg: #1A0B2E; --sidebar-text: #00FFEA; --sidebar-text-muted: rgba(0,255,234,.5); --sidebar-hover: rgba(255,0,229,.08); --sidebar-active: #FF00E5; --sidebar-active-text: #0A0118; --sidebar-border: rgba(255,0,229,.2);
  --main-bg: #0A0118; --main-text: #00FFEA; --main-text-muted: #7A5FB0;
  --main-header-bg: #0A0118; --main-header-border: rgba(255,0,229,.2);
  --input-bg: #1A0B2E; --input-border: rgba(255,0,229,.3); --input-text: #00FFEA;
  --msg-hover: rgba(255,0,229,.04); --badge-bg: #FF00E5; --badge-text: #0A0118;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(255,0,229,.3);
}

[data-theme="forest"] {
  --workspace-bg: #0F2419; --workspace-text: rgba(196,232,184,.85); --workspace-hover: rgba(120,200,140,.08); --workspace-active: #1B3B2F;
  --sidebar-bg: #1B3B2F; --sidebar-text: #C4E8B8; --sidebar-text-muted: rgba(196,232,184,.5); --sidebar-hover: rgba(120,200,140,.08); --sidebar-active: #5E9065; --sidebar-active-text: #fff; --sidebar-border: #2C5A3A;
  --main-bg: #0F2419; --main-text: #D8EECA; --main-text-muted: #6D8F6D;
  --main-header-bg: #0F2419; --main-header-border: #1B3B2F;
  --input-bg: #1B3B2F; --input-border: #2C5A3A; --input-text: #D8EECA;
  --msg-hover: rgba(120,200,140,.04); --badge-bg: #C99846; --badge-text: #0F2419;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(120,200,140,.2);
}

[data-theme="coffee"] {
  --workspace-bg: #1F1713; --workspace-text: rgba(230,200,170,.85); --workspace-hover: rgba(200,150,100,.08); --workspace-active: #3B2A20;
  --sidebar-bg: #3B2A20; --sidebar-text: #E6C8AA; --sidebar-text-muted: rgba(230,200,170,.5); --sidebar-hover: rgba(200,150,100,.08); --sidebar-active: #B08050; --sidebar-active-text: #1F1713; --sidebar-border: #5A4030;
  --main-bg: #1F1713; --main-text: #E6C8AA; --main-text-muted: #8E7058;
  --main-header-bg: #1F1713; --main-header-border: #3B2A20;
  --input-bg: #2A1F18; --input-border: #5A4030; --input-text: #E6C8AA;
  --msg-hover: rgba(200,150,100,.04); --badge-bg: #D97706; --badge-text: #fff;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(200,150,100,.2);
}

[data-theme="mono"] {
  --workspace-bg: #0D0D0D; --workspace-text: rgba(220,220,220,.85); --workspace-hover: rgba(255,255,255,.06); --workspace-active: #1A1A1A;
  --sidebar-bg: #1A1A1A; --sidebar-text: #DDDDDD; --sidebar-text-muted: rgba(220,220,220,.5); --sidebar-hover: rgba(255,255,255,.05); --sidebar-active: #666666; --sidebar-active-text: #fff; --sidebar-border: #2A2A2A;
  --main-bg: #0D0D0D; --main-text: #E8E8E8; --main-text-muted: #888888;
  --main-header-bg: #0D0D0D; --main-header-border: #2A2A2A;
  --input-bg: #1A1A1A; --input-border: #333333; --input-text: #E8E8E8;
  --msg-hover: rgba(255,255,255,.03); --badge-bg: #FFFFFF; --badge-text: #0D0D0D;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(255,255,255,.15);
}

[data-theme="high-contrast"] {
  --workspace-bg: #000000; --workspace-text: #FFFFFF; --workspace-hover: rgba(255,255,0,.15); --workspace-active: #1F1F00;
  --sidebar-bg: #000000; --sidebar-text: #FFFFFF; --sidebar-text-muted: #CCCCCC; --sidebar-hover: rgba(255,255,0,.1); --sidebar-active: #FFFF00; --sidebar-active-text: #000000; --sidebar-border: #FFFFFF;
  --main-bg: #000000; --main-text: #FFFFFF; --main-text-muted: #CCCCCC;
  --main-header-bg: #000000; --main-header-border: #FFFFFF;
  --input-bg: #000000; --input-border: #FFFFFF; --input-text: #FFFFFF;
  --msg-hover: rgba(255,255,0,.1); --badge-bg: #FFFF00; --badge-text: #000000;
  --scrollbar-track: transparent; --scrollbar-thumb: #FFFFFF;
}

[data-theme="solarized-light"] {
  --workspace-bg: #002B36; --workspace-text: rgba(253,246,227,.9); --workspace-hover: rgba(38,139,210,.12); --workspace-active: #073642;
  --sidebar-bg: #EEE8D5; --sidebar-text: #586E75; --sidebar-text-muted: rgba(88,110,117,.7); --sidebar-hover: rgba(38,139,210,.05); --sidebar-active: #268BD2; --sidebar-active-text: #FDF6E3; --sidebar-border: #DDD6C1;
  --main-bg: #FDF6E3; --main-text: #586E75; --main-text-muted: #93A1A1;
  --main-header-bg: #FDF6E3; --main-header-border: #EEE8D5;
  --input-bg: #EEE8D5; --input-border: #DDD6C1; --input-text: #586E75;
  --msg-hover: rgba(38,139,210,.03); --badge-bg: #DC322F; --badge-text: #FDF6E3;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(88,110,117,.2);
}

[data-theme="latte"] {
  --workspace-bg: #DCE0E8; --workspace-text: #4C4F69; --workspace-hover: rgba(136,57,239,.08); --workspace-active: #BCC0CC;
  --sidebar-bg: #E6E9EF; --sidebar-text: #4C4F69; --sidebar-text-muted: rgba(76,79,105,.6); --sidebar-hover: rgba(136,57,239,.05); --sidebar-active: #8839EF; --sidebar-active-text: #fff; --sidebar-border: #BCC0CC;
  --main-bg: #EFF1F5; --main-text: #4C4F69; --main-text-muted: #7C7F93;
  --main-header-bg: #EFF1F5; --main-header-border: #DCE0E8;
  --input-bg: #E6E9EF; --input-border: #BCC0CC; --input-text: #4C4F69;
  --msg-hover: rgba(136,57,239,.03); --badge-bg: #D20F39; --badge-text: #fff;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(76,79,105,.2);
}

[data-theme="sepia"] {
  --workspace-bg: #5E4630; --workspace-text: rgba(251,245,228,.95); --workspace-hover: rgba(255,255,255,.1); --workspace-active: #7A5C3E;
  --sidebar-bg: #F4ECD8; --sidebar-text: #5E4630; --sidebar-text-muted: rgba(94,70,48,.6); --sidebar-hover: rgba(94,70,48,.05); --sidebar-active: #B08050; --sidebar-active-text: #FBF5E4; --sidebar-border: #D9CBA8;
  --main-bg: #FBF5E4; --main-text: #4A3420; --main-text-muted: #8A7050;
  --main-header-bg: #FBF5E4; --main-header-border: #E8DBBA;
  --input-bg: #F4ECD8; --input-border: #D9CBA8; --input-text: #4A3420;
  --msg-hover: rgba(94,70,48,.03); --badge-bg: #C94A29; --badge-text: #FBF5E4;
  --scrollbar-track: transparent; --scrollbar-thumb: rgba(94,70,48,.2);
}

/* ═══ RESET & BASE ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: var(--font); font-size: 15px; line-height: 1.46; background: var(--main-bg); color: var(--main-text); -webkit-font-smoothing: antialiased; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
a { color: #4DA6FF; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* ═══ AUTH SCREEN — FUTURISTIC ═══ */
.auth-screen { height: 100vh; display: flex; align-items: center; justify-content: center; background: #060B18; position: relative; overflow: hidden; }
.auth-bg-shapes { position: absolute; inset: 0; pointer-events: none; }
.shape { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.shape-1 { width: 500px; height: 500px; background: radial-gradient(circle, #0A84FF, transparent 70%); top: -10%; left: -5%; animation: float1 12s ease-in-out infinite; }
.shape-2 { width: 400px; height: 400px; background: radial-gradient(circle, #00D4FF, transparent 70%); bottom: -10%; right: -5%; animation: float2 10s ease-in-out infinite; }
.shape-3 { width: 350px; height: 350px; background: radial-gradient(circle, #7B2FFF, transparent 70%); top: 20%; right: 15%; animation: float3 14s ease-in-out infinite; }
.shape-4 { width: 300px; height: 300px; background: radial-gradient(circle, #FF3CAC, transparent 70%); bottom: 15%; left: 10%; animation: float1 11s ease-in-out infinite reverse; }
.shape-5 { width: 200px; height: 200px; background: radial-gradient(circle, #00F5D4, transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); animation: float2 9s ease-in-out infinite; }

@keyframes float1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, -40px); } }
@keyframes float2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-25px, 30px); } }
@keyframes float3 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(20px, 25px); } }

.auth-container { width: 380px; background: rgba(12, 18, 35, .85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(80,130,200,.15); border-radius: 16px; padding: 36px; box-shadow: 0 20px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.03) inset; position: relative; z-index: 1; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo svg { margin-bottom: 12px; }
.auth-logo h1 { color: #fff; font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.auth-logo p { color: #6B80A0; font-size: 14px; margin-top: 4px; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label { display: block; font-size: 13px; font-weight: 600; color: #B0C8E8; margin-bottom: 6px; }
.auth-form input[type="text"], .auth-form input[type="password"] { width: 100%; padding: 10px 12px; background: rgba(20,30,50,.8); border: 1px solid rgba(80,130,200,.25); border-radius: 8px; color: #C8D8F0; }
.auth-form input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(10,132,255,.15); }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 20px; }
.auth-switch { text-align: center; font-size: 13px; color: #6B80A0; margin-top: 16px; }
.demo-hint { text-align: center; font-size: 12px; color: #4A5A78; margin-top: 16px; background: rgba(255,255,255,.03); padding: 8px; border-radius: 8px; }
.demo-hint span { font-weight: 600; }
.demo-hint code { background: rgba(10,132,255,.15); padding: 2px 6px; border-radius: 3px; color: #4DA6FF; }

/* OAuth Divider & Buttons */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(80,130,200,.2); }
.auth-divider span { font-size: 12px; color: #4A5A78; white-space: nowrap; }
.oauth-buttons { display: flex; gap: 10px; margin-bottom: 4px; }
.oauth-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 1px solid rgba(80,130,200,.2); border-radius: 8px; background: rgba(20,30,50,.6); color: #B0C8E8; cursor: pointer; font-size: 13px; font-weight: 500; transition: var(--transition); }
.oauth-btn:hover { background: rgba(40,60,90,.6); border-color: rgba(80,130,200,.35); }
.oauth-btn svg { flex-shrink: 0; }

/* ═══ BUTTONS ═══ */
.btn-primary { width: 100%; padding: 10px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; transition: var(--transition); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { padding: 8px 16px; background: transparent; border: 1px solid var(--input-border); color: var(--main-text); border-radius: 6px; cursor: pointer; font-weight: 500; transition: var(--transition); }
.btn-secondary:hover { background: var(--msg-hover); }
.btn-danger { padding: 8px 16px; background: transparent; border: 1px solid var(--danger); color: var(--danger); border-radius: 6px; cursor: pointer; font-weight: 500; }
.btn-danger:hover { background: rgba(224,30,90,.1); }
.btn-text { background: none; border: none; color: var(--primary); cursor: pointer; font-weight: 500; font-size: 13px; }
.btn-text:hover { text-decoration: underline; }
.btn-text-sm { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 12px; }
.btn-file { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.icon-btn { background: none; border: none; color: var(--main-text-muted); cursor: pointer; padding: 6px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; transition: var(--transition); }
.icon-btn:hover { background: var(--msg-hover); color: var(--main-text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.small svg { width: 16px; height: 16px; }

/* ═══ APP LAYOUT ═══ */
.app { 
  display: flex; 
  height: 100vh; 
  height: 100dvh; /* Dynamic viewport height for mobile */
  width: 100vw; 
  overflow: hidden; 
  position: relative;
}

/* Workspace Bar */
.workspace-bar { width: 60px; background: var(--workspace-bg); display: flex; flex-direction: column; align-items: center; padding: 12px 0; flex-shrink: 0; }
.workspace-icon { width: 36px; height: 36px; background: var(--workspace-active); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--workspace-text); margin-bottom: 16px; }
.workspace-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.workspace-bottom { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.ws-nav-btn { width: 40px; height: 40px; border: none; background: none; color: var(--workspace-text); border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); position: relative; }
.ws-nav-btn:hover { background: var(--workspace-hover); }
.ws-nav-btn.active { background: var(--workspace-active); color: #fff; }
.ws-nav-btn svg { width: 20px; height: 20px; }

/* Sidebar */
.sidebar { width: 260px; background: var(--sidebar-bg); display: flex; flex-direction: column; border-right: 1px solid var(--sidebar-border); flex-shrink: 0; overflow: hidden; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--sidebar-border); }
.sidebar-header h2 { font-size: 16px; font-weight: 700; color: var(--sidebar-text); }
.sidebar-panel { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-panel.sidebar-split { display: flex; flex-direction: column; }
.sidebar-section { padding: 0 8px; }
.sidebar-section-half { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar-section-half .nav-list { flex: 1; overflow-y: auto; }
.section-header { display: flex; align-items: center; gap: 4px; padding: 6px 8px; font-size: 13px; font-weight: 600; color: var(--sidebar-text-muted); text-transform: uppercase; letter-spacing: .5px; }
.section-chevron { width: 14px; height: 14px; }
.nav-list { display: flex; flex-direction: column; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--sidebar-text); font-size: 14px; transition: var(--transition); position: relative; }
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.nav-item.has-unread .nav-label { font-weight: 700; color: var(--sidebar-text); }
.nav-item.active.has-unread .nav-label { color: var(--sidebar-active-text); }
.nav-icon { font-size: 14px; opacity: .7; width: 18px; text-align: center; flex-shrink: 0; }
.nav-icon i { width: 16px; height: 16px; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-badge { background: var(--badge-bg); color: var(--badge-text); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 10px; margin-left: auto; min-width: 18px; text-align: center; flex-shrink: 0; }

/* Sidebar Bottom */
.sidebar-bottom { 
  padding: 8px; 
  border-top: 1px solid var(--sidebar-border); 
  flex-shrink: 0;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-bottom .nav-item {
  width: 100%;
  color: var(--sidebar-text);
  background: none;
  border: none;
  cursor: pointer;
}
.sidebar-bottom .nav-item:hover {
  background: var(--sidebar-hover);
}
.sidebar-bottom .nav-item .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-bottom .nav-item .mini-avatar {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--main-bg); }
.main-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 480px) minmax(0, 1fr); align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--main-header-border); background: var(--main-header-bg); flex-shrink: 0; min-height: 52px; gap: 12px; }
.header-left { display: flex; align-items: center; gap: 8px; min-width: 0; justify-self: start; overflow: hidden; padding-right: 12px; width: 100%; }
.header-left h3 { font-size: 16px; font-weight: 700; color: var(--main-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; max-width: 50%; }
.header-desc { font-size: 13px; color: var(--main-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; justify-self: end; }
.badge { font-size: 11px; background: var(--main-text-muted); color: var(--main-bg); border-radius: 8px; padding: 0 5px; margin-left: 2px; }

/* Header Search Bar */
.header-search { width: 100%; max-width: 480px; min-width: 120px; position: relative; justify-self: center; }
.header-search-wrap { display: flex; align-items: center; gap: 6px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px; padding: 5px 10px; transition: var(--transition); }
.header-search-clear { background: none; border: none; color: var(--main-text-muted); cursor: pointer; padding: 0; display: flex; align-items: center; }
.header-search-clear:hover { color: var(--main-text); }
.header-search-clear i { width: 14px; height: 14px; }
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  background: var(--main-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.35);
  z-index: 1000;
  padding: 4px 0;
}
.search-dropdown .search-result { padding: 10px 12px; border-radius: 0; margin: 0; cursor: pointer; border-bottom: 1px solid var(--input-border); }
.search-dropdown .search-result:last-child { border-bottom: none; }
.search-dropdown .search-result:hover { background: var(--sidebar-hover, rgba(255,255,255,0.05)); }
.search-dropdown .search-result-meta { display: flex; gap: 8px; font-size: 11px; color: var(--main-text-muted); margin-bottom: 3px; }
.search-dropdown .search-result-text { font-size: 13px; color: var(--main-text); line-height: 1.4; }
.search-dropdown .search-result mark { background: rgba(10,132,255,.3); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-dropdown .search-scope-bar { padding: 8px 10px 4px; position: sticky; top: 0; background: var(--main-bg); z-index: 1; border-bottom: 1px solid var(--input-border); }
.search-dropdown .search-hint-bar { margin: 6px 10px; }
.search-dropdown .search-filter-chips { padding: 6px 10px; }
.search-suggestions { border-bottom: 1px solid var(--input-border); padding: 4px 0; }
.search-suggestion { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 13px; color: var(--main-text); cursor: pointer; }
.search-suggestion:hover, .search-suggestion.active { background: var(--sidebar-hover, rgba(255,255,255,0.06)); }
.search-suggestion .ss-key { font-weight: 600; color: #36C5F0; }
.search-suggestion .ss-desc { color: var(--main-text-muted); font-size: 11px; margin-left: auto; }
.search-suggestion .ss-hint { margin-left: auto; font-size: 10px; color: var(--main-text-muted); border: 1px solid var(--input-border); border-radius: 3px; padding: 1px 5px; }
@media (max-width: 768px) {
  .search-dropdown { position: fixed; top: 56px; left: 8px; right: 8px; max-height: calc(100vh - 70px); }
}
.header-search-wrap:focus-within { border-color: var(--primary); }
.header-search-icon { width: 16px; height: 16px; color: var(--main-text-muted); flex-shrink: 0; }
.header-search-wrap input { flex: 1; background: none; border: none; color: var(--main-text); outline: none; font-size: 13px; }
.header-search-wrap input::placeholder { color: var(--main-text-muted); }

/* Messages */
.main-body { 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  overflow: hidden; 
  position: relative;
  min-height: 0;
}
.messages-container { 
  flex: 1; 
  overflow-y: auto; 
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.load-more { text-align: center; padding: 8px; }

.date-divider { display: flex; align-items: center; gap: 12px; padding: 8px 0; margin: 8px 0; }
.date-divider::before, .date-divider::after { content: ''; flex: 1; height: 1px; background: var(--main-header-border); }
.date-divider span { font-size: 12px; font-weight: 600; color: var(--main-text-muted); white-space: nowrap; padding: 2px 10px; background: var(--main-bg); border-radius: 12px; border: 1px solid var(--main-header-border); }

.message { display: flex; gap: 10px; padding: 6px 4px; border-radius: 6px; transition: background var(--transition); position: relative; }
.message:hover { background: var(--msg-hover); }
.message.deleted { opacity: .5; }
.message.system { justify-content: center; }
.message.system .msg-content { color: var(--main-text-muted); font-style: italic; font-size: 13px; }

.msg-avatar { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; background-size: cover; background-position: center; cursor: pointer; }
.msg-body { flex: 1; min-width: 0; }
.msg-header { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.msg-author { font-weight: 700; font-size: 14px; color: var(--main-text); cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.msg-time { font-size: 12px; color: var(--main-text-muted); }
.msg-edited { font-size: 11px; color: var(--main-text-muted); }
.msg-content { font-size: 15px; line-height: 1.46; word-break: break-word; white-space: pre-wrap; }
.msg-content code { background: rgba(80,160,255,.1); padding: 1px 4px; border-radius: 3px; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.msg-content pre { background: rgba(80,160,255,.06); padding: 12px; border-radius: 6px; margin: 4px 0; overflow-x: auto; }
.msg-content pre code { background: none; padding: 0; }
.msg-content strong { font-weight: 700; }
.msg-content em { font-style: italic; }
.msg-content del { text-decoration: line-through; opacity: .6; }
.msg-content .mention { background: rgba(10,132,255,.25); color: #4DA6FF; padding: 1px 4px; border-radius: 3px; font-weight: 600; cursor: pointer; }
.msg-content a { color: #4DA6FF; }
/* Legacy text receipt — hidden (replaced by tick icons) */
.dm-receipt { display: none; }

/* WhatsApp-style DM tick icons — lives in .msg-header, pushed to the far right */
.dm-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;       /* pushes tick to extreme right of header row */
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
  padding-left: 6px;       /* small breathing gap from the timestamp */
}
.dm-tick-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  transition: fill 0.35s ease;
}
/* Smooth pop animation when status upgrades: sent → delivered → read */
@keyframes tickPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.dm-tick.tick-animate .dm-tick-svg {
  animation: tickPop 0.28s cubic-bezier(0.34,1.56,0.64,1);
}

/* Message File Attachment */
.msg-file { margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(80,160,255,.05); border: 1px solid var(--main-header-border); border-radius: 8px; }
.msg-file a { color: var(--primary); font-weight: 500; font-size: 13px; }
.msg-file-size { font-size: 12px; color: var(--main-text-muted); }
.msg-file-download { background: none; border: none; color: var(--main-text-muted); cursor: pointer; padding: 4px; border-radius: 4px; display: flex; align-items: center; margin-left: auto; }
.msg-file-download:hover { color: var(--primary); background: var(--msg-hover); }
.msg-file-download svg { width: 16px; height: 16px; }
.msg-image-container { margin-top: 6px; }
.msg-media { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; max-width: 480px; }
.msg-media-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--main-text-muted); }
.msg-media-meta .msg-file-link { color: var(--primary); font-weight: 500; font-size: 13px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-media-meta .msg-file-download { margin-left: auto; }
.msg-video { width: 100%; max-width: 480px; max-height: 360px; border-radius: 8px; background: #000; display: block; }
.msg-audio { width: 100%; max-width: 480px; }
.msg-media-audio { max-width: 360px; }
.msg-doc { width: 100%; max-width: 560px; height: 420px; border: 1px solid var(--main-header-border); border-radius: 8px; background: #fff; }
.msg-image { max-width: 400px; max-height: 300px; border-radius: 8px; cursor: pointer; display: block; transition: opacity 0.2s; }
.msg-image:hover { opacity: 0.9; }
.msg-gif { max-width: 300px; max-height: 250px; border-radius: 8px; cursor: pointer; display: block; transition: opacity 0.2s; }
/* Fallback shown when a message image/GIF (e.g. an unreachable external URL) fails to load. */
.msg-image-unavailable { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; margin-top: 6px; font-size: 13px; color: var(--text-muted); background: var(--input-bg); border: 1px dashed var(--input-border); border-radius: 8px; }
.msg-gif:hover { opacity: 0.9; }

/* Pinned badge */
.msg-pin-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #ECB22E; margin-left: 8px; }
.msg-pin-badge svg { width: 12px; height: 12px; }

/* Thread reply count link */
.thread-reply-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--primary); cursor: pointer; margin-top: 4px; padding: 2px 0; }
.thread-reply-link:hover { text-decoration: underline; }
.thread-reply-link svg { width: 14px; height: 14px; }

/* Message Actions (hover) */
.msg-actions { position: absolute; top: -8px; right: 8px; display: none; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px; padding: 2px; }
.message:hover .msg-actions { display: flex; }
@media (max-width: 768px) {
  .message:hover .msg-actions { display: none !important; }
  .msg-actions { 
    display: none !important; 
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .message.show-actions .msg-actions {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
  }
}
.msg-action-btn { background: none; border: none; color: var(--main-text-muted); cursor: pointer; padding: 4px 6px; border-radius: 4px; display: flex; align-items: center; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.msg-action-btn:hover { background: var(--msg-hover); color: var(--main-text); }
.msg-action-btn svg { width: 16px; height: 16px; pointer-events: none; }

/* Reactions */
.reactions-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction-btn { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: rgba(80,160,255,.06); border: 1px solid var(--main-header-border); border-radius: 12px; cursor: pointer; font-size: 13px; color: var(--main-text); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.reaction-btn:hover { background: rgba(80,160,255,.1); }
.reaction-btn.own { border-color: var(--primary); background: rgba(10,132,255,.15); }
.reaction-count { font-size: 12px; color: var(--main-text-muted); }
/* Who-reacted tooltip (WhatsApp-style) */
.reaction-tooltip { position: fixed; z-index: 9999; background: var(--sidebar-bg); border: 1px solid var(--main-header-border); border-radius: 8px; padding: 8px 12px; font-size: 12px; color: var(--main-text); pointer-events: none; max-width: 200px; box-shadow: 0 4px 16px rgba(0,0,0,.45); line-height: 1.6; text-align: center; display: none; word-break: break-word; }
.reaction-tooltip .rt-emoji { font-size: 20px; display: block; margin-bottom: 4px; }
.reaction-tooltip .rt-names { font-size: 11px; color: var(--main-text-muted); display: block; }
.reaction-trigger { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Typing */
.typing-indicator { display: flex; align-items: center; gap: 8px; padding: 4px 20px; font-size: 13px; color: var(--main-text-muted); }
.typing-dots { display: flex; gap: 3px; }
.typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--main-text-muted); animation: typeBounce .6s infinite alternate; }
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typeBounce { to { opacity: .3; transform: translateY(-3px); } }

/* Message Input */
.message-input-container { padding: 8px 20px 16px; flex-shrink: 0; position: relative; }
.edit-banner { display: flex; align-items: center; justify-content: space-between; background: rgba(10,132,255,.15); padding: 6px 12px; border-radius: 6px 6px 0 0; font-size: 13px; color: var(--primary); }
.input-wrapper { display: flex; align-items: center; gap: 4px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 8px; padding: 4px 8px; }
.input-wrapper:focus-within { border-color: var(--primary); }
.input-text-wrap { flex: 1; position: relative; }
#message-input { width: 100%; padding: 8px 4px; background: none; border: none; color: var(--input-text); outline: none; font-size: 14px; resize: none; line-height: 1.4; max-height: 140px; overflow-y: auto; }
#message-input::placeholder { color: var(--main-text-muted); }
.input-action { background: none; border: none; color: var(--main-text-muted); cursor: pointer; padding: 6px; border-radius: 6px; display: flex; align-items: center; }
.input-action:hover { color: var(--main-text); background: var(--msg-hover); }
.input-action svg { width: 18px; height: 18px; }
.send-btn { color: var(--primary); }

/* Attach Dropdown */
.attach-dropdown-container { position: relative; }
.attach-dropdown { position: absolute; bottom: 100%; left: 0; margin-bottom: 6px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.4); z-index: 100; min-width: 180px; padding: 4px; }
.attach-dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: none; background: none; color: var(--main-text); cursor: pointer; border-radius: 6px; font-size: 13px; text-align: left; }
.attach-dropdown-item:hover { background: var(--msg-hover); }
.attach-dropdown-item svg { width: 16px; height: 16px; color: var(--main-text-muted); }
.mobile-attach-item { display: none; }

.file-preview { display: flex; gap: 8px; padding: 8px 0; flex-wrap: wrap; }
.file-preview-item { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px; font-size: 13px; color: var(--main-text); }
.file-preview-img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.remove-file { cursor: pointer; color: var(--main-text-muted); margin-left: 4px; }

/* ═══ MENTION POPUP ═══ */
.mention-popup { position: absolute; bottom: 100%; left: 0; width: 280px; max-height: 200px; overflow-y: auto; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.4); z-index: 100; }
.mention-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--main-text); }
.mention-item:hover, .mention-item.selected { background: var(--primary); color: #fff; }
.mini-avatar { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; background-size: cover; background-position: center; position: relative; }

/* ═══ SLASH COMMAND POPUP ═══ */
.slash-popup { position: absolute; bottom: 100%; left: 0; right: 0; max-height: 240px; overflow-y: auto; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.4); z-index: 100; margin-bottom: 4px; }
.slash-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--main-header-border); }
.slash-item:last-child { border-bottom: none; }
.slash-item:hover, .slash-item.selected { background: var(--primary); color: #fff; }
.slash-item .slash-name { font-weight: 600; font-size: 14px; color: var(--main-text); }
.slash-item .slash-desc { font-size: 12px; color: var(--main-text-muted); }
.slash-item:hover .slash-name, .slash-item.selected .slash-name,
.slash-item:hover .slash-desc, .slash-item.selected .slash-desc { color: #fff; }

/* ═══ THREAD PANEL ═══ */
.thread-panel { width: 360px; background: var(--main-bg); border-left: 1px solid var(--main-header-border); display: flex; flex-direction: column; flex-shrink: 0; }
.thread-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--main-header-border); }
.thread-header h3 { font-size: 15px; font-weight: 700; }
.thread-parent-msg { padding: 12px 16px; border-bottom: 1px solid var(--main-header-border); }
.thread-parent-msg .message { padding: 0; }
.thread-parent-msg .message:hover { background: none; }
.thread-divider { padding: 8px 16px; font-size: 12px; color: var(--main-text-muted); border-bottom: 1px solid var(--main-header-border); }
.thread-replies-list { flex: 1; overflow-y: auto; padding: 8px 16px; }
.thread-replies-list .message { padding: 6px 0; }
.thread-input-container { padding: 8px 16px 12px; border-top: 1px solid var(--main-header-border); }
.thread-input-container .input-wrapper { padding: 4px 8px; }
#thread-input { width: 100%; padding: 8px 4px; background: none; border: none; color: var(--input-text); outline: none; font-size: 14px; resize: none; line-height: 1.4; max-height: 140px; overflow-y: auto; }
#thread-input::placeholder { color: var(--main-text-muted); }

/* ═══ MEMBERS PANEL ═══ */
.members-panel { width: 260px; background: var(--main-bg); border-left: 1px solid var(--main-header-border); display: flex; flex-direction: column; flex-shrink: 0; }
.members-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--main-header-border); }
.members-header h3 { font-size: 15px; font-weight: 700; }
.members-list { flex: 1; overflow-y: auto; padding: 8px; }
.member-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.member-item:hover { background: var(--msg-hover); }
.member-avatar { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; position: relative; background-size: cover; background-position: center; flex-shrink: 0; }
.presence { position: absolute; bottom: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--main-bg); }
.presence.online { background: #2EB67D; }
.presence.offline { background: transparent; border-color: var(--main-text-muted); }
.member-info { min-width: 0; }
.member-name { font-size: 14px; font-weight: 600; color: var(--main-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-status { font-size: 12px; color: var(--main-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-role-badge { display: inline-block; font-size: 10px; background: rgba(10,132,255,.3); color: var(--primary); padding: 1px 5px; border-radius: 3px; margin-left: 4px; font-weight: 600; vertical-align: middle; }
.channel-admin-badge { background: rgba(46,182,125,.25); color: #2EB67D; }
/* Members panel search */
.channels-search-wrap { padding: 4px 8px 2px; }
.channels-search-wrap input { width: 100%; padding: 5px 10px; background: var(--sidebar-input-bg, rgba(255,255,255,.08)); border: 1px solid var(--sidebar-border, rgba(255,255,255,.1)); border-radius: 6px; color: var(--sidebar-text); font-size: 12px; outline: none; box-sizing: border-box; }
.channels-search-wrap input:focus { border-color: var(--primary); }
.channels-search-wrap input::placeholder { color: var(--sidebar-text-muted); }
.members-search-wrap { padding: 8px 10px 4px; }
.members-search-wrap input { width: 100%; padding: 6px 10px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px; color: var(--input-text); font-size: 13px; outline: none; box-sizing: border-box; }
.members-search-wrap input:focus { border-color: var(--primary); }
/* Make Admin button in channel settings */
.btn-make-admin { font-size: 11px; padding: 2px 7px; border-radius: 4px; border: 1px solid rgba(46,182,125,.5); background: rgba(46,182,125,.1); color: #2EB67D; cursor: pointer; white-space: nowrap; }
.btn-make-admin:hover { background: rgba(46,182,125,.2); }
.btn-make-admin.is-admin { border-color: rgba(255,100,100,.4); background: rgba(255,80,80,.08); color: #e05c5c; }
.btn-make-admin.is-admin:hover { background: rgba(255,80,80,.15); }

/* Pinned */
.pinned-list { flex: 1; overflow-y: auto; padding: 8px; }
.pinned-card { padding: 10px 12px; margin: 4px 0; background: rgba(80,160,255,.04); border-radius: 6px; border-left: 3px solid #ECB22E; }
.pinned-card-author { font-size: 13px; font-weight: 600; color: var(--main-text); }
.pinned-card-text { font-size: 13px; color: var(--main-text-muted); margin-top: 2px; }
.pinned-card-time { font-size: 11px; color: var(--main-text-muted); margin-top: 4px; }

/* Search */
.search-sidebar { padding: 8px; }
.search-results { overflow-y: auto; max-height: calc(100vh - 120px); }
.search-result { padding: 8px; border-radius: 6px; cursor: pointer; margin-bottom: 4px; }
.search-result:hover { background: var(--sidebar-hover); }
.search-result-meta { display: flex; gap: 8px; font-size: 12px; color: var(--sidebar-text-muted); margin-bottom: 2px; }
.search-result-text { font-size: 13px; color: var(--sidebar-text); }
.search-result mark { background: rgba(10,132,255,.3); color: var(--sidebar-text); border-radius: 2px; }

/* Bookmarks */
.bookmark-item { padding: 8px; padding-right: 32px; border-radius: 6px; cursor: pointer; margin-bottom: 4px; position: relative; }
.bookmark-item:hover { background: var(--sidebar-hover); }
.bookmark-meta { display: flex; gap: 8px; font-size: 12px; color: var(--sidebar-text-muted); margin-bottom: 2px; }
.bookmark-text { font-size: 13px; color: var(--sidebar-text); }
.bookmark-unsave {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bookmark-item:hover .bookmark-unsave { opacity: 1; }
.bookmark-unsave:hover { color: #ff4d4f; background: rgba(255,77,79,.1); }

/* DM search */
.dm-search-wrap {
  margin-bottom: 10px;
}
.dm-search-wrap input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--main-header-border);
  border-radius: 6px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.dm-search-wrap input:focus {
  border-color: var(--primary);
}

/* ═══ MODALS ═══ */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.modal-content { position: relative; background: var(--main-bg); border: 1px solid var(--main-header-border); border-radius: 12px; width: 480px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 16px 60px rgba(0,0,0,.5); }
.modal-content.modal-wide { width: 640px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--main-header-border); }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--main-header-border); }
.modal-subtitle { font-size: 13px; color: var(--main-text-muted); margin-bottom: 12px; }
.modal-section-title { font-size: 14px; font-weight: 600; margin: 16px 0 8px; color: var(--main-text); }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--main-text); margin-bottom: 6px; }
.form-group .optional { font-weight: 400; color: var(--main-text-muted); }
.form-group input[type="text"], .form-group input[type="password"], .form-group textarea, .form-group select {
  width: 100%; padding: 8px 12px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px; color: var(--input-text); resize: vertical;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); outline: none; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--main-text); cursor: pointer; }

/* Users List (modal) */
.users-list { max-height: 250px; overflow-y: auto; }
.users-list.compact { max-height: 180px; }
.user-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; transition: var(--transition); }
.user-item:hover { background: var(--msg-hover); }
.user-item.selected { background: rgba(10,132,255,.2); border: 1px solid var(--primary); }

/* Profile */
.profile-card .modal-body { padding: 0; }
.profile-banner { height: 80px; background: linear-gradient(135deg, var(--workspace-bg), var(--sidebar-active)); border-radius: 11px 11px 0 0; }
.profile-avatar-lg { width: 72px; height: 72px; border-radius: 16px; margin: -36px auto 8px; border: 4px solid var(--main-bg); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: #fff; background-size: cover; background-position: center; }
.profile-name { text-align: center; font-size: 20px; font-weight: 700; }
.profile-title-text { text-align: center; font-size: 14px; color: var(--main-text-muted); margin-bottom: 16px; }
.profile-details { padding: 0 20px 20px; }
.profile-detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--main-header-border); font-size: 14px; }
.profile-detail-row .label { color: var(--main-text-muted); }
.profile-detail-row .value { color: var(--main-text); font-weight: 500; }

/* Avatar Upload */
.avatar-upload-section { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #fff; flex-shrink: 0; background-size: cover; background-position: center; }

/* Avatar Crop */
.crop-container { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.crop-container canvas { max-width: 100%; border-radius: 8px; background: #000; cursor: move; }
.crop-controls { display: flex; gap: 20px; width: 100%; }
.crop-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--main-text-muted); flex: 1; }
.crop-controls input[type="range"] { width: 100%; accent-color: var(--primary); }

/* ═══ ADMIN PANEL ═══ */
.admin-section { margin-bottom: 24px; }
.admin-section h4 { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--main-text); }
.admin-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.admin-users-list { max-height: 350px; overflow-y: auto; }
.admin-user-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--main-header-border); }
.admin-user-row:last-child { border-bottom: none; }
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-info .name { font-weight: 600; font-size: 14px; }
.admin-user-info .meta { font-size: 12px; color: var(--main-text-muted); }
.admin-user-actions { display: flex; gap: 6px; }
.admin-user-actions button { padding: 4px 10px; font-size: 12px; border-radius: 4px; cursor: pointer; border: 1px solid var(--input-border); background: none; color: var(--main-text-muted); }
.admin-user-actions button:hover { background: var(--msg-hover); color: var(--main-text); }
.admin-user-actions button.danger { border-color: var(--danger); color: var(--danger); }
.admin-user-actions button.danger:hover { background: rgba(224,30,90,.1); }

/* ═══ THEME PICKER ═══ */
.theme-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-card { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 8px; border: 2px solid var(--input-border); cursor: pointer; transition: var(--transition); }
.theme-card:hover { border-color: var(--primary); }
.theme-card.active { border-color: var(--primary); background: rgba(10,132,255,.1); }
.theme-preview { width: 40px; height: 28px; border-radius: 4px; flex-shrink: 0; display: flex; overflow: hidden; }
.theme-preview-bar { width: 12px; height: 100%; }
.theme-preview-main { flex: 1; }
.theme-name { font-size: 14px; font-weight: 600; color: var(--main-text); }

/* ═══ GIF PICKER ═══ */
.gif-picker { position: absolute; bottom: 80px; left: 20px; width: 360px; max-height: 420px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.5); z-index: 200; display: flex; flex-direction: column; overflow: hidden; }
.gif-picker-header { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--main-header-border); }
.gif-picker-header input { flex: 1; background: var(--main-bg); border: 1px solid var(--input-border); border-radius: 6px; padding: 6px 10px; color: var(--input-text); outline: none; font-size: 13px; }
.gif-picker-header input:focus { border-color: var(--primary); }
.gif-results { flex: 1; overflow-y: auto; padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-height: 200px; }
.gif-results img { width: 100%; border-radius: 6px; cursor: pointer; display: block; }
.gif-results img:hover { opacity: .85; }
.gif-hint { grid-column: 1 / -1; text-align: center; color: var(--main-text-muted); font-size: 13px; padding: 40px 10px; }
.gif-powered { text-align: center; font-size: 10px; color: var(--main-text-muted); padding: 4px; border-top: 1px solid var(--main-header-border); }

/* Slash Commands Management */
.cmd-list { max-height: 300px; overflow-y: auto; }
.cmd-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--main-header-border); }
.cmd-item:last-child { border-bottom: none; }
.cmd-item-info .cmd-name { font-weight: 600; font-size: 14px; color: var(--main-text); }
.cmd-item-info .cmd-desc { font-size: 12px; color: var(--main-text-muted); }

/* ═══ DROPDOWN / CONTEXT MENU ═══ */
.dropdown-menu { 
  position: fixed; 
  background: var(--input-bg); 
  border: 1px solid var(--input-border); 
  border-radius: 10px; 
  padding: 8px; 
  min-width: 240px; 
  width: auto;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 30px rgba(0,0,0,.5); 
  z-index: 500; 
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  white-space: nowrap;
}
.dropdown-user-info { padding: 8px 10px; }
.dropdown-name { font-weight: 700; font-size: 14px; color: var(--main-text); }
.dropdown-username { font-size: 12px; color: var(--main-text-muted); }
.dropdown-divider { height: 1px; background: var(--main-header-border); margin: 4px 0; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: none; background: none; color: var(--main-text); cursor: pointer; border-radius: 6px; font-size: 14px; text-align: left; }
.dropdown-item:hover { background: var(--msg-hover); }
.dropdown-item svg { width: 16px; height: 16px; color: var(--main-text-muted); }
.dropdown-item--danger { color: var(--danger); }
.dropdown-item--danger svg { color: var(--danger); }
.dropdown-item--danger:hover { background: rgba(224, 30, 90, 0.10); }

/* God view (break-glass) status banner */
.godview-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  background: var(--danger); color: #fff;
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.godview-banner svg { width: 16px; height: 16px; flex-shrink: 0; }
.godview-banner #godview-banner-text { flex: 1; }
.godview-exit {
  border: 1px solid rgba(255,255,255,0.55); background: transparent; color: #fff;
  padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.godview-exit:hover { background: rgba(255,255,255,0.16); }

.context-menu { position: fixed; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 8px; padding: 4px; min-width: 180px; box-shadow: 0 4px 20px rgba(0,0,0,.4); z-index: 500; }
.context-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; background: none; color: var(--main-text); cursor: pointer; border-radius: 4px; font-size: 13px; text-align: left; }
.context-menu-item:hover { background: var(--msg-hover); }
.context-menu-item.danger { color: var(--danger); }
.context-menu-item svg { width: 14px; height: 14px; }
.context-menu-divider { height: 1px; background: var(--main-header-border); margin: 4px 0; }

/* Emoji Picker */
.emoji-picker { position: fixed; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 10px; padding: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.4); z-index: 500; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-grid button { background: none; border: none; font-size: 22px; padding: 4px; cursor: pointer; border-radius: 4px; line-height: 1.2; }
.emoji-grid button:hover { background: var(--msg-hover); }

/* Toast */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.3); animation: toastIn .3s ease; }
.toast.success { background: #2EB67D; }
.toast.error { background: #E01E5A; }
.toast.info { background: #0A84FF; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* In-App Visual Notif Toast */
.in-app-toast { background: #1a1f2e !important; border: 1px solid rgba(255,255,255,0.18); color: #fff; display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,0.6); animation: toastIn 0.3s ease; font-size: 14px; cursor: pointer; max-width: 320px; transition: transform 0.2s ease; opacity: 1; }
[data-theme="light"] .in-app-toast { background: #ffffff !important; color: #0C1220; border-color: rgba(0,0,0,0.12); }
.in-app-toast:hover { transform: translateY(-3px); }
.in-app-toast .toast-avatar { width: 32px; height: 32px; border-radius: 50%; background-color: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; flex-shrink: 0; }
.in-app-toast .toast-content { display: flex; flex-direction: column; overflow: hidden; }
.in-app-toast .toast-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-app-toast .toast-body { font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 1; }
[data-theme="light"] .in-app-toast .toast-body { color: #0C1220; }

/* ═══ POLLS ═══ */
.poll-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; padding: 16px; margin-top: 8px; max-width: 440px; }
.poll-question { font-weight: 600; font-size: 15px; margin-bottom: 12px; color: var(--text-primary); }
.poll-option { margin-bottom: 8px; cursor: pointer; }
.poll-option-bar-wrap { background: var(--input-bg); border-radius: 6px; overflow: hidden; position: relative; height: 36px; display: flex; align-items: center; border: 1px solid var(--border-color); transition: border-color 0.2s; }
.poll-option-bar-wrap:hover { border-color: var(--primary); }
.poll-option-bar-wrap.voted { border-color: var(--primary); }
.poll-option-bar { position: absolute; left: 0; top: 0; height: 100%; background: rgba(10,132,255,0.18); transition: width 0.4s ease; border-radius: 6px; }
.poll-option-label { position: relative; z-index: 1; padding: 0 12px; display: flex; align-items: center; gap: 8px; font-size: 13px; flex: 1; }
.poll-option-check { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--primary); background: transparent; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.poll-option-check.checked { background: var(--primary); }
.poll-option-check.checked::after { content: '✓'; font-size: 10px; color: #fff; }
.poll-option-text { flex: 1; }
.poll-option-pct { font-size: 12px; color: var(--sidebar-text-muted); margin-left: auto; font-weight: 500; }
.poll-meta { font-size: 12px; color: var(--sidebar-text-muted); margin-top: 10px; display: flex; justify-content: space-between; align-items: center; }
.poll-close-btn { font-size: 12px; color: #E01E5A; cursor: pointer; background: none; border: none; padding: 0; }
.poll-option-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.poll-option-input { flex: 1; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px; color: var(--input-text); padding: 8px 12px; font-size: 13px; }
.poll-remove-option { background: none; border: none; color: var(--sidebar-text-muted); cursor: pointer; font-size: 14px; padding: 4px 8px; }
.poll-remove-option:hover { color: #E01E5A; }

/* ═══ RESPONSIVE DESIGN ═══ */
.mobile-only { display: none; }
.sidebar-overlay { display: none; }

/* ═══ LARGE SCREENS (> 1400px) ═══ */
@media (min-width: 1400px) {
  .sidebar { width: 280px; }
  .main { flex: 1; }
  .thread-panel { width: 400px; }
  .members-panel { width: 300px; }
  .modal-content { max-width: 600px; }
  .modal-content.modal-wide { max-width: 800px; }
}

/* ═══ TABLETS (768px - 1024px) ═══ */
@media (min-width: 768px) and (max-width: 1024px) {
  .workspace-bar { width: 50px; }
  .sidebar { width: 240px; }
  .main-header { padding: 10px 16px; }
  .header-search { max-width: 300px; }
  .thread-panel { width: 320px; }
  .members-panel { width: 240px; }
  .modal-content { width: 90%; max-width: 520px; }
  .modal-content.modal-wide { width: 95%; max-width: 700px; }
  .messages-container { padding: 16px; }
  .message-input-container { padding: 8px 16px 16px; }
  .msg-image { max-width: 350px; max-height: 250px; }
  .gif-picker { width: 320px; }
}

/* ═══ MOBILE (< 768px) ═══ */
@media (max-width: 768px) {
  .mobile-only { display: flex; }
  
  /* Layout adjustments */
  .workspace-bar { display: none; }
  .sidebar { 
    position: fixed; 
    left: -280px; 
    top: 0; 
    bottom: 0;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    z-index: 150; /* Higher than message input to overlap it */
    transition: left .3s ease; 
    width: 280px;
    box-shadow: 2px 0 10px rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .sidebar.open {
    z-index: 150;
  }
  /* Hide message input when sidebar is open */
  .sidebar.open ~ .main .message-input-container,
  .sidebar.open + .main .message-input-container {
    z-index: 50; /* Lower than sidebar */
  }
  .sidebar-panel {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }
  .sidebar-section-half {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-section-half .nav-list {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,.6); 
    z-index: 149; /* Just below sidebar */
    pointer-events: none;
    backdrop-filter: blur(4px);
  }
  .sidebar-overlay.active,
  .sidebar.open ~ .sidebar-overlay,
  .sidebar.open + .sidebar-overlay { 
    display: block; 
    pointer-events: auto; 
  }
  .thread-panel { 
    display: none !important; 
  }
  
  /* Members panel as mobile modal */
  .members-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 70vh;
    max-height: 70vh;
    border-left: none;
    border-top: 1px solid var(--main-header-border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.3);
    z-index: 200;
    transform: translateY(100%);
    transition: transform .3s ease;
  }
  .members-panel.mobile-open {
    transform: translateY(0);
  }
  .members-panel .members-header {
    padding: 16px;
    border-bottom: 1px solid var(--main-header-border);
  }
  .members-panel .members-list {
    padding: 12px;
    max-height: calc(70vh - 60px);
  }
  
  /* Main content */
  .main { width: 100%; }
  .main-header {
    display: flex;
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 48px;
  }
  .main-header > .header-left,
  .main-header > .header-search,
  .main-header > .header-right { justify-self: unset; }
  .header-left { 
    flex-shrink: 1; 
    min-width: 0; 
    order: 1;
    flex-basis: auto;
  }
  .header-left h3 { 
    font-size: 15px; 
    overflow: hidden; 
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
  }
  .header-desc { 
    display: none; 
  }
  .header-search { 
    flex: 1 1 100%; 
    min-width: 0;
    max-width: none; 
    order: 3;
    margin-top: 4px;
  }
  .header-search-wrap { 
    padding: 6px 10px; 
  }
  .header-search-wrap input { 
    font-size: 14px; 
  }
  .header-right { 
    flex-shrink: 0; 
    gap: 4px; 
    order: 2;
  }
  .header-right .icon-btn { 
    width: 36px; 
    height: 36px; 
    padding: 8px;
  }
  .header-right .icon-btn svg { 
    width: 18px; 
    height: 18px; 
  }

  /* Mobile: show message actions (smiley + three dots) only when message is active */
  .message .msg-actions {
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
  }
  .message.show-actions .msg-actions {
    opacity: 1;
    pointer-events: auto;
  }
  /* Hide channel settings button from header on mobile */
  #channel-settings-btn { 
    display: none; 
  }
  #mobile-menu-btn {
    display: flex;
    width: 36px;
    height: 36px;
  }
  
  /* Messages */
  .messages-container { 
    padding: 12px 16px; 
  }
  .message { 
    padding: 8px 4px; 
  }
  .msg-avatar { 
    width: 32px; 
    height: 32px; 
    font-size: 12px; 
  }
  .msg-author { 
    font-size: 13px; 
  }
  .msg-time { 
    font-size: 11px; 
  }
  .msg-content { 
    font-size: 14px; 
    line-height: 1.5; 
  }
  .msg-image { 
    max-width: 100%; 
    max-height: 250px; 
    width: auto;
  }
  .msg-gif { 
    max-width: 100%; 
    max-height: 200px; 
  }
  .msg-file { 
    padding: 6px 10px; 
    font-size: 12px; 
  }
  
  /* Message input - ensure always visible */
  .message-input-container { 
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 8px));
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--main-bg);
    z-index: 100; /* Lower than sidebar when sidebar is open */
    border-top: 1px solid var(--main-header-border);
    box-shadow: 0 -2px 10px rgba(0,0,0,.2);
    max-width: 100vw;
    width: 100%;
    transition: z-index 0s; /* Instant transition */
  }
  /* Hide message input behind sidebar when sidebar is open */
  .sidebar.open ~ .main .message-input-container {
    z-index: 50;
  }
  .main-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding-bottom: calc(75px + env(safe-area-inset-bottom, 0));
  }
  .messages-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    min-height: 0;
  }
  .input-wrapper { 
    padding: 6px 8px; 
  }
  #message-input { 
    padding: 8px 4px; 
    font-size: 14px; 
  }
  .input-action { 
    padding: 6px; 
    min-width: 36px;
    min-height: 36px;
  }
  .input-action svg { 
    width: 18px; 
    height: 18px; 
  }
  /* Mobile composer: keep only attach + send visible */
  #gif-btn,
  #emoji-btn,
  #poll-btn {
    display: none;
  }
  .mobile-attach-item {
    display: flex;
  }
  
  /* Sidebar */
  .sidebar-header { 
    padding: 12px 14px; 
  }
  .sidebar-header h2 { 
    font-size: 15px; 
  }
  .nav-item { 
    padding: 8px 12px; 
    font-size: 14px; 
  }
  .section-header { 
    padding: 8px 10px; 
    font-size: 12px; 
  }
  
  /* Modals */
  .modal { 
    padding: 16px; 
    align-items: flex-start;
    padding-top: 20px;
  }
  .modal-content { 
    width: 100%; 
    max-width: 100%;
    max-height: 90vh;
    margin: 0;
    border-radius: 12px 12px 0 0;
  }
  .modal-content.modal-wide { 
    width: 100%; 
  }
  .modal-header { 
    padding: 14px 16px; 
  }
  .modal-header h3 { 
    font-size: 15px; 
  }
  .modal-body { 
    padding: 16px; 
  }
  .modal-footer { 
    padding: 12px 16px; 
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-footer button { 
    flex: 1;
    min-width: 120px;
  }
  
  /* Forms */
  .form-group { 
    margin-bottom: 16px; 
  }
  .form-group input[type="text"], 
  .form-group input[type="password"], 
  .form-group input[type="email"],
  .form-group textarea, 
  .form-group select {
    padding: 10px 12px;
    font-size: 15px;
  }
  
  /* Auth screen */
  .auth-container { 
    width: 90%; 
    max-width: 400px;
    padding: 28px 24px; 
    margin: 20px;
  }
  .auth-logo h1 { 
    font-size: 24px; 
  }
  .auth-logo p { 
    font-size: 13px; 
  }
  .oauth-buttons { 
    flex-direction: column; 
    gap: 8px; 
  }
  .oauth-btn { 
    width: 100%; 
  }
  
  /* Dropdowns and popups */
  .mention-popup { 
    width: calc(100% - 24px); 
    max-width: 280px; 
  }
  .slash-popup { 
    max-height: 200px; 
  }
  .attach-dropdown { 
    min-width: 160px; 
  }
  .dropdown-menu { 
    min-width: 280px; 
    width: auto;
    max-width: calc(100vw - 32px);
    padding: 10px;
  }
  .dropdown-item {
    padding: 10px 12px;
    font-size: 15px;
  }
  .dropdown-user-info {
    padding: 10px 12px;
  }
  .context-menu { 
    min-width: 160px; 
    max-width: calc(100vw - 32px);
  }
  
  /* GIF Picker */
  .gif-picker { 
    bottom: 70px; 
    left: 12px; 
    right: 12px;
    width: auto;
    max-width: none;
    max-height: 50vh;
  }
  .gif-results { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 4px; 
  }
  
  /* Thread panel - hidden on mobile */
  .thread-panel { 
    display: none !important; 
  }
  
  /* Members list */
  .members-list { 
    padding: 8px 12px; 
  }
  .member-item { 
    padding: 8px 10px; 
  }
  
  /* Profile */
  .profile-card .modal-body { 
    padding: 0; 
  }
  .profile-banner { 
    height: 60px; 
  }
  .profile-avatar-lg { 
    width: 60px; 
    height: 60px; 
    margin: -30px auto 8px; 
    font-size: 20px; 
  }
  .profile-name { 
    font-size: 18px; 
  }
  
  /* Admin panel */
  .admin-form-row { 
    grid-template-columns: 1fr; 
    gap: 12px; 
  }
  
  /* Theme picker */
  .theme-list { 
    grid-template-columns: 1fr; 
    gap: 8px; 
  }
  
  /* Toast */
  .toast-container { 
    bottom: 16px; 
    right: 16px; 
    left: 16px;
    right: auto;
  }
  .toast { 
    width: 100%;
    max-width: none;
  }
  
  /* Call overlay */
  .call-content { 
    padding: 32px 24px; 
  }
  .call-participants { 
    gap: 12px; 
  }
  .call-participant { 
    width: 60px; 
    height: 60px; 
    font-size: 18px; 
  }
  .call-control-btn { 
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255,255,255,.24);
    background: rgba(255,255,255,.14);
    box-shadow: 0 8px 22px rgba(0,0,0,.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .call-controls {
    gap: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(3,8,20,.45);
    border: 1px solid rgba(255,255,255,.08);
  }
  .call-control-btn svg,
  .call-control-btn i {
    width: 24px;
    height: 24px;
  }
  .call-control-btn.danger {
    border-color: rgba(224,30,90,.35);
    box-shadow: 0 10px 26px rgba(224,30,90,.24);
  }
  
  /* Incoming call */
  .incoming-call { 
    left: 16px; 
    right: 16px;
    transform: none;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  .incoming-call-actions { 
    width: 100%;
    justify-content: stretch;
    gap: 10px;
  }
  .incoming-call-actions button { 
    flex: 1;
    min-height: 44px;
    font-size: 14px;
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
  }
  
  /* Link previews */
  .link-preview { 
    max-width: 100%; 
    flex-direction: column;
  }
  .link-preview-image { 
    width: 100%; 
    height: 150px; 
  }
  
  /* File preview */
  .file-preview { 
    gap: 6px; 
  }
  .file-preview-item { 
    font-size: 12px; 
    padding: 6px 8px; 
  }
  
  /* Emoji picker */
  .emoji-grid { 
    grid-template-columns: repeat(6, 1fr); 
  }
  .emoji-grid button { 
    font-size: 20px; 
    padding: 6px; 
  }
  
  /* Better touch targets */
  button, 
  .icon-btn, 
  .nav-item, 
  .member-item,
  .user-item {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Mobile profile button */
  #user-menu-btn-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #user-menu-btn-mobile .mini-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  
  /* Ensure header buttons are visible */
  .header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
  }
  
  /* Mobile panel overlay */
  .mobile-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 199;
    display: none;
    backdrop-filter: blur(4px);
  }
  .mobile-panel-overlay.active {
    display: block;
  }
  
  /* Pinned panel mobile */
  .pinned-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 70vh;
    max-height: 70vh;
    border-left: none;
    border-top: 1px solid var(--main-header-border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.3);
    z-index: 200;
    transform: translateY(100%);
    transition: transform .3s ease;
  }
  .pinned-panel.mobile-open {
    transform: translateY(0);
  }
  
  /* Close panels when clicking overlay */
  .mobile-panel-overlay.active ~ .members-panel.mobile-open,
  .mobile-panel-overlay.active ~ .pinned-panel.mobile-open {
    transform: translateY(100%);
  }
  
  /* Improved spacing */
  .sidebar-panel { 
    padding: 6px 0; 
  }
  .load-more { 
    padding: 12px; 
  }
  
  /* Typing indicator */
  .typing-indicator { 
    padding: 6px 16px; 
    font-size: 12px; 
  }
}

/* ═══ SMALL MOBILE (< 480px) ═══ */
@media (max-width: 480px) {
  .auth-container { 
    padding: 24px 20px; 
  }
  .main-header { 
    padding: 8px 10px; 
  }
  .header-left h3 { 
    font-size: 14px; 
    max-width: 150px;
  }
  .messages-container { 
    padding: 10px 12px; 
  }
  .message-input-container { 
    padding: 8px 10px 10px; 
  }
  .modal-body { 
    padding: 14px; 
  }
  .gif-results { 
    grid-template-columns: 1fr 1fr; 
  }
  .emoji-grid { 
    grid-template-columns: repeat(5, 1fr); 
  }
  .header-search { 
    order: 3;
    margin-top: 6px;
  }
  .header-right { 
    gap: 2px; 
  }
  .header-right .icon-btn { 
    width: 32px; 
    height: 32px; 
    padding: 6px;
  }
}

/* ═══ PRIVATE CHANNEL VISUAL DISTINCTION ═══ */
.nav-icon-private {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.private-lock-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  flex-shrink: 0;
}
.nav-item-private .nav-label {
  font-style: italic;
  opacity: 0.85;
}
.nav-item-private::after {
  content: '';
  display: none;
}

/* ═══ CHANNEL MEMBER MANAGEMENT ═══ */
.member-row {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  gap: 10px;
}
.member-row:hover {
  background: var(--sidebar-hover);
}
.member-row .member-info {
  flex: 1;
  min-width: 0;
}
.member-username {
  font-size: 12px;
  color: var(--main-text-muted);
}
.member-role-tag {
  font-size: 10px;
  background: var(--primary);
  color: white;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.member-role-tag:empty {
  display: none;
}
.btn-remove-member {
  background: none;
  border: none;
  color: var(--main-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0;
  transition: all .2s;
  flex-shrink: 0;
}
.member-row:hover .btn-remove-member {
  opacity: 1;
}
.btn-remove-member:hover {
  color: #ff4d4f;
  background: rgba(255,77,79,.1);
}
.add-members-actions {
  margin-bottom: 10px;
}
.btn-sm {
  font-size: 12px;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-sm i, .btn-sm svg {
  width: 14px;
  height: 14px;
}
#channel-members-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--sidebar-hover);
  border-radius: 6px;
  padding: 4px;
}

/* ═══ LINK PREVIEWS ═══ */
.link-preview {
  display: flex;
  margin-top: 8px;
  max-width: 480px;
  background: rgba(80,160,255,.04);
  border: 1px solid var(--main-header-border);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  overflow: hidden;
  cursor: pointer;
  transition: background var(--transition);
}
.link-preview:hover {
  background: rgba(80,160,255,.08);
}
.link-preview-image {
  width: 100px;
  flex-shrink: 0;
}
.link-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.link-preview-body {
  padding: 8px 12px;
  min-width: 0;
  flex: 1;
}
.link-preview-site {
  font-size: 11px;
  font-weight: 600;
  color: var(--main-text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 2px;
}
.link-preview-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-preview-desc {
  font-size: 13px;
  color: var(--main-text-muted);
  margin-top: 2px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ═══ CALL OVERLAY ═══ */
.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6,11,24,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.call-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 48px;
}
.call-status {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -.3px;
}
.call-participants {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.call-participant {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  background-size: cover;
  background-position: center;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  border: 3px solid rgba(255,255,255,.15);
  box-shadow: 0 0 24px rgba(10,132,255,.3);
  animation: callPulse 2s ease-in-out infinite;
  position: relative;
}
.call-participant-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.call-participant-name {
  position: absolute !important;
  bottom: -28px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: rgba(255,255,255,.9) !important;
  white-space: nowrap !important;
  max-width: 120px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: center !important;
  background: rgba(0,0,0,0.6);
  padding: 3px 8px;
  border-radius: 12px;
  line-height: 1.2;
}

/* ═══ ONGOING CALL BANNER ═══ */
.call-ongoing-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: rgba(46,182,125,.12);
  border-bottom: 1px solid rgba(46,182,125,.25);
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: #2EB67D;
  min-height: 40px;
}
.call-banner-icon { font-size: 16px; flex-shrink: 0; }
.call-banner-text { flex: 1; }
.call-banner-text strong { color: #fff; }
.call-banner-join {
  background: #2EB67D;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: .3px;
  transition: background 0.2s;
}
.call-banner-join:hover { background: #238b5f; }

/* ═══ PINNED MESSAGE BANNER ═══ */
.pinned-message-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--main-header-bg);
  border-bottom: 1px solid var(--main-header-border);
  flex-shrink: 0;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.2s;
  position: relative;
  z-index: 5;
}
.pinned-message-banner:hover { background: var(--hover-bg); }
.pinned-banner-icon { color: var(--primary); display: flex; align-items: center; justify-content: center; }
.pinned-banner-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.pinned-banner-title { font-size: 11.5px; font-weight: 600; color: var(--primary); margin-bottom: 2px; }
.pinned-banner-text { font-size: 13px; color: var(--main-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px;}
.pinned-banner-text .pinned-author { font-weight: 600; }

@keyframes callPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(10,132,255,.3); }
  50% { box-shadow: 0 0 36px rgba(10,132,255,.5); }
}
.call-controls {
  display: flex;
  gap: 16px;
}
.call-control-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 0;
}
.call-control-btn:hover {
  background: rgba(255,255,255,.2);
}
.call-control-btn.danger {
  background: var(--danger);
}
.call-control-btn.danger:hover {
  background: #c4174d;
}
.call-control-btn.muted {
  background: rgba(255,255,255,.25);
}
.call-control-btn svg,
.call-control-btn i {
  width: 22px;
  height: 22px;
}

/* ═══ INCOMING CALL BANNER ═══ */
.incoming-call {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(12,18,35,.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(10,132,255,.4);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04) inset;
  animation: slideDown .3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.incoming-call-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.incoming-call-info svg,
.incoming-call-info i {
  width: 20px;
  height: 20px;
  color: #2EB67D;
  animation: ring 1.2s ease-in-out infinite;
}
@keyframes ring {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-10deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-5deg); }
}
.incoming-call-actions {
  display: flex;
  gap: 8px;
}
#accept-call-btn,
#decline-call-btn {
  width: auto;
  min-width: 112px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .1px;
}
#accept-call-btn {
  border: 1px solid rgba(46,182,125,.5);
  background: linear-gradient(135deg, #2EB67D, #239a67);
}
#accept-call-btn:hover {
  background: linear-gradient(135deg, #33c686, #2aa973);
}
#decline-call-btn {
  border: 1px solid rgba(224,30,90,.5);
  background: rgba(224,30,90,.14);
  color: #ff8cab;
}
#decline-call-btn:hover {
  background: rgba(224,30,90,.24);
  color: #ffb2c6;
}

/* ═══ HIGHLIGHT MESSAGE (jump-to) ═══ */
.highlight-message {
  animation: highlightFlash 3s ease;
}
@keyframes highlightFlash {
  0% { background: rgba(10,132,255,.3); }
  30% { background: rgba(10,132,255,.2); }
  100% { background: transparent; }
}

/* ═══ EMAIL INPUT IN FORMS ═══ */
.form-group input[type="email"] {
  width: 100%; padding: 8px 12px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px; color: var(--input-text);
}
.form-group input[type="email"]:focus { border-color: var(--primary); outline: none; }

/* ═══ PASSWORD CHANGE SECTION ═══ */
.password-change-section {
  border-top: 1px solid var(--input-border);
  padding-top: 8px;
  margin-top: 12px;
}
.password-change-section .form-group { margin-bottom: 10px; }
.password-change-section input[type="password"] {
  width: 100%; padding: 8px 12px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px; color: var(--input-text); font-size: 13px;
}
.password-change-section input[type="password"]:focus { border-color: var(--primary); outline: none; }
#change-pw-btn { margin-top: 4px; }

/* ═══ IMAGE VIEWER MODAL ═══ */
.image-viewer-content {
  width: 90vw;
  max-width: 1200px;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.image-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--main-header-border);
  flex-shrink: 0;
}
.image-viewer-filename {
  font-size: 14px;
  font-weight: 600;
  color: var(--main-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.image-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.image-viewer-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 20px;
  min-height: 0;
}
.image-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* ═══ EXTERNAL INVITE — OAuth only (no password / register) ═══ */
.invite-external-only #login-username,
.invite-external-only #login-password,
.invite-external-only #login-btn,
.invite-external-only .auth-divider,
.invite-external-only #show-register,
.invite-external-only #register-form {
  display: none !important;
}

/* ═══ ADMIN BLOCKED USER ═══ */
.admin-user-blocked { opacity: 0.55; }
.admin-user-blocked .member-avatar { filter: grayscale(1); }

/* ═══ INVITE MODAL ═══ */
.invite-channel-list { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.invite-channel-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--main-text); font-size: 13px; }
.invite-channel-item:hover { background: var(--msg-hover); }
.invite-channel-item input[type="checkbox"] { accent-color: var(--primary); }
#invite-user-type {
  width: 100%; padding: 8px 12px; background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 6px; color: var(--input-text); font-size: 13px;
}
#invite-user-type:focus { border-color: var(--primary); outline: none; }

/* ═══ DM HIDE BUTTON ═══ */
.dm-hide-btn {
  display: none; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border: none !important;
  background: transparent !important;
  color: var(--sidebar-text);
  opacity: 0.45;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  border-radius: 4px;
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1;
  transition: opacity 0.15s;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow: none;
}
.dm-hide-btn:hover { opacity: 0.95; background: transparent !important; }
.nav-item:hover .dm-hide-btn { display: flex; }

/* Mobile: avoid showing the default "button" pill/background */
@media (max-width: 768px) {
  .dm-hide-btn {
    display: flex !important;
    opacity: 0.75;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  .dm-hide-btn:hover { opacity: 1; background: transparent !important; }
}

/* ═══ INVITE ACCEPTANCE BANNER ═══ */
.invite-banner {
  background: var(--primary); color: #fff; padding: 10px 16px; text-align: center;
  font-size: 14px; border-radius: 8px; margin-bottom: 12px;
}
.invite-banner strong { font-weight: 700; }

/* ═══ QUICK SWITCHER (⌘K) ═══ */
.quick-switcher {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
}
.quick-switcher-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
}
.quick-switcher-box {
  position: relative; width: min(640px, 92vw);
  background: var(--main-bg, #1a1d29); color: var(--main-text, #fff);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}
.quick-switcher-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.quick-switcher-input-wrap .quick-switcher-icon { width: 18px; height: 18px; opacity: 0.6; }
.quick-switcher-input-wrap input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--main-text, #fff); font-size: 15px;
}
.quick-switcher-kbd {
  font-family: ui-monospace, monospace; font-size: 11px;
  padding: 2px 6px; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; opacity: 0.6;
}
.quick-switcher-results {
  max-height: 50vh; overflow-y: auto; padding: 6px;
}
.quick-switcher-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 6px; cursor: pointer;
  font-size: 14px;
}
.quick-switcher-item .qs-icon {
  width: 22px; text-align: center; opacity: 0.7; font-size: 13px; flex-shrink: 0;
}
.quick-switcher-item .qs-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-switcher-item .qs-sub { opacity: 0.55; font-size: 12px; margin-left: 8px; }
.quick-switcher-item.active { background: var(--primary, #0a84ff); color: #fff; }
.quick-switcher-item.active .qs-sub, .quick-switcher-item.active .qs-icon { opacity: 0.9; color: #fff; }
.quick-switcher-footer {
  padding: 8px 14px; border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px; opacity: 0.55;
}
.quick-switcher-footer kbd {
  font-family: ui-monospace, monospace; font-size: 10px;
  padding: 1px 5px; margin: 0 3px;
  background: rgba(255,255,255,0.06); border-radius: 3px;
}
.quick-switcher-empty { padding: 24px; text-align: center; opacity: 0.55; font-size: 13px; }

/* ═══ SHORTCUTS HELP MODAL ═══ */
.shortcuts-content { width: min(680px, 94vw); }
.shortcuts-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.shortcuts-col h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; }
.shortcut-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 13px; gap: 10px;
}
.shortcut-row > span:first-child { opacity: 0.8; }
.kbd-group { display: inline-flex; gap: 3px; flex-shrink: 0; }
.kbd-group kbd, .shortcut-row kbd {
  font-family: ui-monospace, monospace; font-size: 11px;
  padding: 2px 6px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 4px;
  min-width: 16px; text-align: center; display: inline-block;
}
@media (max-width: 600px) { .shortcuts-body { grid-template-columns: 1fr; } }

/* ═══ SCHEDULE / REMINDER POPOVERS ═══ */
.schedule-popover {
  position: absolute; z-index: 9000;
  min-width: 260px; background: var(--main-bg, #1a1d29); color: var(--main-text, #fff);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45); padding: 6px;
}
.schedule-popover-header {
  padding: 10px 12px 6px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.55;
}
.schedule-quick-option {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; background: transparent; border: 0; color: inherit;
  font-size: 14px; border-radius: 6px; cursor: pointer;
}
.schedule-quick-option:hover { background: rgba(255,255,255,0.06); }
.schedule-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 6px 0; }
.schedule-custom { padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.schedule-custom label { font-size: 12px; opacity: 0.7; }
.schedule-custom input[type="datetime-local"] {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; padding: 6px 8px; color: inherit; font-size: 13px;
  color-scheme: dark;
}

/* Schedule button in composer */
.send-schedule-btn { opacity: 0.6; }
.send-schedule-btn:hover { opacity: 1; }

/* Scheduled list modal */
.scheduled-list { display: flex; flex-direction: column; gap: 8px; }
.scheduled-list-item {
  padding: 10px 12px; background: rgba(255,255,255,0.04); border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
.scheduled-list-item .sched-target { font-size: 12px; opacity: 0.6; margin-bottom: 4px; }
.scheduled-list-item .sched-time { font-size: 12px; opacity: 0.8; margin-top: 6px; }
.scheduled-list-item .sched-content { font-size: 14px; white-space: pre-wrap; }
.scheduled-list-item .sched-actions { display: flex; gap: 8px; margin-top: 8px; }
.empty-hint { text-align: center; opacity: 0.55; font-size: 13px; padding: 20px; }

/* ═══ Smart UX feature pack v3 ═══ */

/* Sidebar: draft indicator + muted state */
.nav-item .nav-draft {
  color: #f6c453; font-size: 12px; margin-left: 6px;
  opacity: 0.85;
}
.nav-item .nav-muted {
  margin-left: 4px; font-size: 11px; opacity: 0.55;
}
.nav-item.muted .nav-label { opacity: 0.55; }
.nav-item.muted { font-weight: normal; }
.unread-badge.muted {
  background: rgba(255,255,255,0.15) !important;
  color: rgba(255,255,255,0.6) !important;
}

/* DND indicator in main header */
.dnd-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px !important;
  border-radius: 20px; padding: 4px 10px !important;
  width: auto !important; min-width: 36px;
  color: var(--main-text-muted);
  background: transparent;
}
.dnd-indicator:hover { color: var(--main-text); background: rgba(255,255,255,0.06); }
.dnd-indicator i { width: 16px; height: 16px; }
.dnd-indicator.active {
  background: rgba(246,196,83,0.14);
  color: #f6c453;
}
.dnd-indicator .dnd-label { font-weight: 600; font-size: 12px; }

/* DND snooze popover */
.dnd-popover {
  position: fixed; top: 60px; left: 200px; z-index: 1000;
  background: var(--bg-elevated, #1a1f2e);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 8px; min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: flex; flex-direction: column; gap: 2px;
}
.dnd-popover .dnd-title {
  font-size: 12px; opacity: 0.6; padding: 6px 10px 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.dnd-popover .dnd-option {
  text-align: left; background: transparent; border: none;
  color: inherit; padding: 8px 10px; border-radius: 6px;
  cursor: pointer; font-size: 14px;
}
.dnd-popover .dnd-option:hover { background: rgba(255,255,255,0.06); }
.dnd-popover .dnd-divider {
  height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0;
}

/* Workspace bar badge for activity inbox */
.ws-nav-btn { position: relative; }
.ws-nav-badge {
  position: absolute; top: 4px; right: 4px;
  background: #E01E5A; color: #fff; font-size: 10px;
  padding: 1px 5px; border-radius: 10px; min-width: 14px;
  line-height: 12px; text-align: center;
}

/* Activity list */
.activity-list { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.activity-item {
  display: flex; gap: 10px; padding: 10px;
  background: rgba(255,255,255,0.03); border-radius: 8px;
  cursor: pointer; border: 1px solid transparent;
}
.activity-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); }
.activity-item .ai-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.activity-item .ai-body { flex: 1; min-width: 0; }
.activity-item .ai-meta { font-size: 12px; opacity: 0.65; margin-bottom: 2px; }
.activity-item .ai-text {
  font-size: 13px; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.activity-item .ai-time { font-size: 11px; opacity: 0.5; margin-top: 4px; }
.activity-item.kind-mention { border-left: 3px solid #f6c453; }
.activity-item.kind-thread_reply { border-left: 3px solid #36C5F0; }
.activity-item.kind-reaction { border-left: 3px solid #E01E5A; }

/* "New" messages divider */
.new-divider {
  display: flex; align-items: center; text-align: center;
  margin: 16px 12px; color: #E01E5A; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
}
.new-divider::before, .new-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224,30,90,0.5), rgba(224,30,90,0.5), transparent);
}
.new-divider span {
  padding: 0 12px; background: rgba(224,30,90,0.1);
  border-radius: 10px; padding: 2px 10px;
}

/* Jump-to-new floating button */
.jump-to-new {
  position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%);
  background: #E01E5A; color: white; border: none;
  padding: 8px 16px; border-radius: 20px; cursor: pointer;
  font-size: 13px; font-weight: 600; display: none;
  box-shadow: 0 4px 14px rgba(224,30,90,0.4); z-index: 100;
}
.jump-to-new:hover { background: #C01850; }

/* Message delivery status */
.message .msg-status {
  display: inline-block; margin-left: 6px; font-size: 11px;
  opacity: 0.5; vertical-align: middle;
}
.message.msg-sending { opacity: 0.65; }
.message.msg-failed .msg-status { color: #ff5c5c; opacity: 1; }
.message.msg-failed .msg-retry-btn {
  background: rgba(255,92,92,0.15); color: #ff5c5c;
  border: none; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; margin-left: 6px; cursor: pointer;
}

/* Search filter hint bar */
.search-hint-bar {
  padding: 6px 10px; font-size: 11px; opacity: 0.65;
  background: rgba(255,255,255,0.04); border-radius: 6px;
  margin: 4px 8px;
}
.search-hint-bar code {
  background: rgba(255,255,255,0.08); padding: 1px 5px;
  border-radius: 3px; font-size: 10px; margin: 0 2px;
}

/* Room context menu (right-click on channel/DM) */
#room-context-menu .context-menu-item { min-width: 180px; }

/* Search scope + filter chips */
.search-scope-bar { display: flex; gap: 6px; padding: 6px 8px 2px; flex-wrap: wrap; }
.scope-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: inherit; font-size: 12px; padding: 3px 10px;
  border-radius: 14px; cursor: pointer;
}
.scope-chip:hover:not(:disabled) { background: rgba(255,255,255,0.08); }
.scope-chip.active {
  background: rgba(224,30,90,0.2); color: #ff5c8c;
  border-color: rgba(224,30,90,0.3);
}
.scope-chip:disabled { opacity: 0.35; cursor: not-allowed; }
.search-filter-chips {
  padding: 4px 8px 6px; display: flex; flex-wrap: wrap; gap: 4px;
}
.filter-chip {
  font-size: 11px; background: rgba(54,197,240,0.12);
  color: #36C5F0; padding: 2px 8px; border-radius: 10px;
  border: 1px solid rgba(54,197,240,0.25);
}
/* App Platform — Block Kit */
.own-blocks { margin-top: 8px; display: flex; flex-direction: column; gap: 6px;
  border-left: 3px solid #ECB22E; padding: 8px 12px; background: rgba(74,21,75,0.04);
  border-radius: 0 6px 6px 0; }
.own-block-header h3 { margin: 0 0 2px 0; font-size: 15px; color: #1D0A1E; }
.own-block-section { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.own-block-section-main { flex: 1; line-height: 1.5; }
.own-block-section-acc { flex: 0 0 auto; }
.own-block-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 4px; font-size: 13px; }
.own-block-divider { border: 0; border-top: 1px solid rgba(0,0,0,0.08); margin: 2px 0; }
.own-block-context { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: #64748b; }
.own-block-ctx-text { }
.own-block-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.own-block-btn { display: inline-block; padding: 5px 12px; border-radius: 4px; font-size: 13px;
  cursor: pointer; border: 1px solid rgba(0,0,0,0.15); background: #fff; color: #1e293b;
  text-decoration: none; font-family: inherit; }
.own-block-btn:hover { background: #f1f5f9; }
.own-block-btn:disabled { opacity: 0.5; cursor: wait; }
.own-block-btn.own-btn-primary { background: #2EB67D; color: #fff; border-color: #2EB67D; }
.own-block-btn.own-btn-danger { background: #E01E5A; color: #fff; border-color: #E01E5A; }
.own-block-img { max-width: 100%; border-radius: 4px; }

/* ───────────────────────── Help & Guide (How-To) ───────────────────────── */
.help-modal .help-content {
  width: 1040px;
  max-width: 94vw;
  height: 86vh;
  max-height: 860px;
  padding: 0;
}
.help-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--main-header-border);
}
.help-header-title { display: flex; align-items: center; gap: 9px; }
.help-header-title h3 { font-size: 16px; font-weight: 700; margin: 0; color: var(--main-text); }
.help-header-title i { color: var(--primary); }
.help-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 7px 12px;
  max-width: 460px;
}
.help-search-wrap i { width: 16px; height: 16px; color: var(--main-text-muted); }
.help-search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--input-text);
  font-size: 14px;
  font-family: var(--font);
}
.help-body { flex: 1; display: flex; min-height: 0; }
.help-nav {
  width: 248px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 12px 8px 24px;
  border-right: 1px solid var(--main-header-border);
  background: var(--sidebar-bg);
}
.help-nav-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--sidebar-text-muted);
  padding: 14px 12px 4px;
}
.help-nav-link {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13.5px;
  color: var(--sidebar-text);
  cursor: pointer;
  font-family: var(--font);
  line-height: 1.3;
}
.help-nav-link:hover { background: var(--sidebar-hover); }
.help-nav-link.active { background: var(--sidebar-active); color: var(--sidebar-active-text); font-weight: 600; }
.help-nav-home { font-weight: 600; margin-bottom: 4px; }
.help-main {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px 48px;
  color: var(--main-text);
}
.help-topic { max-width: 760px; }
.help-breadcrumb {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--primary);
  margin-bottom: 6px;
}
.help-topic-title { font-size: 24px; font-weight: 800; margin: 0 0 12px; color: var(--main-text); }
.help-topic-intro { font-size: 16px; line-height: 1.6; color: var(--main-text); margin: 0 0 8px; }
.help-topic-desc { font-size: 15px; line-height: 1.65; color: var(--main-text); margin: 0 0 16px; }
.help-section-h { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--main-text-muted); margin: 22px 0 10px; }
.help-location {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--main-text);
  margin: 4px 0 18px;
}
.help-location i { width: 16px; height: 16px; color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.help-shot {
  margin: 0 0 18px;
  border: 1px solid var(--main-header-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--input-bg);
}
.help-shot img { display: block; width: 100%; height: auto; }
.help-shot figcaption {
  font-size: 13px;
  color: var(--main-text-muted);
  padding: 9px 14px;
  border-top: 1px solid var(--main-header-border);
}
.help-shot--missing { display: none; }
.help-steps { margin: 0 0 8px; padding-left: 22px; }
.help-steps li { font-size: 15px; line-height: 1.6; color: var(--main-text); margin-bottom: 9px; }
.help-tips {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 4px 18px 14px;
  margin-top: 18px;
}
.help-tips .help-section-h { margin-top: 14px; }
.help-tips ul { margin: 0; padding-left: 20px; }
.help-tips li { font-size: 14px; line-height: 1.55; color: var(--main-text); margin-bottom: 7px; }
.help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.help-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color var(--transition), transform var(--transition);
}
.help-result:hover { border-color: var(--primary); transform: translateY(-1px); }
.help-result-title { font-size: 14.5px; font-weight: 700; color: var(--main-text); }
.help-result-summary { font-size: 13px; line-height: 1.45; color: var(--main-text-muted); }
.help-result-cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); margin-top: 2px; }
@media (max-width: 768px) {
  .help-modal .help-content { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .help-header { flex-wrap: wrap; gap: 10px; }
  .help-search-wrap { order: 3; max-width: none; flex-basis: 100%; }
  .help-body { flex-direction: column; }
  .help-nav {
    width: 100%;
    max-height: 156px;
    border-right: none;
    border-bottom: 1px solid var(--main-header-border);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-content: flex-start;
  }
  .help-nav-cat { width: 100%; padding: 6px 8px 2px; }
  .help-nav-link { width: auto; padding: 6px 10px; border: 1px solid var(--input-border); }
  .help-main { padding: 18px 18px 40px; }
  .help-topic-title { font-size: 20px; }
}
