/* ge-platform admin utility — Filament asset bundle bağımsız garantili stil seti.
   Tüm custom Filament page'leri bu class'lar üzerine kurulu olmalı.
   Detay: KURALLAR.md "Filament admin page standardı" maddesi. */

/* ═══ Sayfa wrapper / dikey stack ═══ */
.gp-stack-sm { display: flex; flex-direction: column; gap: 0.75rem; }
.gp-stack-md { display: flex; flex-direction: column; gap: 1.25rem; }
.gp-stack-lg { display: flex; flex-direction: column; gap: 1.75rem; }

/* ═══ Responsive grid (mobil 1, tablet 2, desktop 3-4) ═══ */
.gp-grid-2,
.gp-grid-3,
.gp-grid-4 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .gp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gp-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gp-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .gp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .gp-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ═══ Generic kart (border, padding, hover) ═══ */
.gp-card {
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    background: #ffffff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.gp-card:hover { border-color: #d1d5db; }

/* ═══ Tier kart (renkli border, hover lift) — VIP/role/seviye gibi ═══ */
.gp-card-tier {
    border-radius: 0.75rem;
    border: 2px solid;
    padding: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    transition: transform 0.15s, box-shadow 0.15s;
}
.gp-card-tier:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }

/* ═══ Form label ═══ */
.gp-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    display: block;
    margin-bottom: 0.375rem;
}

/* ═══ Bilgi kutusu (mavi sol-border'lı not) ═══ */
.gp-info {
    font-size: 0.8125rem;
    color: #4b5563;
    line-height: 1.5;
    padding: 0.625rem 0.875rem;
    background: rgba(59, 130, 246, 0.06);
    border-left: 3px solid #3b82f6;
    border-radius: 0 0.375rem 0.375rem 0;
    margin-bottom: 0.875rem;
}

/* ═══ Yatay satır (filtre chip'leri, action bar) ═══ */
.gp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.gp-row-end { display: flex; justify-content: flex-end; padding-top: 0.5rem; }
.gp-spacer { flex: 1; }

/* ═══ Checkbox satırı (kart içinde checkbox + başlık + açıklama) ═══ */
.gp-check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.625rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    transition: background 0.15s, border-color 0.15s;
}
.gp-check-row:hover { background: rgba(0, 0, 0, 0.02); border-color: #d1d5db; }
.gp-check-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    display: block;
    line-height: 1.3;
}
.gp-check-desc {
    font-size: 0.6875rem;
    color: #9ca3af;
    margin-top: 0.125rem;
    display: block;
}

