/* ============================================
   Teal Chat - teal.net Inspired Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* teal.net Color Palette (Dark Mode) */
    --bg-primary: #0A0E14;
    --bg-secondary: #0F1319;
    --bg-tertiary: #060A10;
    --bg-modifier-hover: #151A23;
    --bg-modifier-active: #1A2030;
    --accent: #3BC4CA;
    --accent-hover: #2AABB1;
    --accent-light: rgba(59, 196, 202, 0.15);
    --accent-dim: rgba(59, 196, 202, 0.2);
    --text-primary: #EFF3F7;
    --text-secondary: #C8D1DB;
    --text-muted: #6B7A8D;
    --border: #1A1F2A;
    --input-bg: #0D1118;
    --success: #27C93F;
    --danger: #FF5F56;
    --warning: #FFBD2E;
    --scrollbar-thumb: #1A1F2A;
    --scrollbar-track: transparent;
    --teal-glow: 0 0 60px rgba(59, 196, 202, 0.15);
    --clip-corner: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);

    /* Layout */
    --header-height: 48px;
    --sidebar-width: 240px;
    --members-width: 240px;
    --input-height: 68px;

    /* Typography */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-code: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.4s ease;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }
button { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #252B38; }

/* ===== App Layout ===== */
.app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    /* Push content below the translucent status bar when installed as a PWA */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* ===== Left Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 20;
    border-right: 1px solid var(--border);
}
.sidebar-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}
.server-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: text-shadow 0.4s ease, color 0.4s ease;
    cursor: default;
}
.server-name:hover {
    text-shadow: 0 0 20px rgba(59, 196, 202, 0.5), 0 0 40px rgba(59, 196, 202, 0.2);
    color: var(--accent);
}
.server-name-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.server-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1;
    margin-top: -1px;
}
.channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.dm-divider {
    padding: 12px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    border-top: 1px solid var(--border);
}
.dm-list {
    overflow-y: auto;
    max-height: 200px;
    padding: 0 8px 4px;
}
.dm-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
    gap: 8px;
}
.dm-item:hover {
    background: var(--bg-modifier-hover);
    color: var(--text-primary);
}
.dm-item.active {
    background: var(--bg-modifier-active);
    color: #fff;
}
.dm-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    position: relative;
}
.dm-avatar-initial {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    flex-shrink: 0;
}
.channel-category {
    padding: 18px 8px 4px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* Channel Item with top accent bar animation */
.channel-item {
    display: flex;
    align-items: center;
    padding: 6px 8px 6px 16px;
    margin: 1px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.4s ease, color 0.4s ease;
    font-size: 15px;
    position: relative;
    overflow: hidden;
}
.channel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.4s ease;
}
.channel-item:hover::before {
    transform: scaleX(1);
}
.channel-item:hover {
    background: var(--bg-modifier-hover);
    color: var(--text-primary);
}
.channel-item.active {
    background: var(--bg-modifier-active);
    color: #fff;
}
.channel-item.active::before {
    transform: scaleX(1);
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.channel-item .hash {
    color: var(--text-muted);
    margin-right: 6px;
    font-size: 18px;
    font-weight: 500;
}
.channel-item.dragging { opacity: 0.4; }
.channel-item.drop-above { border-top: 2px solid var(--accent); }
.channel-item.drop-below { border-bottom: 2px solid var(--accent); }
.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 14px;
    margin-right: 4px;
    padding: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.channel-item:hover .drag-handle { opacity: 0.6; }
.channel-item .ch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-item .unread-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    border-radius: 8px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    line-height: 18px;
}

/* User Panel */
.user-panel {
    display: flex;
    align-items: center;
    padding: 8px;
    padding-bottom: max(8px, calc(8px + env(safe-area-inset-bottom, 0px)));
    background: var(--bg-tertiary);
    gap: 8px;
    border-top: 1px solid var(--border);
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}
.user-status-text {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    background: var(--bg-primary);
}

