* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Warm taupe / stone theme */
:root {
    --color-bg: #1f1f1e;
    --color-surface: #2c2c2a;
    --color-surface-mid: #35332f;
    --color-text: #97958c;
    --color-text-bright: #a8a5a0;
    --color-border: #3a3834;
    --color-border-subtle: #2d2c28;
    --color-muted: #6e6b65;
}

html, body {
    height: 100%;
    width: 100%;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    overflow: hidden;
}

.hidden { display: none !important; }

/* One-shot notice when auto-merge saved profile to disk */
.memory-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    max-width: min(420px, 92vw);
    padding: 10px 16px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--color-text-bright);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    z-index: 900;
    display: none;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    pointer-events: none;
    text-align: center;
}
.memory-toast.memory-toast--show {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ── Auth Overlay ── */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-box {
    width: 100%;
    max-width: 340px;
    padding: 40px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
}

.auth-title {
    font-size: 22px;
    font-weight: 500;
    color: var(--color-text-bright);
    text-align: center;
    margin-bottom: 28px;
}

#login-form,
#register-form,
#change-password-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#login-form input,
#register-form input,
#change-password-form input {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--color-text);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

#login-form input:focus,
#register-form input:focus,
#change-password-form input:focus {
    border-color: #5a5a6e;
}

#login-form input::placeholder,
#register-form input::placeholder,
#change-password-form input::placeholder {
    color: #666;
}

.auth-btn {
    margin-top: 8px;
    padding: 11px;
    background: var(--color-surface-mid);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    align-self: center;
    padding-left: 32px;
    padding-right: 32px;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
}

.auth-btn:hover {
    background: #333338;
    border-color: #4a4a5e;
}

.auth-toggle {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
}

.auth-toggle span {
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}

.auth-toggle span:hover {
    color: var(--color-text);
}

.auth-message {
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
    min-height: 16px;
    color: #ef4444;
}

/* ── Modal ── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.modal-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 360px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-bright);
}

.modal-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover { color: #fff; }

/* ── App Layout ── */
#app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ── Sidebar ── */
.sidebar {
    width: 56px;
    background: var(--color-bg);
    border-right: 1px solid var(--color-border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    flex-shrink: 0;
}

.sidebar-top,
.sidebar-mid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.sidebar-mid {
    margin-top: auto;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.sidebar-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #555;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sidebar-btn:hover {
    background: var(--color-surface-mid);
    color: var(--color-text);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-surface-mid);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--color-border);
}

/* ── Main ── */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* ── Top bar ── */
.topbar {
    position: absolute;
    top: 0;
    right: 0;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

.status-pills {
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-pill {
    font-size: 11px;
    color: #555;
}

.queue-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
}

.queue-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d97706;
    animation: pulse 0.8s ease-in-out infinite;
}

.queue-status {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(107, 114, 128, 0.1);
    transition: color 0.2s ease;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* ── Context info ── */
.context-info {
    display: flex;
    flex-direction: column;
    padding: 12px 24px 14px;
    border-bottom: 1px solid var(--color-border-subtle);
    flex-shrink: 0;
    gap: 8px;
}

.context-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 11px;
    min-width: 0;
}