/* ═══ Progress bar (popüler linkler, oran gösterimi) ═══ */
.gp-progress {
    background-color: #f3f4f6;
    border-radius: 9999px;
    overflow: hidden;
    height: 6px;
}
.gp-progress-bar {
    height: 100%;
    border-radius: 9999px;
    background: var(--gp-primary, #00685f);
    transition: width 0.3s ease;
}

/* ═══ Text utilities ═══ */
.gp-text-sm { font-size: 0.875rem; }
.gp-text-xs { font-size: 0.75rem; }
.gp-text-muted { color: #6b7280; }
.gp-text-light { color: #9ca3af; }
.gp-text-strong { color: #111827; font-weight: 600; }
.gp-text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.gp-tabular { font-variant-numeric: tabular-nums; }
.gp-mono { font-family: ui-monospace, SFMono-Regular, monospace; }
.gp-link { color: #00685f; text-decoration: none; }
.gp-link:hover { text-decoration: underline; }

/* ─── Tablo (data-table generic) ─────────────────── */
.gp-data-table { width: 100%; font-size: .875rem; border-collapse: collapse; }
.gp-data-table thead tr { border-bottom: 1px solid rgba(148,163,184,0.3); }
.gp-data-table tbody tr { border-bottom: 1px solid rgba(148,163,184,0.15); }
.gp-data-table tbody tr:hover { background: rgba(148,163,184,0.05); }
.gp-data-table th { text-align: left; padding: 8px 6px; color: #64748b; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.gp-data-table th.right { text-align: right; }
.gp-data-table td { padding: 10px 6px; vertical-align: top; }
.gp-data-table td.right { text-align: right; }
.gp-data-table tr.clickable { cursor: pointer; }

/* ─── Bar chart (CSS-only, primary renk) ─────────── */
.gp-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 110px;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(148,163,184,0.3);
    margin-bottom: 6px;
}
.gp-chart-col { flex: 1; display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.gp-chart-bar {
    width: 100%;
    background: #2563eb;
    border-radius: 3px 3px 0 0;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.gp-chart-bar:hover { opacity: 1; }
.gp-chart-axis {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}
.gp-chart-axis > span {
    flex: 1;
    text-align: center;
    font-size: 10px;
    color: #94a3b8;
    font-family: ui-monospace, monospace;
}

/* ─── Baloncuk (chat bubble — sandbox için) ───────── */
.gp-bubble-row { display: flex; gap: 8px; margin-bottom: 8px; }
.gp-bubble-row.user { justify-content: flex-end; }
.gp-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.gp-bubble.user { background: #2563eb; color: white; border-radius: 16px 16px 4px 16px; }
.gp-bubble.assistant { background: #f1f5f9; color: #0f172a; border-radius: 16px 16px 16px 4px; }
.gp-bubble.error { background: #fee2e2; color: #991b1b; border-left: 3px solid #ef4444; }
.gp-bubble-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 6px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ─── SVG icon sizing (Tailwind w-X h-X purge'lü, fallback olarak) ─── */
.gp-icon-sm { width: 14px; height: 14px; flex-shrink: 0; display: inline-block; }
.gp-icon-md { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; }
.gp-icon-lg { width: 24px; height: 24px; flex-shrink: 0; display: inline-block; }
.gp-icon-xl { width: 48px; height: 48px; flex-shrink: 0; display: inline-block; }

/* Wrapper içindeki SVG'leri kapsa (bubble-avatar, persona-avatar gibi) */
.gp-bubble-avatar svg,
.gp-card svg.gp-icon-fill {
    width: 100%;
    height: 100%;
    display: block;
}

/* ─── Persona avatar wrapper'ları ─────── */
.gp-avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    flex-shrink: 0;
}
.gp-avatar-circle.sm { width: 32px; height: 32px; padding: 6px; }
.gp-avatar-circle.md { width: 40px; height: 40px; padding: 8px; }
.gp-avatar-circle.lg { width: 48px; height: 48px; padding: 10px; }
.gp-avatar-circle svg { width: 100%; height: 100%; display: block; }

/* ─── AI conversation mesaj kartları ──── */
.gp-msg {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.2);
    background: #ffffff;
    border-left-width: 3px;
    border-left-style: solid;
}
.gp-msg.user      { border-left-color: #2563eb; background: #eff6ff; }
.gp-msg.assistant { border-left-color: #10b981; background: #f0fdf4; }
.gp-msg.tool      { border-left-color: #f59e0b; background: #fffbeb; }
.gp-msg.system    { border-left-color: #94a3b8; background: #f8fafc; }
.gp-msg-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.gp-msg-role {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
}
.gp-msg-role.user      { background: #dbeafe; color: #1e40af; }
.gp-msg-role.assistant { background: #d1fae5; color: #065f46; }
.gp-msg-role.tool      { background: #fef3c7; color: #92400e; }
.gp-msg-role.system    { background: #e2e8f0; color: #334155; }
.gp-msg-meta {
    font-size: 11px;
    color: #64748b;
    font-family: ui-monospace, monospace;
}
.gp-msg-spacer { flex: 1; }
.gp-msg-body {
    font-size: 14px;
    line-height: 1.55;
    color: #0f172a;
}
.gp-msg-body p { margin: 0 0 8px 0; }
.gp-msg-body p:last-child { margin: 0; }
.gp-msg-body strong { font-weight: 700; }
.gp-msg-body em { font-style: italic; }
.gp-msg-body code {
    background: rgba(15,23,42,0.06);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: ui-monospace, monospace;
    font-size: 12px;
}
.gp-msg-body pre {
    background: rgba(15,23,42,0.06);
    padding: 8px 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 12px;
}
.gp-msg-body a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.gp-msg-body a:hover { color: #1d4ed8; }
.gp-msg-body ul, .gp-msg-body ol { margin: 4px 0 8px 22px; }
.gp-msg-body li { margin-bottom: 2px; }
.gp-msg-body blockquote {
    border-left: 3px solid rgba(148,163,184,0.4);
    padding: 2px 12px;
    color: #475569;
    margin: 8px 0;
}
.gp-msg-body h1, .gp-msg-body h2, .gp-msg-body h3 { font-weight: 700; margin: 12px 0 6px; }
.gp-msg-body h2 { font-size: 16px; }
.gp-msg-body h3 { font-size: 14px; }

/* ─── AI Tutor mesaj baloncuğu mount animasyonu ─── */
@keyframes ai-bubble-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ai-bubble-anim { animation: ai-bubble-in 220ms ease-out both; }

/* Dots fade out, ilk token gelirken */
@keyframes ai-dots-fade {
    0%, 80% { opacity: 0.7; }
    100% { opacity: 1; }
}
.ai-dots-pulse { animation: ai-dots-fade 1.2s infinite ease-in-out; }

/* ─── AI Tutor floating widget — TAM TANIM (Tailwind purge / extension override'dan bağımsız) ─── */

/* FAB: floating action button */
.ai-tutor-fab {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 9999;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 0 4px rgb(var(--md-color-primary) / 0.2),
                0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: transform 150ms ease;
}
.ai-tutor-fab:hover { transform: scale(1.05); }
.ai-tutor-fab:active { transform: scale(0.95); }
@media (min-width: 1024px) {
    .ai-tutor-fab { right: 1.5rem; bottom: 1.5rem; }
}
/* Learning layout (ünite/quiz): alt footer var, üstünde dur */
body[data-learning-mode='1'] .ai-tutor-fab { bottom: 5rem; }
@media (min-width: 1024px) {
    body[data-learning-mode='1'] .ai-tutor-fab { bottom: 5.5rem; }
}

/* Unread badge: FAB üstünde sağ köşe */
.ai-tutor-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3125rem;
    border-radius: 9999px;
    background: #ba1a1a;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    pointer-events: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Drawer: chat penceresi — div + opacity toggle */
.ai-tutor-drawer {
    position: fixed;
    z-index: 9998;
    background: #ffffff;
    border: 1px solid rgba(188, 201, 198, 0.4);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
    pointer-events: none;
}
.ai-tutor-drawer.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
@media (min-width: 1024px) {
    .ai-tutor-drawer {
        right: 1.5rem;
        bottom: 1.5rem;
        width: 420px;
        height: 600px;
        border-radius: 1rem;
    }
}
@media (max-width: 1023px) {
    .ai-tutor-drawer {
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        top: 50%;
        width: calc(100% - 16px);
        max-width: 520px;
        height: min(72vh, 620px);
        border-radius: 18px;
        padding-top: 14px;
    }
    .ai-tutor-drawer::before {
        content: '';
        position: absolute;
        top: 6px; left: 50%;
        transform: translateX(-50%);
        width: 36px; height: 4px;
        border-radius: 2px;
        background: rgb(var(--md-color-outline-variant, 226 232 240));
        z-index: 10;
        pointer-events: none;
    }
}

/* Backdrop — contain: layout style ile iOS Safari klavye davranışından izole */
.ai-tutor-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
    pointer-events: none;
}
.ai-tutor-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
@media (min-width: 1024px) {
    .ai-tutor-backdrop { display: none !important; }
}
@media (max-width: 1023px) {
    .ai-tutor-drawer {
        width: calc(100% - 16px);
        max-width: 520px;
        height: min(72vh, 620px);
        border-radius: 18px;
        padding-top: 14px;
    }
    .ai-tutor-drawer::before {
        content: '';
        position: absolute;
        top: 6px; left: 50%;
        transform: translateX(-50%);
        width: 36px; height: 4px;
        border-radius: 2px;
        background: rgb(var(--md-color-outline-variant, 226 232 240));
        z-index: 10;
        pointer-events: none;
    }
}

/* ═══ GE Mobile genel altyapısı (gp-mobile-viewport.js ile beraber) ═══ */

/* Bottom sheet — alta yapışık, klavye açılınca üstüne kayar */
@media (max-width: 1023px) {
    .gp-mobile-sheet {
        position: fixed;
        bottom: calc(8px + max(env(safe-area-inset-bottom, 0px), var(--gp-keyboard-h, 0px))) !important;
        max-height: calc(100vh - 16px - max(env(safe-area-inset-bottom, 0px), var(--gp-keyboard-h, 0px))) !important;
        transition: bottom .2s ease, max-height .2s ease;
        overscroll-behavior: contain;
    }
}

/* Modal — ekran ortası + visualViewport tabanlı klavye-aware shift (exact, fallback YOK) */
@media (max-width: 1023px) {
    .gp-mobile-modal {
        position: fixed;
        top: 50% !important;
        bottom: auto !important;
        left: 50% !important;
        right: auto !important;
        /* Klavye yokken normal merkez. Klavye açılınca yarı yüksekliği kadar yukarı kayar. */
        transform: translate(-50%, calc(-50% - var(--gp-keyboard-h, 0px) / 2)) !important;
        max-height: calc(100vh - 32px - var(--gp-keyboard-h, 0px)) !important;
        transition: transform .2s ease, max-height .2s ease;
        overscroll-behavior: contain;
    }
}

/* Backdrop — full screen */
.gp-mobile-backdrop {
    height: 100vh;
}

/* Body scroll lock helper — JS GpScrollLock.acquire/release ile birlikte */
html.gp-scroll-locked {
    overflow: hidden !important;
}
html.gp-scroll-locked body {
    overscroll-behavior: none;
}

body[data-learning-mode='1'] .ai-tutor-drawer { bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) {
    body[data-learning-mode='1'] .ai-tutor-drawer { bottom: 5rem; }
}

/* ─── AI Tutor inline quiz — hover state ─── */
.ai-tutor-quiz-opt:not([disabled]):hover {
    background: rgba(215, 0, 64, 0.04) !important;
    border-color: rgba(215, 0, 64, 0.4) !important;
    transform: translateX(2px);
}
.ai-tutor-quiz-opt:not([disabled]):hover .ai-tutor-quiz-letter {
    background: rgb(var(--md-color-primary)) !important;
    color: white !important;
}
.ai-tutor-quiz-opt {
    transition: all 150ms ease;
}

/* ─── AI Tutor inline quiz — premium tasarım ─── */

.ai-tutor-quiz-card {
    margin: 4px 0;
    display: flex; flex-direction: column;
    gap: 10px;
    position: relative;
}
.ai-tutor-quiz-hint {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px; height: 30px;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgb(var(--md-color-surface-container, 241 245 249));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    border-radius: 50%;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .15s;
    z-index: 2;
}
.ai-tutor-quiz-hint:hover {
    background: rgb(var(--md-color-primary) / 0.10);
    color: rgb(var(--md-color-primary));
    border-color: rgb(var(--md-color-primary) / 0.45);
    transform: translateY(-1px);
}
/* Hint button quiz card sağ üst → quiz soru başında padding sağa */
.ai-tutor-quiz-card .ai-tutor-quiz-q {
    padding-right: 40px;
}
.ai-tutor-quiz-q {
    font-size: 14.5px;
    font-weight: 700;
    color: rgb(var(--md-color-on-surface, 30 41 59));
    line-height: 1.4;
    letter-spacing: -0.005em;
}
.ai-tutor-quiz-opts {
    display: flex; flex-direction: column;
    gap: 7px;
}
.ai-tutor-quiz-opt {
    display: flex; align-items: center;
    gap: 11px;
    width: 100%;
    text-align: left;
    padding: 11px 14px;
    background: rgb(var(--md-color-surface, 255 255 255));
    border: 1.5px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.6);
    border-radius: 12px;
    font-size: 13.5px;
    color: rgb(var(--md-color-on-surface, 30 41 59));
    cursor: pointer;
    transition: border-color .18s, background .18s, transform .18s;
    line-height: 1.4;
}
.ai-tutor-quiz-letter {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgb(var(--md-color-surface-container, 241 245 249));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px;
    transition: background .18s, color .18s;
    letter-spacing: 0;
}
.ai-tutor-quiz-text {
    flex: 1;
}
.ai-tutor-quiz-mark {
    flex-shrink: 0;
    width: 20px; height: 20px;
    opacity: 0;
    display: flex; align-items: center; justify-content: center;
    transition: opacity .2s;
    font-size: 17px;
    font-weight: 900;
}

/* Hover */
.ai-tutor-quiz-opt:not([disabled]):hover {
    border-color: rgb(var(--md-color-primary) / 0.55);
    background: rgb(var(--md-color-primary) / 0.04);
    transform: translateY(-1px);
}
.ai-tutor-quiz-opt:not([disabled]):hover .ai-tutor-quiz-letter {
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary));
}

/* Doğru cevap (yeşil — success semantics) */
.ai-tutor-quiz-opt.is-correct {
    background: rgb(16 185 129 / 0.07);
    border-color: rgb(16 185 129 / 0.5);
}
.ai-tutor-quiz-opt.is-correct .ai-tutor-quiz-letter {
    background: rgb(16 185 129);
    color: white;
}
.ai-tutor-quiz-opt.is-correct .ai-tutor-quiz-mark {
    opacity: 1;
    color: rgb(16 185 129);
}
.ai-tutor-quiz-opt.is-correct .ai-tutor-quiz-mark::before {
    content: '✓';
}

/* Yanlış (kullanıcı seçimi) */
.ai-tutor-quiz-opt.is-wrong {
    background: rgb(239 68 68 / 0.05);
    border-color: rgb(239 68 68 / 0.45);
}
.ai-tutor-quiz-opt.is-wrong .ai-tutor-quiz-letter {
    background: rgb(239 68 68);
    color: white;
}
.ai-tutor-quiz-opt.is-wrong .ai-tutor-quiz-mark {
    opacity: 1;
    color: rgb(239 68 68);
}
.ai-tutor-quiz-opt.is-wrong .ai-tutor-quiz-mark::before {
    content: '✗';
}

/* Soluk (cevaplanmış değil bu seçenek) */
.ai-tutor-quiz-opt.is-faded {
    opacity: 0.4;
}
.ai-tutor-quiz-opt[disabled] {
    cursor: default;
}

/* Feedback panel */
.ai-tutor-quiz-fb {
    display: none;
    margin-top: 4px;
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.55;
    animation: ai-fade-rise .25s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-tutor-quiz-fb.is-correct,
.ai-tutor-quiz-fb.is-wrong { display: block; }

.ai-tutor-quiz-fb.is-correct {
    background: rgb(16 185 129 / 0.06);
    border: 1px solid rgb(16 185 129 / 0.25);
    color: rgb(6 95 70);
}
.ai-tutor-quiz-fb.is-wrong {
    background: rgb(239 68 68 / 0.05);
    border: 1px solid rgb(239 68 68 / 0.22);
    color: rgb(127 29 29);
}
.ai-tutor-quiz-fb-label {
    display: inline-block;
    font-weight: 800;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    margin-right: 6px;
    padding: 0.0625rem 0.4rem;
    border-radius: 0.25rem;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

@keyframes ai-tutor-quiz-fb-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Unit section AI ikonu + mini menü ─── */
.gp-section-ai-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 4px;
    height: 30px;
    padding: 0 9px;
    background: rgb(248 250 252); /* slate-50 */
    border: 1px solid rgb(226 232 240); /* slate-200 */
    color: rgb(100 116 139); /* slate-500 */
    opacity: 0.65;
    cursor: pointer;
    border-radius: 8px;
    transition: opacity .18s ease, background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
    flex-shrink: 0;
    z-index: 5;
}
/* Buton üstünde mouse → tam belirgin (tıklama daveti) */
.gp-section-ai-btn:hover {
    background: rgb(241 245 249); /* slate-100 */
    border-color: rgb(148 163 184); /* slate-400 */
    color: rgb(15 23 42); /* slate-900 */
    opacity: 1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);
}
.gp-section-ai-btn svg {
    width: 15px; height: 15px;
    transition: transform .18s ease;
}
.gp-section-ai-btn:hover svg:first-child {
    transform: translateY(-1.5px);
}
@media (max-width: 1023px) {
    .gp-section-ai-btn { top: 8px; right: 8px; }
}

.gp-section-ai-menu {
    position: absolute;
    z-index: 10001; /* drawer (9998) ve FAB (9999) üstünde olsun */
    display: none;
    flex-direction: column;
    min-width: 200px;
    background: rgb(var(--md-color-surface, 255 255 255));
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    border-radius: 12px;
    box-shadow: 0 18px 44px -12px rgba(15, 23, 42, 0.18), 0 4px 12px -4px rgba(15, 23, 42, 0.08);
    padding: 5px;
    animation: gp-section-ai-in 160ms cubic-bezier(0.4, 0, 0.2, 1);
}
.gp-section-ai-menu.is-open { display: flex; }
.gp-section-ai-menu button {
    display: flex; align-items: center;
    width: 100%; text-align: left;
    padding: 8px 11px;
    background: transparent; border: 0; border-radius: 7px;
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: background .14s, color .14s;
    font-family: inherit;
}
.gp-section-ai-menu button:hover {
    background: rgb(var(--md-color-primary) / 0.08);
    color: rgb(var(--md-color-primary));
}
@keyframes gp-section-ai-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Section AI menu — ikon + label gap */
.gp-section-ai-menu button {
    gap: 9px;
}
.gp-section-ai-menu-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: rgb(var(--md-color-primary));
}
.gp-section-ai-menu button:hover .gp-section-ai-menu-icon {
    color: rgb(var(--md-color-primary));
}

/* ─── AI Tek cümle özet — doğal mesaj içinde, küçük rozet + büyük metin ─── */
.ai-tldr-poster {
    display: flex; flex-direction: column; gap: 8px;
    margin: 4px 0;
}
.ai-tldr-badge {
    display: inline-flex; align-items: center;
    gap: 5px;
    align-self: flex-start;
    padding: 4px 10px 4px 8px;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary));
    font-size: 9px; font-weight: 800;
    letter-spacing: 0.10em; text-transform: uppercase;
    border-radius: 999px;
}
.ai-tldr-text {
    font-size: 18px; font-weight: 600;
    color: rgb(var(--md-color-on-surface, 30 41 59));
    line-height: 1.55;
    letter-spacing: 0.005em;
}
.ai-tldr-text strong {
    color: rgb(var(--md-color-primary));
    font-weight: 800;
}
.ai-tldr-save {
    align-self: flex-start;
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 11px; font-weight: 700;
    background: rgb(248 250 252); /* slate-50 */
    color: rgb(51 65 85); /* slate-700 */
    border: 1px solid rgb(203 213 225); /* slate-300 */
    border-radius: 999px;
    cursor: pointer;
    transition: background .14s, border-color .14s, color .14s, transform .14s;
    display: inline-flex; align-items: center; gap: 6px;
    letter-spacing: 0.02em;
}
.ai-tldr-save:hover {
    background: rgb(241 245 249); /* slate-100 */
    border-color: rgb(148 163 184); /* slate-400 */
    color: rgb(15 23 42); /* slate-900 */
    transform: translateY(-1px);
}
.ai-tldr-save-icon {
    width: 13px; height: 13px;
    flex-shrink: 0;
}

/* ─── AI GLOSS flashcard — çevirilebilir terim kartları ─── */

/* ─── User mesajı uzun olunca daralt + fade ─── */
.ai-user-bubble-collapsed {
    max-height: 350px;
    overflow: hidden;
}
.ai-user-bubble-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 70px;
    background: linear-gradient(to top, rgb(var(--md-color-primary)) 30%, transparent);
    pointer-events: none;
    border-radius: 0 0 1rem 1rem;
}

/* Devamını gör / Daralt — mesaj baloncuğunun İÇİNDE, alt-merkez, gradient üzerinde */
.ai-bubble-more-btn {
    opacity: 0.85;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    padding: 4px 14px;
    font-size: 11px; font-weight: 700;
    background: rgb(var(--md-color-on-primary, 255 255 255));
    color: rgb(var(--md-color-primary));
    border: 0;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
    cursor: pointer;
    transition: transform .14s, box-shadow .14s;
    letter-spacing: 0.02em;
}
.ai-bubble-more-btn:hover {
    transform: translateX(-50%) translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.26);
}
/* Genişletilmiş halde buton mesajın altına çıkar (absolute kalkar) */
.ai-bubble-more-btn.is-expanded {
    position: relative;
    bottom: auto; left: auto;
    transform: none;
    margin: 8px auto 0;
    display: block;
    background: rgb(var(--md-color-primary) / 0.15);
    color: rgb(var(--md-color-on-primary));
    box-shadow: none;
}

/* ─── Chat scroll-to-bottom buton (sağ-alt floating) ─── */
.ai-scroll-bottom-btn {
    position: absolute;
    bottom: 88px;
    right: 20px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary));
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    transition: transform .14s, box-shadow .14s;
    animation: ai-scroll-btn-in 200ms ease-out;
}
.ai-scroll-bottom-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
}
@keyframes ai-scroll-btn-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* AI Tutor — sınıfa girince rozet (boş bucket'ta gösterilir) */
.ai-classroom-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: rgb(var(--md-color-primary) / 0.08);
    color: rgb(var(--md-color-primary));
    border: 1px solid rgb(var(--md-color-primary) / 0.20);
}

/* AI Tutor — cross-bucket hint banner (başka kursun sohbeti açık) */
.ai-cross-bucket-hint {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px 14px;
    background: rgb(var(--md-color-primary) / 0.06);
    border-bottom: 1px solid rgb(var(--md-color-primary) / 0.15);
    color: rgb(var(--md-color-primary));
    font-size: 12px;
    font-weight: 500;
}
.ai-cross-bucket-hint-text {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.ai-cross-bucket-hint-text span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ai-cross-bucket-hint strong {
    font-weight: 700;
}
.ai-cross-bucket-hint-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary));
    border-radius: 999px;
    cursor: pointer;
    transition: opacity .14s, transform .14s;
    align-self: flex-start;
    border: 0;
}
.ai-cross-bucket-hint-text span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
}
.ai-cross-bucket-hint-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* Stream sırasında yarım marker placeholder */
/* Placeholder kaldırıldı, sadece final kart fade-in kullanır */
.ai-marker-loading { display: none; }
/* Marker kartları mount olunca smooth fade+slide-up */
/* Segment kart fade-in — yeni veya cached fark etmez, hep smooth */
.ai-segment-mount > .ai-tldr-poster,
.ai-segment-mount > 
@keyframes ai-card-appear {
    from { 
        opacity: 0; 
        transform: translateY(10px) scale(0.96);
        filter: blur(3px);
    }
    to   { 
        opacity: 1; 
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}
@keyframes ai-marker-fadein {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes ai-marker-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.ai-marker-dots {
    display: inline-block;
    animation: ai-marker-pulse 1.4s infinite;
}
@keyframes ai-marker-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Empty assistant message — küçük typing indicator (bubble flash önle) */
.ai-typing-mini {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    border-radius: 16px 16px 16px 4px;
    animation: ai-bubble-fadein-anim .2s ease-out;
}
.ai-typing-mini-label {
    font-size: 12px;
    font-weight: 600;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    letter-spacing: 0.005em;
}
/* Bot mesaj bubble — content geldiğinde smooth fade-in */
.ai-bubble-fadein {
    animation: ai-fade-rise .25s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes ai-fade-rise {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ai-bubble-fadein-anim {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* Anladım/Daha anlat ack butonları — mount fade-in (blink önle) */
.ai-ack-fadein {
    animation: ai-ack-appear .28s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes ai-ack-appear {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ai-ack-appear {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Drawer mount class — animation YOK (sayfa yenilenince blink etmesin) */
/* İlk yüklemede tek seferlik liste fade-in (toplu, mesaj başına değil) */
.ai-drawer-mounted {
    animation: ai-drawer-mount .22s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes ai-drawer-mount {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Cache restore'dan gelen mesajlar için animasyon iptal — blink önle */
.ai-bubble-fadein[data-from-cache="true"] {
    animation: none !important;
}
.ai-segment-static > *,
.ai-segment-static .ai-tutor-quiz-fb,
.ai-segment-static .ai-tutor-quiz-fb-link {
    animation: none !important;
}

.ai-gloss-poster {
    display: flex; flex-direction: column; gap: 10px;
    margin: 4px 0;
}
.ai-gloss-badge {
    display: inline-flex; align-items: center;
    gap: 5px;
    align-self: flex-start;
    padding: 4px 10px 4px 8px;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary));
    font-size: 9px; font-weight: 800;
    letter-spacing: 0.10em; text-transform: uppercase;
    border-radius: 999px;
}
.ai-marker-badge-icon {
    width: 11px; height: 11px;
    flex-shrink: 0;
}
.ai-gloss-list {
    display: flex; flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}
.ai-gloss-item {
    padding-bottom: 14px;
    border-bottom: 1.5px dotted rgb(var(--md-color-outline, 148 163 184) / 0.6);
}
.ai-gloss-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.ai-gloss-term {
    font-size: 16px;
    font-weight: 800;
    color: rgb(var(--md-color-primary));
    line-height: 1.25;
    margin-bottom: 6px;
    letter-spacing: -0.012em;
    display: flex;
    align-items: center;
    gap: 7px;
}
.ai-gloss-term::before {
    content: "›";
    color: rgb(var(--md-color-primary));
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}
.ai-gloss-def {
    font-size: 13px;
    color: rgb(var(--md-color-on-surface) / 0.82);
    line-height: 1.55;
    padding-left: 17px;
}
.ai-gloss-def strong {
    color: rgb(var(--md-color-primary));
    font-weight: 700;
}

.ai-tutor-quiz-badge {
    display: inline-flex; align-items: center;
    gap: 5px;
    align-self: flex-start;
    padding: 4px 10px 4px 8px;
    margin-bottom: 8px;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary));
    font-size: 9px; font-weight: 800;
    letter-spacing: 0.10em; text-transform: uppercase;
    border-radius: 999px;
}

/* Mesaj seviyesi rozet — tüm marker mesajlarında üstte gösterilir */
.ai-msg-badge-wrap {
    display: flex; align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    position: relative;
}
.ai-msg-badge {
    display: inline-flex; align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    margin-bottom: 12px;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary));
    font-size: 9px; font-weight: 800;
    letter-spacing: 0.10em; text-transform: uppercase;
    border-radius: 999px;
}
.ai-msg-badge-hint {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    padding: 0;
    background: rgb(var(--md-color-surface-container, 241 245 249));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    border-radius: 50%;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.ai-msg-badge-hint:hover {
    background: rgb(var(--md-color-primary) / 0.10);
    color: rgb(var(--md-color-primary));
    border-color: rgb(var(--md-color-primary) / 0.40);
}
.ai-msg-hint-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    max-width: 240px;
    padding: 10px 13px;
    background: rgb(var(--md-color-inverse-surface, 30 41 59));
    color: rgb(var(--md-color-inverse-on-surface, 248 250 252));
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
    font-weight: 500;
    border-radius: 10px;
    box-shadow: 0 12px 28px -8px rgba(15, 23, 42, 0.30), 0 4px 12px -4px rgba(15, 23, 42, 0.15);
    z-index: 20;
    animation: ai-fade-rise .18s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: text;
    white-space: normal;
}
.ai-msg-hint-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 11px;
    width: 10px; height: 10px;
    background: rgb(var(--md-color-inverse-surface, 30 41 59));
    transform: rotate(45deg);
}

/* Quiz feedback — ünite section linki (feedback rengiyle uyumlu) */
.ai-tutor-quiz-fb-link {
    display: flex; align-items: center;
    margin-top: 10px;
    padding: 5px 10px;
    background: rgb(255 255 255 / 0.6);
    font-size: 11px; font-weight: 700;
    border-radius: 999px;
    text-decoration: none;
    transition: background .15s, border-color .15s;
    width: fit-content;
}
.ai-tutor-quiz-fb.is-correct .ai-tutor-quiz-fb-link {
    color: rgb(16 185 129);
    border: 1px solid rgb(16 185 129 / 0.40);
}
.ai-tutor-quiz-fb.is-correct .ai-tutor-quiz-fb-link:hover {
    background: rgb(16 185 129 / 0.10);
    border-color: rgb(16 185 129 / 0.65);
}
.ai-tutor-quiz-fb.is-wrong .ai-tutor-quiz-fb-link {
    color: rgb(239 68 68);
    border: 1px solid rgb(239 68 68 / 0.40);
}
.ai-tutor-quiz-fb.is-wrong .ai-tutor-quiz-fb-link:hover {
    background: rgb(239 68 68 / 0.10);
    border-color: rgb(239 68 68 / 0.65);
}

/* Section'a scroll sonrası tek pulse yumuşak highlight (nötr cool slate) */
.ai-section-flash {
    animation: ai-section-flash-anim 1.8s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 10px;
}
@keyframes ai-section-flash-anim {
    0%   { background-color: transparent; box-shadow: 0 0 0 0 rgb(100 116 139 / 0); }
    25%  { background-color: rgb(100 116 139 / 0.10); box-shadow: 0 0 0 6px rgb(100 116 139 / 0.18); }
    100% { background-color: transparent; box-shadow: 0 0 0 0 rgb(100 116 139 / 0); }
}

/* AI Tutor — quick tools button (input solu) */
.ai-tools-btn {
    width: 40px; height: 40px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    border-radius: 12px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.ai-tools-btn:hover {
    background: rgb(var(--md-color-primary) / 0.08);
    color: rgb(var(--md-color-primary));
    border-color: rgb(var(--md-color-primary) / 0.40);
}
.ai-tools-btn.is-open {
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary));
    border-color: rgb(var(--md-color-primary));
}

.ai-tools-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: rgb(var(--md-color-surface, 255 255 255));
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    border-radius: 12px;
    box-shadow: 0 14px 32px -10px rgba(15, 23, 42, 0.20), 0 4px 12px -4px rgba(15, 23, 42, 0.10);
    padding: 5px;
    z-index: 30;
    animation: ai-fade-rise .18s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ai-tools-menu button {
    display: flex; align-items: center;
    gap: 9px;
    padding: 8px 11px;
    background: transparent;
    border: 0;
    border-radius: 7px;
    text-align: left;
    cursor: pointer;
    font-size: 13px; font-weight: 500;
    color: rgb(var(--md-color-on-surface, 30 41 59));
    transition: background .12s, color .12s;
}
.ai-tools-menu button:hover {
    background: rgb(var(--md-color-primary) / 0.08);
    color: rgb(var(--md-color-primary));
}
.ai-tools-menu button svg {
    flex-shrink: 0;
    opacity: 0.7;
}
.ai-tools-menu button:hover svg {
    opacity: 1;
}

.ai-scroll-bottom-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary));
    font-size: 10px;
    font-weight: 800;
    border-radius: 999px;
    border: 2px solid rgb(var(--md-color-surface, 255 255 255));
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

/* AI Tutor — MISTAKES warm card + pill labels + auto-bold */

/* HATA-DOĞRUSU geçişi: DOĞRUSU pill HATA metninden 10px ile ayrılır (madde-içi nefes) */

/* AI Tutor — Notlarıma ekle butonu (GLOSS + MISTAKES paylaşır) */
.ai-marker-save {
    align-self: flex-start;
    margin-top: 12px;
    padding: 6px 12px;
    font-size: 11px; font-weight: 700;
    background: rgb(248 250 252);
    color: rgb(51 65 85);
    border: 1px solid rgb(203 213 225);
    border-radius: 999px;
    cursor: pointer;
    transition: background .14s, border-color .14s, color .14s, transform .14s;
    display: inline-flex; align-items: center; gap: 6px;
    letter-spacing: 0.02em;
}
.ai-marker-save:hover {
    background: rgb(241 245 249);
    border-color: rgb(148 163 184);
    color: rgb(15 23 42);
    transform: translateY(-1px);
}
.ai-marker-save-icon {
    width: 13px; height: 13px;
    flex-shrink: 0;
}

/* AI Tutor — MISTAKES editorial newspaper style */
.ai-mistakes-poster {
    display: flex; flex-direction: column;
    margin: 4px 0;
}
.ai-mistakes-list {
    display: flex; flex-direction: column;
    margin-top: 8px;
}
.ai-mistakes-item {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid rgb(var(--md-color-outline, 148 163 184) / 0.30);
}
.ai-mistakes-item:first-child { padding-top: 4px; }
.ai-mistakes-item:last-child { border-bottom: 0; padding-bottom: 4px; }
.ai-mistakes-num {
    font-family: ui-monospace, SF Mono, Cascadia Mono, Menlo, monospace;
    font-size: 12px;
    font-weight: 800;
    color: rgb(var(--md-color-primary));
    letter-spacing: 0.15em;
    padding-top: 4px;
    min-width: 22px;
}
.ai-mistakes-content {
    display: flex; flex-direction: column;
    gap: 4px;
}
.ai-mistakes-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    align-self: flex-start;
}
.ai-mistakes-label.wrong {
    color: rgb(239 68 68);  /* red-500 */
}
.ai-mistakes-label.right {
    color: rgb(16 185 129);  /* emerald-500 */
}
.ai-mistakes-label svg {
    flex-shrink: 0;
}
.ai-mistakes-wrong-text {
    font-size: 13.5px;
    font-style: italic;
    color: rgb(var(--md-color-on-surface) / 0.7);
    line-height: 1.55;
    margin-bottom: 6px;
}
.ai-mistakes-wrong-text strong {
    color: rgb(var(--md-color-on-surface));
    font-weight: 700;
    font-style: italic;
}
.ai-mistakes-arrow {
    display: flex; justify-content: center;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105) / 0.55);
    margin: 4px 0;
    width: 32px;
}
.ai-mistakes-right-text {
    font-size: 13.5px;
    font-weight: 500;
    color: rgb(var(--md-color-on-surface));
    line-height: 1.55;
    letter-spacing: -0.005em;
}
.ai-mistakes-right-text strong {
    color: rgb(var(--md-color-primary));
    font-weight: 800;
}

