/* ==========================================================================
   NOTIFORGE — VIEWS: SOHBET & ASİSTAN (CHAT VIEW)
   Mesaj baloncukları, AI yanıt kartları, çoklu referans carousel,
   sohbet çekmecesi (drawer), prompt çipleri ve input pill stilleri.
   ========================================================================== */

/* Chat Baloncuk Stilleri & WhatsApp / Gemini Akıcı Tasarımı 💬 */
.chat-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0.5rem 0 1rem 0;
}

.message {
    max-width: 85%;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* Kullanıcı Mesajı (Sağa Yatık) */
.user-msg {
    align-self: flex-end;
}

/* Yapay Zeka Mesajı (Sola Yatık) */
.ai-msg {
    align-self: flex-start;
    min-width: 160px;
}

/* Baloncuk Gövdesi 💬 */
.chat-msg-bubble {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.93rem;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    position: relative;
    min-width: 64px;
}

/* Kullanıcı Mesaj Baloncuğu (Botanik Yeşil Baloncuk) */
.user-msg .chat-msg-bubble {
    background: linear-gradient(135deg, var(--accent, var(--accent)) 0%, #1e3f2e 100%);
    color: #ffffff !important;
    padding: 10px 16px;
    border-radius: 18px 18px 4px 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.18);
    unicode-bidi: plaintext;
    text-align: start;
}

.user-msg .chat-msg-text,
.user-msg .chat-msg-text p,
.user-msg .chat-msg-text span,
.user-msg .chat-msg-text div {
    color: #ffffff !important;
    unicode-bidi: plaintext;
}

/* Yapay Zeka Mesaj Baloncuğu (Sola Yatık Beyaz Kart) */
.ai-msg .chat-msg-bubble {
    background: var(--surface);
    color: var(--text-primary, var(--accent-ink));
    padding: 14px 18px;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Mesaj Alt Satırı (Token Rozeti & Saat - Baloncuğun Dışında Altta) */
.chat-msg-footer {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 0 4px;
    font-size: 0.72rem;
    color: var(--text-muted, var(--text-muted));
}

.ai-msg .chat-msg-footer {
    justify-content: space-between;
}

.user-msg .chat-msg-footer {
    justify-content: flex-end;
}

/* Token Rozeti (Sarı / Amber Hap - Fotoğraf 2 ile Birebir) ⚡ */
.msg-token-badge {
    background: color-mix(in srgb, #fbe604 20%, var(--surface));
    color: color-mix(in srgb, #854d0e 62%, var(--text));
    border: 1px solid #fef08a;
    border-radius: var(--r-lg);
    padding: 2px 9px;
    font-weight: 700;
    font-size: 0.70rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    user-select: none;
    transition: all 0.15s ease;
    height: 22px;
    box-sizing: border-box;
    line-height: 1;
}

.msg-token-badge:hover {
    background: #fef08a;
    border-color: #fde047;
}

.msg-token-badge .token-bolt {
    color: color-mix(in srgb, var(--warning) 62%, var(--text));
    font-size: 0.76rem;
}

.chat-msg-time {
    opacity: 0.8;
    font-size: 0.70rem;
    color: var(--text-muted, var(--text-muted));
    display: inline-flex;
    align-items: center;
    gap: 3px;
    user-select: none;
}

.chat-msg-check {
    color: var(--success);
    font-weight: 700;
}

/* Asistan Baloncuğu Pürüzsüz Giriş / Morf Animasyonu 🌟 */
.ai-bubble-reveal {
    animation: aiBubbleReveal 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes aiBubbleReveal {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Aşamalı AI Durum Pill (Artık mesaj içi spinner kullanıldığı için gizlendi) 🌟 */
#ai-thinking-indicator {
    display: none !important;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    margin: 6px 0 16px 0;
    border-radius: var(--r-xl);
    background: rgba(var(--surface-rgb), 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    box-shadow: 0 4px 18px rgba(var(--accent-rgb), 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    max-width: 90%;
    align-self: flex-start;
    flex-shrink: 0;
    z-index: 5;
    animation: statusPillEntrance 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.25s ease, opacity 0.25s ease;
}

#ai-thinking-indicator.pill-morphing {
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
    pointer-events: none;
}

@keyframes statusPillEntrance {
    0% {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Shimmer Sweep Animasyonu */
#ai-thinking-indicator::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(var(--surface-rgb), 0.7) 50%,
        transparent 100%
    );
    animation: pillShimmerSweep 2.2s infinite ease-in-out;
    pointer-events: none;
}

@keyframes pillShimmerSweep {
    0% { left: -150%; }
    100% { left: 150%; }
}

/* Aşama İkonu ve Nefes Alma / Nabız Animasyonu */
.ai-status-icon-wrap {
    font-size: 1.1rem;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.08);
    animation: statusIconPulse 1.6s infinite ease-in-out;
    flex-shrink: 0;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

@keyframes statusIconPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(45, 90, 67, 0));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 6px rgba(45, 90, 67, 0.35));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(45, 90, 67, 0));
    }
}

/* Aşama Metin Gövdesi */
.ai-status-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.ai-status-title-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-status-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary, var(--accent-ink));
    white-space: nowrap;
    transition: color 0.3s ease;
}