/* Channel Header */
.channel-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    gap: 4px;
    background: var(--bg-secondary);
}
.channel-header .hash {
    color: var(--text-muted);
    font-size: 22px;
    font-weight: 600;
    margin-right: 2px;
}
.channel-header .channel-name {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    color: var(--text-primary);
}
.channel-header .channel-desc {
    color: var(--text-muted);
    font-size: 13px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

/* ===== Messages ===== */
.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}
.messages-list {
    margin-top: auto;
    padding: 16px 0 8px;
}
.load-more {
    text-align: center;
    padding: 8px;
}
.message {
    padding: 2px 48px 2px 72px;
    position: relative;
    min-height: 28px;
    display: flex;
    flex-direction: column;
    transition: background 0.2s ease;
}
.message:hover {
    background: var(--bg-modifier-hover);
}
.message.grouped {
    padding-top: 0;
    min-height: 22px;
}
.message-avatar {
    position: absolute;
    left: 16px;
    top: 4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.message-avatar:hover {
    box-shadow: 0 0 12px rgba(59, 196, 202, 0.3);
}
.message-avatar img { width: 100%; height: 100%; object-fit: cover; }
.grouped .message-avatar { display: none; }
.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.grouped .message-header { display: none; }
.message-author {
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    color: var(--text-primary);
    transition: color 0.2s ease;
}
.message-author:hover { text-decoration: underline; }
.message-author.admin { color: var(--accent); }
.message-timestamp {
    font-size: 11px;
    color: var(--text-muted);
}
.grouped .hover-timestamp {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    text-align: right;
    font-size: 10px;
    color: var(--text-muted);
    display: none;
    padding-right: 4px;
}
.message:hover .hover-timestamp { display: block; }
.message-body {
    color: var(--text-secondary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.45;
}
.message-body code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: var(--font-code);
    border: 1px solid var(--border);
    color: var(--accent);
}
.message-body pre {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 4px;
    margin: 4px 0;
    overflow-x: auto;
    font-size: 13px;
    font-family: var(--font-code);
    border: 1px solid var(--border);
}
.message-body pre code {
    background: none;
    padding: 0;
    border: none;
    color: var(--text-secondary);
}
.message-body .mention {
    background: var(--accent-light);
    color: var(--accent);
    padding: 0 2px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
}
.message-body .mention:hover {
    background: var(--accent-dim);
}
.message-body strong { font-weight: 700; color: var(--text-primary); }
.message-body em { font-style: italic; }
.gorelo-ref {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(13, 148, 136, 0.1);
    color: var(--accent);
    border: 1px solid rgba(13, 148, 136, 0.3);
    border-radius: 4px;
    padding: 0 6px;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.gorelo-ref:hover { background: rgba(13, 148, 136, 0.2); border-color: var(--accent); text-decoration: none; }

/* Edited indicator */
.edited-tag {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Deleted message */
.message-deleted {
    color: var(--text-muted);
    font-style: italic;
}

/* Reply (Discord-style) */
.message-reply {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
    cursor: pointer;
    padding-left: 0;
    transition: color 0.2s ease;
}
.message-reply::before {
    content: '';
    display: block;
    width: 32px;
    height: 12px;
    border-left: 2px solid var(--text-muted);
    border-top: 2px solid var(--text-muted);
    border-radius: 6px 0 0 0;
    margin-right: 4px;
    flex-shrink: 0;
}
.message-reply .reply-author { font-weight: 600; color: var(--accent); }
.message-reply .reply-content { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.message-reply:hover { color: var(--text-primary); }
.message-reply:hover .reply-author { color: var(--accent-hover, var(--accent)); }

/* File Attachments */
.message-attachment {
    margin-top: 4px;
    max-width: 520px;
}
.message-attachment img,
.message-attachment video {
    max-width: 100%;
    max-height: 350px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    border: 1px solid var(--border);
}

/* media-wrap: wraps image/gif with a floating download button */
.media-wrap {
    position: relative;
    display: inline-block;
}
.media-wrap img { display: block; }
.attach-download-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(6, 10, 16, 0.75);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 4px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.15s;
    backdrop-filter: blur(4px);
    z-index: 5;
}
.media-wrap:hover .attach-download-btn,
.message-attachment:hover .attach-download-btn { opacity: 1; }
.attach-download-btn:hover { background: var(--accent); color: #fff; }

/* Download button variant for video footer */
.attach-download-text {
    position: static;
    opacity: 1;
    background: none;
    color: var(--accent);
    font-size: 12px;
    padding: 2px 4px;
}
.attach-download-text:hover { background: var(--accent-dim); }

.media-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
}
.media-filename { font-size: 12px; color: var(--text-muted); }
.file-attachment {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    max-width: 420px;
    transition: border-color 0.4s ease;
}
.file-attachment:hover {
    border-color: var(--accent);
}
.file-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
    clip-path: var(--clip-corner);
}
.file-info { min-width: 0; }
.file-name {
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-size { color: var(--text-muted); font-size: 12px; }

/* ===== Media Embed: Video ===== */
.media-video {
    max-width: 520px;
    margin-top: 4px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
}
.media-video video {
    width: 100%;
    max-height: 350px;
    display: block;
    background: #000;
}
.media-video video::-webkit-media-controls-panel {
    background: var(--bg-secondary);
}

/* ===== Media Embed: Audio ===== */
.media-audio {
    max-width: 420px;
    margin-top: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.media-audio .audio-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
    clip-path: var(--clip-corner);
    font-size: 18px;
}
.media-audio .audio-info {
    flex: 1;
    min-width: 0;
}
.media-audio .audio-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.media-audio audio {
    width: 100%;
    height: 32px;
    outline: none;
}
.media-audio audio::-webkit-media-controls-panel {
    background: var(--bg-tertiary);
}

/* ===== Link Embed / Rich Preview ===== */
.link-embed {
    display: flex;
    gap: 12px;
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    padding: 12px;
    margin-top: 4px;
    max-width: 520px;
}
.link-embed .embed-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.link-embed .embed-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.link-embed .embed-site {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.link-embed .embed-title {
    font-weight: 600;
    font-size: 14px;
    margin: 2px 0;
}
.link-embed .embed-title a {
    color: var(--accent);
    text-decoration: none;
}
.link-embed .embed-title a:hover {
    text-decoration: underline;
}
.link-embed .embed-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Avatar Cropper ===== */
.avatar-cropper-wrap {
    position: relative;
    width: 256px;
    height: 256px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 12px 0;
    cursor: grab;
    background: var(--bg-tertiary);
}
.avatar-cropper-wrap:active { cursor: grabbing; }
.avatar-cropper-wrap canvas {
    display: block;
}
.avatar-preview-current {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.avatar-preview-current img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

/* ===== GIF Container (pauseable) ===== */
.gif-container {
    position: relative;
    display: inline-block;
    max-width: 400px;
    margin-top: 4px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
}
.gif-container img {
    width: 100%;
    display: block;
}
.gif-container .gif-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 10, 16, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gif-container:hover .gif-overlay,
.gif-container.paused .gif-overlay {
    opacity: 1;
}
.gif-container .gif-play-btn {
    width: 48px;
    height: 48px;
    background: rgba(59, 196, 202, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    box-shadow: 0 0 20px rgba(59, 196, 202, 0.3);
}
.gif-container .gif-play-btn:hover {
    transform: scale(1.1);
    background: var(--accent);
}
.gif-container .gif-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(6, 10, 16, 0.7);
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Reactions */
.reactions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: background 0.2s ease, border-color 0.2s ease;
    height: 28px;
}
.reaction-btn:hover {
    background: var(--bg-modifier-active);
    border-color: var(--border);
}
.reaction-btn.reacted {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}
.reaction-btn .count { font-size: 12px; font-weight: 600; }
.reaction-btn .emoji-img { width: 18px; height: 18px; object-fit: contain; }
.reaction-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.reaction-add:hover {
    background: var(--bg-modifier-active);
    border-color: var(--border);
    color: var(--text-primary);
}

/* Message Actions (hover toolbar) */
.message-actions {
    position: absolute;
    top: -16px;
    right: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: none;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.message:hover .message-actions { display: flex; }
.message-action-btn {
    padding: 6px 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}
.message-action-btn:hover {
    background: var(--bg-modifier-active);
    color: var(--text-primary);
}

/* ===== Typing Indicator ===== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    min-height: 24px;
}
.typing-dots span {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* ===== Reply Preview ===== */
.reply-preview {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    gap: 8px;
}

/* ===== Message Input ===== */
.message-input-container {
    padding: 8px 16px 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
    flex-shrink: 0;
    position: relative;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}
.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border-radius: 8px;
    padding: 4px 4px 4px 12px;
    gap: 4px;
    border: 1px solid var(--border);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.input-wrapper:focus-within {
    border-color: rgba(59, 196, 202, 0.4);
    box-shadow: 0 0 20px rgba(59, 196, 202, 0.08);
}
.input-area {
    flex: 1;
    min-width: 0;
}
.input-area textarea {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.4;
    resize: none;
    max-height: 200px;
    padding: 8px 0;
    font-family: var(--font-primary);
}
.input-area textarea:focus { outline: none; }
.input-area textarea::placeholder { color: var(--text-muted); }
.attach-btn, .emoji-btn, .gif-btn, .send-btn {
    flex-shrink: 0;
}
.gorelo-mobile-btn {
    display: none; /* hidden everywhere; shown on mobile for employees via media query */
    flex-shrink: 0;
    border-radius: 4px;
    background: rgba(59, 196, 202, 0.12);
    color: var(--accent);
    transition: color 0.2s ease, background 0.2s ease;
    padding: 6px 8px;
    font-size: 18px;
    line-height: 1;
}
.gorelo-mobile-btn:hover { background: rgba(59, 196, 202, 0.24); }
@media (max-width: 768px) {
    .gorelo-mobile-btn.employee { display: flex; align-items: center; justify-content: center; }
}
.gif-btn {
    font-size: 11px;
    font-weight: 800;
    padding: 6px 8px;
    border-radius: 4px;
    background: var(--bg-modifier-active);
    color: var(--text-secondary);
    transition: color 0.2s ease, background 0.2s ease;
}
.gif-btn:hover {
    color: var(--text-primary);
    background: var(--bg-modifier-hover);
}

/* ===== Right Sidebar: Members ===== */
.members-sidebar {
    width: var(--members-width);
    background: var(--bg-secondary);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
}
.members-header {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.members-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}
.members-close-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.members-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
}
.member-group-label {
    padding: 16px 8px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.member-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    gap: 10px;
    color: var(--text-secondary);
    transition: background 0.2s ease, color 0.2s ease;
}
.member-item:hover {
    background: var(--bg-modifier-hover);
    color: var(--text-primary);
}
.member-item .member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    position: relative;
    flex-shrink: 0;
}
.member-item .member-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.member-item .status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    z-index: 1;
}
.dm-avatar .status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    z-index: 1;
}
.status-dot.online { background: var(--success); }
.status-dot.away { background: var(--warning); }
.status-dot.dnd { background: var(--danger); }
.status-dot.offline { background: var(--text-muted); }
.member-item .member-name { font-size: 14px; font-weight: 500; }
.member-item .member-name.admin-name { color: var(--accent); }

/* ===== Icon Buttons ===== */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}
.icon-btn:hover {
    color: var(--text-primary);
    background: var(--bg-modifier-hover);
}
#clearChannelBtn:hover { color: var(--danger) !important; }
.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    transition: color 0.2s ease;
}
.btn-text:hover { color: var(--accent-hover); text-decoration: underline; }

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal {
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    box-shadow: var(--teal-glow);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.modal-close {
    font-size: 24px;
    width: 36px;
    height: 36px;
}

/* Settings Modal */
.settings-modal {
    width: 800px;
    height: 600px;
}
.settings-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}
.settings-nav {
    width: 200px;
    padding: 12px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}