/* AI Tutor — STEPS timeline (sol dikey çizgi + dot + içerik) */
.ai-steps-poster {
    display: flex; flex-direction: column;
    margin: 4px 0;
}
.ai-steps-list {
    display: flex; flex-direction: column;
    margin-top: 10px;
}
.ai-steps-item {
    display: grid;
    grid-template-columns: 28px 1fr;
    column-gap: 14px;
    padding-bottom: 18px;
    position: relative;
}
.ai-steps-item:last-child {
    padding-bottom: 4px;
}
.ai-steps-marker {
    position: relative;
    display: flex; justify-content: center;
    padding-top: 6px;
}
.ai-steps-marker::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    bottom: -18px;
    background: rgb(var(--md-color-outline-variant, 226 232 240) / 0.7);
}
.ai-steps-item.is-last .ai-steps-marker::after {
    display: none;
}
.ai-steps-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgb(var(--md-color-primary));
    box-shadow: 0 0 0 4px rgb(var(--md-color-primary) / 0.12);
    z-index: 1;
    position: relative;
}
.ai-steps-content {
    display: flex; flex-direction: column;
    gap: 4px;
}
.ai-steps-head {
    display: flex; align-items: baseline;
    gap: 10px;
}
.ai-steps-num {
    font-family: ui-monospace, SF Mono, Cascadia Mono, Menlo, monospace;
    font-size: 11px;
    font-weight: 800;
    color: rgb(var(--md-color-primary));
    letter-spacing: 0.15em;
    flex-shrink: 0;
}
.ai-steps-title {
    font-size: 14px;
    font-weight: 700;
    color: rgb(var(--md-color-on-surface));
    line-height: 1.3;
    letter-spacing: -0.005em;
}
.ai-steps-title strong {
    color: rgb(var(--md-color-primary));
    font-weight: 800;
}
.ai-steps-detail {
    font-size: 13px;
    color: rgb(var(--md-color-on-surface) / 0.82);
    line-height: 1.55;
    padding-top: 2px;
}
.ai-steps-detail strong {
    color: rgb(var(--md-color-primary));
    font-weight: 700;
}