.context-label {
    color: var(--color-muted);
    min-width: 48px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Rounded token bar: dark track, white fill */
.progress-bar {
    flex: 1;
    min-width: 0;
    height: 10px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.progress-fill {
    height: 100%;
    width: 0%;
    min-width: 0;
    border-radius: inherit;
    background: #c4c0b8;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset;
    transition: width 0.35s ease;
}

.progress-fill.progress-fill--high {
    background: #d2cec6;
    box-shadow: 0 0 12px rgba(196, 192, 184, 0.2);
}

.context-text {
    color: var(--color-muted);
    min-width: 108px;
    text-align: right;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.context-meta {
    font-size: 10.5px;
    line-height: 1.45;
    color: var(--color-muted);
    min-width: 0;
    display: block;
}

.context-meta[hidden] {
    display: none;
}

.context-meta .context-meta-sep {
    color: #3e3e44;
    margin: 0 0.15em;
}

.context-meta .context-meta-search {
    color: #5d5d66;
}

.chunks-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
    margin-top: 8px;
}

.chunk-item {
    background: var(--color-surface-mid);
    border-left: 2px solid #3a3a4e;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    color: #888;
}

.chunk-module {
    color: #7c7caa;
    font-weight: 500;
    display: block;
    margin-bottom: 2px;
}

.chunk-similarity {
    color: #555;
    font-size: 10px;
    margin-top: 2px;
}

/* ── Chat history ── */
.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chat-history::-webkit-scrollbar { width: 4px; }
.chat-history::-webkit-scrollbar-track { background: transparent; }
.chat-history::-webkit-scrollbar-thumb { background: var(--color-surface-mid); border-radius: 2px; }

/* ── Home screen ── */
.home-screen {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.greeting {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 40px;
    font-weight: 400;
    color: var(--color-text);
    letter-spacing: -0.5px;
}

/* ── Messages ── */
.message {
    display: flex;
    padding: 0 max(24px, calc(50% - 360px));
    margin-bottom: 4px;
    animation: fadeUp 0.2s ease-out;
}

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

.message.user { justify-content: flex-end; }
.message.assistant { justify-content: flex-start; }
.message.status { justify-content: center; }

.message-content {
    max-width: 680px;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.65;
    font-size: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user .message-content {
    background: var(--color-surface);
    color: var(--color-text-bright);
    border-radius: 18px 18px 4px 18px;
}

.message.assistant .message-content {
    background: transparent;
    color: var(--color-text);
    padding-left: 0;
}

.message.status .message-content {
    background: transparent;
    color: #555;
    font-size: 12px;
    font-style: italic;
}

/* Markdown */
.message-content strong { font-weight: 600; color: var(--color-text-bright); }
.message-content em { font-style: italic; }

.message-content h1 { font-size: 22px; font-weight: 600; color: var(--color-text-bright); margin: 16px 0 8px; }
.message-content h2 { font-size: 18px; font-weight: 600; color: var(--color-text-bright); margin: 14px 0 6px; }
.message-content h3 { font-size: 15px; font-weight: 600; color: var(--color-text-bright); margin: 12px 0 4px; }
.message-content h4 { font-size: 17px; font-weight: 600; color: var(--color-text-bright); margin: 14px 0 6px; letter-spacing: -0.02em; }

.message-content code {
    background: var(--color-surface-mid);
    color: #88d4e8;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
}

/* Fenced code: wrapper + scrollable pre + copy (top-right) */
.code-block-wrap {
    position: relative;
    margin: 12px 0;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    overflow: hidden;
}

.code-block-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 4px 10px;
    font-size: 11px;
    font-family: inherit;
    font-weight: 500;
    color: #9ca3af;
    background: rgba(26, 26, 28, 0.94);
    border: 1px solid #3a3a42;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.code-block-copy:hover {
    color: #e5e7eb;
    border-color: #52525b;
    background: #252529;
}

.code-block-pre {
    margin: 0;
    border: none;
    border-radius: 0;
    padding: 38px 14px 14px 16px;
    overflow: auto;
    max-height: 400px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.7;
    background: transparent;
    --keyword: #569cd6;
    --type: #4ec9b0;
    --string: #ce9178;
    --comment: #6a9955;
    --number: #b5cea8;
}

.code-block-pre code {
    background: transparent;
    color: #e8e8e8;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    font-family: inherit;
    display: block;
}

.wlm-md .code-block-wrap {
    margin: 8px 0;
}

.message-content p { margin: 6px 0; color: var(--color-text); }
.message-content p:first-child { margin-top: 0; }
.message-content p:last-child { margin-bottom: 0; }

.message-content a {
    color: #88d4e8;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.message-content a:hover {
    color: #a8e4f8;
    text-decoration: underline;
}

.message-content ul {
    list-style: none;
    padding-left: 0;
    margin: 8px 0;
    color: var(--color-text);
}

.message-content li {
    margin: 4px 0;
    padding-left: 20px;
    position: relative;
}

.message-content li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: #666;
}

/* Thinking indicator */
.thinking-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px max(24px, calc(50% - 360px));
    margin: 8px 0;
    font-size: 13px;
    font-style: italic;
    color: #6b7280;
    animation: fadeUp 0.25s ease-out;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    border: 1px solid transparent;
    transition: border-color 0.3s, background 0.3s;
}

.thinking-indicator::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0;
    background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.04) 50%, transparent 60%);
    background-size: 200% 100%;
    animation: thinkingShimmer 2.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes thinkingShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.thinking-indicator--knowledge {
    border-color: rgba(129, 140, 248, 0.25);
    background: rgba(99, 102, 241, 0.06);
    color: #a5b4fc;
}

