*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0e0e10;
    --surface: #18181b;
    --surface2: #1f1f23;
    --surface3: #26262c;
    --border: #2f2f35;
    --border-hover: #3f3f45;
    --accent: #9147ff;
    --accent-hover: #772ce8;
    --accent-soft: rgba(145, 71, 255, 0.15);
    --accent-glow: rgba(145, 71, 255, 0.3);
    --text: #efeff1;
    --text-dim: #adadb8;
    --text-muted: #76768a;
    --success: #00e676;
    --success-soft: rgba(0, 230, 118, 0.12);
    --warning: #ffab00;
    --warning-soft: rgba(255, 171, 0, 0.12);
    --danger: #ff5252;
    --danger-soft: rgba(255, 82, 82, 0.12);
    --info-blue: #42a5f5;
    --info-blue-soft: rgba(66, 165, 245, 0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
    50% { box-shadow: 0 0 20px var(--accent-glow); }
}

@keyframes highlightFlash {
    0% { background: var(--accent-soft); }
    100% { background: transparent; }
}

@keyframes awayPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* ── Login Screen ── */
.login-screen {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-screen.active {
    display: flex;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: fadeIn 0.5s ease;
    box-shadow: var(--shadow);
}

.login-card .logo {
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), #bf7aff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    overflow: visible;
}

.login-card .subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-twitch {
    background: var(--accent);
    color: white;
    width: 100%;
    padding: 0.9rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius);
    letter-spacing: 0.3px;
}

.btn-twitch:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 0.5rem 0.9rem;
    font-size: 0.82rem;
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--surface2);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(255, 82, 82, 0.25);
}

.btn-danger:hover {
    background: rgba(255, 82, 82, 0.25);
}

.btn-success {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.25);
}

.btn-success:hover {
    background: rgba(0, 230, 118, 0.25);
}

.btn-warning {
    background: var(--warning-soft);
    color: var(--warning);
    border: 1px solid rgba(255, 171, 0, 0.25);
}

.btn-warning:hover {
    background: rgba(255, 171, 0, 0.25);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    font-size: 1rem;
}

/* ── Dashboard ── */
.dashboard {
    display: none;
    height: 100vh;
    flex-direction: column;
}

.dashboard.active {
    display: flex;
}

/* Header */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 10;
}

.dash-header .brand {
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #bf7aff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background var(--transition);
}

.connection-dot.connected {
    background: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

.connection-dot.connecting {
    background: var(--warning);
    animation: pulse 1s ease-in-out infinite;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: var(--surface2);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dim);
}

/* Body layout */
.dash-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1rem 1rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
}

.channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.5rem;
    min-height: 0;
}

.channel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 2px;
    animation: slideInLeft 0.3s ease;
}

.channel-item:hover {
    background: var(--surface2);
}

.channel-item.active {
    background: var(--accent-soft);
    border: 1px solid rgba(145, 71, 255, 0.25);
}

.channel-item.active .channel-name {
    color: var(--text);
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.channel-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
    text-transform: uppercase;
}

.channel-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-trigger-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--surface3);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    flex-shrink: 0;
}

.channel-remove {
    opacity: 0;
    transition: opacity var(--transition);
}

.channel-item:hover .channel-remove {
    opacity: 1;
}

.trigger-card.disabled {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.channel-item.paused .channel-name {
    opacity: 0.5;
    text-decoration: line-through;
}

.paused-badge {
    font-size: 0.65rem;
    color: var(--warning);
    background: var(--warning-soft);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    margin-left: 0.4rem;
    font-weight: 800;
}

/* Add channel */
.add-channel-area {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
}

.add-channel-row {
    display: flex;
    gap: 0.5rem;
}

.add-channel-row input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color var(--transition);
}

.add-channel-row input:focus {
    outline: none;
    border-color: var(--accent);
}

.add-channel-row input::placeholder {
    color: var(--text-muted);
}

/* ── Reply Queue ── */
.reply-queue-section {
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: 40%;
    min-height: 80px;
}

.reply-queue-header {
    padding: 0.75rem 1rem 0.5rem;
    display: flex;
    align-items: center;
}

.reply-queue-header h2 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reply-queue-count {
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reply-queue-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.5rem 0.5rem;
}