.ai-status-desc {
    font-size: 0.73rem;
    color: var(--text-muted, var(--text-muted));
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 3 Noktalı Canlı Zıplama İndikatörü */
.ai-status-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 2px;
}

.ai-status-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent, var(--accent));
    animation: dotBounce 1.4s infinite ease-in-out both;
}

.ai-status-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-status-dot:nth-child(2) { animation-delay: -0.16s; }
.ai-status-dot:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.7) translateY(0);
        opacity: 0.35;
    }
    40% {
        transform: scale(1.25) translateY(-3px);
        opacity: 1;
    }
}


/* Chat İçi Mesaj Metni ve Markdown Formatları 📑 */
.chat-msg-text {
    line-height: 1.6;
    font-size: 0.88rem;
    color: inherit;
    word-break: break-word;
}
.chat-msg-text p {
    margin-bottom: 8px;
    font-size: 0.88rem;
    line-height: 1.6;
}
.chat-msg-text p:last-child {
    margin-bottom: 0;
}
.chat-msg-text h1 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 10px 0 6px 0;
    color: var(--text);
    line-height: 1.35;
}
.chat-msg-text h2 {
    font-size: 0.98rem;
    font-weight: 700;
    margin: 8px 0 4px 0;
    color: var(--text);
    line-height: 1.35;
}
.chat-msg-text h3, .chat-msg-text h4 {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 6px 0 3px 0;
    color: var(--text);
    line-height: 1.3;
}
.chat-msg-text strong {
    font-weight: 700;
    color: var(--accent-ink);
}
.user-msg .chat-msg-text strong {
    color: #ffffff;
}
.chat-msg-text ul, .chat-msg-text ol {
    margin: 6px 0 8px 18px;
    padding-left: 4px;
    font-size: 0.88rem;
}
.chat-msg-text li {
    margin-bottom: 4px;
    line-height: 1.5;
}
.chat-msg-text blockquote {
    border-left: 3px solid var(--accent);
    padding: 6px 12px;
    margin: 8px 0;
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: 0 8px 8px 0;
    font-size: 0.86rem;
    color: var(--text);
}
.chat-msg-text pre {
    background: var(--text);
    color: #f8fafc;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    overflow-x: auto;
    font-size: 0.8rem;
    margin: 8px 0;
}
.chat-msg-text code {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent-ink);
    padding: 2px 6px;
    border-radius: var(--r-xs);
    font-size: 0.84em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.user-msg .chat-msg-text code {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* 🌿 Arapça Ayet / Metin Stili (RTL & Büyük Punto) */
.chat-arabic-block {
    font-family: var(--font-arabic) !important;
    font-size: 1.25rem !important;
    line-height: 2 !important;
    text-align: right !important;
    direction: rtl !important;
    color: var(--accent-ink) !important;
    padding: 8px 14px !important;
    background: rgba(var(--accent-rgb), 0.05) !important;
    border-radius: var(--r-sm) !important;
    margin: 8px 0 !important;
    letter-spacing: 0.01em;
    border-right: 3.5px solid var(--accent);
}

.chat-mixed-ltr-line {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: embed !important;
    line-height: 1.6;
    margin: 4px 0;
}

.user-msg .chat-arabic-block {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-right: 3px solid rgba(255, 255, 255, 0.7) !important;
}

/* Chat İçi Mini Widget Kutusu */
.chat-widget-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent-text);
    padding: 8px 12px;
    border-radius: var(--r-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-widget-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.chat-mini-card {
    margin-top: 8px;
    background: var(--surface); /* Sıcak yumuşak fildişi / fildişi botanik zemin */
    border: 1px solid var(--border-strong);
    border-left: 3.5px solid var(--accent, var(--accent)); /* Sol Botanik Yeşil Vurgu */
    border-radius: var(--r-md);
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    text-align: left;
}

.chat-mini-card:hover {
    background: var(--surface);
    border-color: var(--accent, var(--accent));
    border-left-color: var(--accent, var(--accent));
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.12);
}

