/* ============================================================
   ALOOM SPACES Meet — Light Theme
   ============================================================ */

/* Segoe UI is a system font — no Google Fonts import needed */

:root {
    /* Core palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f7f8fa;
    --bg-tertiary: #ffffff;
    --bg-hover: #eef1f5;
    --bg-active: #dce6f0;
    --bg-surface: #f0f3f7;
    --bg-elevated: #ffffff;
    --bg-input: #f5f7fa;

    /* Accent */
    --accent: #00a0e1;
    --accent-hover: #0090ca;
    --accent-light: rgba(0, 160, 225, 0.08);
    --accent-glow: rgba(0, 160, 225, 0.2);

    /* Text */
    --text-primary: #2d2d2d;
    --text-secondary: #555555;
    --text-tertiary: #878787;
    --text-accent: #284b73;
    --text-inverse: #ffffff;

    /* Status */
    --status-online: #96c300;
    --status-away: #fab900;
    --status-busy: #b42369;
    --status-dnd: #b42369;
    --status-offline: #878787;

    /* Borders */
    --border: rgba(0, 0, 0, 0.10);
    --border-light: rgba(0, 0, 0, 0.05);
    --border-accent: rgba(0, 160, 225, 0.3);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);

    /* Overlays */
    --hover-overlay: rgba(0, 0, 0, 0.06);
    --subtle-overlay: rgba(0, 0, 0, 0.03);
    --backdrop-overlay: rgba(0, 0, 0, 0.5);

    /* Scrollbar */
    --scrollbar-thumb: rgba(0, 0, 0, 0.15);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.25);

    /* Error / destructive */
    --error-bg: rgba(180, 35, 105, 0.06);
    --error-border: rgba(180, 35, 105, 0.2);
    --delete-hover-bg: rgba(180, 35, 105, 0.08);

    /* Status tints */
    --status-online-tint: rgba(150, 195, 0, 0.12);
    --status-busy-tint: rgba(180, 35, 105, 0.10);
    --status-online-hover: #85b000;
    --status-busy-hover: #9a1d5a;

    /* Self message (on accent background) */
    --msg-self-file-bg: rgba(255, 255, 255, 0.2);
    --msg-self-file-border: rgba(255, 255, 255, 0.25);
    --msg-self-file-hover: rgba(255, 255, 255, 0.3);
    --msg-self-icon: rgba(255, 255, 255, 0.9);
    --msg-self-meta: rgba(255, 255, 255, 0.7);

    /* Reaction pills */
    --reaction-mine-bg: rgba(0, 160, 225, 0.1);
    --reaction-mine-hover: rgba(0, 160, 225, 0.15);

    /* Image overlay controls */
    --image-action-bg: rgba(0, 0, 0, 0.5);
    --image-action-hover: rgba(0, 0, 0, 0.7);

    /* Call view */
    --call-view-bg: #000000;
    --call-toggle-bg: rgba(0, 0, 0, 0.6);
    --call-toggle-hover: rgba(0, 0, 0, 0.8);

    /* Close button */
    --btn-close-bg: #e81123;

    /* Message bubble (self) */
    --msg-self-bubble: #78aad2;

    /* Reaction pill */
    --pill-bg: #3c73aa;
    --pill-text: #ffffff;

    /* Dimensions */
    --titlebar-height: 0px;
    --sidebar-width: 68px;
    --panel-width: 320px;

    /* Transitions */
    --transition-fast: 120ms ease;
    --transition: 200ms ease;
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
}

/* ---- Custom Tooltips (native ones don't scale with zoom) ---- */
.custom-tooltip {
    position: fixed;
    padding: 4px 8px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    white-space: nowrap;
    border-radius: 4px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    z-index: 99999;
    pointer-events: none;
    animation: tooltipIn 0.12s ease;
}

@keyframes tooltipIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ============================================================
   CUSTOM TITLE BAR
   ============================================================ */