.reply-queue-empty {
    padding: 1rem 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.reply-queue-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all var(--transition);
    animation: slideInLeft 0.2s ease;
    position: relative;
}

.reply-queue-item:hover {
    border-color: var(--accent);
    background: var(--surface3);
}

.rq-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.rq-user {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
}

.rq-time {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.rq-message {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.4;
    word-break: break-word;
}

.rq-dismiss {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition);
    font-family: inherit;
}

.reply-queue-item:hover .rq-dismiss {
    opacity: 1;
}

/* ── Main Content ── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── Main Tabs ── */
.main-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.main-tab {
    padding: 0.6rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-tab:hover {
    color: var(--text-dim);
    background: var(--surface2);
}

.main-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Chat Panel ── */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-scroll-indicator {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface3);
    color: var(--text-dim);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    z-index: 5;
    border: 1px solid var(--border);
    pointer-events: none;
    animation: fadeIn 0.15s ease;
}

.conversation-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 1rem;
    background: var(--accent-soft);
    border-bottom: 1px solid rgba(145, 71, 255, 0.25);
    font-size: 0.78rem;
    color: var(--text-dim);
    flex-shrink: 0;
}

.conversation-filter-bar b {
    color: var(--accent);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.chat-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Chat Message ── */
.chat-msg {
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s ease;
    position: relative;
}

.chat-msg:hover {
    background: var(--surface2);
}

.chat-msg.highlighted {
    animation: highlightFlash 2s ease forwards;
}

.chat-msg.is-reply {
    border-left: 2px solid var(--accent);
    margin-left: 0.5rem;
    padding-left: 0.65rem;
}

.chat-msg-content {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
    line-height: 1.5;
}

.chat-msg-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.chat-msg-user {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.chat-msg-user:hover {
    text-decoration: underline;
    color: #bf7aff;
}

.chat-msg-text {
    font-size: 0.82rem;
    color: var(--text);
    word-break: break-word;
}

.chat-msg-actions {
    display: none;
    align-items: center;
    gap: 0.15rem;
    margin-left: auto;
    flex-shrink: 0;
}

.chat-msg:hover .chat-msg-actions {
    display: flex;
}

.chat-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.15rem 0.25rem;
    border-radius: 3px;
    transition: background var(--transition);
    opacity: 0.5;
}

.chat-action-btn:hover {
    background: var(--surface3);
    opacity: 1;
}

/* ── Reply Indicator ── */
.reply-indicator {
    font-size: 0.7rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.1rem 0;
    margin-bottom: 0.1rem;
}

.reply-indicator:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ── Chatter Badges ── */
.chatter-badge {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    line-height: 1;
    vertical-align: middle;
}

.badge-new {
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.badge-returning {
    background: var(--info-blue-soft);
    color: var(--info-blue);
    border: 1px solid rgba(66, 165, 245, 0.3);
}

.badge-regular {
    background: var(--surface3);
    color: var(--text-muted);
    border: 1px solid var(--border);
}


/* ── Monitor Bar ── */
.monitor-bar {
    padding: 0.8rem 1.25rem;
    background: var(--surface2);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
}

.monitor-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.monitor-right {
    flex: 1;
    max-width: 300px;
    display: flex;
    align-items: center;
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: var(--surface3);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #bf7aff);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* ── Right Panel (Activity + Away) ── */
.activity-panel {
    width: 320px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.right-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.right-tab {
    flex: 1;
    padding: 0.55rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.right-tab:hover {
    color: var(--text-dim);
    background: var(--surface2);
}

.right-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Activity Tab */
.activity-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.activity-header {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.activity-header h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-dim);
}

.activity-log {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.activity-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.log-entry {
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 0.82rem;
    animation: slideInRight 0.25s ease;
    line-height: 1.4;
}


.log-entry.sent {
    background: var(--success-soft);
    border-left: 3px solid var(--success);
}

.log-entry.error {
    background: var(--danger-soft);
    border-left: 3px solid var(--danger);
}

.log-entry.info {
    background: var(--warning-soft);
    border-left: 3px solid var(--warning);
}

.log-entry.chat {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--border);
    color: var(--text-dim);
    font-size: 0.78rem;
}

.log-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-right: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.log-channel {
    color: var(--accent);
    font-weight: 600;
}

.log-user {
    color: var(--warning);
    font-weight: 600;
}


/* ── Away Tab ── */
.away-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow-y: auto;
}

.away-controls {
    margin-bottom: 1rem;
}

.away-btn {
    width: 100%;
    font-size: 0.85rem;
}

.away-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--warning);
}

.away-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    animation: awayPulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

.away-empty {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.6;
    text-align: center;
    padding: 1rem 0;
}

.away-summary {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.away-summary-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.away-summary-body {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.away-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.away-stat {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.away-stat-num {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
}

.away-section {
    margin-bottom: 0.75rem;
}

.away-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.away-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.away-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-dim);
}

.away-pill small {
    color: var(--text-muted);
    font-weight: 400;
}

.away-pill.emote-pill {
    background: var(--warning-soft);
    border-color: rgba(255, 171, 0, 0.25);
    color: var(--warning);
}

/* ── User Context Card ── */
.user-context-card {
    position: fixed;
    z-index: 200;
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.15s ease;
    overflow: hidden;
}

.ucc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}

.ucc-username {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
}

.ucc-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    transition: all var(--transition);
}