.chat-mini-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.chat-mini-card-header-left {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 1;
}

.chat-mini-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary, var(--text));
    font-family: var(--font-heading, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.chat-card-icon {
    font-size: 0.95rem;
    line-height: 1;
    flex-shrink: 0;
}

.chat-card-tag {
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent, var(--accent-text));
    padding: 2px 7px;
    border-radius: var(--r-pill);
    border: 1px solid rgba(var(--accent-rgb), 0.16);
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-mini-card-btn-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent, var(--accent-text));
    padding: 3px 10px;
    border-radius: var(--r-xl);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.18s ease;
}

.chat-mini-card:hover .chat-mini-card-btn-badge {
    background: var(--accent, var(--accent));
    color: #ffffff;
    border-color: var(--accent, var(--accent));
}

.chat-mini-card-sub {
    font-size: 0.82rem;
    color: var(--text-secondary, var(--text-muted));
    font-weight: 500;
    line-height: 1.42;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chat-card-arrow {
    color: var(--accent, var(--accent-text));
    font-weight: 800;
    margin-right: 4px;
    display: inline-block;
}

/* --- YATAY KAYDIRMA (CAROUSEL) STİLLERİ --- */
.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;  /* IE ve Edge için gizle */
    scrollbar-width: none;  /* Firefox için gizle */
}

/* Chrome, Safari ve Opera için kaydırma çubuğunu gizle */
.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.carousel-card {
    flex: 0 0 auto;
    width: 250px; /* Mini kartların dengeli genişliği */
    min-height: 84px;
    scroll-snap-align: start;
    white-space: normal;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    border-left: 4px solid var(--accent) !important;
}

.carousel-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent) !important;
    border-left: 4px solid var(--accent) !important;
    box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.09) !important;
}

/* ==========================================================================
   MOCKUP UYUMLU ÇOKLU REFERANS KARTLARI CAROUSEL (YATAY KAYDIRMA) 📑✨
   ========================================================================== */

.chat-ref-container {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.chat-ref-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.chat-ref-header-left {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-muted, var(--text-muted));
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-ref-header-right {
    font-size: 0.72rem;
    color: var(--text-faint);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: default;
}

.chat-ref-carousel {
    display: flex;
    gap: 10px;
    padding: 4px 2px 6px 2px;
    box-sizing: border-box;
    width: 100%;
}

.chat-ref-carousel-single {
    overflow: visible;
}

.chat-ref-carousel-multi {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-ref-carousel-multi::-webkit-scrollbar {
    display: none;
}

.chat-ref-card {
    background: var(--surface); /* Sıcak yumuşak fildişi botanik zemin */
    border: 1px solid var(--border-strong);
    border-left: 3.5px solid var(--accent, var(--accent)); /* Sol Botanik Yeşil Vurgu */
    border-radius: var(--r-md);
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    text-align: left;
}

.chat-ref-card:hover {
    background: var(--surface);
    border-color: var(--accent, var(--accent));
    border-left-color: var(--accent, var(--accent));
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.12);
}

.chat-ref-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.chat-ref-card-header-left {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 1;
}

.chat-ref-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary, var(--text));
    font-family: var(--font-heading, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.chat-ref-card-action-pill {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent, var(--accent-text));
    padding: 3px 10px;
    border-radius: var(--r-xl);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.18s ease;
}

.chat-ref-card:hover .chat-ref-card-action-pill {
    background: var(--accent, var(--accent));
    color: #ffffff;
    border-color: var(--accent, var(--accent));
}

