/* =========================================================
   Chat page styles — builds on styles.css CSS variables
   ========================================================= */

/* ---- Layout shell ----
   The navbar is taken out of fixed positioning on this page so the
   flex column can fill the exact remaining height with no hardcoded px. */
body.chat-page {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* dynamic viewport height — correct on mobile browsers */
}

body.chat-page .navbar {
    position: static;  /* override global fixed; stays in flex flow */
    flex-shrink: 0;
    width: 100%;
}

/* ---- Auth wall ---- */
#auth-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--bg-secondary);
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    justify-content: center;
}

.auth-logo img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.auth-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-google:hover {
    box-shadow: var(--shadow-md);
    border-color: #c0c0c0;
}

.btn-google svg {
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-field {
    margin-bottom: 0.875rem;
}

.auth-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.auth-field input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.auth-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.auth-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.1rem;
}

.btn-auth-primary {
    flex: 1;
    padding: 0.7rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.btn-auth-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-auth-secondary {
    flex: 1;
    padding: 0.7rem 1rem;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-auth-secondary:hover {
    background: rgba(99, 102, 241, 0.06);
}

.auth-forgot {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.auth-forgot a {
    color: var(--primary);
    text-decoration: none;
}

.auth-forgot a:hover {
    text-decoration: underline;
}

.auth-info-box {
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.auth-info-box strong {
    color: var(--primary);
}

.auth-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #dc2626;
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    font-size: 0.88rem;
    margin-bottom: 0.875rem;
    display: none;
}

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

/* ---- Chat shell ---- */
#chat-shell {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    min-width: 0;
}

#chat-shell.visible {
    display: grid;
    grid-template-columns: 280px 1fr;
}

/* Medium screens: narrow sidebar */
@media (max-width: 1024px) and (min-width: 769px) {
    #chat-shell.visible {
        grid-template-columns: 220px 1fr;
    }
    #thread-sidebar {
        width: 220px;
    }
}

/* ---- Sidebar ---- */
#thread-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.875rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.btn-signout {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition: border-color 0.2s, color 0.2s;
}

.btn-signout:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.btn-delete-account {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #ef4444;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.btn-delete-account:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.btn-new-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-new-chat:hover {
    background: var(--primary-dark);
}

#thread-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.thread-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.thread-item:hover {
    background: rgba(99, 102, 241, 0.05);
}

.thread-item.active {
    border-left-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.thread-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

.thread-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.thread-model {
    font-size: 0.7rem;
    background: rgba(139, 92, 246, 0.12);
    color: var(--secondary);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.thread-time {
    font-size: 0.7rem;
    color: var(--text-light);
    white-space: nowrap;
    margin-left: auto;
}

/* Thread skeleton loader */
.thread-skeleton {
    padding: 0.75rem 1rem;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

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

/* Phone status */
.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.phone-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

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

.status-dot.online  { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.2); }
.status-dot.offline { background: #9ca3af; }

/* ---- Main chat area ---- */
#chat-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

#chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    min-height: 60px;
    background: var(--bg-card);
}

.chat-header-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.chat-header-model {
    font-size: 0.75rem;
    background: rgba(139, 92, 246, 0.12);
    color: var(--secondary);
    border-radius: 12px;
    padding: 0.2rem 0.65rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-header-empty {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-style: italic;
}

/* ---- Message list ---- */
#message-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.message-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    text-align: center;
    gap: 0.75rem;
    padding: 2rem;
}

.message-empty-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

.message-empty-text {
    font-size: 0.9rem;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 78%;
}

.message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.message.assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.message-role {
    font-size: 0.72rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    word-break: break-word;
}

.message.user .message-bubble {
    background: var(--gradient-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

/* Markdown inside assistant bubble */
.message.assistant .message-bubble h1,
.message.assistant .message-bubble h2,
.message.assistant .message-bubble h3 {
    margin: 0.75rem 0 0.4rem;
    font-size: 1em;
    font-weight: 600;
}

.message.assistant .message-bubble p { margin: 0.4rem 0; }
.message.assistant .message-bubble p:first-child { margin-top: 0; }
.message.assistant .message-bubble p:last-child { margin-bottom: 0; }

.message.assistant .message-bubble ul,
.message.assistant .message-bubble ol {
    margin: 0.4rem 0;
    padding-left: 1.5rem;
}

.message.assistant .message-bubble code {
    background: rgba(0,0,0,0.06);
    border-radius: 4px;
    padding: 0.1em 0.35em;
    font-size: 0.88em;
    font-family: 'Fira Code', 'Consolas', monospace;
}

.message.assistant .message-bubble pre {
    background: #1e1e2e;
    color: #cdd6f4;
    border-radius: 8px;
    padding: 0.9rem 1rem;
    overflow-x: auto;
    margin: 0.6rem 0;
}

.message.assistant .message-bubble pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.85em;
}

.message.assistant .message-bubble blockquote {
    border-left: 3px solid var(--primary-light);
    padding-left: 0.75rem;
    color: var(--text-secondary);
    margin: 0.4rem 0;
}

/* Thinking block */
.thinking-block {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    max-width: 100%;
}

.thinking-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--text-secondary);
    user-select: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.thinking-toggle svg {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.thinking-toggle.open svg { transform: rotate(180deg); }

.thinking-content {
    display: none;
    padding: 0.5rem 0.75rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    border-top: 1px solid var(--border);
    white-space: pre-wrap;
    word-break: break-word;
}

.thinking-content.open { display: block; }

/* Message images */
.message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.message-image {
    max-width: 180px;
    max-height: 180px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* ---- Status bar ---- */
#status-bar {
    padding: 0.35rem 1.25rem;
    font-size: 0.8rem;
    min-height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

#status-bar .status-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

#status-bar.error { color: #dc2626; }

/* ---- Image preview strip ---- */
#image-preview {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.25rem 0.5rem;
    flex-shrink: 0;
    overflow-x: auto;
}

.preview-thumb {
    position: relative;
    flex-shrink: 0;
}

.preview-thumb img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.preview-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ---- Model bar ---- */
#model-bar {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem 0;
    flex-shrink: 0;
}

#model-bar.visible { display: flex; }

.model-bar-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

#model-select {
    flex: 1;
    max-width: 360px;
    font-size: 0.82rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
}

#model-select:focus { border-color: var(--primary); }
#model-select:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Input bar ---- */
#input-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-card);
}