.settings-tab {
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
}
.settings-tab:hover { background: var(--bg-modifier-hover); color: var(--text-primary); }
.settings-tab.active { background: var(--bg-modifier-active); color: #fff; }
.settings-tab.danger { color: var(--danger); }
.settings-tab.danger:hover { background: rgba(255, 95, 86, 0.1); }
.settings-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}
/* PWA install banner */
.pwa-install-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: linear-gradient(90deg, rgba(59, 196, 202, 0.15), rgba(59, 196, 202, 0.08));
    border-bottom: 1px solid rgba(59, 196, 202, 0.3);
    font-size: 13px;
    color: var(--text-primary);
    flex-shrink: 0;
}
.pwa-banner-icon { font-size: 16px; flex-shrink: 0; }
.pwa-banner-text { flex: 1; color: var(--text-secondary); }
.pwa-banner-btn { flex-shrink: 0; }
.pwa-banner-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}
.pwa-banner-dismiss:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn-sm { padding: 4px 12px; font-size: 12px; }

/* Settings notices */
.settings-notice {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 14px;
}
.settings-notice-success { background: rgba(39, 201, 63, 0.12); color: var(--success); border: 1px solid rgba(39, 201, 63, 0.3); }

/* PWA notification permission prompt */
.pwa-notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 0 env(safe-area-inset-bottom, 0);
    animation: fadeIn 0.2s ease;
}
.pwa-notif-dialog {
    background: var(--bg-secondary);
    border-radius: 16px 16px 0 0;
    padding: 28px 24px 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.4);
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.pwa-notif-icon { font-size: 40px; text-align: center; margin-bottom: 12px; }
.pwa-notif-dialog h3 { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 10px; color: var(--text-primary); }
.pwa-notif-dialog p { font-size: 14px; color: var(--text-secondary); text-align: center; margin-bottom: 10px; line-height: 1.5; }
.pwa-notif-note { font-size: 12px !important; color: var(--text-muted) !important; background: var(--bg-tertiary); border-radius: 8px; padding: 10px 12px !important; text-align: left !important; }
.pwa-notif-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.pwa-notif-actions .btn { width: 100%; padding: 12px; font-size: 15px; border-radius: 10px; justify-content: center; }