.thinking-indicator--modules {
    border-color: rgba(52, 211, 153, 0.25);
    background: rgba(16, 185, 129, 0.06);
    color: #6ee7b7;
}

.thinking-indicator--think {
    border-color: rgba(251, 191, 36, 0.2);
    background: rgba(245, 158, 11, 0.05);
    color: #fcd34d;
}

.thinking-indicator--default {
    border-color: rgba(75, 85, 99, 0.35);
    color: #6b7280;
}

.thinking-indicator--wait {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(14, 116, 144, 0.08);
    color: #7dd3fc;
}

.thinking-indicator--wait .thinking-orbit-dot {
    border-color: rgba(56, 189, 248, 0.5);
    animation-duration: 0.85s;
}

.thinking-indicator--learning {
    border-color: rgba(168, 85, 247, 0.25);
    background: rgba(147, 51, 234, 0.06);
    color: #d8b4fe;
}

.thinking-orbit {
    position: relative;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.thinking-orbit-dot {
    position: absolute;
    inset: 0;
    border: 1.5px solid rgba(156, 163, 175, 0.35);
    border-radius: 50%;
    animation: thinkingOrbitPulse 1.1s ease-in-out infinite;
}

@keyframes thinkingOrbitPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 1; }
}

.thinking-icon {
    font-style: normal;
    font-size: 11px;
    opacity: 0.85;
    animation: thinkingIconBob 1.4s ease-in-out infinite;
}

@keyframes thinkingIconBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.thinking-text {
    flex: 1;
    min-width: 0;
    font-style: italic;
}

.thinking-dots {
    display: inline-flex;
    gap: 1px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 1px;
    color: #9ca3af;
}

.thinking-dots span {
    animation: thinkingDotFade 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes thinkingDotFade {
    0%, 100% { opacity: 0.2; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-1px); }
}

/* ── Input area ── */
.input-area {
    padding: 0 max(24px, calc(50% - 380px)) 20px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.selected-modules {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 0;
}

.module-tag {
    background: rgba(100, 100, 180, 0.15);
    border: 1px solid rgba(100, 100, 180, 0.3);
    color: #8888cc;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

.module-tag--enter {
    animation: moduleTagPop 0.5s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

@keyframes moduleTagPop {
    from {
        transform: scale(0.65) rotate(-4deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.06) rotate(1deg);
    }
    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.input-box {
    position: relative;
    z-index: 4;
    overflow: visible;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 14px 16px 10px;
    transition: border-color 0.2s;
}

.input-box:focus-within {
    border-color: #5a5850;
}

#prompt-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
}

#prompt-input::placeholder {
    color: var(--color-muted);
}

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

.input-add-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.input-add-btn:hover {
    background: var(--color-surface-mid);
    color: var(--color-text);
}

.input-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.model-badge {
    font-size: 12px;
    color: var(--color-muted);
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.send-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #b0aca4;
    border: none;
    border-radius: 8px;
    color: #1f1f1e;
    cursor: pointer;
    transition: opacity 0.15s;
}

.send-btn:hover { opacity: 0.85; }
.send-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Chips ── */
.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    color: var(--color-muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.chip:hover {
    background: var(--color-surface-mid);
    border-color: #4a4842;
    color: var(--color-text);
}

/* ── Agent prefs (dropdown inside input bar) ── */
.agent-prefs-inline {
    position: relative;
    flex-shrink: 0;
}

.agent-prefs-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    min-height: 30px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: #7c8498;
    font-size: 11px;
    font-family: inherit;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.agent-prefs-toggle-compact {
    color: #9ca3af;
}

.agent-prefs-toggle:hover {
    color: var(--color-text);
    border-color: #3a3a3e;
    background: rgba(255, 255, 255, 0.03);
}

.agent-prefs-toggle--open {
    border-color: #4b5563;
    background: rgba(99, 102, 241, 0.08);
    color: #c4b5fd;
}

.agent-prefs-toggle--open .agent-prefs-chevron {
    transform: rotate(180deg);
}

.agent-prefs-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    opacity: 0.75;
}

.agent-prefs-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    top: auto;
    z-index: 50;
    min-width: 232px;
    max-width: min(320px, calc(100vw - 48px));
    padding: 10px 12px 12px;
    background: #121214;
    border: 1px solid #35353a;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* `display: flex` above wins over the UA [hidden] rule in some engines — force closed state */
.agent-prefs-panel[hidden] {
    display: none !important;
}

.agent-prefs-panel-head {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--color-border);
}

.agent-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.agent-pref-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.agent-pref-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
}