.chat-ref-card-snippet {
    font-size: 0.82rem;
    color: var(--text-secondary, var(--text-muted));
    font-weight: 500;
    line-height: 1.42;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tekil Referans Kartı: Balonun tüm genişliğini kaplar (Keep kartı gibi) */
.chat-ref-card-single {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

/* Çoklu Referans Kartları: Yatay kaydırma için konforlu genişlik */
.chat-ref-carousel-multi .chat-ref-card {
    flex: 0 0 250px;
    width: 250px;
    min-width: 230px;
    max-width: 280px;
    scroll-snap-align: start;
}


/* ==========================================================================
   💬 ÇOKLU SOHBET & MODERN CHAT MODU (CHAT MODE, DRAWER & HEADER) STİLLERİ
   ========================================================================== */

/* 🌿 Chat Modunda SADECE Ana Sayfa Üst Header'ını ve Alt Navigasyonu Gizle & Alanı Genişlet (Modal ve diğer headerları etkilemez) */
body.chat-mode-active > header,
body.chat-mode-active .bottom-nav-container,
body.chat-mode-active #guest-banner {
    display: none !important;
}

body.chat-mode-active #app-content {
    padding: 0 !important;
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
}

.chat-view-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    background: var(--bg-primary, var(--bg-primary));
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* 🌿 Sohbet Üst Çubuğu (Chat Header Bar) */
.chat-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 14px;
    background: var(--surface);
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.08);
    flex-shrink: 0;
    position: relative;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.chat-header-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--accent-ink);
    cursor: pointer;
    transition: all 0.18s ease;
    padding: 0;
    z-index: 2;
}

.chat-header-back-btn:hover {
    background: var(--surface-3);
    transform: scale(1.05);
}

.chat-header-center-wrap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    padding: 4px 10px;
    border-radius: var(--r-sm);
    transition: background 0.15s ease;
    max-width: calc(100% - 160px);
    z-index: 1;
}

.chat-header-center-wrap:hover {
    background: rgba(0, 0, 0, 0.03);
}

.chat-header-title-row {
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
}

.chat-header-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
}

.chat-header-meta {
    font-size: 0.70rem;
    color: var(--text-faint);
    margin-top: 1px;
}

/* Sağ Üst Aksiyon Butonları */
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    z-index: 2;
}

.chat-header-refresh-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    transition: all 0.18s ease;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.chat-header-refresh-btn:hover {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent, var(--accent-text));
    transform: scale(1.05);
}

.chat-header-refresh-btn:active {
    transform: scale(0.92);
}

.chat-header-refresh-btn.spinning {
    color: var(--accent, var(--accent-text));
    pointer-events: none;
}

.chat-header-refresh-btn.spinning .chat-refresh-svg {
    animation: chatSpinRefresh 0.8s linear infinite;
}

@keyframes chatSpinRefresh {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.chat-header-new-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent, var(--accent));
    border: none;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25);
    padding: 0;
}

.chat-header-new-btn:hover {
    background: var(--accent-hover, var(--accent-hover));
    transform: scale(1.06);
}