.settings-section { margin-bottom: 24px; }
.settings-section h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(59, 196, 202, 0.1);
}
.form-group input[type="color"] {
    width: 48px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    clip-path: var(--clip-corner);
    border-radius: 0;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-secondary { background: var(--bg-modifier-active); color: var(--text-primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* Color picker row */
.color-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.color-row label { margin-bottom: 0; flex: 1; }
.color-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

/* Admin user/channel tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}
.admin-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(26, 31, 42, 0.5);
}
.admin-table tr:hover td { background: var(--bg-modifier-hover); }

/* ===== Emoji Picker ===== */
.emoji-picker {
    position: fixed;
    bottom: 80px;
    right: 60px;
    width: 350px;
    height: 400px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), var(--teal-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 101;
}
.emoji-picker-header { padding: 12px; border-bottom: 1px solid var(--border); }
.emoji-search {
    width: 100%;
    padding: 8px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
    transition: border-color 0.4s ease;
}
.emoji-search:focus { outline: none; border-color: var(--accent); }
.emoji-tabs {
    display: flex;
    gap: 2px;
    margin-top: 8px;
    overflow-x: auto;
}
.emoji-tab {
    padding: 4px 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}
.emoji-tab:hover { background: var(--bg-modifier-hover); color: var(--text-primary); }
.emoji-tab.active { background: var(--bg-modifier-active); color: var(--text-primary); }
.emoji-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    align-content: start;
}
.emoji-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 22px;
    border: none;
    background: none;
    padding: 0;
    transition: background 0.15s ease;
}
.emoji-item:hover { background: var(--bg-modifier-active); }
.emoji-item img { width: 28px; height: 28px; object-fit: contain; }
.emoji-category-label {
    grid-column: 1 / -1;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 4px 4px;
    letter-spacing: 0.5px;
}

/* ===== GIF Picker ===== */
.gif-picker {
    position: fixed;
    bottom: 80px;
    right: 100px;
    width: 420px;
    height: 450px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), var(--teal-glow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 101;
}
.gif-picker-header { padding: 12px; border-bottom: 1px solid var(--border); }
.gif-search {
    width: 100%;
    padding: 8px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
    transition: border-color 0.4s ease;
}
.gif-search:focus { outline: none; border-color: var(--accent); }
.gif-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    align-content: start;
}
.gif-item {
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.gif-item img { width: 100%; height: 100%; object-fit: cover; }
.gif-item:hover { opacity: 0.85; transform: scale(1.02); }

/* ===== Gorelo <g> Autocomplete ===== */
.gorelo-autocomplete {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
    z-index: 200;
    overflow: hidden;
    max-height: 320px;
    display: flex;
    flex-direction: column;
}
.gorelo-ac-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 0;
    flex-wrap: wrap;
    gap: 6px;
}
.gorelo-ac-tip { font-size: 11px; color: var(--text-muted); }
.gorelo-ac-tabs { display: flex; gap: 2px; }
.gorelo-ac-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px 6px;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: color 0.15s, border-color 0.15s;
}
.gorelo-ac-tab:hover { color: var(--text-primary); }
.gorelo-ac-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.gorelo-ac-results {
    overflow-y: auto;
    max-height: 220px;
    padding: 4px 8px 8px;
}
.gorelo-ac-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.gorelo-ac-item:hover { background: var(--bg-hover); }
.gorelo-ac-item.ac-highlighted { background: var(--bg-hover); outline: 1px solid var(--accent); outline-offset: -1px; }
.gorelo-ac-item .gr-id { font-size: 11px; color: var(--accent); font-weight: 700; flex-shrink: 0; min-width: 40px; }
.gorelo-ac-item .gr-title { font-size: 13px; color: var(--text-primary); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-meta-tag { font-size: 11px; color: var(--text-muted); background: var(--bg-tertiary); padding: 1px 6px; border-radius: 4px; flex-shrink: 0; }
.gr-type-badge { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; letter-spacing: 0.04em; }
.gr-type-clients  { background: rgba(59, 196, 202, 0.18); color: var(--accent); }
.gr-type-contacts { background: rgba(160, 120, 230, 0.18); color: #a078e6; }
.gr-type-assets   { background: rgba(230, 170, 60, 0.18); color: #e6aa3c; }
.gr-type-tickets  { background: rgba(255, 95, 86, 0.18); color: var(--danger); }
.gorelo-empty { text-align: center; color: var(--text-muted); padding: 20px; font-size: 13px; }

/* ===== @mention Autocomplete ===== */
.mention-autocomplete {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 50;
    overflow: hidden;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.3);
    max-height: 220px;
    display: flex;
    flex-direction: column;
}
.mention-ac-results { overflow-y: auto; padding: 4px; }
.mention-ac-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.mention-ac-item:hover { background: var(--bg-hover); }
.mention-ac-item.ac-highlighted { background: var(--bg-hover); outline: 1px solid var(--accent); outline-offset: -1px; }
.mention-ac-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}
.mention-ac-name { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.mention-ac-username { font-size: 11px; color: var(--text-muted); }
.ticket-badge { padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.ticket-badge.open { background: rgba(39, 201, 63, 0.2); color: var(--success); }
.ticket-badge.closed { background: rgba(255, 95, 86, 0.2); color: var(--danger); }
.ticket-badge.pending { background: rgba(255, 189, 46, 0.2); color: var(--warning); }

/* ===== Search Panel ===== */
.search-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100dvh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 300;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.search-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
}
.search-panel-header h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.search-panel-filters {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.search-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-primary);
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-date {
    flex: 1;
    padding: 7px 10px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-primary);
    box-sizing: border-box;
}
.search-date:focus { outline: none; border-color: var(--accent); }
.search-type-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.search-select {
    flex: 1;
    padding: 7px 10px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-primary);
}
.search-select:focus { outline: none; border-color: var(--accent); }
.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.search-result-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
    margin-bottom: 4px;
}
.search-result-item:hover { background: var(--bg-hover); border-color: var(--border); }
.search-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 11px;
}
.search-result-chan { color: var(--accent); font-weight: 600; }
.search-result-author { color: var(--text-secondary); font-weight: 600; }
.search-result-time { color: var(--text-muted); margin-left: auto; }
.search-result-body { font-size: 13px; color: var(--text-primary); line-height: 1.4; }
.search-attachment { color: var(--text-muted); font-style: italic; }
.search-loading, .search-empty { text-align: center; color: var(--text-muted); padding: 32px; font-size: 13px; }
@keyframes highlight-flash-kf {
    0%, 100% { background: transparent; }
    50% { background: rgba(13, 148, 136, 0.2); }
}
.highlight-flash { animation: highlight-flash-kf 1s ease 3; border-radius: 4px; }