.agent-pref-hint {
    font-size: 10px;
    line-height: 1.25;
    color: #6b7280;
    max-width: 160px;
}

/* Toggle switch (checkbox + slider) */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--color-surface-mid);
    border-radius: 22px;
    transition: background 0.2s;
}

.switch-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #6b7280;
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.switch input:checked + .switch-slider {
    background: #3b3f46;
}

.switch input:checked + .switch-slider::before {
    transform: translateX(18px);
    background: #e5e7eb;
}

.switch input:focus-visible + .switch-slider {
    outline: 2px solid #6b7280;
    outline-offset: 2px;
}

/* ── Web Search UI ── */
.web-search-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px max(24px, calc(50% - 360px));
    color: #888;
    font-size: 13px;
    font-style: italic;
    animation: fadeUp 0.25s ease-out;
    position: relative;
}

.web-search-indicator--active .web-search-svg {
    animation: webSearchIconPulse 1.2s ease-in-out infinite;
}

.web-search-glow {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.18) 0%, transparent 70%);
    animation: webSearchGlow 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes webSearchGlow {
    0%, 100% { transform: scale(0.85); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

@keyframes webSearchIconPulse {
    0%, 100% { transform: scale(1); opacity: 0.75; }
    50% { transform: scale(1.08); opacity: 1; }
}

.web-search-label {
    font-style: italic;
    color: #c4b5fd;
}

.web-search-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.web-search-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #818cf8;
    animation: webSearchDotBounce 0.9s ease-in-out infinite;
}

.web-search-dots span:nth-child(2) { animation-delay: 0.12s; }
.web-search-dots span:nth-child(3) { animation-delay: 0.24s; }

@keyframes webSearchDotBounce {
    0%, 100% { transform: translateY(0); opacity: 0.35; }
    50% { transform: translateY(-5px); opacity: 1; }
}

.web-search-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #a5b4fc;
    position: relative;
    z-index: 1;
}

.search-results-card {
    margin: 8px max(24px, calc(50% - 360px));
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeUp 0.2s ease-out;
}

.search-results-title {
    font-size: 13px;
    color: var(--color-text);
    font-weight: 500;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease, transform 0.35s ease;
}

.search-result-item--loading {
    border-color: rgba(129, 140, 248, 0.45);
    animation: searchRowPulse 1.1s ease-in-out infinite;
}

@keyframes searchRowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.12); }
    50% { box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.08); }
}

.search-result-item--success {
    border-color: rgba(74, 222, 128, 0.85) !important;
    background: rgba(22, 101, 52, 0.22) !important;
    animation: trustRowPlopOk 0.55s cubic-bezier(0.34, 1.55, 0.64, 1);
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.2), 0 0 24px rgba(74, 222, 128, 0.12);
}

.search-result-item--fail {
    border-color: rgba(248, 113, 113, 0.75) !important;
    background: rgba(127, 29, 29, 0.18) !important;
    animation: trustRowPlopBad 0.45s cubic-bezier(0.36, 1.2, 0.66, 1);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.15);
}

