/* ============================================
   Claudible Chat — Claude-like Chat Interface
   ============================================ */

/* --- Layout: full-height app --- */
.chat-layout {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* --- Sidebar --- */
.chat-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
}

.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.chat-sidebar-header h3 {
    font-size: 0.9375rem;
    margin: 0;
}

.chat-conv-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2);
}

.chat-conv-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    margin-bottom: 1px;
}

.chat-conv-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(2px);
}

.chat-conv-item.active {
    background: var(--accent-light);
    color: var(--text-primary);
    border-left: 2px solid var(--accent);
}

.chat-conv-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-conv-title mark {
    background: rgba(107,175,109,0.3);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

.chat-conv-delete {
    opacity: 0;
    flex-shrink: 0;
    padding: 2px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.chat-conv-item:hover .chat-conv-delete {
    opacity: 1;
}

.chat-conv-delete:hover {
    color: var(--red);
    background: var(--red-light);
}

/* --- Main area --- */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-primary);
}

/* --- Top bar --- */
.chat-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
    min-height: 48px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.chat-topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.chat-topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* --- Custom model picker (replaces native select) --- */
.chat-model-picker {
    position: relative;
}
.chat-model-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.chat-model-picker-btn:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}
.chat-model-dropdown {
    position: absolute;
    bottom: calc(100% + 0.375rem);
    left: 0;
    min-width: 220px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem;
    z-index: 100;
}
.chat-model-group-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.5rem 0.625rem 0.25rem;
}
.chat-model-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    text-align: left;
}
.chat-model-option:hover {
    background: var(--bg-secondary);
}
.chat-model-option.active {
    background: var(--accent-light);
}
.chat-model-option-name {
    flex: 1;
    font-weight: 500;
}
.chat-model-option-tier {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.chat-token-badge {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    padding: var(--space-1) var(--space-2);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

/* --- Messages area --- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.chat-messages-inner {
    max-width: 768px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* --- Empty state --- */
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: var(--space-8);
    color: var(--text-muted);
}

.chat-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.chat-empty h2 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.chat-empty p {
    font-size: 0.875rem;
    max-width: 400px;
    margin: 0;
}

/* Suggestion chips */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-6);
    max-width: 480px;
    justify-content: center;
}
.chat-suggestion-chip {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-family: var(--font-sans);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.chat-suggestion-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* --- Message bubbles --- */
.chat-message {
    display: flex;
    gap: var(--space-3);
    margin-bottom: 0.375rem;
    animation: fade-in 0.2s ease;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-avatar-user {
    background: var(--accent-light);
    color: var(--accent);
}

.chat-avatar-assistant {
    background: var(--purple-light);
    color: var(--purple);
}

.chat-bubble {
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.chat-bubble-user {
    color: var(--text-primary);
}

.chat-bubble-assistant {
    color: var(--text-primary);
}

.chat-bubble-error {
    color: var(--red);
}

/* Role labels above messages */
.chat-role-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--space-1);
    text-transform: capitalize;
}

/* Scroll-to-bottom floating button */
.chat-scroll-bottom {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    z-index: 10;
}
.chat-scroll-bottom:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* --- Markdown content inside bubbles (matching claude.ai compact) --- */
.chat-bubble p {
    margin: 0 0 0.25rem;
    color: inherit;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

.chat-bubble strong {
    font-weight: 600;
}

.chat-bubble ul.chat-list,
.chat-bubble ol {
    margin: 0.125rem 0;
    padding-left: 1.25rem;
}

.chat-bubble li {
    margin-bottom: 0;
    padding: 0.0625rem 0;
}

.chat-heading {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0.5rem 0 0.125rem;
}

h4.chat-heading {
    font-size: 0.875rem;
}

.chat-quote {
    border-left: 3px solid var(--accent);
    padding: 0.25rem 0.75rem;
    margin: 0.25rem 0;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.chat-hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.375rem 0;
}

/* Callout blocks */
.chat-callout {
    padding: var(--space-3) var(--space-4);
    margin: var(--space-3) 0;
    border-radius: var(--radius);
    border-left: 3px solid;
    font-size: 0.875rem;
    line-height: 1.5;
}
.chat-callout-note { background: rgba(59,130,246,0.08); border-color: #3B82F6; }
.chat-callout-tip { background: rgba(16,185,129,0.08); border-color: #10B981; }
.chat-callout-warning { background: rgba(245,158,11,0.08); border-color: #F59E0B; }
.chat-callout-caution { background: rgba(239,68,68,0.08); border-color: var(--red); }
.chat-callout-important { background: rgba(124,58,237,0.08); border-color: #7C3AED; }
.chat-callout-success { background: rgba(16,185,129,0.08); border-color: #10B981; }

/* GFM tables in messages */
.chat-bubble .table-container { margin: 0.25rem 0; overflow-x: auto; }
.chat-table { font-size: 0.8125rem; }
.chat-table th { font-size: 0.75rem; }

/* --- Code blocks in messages --- */
.chat-code-block {
    position: relative;
    background: var(--bg-code);
    border-radius: 0.625rem;
    margin: 0.375rem 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.chat-code-block pre {
    margin: 0;
    padding: 0.75rem;
    overflow-x: auto;
}

.chat-code-block code {
    display: block;
    color: #E5E7EB;
    background: transparent;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    font-family: var(--font-mono);
}

.chat-code-block .code-lang {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-code-copy {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    color: rgba(255,255,255,0.5);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.chat-code-block:hover .chat-code-copy {
    opacity: 1;
}

.chat-code-copy:hover {
    color: white !important;
}

.chat-inline-code {
    background: var(--bg-tertiary);
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85em;
}

/* --- Typing indicator --- */
.chat-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-2) 0;
}

.chat-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.4;
    animation: typing-pulse 1.4s ease-in-out infinite;
}

.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* --- Streaming cursor --- */
.chat-streaming-cursor::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- Input area --- */
.chat-input-area {
    padding: 0.5rem 1rem;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-input-wrapper {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    gap: var(--space-3);
    align-items: flex-end;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: var(--space-3) var(--space-4);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.chat-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(107,175,109,0.1), 0 2px 8px rgba(0,0,0,0.06);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.chat-input-textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 200px;
    padding: 0;
}

.chat-input-textarea::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.chat-send-btn-send {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 6px rgba(91,154,93,0.3);
}

.chat-send-btn-send:hover:not(:disabled) {
    background: var(--accent-hover);
}

.chat-send-btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-send-btn-stop {
    background: var(--red);
    color: white;
}

.chat-send-btn-stop:hover {
    background: #B91C1C;
}

.chat-input-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-2);
}

/* --- Settings modal --- */
.chat-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    animation: fade-in 0.15s ease;
}

.chat-settings-panel {
    width: 100%;
    max-width: 480px;
    margin: var(--space-4);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slide-up 0.2s ease;
}

.chat-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border);
}

.chat-settings-header h3 {
    font-size: 1.0625rem;
    margin: 0;
}

.chat-settings-body {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    max-height: 60vh;
    overflow-y: auto;
}

.chat-settings-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.chat-settings-field input,
.chat-settings-field textarea,
.chat-settings-field select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition-fast);
}

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

.chat-settings-field textarea {
    min-height: 80px;
    resize: vertical;
}

.chat-settings-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
}

