/*
 * style.css
 * ---------
 * Stylesheet utama Pojok Religi.
 *
 * Struktur:
 *   1. Design Tokens (CSS Variables) — Light & Dark Mode
 *   2. Reset & Base
 *   3. Auth Overlay
 *   4. Modal (Edit Profil & Konfirmasi Hapus)
 *   5. Toast Notification
 *   6. App Shell (Sidebar + Topbar)
 *   7. Main Content (Welcome, Chat, Bubbles, Form)
 */

/* ══════════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS — Light Mode
   ══════════════════════════════════════════════════════════════════════════════ */
:root {
    --color-primary:      #a7f3d0;
    --color-secondary:    #d1fae5;
    --color-accent:       #059669;
    --color-accent-dark:  #047857;
    --color-text-base:    #1f2937;
    --color-text-muted:   #6b7280;
    --color-bg:           #ffffff;
    --color-bg-app:       linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #bbf7d0 100%);
    --color-bg-subtle:    #f0fdf4;
    --color-bg-sidebar:   #f9fafb;
    --color-border:       #e5e7eb;
    --color-topbar:       #ffffff;
    --color-danger:       #ef4444;
    --color-danger-dark:  #dc2626;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:  0 4px 12px rgba(0,0,0,.10);
    --shadow-lg:  0 10px 25px rgba(0,0,0,.12);

    --sidebar-w:    260px;
    --topbar-h:     52px;
    --radius-lg:    16px;
    --radius-md:    10px;
    --radius-sm:    6px;
    --radius-pill:  999px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS — Dark Mode
   ══════════════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --color-primary:      #065f46;
    --color-secondary:    #064e3b;
    --color-accent:       #34d399;
    --color-accent-dark:  #6ee7b7;
    --color-text-base:    #f3f4f6;
    --color-text-muted:   #9ca3af;
    --color-bg:           #1f2937;
    --color-bg-app:       linear-gradient(135deg, #111827 0%, #1a2e25 50%, #0f2318 100%);
    --color-bg-subtle:    #111827;
    --color-bg-sidebar:   #111827;
    --color-border:       #374151;
    --color-topbar:       #1f2937;
    --color-danger:       #f87171;
    --color-danger-dark:  #ef4444;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.30), 0 1px 2px rgba(0,0,0,.20);
    --shadow-md:  0 4px 12px rgba(0,0,0,.40);
    --shadow-lg:  0 10px 25px rgba(0,0,0,.50);
}


/* ══════════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--color-bg-app);
    height: 100vh;
    overflow: hidden;
    color: var(--color-text-base);
    transition: background .3s, color .3s;
}


/* ══════════════════════════════════════════════════════════════════════════════
   AUTH OVERLAY
   ══════════════════════════════════════════════════════════════════════════════ */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-bg-app);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.auth-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-logo img   { margin-bottom: .5rem; }
.auth-logo h1    { font-size: 1.3rem; font-weight: 700; color: var(--color-accent); margin-bottom: .25rem; }
.auth-logo p     { font-size: .82rem; color: var(--color-text-muted); }

.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--color-bg-subtle);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 1.25rem;
}
.auth-tab {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--color-text-muted);
    transition: background .15s, color .15s;
}
.auth-tab--active {
    background: var(--color-accent);
    color: #fff;
}

.auth-field {
    margin-bottom: 1rem;
}
.auth-field label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: .35rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.auth-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-subtle);
    color: var(--color-text-base);
    font-size: .9rem;
    outline: none;
    transition: border-color .15s;
}
.auth-field input:focus {
    border-color: var(--color-accent);
}

.auth-error {
    font-size: .8rem;
    color: var(--color-danger);
    margin-bottom: .75rem;
    min-height: 1.2em;
}
.auth-success {
    font-size: .8rem;
    color: var(--color-accent);
    margin-bottom: .75rem;
    min-height: 1.2em;
}