@keyframes trustRowPlopOk {
    0% { transform: scale(0.98); }
    55% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes trustRowPlopBad {
    0% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

.star-burst-origin {
    position: absolute;
    right: 18px;
    top: 50%;
    width: 1px;
    height: 1px;
    pointer-events: none;
    z-index: 3;
}

.star-burst-star {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 11px;
    line-height: 1;
    color: #bbf7d0;
    text-shadow: 0 0 8px rgba(74, 222, 128, 0.9);
    animation: starBurstFly 0.78s ease-out forwards;
}

@keyframes starBurstFly {
    from {
        transform: translate(0, -50%) rotate(var(--burst-angle, 0deg)) translateX(0);
        opacity: 1;
    }
    to {
        transform: translate(0, -50%) rotate(var(--burst-angle, 0deg)) translateX(var(--burst-dist, 32px));
        opacity: 0;
    }
}

.btn-mini-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(165, 180, 252, 0.25);
    border-top-color: #a5b4fc;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: -2px;
    animation: btnSpin 0.65s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

.trust-result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.trust-result-badge--ok {
    background: rgba(22, 101, 52, 0.35);
    border-color: rgba(74, 222, 128, 0.5);
}

.trust-result-badge--bad {
    background: rgba(127, 29, 29, 0.35);
    border-color: rgba(248, 113, 113, 0.45);
}

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 13px;
    font-weight: 500;
    color: #7c7caa;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-title:hover { color: #a0a0d0; }

.search-result-url {
    font-size: 10px;
    color: #555;
    font-family: 'SF Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-snippet {
    font-size: 12px;
    color: #777;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trust-btn {
    background: var(--color-surface-mid);
    border: 1px solid #3a3a3e;
    color: var(--color-text);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s;
}

.trust-btn:hover { background: #3a3a4e; border-color: #5a5a7e; }
.trust-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.search-results-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.trust-all-btn {
    background: var(--color-surface-mid);
    border: 1px solid #3a3a3e;
    color: var(--color-text);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
    flex: 1;
}

.trust-all-btn:hover { background: #3a3a4e; border-color: #5a5a7e; }
.trust-all-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.skip-search-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: #555;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    border-radius: 8px;
    transition: color 0.15s, border-color 0.15s;
    flex: 1;
}

.skip-search-btn:hover { color: #888; border-color: #3a3a3e; }

.web-learning-banner {
    margin: 6px max(24px, calc(50% - 360px));
    padding: 10px 14px 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    color: #c4b5fd;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(30, 27, 45, 0.95));
    border: 1px solid rgba(129, 140, 248, 0.35);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.25s ease-out, webLearnBannerGlow 2s ease-in-out infinite;
}

@keyframes webLearnBannerGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.08); }
    50% { box-shadow: 0 0 20px 1px rgba(129, 140, 248, 0.12); }
}

.web-learning-edge {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #a5b4fc, #6366f1);
    animation: webLearnEdgeShine 1.5s ease-in-out infinite;
}

@keyframes webLearnEdgeShine {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.web-learning-icon {
    font-style: normal;
    animation: webLearnIconWiggle 0.9s ease-in-out infinite;
}

@keyframes webLearnIconWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-6deg); }
    75% { transform: rotate(6deg); }
}

.web-learning-text {
    flex: 1;
    min-width: 0;
    font-style: italic;
    color: #d8d4ff;
}

.web-learning-bar {
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
    flex-basis: 100%;
}

.web-learning-bar-fill {
    display: block;
    height: 100%;
    width: 35%;
    border-radius: 2px;
    background: linear-gradient(90deg, #6366f1, #a5b4fc, #6366f1);
    background-size: 200% 100%;
    animation: webLearnBarSlide 1.1s ease-in-out infinite;
}

@keyframes webLearnBarSlide {
    0% { transform: translateX(-30%); background-position: 0% 0; }
    100% { transform: translateX(220%); background-position: 100% 0; }
}

.web-learning-banner--live {
    flex-wrap: nowrap;
    align-items: stretch;
}

.learn-live-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 8px;
}

.learn-live-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    width: 100%;
}

