* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #0b0b0c; color: #fbfbff; overflow: hidden; overscroll-behavior: none; }
nav { display: flex; gap: 0; background: #1a1a1f; border-bottom: 1px solid #2c2c33; }
nav button { padding: 12px 20px; background: none; border: none; color: #949498; cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; transition: all 0.15s ease; }
nav button.active { color: #13ef95; border-bottom-color: #13ef95; }
main { flex: 1; overflow: hidden; min-height: 0; }

/* Auth (legacy setup prompt) */
.auth-prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; overflow-y: auto; padding: 24px 0; gap: 16px; }
.auth-prompt input { padding: 10px 16px; background: #050506; border: 1px solid #2c2c33; border-radius: 8px; color: #fbfbff; width: 300px; }
.auth-prompt button { padding: 10px 24px; background: #13ef95; border: none; border-radius: 8px; color: #000; cursor: pointer; font-weight: 600; }

/* Auth Page */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #0b0b0c; }
.auth-card { background: #1a1a1f; border: 1px solid #2c2c33; border-radius: 12px; padding: 32px; width: 380px; max-width: calc(100vw - 32px); }
.auth-title { font-size: 28px; font-weight: 600; color: #fbfbff; text-align: center; margin: 0 0 24px 0; line-height: 1.2; }
.auth-subtitle { font-size: 14px; color: #949498; text-align: center; margin: -16px 0 24px 0; line-height: 1.5; }
.auth-mode-toggle { display: flex; width: 100%; margin-bottom: 20px; }
.auth-mode-toggle button { flex: 1; background: none; border: none; border-bottom: 2px solid transparent; color: #949498; font-size: 14px; font-weight: 600; padding: 8px 0; cursor: pointer; transition: all 0.15s ease; }
.auth-mode-toggle button.active { color: #13ef95; border-bottom-color: #13ef95; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input { background: #050506; border: 1px solid #2c2c33; border-radius: 8px; padding: 12px 16px; color: #fbfbff; font-size: 14px; width: 100%; box-sizing: border-box; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.auth-form input::placeholder { color: #949498; }
.auth-form input:focus { border-color: #13ef95; box-shadow: 0 0 0 2px rgba(19, 239, 149, 0.15); }
.auth-error { color: #ef4444; font-size: 12px; text-align: center; margin-top: 8px; }
.auth-submit-btn { background: #13ef95; border: none; border-radius: 8px; padding: 12px 24px; color: #000; font-weight: 600; font-size: 14px; cursor: pointer; width: 100%; margin-top: 16px; transition: background 0.15s ease; }
.auth-submit-btn:hover { background: #0fd485; }
.auth-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Logout button */
.logout-btn { color: #949498; }
.logout-btn:hover { color: #fbfbff; background: #2c2c33; }

/* Hives layout */
.hives-layout { display: flex; height: 100%; }
.sidebar { width: 260px; flex-shrink: 0; background: #1a1a1f; border-right: 1px solid #2c2c33; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; }
.hive-entry { padding: 8px 12px; border-radius: 8px; cursor: pointer; margin-bottom: 2px; transition: all 0.15s ease; }
.hive-entry:hover { background: rgba(19, 239, 149, 0.06); }
.hive-entry.selected { background: rgba(19, 239, 149, 0.06); border-left: 3px solid #13ef95; padding-left: 9px; }

/* Hive row with actions */
.hive-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hive-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.hive-actions { display: none; flex-shrink: 0; gap: 2px; }
.hive-entry:hover .hive-actions { display: flex; }
.hive-entry.selected .hive-actions { display: flex; }
.icon-btn { background: none; border: none; color: #949498; cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 4px; line-height: 1; width: auto; margin: 0; transition: all 0.15s ease; }
.icon-btn:hover { color: #fbfbff; background: #2c2c33; }
.icon-btn[data-tooltip] { position: relative; }
.icon-btn[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: #1a1a1f; border: 1px solid #2c2c33; color: #fbfbff; font-size: 11px; padding: 3px 8px; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.1s; z-index: 200; }
.icon-btn[data-tooltip]:hover::after { opacity: 1; }

/* System hives (Scout) */
.sidebar-divider { border-top: 1px solid #2c2c33; margin: 8px 0; flex-shrink: 0; }
.system-hive { opacity: 0.6; }
.system-hive:hover { opacity: 1; }

/* Version indicator */
.version-indicator { margin-top: auto; padding: 8px 4px 0; border-top: 1px solid #2c2c33; font-size: 11px; font-family: 'Fira Code', Monaco, Consolas, monospace; opacity: 0.5; flex-shrink: 0; }
.version-indicator:hover { opacity: 1; }
.version-current { color: #13ef95; }
.version-stale { color: #fec84b; }
.version-unknown { color: #949498; }
.version-badge { margin-left: 4px; }

/* Rename input */
.rename-input { width: 100%; padding: 4px 8px; background: #050506; border: 1px solid #13ef95; border-radius: 4px; color: #fbfbff; font-size: 14px; outline: none; }

/* New chat button */
.new-chat-btn { width: 100%; padding: 8px; margin-bottom: 8px; background: #13ef95; border: 1px solid #13ef95; border-radius: 8px; color: #000; cursor: pointer; font-size: 14px; font-weight: 600; transition: all 0.15s ease; }
.new-chat-btn:hover { background: #0fd485; border-color: #0fd485; }

/* Chat pane */
.chat-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.messages { flex: 1; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.message { margin-bottom: 12px; padding: 10px 14px; border-radius: 10px; max-width: 80%; overflow-wrap: break-word; word-break: break-word; position: relative; }
.message.user { background: linear-gradient(135deg, #149afb, #13ef95); color: #000; margin-left: auto; }
.message.assistant { background: #1a1a1f; }
.message.hive { background: #1a1a1f; border-left: 3px solid #13ef95; }
.input-bar { display: flex; flex-wrap: wrap; padding: 12px; gap: 8px; border-top: 1px solid #2c2c33; align-items: flex-end; }
.input-wrapper { flex: 1; position: relative; }
.input-wrapper textarea { width: 100%; padding: 10px; background: #050506; border: 1px solid #2c2c33; border-radius: 8px; color: #fbfbff; box-sizing: border-box; transition: all 0.15s ease; font-family: inherit; font-size: inherit; resize: none; overflow-y: auto; min-height: 40px; max-height: 120px; line-height: 1.4; }
.input-wrapper textarea:focus { border-color: #13ef95; box-shadow: 0 0 0 2px rgba(19, 239, 149, 0.15); outline: none; }
.input-bar button { padding: 10px 20px; background: #13ef95; border: none; border-radius: 8px; color: #000; cursor: pointer; font-weight: 600; transition: all 0.15s ease; }
.input-bar button:hover { background: #0fd485; }

/* Chat file uploads (issue #11) */
.attachment-file-input { display: none; }
.attachment-btn {
    padding: 10px 12px !important;
    background: #2c2c33 !important;
    color: #fbfbff !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    line-height: 1 !important;
    font-weight: normal !important;
}
.attachment-btn:hover { background: #3a3a44 !important; }
.attachment-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pending-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 0 0 0;
    align-items: center;
    min-height: 20px;
}
.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #1a1a1f;
    border: 1px solid #2c2c33;
    border-radius: 6px;
    color: #fbfbff;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: left;
}
.attachment-chip:hover { background: #2c2c33; border-color: #13ef95; }
.attachment-chip.pending { cursor: default; }
.attachment-chip.pending:hover { background: #1a1a1f; border-color: #13ef95; }
.attachment-icon { font-size: 13px; }
.attachment-name {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attachment-size { color: #8b949e; font-size: 11px; }
.attachment-remove {
    background: transparent !important;
    color: #8b949e !important;
    padding: 0 4px !important;
    margin-left: 2px;
    font-size: 16px !important;
    line-height: 1 !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer;
    font-weight: normal !important;
}
.attachment-remove:hover { color: #ff6b6b !important; background: rgba(255, 107, 107, 0.1) !important; }
.attachment-uploading { color: #8b949e; font-size: 12px; font-style: italic; }
.attachment-error { color: #ff6b6b; font-size: 12px; }
.message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

/* Command autocomplete popup */
.command-popup { position: absolute; bottom: 100%; left: 0; right: 0; background: #1a1a1f; border: 1px solid #2c2c33; border-radius: 8px; margin-bottom: 4px; max-height: 240px; overflow-y: auto; box-shadow: 0 -4px 12px rgba(0,0,0,0.4); z-index: 50; }
.command-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px; transition: all 0.15s ease; }
.command-item.active { background: rgba(19, 239, 149, 0.12); }
.command-item:hover { background: #1a1a1f; }
.command-trigger { color: #13ef95; font-family: 'Fira Code', Monaco, Consolas, monospace; font-weight: 600; min-width: 100px; }
.command-desc { color: #949498; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.command-type { font-size: 10px; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; font-weight: 600; }
.type-builtin { background: rgba(19, 239, 149, 0.12); color: #13ef95; }
.type-skill { background: rgba(19, 239, 149, 0.12); color: #12b76a; }
.empty-state { display: flex; align-items: center; justify-content: center; height: 100%; color: #4e4e52; font-size: 16px; }

/* Skills tab */
.skills-layout { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.skills-sidebar { width: 280px; border-right: 1px solid #2c2c33; overflow-y: auto; padding: 16px; flex-shrink: 0; overscroll-behavior: contain; }
.skills-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.skills-title { margin: 0; font-size: 18px; }
.skills-empty { color: #4e4e52; font-size: 13px; padding: 8px 0; }
.skill-entry { padding: 10px 12px; border-radius: 8px; cursor: pointer; margin-bottom: 4px; transition: all 0.15s ease; }
.skill-entry:hover { background: #1a1a1f; }
.skill-entry.selected { background: rgba(19, 239, 149, 0.12); border-left: 3px solid #13ef95; }
.skill-entry-name { font-weight: 600; color: #fbfbff; font-size: 14px; }
.skill-entry-trigger { font-family: 'Fira Code', Monaco, Consolas, monospace; color: #13ef95; font-size: 12px; }
.skill-entry-desc { color: #949498; font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity-group-label { padding: 10px 16px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #13ef95; display: flex; align-items: center; gap: 6px; border-top: 1px solid #2c2c33; margin-top: 4px; }
.identity-group-label:first-of-type { border-top: none; margin-top: 0; }
.identity-group-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: #4e4e52; font-size: 11px; }
.skills-detail { flex: 1; padding: 24px; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; overscroll-behavior: contain; }
.skills-detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #4e4e52; text-align: center; gap: 8px; }
.skills-detail-empty p { margin: 0; }
.skills-hint { font-size: 12px; color: #4e4e52; max-width: 320px; line-height: 1.5; }
.skill-view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.skill-view-name { margin: 0; font-size: 16px; color: #fbfbff; }
.skill-view-actions { display: flex; gap: 8px; }
.skill-content { background: #050506; border: 1px solid #2c2c33; border-radius: 8px; padding: 16px; color: #fbfbff; font-size: 13px; white-space: pre-wrap; overflow-x: auto; }
.skill-editor { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.skill-editor-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.skill-editor-title-row { display: flex; flex-direction: column; gap: 4px; }
.skill-editor-title-row h3 { margin: 0; }
.skill-editor-hint { font-size: 12px; color: #4e4e52; }
.skill-textarea { flex: 1; background: #050506; border: 1px solid #2c2c33; border-radius: 8px; padding: 16px; color: #fbfbff; font-family: 'Fira Code', Monaco, Consolas, monospace; font-size: 13px; resize: none; min-height: 300px; transition: all 0.15s ease; }
.skills-divider { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; color: #4e4e52; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.skills-divider::before, .skills-divider::after { content: ''; flex: 1; height: 1px; background: #2c2c33; }
.skill-entry.example .skill-entry-name { color: #949498; }
.skill-entry.example .skill-entry-trigger { color: #949498; }
.skill-example-badge { display: inline-block; font-size: 10px; color: #949498; background: #1a1a1f; border: 1px solid #2c2c33; border-radius: 4px; padding: 1px 6px; margin-left: 8px; vertical-align: middle; font-weight: 400; }
.skill-example-note { font-size: 12px; color: #949498; margin: 0 0 12px; line-height: 1.5; }
.skill-textarea:focus { outline: none; border-color: #13ef95; box-shadow: 0 0 0 2px rgba(19, 239, 149, 0.15); }

/* Archive tab */
.archive-layout { padding: 24px; max-width: 700px; margin: 0 auto; height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.archive-entry { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 12px 16px; background: #1a1a1f; border: 1px solid #2c2c33; border-radius: 8px; margin-bottom: 8px; }
.archive-entry .archive-projects { width: 100%; }
.archive-info { display: flex; flex-direction: column; gap: 4px; }
.archive-name { font-size: 15px; color: #fbfbff; }
.archive-date { font-size: 12px; color: #4e4e52; }
.restore-btn { padding: 6px 14px; background: #1a1a1f; border: 1px solid #2c2c33; border-radius: 8px; color: #949498; cursor: pointer; font-size: 13px; transition: all 0.15s ease; }
.restore-btn:hover { color: #fbfbff; border-color: #13ef95; }

/* Hamburger button — hidden on desktop */
.hamburger-btn { display: none; background: none; border: none; color: #fbfbff; font-size: 22px; padding: 8px 12px; cursor: pointer; line-height: 1; transition: all 0.15s ease; }
.hamburger-btn:hover { color: #13ef95; }

/* Sidebar overlay backdrop — hidden on desktop */
.sidebar-overlay { display: none; }
.config-sidebar-overlay { display: none; }

@media (max-width: 768px) {
    .hamburger-btn { display: block; }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 100;
    }

    .sidebar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    .sidebar.open { transform: translateX(0); }

    .hives-layout { height: 100%; }
    .chat-pane { height: 100%; }

    .message { max-width: 90%; }

    .skills-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        border-right: 1px solid #2c2c33;
    }
    .skills-sidebar.open { transform: translateX(0); }

    .config-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }

    /* Config sidebar: collapsible on mobile — z-index 200 to sit above inner skills-sidebar */
    .config-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 180px;
        z-index: 200;
        background: #1a1a1f;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    .config-sidebar.open { transform: translateX(0); }

    /* Config content takes full width on mobile */
    .config-content { max-width: none; padding: 16px; height: 100%; }

    /* Skills/Identity/Prompts: full-screen swap pattern on mobile */
    .config-content .skills-layout { flex-direction: column; }
    .config-content .skills-sidebar {
        position: relative;
        transform: none;
        width: 100%;
        border-right: none;
        background: #0e0e10;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }
    .config-content .skills-detail { flex: 1; min-height: 0; }

    /* When editing: hide list, show editor full-screen */
    .config-content .skills-layout.editing-active .skills-sidebar { display: none; }
    .config-content .skills-layout.editing-active .skills-detail { flex: 1; }

    /* When NOT editing: hide detail pane, list takes full height */
    .config-content .skills-layout:not(.editing-active) .skills-detail { display: none; }

    /* MD editor textarea takes full height */
    .skill-textarea { min-height: 50vh; }

}

/* Server cards */
.server-cards { display: flex; flex-direction: column; gap: 12px; }
.server-group-title { color: #8b949e; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 16px 0 8px; padding: 0; font-weight: 600; }
.server-group-title:first-of-type { margin-top: 0; }
.server-card { background: #1a1a1f; border: 1px solid #2c2c33; border-radius: 8px; padding: 16px; overflow: hidden; }
.server-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.server-name { font-size: 16px; font-weight: 600; color: #fbfbff; margin-right: 8px; }
.server-desc { color: #949498; font-size: 13px; margin-bottom: 8px; }
.server-help { color: #4e4e52; font-size: 12px; font-style: italic; margin-bottom: 8px; }

/* Status badges */
.server-badge { font-size: 12px; padding: 2px 8px; border-radius: 12px; }
.badge-connected { background: rgba(19, 239, 149, 0.08); color: #13ef95; border: 1px solid rgba(19, 239, 149, 0.25); }
.badge-needs-auth { background: rgba(254, 200, 75, 0.08); color: #fec84b; border: 1px solid rgba(254, 200, 75, 0.25); }
.badge-not-configured { background: #2c2c33; color: #4e4e52; border: 1px solid #2c2c33; }
.badge-not-connected { background: #1a1a1f; color: #949498; border: 1px solid #2c2c33; }
.badge-team-fallback { background: rgba(254, 200, 75, 0.08); color: #fec84b; border: 1px solid rgba(254, 200, 75, 0.25); }
.badge-disabled { background: rgba(110, 110, 114, 0.08); color: #6e6e72; border: 1px solid #2c2c33; }

.server-card-disabled { opacity: 0.5; }
.server-disabled-reason { color: #6e6e72; font-size: 12px; font-style: italic; margin-bottom: 8px; }

/* Actions */
.server-actions { margin-top: 12px; }
.connect-btn { padding: 8px 16px; background: #13ef95; border: none; border-radius: 8px; color: #000; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.15s ease; }
.connect-btn:hover { background: #0fd485; }
.connect-btn.small { padding: 6px 12px; }
.disconnect-btn { padding: 6px 12px; background: none; border: 1px solid rgba(240, 68, 56, 0.4); border-radius: 8px; color: #f04438; cursor: pointer; font-size: 13px; transition: all 0.15s ease; }
.disconnect-btn:hover { background: rgba(240, 68, 56, 0.08); }
/* Switch-to-team variant: same action as disconnect, but neutral yellow
   styling because the user falls back to team default rather than truly
   losing the server (issue #161 follow-up). */
.switch-team-btn { padding: 6px 12px; background: none; border: 1px solid rgba(254, 200, 75, 0.4); border-radius: 8px; color: #fec84b; cursor: pointer; font-size: 13px; transition: all 0.15s ease; }
.switch-team-btn:hover { background: rgba(254, 200, 75, 0.08); }
.text-btn { background: none; border: none; color: #149afb; cursor: pointer; font-size: 12px; padding: 4px 0; transition: all 0.15s ease; }
.text-btn:hover { text-decoration: underline; }

.auth-link-section { margin-top: 8px; }
.auth-link { color: #149afb; font-size: 13px; }
.paste-fallback { margin-top: 6px; }
.paste-input-row { display: flex; gap: 8px; margin-top: 6px; }
.token-input-row { display: flex; gap: 8px; }
.paste-input { flex: 1; padding: 6px 10px; background: #050506; border: 1px solid #2c2c33; border-radius: 8px; color: #fbfbff; font-size: 13px; transition: all 0.15s ease; }
.paste-input:focus { border-color: #13ef95; box-shadow: 0 0 0 2px rgba(19, 239, 149, 0.15); outline: none; }
.config-needed { color: #4e4e52; font-size: 12px; font-style: italic; margin-top: 8px; }

/* Config sidebar layout */
.config-sidebar-layout { display: flex; height: 100%; overflow: hidden; }
.config-sidebar { width: 150px; min-width: 150px; background: #1a1a1f; border-right: 1px solid #2c2c33; padding: 12px 0; }
.config-sidebar-item { padding: 10px 16px; font-size: 13px; color: #949498; cursor: pointer; border-left: 2px solid transparent; transition: all 0.15s ease; }
.config-sidebar-item:hover { color: #fbfbff; background: rgba(19, 239, 149, 0.04); }
.config-sidebar-item.active { color: #fbfbff; background: rgba(19, 239, 149, 0.08); border-left-color: #13ef95; }
.config-sidebar-item.sub { padding-left: 28px; font-size: 12px; }
.config-sidebar-group { padding: 16px 16px 4px; font-size: 11px; color: #6e6e72; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.config-content { flex: 1; padding: 24px; overflow-y: auto; max-width: 800px; min-height: 0; overscroll-behavior: contain; }
.config-content:has(.skills-layout) { max-width: none; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.config-content-title { color: #fbfbff; font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.config-content-subtitle { color: #949498; font-size: 13px; margin-bottom: 20px; }

/* Identity cards */
.identity-cards { display: flex; flex-direction: column; gap: 12px; }
.identity-card { background: #1a1a1f; border: 1px solid #2c2c33; border-radius: 8px; padding: 16px; cursor: pointer; transition: border-color 0.15s, opacity 0.15s; }
.identity-card:hover { border-color: #4e4e52; }
.identity-card.expanded { border-color: #13ef95; cursor: default; }
.identity-card.dimmed { opacity: 0.6; }
.identity-card-header { display: flex; justify-content: space-between; align-items: center; }
.identity-card-name { font-size: 14px; font-weight: 600; color: #fbfbff; }
.identity-card-desc { font-size: 12px; color: #949498; margin-top: 2px; }
.identity-card-meta { display: flex; align-items: center; gap: 8px; }
.identity-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.identity-badge.has-content { background: rgba(19, 239, 149, 0.08); color: #13ef95; border: 1px solid rgba(19, 239, 149, 0.25); }
.identity-badge.empty { background: rgba(254, 200, 75, 0.08); color: #fec84b; border: 1px solid rgba(254, 200, 75, 0.25); }
.identity-chevron { font-size: 14px; color: #4e4e52; transition: transform 0.15s; }
.identity-chevron.open { transform: rotate(90deg); }
.identity-preview { margin-top: 10px; background: #050506; border-radius: 4px; padding: 8px 10px; font-family: 'Fira Code', Monaco, Consolas, monospace; font-size: 11px; color: #4e4e52; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.identity-editor { margin-top: 12px; }
.identity-textarea { width: 100%; min-height: 200px; max-height: 500px; background: #050506; border: 1px solid #2c2c33; border-radius: 4px; padding: 10px; font-family: 'Fira Code', Monaco, Consolas, monospace; font-size: 12px; color: #fbfbff; line-height: 1.5; resize: vertical; box-sizing: border-box; transition: all 0.15s ease; }
.identity-textarea:focus { outline: none; border-color: #13ef95; box-shadow: 0 0 0 2px rgba(19, 239, 149, 0.15); }
.identity-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.identity-btn-cancel { padding: 6px 14px; background: transparent; border: 1px solid #2c2c33; border-radius: 8px; color: #949498; cursor: pointer; font-size: 12px; transition: all 0.15s ease; }
.identity-btn-cancel:hover { border-color: #4e4e52; color: #fbfbff; }
.identity-btn-save { padding: 6px 14px; background: #13ef95; border: none; border-radius: 8px; color: #000; cursor: pointer; font-size: 12px; font-weight: 600; transition: all 0.15s ease; }
.identity-btn-save:hover { background: #0fd485; }
.identity-btn-save:disabled { opacity: 0.6; cursor: not-allowed; }
.identity-loading { text-align: center; color: #949498; padding: 40px 0; font-size: 14px; }
.identity-error { text-align: center; color: #f04438; padding: 40px 0; font-size: 14px; }
.identity-save-error { color: #f04438; font-size: 12px; margin-right: auto; align-self: center; }

/* Markdown rendering */
.markdown-body { line-height: 1.6; }
.markdown-body p { margin-bottom: 8px; }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body code { background: #1a1a1f; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; font-family: 'Fira Code', Monaco, Consolas, monospace; }
.markdown-body pre { background: #1a1a1f; padding: 12px; border-radius: 8px; overflow-x: auto; margin: 8px 0; }
.markdown-body pre code { background: none; padding: 0; }
.markdown-body ul, .markdown-body ol { margin: 8px 0; padding-left: 24px; }
.markdown-body li { margin-bottom: 4px; }
.markdown-body strong { color: #fbfbff; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: #fbfbff; margin: 12px 0 8px; }
.markdown-body blockquote { border-left: 3px solid #2c2c33; padding-left: 12px; color: #949498; margin: 8px 0; }
.markdown-body a { color: #149afb; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body hr { border: none; border-top: 1px solid #2c2c33; margin: 12px 0; }

/* ── Markdown tables ──────────────────────────────────────────────────────── */
.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
    font-size: 0.88em;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--border, #2c2c33);
    padding: 6px 10px;
    text-align: left;
}

.markdown-body th {
    background: rgba(255, 255, 255, 0.06);
    font-weight: 600;
    color: var(--text, #fbfbff);
}

.markdown-body tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.025);
}

.markdown-body tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

.worker-report table {
    border-collapse: collapse;
    width: 100%;
    margin: 6px 0;
    font-size: 0.8em;
}

.worker-report th,
.worker-report td {
    border: 1px solid var(--border, #2c2c33);
    padding: 4px 8px;
    text-align: left;
}

.worker-report th {
    background: rgba(255, 255, 255, 0.06);
    font-weight: 600;
}

/* Thread activity indicator (in-thread processing status) */
.thread-activity-indicator {
    margin: 12px 20px; padding: 12px 16px;
    background: rgba(19, 239, 149, 0.06); border: 1px solid rgba(19, 239, 149, 0.15);
    border-radius: 8px; font-size: 13px;
}
.thread-activity-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: #13ef95; font-weight: 500; }
.thread-breadcrumb { display: flex; align-items: center; gap: 6px; padding: 3px 0; color: #b0b0b4; font-size: 12px; }
.thread-breadcrumb.bc-running { color: #e0e0e4; }
.thread-breadcrumb.bc-completed { color: #949498; }
.thread-breadcrumb.bc-failed { color: #ff6b6b; }
.bc-icon { font-size: 11px; width: 14px; text-align: center; }
.bc-running .bc-icon { color: #13ef95; animation: spin 0.8s linear infinite; display: inline-block; }
.bc-completed .bc-icon { color: #13ef95; }
.bc-failed .bc-icon { color: #ff6b6b; }
.bc-duration { color: #666; margin-left: auto; }

/* Worker activity panel inside thread view */
.thread-worker-panel {
    margin: 8px 20px 12px; padding: 12px 16px;
    background: rgba(99, 102, 241, 0.08); border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
}
.thread-worker-row { margin-bottom: 8px; }
.thread-worker-row:last-child { margin-bottom: 0; }
.thread-worker-header { display: flex; align-items: center; gap: 8px; }
.thread-worker-goal { color: #e0e0e4; font-size: 13px; font-weight: 500; flex: 1; }
.thread-worker-status { font-size: 11px; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.thread-worker-status.ws-working { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.thread-worker-status.ws-spawned { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.thread-worker-message { color: #949498; font-size: 12px; margin-top: 4px; padding-left: 20px; }

/* ── Write gate approval card ─────────────────────────────────── */
.approval-card {
    margin: 8px 20px 12px; padding: 14px 16px;
    background: rgba(234, 179, 8, 0.08); border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 8px;
}
.approval-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.approval-icon { font-size: 16px; }
.approval-title { color: #fec84b; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.approval-tool { color: #e0e0e4; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.approval-params {
    color: #949498; font-size: 12px; font-family: monospace;
    background: #111113; border-radius: 6px; padding: 8px 12px;
    max-height: 120px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
    margin-bottom: 10px;
}
.approval-actions { display: flex; gap: 8px; }
.approval-btn {
    padding: 6px 16px; border: none; border-radius: 6px; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: opacity 0.15s;
}
.approval-btn:hover { opacity: 0.85; }
.approval-btn.approve { background: #13ef95; color: #0a0a0c; }
.approval-btn.reject { background: #ef4444; color: #fff; }

/* ── Swarm thinking transparency block ──────────────────────────── */
.thinking-block {
    margin: 8px 20px 12px;
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.thinking-block.collapsed {
    background: rgba(139, 92, 246, 0.03);
    border-color: rgba(139, 92, 246, 0.1);
}
.thinking-header {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
}
.thinking-header:hover { background: rgba(139, 92, 246, 0.08); }
.thinking-toggle { color: #a78bfa; font-size: 10px; width: 12px; text-align: center; }
.thinking-label { color: #a78bfa; font-size: 12px; font-weight: 500; letter-spacing: 0.3px; }
.thinking-body {
    padding: 0 12px 10px;
    max-height: 600px;
    overflow-y: auto;
}
.thinking-text {
    color: #94909e; font-size: 12px; line-height: 1.5;
    white-space: pre-wrap; word-break: break-word;
    padding: 6px 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    margin-bottom: 6px;
    max-height: 200px;
    overflow-y: auto;
}
/* Worker card (expandable) */
.thinking-worker-card {
    margin: 4px 0;
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 5px;
    overflow: hidden;
    font-size: 12px;
}
.thinking-worker-card.tw-working, .thinking-worker-card.tw-spawned { border-color: rgba(196, 181, 253, 0.25); }
.thinking-worker-card.tw-completed { border-color: rgba(110, 231, 183, 0.2); }
.thinking-worker-card.tw-failed { border-color: rgba(252, 165, 165, 0.2); }
.tw-card-header {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px;
    cursor: pointer;
    user-select: none;
}
.tw-card-header:hover { background: rgba(139, 92, 246, 0.06); }
.tw-card-toggle { color: #78747f; font-size: 9px; margin-left: auto; }
.tw-icon { width: 14px; text-align: center; font-size: 11px; }
.thinking-worker-card.tw-working .tw-icon, .thinking-worker-card.tw-spawned .tw-icon { color: #c4b5fd; }
.thinking-worker-card.tw-completed .tw-icon { color: #6ee7b7; }
.thinking-worker-card.tw-failed .tw-icon { color: #fca5a5; }
.tw-goal { flex: 1; color: #ccc; }
.tw-status {
    font-size: 10px; padding: 1px 5px; border-radius: 3px;
    text-transform: uppercase; letter-spacing: 0.4px;
    background: rgba(139, 92, 246, 0.15); color: #a78bfa;
}
.thinking-worker-card.tw-completed .tw-status { background: rgba(110, 231, 183, 0.15); color: #6ee7b7; }
.thinking-worker-card.tw-failed .tw-status { background: rgba(252, 165, 165, 0.15); color: #fca5a5; }
.tw-card-body {
    padding: 4px 8px 8px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}
.tw-logs { display: flex; flex-direction: column; gap: 2px; }
.tw-log-entry {
    color: #78747f; font-size: 11px; line-height: 1.4;
    padding: 1px 0;
    border-left: 2px solid rgba(139, 92, 246, 0.15);
    padding-left: 6px;
}
.tw-live-status { color: #a78bfa; font-size: 11px; font-style: italic; }
.tw-report { margin-top: 4px; }
.tw-report-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px;
    color: #6ee7b7; margin-bottom: 4px;
}
.tw-report-content {
    font-size: 12px; line-height: 1.5; color: #d4d0db;
    max-height: 300px; overflow-y: auto;
}
.tw-report-content p { margin: 0 0 6px; }
.tw-report-content h2, .tw-report-content h3 { font-size: 12px; color: #e8e4ee; margin: 8px 0 4px; }
/* Legacy bare tool row (kept for any callers still producing { name, status }). */
.thinking-tool {
    display: flex; align-items: center; gap: 6px;
    padding: 2px 0; font-size: 11px; color: #78747f;
}
.thinking-tool.tt-done .tt-icon { color: #6ee7b7; }
.thinking-tool.tt-running .tt-icon { color: #a78bfa; }
.tt-icon { width: 14px; text-align: center; }
.tt-name { font-family: monospace; font-size: 11px; }

/* Issue #98: tool entries as collapsible cards (worker-card pattern). */
.thinking-tool-card {
    margin: 4px 0;
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 5px;
    overflow: hidden;
    font-size: 12px;
}
.thinking-tool-card.tt-done { border-color: rgba(110, 231, 183, 0.2); }
.thinking-tool-card.tt-running { border-color: rgba(196, 181, 253, 0.25); }
/* Status-icon colors mirror the legacy .thinking-tool row so the check / spinner
   stays legible on both card shapes. Without these rules the icon fell through to
   the default muted color, losing the visual done/running distinction. */
.thinking-tool-card.tt-done .tt-icon { color: #6ee7b7; }
.thinking-tool-card.tt-running .tt-icon { color: #a78bfa; }
.tt-card-header {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px;
    cursor: pointer;
    user-select: none;
}
.tt-card-header:hover { background: rgba(139, 92, 246, 0.06); }
.tt-preview {
    flex: 1;
    font-family: monospace;
    color: #b8b2c2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
}
.tt-card-toggle { color: #78747f; font-size: 9px; margin-left: auto; flex-shrink: 0; }
.tt-card-body {
    padding: 6px 8px 8px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
}
.tt-section { margin-bottom: 6px; }
.tt-section:last-child { margin-bottom: 0; }
.tt-section-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px;
    color: #a78bfa; margin-bottom: 3px;
}
.tt-code {
    font-family: monospace; font-size: 11px;
    color: #d4d0db;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 8px;
    border-radius: 3px;
    white-space: pre-wrap; word-break: break-word;
    max-height: 400px; overflow-y: auto;
    margin: 0;
}
.tt-show-more {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 8px;
    font-size: 10px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 3px;
    color: #a78bfa;
    cursor: pointer;
}
.tt-show-more:hover { background: rgba(139, 92, 246, 0.2); }

/* Message-level thinking (attached to completed assistant messages) */
.msg-thinking-block {
    margin-bottom: 8px;
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 6px;
    overflow: hidden;
}
.msg-thinking-block.collapsed { border-color: rgba(139, 92, 246, 0.08); }
.msg-thinking-block .thinking-header { padding: 6px 10px; }
.msg-thinking-block .thinking-body { padding: 0 10px 8px; }
.thinking-summary { color: #78747f; font-size: 11px; margin-left: 4px; }

/* Typing indicator */
.typing-indicator { display: inline-flex; align-items: center; gap: 6px; padding: 16px 20px !important; max-width: fit-content !important; }
.typing-indicator .dot {
    width: 10px; height: 10px; border-radius: 50%; background: #949498; display: inline-block;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}
.typing-indicator .dot:nth-child(1) { animation-delay: 0s; }
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
.tool-label { color: #13ef95; font-size: 13px; font-style: italic; }

/* ── Hive tool breadcrumbs ───────────────────────────────────────── */
.hive-breadcrumbs { display: flex; flex-direction: column; gap: 4px; padding: 8px 20px; }
.breadcrumb-line { display: flex; align-items: center; gap: 8px; animation: breadcrumb-fade-in 0.15s ease; }
.breadcrumb-desc { font-size: 13px; font-weight: 400; color: #949498; }
.breadcrumb-spinner {
    width: 12px; height: 12px;
    border: 2px solid rgba(19, 239, 149, 0.2);
    border-top-color: #13ef95;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.breadcrumb-done { display: inline-flex; align-items: center; gap: 4px; }
.breadcrumb-check { color: #13ef95; font-size: 12px; }
.breadcrumb-duration { color: #949498; font-size: 12px; }
.breadcrumb-fail { display: inline-flex; align-items: center; gap: 4px; }
.breadcrumb-x { color: #ef4444; font-size: 12px; }
.breadcrumb-error { color: #949498; font-size: 12px; }
.breadcrumb-summary {
    font-size: 13px; font-weight: 600; color: #13ef95;
    cursor: pointer; padding: 4px 8px; border-radius: 4px;
    margin: 4px 20px; width: fit-content;
}
.breadcrumb-summary:hover { background: rgba(19, 239, 149, 0.06); }
@keyframes breadcrumb-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Summary compression card */
.message.summary { background: none !important; padding: 0 !important; max-width: 100% !important; align-self: stretch !important; margin: 16px 0; }
.summary-card { border: 1px solid #2c2c33; border-radius: 8px; overflow: hidden; width: 100%; }
.summary-header { background: #1a1a1f; color: #949498; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 8px 14px; border-bottom: 1px solid #2c2c33; }
.summary-body { padding: 12px 14px; font-size: 13px; color: #fbfbff; max-height: 200px; overflow-y: auto; }

/* Error card */
.message.error { background: rgba(240, 68, 56, 0.1) !important; border: 1px solid rgba(240, 68, 56, 0.4) !important; color: #f04438; max-width: 100% !important; align-self: stretch !important; font-size: 13px; display: flex; align-items: flex-start; gap: 8px; }
.error-icon { flex-shrink: 0; }

/* ── Worker tree in sidebar ─────────────────────────────────────────────── */
.worker-tree {
    margin-left: 12px;
    border-left: 1px solid #2c2c33;
    padding-left: 8px;
    margin-top: 2px;
}

.worker-entry {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #949498;
    transition: all 0.15s ease;
}

.worker-entry:hover {
    background: rgba(19, 239, 149, 0.06);
    color: #fbfbff;
}

.worker-dot {
    flex-shrink: 0;
    font-size: 10px;
}

.worker-goal {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.worker-entry-pinned {
    border-left: 2px solid #13ef95;
    margin-left: 2px;
    padding-left: 4px;
    opacity: 0.85;
}

/* ── Project tree in sidebar ────────────────────────────────────────────── */
.project-tree {
    margin-left: 12px;
    border-left: 1px solid #2c2c33;
    padding-left: 8px;
    margin-top: 2px;
}

.project-entry {
    margin-bottom: 4px;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #949498;
    user-select: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.project-header:hover {
    background: rgba(19, 239, 149, 0.06);
    color: #fbfbff;
}

.project-chevron {
    flex-shrink: 0;
    font-size: 13px;
    color: #4e4e52;
    width: 14px;
    text-align: center;
}

.project-worker-summary {
    flex-shrink: 0;
    font-size: 11px;
    margin-left: auto;
}

.project-icon {
    flex-shrink: 0;
    font-size: 11px;
}

.project-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* ── Approval card ──────────────────────────────────────────────────────── */
.message.approval {
    background: rgba(254, 200, 75, 0.1) !important;
    border: 1px solid rgba(254, 200, 75, 0.4) !important;
    max-width: 100% !important;
    align-self: stretch !important;
}

.approval-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #fec84b;
}

.approval-tool {
    font-size: 13px;
    margin-bottom: 4px;
    color: #fbfbff;
}

.approval-params {
    background: #050506;
    border-radius: 4px;
    padding: 8px;
    font-size: 12px;
    color: #949498;
    margin-bottom: 8px;
    overflow-x: auto;
    max-height: 150px;
    overflow-y: auto;
}

.approval-params pre {
    margin: 0;
    white-space: pre-wrap;
}

.approval-actions {
    display: flex;
    gap: 8px;
}

.message.approval.approval-resolved {
    opacity: 0.7;
    border-color: rgba(148, 148, 152, 0.3) !important;
    background: rgba(148, 148, 152, 0.05) !important;
}

.approval-resolved .approval-header {
    color: #949498;
}

/* ── Worker messages ────────────────────────────────────────────────────── */
.message.worker-finding {
    background: #1a1a1f !important;
    border: 1px solid #2c2c33 !important;
    max-width: 100% !important;
    align-self: stretch !important;
}

.message.worker-question {
    background: rgba(19, 239, 149, 0.05) !important;
    border: 1px solid rgba(19, 239, 149, 0.3) !important;
    max-width: 100% !important;
    align-self: stretch !important;
}

.worker-badge {
    font-size: 11px;
    color: #949498;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Project view ─────────────────────────────────────────────────────────── */
.project-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.project-view-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border, #2c2c33);
    background: var(--surface, #1a1a1f);
    flex-shrink: 0;
}

.back-btn {
    background: none;
    border: 1px solid var(--border, #2c2c33);
    color: var(--text-muted, #949498);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.back-btn:hover {
    color: var(--text, #fbfbff);
    border-color: var(--text, #fbfbff);
}

.project-view-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text, #fbfbff);
}

.worker-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    align-content: start;
}

.worker-grid-empty {
    color: var(--text-muted, #949498);
    font-size: 0.9rem;
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
}

/* ── Worker cards ─────────────────────────────────────────────────────────── */
.worker-card {
    background: var(--surface, #1a1a1f);
    border: 1px solid var(--border, #2c2c33);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 360px;
}

.worker-card-working { border-left: 3px solid #149afb; }
.worker-card-completed { border-left: 3px solid #13ef95; }
.worker-card-failed { border-left: 3px solid #f04438; }
.worker-card-dismissed { border-left: 3px solid #4e4e52; opacity: 0.6; }
.worker-card-spawned { border-left: 3px solid #4e4e52; }
.worker-card-waiting_for_input { border-left: 3px solid #fec84b; }

.worker-card-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border, #2c2c33);
    flex-shrink: 0;
}

.worker-card-dot {
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.worker-card-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text, #fbfbff);
    line-height: 1.4;
}

/* ── Worker feed (active status messages) ─────────────────────────────────── */
.worker-feed {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.worker-feed-entry {
    font-size: 0.78rem;
    color: var(--text-muted, #949498);
    line-height: 1.4;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.worker-feed-entry:last-child { border-bottom: none; }

.worker-feed-waiting {
    font-style: italic;
    opacity: 0.6;
}

/* ── Worker report (completed) ────────────────────────────────────────────── */
.worker-report {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text, #fbfbff);
}

.worker-report h1, .worker-report h2, .worker-report h3 {
    font-size: 0.88rem;
    margin: 8px 0 4px;
}

.worker-report ul, .worker-report ol {
    padding-left: 16px;
    margin: 4px 0;
}

.worker-report p { margin: 4px 0; }

/* ── Worker error (failed) ────────────────────────────────────────────────── */
.worker-error {
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.82rem;
    color: #fca5a5;
}

.worker-error-icon { flex-shrink: 0; }

.dismiss-btn {
    padding: 2px 10px;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.dismiss-btn:hover { background: rgba(255,255,255,0.15); }

/* ── Worker dismissed ────────────────────────────────────────────────────── */
.worker-dismissed {
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #4e4e52;
}

/* ── Worker waiting ───────────────────────────────────────────────────────── */
.worker-waiting {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #fec84b;
}

/* ── Worker notification badge ────────────────────────────────────────────── */
.message.worker-notification {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border, #2c2c33);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-muted, #949498);
    transition: background 0.15s, border-color 0.15s;
    max-width: 100%;
    box-sizing: border-box;
}
.worker-notif-header { display: flex; align-items: center; gap: 8px; width: 100%; }
.message.worker-notification.has-question { border-color: #fec84b; background: rgba(254, 200, 75, 0.08); }

/* ── Worker question thread ────────────────────────────────────────────── */
.worker-thread { display: flex; gap: 0; padding: 6px 0 2px 8px; position: relative; }
.thread-line { width: 2px; background: #2c2c33; border-radius: 1px; flex-shrink: 0; margin: 4px 0; }
.thread-messages { flex: 1; display: flex; flex-direction: column; gap: 6px; padding-left: 10px; }
.thread-msg { padding: 6px 10px; border-radius: 10px; font-size: 13px; line-height: 1.4; max-width: 90%; }
.thread-msg-worker { background: #1a1a1f; border: 1px solid #2c2c33; align-self: flex-start; }
.thread-msg-user { background: linear-gradient(135deg, #149afb, #13ef95); color: #000; align-self: flex-end; }
.thread-author { display: block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #949498; margin-bottom: 2px; }
.thread-msg-user .thread-author { color: rgba(0,0,0,0.6); }
.thread-body { margin: 0; color: #fbfbff; }
.thread-msg-user .thread-body { color: #000; }
.thread-reply-row { display: flex; gap: 6px; align-items: center; }
.thread-reply-input { flex: 1; background: #050506; border: 1px solid #2c2c33; border-radius: 16px; padding: 6px 12px; color: #fbfbff; font-size: 13px; transition: all 0.15s ease; }
.thread-reply-input:focus { outline: none; border-color: #13ef95; box-shadow: 0 0 0 2px rgba(19, 239, 149, 0.15); }
.thread-reply-btn { width: 28px; height: 28px; border-radius: 50%; background: #13ef95; border: none; color: #000; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; transition: all 0.15s ease; }
.thread-reply-btn:hover { background: #0fd485; }

.message.worker-notification:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent, #13ef95);
    color: var(--text, #fbfbff);
}

.worker-notif-dot {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.worker-notif-body {
    flex: 1;
    min-width: 0;
    white-space: normal;
    word-break: break-word;
}

.worker-notif-project {
    font-weight: 500;
    color: var(--text, #fbfbff);
}

.worker-notif-sep {
    color: var(--text-muted, #4e4e52);
    margin: 0 2px;
}

.worker-notif-goal {
    color: var(--text-muted, #949498);
}

.worker-notif-label {
    font-weight: 500;
}

.worker-notif-arrow {
    font-size: 0.75rem;
    flex-shrink: 0;
    opacity: 0.5;
}

.message.worker-notification:hover .worker-notif-arrow {
    opacity: 1;
}

/* ── Worker card highlight flash ──────────────────────────────────────────── */
@keyframes worker-highlight-flash {
    0%   { box-shadow: 0 0 0 3px rgba(19, 239, 149, 1), 0 0 20px rgba(19, 239, 149, 0.4); background: rgba(19, 239, 149, 0.12); }
    100% { box-shadow: none; background: transparent; }
}

.worker-card-highlighted {
    animation: worker-highlight-flash 0.9s ease-out 1;
}

/* ── Settings tab ───────────────────────────────────────────────────────── */
nav .settings-btn {
    margin-left: auto;
    color: #f0c040;
    font-size: 18px;
    padding: 8px 14px;
    line-height: 1;
}
nav .settings-btn.active {
    color: #f0c040;
    border-bottom-color: #f0c040;
}
nav .settings-btn svg {
    display: block;
}

.settings-layout {
    padding: 32px 40px;
    max-width: 600px;
    height: 100%;
    overflow-y: auto;
}

.settings-title {
    font-size: 20px;
    color: #fbfbff;
    margin-bottom: 24px;
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section-title {
    font-size: 14px;
    color: #fbfbff;
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-section-desc {
    font-size: 12px;
    color: #949498;
    margin-bottom: 16px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #2c2c33;
}

.settings-row-text {
    flex: 1;
    padding-right: 24px;
}

.settings-label {
    font-size: 13px;
    color: #fbfbff;
    font-weight: 500;
}

.settings-desc {
    font-size: 12px;
    color: #949498;
    margin-top: 2px;
}

.settings-toggle {
    width: 36px;
    height: 20px;
    background: #2c2c33;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.settings-toggle.on {
    background: #13ef95;
}

.settings-toggle-knob {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.2s;
}

.settings-toggle.on .settings-toggle-knob {
    left: 18px;
}

/* ── Project archive button ─────────────────────────────────────────────── */
.project-archive-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.project-header:hover .project-archive-btn {
    opacity: 1;
    pointer-events: auto;
}

/* ── Archive page — active hives with archived projects ────────────────── */
.archive-hive-active {
    opacity: 0.55;
    filter: brightness(0.8);
}

.archive-active-badge {
    display: inline-block;
    font-size: 10px;
    color: #13ef95;
    border: 1px solid #13ef95;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
}

.archive-projects {
    margin-top: 8px;
    padding-left: 12px;
}

.archive-project-entry {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 12px;
    color: #949498;
}

.archive-project-icon {
    font-size: 11px;
    flex-shrink: 0;
}

.archive-project-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Project chat messages ─────────────────────────────────────────────── */
.project-chat-messages {
    border-top: 1px solid #2c2c33;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.project-chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px 12px;
}

.project-chat-messages .message {
    max-width: 90%;
    font-size: 0.88rem;
}

/* ── Project status badges ─────────────────────────────────────────────── */
.project-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.project-status-active { background: #13ef95; box-shadow: 0 0 6px rgba(18, 183, 106, 0.4); }
.project-status-needs_review { background: #fec84b; }
.project-status-idle { background: #149afb; }
.project-status-completed { background: #4e4e52; }

/* ── New chat row with template select ─────────────────────────────────── */
.new-chat-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.new-chat-row .new-chat-btn {
    flex: 1;
    margin-bottom: 0;
}

.new-chat-template-select {
    width: 90px;
    padding: 4px 6px;
    background: #1a1a1f;
    border: 1px solid #2c2c33;
    border-radius: 8px;
    color: #949498;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.new-chat-template-select:hover {
    border-color: #13ef95;
    color: #fbfbff;
}

/* ── New Chat Modal ──────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #1a1a1f;
    border: 1px solid #2c2c33;
    border-radius: 12px;
    padding: 24px;
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin: 0 0 4px;
    color: #fbfbff;
    font-size: 1.2em;
}

.modal-subtitle {
    margin: 0 0 16px;
    color: #949498;
    font-size: 0.85em;
}

.template-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.template-card {
    padding: 12px 14px;
    border: 1px solid #2c2c33;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.template-card:hover {
    border-color: #13ef95;
    background: #1a1a1f;
}

.template-card.selected {
    border-color: #13ef95;
    background: rgba(19, 239, 149, 0.06);
}

.template-name {
    font-weight: 600;
    color: #fbfbff;
    margin-bottom: 2px;
}

.template-desc {
    color: #949498;
    font-size: 0.8em;
    line-height: 1.3;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-cancel {
    padding: 8px 16px;
    border: 1px solid #2c2c33;
    border-radius: 8px;
    background: transparent;
    color: #949498;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.15s ease;
}

.modal-cancel:hover {
    color: #fbfbff;
    border-color: #4e4e52;
}

.modal-create {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: #13ef95;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.15s ease;
}

.modal-create:hover {
    background: #0fd485;
}

[x-cloak] { display: none !important; }

/* ── Loading Screen ──────────────────────────────────────── */
.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow-y: auto;
    padding: 24px 0;
    background: var(--bg, #0b0b0c);
}

.loading-card {
    background: var(--surface, #1a1a1f);
    border-radius: 12px;
    padding: 32px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.loading-header {
    text-align: center;
    margin-bottom: 24px;
}

.loading-header h2 {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent, #13ef95);
    margin: 0;
}

.loading-subtitle {
    font-size: 13px;
    color: #949498;
    margin-top: 4px;
}

.loading-phases {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.loading-divider {
    font-size: 11px;
    color: #949498;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-top: 1px solid #2c2c33;
    padding-top: 12px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.loading-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.loading-icon { width: 18px; text-align: center; font-size: 14px; }
.icon-ready { color: #13ef95; }
.icon-connecting { color: #fec84b; }
.icon-waiting { color: #4e4e52; }
.icon-failed { color: #f04438; }
.icon-not-configured { color: #4e4e52; }

.loading-label { flex: 1; font-size: 14px; }
.label-dimmed { color: #4e4e52; }

.loading-status { font-size: 11px; margin-left: auto; }
.status-ready { color: #13ef95; }
.status-connecting { color: #fec84b; }
.status-waiting { color: #4e4e52; }
.status-failed { color: #f04438; }

.loading-progress-container {
    margin-top: 16px;
    background: #050506;
    border-radius: 8px;
    height: 6px;
    overflow: hidden;
}

.loading-progress-bar {
    background: linear-gradient(90deg, #149afb, #13ef95);
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
}

.loading-counter {
    text-align: center;
    font-size: 11px;
    color: #949498;
    margin-top: 6px;
}


.btn-continue {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 10px;
    background: var(--accent, #13ef95);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-continue:hover { opacity: 0.9; }
.btn-continue-secondary { background: transparent; border: 1px solid #2c2c33; color: #949498; }
.btn-continue-secondary:hover { background: #1a1a1f; opacity: 1; }
.regression-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.regression-actions .btn-continue { margin-top: 0; }

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* ── Inbox List ──────────────────────────────────────────────────────────── */

.inbox-list {
    overflow-y: auto;
    padding: 16px;
    flex: 1;
    overscroll-behavior: contain;
}

.thread-entry {
    background: #1a1a1f;
    border: 1px solid #2c2c33;
    border-left: 3px solid transparent;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.thread-entry:hover {
    background: rgba(19, 239, 149, 0.06);
}

.thread-entry.selected {
    background: rgba(19, 239, 149, 0.12);
    border-left-color: #13ef95;
}

.thread-entry.processing {
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-left-color: #13ef95; }
    50% { border-left-color: rgba(19, 239, 149, 0.4); }
}

.thread-entry.needs-input {
    border-left-color: #fec84b;
}

.thread-entry.error {
    border-left-color: #ef4444;
}

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

.thread-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #fbfbff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thread-time {
    flex-shrink: 0;
    font-size: 12px;
    color: #949498;
    line-height: 1.4;
}

.thread-badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    padding: 2px 8px;
    border-radius: 4px;
}

.thread-badge.badge-processing {
    background: rgba(19, 239, 149, 0.08);
    color: #13ef95;
    border: 1px solid rgba(19, 239, 149, 0.25);
}

.thread-badge.badge-needs_input {
    background: rgba(254, 200, 75, 0.08);
    color: #fec84b;
    border: 1px solid rgba(254, 200, 75, 0.25);
}

.thread-badge.badge-complete,
.thread-badge.badge-resolved {
    background: #2c2c33;
    color: #949498;
    border: 1px solid #2c2c33;
}

.thread-badge.badge-error {
    background: rgba(240, 68, 56, 0.08);
    color: #f04438;
    border: 1px solid rgba(240, 68, 56, 0.25);
}

/* Worker indicator dots on thread entries */
.thread-worker-dots { display: inline-flex; gap: 3px; align-items: center; margin-left: 4px; cursor: pointer; padding: 2px 4px; border-radius: 4px; transition: background 0.15s ease; }
.thread-worker-dots:hover { background: rgba(255, 255, 255, 0.06); }
.worker-indicator-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.worker-indicator-dot.dot-working, .worker-indicator-dot.dot-spawned { background: #fec84b; animation: dot-pulse 1.5s ease-in-out infinite; }
.worker-indicator-dot.dot-completed { background: #13ef95; }
.worker-indicator-dot.dot-failed { background: #f04438; }
.worker-indicator-dot.dot-dismissed { background: #4e4e52; }
@keyframes dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.thread-snippet {
    font-size: 13px;
    color: #949498;
    line-height: 1.4;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thread-indicators {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.indicator-snippet {
    font-size: 13px;
    color: #949498;
    line-height: 1.4;
}

.inbox-tier-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.inbox-tier-divider::before,
.inbox-tier-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #2c2c33;
}

.inbox-tier-label {
    font-size: 11px;
    font-weight: 600;
    color: #4e4e52;
    text-transform: uppercase;
    white-space: nowrap;
}

.inbox-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: #4e4e52;
    flex: 1;
}

.inbox-empty .empty-heading {
    font-size: 16px;
    margin-bottom: 8px;
}

.inbox-empty .empty-body {
    font-size: 14px;
}

.inbox-loading-spinner {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.inbox-loading-spinner .breadcrumb-spinner { width: 24px; height: 24px; }

.inbox-skeleton-entry {
    background: #1a1a1f;
    border-radius: 8px;
    height: 72px;
    margin-bottom: 8px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1.0; }
}

.inbox-load-more {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: #4e4e52;
    cursor: pointer;
}

.ws-reconnect-banner {
    position: sticky;
    top: 0;
    background: rgba(254, 200, 75, 0.1);
    color: #fec84b;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    padding: 8px;
    z-index: 10;
}

.thread-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.thread-view-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #2c2c33;
    background: #111114;
}

.thread-view-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #fbfbff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thread-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.read-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #949498;
    background: transparent;
    border: 1px solid #2c2c33;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.read-btn:hover {
    color: #6db3f2;
    border-color: #6db3f2;
    background: rgba(109, 179, 242, 0.08);
}

.archive-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #949498;
    background: transparent;
    border: 1px solid #2c2c33;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.archive-btn:hover {
    color: #13ef95;
    border-color: #13ef95;
    background: rgba(19, 239, 149, 0.08);
}

.thread-read-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #949498;
    background: transparent;
    border: 1px solid #2c2c33;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.thread-read-btn:hover {
    color: #6db3f2;
    border-color: #6db3f2;
    background: rgba(109, 179, 242, 0.08);
}

.thread-archive-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #949498;
    background: transparent;
    border: 1px solid #2c2c33;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.thread-archive-btn:hover {
    color: #13ef95;
    border-color: #13ef95;
    background: rgba(19, 239, 149, 0.08);
}

/* Cancel button on thread entries -- per UI-SPEC Phase 3 */
.thread-cancel-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #949498;
    background: transparent;
    border: 1px solid #2c2c33;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.thread-cancel-btn:hover {
    color: #f04438;
    border-color: #f04438;
    background: rgba(240, 68, 56, 0.08);
}

/* Cancelled badge -- muted like complete/resolved */
.thread-badge.badge-cancelled {
    background: #2c2c33;
    color: #949498;
    border: 1px solid #2c2c33;
}

/* Cancelled thread entry -- neutral border */
.thread-entry.cancelled {
    border-left-color: #949498;
}

/* ── Read/Unread visual treatment ──────────────────────────────────────── */

.thread-entry.unread .thread-title {
    font-weight: 700;
    color: #fbfbff;
}

.thread-entry:not(.unread) .thread-title {
    font-weight: 400;
    color: #949498;
}

.unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #13ef95;
    flex-shrink: 0;
    margin-right: 6px;
}

/* ── Star button ───────────────────────────────────────────────────────── */

.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #4e4e52;
    padding: 2px 4px;
    line-height: 1;
    flex-shrink: 0;
}

.star-btn:hover {
    color: #fec84b;
}

.star-btn.starred {
    color: #fec84b;
}

/* ── Sidebar unread badge ──────────────────────────────────────────────── */

.unread-badge {
    background: #13ef95;
    color: #0d0d11;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
    margin-left: 6px;
    flex-shrink: 0;
}

/* ── Reply-to UI ─────────────────────────────────────────────────────────── */

/* Reply hover button — hidden by default, visible on message hover */
.reply-btn { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; display: none; align-items: center; justify-content: center; font-size: 14px; color: #949498; background: transparent; border: none; border-radius: 4px; cursor: pointer; padding: 0; line-height: 1; z-index: 10; transition: all 0.15s ease; }
.reply-btn:hover { color: #13ef95; background: #2c2c33; }
.message:hover .reply-btn { display: flex; }

/* Quoted reply preview above input bar */
.reply-preview { width: 100%; display: flex; align-items: flex-start; gap: 8px; background: #1a1a1f; border-left: 2px solid #2c2c33; border-radius: 8px; padding: 8px 12px; }
.reply-preview-body { flex: 1; min-width: 0; }
.reply-preview-label { font-size: 11px; font-weight: 600; color: #949498; line-height: 1.3; margin-bottom: 2px; }
.reply-preview-text { font-size: 13px; color: #fbfbff; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.reply-preview-dismiss { flex-shrink: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: #949498; font-size: 16px; cursor: pointer; padding: 0; line-height: 1; border-radius: 4px; transition: color 0.15s ease; }
.reply-preview-dismiss:hover { color: #fbfbff; }

/* Reply nesting — indented messages */
.message-reply { border-left: 2px solid #2c2c33; padding-left: 10px; margin-left: 16px; }

/* Hive Profile Panel */
.hive-profile-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 299; }
.hive-profile-panel { position: fixed; top: 0; left: 260px; bottom: 0; width: 360px; background: #1a1a1f; border-right: 1px solid #2c2c33; z-index: 300; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.profile-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; border-bottom: 1px solid #2c2c33; padding-bottom: 12px; }
.profile-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: #fbfbff; }
.profile-section { margin-bottom: 16px; }
.profile-section h4 { font-size: 12px; font-weight: 600; color: #949498; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 8px 0; display: flex; align-items: center; gap: 6px; }
.profile-count { font-size: 11px; color: #13ef95; font-weight: 500; }
.profile-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; gap: 8px; }
.profile-label { font-size: 13px; color: #949498; flex-shrink: 0; }
.profile-value { font-size: 13px; color: #fbfbff; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-id { font-family: 'Fira Code', monospace; font-size: 11px; color: #949498; cursor: pointer; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.profile-id:hover { color: #13ef95; }
.profile-server-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.profile-server-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.profile-server-dot.dot-connected { background: #13ef95; }
.profile-server-dot.dot-failed { background: #ef4444; }
.profile-server-dot.dot-waiting, .profile-server-dot.dot-connecting { background: #f59e0b; }
.profile-server-dot.dot-not_configured { background: #4b5563; }
.profile-server-name { font-size: 13px; color: #fbfbff; flex: 1; }
.profile-server-tools { font-size: 11px; color: #949498; }
.profile-tool-group { margin-bottom: 8px; }
.profile-tool-server { font-size: 12px; color: #949498; margin-bottom: 4px; }
.profile-tool-list { display: flex; flex-wrap: wrap; gap: 4px; }
.profile-tool-tag { font-size: 10px; font-family: 'Fira Code', monospace; color: #949498; background: #2c2c33; padding: 2px 6px; border-radius: 3px; }
.profile-tool-more { font-size: 11px; color: #949498; padding: 2px 4px; }
.profile-worker-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; flex-wrap: wrap; }
.profile-worker-status { font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 3px; }
.profile-worker-status.wstatus-working { background: rgba(19, 239, 149, 0.15); color: #13ef95; }
.profile-worker-status.wstatus-completed { background: rgba(19, 239, 149, 0.1); color: #949498; }
.profile-worker-status.wstatus-failed { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.profile-worker-status.wstatus-spawned { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.profile-worker-goal { font-size: 13px; color: #fbfbff; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-info-btn { display: inline-flex; font-size: 16px; margin-left: auto; }

.profile-swarm-list { max-height: 400px; overflow-y: auto; overscroll-behavior: contain; }
.profile-swarm { background: rgba(19, 239, 149, 0.03); border: 1px solid #2c2c33; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.profile-swarm-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.profile-swarm-title { font-size: 13px; font-weight: 500; color: #fbfbff; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-swarm-status { font-size: 10px; font-weight: 600; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; }
.profile-swarm-status.pstatus-active, .profile-swarm-status.pstatus-processing { background: rgba(19, 239, 149, 0.15); color: #13ef95; }
.profile-swarm-status.pstatus-completed, .profile-swarm-status.pstatus-complete, .profile-swarm-status.pstatus-resolved { background: rgba(148, 148, 152, 0.15); color: #949498; }
.profile-swarm-status.pstatus-archived, .profile-swarm-status.pstatus-unknown { background: rgba(148, 148, 152, 0.1); color: #6b7280; }
.profile-swarm-status.pstatus-needs_input { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.profile-swarm-status.pstatus-error { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.profile-swarm-workers { border-top: 1px solid #2c2c33; margin-top: 6px; padding-top: 6px; padding-left: 12px; }
.profile-swarm-empty { font-size: 12px; color: #6b7280; padding-top: 4px; }
.profile-worker-card { background: rgba(19, 239, 149, 0.03); border: 1px solid #2c2c33; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; }

.profile-files-group { margin-bottom: 10px; }
.profile-files-group:last-child { margin-bottom: 0; }
.profile-files-group-label { font-size: 11px; color: #6e6e72; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.profile-file-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid #1a1a1f; }
.profile-file-row:last-child { border-bottom: none; }
.profile-file-name { color: #13ef95; font-size: 13px; word-break: break-all; text-decoration: none; }
.profile-file-name:hover { text-decoration: underline; }
.profile-file-size { font-size: 11px; color: #6e6e72; flex-shrink: 0; font-variant-numeric: tabular-nums; }

@media (max-width: 768px) {
    .hive-profile-panel { left: 0; width: 100%; }
}


/* API Key section */
.apikey-card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 16px; }
.apikey-card-empty { border-style: dashed; text-align: center; padding: 32px 16px; }
.apikey-card-empty .apikey-icon { font-size: 24px; margin-bottom: 8px; opacity: 0.5; }
.apikey-card-empty h3 { font-size: 14px; font-weight: 600; color: #e6edf3; margin-bottom: 4px; }
.apikey-card-empty p { font-size: 13px; color: #8b949e; margin-bottom: 16px; }
.apikey-btn-set { background: #7c4dff; color: white; border: none; border-radius: 6px; padding: 8px 16px; font-size: 13px; cursor: pointer; }
.apikey-btn-set:hover { background: #9171ff; }

.apikey-configured { display: flex; justify-content: space-between; align-items: center; }
.apikey-mask { font-family: monospace; font-size: 13px; color: #c9d1d9; }
.apikey-actions { display: flex; gap: 8px; }
.apikey-btn-update { padding: 8px 16px; background: transparent; border: 1px solid #7c4dff; border-radius: 6px; color: #7c4dff; cursor: pointer; font-size: 12px; }
.apikey-btn-update:hover { background: rgba(124, 77, 255, 0.1); }
.apikey-btn-remove { padding: 8px 16px; background: transparent; border: 1px solid #30363d; border-radius: 6px; color: #f85149; cursor: pointer; font-size: 12px; }
.apikey-btn-remove:hover { background: rgba(248, 81, 73, 0.1); border-color: rgba(248, 81, 73, 0.4); }

.apikey-input-row { margin-top: 16px; }
.apikey-input { width: 100%; padding: 8px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 13px; font-family: monospace; box-sizing: border-box; }
.apikey-input:focus { outline: none; border-color: #7c4dff; }
.apikey-input.invalid { border-color: #f85149; }

.apikey-confirm { background: rgba(248, 81, 73, 0.05); border-color: rgba(248, 81, 73, 0.4); padding: 16px; text-align: center; }
.apikey-confirm p { font-size: 13px; color: #c9d1d9; margin-bottom: 16px; }
.apikey-btn-remove-confirm { padding: 8px 16px; background: #f85149; border: none; border-radius: 6px; color: white; cursor: pointer; font-size: 12px; }
.apikey-btn-remove-confirm:hover { background: #da3633; }

.apikey-info { font-size: 12px; color: #6e7681; margin-top: 8px; }
.apikey-error { color: #f85149; font-size: 12px; margin-top: 8px; }
.apikey-success { color: #3fb950; font-size: 12px; margin-left: 8px; opacity: 0; transition: opacity 0.3s; }
.apikey-success.visible { opacity: 1; }

/* ── Settings sidebar layout (mirrors .config-sidebar-layout with gold accent) ── */
.settings-sidebar-layout { display: flex; height: 100%; }
.settings-sidebar { width: 150px; min-width: 150px; background: #151525; border-right: 1px solid #30363d; padding: 12px 0; }
.settings-sidebar-item { padding: 10px 16px; font-size: 13px; color: #8b949e; cursor: pointer; border-left: 2px solid transparent; transition: all 0.15s; }
.settings-sidebar-item:hover { color: #c9d1d9; background: #1c1c35; }
.settings-sidebar-item.active { color: #e6edf3; background: #252540; border-left-color: #f0c040; }
/* max-width 960 lets admin-facing tables (User Management, Invite Codes)
   breathe on desktop; form-style sections (Account / Preferences) are
   naturally narrower from their own inputs so this only affects content
   that actually needs the width. */
.settings-content { flex: 1; padding: 32px 40px; overflow-y: auto; max-width: 960px; }
.settings-content-title { color: #e6edf3; font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.settings-content-subtitle { color: #8b949e; font-size: 13px; margin-bottom: 20px; }

/* ── Account section ── */
.account-edit-btn { background: none; border: none; color: #58a6ff; cursor: pointer; font-size: 12px; padding: 4px 0; }
.account-edit-btn:hover { text-decoration: underline; }
.account-input { padding: 6px 10px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 13px; width: 200px; box-sizing: border-box; }
.account-input:focus { outline: none; border-color: #58a6ff; }
.account-input.invalid { border-color: #f85149; }
.account-error { color: #f85149; font-size: 12px; margin-top: 4px; }
.account-success { color: #3fb950; font-size: 12px; opacity: 0; transition: opacity 0.3s; }
.account-success.visible { opacity: 1; }

/* ── Password change ── */
.password-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 16px 0; }
.password-input { width: 100%; padding: 8px 10px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 13px; box-sizing: border-box; }
.password-input:focus { outline: none; border-color: #58a6ff; }
.password-input.invalid { border-color: #f85149; }
.password-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ── Change button (ghost outline) ── */
.change-btn { padding: 6px 14px; background: transparent; border: 1px solid #30363d; border-radius: 6px; color: #8b949e; cursor: pointer; font-size: 13px; }
.change-btn:hover { border-color: #58a6ff; color: #c9d1d9; }

/* ── Settings action buttons (shared save/cancel) ── */
.settings-btn-cancel { padding: 6px 14px; background: transparent; border: 1px solid #30363d; border-radius: 6px; color: #8b949e; cursor: pointer; font-size: 12px; }
.settings-btn-cancel:hover { border-color: #484f58; color: #c9d1d9; }
.settings-btn-save { padding: 6px 14px; background: #238636; border: none; border-radius: 6px; color: white; cursor: pointer; font-size: 12px; }
.settings-btn-save:hover { background: #2ea043; }
.settings-btn-save:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Auth toggle for login/register ── */
.auth-toggle { color: #58a6ff; font-size: 13px; cursor: pointer; background: none; border: none; }
.auth-toggle:hover { text-decoration: underline; }

/* ── User Management table ── */
/* overflow-x: auto is the safety net — the 6-column admin table can exceed
   the 600px .settings-content cap on narrow viewports; users scroll the
   table rather than seeing columns clipped. whitespace: nowrap on th/td
   keeps Role/Status/Signals/Threads compact so horizontal scroll only
   kicks in when truly needed. */
.user-table-container { background: #161b22; border: 1px solid #30363d; border-radius: 8px; overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; }
.user-table th { background: rgba(255, 255, 255, 0.06); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #8b949e; padding: 10px 12px; text-align: left; white-space: nowrap; }
.user-table td { padding: 10px 12px; border-bottom: 1px solid #21262d; font-size: 13px; color: #c9d1d9; white-space: nowrap; }
.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.user-name-cell { display: flex; flex-direction: column; gap: 2px; }
.user-display-name { font-size: 13px; color: #c9d1d9; }
.user-username { font-size: 12px; color: #8b949e; font-family: monospace; }
.user-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; display: inline-block; }
.badge-admin { background: #1f6feb20; color: #58a6ff; border: 1px solid #1f6feb40; }
.badge-user { background: #30363d; color: #8b949e; border: 1px solid #30363d; }
.badge-active { background: #23863620; color: #3fb950; border: 1px solid #23863640; }
.user-badge.badge-disabled { background: #d2992220; color: #d29922; border: 1px solid #d2992240; }

/* UUID now lives inside the Identity cell as the third stacked line —
   monospace so it lines up visually and can be eyeball-matched against
   logs / sqlite rows. align-self: flex-start keeps the pill tight to
   the text, not stretched to the cell width. */
.user-uuid { font-family: monospace; font-size: 11px; color: #8b949e; background: #0d1117; border: 1px solid #21262d; border-radius: 4px; padding: 1px 5px; cursor: help; align-self: flex-start; margin-top: 1px; }

/* Signal badges (API key / Slack link presence). */
.user-signals { display: flex; gap: 4px; }
.user-signal { font-size: 10px; padding: 2px 6px; border-radius: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; cursor: help; }
.user-signal.signal-on { background: #23863620; color: #3fb950; border: 1px solid #23863640; }
.user-signal.signal-off { background: #30363d; color: #6e7681; border: 1px solid #30363d; }

/* Thread count: dim zero-count to visually downrank dead accounts. */
.user-thread-count { font-variant-numeric: tabular-nums; font-weight: 500; }
.user-thread-count.thread-count-zero { color: #484f58; font-weight: normal; }

/* User action buttons */
.user-action-disable { background: none; border: none; color: #d29922; cursor: pointer; font-size: 12px; padding: 4px 8px; }
.user-action-disable:hover { text-decoration: underline; }
.user-action-enable { background: none; border: none; color: #3fb950; cursor: pointer; font-size: 12px; padding: 4px 8px; }
.user-action-enable:hover { text-decoration: underline; }
.user-action-reset { background: none; border: none; color: #58a6ff; cursor: pointer; font-size: 12px; padding: 4px 8px; }
.user-action-reset:hover { text-decoration: underline; }
.user-disable-confirm { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.user-disable-confirm-text { color: #c9d1d9; }
.user-disable-confirm-btn { padding: 4px 12px; background: #d29922; border: none; border-radius: 6px; color: #0d1117; cursor: pointer; font-size: 12px; font-weight: 600; }
.user-disable-confirm-btn:hover { background: #e3b341; }

/* Reset password confirmation and result display */
.user-reset-confirm { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.user-reset-confirm-text { color: #c9d1d9; }
.user-reset-confirm-btn { padding: 4px 12px; background: #1f6feb; border: none; border-radius: 6px; color: white; cursor: pointer; font-size: 12px; font-weight: 600; }
.user-reset-confirm-btn:hover { background: #388bfd; }
.user-temp-password { display: flex; align-items: center; gap: 8px; font-size: 12px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; padding: 6px 10px; }
.user-temp-password code { font-family: monospace; color: #f0c040; font-size: 13px; letter-spacing: 0.03em; }
.user-temp-password-copy { background: none; border: none; color: #8b949e; cursor: pointer; font-size: 14px; padding: 2px 4px; }
.user-temp-password-copy:hover { color: #c9d1d9; }
.user-temp-password-dismiss { background: none; border: none; color: #8b949e; cursor: pointer; font-size: 11px; padding: 2px 4px; }
.user-temp-password-dismiss:hover { color: #c9d1d9; text-decoration: underline; }

/* ── Invite code cards ── */
.invite-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.invite-card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.invite-card-left { display: flex; flex-direction: column; gap: 4px; }
.invite-code-row { display: flex; align-items: center; gap: 8px; }
.invite-code { font-family: monospace; font-size: 14px; color: #e6edf3; letter-spacing: 0.05em; }
.invite-copy-btn { background: none; border: none; color: #8b949e; cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 4px; position: relative; }
.invite-copy-btn:hover { color: #c9d1d9; background: #30363d; }
.invite-meta { font-size: 11px; color: #6e7681; }
.invite-card-right { display: flex; align-items: center; gap: 12px; }
.invite-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.badge-available { background: #23863620; color: #3fb950; border: 1px solid #23863640; }
.badge-used { background: #30363d; color: #8b949e; border: 1px solid #30363d; }
.badge-revoked { background: #f8514920; color: #f85149; border: 1px solid #f8514940; }
.invite-revoke-btn { background: none; border: none; color: #f85149; cursor: pointer; font-size: 12px; padding: 4px 0; }
.invite-revoke-btn:hover { text-decoration: underline; }
.invite-revoke-confirm { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.invite-revoke-confirm-text { color: #c9d1d9; }
.invite-btn-revoke { padding: 4px 12px; background: #f85149; border: none; border-radius: 6px; color: white; cursor: pointer; font-size: 12px; }
.invite-btn-revoke:hover { background: #da3633; }
.invite-btn-keep { padding: 4px 12px; background: transparent; border: 1px solid #30363d; border-radius: 6px; color: #8b949e; cursor: pointer; font-size: 12px; }
.invite-btn-keep:hover { border-color: #484f58; color: #c9d1d9; }

/* Generate button */
.invite-generate-btn { padding: 8px 16px; background: #238636; border: none; border-radius: 6px; color: white; font-size: 13px; cursor: pointer; }
.invite-generate-btn:hover { background: #2ea043; }
.invite-generate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Highlight animation for new invite card */
.invite-card-highlighted { animation: worker-highlight-flash 0.9s ease-out 1; }

/* Copied tooltip */
.copied-tooltip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: #1c2128; border: 1px solid #30363d; color: #3fb950; font-size: 11px; padding: 3px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none; animation: fade-in-out 1.5s ease-in-out; }
@keyframes fade-in-out { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* Mobile tabs hidden on desktop */
.settings-mobile-tabs { display: none; }

/* ── Settings mobile responsive ── */
@media (max-width: 768px) {
    .settings-sidebar { display: none; }
    .settings-sidebar-layout { flex-direction: column; }
    .settings-content { padding: 16px; max-width: 100%; }
    .settings-mobile-tabs { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid #30363d; padding: 0 8px; background: #151525; }
    .settings-mobile-tab { padding: 10px 16px; font-size: 13px; color: #8b949e; white-space: nowrap; border-bottom: 2px solid transparent; cursor: pointer; }
    .settings-mobile-tab.active { color: #f0c040; border-bottom-color: #f0c040; }
    .user-table { font-size: 12px; }
    .user-table th, .user-table td { padding: 8px 10px; }
}

/* Plug-ins section (issue #202 PR 2b) */
.plugin-register-card { background: #0f0f14; border: 1px dashed #2c2c33; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.plugin-register-header { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.plugin-register-hint { font-size: 12px; color: #8b949e; }
.plugin-register-card .paste-input { margin-bottom: 8px; font-family: 'Fira Code', Monaco, Consolas, monospace; font-size: 12px; }
.plugin-fields { margin: 12px 0; display: flex; flex-direction: column; gap: 12px; }
.plugin-field { display: flex; flex-direction: column; gap: 4px; }
.plugin-field-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #fbfbff; font-weight: 500; }
.plugin-field-required { color: #f85149; }
.plugin-field-set-badge { font-size: 10px; color: #13ef95; background: rgba(19, 239, 149, 0.12); border: 1px solid rgba(19, 239, 149, 0.3); border-radius: 4px; padding: 1px 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.plugin-field-help { font-size: 11px; color: #8b949e; margin: 0; line-height: 1.4; }
.plugin-field-help a { color: #58a6ff; }
.plugin-field-bool { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #fbfbff; }