/* AI Tutor — EXAMPLES anekdot kartları (nötr bg + Lucide ikon) */
.ai-examples-poster {
    display: flex; flex-direction: column;
    margin: 4px 0;
}
.ai-examples-list {
    display: flex; flex-direction: column;
    gap: 14px;
    margin-top: 12px;
    padding: 6px 4px;
}
.ai-examples-card {
    display: flex; flex-direction: column;
    gap: 5px;
    padding: 14px 16px;
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.7);
    border-radius: 12px 14px 10px 16px;
    box-shadow: 0 4px 12px -6px rgba(15, 23, 42, 0.10), 0 1px 3px -1px rgba(15, 23, 42, 0.06);
    transition: transform .18s, box-shadow .18s;
}
.ai-examples-card.tilt-left { transform: rotate(-0.6deg); }
.ai-examples-card.tilt-right { transform: rotate(0.6deg); margin-left: 14px; }
.ai-examples-card:hover {
    transform: rotate(0deg) translateY(-2px);
    box-shadow: 0 8px 18px -6px rgba(15, 23, 42, 0.15), 0 2px 6px -1px rgba(15, 23, 42, 0.08);
}
.ai-examples-title {
    display: inline-flex; align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: rgb(var(--md-color-on-surface));
    letter-spacing: 0.10em;
    text-transform: uppercase;
}
.ai-examples-title svg {
    color: rgb(var(--md-color-primary));
    flex-shrink: 0;
}
.ai-examples-title strong {
    color: rgb(var(--md-color-primary));
}
.ai-examples-text {
    font-size: 13px;
    font-style: italic;
    color: rgb(var(--md-color-on-surface) / 0.82);
    line-height: 1.55;
}
.ai-examples-text strong {
    color: rgb(var(--md-color-primary));
    font-weight: 700;
    font-style: italic;
}