#msg-input {
    flex: 1;
    min-height: 44px;
    max-height: 140px;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    resize: none;
    outline: none;
    line-height: 1.5;
    overflow-y: auto;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#msg-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

#msg-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-attach {
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.btn-attach:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-send {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.btn-send:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

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

/* ---- Mobile sidebar drawer ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
}

.sidebar-overlay.open { display: block; }

.btn-sidebar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: inherit;
}

/* ---- Web Sync usage banner ---- */
#websync-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

#websync-banner.limit-reached {
    background: #fff3cd;
    border-color: #ffc107;
    color: #664d03;
}

#websync-banner.free-tier {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.websync-icon { flex-shrink: 0; }

.websync-text { flex: 1; line-height: 1.4; }

.websync-upgrade-btn {
    background: var(--accent, #6366f1);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.websync-upgrade-btn:hover { opacity: 0.88; }

/* ---- Premium info modal ---- */
.premium-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.premium-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.premium-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    padding: 0.25rem;
}

.premium-modal-close:hover { color: var(--text-primary); }

.premium-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.premium-modal-header svg { margin-bottom: 0.75rem; }

.premium-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.premium-modal-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.premium-modal-plans {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.premium-plan {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    position: relative;
}

.premium-plan.featured {
    border-color: var(--accent, #6366f1);
    background: color-mix(in srgb, var(--accent, #6366f1) 8%, transparent);
}

.premium-plan.muted { opacity: 0.75; }

.premium-plan-badge {
    position: absolute;
    top: -0.6rem;
    left: 1rem;
    background: var(--accent, #6366f1);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    letter-spacing: 0.04em;
}

.premium-plan-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.premium-plan-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent, #6366f1);
    margin-bottom: 0.2rem;
}

.premium-plan.muted .premium-plan-price { color: var(--text-secondary); }

.premium-plan-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.premium-modal-cta-note {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.premium-modal-methods {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary, rgba(99,102,241,0.06));
    border: 1px solid var(--border, rgba(0,0,0,0.08));
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.premium-modal-methods li { margin: 0 0 0.5rem; }
.premium-modal-methods li:last-child { margin-bottom: 0; }
.premium-modal-methods strong { color: var(--text-primary); }

.btn-premium-store {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--accent, #6366f1);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.15s;
}

.btn-premium-store:hover { opacity: 0.88; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    #chat-shell.visible {
        grid-template-columns: 1fr;
    }

    #thread-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        z-index: 1001; /* above the static navbar */
        transition: left 0.25s ease;
        box-shadow: var(--shadow-xl);
        background: var(--bg-secondary);
    }

    #thread-sidebar.open {
        left: 0;
    }

    .sidebar-overlay {
        z-index: 1000;
    }

    .btn-sidebar-toggle {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.85rem;
        margin-right: 0.5rem;
    }
}