/* Elemen pesan auth yang serbaguna (warna diatur via JS) */
.auth-message {
    font-size: .8rem;
    margin-bottom: .75rem;
    min-height: 1.2em;
    transition: color .15s;
}

.auth-btn {
    width: 100%;
    padding: 11px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.auth-btn:hover { background: var(--color-accent-dark); }


/* ══════════════════════════════════════════════════════════════════════════════
   MODAL (Edit Profile & Konfirmasi Hapus Semua)
   ══════════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 8000;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

.modal-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.modal-card--danger .modal-header h2 { color: var(--color-danger); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.modal-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-base);
}
.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: .85rem;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: background .15s;
}
.modal-close-btn:hover { background: var(--color-border); }

.modal-desc {
    font-size: .875rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
}
.btn-modal-cancel {
    padding: 9px 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-base);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}
.btn-modal-cancel:hover { background: var(--color-bg-subtle); }

.btn-modal-danger {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--color-danger);
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-modal-danger:hover { background: var(--color-danger-dark); }


/* ══════════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATION
   ══════════════════════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: calc(var(--topbar-h) + 12px);
    right: 16px;
    z-index: 7000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 380px;
    pointer-events: all;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .3s, transform .3s;
}
.toast--visible {
    opacity: 1;
    transform: translateX(0);
}
.toast--error  { border-left: 3px solid var(--color-danger); }
.toast--info   { border-left: 3px solid var(--color-accent); }
.toast--success{ border-left: 3px solid #22c55e; }

.toast-icon    { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.toast-message { font-size: .82rem; color: var(--color-text-base); line-height: 1.5; flex: 1; }
.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: .75rem;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: background .15s;
}
.toast-close:hover { background: var(--color-border); }


/* ══════════════════════════════════════════════════════════════════════════════
   APP SHELL
   ══════════════════════════════════════════════════════════════════════════════ */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}


/* ══════════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════════════════════ */
.sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    height: 100vh;
    padding: 1rem 0.75rem;
    overflow: hidden;
    background: var(--color-bg-sidebar);
    border-right: 1px solid var(--color-border);
    transition: transform .25s ease, width .25s ease, min-width .25s ease,
                background .3s, border-color .3s;
    z-index: 300;
    flex-shrink: 0;
}

/* Desktop & Tablet: sidebar bisa di-collapse */
@media (min-width: 768px) {
    .sidebar.sidebar--collapsed {
        transform: translateX(calc(-1 * var(--sidebar-w)));
        min-width: 0;
        width: 0;
        padding: 0;
        overflow: hidden;
        border-right: none;
    }
}

/* Mobile: sidebar overlay, hidden by default */
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar--open { transform: translateX(0); }
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: .95rem;
    font-weight: 700;
    color: var(--color-accent);
}

.sidebar-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: .85rem;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
    line-height: 1;
}
.sidebar-close-btn:hover {
    background: var(--color-border);
    color: var(--color-text-base);
}

.btn-new-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 9px 12px;
    margin-bottom: 1rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.btn-new-chat:hover { background: var(--color-accent-dark); }

.sidebar-section-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--color-text-muted);
    padding: 0 4px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-nav::-webkit-scrollbar       { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

.sidebar-empty {
    font-size: .82rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 1.5rem;
    line-height: 1.6;
}

/* ── Conversation Item ── */
.conv-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 8px 8px 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s;
    position: relative;
}
.conv-item:hover               { background: var(--color-secondary); }
.conv-item--active             { background: var(--color-primary); }

.conv-title {
    font-size: .82rem;
    color: var(--color-text-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Tombol titik tiga dan dropdown */
.conv-actions {
    position: relative;
    flex-shrink: 0;
}

.conv-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s, background .15s;
}
.conv-item:hover .conv-menu-btn { opacity: 1; }
.conv-menu-btn:hover            { background: var(--color-border); color: var(--color-text-base); }

.conv-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    z-index: 500;
    overflow: hidden;
}