.learn-live-ico { font-size: 15px; line-height: 1; }
.learn-live-meta { color: #9ca3af; font-variant-numeric: tabular-nums; }
.learn-live-note { color: #f5e8ff; font-weight: 500; }

.learn-live-http {
    font-size: 10px;
    font-weight: 600;
    color: #a1a1aa;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    margin-left: auto;
}

.learn-live-title {
    font-size: 11px;
    font-weight: 500;
    color: #c4b5fd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.learn-live-step {
    font-size: 11px;
    color: #b8bfd4;
    line-height: 1.35;
    word-break: break-word;
}

.learn-live-hint {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.35;
    font-style: italic;
}

.learn-live-bytes {
    font-size: 10px;
    color: #7c8498;
    font-variant-numeric: tabular-nums;
}

.learn-live-bar--batch {
    margin-top: 2px;
}

.learn-live-bar--bytes {
    margin-top: 4px;
}

.learn-live-bar--indeterminate span {
    animation: learnBytePulse 1.2s ease-in-out infinite;
}

@keyframes learnBytePulse {
    0%, 100% { opacity: 0.35; transform: scaleX(0.85); transform-origin: left center; }
    50% { opacity: 1; transform: scaleX(1); transform-origin: left center; }
}

.learn-live-url {
    font-size: 11px;
    color: #8b92a8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.learn-live-bar {
    height: 4px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.learn-live-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a5b4fc);
    border-radius: 3px;
    transition: width 0.28s ease-out;
}

.web-learn-result--merged {
    padding: 12px 14px;
}

.web-learn-merge-head {
    font-size: 12px;
    font-weight: 600;
    color: #fecaca;
    margin-bottom: 8px;
}

.web-learn-merge-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.web-learn-merge-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.18);
    animation: fadeUp 0.22s ease-out;
}

.web-learn-merge-row.is-unsafe {
    border-color: rgba(251, 191, 36, 0.22);
}

.wlm-ico {
    flex-shrink: 0;
    line-height: 1.35;
}

.wlm-md {
    font-size: 12px;
    color: var(--color-text);
    min-width: 0;
}

.wlm-md p { margin: 4px 0; }

.web-learn-result {
    margin: 4px max(24px, calc(50% - 360px));
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    animation: fadeUp 0.2s ease-out;
    position: relative;
    overflow: hidden;
}

.web-learn-result.safe {
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.web-learn-result.unsafe {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.web-learn-result--celebrate::after {
    content: '✦ ✧ ✦';
    position: absolute;
    right: 10px;
    top: 8px;
    font-size: 10px;
    letter-spacing: 4px;
    color: rgba(74, 222, 128, 0.5);
    animation: celebrateSparkle 1.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes celebrateSparkle {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.08); }
}

/* ── SSH Session Cards ── */
.ssh-confirm-card {
    margin: 8px max(24px, calc(50% - 360px));
    background: var(--color-surface);
    border: 1px solid #3a3a2e;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeUp 0.2s ease-out;
}

.ssh-confirm-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text);
}

.ssh-confirm-icon { font-style: normal; }

.ssh-confirm-host {
    color: #888;
    font-size: 11px;
    font-family: 'SF Mono', monospace;
}

.ssh-confirm-command {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
}

.ssh-confirm-command code {
    color: #88d4e8;
    font-family: 'SF Mono', Monaco, monospace;
    background: transparent;
    padding: 0;
}

.ssh-confirm-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ssh-result-card {
    margin: 8px max(24px, calc(50% - 360px));
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeUp 0.2s ease-out;
}

.ssh-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--color-text);
    gap: 12px;
}

.ssh-result-cmd {
    font-size: 11px;
    color: #888;
    font-family: 'SF Mono', monospace;
    background: transparent;
}