/* Reply avatar */
.reply-avatar-img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.reply-avatar-initial { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }

/* Inline ticket embed in messages */
.ticket-embed {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    border-radius: 0 4px 4px 0;
    padding: 8px 12px;
    margin-top: 4px;
    max-width: 400px;
}
.ticket-embed .ticket-id { font-size: 11px; color: var(--accent); font-weight: 600; }
.ticket-embed .ticket-title { font-size: 13px; font-weight: 600; margin: 2px 0; color: var(--text-primary); }
.ticket-embed .ticket-meta { font-size: 12px; color: var(--text-muted); }

/* ===== Image Viewer ===== */
.image-viewer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6, 10, 16, 0.9);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
}
.image-viewer img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}
.image-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    color: #fff;
    width: 40px;
    height: 40px;
}

/* ===== Drag & Drop Overlay ===== */
.drop-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(59, 196, 202, 0.1);
    border: 3px dashed var(--accent);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.drop-message {
    text-align: center;
    color: var(--accent);
}
.drop-message p { font-size: 18px; font-weight: 600; margin-top: 12px; }

/* ===== Context Menu ===== */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px;
    z-index: 300;
    min-width: 160px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.context-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    border-radius: 2px;
    transition: background 0.15s ease;
}
.context-menu-item:hover { background: var(--accent); color: #fff; }
.context-menu-item.danger { color: var(--danger); }
.context-menu-item.danger:hover { background: var(--danger); color: #fff; }
.context-menu-separator {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ===== Mobile Menu Button ===== */
.mobile-menu-btn { display: none; }

/* ===== Upload Progress ===== */
.upload-progress {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}
.upload-progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}
.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transition: width 0.3s ease;
}
.upload-file-name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== System Messages ===== */
.system-message {
    text-align: center;
    padding: 4px 16px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Date Divider ===== */
.date-divider {
    display: flex;
    align-items: center;
    padding: 16px 16px 4px;
}
.date-divider::before, .date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.date-divider span {
    padding: 0 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.3s ease;
    max-width: 400px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        height: 100dvh;
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        z-index: 30;
        transition: left 0.3s ease;
    }
    .sidebar.open { left: 0; }
    .members-sidebar {
        position: fixed;
        right: -100%;
        top: 0;
        height: 100vh;
        height: 100dvh;
        padding-top: env(safe-area-inset-top);
        padding-right: env(safe-area-inset-right);
        z-index: 30;
        transition: right 0.3s ease;
    }
    .members-sidebar.open { right: 0; }
    .mobile-menu-btn { display: flex; }
    .members-close-btn { display: block; }
    .channel-header .channel-desc { display: none; }
    .emoji-picker {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 50vh;
        border-radius: 12px 12px 0 0;
    }
    .gif-picker {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 50vh;
        border-radius: 12px 12px 0 0;
    }
    .search-panel { width: 100vw; }
    .settings-modal { width: calc(100vw - 16px); height: 85dvh; max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px); border-radius: 12px; }
    .settings-nav { width: 140px; }
    .message { padding-left: 60px; padding-right: 16px; }
    .message-avatar { left: 12px; }
}