.conv-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: transparent;
    font-size: .82rem;
    cursor: pointer;
    transition: background .15s;
    text-align: left;
    color: var(--color-text-base);
}
.conv-dropdown-item:hover               { background: var(--color-bg-subtle); }
.conv-dropdown-item--danger             { color: var(--color-danger); }
.conv-dropdown-item--danger:hover       { background: #fef2f2; color: var(--color-danger-dark); }
[data-theme="dark"] .conv-dropdown-item--danger:hover { background: #2d1515; }

/* ── Sidebar Footer ── */
.sidebar-footer {
    border-top: 1px solid var(--color-border);
    padding-top: .75rem;
    margin-top: .5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.sidebar-footer-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: .82rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
    text-align: left;
}
.sidebar-footer-btn:hover {
    background: var(--color-secondary);
    color: var(--color-text-base);
}
.sidebar-footer-btn--danger       { color: var(--color-danger); }
.sidebar-footer-btn--danger:hover {
    background: #fef2f2;
    color: var(--color-danger-dark);
}
[data-theme="dark"] .sidebar-footer-btn--danger:hover { background: #2d1515; }


/* ══════════════════════════════════════════════════════════════════════════════
   SIDEBAR OVERLAY (mobile)
   ══════════════════════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 299;
}
.overlay--visible { display: block; }


/* ══════════════════════════════════════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════════════════════════════════════ */
.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    background: var(--color-topbar);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    gap: .5rem;
    transition: background .3s, border-color .3s;
    position: relative;
    z-index: 10;
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.topbar-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
}
.topbar-menu-btn:hover {
    background: var(--color-bg-subtle);
    color: var(--color-text-base);
}

.topbar-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--color-accent);
}

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 5px 12px;
    font-size: .78rem;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.theme-toggle:hover {
    background: var(--color-secondary);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Profile button */
.profile-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 5px 12px 5px 8px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--color-text-base);
    cursor: pointer;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
    overflow: hidden;
    max-width: 200px;
}
.profile-btn:hover {
    background: var(--color-secondary);
    border-color: var(--color-accent);
}

.profile-chevron {
    flex-shrink: 0;
    opacity: .6;
    transition: transform .2s;
}
.profile-btn[aria-expanded="true"] .profile-chevron {
    transform: rotate(180deg);
}

.profile-dropdown-wrapper {
    position: relative;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-card, var(--color-bg));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    overflow: hidden;
    min-width: 160px;
    z-index: 200;
    animation: dropdownFadeIn .15s ease;
}

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

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 10px 14px;
    font-size: .84rem;
    font-weight: 500;
    color: var(--color-text-base);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background .12s;
}
.profile-dropdown-item:hover {
    background: var(--color-secondary);
}
.profile-dropdown-item--danger {
    color: var(--color-danger, #dc2626);
}
.profile-dropdown-item--danger:hover {
    background: rgba(220, 38, 38, .08);
}

.profile-avatar {
    font-size: 1rem;
    flex-shrink: 0;
}

.profile-greeting {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .profile-greeting { display: none; }
    .theme-toggle span { display: none; }
}


/* ══════════════════════════════════════════════════════════════════════════════
   MAIN WRAPPER
   ══════════════════════════════════════════════════════════════════════════════ */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem 1rem .75rem;
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}


/* ══════════════════════════════════════════════════════════════════════════════
   WELCOME SCREEN
   ══════════════════════════════════════════════════════════════════════════════ */
.welcome-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    transition: opacity .2s;
    pointer-events: none;
}
.welcome-screen img {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: .85;
}
.welcome-screen h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: .4rem;
}
.welcome-screen p {
    font-size: .9rem;
    color: var(--color-text-muted);
    max-width: 320px;
}
.welcome-screen--hidden {
    opacity: 0;
    pointer-events: none;
}


/* ══════════════════════════════════════════════════════════════════════════════
   CHAT HISTORY
   ══════════════════════════════════════════════════════════════════════════════ */