.ssh-result-output {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    color: #d4d4d4;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* ── SSH Modal ── */
.ssh-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.ssh-endpoint-item {
    background: var(--color-surface-mid);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ssh-endpoint-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.ssh-endpoint-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
}

.ssh-endpoint-meta {
    font-size: 11px;
    color: #555;
    font-family: 'SF Mono', monospace;
}

.ssh-endpoint-remove {
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 18px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s;
}

.ssh-endpoint-remove:hover {
    background: var(--color-surface-mid);
    color: #f87171;
}

.ssh-add-section {
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ssh-section-title {
    font-size: 13px;
    font-weight: 500;
    color: #888;
}

#ssh-add-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#ssh-add-form input {
    background: var(--color-surface-mid);
    border: 1px solid #3a3a3e;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--color-text);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
    width: 100%;
}

#ssh-add-form input:focus { border-color: #5a5a6e; }
#ssh-add-form input::placeholder { color: #555; }

.ssh-form-row {
    display: flex;
    gap: 8px;
}

.ssh-form-row input:first-child { flex: 1; }

.ssh-key-result {
    border-top: 1px solid var(--color-border);
    padding-top: 14px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ssh-key-label {
    font-size: 12px;
    color: #888;
}

.ssh-key-label code {
    background: var(--color-surface-mid);
    color: #88d4e8;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
}

.ssh-pubkey {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px;
    color: #88d4e8;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
    resize: none;
    width: 100%;
    height: 70px;
    outline: none;
    line-break: anywhere;
}

/* ── Profile & memory modal ── */
.memory-modal-content {
    max-width: 480px;
}

.memory-panel-hint {
    font-size: 12px;
    color: #7c7c8a;
    line-height: 1.55;
    margin-bottom: 12px;
}

.memory-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #c4c4d4;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
}

.memory-toggle-row input {
    width: 16px;
    height: 16px;
    accent-color: #818cf8;
}

.memory-profile-text {
    width: 100%;
    min-height: 180px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #121214;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: #e5e7eb;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.memory-profile-text:focus {
    border-color: #4f46e5;
}

.memory-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* ── Admin modal ── */
.admin-modal-content {
    max-width: 520px;
}

.knowledge-modal-content {
    max-width: 480px;
}

.knowledge-hint {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.knowledge-item {
    padding: 10px 12px;
    background: var(--color-surface-mid);
    border: 1px solid #3a3a3e;
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-text);
}

.knowledge-item strong {
    color: #e8e8f0;
    display: block;
    margin-bottom: 4px;
}

.knowledge-item small {
    color: #888;
    line-height: 1.4;
}

.admin-panel-hint {
    font-size: 12px;
    color: #666;
    line-height: 1.55;
    margin-bottom: 14px;
}

.admin-panel-hint code {
    background: var(--color-surface-mid);
    color: #a8a8b8;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}

#admin-modal input[type="text"],
#admin-modal input[type="password"] {
    background: var(--color-surface-mid);
    border: 1px solid #3a3a3e;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--color-text);
    outline: none;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s;
}

#admin-modal input:focus {
    border-color: #5a5a6e;
}

#admin-modal input::placeholder {
    color: #555;
}

.admin-auth-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
}

.admin-keys-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 4px;
}

.admin-key-item {
    background: var(--color-surface-mid);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}

.admin-key-item .admin-key-id {
    font-family: 'SF Mono', Monaco, monospace;
    color: var(--color-text);
    font-size: 12px;
}

.admin-key-item .admin-key-meta {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #555;
}

.admin-open-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--color-border);
    padding-top: 14px;
    margin-top: 10px;
}

.admin-open-hint {
    font-size: 11px;
    color: #6b6b70;
}

/* ── Context Menu ── */
.context-menu-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.context-menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--color-surface-mid);
    border: 1px solid #3a3a3e;
    border-radius: 10px;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.context-menu-btn:hover {
    background: #333338;
    border-color: #4a4a5e;
    color: #e5e7eb;
}

.context-menu-btn svg {
    color: #9ca3af;
    transition: color 0.2s ease;
}

.context-menu-btn:hover svg {
    color: var(--color-text);
}

/* ── Effort buttons ── */
.effort-options {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.effort-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    border: 1px solid #3a3a3e;
    background: var(--color-surface-mid);
    color: var(--color-text);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.effort-btn:hover {
    border-color: #4a4a5e;
    background: #333338;
    color: #e5e7eb;
}

.effort-btn-active {
    border-color: #6366f1;
    background: #6366f1;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.effort-hint {
    font-size: 10px;
    color: #6b7280;
    line-height: 1.4;
    margin-top: 4px;
}

/* ── Chat History ── */
#history-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#history-list button {
    border: 1px solid transparent;
    background: var(--color-surface-mid);
    padding: 6px 10px;
    border-radius: 4px;
    color: var(--color-text);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

#history-list button:hover {
    background: #3a3a3e;
    border-color: #4a4a5e;
}

#history-list button:active {
    transform: scale(0.98);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .greeting { font-size: 28px; }
    .message { padding: 0 16px; }
    .input-area { padding: 0 16px 16px; }
    .chips { display: none; }
}