.titlebar {
    height: var(--titlebar-height);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    -webkit-app-region: drag;
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.titlebar__left {
    display: flex;
    align-items: center;
    padding-left: 12px;
    gap: 8px;
}

.titlebar__logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.titlebar__title {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.titlebar__controls {
    display: flex;
    -webkit-app-region: no-drag;
}

.titlebar__btn {
    width: 46px;
    height: var(--titlebar-height);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}
.titlebar__btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.titlebar__btn--close:hover {
    background: var(--btn-close-bg);
    color: var(--text-inverse);
}

.titlebar__btn svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app {
    display: flex;
    height: 100vh;
    padding-top: var(--titlebar-height);
}

/* ============================================================
   LEFT SIDEBAR (Icon Rail)
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    flex-shrink: 0;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.sidebar__item {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    position: relative;
}

.sidebar__item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
    transition: all var(--transition);
}

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

.sidebar__item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.sidebar__item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar__item .badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--status-busy);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.sidebar__divider {
    width: 28px;
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.sidebar__bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-bottom: 8px;
}

.sidebar__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-inverse);
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
}

.sidebar__avatar:hover {
    transform: scale(1.08);
}

.sidebar__avatar .status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.status-dot--online { background: var(--status-online); }
.status-dot--away { background: var(--status-away); }
.status-dot--busy { background: var(--status-busy); }
.status-dot--dnd { background: var(--status-dnd); }
.status-dot--offline { background: var(--status-offline); }

/* ============================================================
   SECONDARY PANEL (List Panel)
   ============================================================ */
.panel {
    width: var(--panel-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.panel__header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
}

.panel__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.panel__search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel__search-row .panel__search {
    flex: 1;
}

.panel__new-chat {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.panel__new-chat {
    gap: 2px;
}

.panel__new-chat:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.panel__new-chat svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.panel__new-chat .new-chat-arrow {
    width: 10px;
    height: 10px;
}

.new-chat-wrap {
    position: relative;
}

.new-chat-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 200px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    padding: 4px;
}

.new-chat-menu.hidden {
    display: none;
}

.new-chat-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}

.new-chat-menu__item:hover {
    background: var(--bg-hover);
}

.new-chat-menu__item svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

/* New Chat Picker Overlay */
.new-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.new-chat-picker {
    width: 340px;
    max-height: 480px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.new-chat-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
}

.new-chat-picker__header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.new-chat-picker__close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.new-chat-picker__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.new-chat-picker__close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.new-chat-picker__search {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
}

.new-chat-picker__search input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.new-chat-picker__search input:focus {
    border-color: var(--accent);
}

.new-chat-picker__list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
}

.new-chat-picker__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.new-chat-picker__item:hover {
    background: var(--bg-hover);
}

.new-chat-picker__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.new-chat-picker__name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.new-chat-picker__status {
    font-size: 11px;
    color: var(--text-tertiary);
}

.new-chat-picker__empty {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.new-chat-picker__check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.new-chat-picker__check svg {
    width: 14px;
    height: 14px;
    stroke: white;
    stroke-width: 3;
    fill: none;
    display: none;
}

.new-chat-picker__item--selectable .new-chat-picker__check {
    display: flex;
}

.new-chat-picker__item--selected .new-chat-picker__check {
    background: var(--accent);
    border-color: var(--accent);
}

.new-chat-picker__item--selected .new-chat-picker__check svg {
    display: block;
}

.new-chat-picker__item--locked {
    opacity: 0.6;
    cursor: default;
}

.new-chat-picker__item--locked:hover {
    background: transparent;
}

.new-chat-picker__footer {
    padding: 8px 16px 12px;
    border-top: 1px solid var(--border);
}

.new-chat-picker__btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.new-chat-picker__btn--confirm {
    background: var(--accent);
    color: white;
}

.new-chat-picker__btn--confirm:hover:not(:disabled) {
    opacity: 0.9;
}

.new-chat-picker__btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.panel__search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    transition: border-color var(--transition);
}

.panel__search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.panel__search svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-tertiary);
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.panel__search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

.panel__search input::placeholder {
    color: var(--text-tertiary);
}

.panel__actions {
    display: flex;
    gap: 4px;
    margin-top: 12px;
}

.panel__filter {
    padding: 6px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.panel__filter.active {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--border-accent);
}

/* ---- List ---- */
.panel__list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
}

.list-item:hover {
    background: var(--bg-hover);
}

.list-item.active {
    background: var(--bg-active);
}

.list-item__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-accent);
    flex-shrink: 0;
    position: relative;
}

.list-item__avatar .status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.list-item__avatar--group {
    background: var(--accent);
    color: var(--text-inverse);
}

.list-item__info {
    flex: 1;
    min-width: 0;
}

.list-item__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item__preview {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.list-item__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.list-item__time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.list-item__unread {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--text-inverse);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-tertiary);
    min-width: 0;
    min-height: 0;
}

.content-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#content-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.content__chat-row {
    flex: 1;
    display: flex;
    min-height: 0;
}

.content__chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    position: relative;
}

/* ---- Scroll-to-bottom Button ---- */
.scroll-down-btn {
    position: absolute;
    bottom: 80px;
    right: 24px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: background 0.15s ease, color 0.15s ease, opacity 0.2s ease;
    opacity: 1;
}

.scroll-down-btn:hover {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
}