@media (max-width: 480px) {
    .settings-body { flex-direction: column; }
    .settings-nav {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 4px;
    }
    .settings-tab { white-space: nowrap; font-size: 13px; }
}

/* ===== Sidebar Overlay for mobile ===== */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(6, 10, 16, 0.6);
    z-index: 25;
    display: none;
}
.sidebar-overlay.visible { display: block; }

/* ===== Notes Feature ===== */
.notes-sidebar {
    padding: 0 0 4px;
    border-top: 1px solid var(--border);
}
.notes-divider {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.notes-add-btn {
    width: 20px; height: 20px;
    padding: 0;
    border-radius: 4px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.notes-add-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.notes-list { padding: 0 4px; }
.notes-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: background 0.12s, color 0.12s;
    user-select: none;
}
.notes-item:hover, .notes-item.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.note-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.note-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-shared-badge {
    font-size: 11px;
    opacity: 0.6;
    flex-shrink: 0;
}
.notes-empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 12px;
    font-style: italic;
}

/* Note Editor Panel */
.note-editor-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 480px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 40;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.35);
}
.note-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.note-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.note-color-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.2);
    transition: transform 0.15s;
    position: relative;
}
.note-color-dot:hover { transform: scale(1.25); }
.note-title-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
}
.note-title-input::placeholder { color: var(--text-muted); font-weight: 400; }
.note-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.note-gorelo-btn, .note-share-btn { color: var(--text-muted); }
.note-gorelo-btn:hover, .note-share-btn:hover { color: var(--accent); }