/* Chat Mesaj Kutusu */
.chat-box {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 14px 20px 14px;
    scrollbar-width: thin;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* AI Aksiyon Butonları (Dinle, Nota Kaydet, Kopyala) - Footer'da Token ile Yan Yana */
.chat-msg-footer-left {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.chat-ai-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.chat-ai-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 2px 8px;
    border-radius: var(--r-lg);
    font-size: 0.70rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    line-height: 1;
    height: 22px;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.chat-ai-action-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.chat-ai-action-btn:hover {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border-strong);
    transform: translateY(-0.5px);
}

/* Yanıt İçi Referans Not Kartı */
.chat-inline-reference-card {
    margin-top: 10px;
    padding: 9px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.chat-inline-reference-card:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.chat-inline-ref-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.chat-inline-ref-icon {
    font-size: 1.1rem;
}

.chat-inline-ref-texts {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-inline-ref-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-inline-ref-meta {
    font-size: 0.70rem;
    color: var(--text-muted);
}

.chat-inline-ref-arrow {
    color: var(--accent, var(--accent-text));
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 8px;
}

/* 💡 Canlı Öneri Çipleri (Prompt Chips & Quick Actions) */
.chat-suggested-chips-wrapper {
    position: relative;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    overflow: hidden;
    transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
}

/* 🏹 Masaüstü Yatay Kaydırma Okları */
.chat-chips-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.2px solid var(--border-strong);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.18s ease;
    opacity: 0.85;
}

.chat-chips-arrow:hover {
    opacity: 1;
    background: var(--surface);
    color: var(--accent, var(--accent-text));
    border-color: var(--accent, var(--accent));
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.chat-chips-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.chat-chips-arrow-left {
    left: 4px;
}

.chat-chips-arrow-right {
    right: 4px;
}

.chat-suggested-chips-wrapper.is-typing {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    pointer-events: none;
    transform: translateY(6px);
}

.chat-suggested-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 14px 10px 14px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    scroll-behavior: smooth;
    user-select: none;
    cursor: grab;
}

.chat-suggested-chips.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.chat-suggested-chips::-webkit-scrollbar {
    display: none;
}

/* 🎲 Çark / Yenile Butonu */
.chat-chip-shuffle-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.2px solid var(--border-strong);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-right: 2px;
}

.chat-chip-shuffle-btn:hover {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--accent, var(--accent-text));
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.chat-chip-shuffle-btn:active {
    transform: scale(0.92);
}

.chat-chip-shuffle-btn .shuffle-svg {
    transition: transform 0.4s ease;
}

.chat-chip-shuffle-btn.is-spinning .shuffle-svg {
    transform: rotate(360deg);
}

/* 🌿 Temel Çip Butonu */
.chat-chip-btn {
    white-space: nowrap;
    border-radius: var(--r-xl);
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
}

.chat-chip-btn:active,
.chat-chip-btn.chip-clicked {
    transform: scale(0.95);
}

/* ⚡ HIZLI EYLEM HAPLARI */
.chat-chip-btn.chip-action {
    padding: 6px 14px;
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* 🎯 1. Beni Sına (Quiz) */
.chat-chip-btn.chip-action-quiz {
    background: linear-gradient(135deg, color-mix(in srgb, var(--warning) 13%, var(--surface)) 0%, color-mix(in srgb, var(--warning) 20%, var(--surface)) 100%);
    border: 1.2px solid #fcd34d;
    color: color-mix(in srgb, var(--warning) 62%, var(--text));
}
.chat-chip-btn.chip-action-quiz:hover {
    background: color-mix(in srgb, var(--warning) 20%, var(--surface));
    border-color: var(--warning);
    color: color-mix(in srgb, var(--warning) 62%, var(--text));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--warning-rgb), 0.22);
}

/* 📝 2. Notlarımdan Özet Çıkar */
.chat-chip-btn.chip-action-summary {
    background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent-soft) 100%);
    border: 1.2px solid var(--border-strong);
    color: var(--accent-ink);
}
.chat-chip-btn.chip-action-summary:hover {
    background: var(--accent-soft);
    border-color: var(--success);
    color: var(--accent-ink);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--success-rgb), 0.20);
}