.scroll-down-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.scroll-down-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ---- Content Header ---- */
.content__header {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.content__header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content__header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-accent);
}

.content__header-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.content__header-info span {
    font-size: 12px;
    color: var(--text-tertiary);
}

.content__header-actions {
    display: flex;
    gap: 4px;
}

.header-action {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.header-action:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.header-action svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

/* ---- Chat Header Menu ---- */
.chat-menu-wrap {
    position: relative;
}

.chat-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 160px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 50;
    padding: 4px;
    animation: dropdownIn 0.15s ease;
}

.chat-menu.hidden {
    display: none;
}

.chat-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-menu__item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chat-menu__item svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    flex-shrink: 0;
}

/* ---- Files Side Panel ---- */
.content__files {
    width: 300px;
    min-width: 300px;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
}

.content__files.hidden {
    display: none;
}

.files-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
}

.files-panel__header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.files-panel__close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.files-panel__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.files-panel__close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.files-panel__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.files-panel__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

.files-panel__item:hover {
    background: var(--bg-hover);
}

.files-panel__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.files-panel__icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-tertiary);
    stroke-width: 1.5;
    fill: none;
}

.files-panel__icon--image {
    overflow: hidden;
    padding: 0;
}

.files-panel__icon--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.files-panel__info {
    flex: 1;
    min-width: 0;
}

.files-panel__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.files-panel__meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.files-panel__download {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: all var(--transition-fast);
}

.files-panel__item:hover .files-panel__download {
    opacity: 1;
}

.files-panel__download:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.files-panel__download svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.files-panel__empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ---- Saved Messages Panel ---- */
.content__saved {
    width: 300px;
    min-width: 300px;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
}

.content__saved.hidden {
    display: none;
}

.saved-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
}

.saved-panel__header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.saved-panel__close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.saved-panel__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.saved-panel__close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.saved-panel__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.saved-panel__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.saved-panel__item:hover {
    background: var(--bg-hover);
}

.saved-panel__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.saved-panel__info {
    flex: 1;
    min-width: 0;
}

.saved-panel__text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-panel__meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-panel__remove {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: all var(--transition-fast);
}

.saved-panel__item:hover .saved-panel__remove {
    opacity: 1;
}

.saved-panel__remove:hover {
    background: var(--bg-hover);
    color: var(--status-busy);
}

.saved-panel__remove svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.saved-panel__empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ---- Schedule Picker ---- */
.schedule-picker {
    position: absolute;
    bottom: 100%;
    right: 50px;
    width: 280px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 16px;
    z-index: 100;
}

.schedule-picker.hidden {
    display: none;
}

.schedule-picker__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.schedule-picker__presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.schedule-picker__preset {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.schedule-picker__preset:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

.schedule-picker__preset.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.schedule-picker__custom {
    margin-bottom: 12px;
}

.schedule-picker__label {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.schedule-picker__datetime {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    color-scheme: dark;
}

.schedule-picker__datetime:focus {
    outline: none;
    border-color: var(--accent);
}

.schedule-picker__confirm {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 8px;
}

.schedule-picker__confirm:hover {
    opacity: 0.9;
}

.schedule-picker__view-all {
    width: 100%;
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
    text-align: center;
}

.schedule-picker__view-all:hover {
    text-decoration: underline;
}

/* ---- Scheduled Messages Panel ---- */
.content__scheduled {
    width: 300px;
    min-width: 300px;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.content__scheduled.hidden {
    display: none;
}

.scheduled-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
}

.scheduled-panel__header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.scheduled-panel__close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.scheduled-panel__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.scheduled-panel__close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.scheduled-panel__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.scheduled-panel__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: default;
}

.scheduled-panel__item:hover {
    background: var(--bg-hover);
}

.scheduled-panel__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.scheduled-panel__icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.scheduled-panel__info {
    flex: 1;
    min-width: 0;
}

.scheduled-panel__text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scheduled-panel__meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.scheduled-panel__cancel {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    flex-shrink: 0;
}

.scheduled-panel__item:hover .scheduled-panel__cancel {
    opacity: 1;
}

.scheduled-panel__cancel:hover {
    background: var(--bg-hover);
    color: var(--status-busy);
}

.scheduled-panel__cancel svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.scheduled-panel__empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ---- Chat Messages Area ---- */
.content__messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.content__messages.drag-over,
.call-view__chat-messages.drag-over {
    background: var(--accent-light);
    outline: 2px dashed var(--accent);
    outline-offset: -8px;
    border-radius: 8px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 70%;
    align-self: flex-start;
    animation: messageIn 0.25s var(--transition-slow);
    position: relative;
    z-index: 1;
}

.message:has(.msg-react__popup:not(.hidden)),
.message:has(.reaction-emoji-picker) {
    z-index: 100;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.date-separator {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 20px 4px;
    gap: 12px;
}

.date-separator::before,
.date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    opacity: 0.5;
}

.date-separator span {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    user-select: none;
}

.message--system {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 11px;
    padding: 8px 20px;
    align-self: center;
    width: 100%;
}

.message--self {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message--unread .message__bubble,
.message--unread .message__file-name {
    font-weight: 600;
}

.message__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-accent);
    flex-shrink: 0;
}