/* Color picker popup */
.note-color-picker {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-tertiary);
}
.color-swatches {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.color-swatch {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.12s, border-color 0.12s;
    padding: 0;
}
.color-swatch:hover { transform: scale(1.2); border-color: rgba(255,255,255,0.5); }

/* Gorelo refs attached to note */
.note-gorelo-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 14px;
    border-bottom: 1px solid var(--border);
    min-height: 0;
    flex-shrink: 0;
}
.note-gorelo-refs:empty { display: none; }
.note-gorelo-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 2px 8px 2px 6px;
    text-decoration: none;
}
.note-gorelo-tag-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    padding: 0 0 0 2px;
    transition: color 0.12s;
}
.note-gorelo-tag-remove:hover { color: var(--danger); }

/* Formatting toolbar */
.note-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.note-fmt-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    padding: 3px 7px;
    transition: background 0.12s, color 0.12s;
    line-height: 1.4;
}
.note-fmt-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.note-toolbar-sep { width: 1px; height: 16px; background: var(--border); margin: 0 2px; flex-shrink: 0; }

/* Note content editable area */
.note-editor {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary);
    outline: none;
    caret-color: var(--accent);
    word-wrap: break-word;
}
.note-editor:empty::before {
    content: 'Start writing your note…';
    color: var(--text-muted);
    pointer-events: none;
}
.note-editor h3 { font-size: 15px; font-weight: 700; margin: 8px 0 4px; color: var(--text-primary); }
.note-editor ul, .note-editor ol { margin: 4px 0; padding-left: 20px; }
.note-editor li { margin: 2px 0; }
.note-editor strong { font-weight: 700; }
.note-editor em { font-style: italic; }
.note-editor u { text-decoration: underline; }
.note-editor s { text-decoration: line-through; }

/* Footer */
.note-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.note-saved-status {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}
.btn-danger-sm {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    background: rgba(220, 38, 38, 0.15);
    color: var(--danger, #ef4444);
    transition: background 0.12s;
}
.btn-danger-sm:hover { background: rgba(220, 38, 38, 0.3); }

/* Note Share Modal */
.note-share-modal-inner {
    width: 480px;
    max-width: 95vw;
}
.note-share-body { padding: 16px; }
.note-share-search-wrap { margin-bottom: 16px; }
.note-share-results {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    max-height: 180px;
    overflow-y: auto;
}
.note-share-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}
.note-share-result-row:last-child { border-bottom: none; }
.note-share-result-row:hover { background: var(--bg-hover); color: var(--text-primary); }
.note-current-shares { margin-top: 8px; }
.note-shares-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.note-share-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.note-share-row:last-child { border-bottom: none; }
.note-share-name { flex: 1; }

/* Note Gorelo Modal */
.note-gorelo-modal-inner {
    width: 500px;
    max-width: 95vw;
}
.note-gorelo-body { padding: 16px; }
.note-gorelo-tabs { margin-bottom: 8px; }

/* gr-status for tickets */
.gr-status { color: var(--accent); }