/* ⏰ 3. Bugünkü Görevlerim */
.chat-chip-btn.chip-action-tasks {
    background: linear-gradient(135deg, color-mix(in srgb, var(--info) 8%, var(--surface)) 0%, color-mix(in srgb, #076ef8 20%, var(--surface)) 100%);
    border: 1.2px solid #93c5fd;
    color: color-mix(in srgb, #1e40af 62%, var(--text));
}
.chat-chip-btn.chip-action-tasks:hover {
    background: color-mix(in srgb, #076ef8 20%, var(--surface));
    border-color: var(--info);
    color: color-mix(in srgb, var(--info) 62%, var(--text));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--info-rgb), 0.20);
}

/* 💡 DİNAMİK KİŞİSEL KARTLAR */
.chat-chip-btn.chip-personal {
    background: var(--surface);
    border: 1.2px solid var(--border-strong);
    color: var(--text);
    padding: 5px 12px 5px 8px;
    font-size: 0.77rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.chat-chip-btn.chip-personal:hover {
    background: var(--surface);
    border-color: var(--text-faint);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Kişisel Kart İç Rozetleri */
.chat-chip-btn .chip-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--r-sm);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.chat-chip-btn .chip-badge-note {
    background: var(--accent-soft);
    color: var(--accent-ink);
    border: 1px solid var(--border-strong);
}

.chat-chip-btn .chip-badge-word {
    background: color-mix(in srgb, var(--ai) 13%, var(--surface));
    color: color-mix(in srgb, #6b21a8 62%, var(--text));
    border: 1px solid color-mix(in srgb, #7900ff 32%, var(--surface));
}

.chat-chip-btn .chip-badge-task {
    background: color-mix(in srgb, #0897f7 13%, var(--surface));
    color: color-mix(in srgb, #0369a1 62%, var(--text));
    border: 1px solid color-mix(in srgb, #07a5f8 32%, var(--surface));
}

/* Kişisel Kart Başlığı */
.chat-chip-btn .chip-title {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* 🌿 Yuvarlatılmış Modern Input Pill */
.chat-input-pill-container {
    padding: 0 14px 14px 14px;
    position: relative;
    flex-shrink: 0;
    background: transparent;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    box-sizing: border-box;
}

.chat-input-pill {
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--r-xl);
    padding: 4px 6px 4px 10px;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input-pill:focus-within {
    border-color: var(--accent, var(--accent));
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.12);
}

.chat-pill-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.chat-pill-icon-btn:hover {
    background: var(--surface-2);
    color: var(--accent-ink);
}

.chat-pill-text-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.88rem;
    color: var(--text);
    font-family: inherit;
    padding: 9px 4px;
    min-width: 0;
    resize: none;
    line-height: 1.4;
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: none;
    display: block;
}

.chat-pill-text-input::-webkit-scrollbar {
    display: none;
}

.chat-pill-text-input::placeholder {
    color: var(--text-faint);
}

.chat-pill-send-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent, var(--accent));
    border: none;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.18s ease;
    padding: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    outline: none;
}

.chat-pill-send-btn:hover {
    background: var(--accent-hover, var(--accent-hover));
    transform: scale(1.05);
}

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

.chat-spin-anim {
    animation: chatSpin 0.8s linear infinite;
    transform-origin: center;
}

@keyframes chatSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.chat-attach-popover {
    position: absolute;
    bottom: 58px;
    left: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 90;
    animation: fadeInFast 0.15s ease;
}

.attach-popover-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: var(--r-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: background 0.12s ease;
    text-align: left;
}

.attach-popover-item:hover {
    background: var(--surface);
    color: var(--text);
}

.chat-voice-recording-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 4px 6px;
}

.voice-red-dot {
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulseGlow 1.2s infinite;
}

.voice-timer-text {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--danger);
}

.voice-label-text {
    font-size: 0.80rem;
    color: var(--text-muted);
    flex: 1;
}

.voice-cancel-action-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
}

/* Önizleme Kutusu */
.chat-attachment-preview {
    flex-shrink: 0;
    padding: 8px 14px;
    background: var(--surface);
    border-top: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-attachment-preview img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: var(--r-sm);
    border: 1px solid var(--accent, var(--accent));
}

.preview-text {
    font-size: 0.8rem;
    color: var(--text-muted, var(--text-muted));
    flex: 1;
}

.preview-remove-btn {
    background: transparent;
    border: none;
    color: var(--danger);
    font-size: 1.3rem;
    cursor: pointer;
}

/* 🌿 Sol Çekmece Arka Plan Karartması (Backdrop Overlay) */
.chat-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* 🌿 Sol Çekmece Gövdesi (Sidebar Drawer) */
.chat-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 86vw;
    background: var(--surface);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

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

.chat-drawer-top {
    padding: 16px 14px 10px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-drawer-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drawer-new-chat-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent, var(--accent));
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: var(--r-sm);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.drawer-new-chat-btn:hover {
    background: var(--accent-hover, var(--accent-hover));
}

.chat-drawer-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-faint);
    padding: 4px;
    border-radius: var(--r-xs);
    transition: all 0.15s ease;
}

.chat-drawer-close-btn:hover {
    color: var(--text);
    background: var(--surface-2);
}

.chat-drawer-search-wrap {
    position: relative;
}

.chat-drawer-search-input {
    width: 100%;
    padding: 8px 30px 8px 32px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.82rem;
    box-sizing: border-box;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease;
}

.chat-drawer-search-input:focus {
    border-color: var(--accent, var(--accent));
    background: var(--surface);
}

.chat-drawer-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    pointer-events: none;
}

.chat-drawer-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--text-faint);
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
}

.chat-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    scrollbar-width: thin;
}

.chat-drawer-content::-webkit-scrollbar {
    width: 4px;
}

.chat-drawer-content::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: var(--r-xs);
}

/* 🌿 Gruplandırılmış Sohbet Kartları (Session Groups) */
.chat-session-group {
    margin-bottom: 14px;
}