.message__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message__sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-accent);
}

.message--self .message__sender {
    text-align: right;
}

.message__bubble {
    padding: 10px 14px;
    border-radius: 4px 12px 12px 12px;
    background: var(--bg-surface);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.message--self .message__bubble {
    background: var(--msg-self-bubble);
    color: var(--text-inverse);
    border: none;
    border-radius: 12px 4px 12px 12px;
}

.message__time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.message--self .message__time {
    text-align: right;
}

.message__status {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 4px;
}

.message__status svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    fill: none;
}

.message__status--sent svg {
    stroke: var(--text-tertiary);
}

.message__status--read svg {
    stroke: var(--accent);
}

.message__saved-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
    vertical-align: middle;
    opacity: 0.6;
}

.message__saved-icon svg {
    width: 12px;
    height: 12px;
    stroke: var(--accent);
    stroke-width: 2;
    fill: var(--accent);
}

/* ---- Message Content Row (bubble + action button) ---- */
.message__content-row {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    padding-bottom: 2px;
}

/* Extra bottom space when reactions are present */
.message__content-row:has(.message__reactions) {
    padding-bottom: 14px;
}

/* ---- Message Action Menu ---- */
.msg-actions {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.message:hover .msg-actions {
    opacity: 1;
}

.msg-actions__toggle {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.msg-actions__toggle:hover {
    background: var(--hover-overlay);
    color: var(--text-secondary);
}

.msg-actions__toggle svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.msg-actions__menu {
    position: fixed;
    min-width: 120px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 9999;
    padding: 4px;
}

.msg-actions__menu.hidden {
    display: none;
}

.msg-actions__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.msg-actions__item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.msg-actions__delete:hover {
    color: var(--status-busy);
    background: var(--delete-hover-bg);
}

.msg-actions__mark-unread:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.msg-actions__mark-unread--disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.message--unread {
    cursor: pointer;
}

.msg-actions__quote:hover {
    color: var(--accent);
    background: var(--accent-light);
}

/* ---- Quote Block in Messages ---- */
.message__quote {
    border-left: 3px solid var(--accent);
    background: var(--subtle-overlay);
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.4;
}

.message__quote[data-quote-event-id] {
    cursor: pointer;
    transition: background 0.15s ease;
}

.message__quote[data-quote-event-id]:hover {
    background: var(--hover-overlay);
}

/* ---- Jump-to-message highlight ---- */
.message--highlight {
    animation: msg-highlight 2s ease;
}

@keyframes msg-highlight {
    0%, 15% { background: var(--accent-light); }
    100% { background: transparent; }
}

/* ---- Quote Preview Bar ---- */
.composer__quote-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.quote-preview__bar {
    display: none;
}

.quote-preview__content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.quote-preview__sender {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2px;
}

.quote-preview__text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quote-preview__close {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quote-preview__close:hover {
    color: var(--text-primary);
    background: var(--hover-overlay);
}

.quote-preview__close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.msg-actions__item svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.msg-actions__edit:hover {
    color: var(--accent);
    background: var(--accent-light);
}

/* ---- Edited Tag ---- */
.message__edited {
    font-size: 11px;
    color: var(--text-tertiary);
    font-style: italic;
    margin-left: 4px;
}

/* ---- Edit Preview Bar ---- */
.composer__edit-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.edit-preview__icon {
    flex-shrink: 0;
    color: var(--accent);
    display: flex;
    align-items: center;
}

.edit-preview__icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.edit-preview__content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.edit-preview__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2px;
}

.edit-preview__text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.edit-preview__close {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-preview__close:hover {
    color: var(--text-primary);
    background: var(--hover-overlay);
}

.edit-preview__close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ---- Reaction Emoji Toggle ---- */
.msg-react {
    position: relative;
    flex-shrink: 0;
}

.msg-react__toggle {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.msg-react__toggle:hover {
    background: var(--hover-overlay);
    color: var(--text-secondary);
}

.msg-react__toggle svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ---- Quick Reaction Popup ---- */
.msg-react__popup {
    position: absolute;
    top: 0;
    display: flex;
    gap: 2px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2px 4px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.message:not(.message--self) .msg-react__popup {
    left: 100%;
    margin-left: 4px;
}

.message--self .msg-react__popup {
    right: 100%;
    margin-right: 4px;
}

.msg-react__popup.hidden {
    display: none;
}

.quick-react__btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s ease, transform 0.1s ease;
    padding: 0;
}

.quick-react__btn:hover {
    background: var(--hover-overlay);
    transform: scale(1.2);
}

.quick-react__btn--more {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.quick-react__btn--more:hover {
    color: var(--accent);
}

/* ---- Reaction Pills (overlapping bubble bottom) ---- */
.message__reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    position: absolute;
    bottom: 4px;
    left: 5px;
    z-index: 2;
}

.message--self .message__reactions {
    left: auto;
    right: 5px;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--pill-bg);
    color: var(--pill-text);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.1s ease, border-color 0.1s ease;
    box-shadow: var(--shadow-sm);
}

.reaction-pill:hover {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
}

.reaction-pill--mine {
    background: var(--reaction-mine-bg);
    border-color: var(--accent);
    color: var(--accent);
}

.reaction-pill--mine:hover {
    background: var(--reaction-mine-hover);
}

/* ---- Reaction Emoji Picker (from + button) ---- */
.reaction-emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 4px;
    width: 280px;
    max-height: 260px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.message--self .reaction-emoji-picker {
    left: auto;
    right: 0;
}

.reaction-emoji-picker__search {
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

.reaction-emoji-picker__search input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 8px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}

.reaction-emoji-picker__search input:focus {
    border-color: var(--accent);
}

.reaction-emoji-picker__grid {
    display: flex;
    flex-wrap: wrap;
    padding: 6px;
    overflow-y: auto;
    flex: 1;
    gap: 2px;
}

.reaction-emoji-picker__emoji {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.reaction-emoji-picker__emoji:hover {
    background: var(--hover-overlay);
}

/* ---- File Messages ---- */
.message__image-link {
    display: block;
}

.message__image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.message__image:hover {
    opacity: 0.9;
}

.message__file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition-fast);
    min-width: 200px;
}

.message__file:hover {
    background: var(--bg-hover);
}

.message--self .message__file {
    background: var(--msg-self-file-bg);
    border-color: var(--msg-self-file-border);
}

.message--self .message__file:hover {
    background: var(--msg-self-file-hover);
}

.message__file-icon {
    width: 28px;
    height: 28px;
    stroke: var(--text-accent);
    stroke-width: 1.5;
    fill: none;
    flex-shrink: 0;
}

.message--self .message__file-icon {
    stroke: var(--msg-self-icon);
}

.message__file-info {
    flex: 1;
    min-width: 0;
}

.message__file-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message--self .message__file-name {
    color: var(--text-inverse);
}

.message__file-size {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.message--self .message__file-size {
    color: var(--msg-self-meta);
}

/* ---- File message wrappers ---- */
.message__image-wrap {
    position: relative;
    display: inline-block;
}

/* Image overlay: position menu inside image, show on hover */
.message__image-wrap .msg-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    opacity: 1;
}

.message__image-wrap .msg-actions__toggle {
    background: var(--image-action-bg);
    color: var(--text-inverse);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.message__image-wrap:hover .msg-actions__toggle {
    opacity: 1;
}

.message__image-wrap .msg-actions__toggle:hover {
    background: var(--image-action-hover);
}

/* ---- Message Composer ---- */
.content__composer {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    transition: border-color var(--transition);
}

.composer:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.composer__input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
}

.composer__input::placeholder {
    color: var(--text-tertiary);
}

.composer__actions {
    display: flex;
    gap: 4px;
}

.composer__btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

.composer__btn--send {
    background: var(--accent);
    color: var(--text-inverse);
}

.composer__btn--send:hover {
    background: var(--accent-hover);
}

.composer__btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ---- Emoji Picker ---- */
.content__composer {
    position: relative;
}

.emoji-picker {
    position: absolute;
    bottom: 100%;
    right: 12px;
    width: 320px;
    max-height: 360px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    margin-bottom: 6px;
}

.emoji-picker.hidden {
    display: none;
}

.emoji-picker__tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.emoji-picker__tabs::-webkit-scrollbar {
    display: none;
}

.emoji-picker__tab {
    padding: 8px 6px;
    font-size: 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    opacity: 0.5;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.emoji-picker__tab:hover {
    opacity: 0.8;
}

.emoji-picker__tab.active {
    opacity: 1;
    border-bottom-color: var(--accent);
}

.emoji-picker__search {
    padding: 8px;
}

.emoji-picker__search-input {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
}

.emoji-picker__search-input:focus {
    border-color: var(--accent);
}

.emoji-picker__search-input::placeholder {
    color: var(--text-tertiary);
}

.emoji-picker__grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 4px 8px 8px;
    overflow-y: auto;
    max-height: 240px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.emoji-picker__grid::-webkit-scrollbar {
    width: 4px;
}

.emoji-picker__grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.emoji-picker__emoji {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.emoji-picker__emoji:hover {
    background: var(--bg-hover);
}

/* Emoji-only message (large emoji without bubble) */
.message__bubble--emoji {
    background: transparent;
    font-size: 40px;
    line-height: 1.2;
    padding: 4px 0;
}

/* ============================================================
   CALL HISTORY VIEW
   ============================================================ */
.call-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.call-item:hover {
    background: var(--bg-hover);
}

.call-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.call-item__icon--answered {
    background: var(--status-online-tint);
    color: var(--status-online);
}

.call-item__icon--missed {
    background: var(--status-busy-tint);
    color: var(--status-busy);
}

.call-item__icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.call-item__info {
    flex: 1;
}

.call-item__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.call-item__detail {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.call-item__actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.call-item:hover .call-item__actions {
    opacity: 1;
}

/* ============================================================
   CONTACTS VIEW
   ============================================================ */
.contact-group {
    padding: 8px 0;
}

.contact-group__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
}

/* ---- Contact Detail Panel ---- */
.contact-detail {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-detail__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
    width: 100%;
    padding: 40px 32px;
}

.contact-detail__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-accent);
    margin-bottom: 16px;
}

.contact-detail__name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-detail__username {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.contact-detail__status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.contact-detail__status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.contact-detail__info {
    margin-top: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-detail__info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--bg-surface);
}

.contact-detail__info-row svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-tertiary);
    stroke-width: 1.8;
    fill: none;
    flex-shrink: 0;
}