/* Responsive: note editor on smaller screens */
@media (max-width: 768px) {
    .note-editor-panel {
        width: 100vw;
        left: 0;
    }
}

/* ===== Notification Bell Badge ===== */
.notif-bell-btn {
    position: relative;
}
.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--danger, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    line-height: 1;
}

/* ===== Notifications Panel ===== */
.notif-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 340px;
    max-width: 100vw;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 300;
    box-shadow: -4px 0 24px rgba(0,0,0,0.35);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 12px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.notif-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.notif-enable-banner {
    margin: 10px 12px;
    padding: 12px 14px;
    background: rgba(59, 196, 202, 0.08);
    border: 1px solid rgba(59, 196, 202, 0.25);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.notif-enable-banner-text { flex: 1; font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.notif-enable-banner-text strong { color: var(--text-primary); }
.notif-enable-banner .btn { font-size: 12px; padding: 5px 12px; white-space: nowrap; flex-shrink: 0; }
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
    position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(59,196,202, 0.06); }
.notif-item-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 3px;
    line-height: 1.4;
}
.notif-ch { color: var(--accent); }
.notif-item-preview {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.notif-item-time {
    font-size: 11px;
    color: var(--text-muted);
}
.notif-unread-dot {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* ===== DND Toggle Button ===== */
.dnd-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dnd-toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.dnd-toggle-btn.dnd-on {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border-color: rgba(239,68,68,0.4);
}
.dnd-toggle-btn.dnd-on:hover {
    background: rgba(239,68,68,0.25);
}
/* Bell button DND indicator */
.notif-bell-btn.dnd-active svg {
    color: #ef4444;
}

/* ===== Note Folders ===== */
.note-folder-header {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px 4px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
    margin-top: 2px;
}
.note-folder-header:hover { background: var(--bg-hover); }
.note-folder-header.drag-over {
    background: rgba(59, 196, 202, 0.12);
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
    border-radius: 4px;
}
.note-folder-arrow {
    font-size: 9px;
    color: var(--text-muted);
    transition: transform 0.15s;
    display: inline-block;
    width: 10px;
}
.note-folder-arrow.open {
    transform: rotate(90deg);
}
.note-folder-name {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-folder-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: 2px;
}
.note-folder-menu-btn {
    width: 20px !important;
    height: 20px !important;
    font-size: 14px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.12s;
}
.note-folder-header:hover .note-folder-menu-btn { opacity: 1; }
.note-folder-items {
    padding-left: 8px;
}

/* Note drag/drop */
.notes-item.dragging { opacity: 0.4; }
.notes-item.drop-above {
    border-top: 2px solid var(--accent);
}

/* ===== Hotkeys Settings ===== */
.hotkey-list {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.hotkey-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}
.hotkey-row:last-child { border-bottom: none; }
.hotkey-row span { color: var(--text-primary); }
kbd {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.5;
    min-width: 32px;
    text-align: center;
}

/* ===== Note Close Button - bigger ===== */
#closeNoteBtn {
    width: 36px !important;
    height: 36px !important;
    font-size: 22px !important;
    color: var(--text-secondary) !important;
    font-weight: 300;
}
#closeNoteBtn:hover {
    color: var(--text-primary) !important;
    background: var(--bg-hover) !important;
}

/* ===== Notes Color Key (collab) ===== */
.note-color-key {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px 6px;
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
    font-size: 12px;
}
.note-color-key-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 4px;
}
.note-collab-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-primary);
}
.note-collab-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.note-collab-name { font-weight: 500; }
.note-collab-you { color: var(--text-muted); font-size: 10px; }

/* ===== Hotkey Capture UI ===== */
.hotkey-capture-display {
    display: inline-flex;
    align-items: center;
    min-width: 100px;
    min-height: 32px;
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 13px;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.btn-secondary.listening {
    border-color: var(--accent);
    color: var(--accent);
    animation: pulse-border 1s ease-in-out infinite;
}
@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 196, 202, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(59, 196, 202, 0); }
}
.listen-pulse {
    color: var(--danger);
    animation: blink 1s step-start infinite;
    margin-right: 4px;
}
.listen-waiting {
    color: var(--accent);
    font-style: italic;
    font-size: 12px;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== Reactions layout improvement ===== */
.reactions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1.5;
}
.reaction-btn:hover { background: var(--bg-hover); border-color: var(--accent); }
.reaction-btn.reacted {
    background: rgba(59, 196, 202, 0.15);
    border-color: var(--accent);
    color: var(--text-primary);
}
.reaction-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 12px;
    border: 1px dashed var(--border);
    background: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
}
.reaction-add:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent);
    border-style: solid;
}