.chat-session-group-title {
    font-size: 0.70rem;
    font-weight: 800;
    color: var(--text-faint);
    letter-spacing: 0.05em;
    padding: 4px 8px 6px 8px;
    text-transform: uppercase;
}

.chat-session-group-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
}

.chat-session-item:hover {
    background: var(--surface);
    border-color: var(--border);
}

.chat-session-item.active {
    background: var(--accent-soft);
    border: 1px solid var(--border-strong);
}

.chat-session-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-session-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-session-item.active .chat-session-title {
    color: var(--accent-ink);
    font-weight: 700;
}

.chat-session-snippet {
    font-size: 0.72rem;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-session-item.active .chat-session-snippet {
    color: var(--text);
}

.chat-session-menu-btn {
    background: transparent;
    border: none;
    padding: 4px 6px;
    border-radius: var(--r-xs);
    color: var(--text-faint);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.5;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.chat-session-item:hover .chat-session-menu-btn,
.chat-session-item.active .chat-session-menu-btn {
    opacity: 1;
}

.chat-session-menu-btn:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.06);
}

.chat-session-dropdown {
    position: absolute;
    right: 8px;
    top: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: var(--r-sm);
    padding: 4px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    min-width: 145px;
    animation: fadeInFast 0.15s ease;
}

.chat-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    border: none;
    background: transparent;
    border-radius: var(--r-xs);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.12s ease;
}

.chat-dropdown-item:hover {
    background: var(--surface-2);
}

.chat-dropdown-item.delete {
    color: var(--danger);
}

.chat-dropdown-item.delete:hover {
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.chat-drawer-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.chat-drawer-tip {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-faint);
}

.chat-drawer-token-badge {
    background: var(--accent-soft);
    border: 1px solid var(--border-strong);
    padding: 3px 8px;
    border-radius: var(--r-md);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--accent-ink);
    white-space: nowrap;
}

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

#chat-rename-modal,
#chat-delete-modal {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
}

#chat-rename-modal .modal-card,
#chat-delete-modal .modal-card {
    border-radius: var(--r-lg) !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15) !important;
}

/* 🌿 Yeni Sohbet Karşılama Ekranı (Boş Durum + İlham Kartları) */
.chat-welcome {
    margin: auto;
    width: 100%;
    max-width: 440px;
    padding: 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: aiBubbleReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chat-welcome-logo {
    width: 56px;
    height: 56px;
    border-radius: var(--r-lg);
    display: grid;
    place-items: center;
    font-size: 1.7rem;
    background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent-soft) 100%);
    border: 1px solid rgba(var(--accent-rgb), 0.14);
    box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.10);
    margin-bottom: 14px;
}

.chat-welcome-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-ink);
    margin: 0 0 6px 0;
    letter-spacing: -0.01em;
}

.chat-welcome-sub {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted, var(--text-muted));
    margin: 0 0 18px 0;
    max-width: 340px;
}

.chat-welcome-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.chat-welcome-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.chat-welcome-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.10);
}

.chat-welcome-card:active {
    transform: scale(0.99);
}

.chat-welcome-card-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    background: var(--accent-soft);
}

.chat-welcome-card:nth-child(2) .chat-welcome-card-icon { background: color-mix(in srgb, var(--ai) 13%, var(--surface)); }
.chat-welcome-card:nth-child(3) .chat-welcome-card-icon { background: color-mix(in srgb, var(--warning) 20%, var(--surface)); }
.chat-welcome-card:nth-child(4) .chat-welcome-card-icon { background: color-mix(in srgb, #0897f7 13%, var(--surface)); }

.chat-welcome-card-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.chat-welcome-card-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
}

.chat-welcome-card-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-welcome-card-arrow {
    color: var(--accent, var(--accent-text));
    font-weight: 700;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* 🧑‍💻 Kod Bloğu Başlığı (dil etiketi + kopyala) */
.chat-code-block {
    margin: 8px 0;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
}

.chat-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chat-code-copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--r-xs);
    font-family: inherit;
}

.chat-code-copy-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.chat-code-block pre {
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}


/* ==========================================================================
   🌿 SOHBET ŞABLON KART VE ELEMAN STİLLERİ (chat.html'den taşınanlar)
   ========================================================================== */