.ucc-close:hover {
    background: var(--surface3);
    color: var(--text);
}

.ucc-status {
    padding: 0.5rem 1rem;
}

.ucc-details {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.ucc-detail {
    flex: 1;
    padding: 0.5rem 1rem;
    border-right: 1px solid var(--border);
}

.ucc-detail:last-child {
    border-right: none;
}

.ucc-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.2rem;
}

.ucc-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.ucc-messages-section {
    padding: 0.5rem 1rem 0.75rem;
}

.ucc-messages-section .ucc-label {
    margin-bottom: 0.4rem;
}

.ucc-messages {
    max-height: 120px;
    overflow-y: auto;
}

.ucc-msg {
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: 0.2rem 0;
    line-height: 1.4;
    word-break: break-word;
}

.ucc-msg-time {
    color: var(--text-muted);
    font-size: 0.65rem;
    margin-right: 0.3rem;
}

.ucc-no-msgs {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Model Selection ── */
.model-select-compact {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.model-select-compact:hover {
    border-color: var(--accent);
    color: var(--text);
}

.model-select-compact:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

/* ── Browser Alert ── */
.browser-alert {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    text-align: left;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.browser-alert .icon {
    font-size: 1.25rem;
}

.browser-alert b {
    color: var(--text);
}

/* ── Help Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 2rem;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(12px);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text);
}

.modal h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
}

.modal p,
.modal li {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.modal ul {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.modal li {
    margin-bottom: 0.3rem;
}

.modal code {
    background: var(--surface2);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--accent);
    font-family: 'Consolas', 'Monaco', monospace;
}

.modal-close {
    float: right;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--surface2);
    color: var(--text);
}

.help-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(145, 71, 255, 0.4);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    margin-left: 0.5rem;
    vertical-align: middle;
}

.help-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.login-features {
    text-align: left;
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.login-feature .feat-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.model-selection-login {
    margin-top: 1.5rem;
    text-align: left;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.model-selection-login label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.model-selection-login select {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.model-selection-login select:focus {
    outline: none;
    border-color: var(--accent);
}

.model-warning {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--warning-soft);
    color: var(--warning);
    border: 1px solid rgba(255, 171, 0, 0.2);
    border-radius: var(--radius);
    font-size: 0.8rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .activity-panel {
        width: 260px;
    }
}

@media (max-width: 900px) {
    .activity-panel {
        display: none;
    }
}

@media (max-width: 650px) {
    .sidebar {
        width: 200px;
    }
}
/* ── Away AI Summary ── */
.away-ai-summary {
    background: var(--surface2);
    border-left: 3px solid var(--accent);
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text);
    animation: fadeIn 0.4s ease;
}

.away-ai-summary p {
    margin: 0;
}

.ai-loading-dots {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
    display: flex;
    gap: 2px;
}

.ai-loading-dots span {
    animation: pulse 1.5s infinite;
}

.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

.emote-pill {
    background: var(--accent-soft) !important;
    border: 1px solid rgba(145, 71, 255, 0.2) !important;
    color: var(--accent) !important;
}