/* --- No-key state --- */
.chat-no-key {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: var(--space-8);
}

.chat-no-key p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

/* --- Message actions --- */
.chat-msg-actions {
    display: flex;
    gap: var(--space-1);
    margin-top: var(--space-2);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

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

.chat-msg-action-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-msg-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* --- System prompt panel --- */
.chat-system-prompt-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3);
    margin-bottom: var(--space-2);
}

.chat-system-textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.6;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    resize: vertical;
    outline: none;
    min-height: 80px;
}

.chat-system-textarea:focus {
    border-color: var(--accent);
}

/* --- File upload strip --- */
.chat-file-strip {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    overflow-x: auto;
}

.chat-file-thumb {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.chat-file-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--red);
    color: white;
    border: none;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-file-name {
    font-size: 0.6rem;
    color: var(--text-muted);
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* Drag-over indicator */
.chat-input-area.drag-over {
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
    background: var(--accent-light);
}

/* --- Edit textarea --- */
.chat-edit-textarea {
    width: 100%;
    border: 1px solid var(--accent);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.5;
    padding: var(--space-3);
    border-radius: var(--radius);
    resize: vertical;
    outline: none;
}

/* --- Prompt library items --- */
.chat-prompt-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.chat-prompt-item:hover {
    background: var(--bg-tertiary);
}

/* --- Responsive: Tablet --- */
@media (max-width: 1024px) {
    .chat-messages-inner { max-width: 100%; }
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    .chat-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 150;
        transform: translateX(-100%);
        width: 85vw;
        max-width: 320px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .chat-sidebar.open {
        transform: translateX(0);
    }

    .chat-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 149;
        background: rgba(0,0,0,0.4);
    }

    .chat-topbar {
        padding: var(--space-2) var(--space-3);
        min-height: 44px;
    }

    /* Show essential buttons, hide only export on mobile */
    .chat-topbar-right { gap: 0.125rem; }

    .chat-context-bar {
        padding: var(--space-1) var(--space-3);
        font-size: 0.6875rem;
        min-height: 28px;
    }

    .chat-messages {
        padding: var(--space-2) 0;
    }

    .chat-messages-inner {
        padding: 0 var(--space-3);
    }

    .chat-message {
        gap: var(--space-2);
        margin-bottom: 0.375rem;
    }

    .chat-avatar {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .chat-bubble {
        font-size: 0.875rem;
        line-height: 1.4;
    }

    .chat-input-area {
        padding: 0.25rem 0.5rem 0;
    }

    .chat-input-wrapper {
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius);
    }

    .chat-input-textarea {
        font-size: 1rem; /* prevent iOS zoom on focus */
    }

    .chat-send-btn {
        width: 40px;
        height: 40px;
    }

    .chat-input-hint > span:first-child {
        display: none; /* hide keyboard shortcuts on mobile */
    }
    .chat-input-hint {
        font-size: 0.625rem;
        justify-content: flex-end;
    }

    .chat-model-picker-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    .chat-model-dropdown {
        min-width: 200px;
    }

    .chat-system-prompt-panel {
        padding: var(--space-2);
    }

    .chat-system-textarea {
        font-size: 0.8125rem;
        min-height: 60px;
    }

    .chat-code-block pre {
        font-size: 0.75rem;
    }

    .chat-msg-actions {
        opacity: 1; /* always visible on touch */
    }

    .chat-conv-delete,
    .chat-conv-rename,
    .chat-conv-star {
        opacity: 1; /* always visible on touch */
    }

    .chat-suggestions { gap: var(--space-1); }
    .chat-suggestion-chip { font-size: 0.75rem; padding: var(--space-1) var(--space-3); }
    .chat-scroll-bottom { bottom: 80px; }

    /* Settings/modals full-width on mobile */
    .chat-settings-panel {
        margin: 0;
        max-width: 100vw !important;
        width: 100vw;
        min-height: 100vh;
        border-radius: 0;
    }

    .chat-settings-overlay {
        align-items: flex-start;
    }
}

/* --- Responsive: Small phone --- */
@media (max-width: 480px) {
    .chat-topbar-left a img { height: 22px !important; }

    .chat-empty h2 { font-size: 1rem; }
    .chat-empty p { font-size: 0.8125rem; }

    .chat-quick-actions {
        gap: 0.25rem;
    }

    .chat-quick-action-btn {
        font-size: 0.6875rem;
        padding: 0.2rem 0.5rem;
    }
}

/* --- iOS safe area --- */
/* Mobile browser nav bar compensation */
@media (max-width: 768px) {
    .chat-input-area {
        padding: var(--space-2) var(--space-3);
        padding-bottom: max(var(--space-2), env(safe-area-inset-bottom, 0px));
    }
}

/* --- Touch-friendly: larger tap targets --- */
@media (hover: none) and (pointer: coarse) {
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    .chat-conv-item {
        padding: var(--space-3) var(--space-3);
        min-height: 44px;
    }

    .chat-msg-actions {
        opacity: 1;
    }

    .chat-msg-action-btn {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }

    .chat-conv-star {
        opacity: 1;
    }

    .chat-file-remove {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }
}