.contact-detail__actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.contact-detail__action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.contact-detail__action:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--border-accent);
}

.contact-detail__action svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-tertiary);
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state__icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--text-tertiary);
    stroke-width: 1.5;
    fill: none;
}

.empty-state__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.empty-state__text {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
    max-width: 300px;
    line-height: 1.5;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding-top: var(--titlebar-height);
}

.login-screen.hidden {
    display: none;
}

.login-card {
    width: 380px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

.login-card__logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-card h2 {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-card p {
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.form-group__server {
    display: flex;
    gap: 8px;
    align-items: center;
}

.form-group__server input {
    flex: 1;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn--primary {
    width: 100%;
    background: var(--accent);
    color: var(--text-inverse);
}

.btn--primary:hover {
    background: var(--accent-hover);
}

.btn--primary:active {
    transform: scale(0.98);
}

.btn--secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn--secondary:hover {
    background: var(--bg-hover);
}

.login-card__footer {
    text-align: center;
    margin-top: 20px;
}

.login-card__footer a {
    color: var(--text-accent);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.login-card__footer a:hover {
    text-decoration: underline;
}

.login-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--status-busy);
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: none;
}

.login-error.visible {
    display: block;
}

/* ============================================================
   USER PROFILE DROPDOWN
   ============================================================ */
.user-dropdown {
    position: fixed;
    bottom: 60px;
    left: 76px;
    width: 280px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 500;
    display: none;
    overflow: hidden;
    animation: dropdownIn 0.15s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown.visible {
    display: block;
}

.user-dropdown__header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-dropdown__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-inverse);
}

.user-dropdown__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown__email {
    font-size: 12px;
    color: var(--text-tertiary);
}

.user-dropdown__presence {
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

.presence-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: var(--text-primary);
}

.presence-option:hover {
    background: var(--bg-hover);
}

.presence-option.active {
    background: var(--accent-light);
}

.presence-option__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.presence-option__label {
    font-size: 13px;
}

.user-dropdown__footer {
    padding: 8px;
}

.user-dropdown__footer button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: var(--text-secondary);
    font-size: 13px;
}

.user-dropdown__footer button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-dropdown__footer button svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ============================================================
   SETTINGS VIEW
   ============================================================ */
#content-settings {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-section {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.about-logo {
    text-align: center;
    margin-bottom: 16px;
}