/* AI Tutor — VS karşılaştırma (madde-madde, axis + A/B) */
.ai-vs-poster {
    display: flex; flex-direction: column;
    gap: 14px;
    margin: 4px 0;
}

.ai-vs-rows {
    display: flex; flex-direction: column;
    gap: 14px;
}
.ai-vs-row {
    display: flex; flex-direction: column;
    gap: 8px;
}
.ai-vs-axis {
    font-size: 11px;
    font-weight: 800;
    color: rgb(var(--md-color-primary));
    letter-spacing: 0.10em;
    text-transform: uppercase;
}
.ai-vs-row-body {
    display: flex; flex-direction: column;
    gap: 6px;
}
.ai-vs-cell {
    display: flex; flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: rgb(var(--md-color-on-surface) / 0.85);
}
.ai-vs-cell-head {
    display: inline-flex; align-items: center;
    gap: 6px;
}
.ai-vs-cell-name {
    font-size: 9.5px;
    font-weight: 800;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105) / 0.85);
    letter-spacing: 0.10em;
    text-transform: uppercase;
}
.ai-vs-cell-value {
    font-size: 13px;
    line-height: 1.5;
    color: rgb(var(--md-color-on-surface));
}
.ai-vs-cell.side-a {
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
}
.ai-vs-cell.side-b {
    background: rgb(var(--md-color-primary) / 0.06);
}
.ai-vs-cell-letter {
    flex-shrink: 0;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: ui-monospace, SF Mono, Menlo, monospace;
    font-size: 9px;
    font-weight: 800;
    color: white;
}
.ai-vs-cell.side-a .ai-vs-cell-letter {
    background: rgb(var(--md-color-on-surface-variant, 71 85 105));
}
.ai-vs-cell.side-b .ai-vs-cell-letter {
    background: rgb(var(--md-color-primary));
}
.ai-vs-cell strong {
    color: rgb(var(--md-color-primary));
    font-weight: 700;
}


/* === AI Tutor BTN marker button === */
.ai-marker-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    margin: 6px 0;
    border-radius: 12px;
    background: var(--md-color-primary, #9F1239);
    color: var(--md-color-on-primary, #FFFFFF);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: transform 0.12s ease, filter 0.12s ease;
    border: 1px solid transparent;
}
.ai-marker-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    text-decoration: none;
}
.ai-marker-btn:active {
    transform: translateY(0);
    filter: brightness(0.95);
}
.ai-marker-btn-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.ai-marker-btn-icon {
    flex-shrink: 0;
    opacity: 0.95;
}
.ai-marker-btn-title {
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.ai-marker-btn-price {
    flex-shrink: 0;
    padding: 3px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
/* Premium: aynı primary + üst kenarda ince accent çizgi, hafif gradient — taç ikonu zaten ayırt ediyor */
.ai-marker-btn-premium {
    background: linear-gradient(135deg, var(--md-color-primary, #9F1239) 0%, color-mix(in srgb, var(--md-color-primary, #9F1239) 80%, #000) 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 2px 6px rgba(0, 0, 0, 0.08);
}
.ai-marker-btn-premium .ai-marker-btn-price {
    background: rgba(255, 255, 255, 0.22);
}