.chat-history {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: .25rem;
    scroll-behavior: smooth;
}
.chat-history--empty   { overflow: hidden; }
.chat-history::-webkit-scrollbar       { width: 4px; }
.chat-history::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }


/* ══════════════════════════════════════════════════════════════════════════════
   BUBBLE: USER
   ══════════════════════════════════════════════════════════════════════════════ */
.user-bubble {
    align-self: flex-end;
    max-width: 72%;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
    padding: .65rem 1rem;
    font-size: .9rem;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-sm);
}

.file-tag {
    font-size: .75rem;
    opacity: .85;
    font-style: italic;
}


/* ══════════════════════════════════════════════════════════════════════════════
   BUBBLE: LOADING
   ══════════════════════════════════════════════════════════════════════════════ */
.loading-bubble {
    display: flex;
    align-items: center;
    gap: .6rem;
    align-self: flex-start;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: .7rem 1rem;
    box-shadow: var(--shadow-sm);
}
.loading-dots {
    display: flex;
    gap: 4px;
}
.loading-dots span {
    width: 7px; height: 7px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: bounce .9s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .30s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: .5; }
    40%           { transform: scale(1);   opacity: 1; }
}

.loading-text {
    font-size: .82rem;
    color: var(--color-text-muted);
    font-style: italic;
}


/* ══════════════════════════════════════════════════════════════════════════════
   BUBBLE: HASIL AI
   ══════════════════════════════════════════════════════════════════════════════ */
.result-bubble {
    align-self: flex-start;
    display: flex;
    gap: .75rem;
    max-width: 85%;
}

.result-avatar {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: .15rem;
}

.result-body {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: .85rem 1rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.result-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-accent);
    margin-bottom: .6rem;
}

.result-content { display: flex; flex-direction: column; gap: .5rem; }

.section-heading {
    font-size: .875rem;
    font-weight: 700;
    color: var(--color-text-base);
    margin-top: .25rem;
}

.section-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.section-point {
    font-size: .875rem;
    color: var(--color-text-base);
    line-height: 1.6;
    padding-left: 1.1rem;
    position: relative;
}
.section-point::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: 700;
}

.section-point--interactive {
    color: var(--color-accent);
    font-style: italic;
}
.section-point--interactive::before { content: "💬"; font-style: normal; }

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50%      { border-color: var(--color-accent); }
}


/* ══════════════════════════════════════════════════════════════════════════════
   FILE PREVIEW BAR
   ══════════════════════════════════════════════════════════════════════════════ */
.file-preview {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: .5rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: .8rem;
    color: var(--color-text-muted);
}
.file-preview--visible { display: flex; }
.file-preview svg      { flex-shrink: 0; }

#file-preview-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#file-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: .75rem;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
}
#file-remove-btn:hover {
    background: var(--color-border);
    color: var(--color-text-base);
}


/* ══════════════════════════════════════════════════════════════════════════════
   SEARCH / INPUT FORM
   ══════════════════════════════════════════════════════════════════════════════ */
.search-container {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--color-bg);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: .4rem .5rem .4rem .75rem;
    box-shadow: var(--shadow-sm);
    transition: border-color .2s, box-shadow .2s;
}
.search-container:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(5,150,105,.12);
}

.btn-upload {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: background .15s, color .15s;
}
.btn-upload:hover {
    background: var(--color-bg-subtle);
    color: var(--color-accent);
}

.input { flex: 1; }
.input input {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    font-size: .9rem;
    color: var(--color-text-base);
    width: 100%;
    padding: 0 .25rem;
}
.input input::placeholder { color: var(--color-text-muted); }

.btn-send {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    transition: background .15s, transform .1s;
    padding: 0;
}
.btn-send:hover  { background: var(--color-accent-dark); }
.btn-send:active { transform: scale(.93); }
.btn-send:disabled {
    background: var(--color-border);
    cursor: not-allowed;
}