/* 📝 Kompakt & Şık Not Detayı Kartı (Not Detay Kartı) */
.chat-note-preview-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 12px 14px;
    margin-top: 4px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.04);
    transition: all 0.18s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-note-preview-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.10);
    transform: translateY(-1px);
}
.chat-note-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.chat-note-card-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 1;
}
.chat-note-card-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
    line-height: 1;
}
.chat-note-card-title {
    margin: 0;
    font-size: 0.90rem;
    font-weight: 700;
    color: var(--accent-ink);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-note-card-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent-soft);
    color: var(--accent, var(--accent-text));
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 3px 9px;
    font-size: 0.70rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.chat-note-preview-card:hover .chat-note-card-action-pill {
    background: var(--accent, var(--accent));
    color: #ffffff;
    border-color: var(--accent, var(--accent));
}
.chat-note-card-excerpt {
    margin: 0;
    font-size: 0.80rem;
    line-height: 1.48;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.chat-note-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    font-size: 0.70rem;
}
.chat-note-card-category {
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.75rem;
}
.chat-note-card-guide {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.70rem;
}
.chat-note-preview-card:hover .chat-note-card-guide {
    color: var(--accent, var(--accent-text));
    text-decoration: underline;
}

/* 🌿 İşlem Adımları Açılır Çekmecesi (Timeline Drawer) */
.chat-stepper-timeline-drawer {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    animation: fadeInFast 0.18s ease;
}
.chat-stepper-timeline {
    display: flex;
    flex-direction: column;
    padding: 2px 6px;
}
.stepper-item {
    display: flex;
    align-items: stretch;
    gap: 8px;
    position: relative;
}
.stepper-node-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 16px;
    flex-shrink: 0;
}
.stepper-node {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 2;
}
.stepper-node.done {
    background: var(--success);
    color: #ffffff;
}
.stepper-node.running {
    background: var(--warning);
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(var(--warning-rgb), 0.2);
}
.stepper-node.pending {
    background: var(--surface);
    color: var(--text-faint);
    border: 1px solid var(--border-strong);
}
.stepper-line {
    width: 1.5px;
    flex: 1;
    min-height: 10px;
    background: var(--surface-2);
    margin: 1px 0;
}
.stepper-content {
    flex: 1;
    padding-bottom: 5px;
}
.stepper-step-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.stepper-step-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ⚡ Alt Satırdaki "✓ X işlem" Rozeti */
.chat-steps-badge {
    background: var(--accent-soft);
    color: var(--accent-ink);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: 2px 9px;
    font-weight: 700;
    font-size: 0.70rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    height: 22px;
    box-sizing: border-box;
    line-height: 1;
    font-family: inherit;
}
.chat-steps-badge:hover {
    background: var(--accent-soft);
    border-color: var(--border-strong);
    transform: translateY(-0.5px);
}
.chat-steps-badge .steps-check {
    color: var(--success);
    font-weight: 800;
}
.chat-steps-badge .steps-chevron {
    font-size: 0.70rem;
    color: var(--success);
    transition: transform 0.2s ease;
}
.chat-steps-badge.open .steps-chevron {
    transform: rotate(180deg);
}

/* 🗑️ Sadeleştirilmiş Silinmiş Kayıt Bildirimi */
.chat-deleted-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-faint);
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
    padding: 6px 12px;
    font-style: italic;
    user-select: none;
}

/* 📷 Kullanıcı Görsel Mesajı İyileştirmesi */
.user-msg.msg-has-image .chat-msg-bubble {
    padding: 4px 4px 6px 4px !important;
    background: linear-gradient(135deg, var(--accent, var(--accent)) 0%, #1e3f2e 100%) !important;
    border-radius: 16px !important;
    max-width: 250px;
    box-sizing: border-box;
}
.chat-img-wrapper {
    overflow: hidden;
    border-radius: 12px;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
}
.chat-msg-img {
    max-width: 100%;
    max-height: 280px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}
.chat-msg-img:hover {
    transform: scale(1.02);
}

/* 🖼️ Tam Ekran Lightbox */
.chat-image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.chat-image-lightbox .lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}
.chat-image-lightbox .lightbox-card {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInFast 0.2s ease;
}
.chat-image-lightbox img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}
.chat-image-lightbox .lightbox-close-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

/* ⬇️ Yüzen En Alta Kaydır Butonu */
.chat-scroll-bottom-btn {
    position: absolute;
    right: 20px;
    bottom: 84px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 40;
    transition: all 0.18s ease;
}
.chat-scroll-bottom-btn:hover {
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}