.about-logo img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.settings-row__label {
    font-size: 13px;
    color: var(--text-primary);
}

.settings-row__desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.settings-row input[type="text"],
.settings-row input[type="password"],
.settings-row input[type="number"],
.settings-row select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    min-width: 200px;
}

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

/* ============================================================
   RESPONSIVE / UTILITY
   ============================================================ */
.hidden { display: none !important; }

.fade-in {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* New call / meeting dialog */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background: var(--backdrop-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 600;
}

.dialog-overlay.visible {
    display: flex;
}

.dialog {
    width: 420px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: dropdownIn 0.2s ease;
}

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

.dialog__header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.dialog__close {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.dialog__close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.dialog__body {
    padding: 20px;
}

.dialog__footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================================
   SIP Dial Pad
   ============================================================ */
.dialpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 240px;
    margin: 16px auto;
}

.dialpad__key {
    height: 48px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialpad__key:hover {
    background: var(--bg-hover);
    border-color: var(--border-accent);
}

.dialpad__key:active {
    background: var(--accent-light);
}

.dialpad__key--call {
    background: var(--status-online);
    color: var(--text-inverse);
    border: none;
    grid-column: 2;
}

.dialpad__key--call:hover {
    background: var(--status-online-hover);
}

.dialpad__display {
    text-align: center;
    font-size: 24px;
    font-weight: 300;
    color: var(--text-primary);
    padding: 16px;
    letter-spacing: 2px;
    min-height: 56px;
}

/* ============================================================
   IN-APP CALL VIEW (embedded Jitsi)
   ============================================================ */
.call-view {
    position: fixed;
    top: var(--titlebar-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    z-index: 100;
    background: var(--call-view-bg);
    display: flex;
}

.call-view.chat-open {
    /* Make room for chat panel */
}

.call-view__frame {
    flex: 1;
    position: relative;
    background: var(--call-view-bg);
    min-width: 0;
}

.call-view__frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ---- Panel toggle buttons (overlay on call view) ---- */
.call-view__panel-toggles {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.call-view__panel-toggle {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--call-toggle-bg);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(8px);
}

.call-view__panel-toggle:hover {
    background: var(--call-toggle-hover);
    color: #ffffff;
}

.call-view__panel-toggle.active {
    background: var(--accent);
    color: var(--text-inverse);
}

.call-view__panel-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

/* ---- Participants panel (slides in from right during call) ---- */
.call-view__participants {
    width: 340px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    animation: callChatSlideIn 0.2s ease;
}

.call-view__participants-header {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.call-view__participants-header span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.call-view__participants-close {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.call-view__participants-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.call-view__participants-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.call-view__participants-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* ---- Participant list item ---- */
.call-participant {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
}

.call-participant__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-accent);
    flex-shrink: 0;
    position: relative;
}

.call-participant__avatar .status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.call-participant__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.call-participant__you {
    font-weight: 400;
    color: var(--text-tertiary);
    font-size: 12px;
}

/* ---- Chat panel (slides in from right during call) ---- */
.call-view__chat {
    width: 340px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    animation: callChatSlideIn 0.2s ease;
}

@keyframes callChatSlideIn {
    from { width: 0; opacity: 0; }
    to { width: 340px; opacity: 1; }
}

.call-view__chat-header {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.call-view__chat-header span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.call-view__chat-close {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.call-view__chat-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.call-view__chat-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.call-view__chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.call-view__chat-composer {
    padding: 12px;
    border-top: 1px solid var(--border);
    position: relative;
}

.call-view__chat-composer .composer {
    background: var(--bg-input);
}

.call-view__chat-composer .composer__input {
    font-size: 12px;
}

.call-view__chat-composer .composer__actions {
    gap: 2px;
}

.call-view__chat-composer .composer__btn {
    width: 28px;
    height: 28px;
}

.call-view__chat-composer .composer__btn svg {
    width: 14px;
    height: 14px;
}

/* ============================================================
   INCOMING CALL POPUP
   ============================================================ */
.incoming-call {
    position: fixed;
    top: calc(var(--titlebar-height) + 16px);
    right: 24px;
    width: 340px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-glow);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    animation: incomingCallSlide 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes incomingCallSlide {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.incoming-call__ring {
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    border: 2px solid var(--accent);
    animation: incomingRing 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes incomingRing {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

.incoming-call__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-inverse);
    flex-shrink: 0;
}

.incoming-call__info {
    flex: 1;
    min-width: 0;
}

.incoming-call__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.incoming-call__type {
    font-size: 12px;
    color: var(--text-accent);
    margin-top: 2px;
    animation: incomingPulseText 1.5s ease-in-out infinite;
}

@keyframes incomingPulseText {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.incoming-call__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.incoming-call__btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.incoming-call__btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.incoming-call__btn--accept {
    background: var(--status-online);
    color: var(--text-inverse);
}

.incoming-call__btn--accept:hover {
    background: var(--status-online-hover);
    transform: scale(1.1);
}

.incoming-call__btn--decline {
    background: var(--status-busy);
    color: var(--text-inverse);
}

.incoming-call__btn--decline:hover {
    background: var(--status-busy-hover);
    transform: scale(1.1);
}

/* ============================================================
   FORWARD PICKER
   ============================================================ */
.forward-picker-overlay {
    position: fixed;
    inset: 0;
    background: var(--backdrop-overlay);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.forward-picker {
    width: 320px;
    max-height: 70vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: dropdownIn 0.15s ease;
}

.forward-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.forward-picker__close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.forward-picker__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.forward-picker__close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.forward-picker__search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 12px;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color var(--transition);
}

.forward-picker__search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.forward-picker__search svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-tertiary);
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.forward-picker__search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

.forward-picker__search input::placeholder {
    color: var(--text-tertiary);
}

.forward-picker__list {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
    padding: 4px 8px;
}

.forward-picker__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.forward-picker__item:hover {
    background: var(--bg-hover);
}

.forward-picker__item--selected {
    background: var(--accent-light);
}

.forward-picker__item--selected:hover {
    background: var(--accent-light);
}

.forward-picker__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-accent);
    flex-shrink: 0;
    position: relative;
}

.forward-picker__avatar .status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.forward-picker__name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forward-picker__check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-tertiary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.forward-picker__check svg {
    width: 14px;
    height: 14px;
    stroke: transparent;
    stroke-width: 3;
    fill: none;
}

.forward-picker__item--selected .forward-picker__check {
    background: var(--accent);
    border-color: var(--accent);
}

.forward-picker__item--selected .forward-picker__check svg {
    stroke: var(--text-inverse);
}

.forward-picker__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.forward-picker__btn {
    padding: 7px 18px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.forward-picker__btn--cancel {
    background: transparent;
    color: var(--text-secondary);
}

.forward-picker__btn--cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.forward-picker__btn--send {
    background: var(--accent);
    color: var(--text-inverse);
}

.forward-picker__btn--send:hover:not(:disabled) {
    background: var(--accent-hover);
}

.forward-picker__btn--send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.msg-actions__forward:hover {
    color: var(--accent);
    background: var(--accent-light);
}

/* Group name input step */
.new-chat-picker__name-step {
    padding: 16px;
}

.new-chat-picker__label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.new-chat-picker__name-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
}

.new-chat-picker__name-input:focus {
    border-color: var(--accent);
}

/* Group-only chat menu separator */
.chat-menu__item--group-only {
    border-top: 1px solid var(--border);
}

/* DM-only chat menu separator */
.chat-menu__item--dm-only {
    border-top: 1px solid var(--border);
}

/* Inline group rename in header */
.header-name--editable {
    cursor: pointer;
    border-radius: 4px;
    padding: 0 4px;
    margin: 0 -4px;
    transition: background var(--transition-fast);
}

.header-name--editable:hover {
    background: var(--bg-hover);
}

.header-rename-input {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 2px 6px;
    outline: none;
    width: 200px;
    font-family: inherit;
}

/* Members side panel */
.content__members {
    width: 280px;
    min-width: 280px;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    overflow: hidden;
}

.content__members.hidden {
    display: none;
}

.members-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
}

.members-panel__header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.members-panel__close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.members-panel__close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.members-panel__close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.members-panel__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.members-panel__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
}

.members-panel__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-accent);
    flex-shrink: 0;
}

.members-panel__info {
    flex: 1;
    min-width: 0;
}

.members-panel__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.members-panel__status {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.members-panel__presence {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.members-panel__presence--online {
    background: var(--status-online);
}

.members-panel__presence--away {
    background: var(--status-away);
}

.members-panel__presence--busy {
    background: var(--status-busy);
}

.members-panel__presence--dnd {
    background: var(--status-dnd);
}

.members-panel__presence--offline {
    background: var(--status-offline);
    opacity: 0.4;
}

.members-panel__actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.members-panel__add {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.members-panel__add:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.members-panel__add svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.members-panel__remove {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.members-panel__item:hover .members-panel__remove {
    display: flex;
}

.members-panel__remove:hover {
    background: var(--bg-hover);
    color: var(--status-busy);
}

.members-panel__remove svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Confirm dialog */
.confirm-dialog {
    width: 320px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
}

.confirm-dialog__message {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.confirm-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.confirm-dialog__btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.confirm-dialog__btn--cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.confirm-dialog__btn--cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.confirm-dialog__btn--confirm {
    background: var(--status-busy);
    color: #fff;
}

.confirm-dialog__btn--confirm:hover {
    background: var(--status-busy-hover);
}
