/* 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 Gameify modal — selected content mini game ─── */
.gp-gameify-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
}
.gp-gameify-modal.is-open {
    display: block;
}
.gp-gameify-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    backdrop-filter: blur(3px);
}
.gp-gameify-shell {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(920px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 28px));
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    border-radius: 14px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.30);
    overflow: hidden;
}
.gp-gameify-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.75);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
}
.gp-gameify-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: rgb(var(--md-color-primary));
}
.gp-gameify-topbar h2 {
    margin: 2px 0 0;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 850;
    color: rgb(var(--md-color-on-surface, 30 41 59));
}
.gp-gameify-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.gp-gameify-ghost,
.gp-gameify-close,
.gp-gameify-error-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
}
.gp-gameify-ghost,
.gp-gameify-close {
    height: 34px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    border-radius: 8px;
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    cursor: pointer;
}
.gp-gameify-ghost {
    padding: 0 16px;
    font-size: 12.5px;
    font-weight: 750;
}
.gp-gameify-close {
    width: 34px;
    font-size: 22px;
}
.gp-gameify-body {
    padding: 18px 20px 20px;
    overflow: auto;
}
.gp-gameify-picker {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gp-gameify-picker-copy {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
}
.gp-gameify-source {
    max-height: 68px;
    overflow: hidden;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.75);
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 13px;
    line-height: 1.45;
}
.gp-gameify-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.gp-gameify-template {
    min-height: 156px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.gp-gameify-template:hover,
.gp-gameify-template:focus-visible {
    border-color: rgb(var(--md-color-primary) / 0.5);
    background: rgb(var(--md-color-primary) / 0.035);
    box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.35);
    transform: translateY(-1px);
    outline: none;
}
.gp-gameify-template-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 4px;
}
.gp-gameify-template-icon,
.gp-gameify-template-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgb(var(--md-color-primary));
}
.gp-gameify-template-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-primary) / 0.16);
    background: rgb(var(--md-color-primary) / 0.07);
}
.gp-gameify-template-icon svg {
    width: 19px;
    height: 19px;
}
.gp-gameify-template-arrow {
    width: 30px;
    height: 30px;
    margin-left: auto;
    border-radius: 9px;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    opacity: 0.78;
    transition: color .16s ease, background .16s ease, transform .16s ease, opacity .16s ease;
}
.gp-gameify-template-arrow svg {
    width: 15px;
    height: 15px;
}
.gp-gameify-template:hover .gp-gameify-template-arrow,
.gp-gameify-template:focus-visible .gp-gameify-template-arrow {
    color: rgb(var(--md-color-primary));
    background: rgb(var(--md-color-primary) / 0.09);
    opacity: 1;
    transform: translate(1px, -1px);
}
.gp-gameify-template-tag {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgb(var(--md-color-primary) / 0.10);
    color: rgb(var(--md-color-primary));
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}
.gp-gameify-template strong {
    font-size: 16px;
    line-height: 1.25;
}
.gp-gameify-template small {
    font-size: 12.5px;
    line-height: 1.4;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
}
.gp-memory-game {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gp-memory-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.gp-memory-hud > div {
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
}
.gp-memory-hud span {
    display: block;
    font-size: 10px;
    font-weight: 850;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    text-transform: uppercase;
}
.gp-memory-hud strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
    line-height: 1;
    color: rgb(var(--md-color-primary));
}
.gp-memory-instruction {
    margin: 0;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 14px;
    line-height: 1.45;
}
.gp-memory-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.gp-memory-card {
    position: relative;
    width: 100%;
    min-height: 104px;
    aspect-ratio: 1 / 0.78;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    perspective: 800px;
}
.gp-memory-card[disabled] {
    cursor: default;
}
.gp-memory-card-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform .28s ease;
}
.gp-memory-card.is-open .gp-memory-card-inner,
.gp-memory-card.is-matched .gp-memory-card-inner {
    transform: rotateY(180deg);
}
.gp-memory-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    backface-visibility: hidden;
    text-align: center;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
}
.gp-memory-back {
    background: rgb(var(--md-color-primary));
    border-color: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary, 255 255 255));
    font-size: 24px;
}
.gp-memory-front {
    transform: rotateY(180deg);
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    box-shadow: inset 0 0 0 2px rgb(var(--md-color-primary) / 0.10);
}
.gp-memory-card.is-matched .gp-memory-front {
    border-color: rgb(16 185 129 / 0.48);
    background: rgb(16 185 129 / 0.08);
    color: rgb(6 95 70);
}
.gp-memory-feedback {
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}
.gp-memory-finish {
    padding: 14px;
    border-radius: 10px;
    background: rgb(var(--md-color-primary) / 0.08);
    border: 1px solid rgb(var(--md-color-primary) / 0.22);
}
.gp-memory-finish strong,
.gp-memory-finish span {
    display: block;
}
.gp-memory-finish strong {
    color: rgb(var(--md-color-primary));
    font-size: 15px;
    margin-bottom: 3px;
}
.gp-memory-finish span {
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 13px;
}
.gp-hunt-game {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gp-hunt-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.gp-hunt-hud > div {
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
}
.gp-hunt-hud span {
    display: block;
    font-size: 10px;
    font-weight: 850;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    text-transform: uppercase;
}
.gp-hunt-hud strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
    line-height: 1;
    color: rgb(var(--md-color-primary));
}
.gp-hunt-call {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgb(var(--md-color-primary) / 0.18);
    background: rgb(var(--md-color-primary) / 0.055);
}
.gp-hunt-call-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.gp-hunt-call-top span {
    flex: 0 0 auto;
    color: rgb(var(--md-color-primary));
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.gp-hunt-meter {
    flex: 1 1 auto;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(var(--md-color-outline-variant, 226 232 240) / 0.72);
}
.gp-hunt-meter i {
    display: block;
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: rgb(var(--md-color-primary));
    transition: width .22s ease;
}
.gp-hunt-call strong {
    display: block;
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 15px;
    line-height: 1.42;
}
.gp-hunt-board {
    width: min(620px, 100%);
    align-self: center;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.gp-hunt-card {
    position: relative;
    min-height: 106px;
    aspect-ratio: 1 / 0.78;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    text-align: center;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px -22px rgba(15, 23, 42, 0.48);
    transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.gp-hunt-card span {
    display: block;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 850;
    overflow-wrap: anywhere;
}
.gp-hunt-card:not(:disabled):hover {
    border-color: rgb(var(--md-color-primary) / 0.48);
    background: rgb(var(--md-color-primary) / 0.045);
    transform: translateY(-1px);
}
.gp-hunt-card:disabled {
    cursor: default;
}
.gp-hunt-card.is-found {
    border-color: rgb(16 185 129 / 0.46);
    background: rgb(16 185 129 / 0.09);
    color: rgb(6 95 70);
    animation: gp-hunt-pop .28s ease both;
}
.gp-hunt-card.is-found::after {
    content: "✓";
    position: absolute;
    right: 8px;
    top: 7px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgb(16 185 129);
    color: white;
    font-size: 13px;
    font-weight: 950;
}
.gp-hunt-card.is-wrong {
    border-color: rgb(239 68 68 / 0.44);
    background: rgb(239 68 68 / 0.07);
    color: rgb(127 29 29);
    animation: gp-hunt-shake .24s ease both;
}
.gp-hunt-feedback {
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}
.gp-hunt-finish {
    padding: 14px;
    border-radius: 10px;
    background: rgb(16 185 129 / 0.09);
    border: 1px solid rgb(16 185 129 / 0.38);
}
.gp-hunt-finish strong,
.gp-hunt-finish span {
    display: block;
}
.gp-hunt-finish strong {
    color: rgb(6 95 70);
    font-size: 15px;
    margin-bottom: 3px;
}
.gp-hunt-finish span {
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 13px;
}
@keyframes gp-hunt-pop {
    0% { transform: scale(1); }
    55% { transform: scale(1.03); }
    100% { transform: scale(1); }
}
@keyframes gp-hunt-shake {
    0%, 100% { transform: translateX(0); }
    35% { transform: translateX(-3px); }
    70% { transform: translateX(3px); }
}
.gp-decision-game {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gp-decision-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.gp-decision-hud > div {
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
}
.gp-decision-hud span {
    display: block;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}
.gp-decision-hud strong {
    display: block;
    margin-top: 4px;
    color: rgb(var(--md-color-primary));
    font-size: 18px;
    line-height: 1;
}
.gp-decision-stage {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgb(var(--md-color-primary) / 0.18);
    background: rgb(var(--md-color-primary) / 0.055);
}
.gp-decision-stage-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.gp-decision-stage-top span {
    flex: 0 0 auto;
    color: rgb(var(--md-color-primary));
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.gp-decision-meter {
    flex: 1 1 auto;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(var(--md-color-outline-variant, 226 232 240) / 0.72);
}
.gp-decision-meter i {
    display: block;
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: rgb(var(--md-color-primary));
    transition: width .22s ease;
}
.gp-decision-card {
    min-height: 250px;
    padding: 22px;
    border-radius: 14px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.9);
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: center;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.gp-decision-card > strong {
    display: block;
    max-width: 660px;
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 22px;
    font-weight: 850;
    line-height: 1.32;
}
.gp-decision-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 180px));
    gap: 12px;
    width: min(392px, 100%);
}
.gp-decision-choice {
    height: 54px;
    border-radius: 12px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    cursor: pointer;
    font-size: 15px;
    font-weight: 900;
    transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.gp-decision-choice:not(:disabled):hover {
    border-color: rgb(var(--md-color-primary) / 0.5);
    background: rgb(var(--md-color-primary) / 0.045);
    transform: translateY(-1px);
}
.gp-decision-choice.is-answer {
    border-color: rgb(16 185 129 / 0.56);
    background: rgb(16 185 129 / 0.11);
    color: rgb(6 95 70);
}
.gp-decision-choice.is-selected:not(.is-answer) {
    border-color: rgb(239 68 68 / 0.5);
    background: rgb(239 68 68 / 0.08);
    color: rgb(127 29 29);
}
.gp-decision-card.is-correct {
    border-color: rgb(16 185 129 / 0.46);
    background: rgb(16 185 129 / 0.06);
    animation: gp-hunt-pop .28s ease both;
}
.gp-decision-card.is-wrong {
    border-color: rgb(239 68 68 / 0.44);
    background: rgb(239 68 68 / 0.055);
    animation: gp-hunt-shake .24s ease both;
}
.gp-decision-result {
    max-width: 660px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 13px;
    font-weight: 740;
    line-height: 1.45;
}
.gp-decision-next {
    height: 44px;
    min-width: 150px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary, 255 255 255));
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 14px 24px -20px rgba(15, 23, 42, 0.55);
    transition: transform .15s ease, box-shadow .15s ease;
}
.gp-decision-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 28px -22px rgba(15, 23, 42, 0.65);
}
.gp-decision-next[hidden],
.gp-unlock-next[hidden] {
    display: none;
}
.gp-decision-feedback {
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}
.gp-decision-finish {
    padding: 14px;
    border-radius: 10px;
    background: rgb(16 185 129 / 0.09);
    border: 1px solid rgb(16 185 129 / 0.38);
}
.gp-decision-finish strong,
.gp-decision-finish span {
    display: block;
}
.gp-decision-finish strong {
    color: rgb(6 95 70);
    font-size: 15px;
    margin-bottom: 3px;
}
.gp-decision-finish span {
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 13px;
}
.gp-unlock-game {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gp-unlock-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.gp-unlock-hud > div {
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
}
.gp-unlock-hud span {
    display: block;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}
.gp-unlock-hud strong {
    display: block;
    margin-top: 4px;
    color: rgb(var(--md-color-primary));
    font-size: 18px;
    line-height: 1;
}
.gp-unlock-stage {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgb(var(--md-color-primary) / 0.18);
    background: rgb(var(--md-color-primary) / 0.055);
}
.gp-unlock-stage-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.gp-unlock-stage-top span {
    flex: 0 0 auto;
    color: rgb(var(--md-color-primary));
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.gp-unlock-meter {
    flex: 1 1 auto;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(var(--md-color-outline-variant, 226 232 240) / 0.72);
}
.gp-unlock-meter i {
    display: block;
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: rgb(var(--md-color-primary));
    transition: width .22s ease;
}
.gp-unlock-scene {
    min-height: 270px;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.9);
    background: rgb(var(--md-color-surface, 255 255 255));
    box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.55);
    display: grid;
    grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
    align-items: center;
    gap: 24px;
}
.gp-unlock-visual {
    position: relative;
    width: 170px;
    height: 184px;
    justify-self: center;
}
.gp-unlock-shackle {
    position: absolute;
    left: 38px;
    top: 2px;
    width: 94px;
    height: 92px;
    border: 14px solid rgb(var(--md-color-primary));
    border-bottom: 0;
    border-radius: 62px 62px 0 0;
    transform-origin: 22px 88px;
    transition: transform .32s ease, border-color .2s ease;
}
.gp-unlock-body {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 112px;
    border-radius: 18px;
    background: rgb(var(--md-color-primary));
    box-shadow: inset 0 -12px 0 rgb(0 0 0 / 0.08), 0 20px 38px -28px rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, transform .2s ease;
}
.gp-unlock-body b {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgb(var(--md-color-on-primary, 255 255 255));
    color: rgb(var(--md-color-primary));
    font-size: 20px;
    font-weight: 950;
}
.gp-unlock-visual.is-open .gp-unlock-shackle {
    transform: rotate(-22deg) translate(-12px, -4px);
    border-color: rgb(16 185 129);
}
.gp-unlock-visual.is-open .gp-unlock-body {
    background: rgb(16 185 129);
    transform: translateY(-2px);
    animation: gp-hunt-pop .28s ease both;
}
.gp-unlock-visual.is-wrong {
    animation: gp-hunt-shake .24s ease both;
}
.gp-unlock-visual.is-wrong .gp-unlock-shackle {
    border-color: rgb(239 68 68);
}
.gp-unlock-visual.is-wrong .gp-unlock-body {
    background: rgb(239 68 68);
}
.gp-unlock-clue {
    min-width: 0;
    padding: 16px;
    border-radius: 12px;
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.75);
}
.gp-unlock-clue span {
    display: block;
    margin-bottom: 8px;
    color: rgb(var(--md-color-primary));
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.gp-unlock-clue strong {
    display: block;
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 21px;
    font-weight: 850;
    line-height: 1.32;
}
.gp-unlock-keys {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.gp-unlock-key {
    min-height: 62px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.gp-unlock-key:not(:disabled):hover {
    border-color: rgb(var(--md-color-primary) / 0.5);
    background: rgb(var(--md-color-primary) / 0.045);
    transform: translateY(-1px);
}
.gp-unlock-key > span {
    position: relative;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 3px solid rgb(var(--md-color-primary));
    border-radius: 999px;
}
.gp-unlock-key > span::after {
    content: "";
    position: absolute;
    left: 25px;
    top: 11px;
    width: 32px;
    height: 7px;
    border-radius: 999px;
    background: rgb(var(--md-color-primary));
}
.gp-unlock-key > span::before {
    content: "";
    position: absolute;
    left: 48px;
    top: 17px;
    width: 8px;
    height: 10px;
    border-radius: 0 0 2px 2px;
    background: rgb(var(--md-color-primary));
}
.gp-unlock-key strong {
    min-width: 0;
    padding-left: 30px;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.gp-unlock-key.is-answer {
    border-color: rgb(16 185 129 / 0.56);
    background: rgb(16 185 129 / 0.11);
    color: rgb(6 95 70);
}
.gp-unlock-key.is-answer > span,
.gp-unlock-key.is-answer > span::after,
.gp-unlock-key.is-answer > span::before {
    border-color: rgb(16 185 129);
    background: rgb(16 185 129);
}
.gp-unlock-key.is-selected:not(.is-answer) {
    border-color: rgb(239 68 68 / 0.5);
    background: rgb(239 68 68 / 0.08);
    color: rgb(127 29 29);
}
.gp-unlock-key.is-selected:not(.is-answer) > span,
.gp-unlock-key.is-selected:not(.is-answer) > span::after,
.gp-unlock-key.is-selected:not(.is-answer) > span::before {
    border-color: rgb(239 68 68);
    background: rgb(239 68 68);
}
.gp-unlock-result {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 13px;
    font-weight: 740;
    line-height: 1.45;
}
.gp-unlock-next {
    height: 44px;
    min-width: 160px;
    margin: 12px auto 0;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary, 255 255 255));
    cursor: pointer;
    display: block;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 14px 24px -20px rgba(15, 23, 42, 0.55);
}
.gp-unlock-feedback {
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}
.gp-unlock-finish {
    padding: 14px;
    border-radius: 10px;
    background: rgb(16 185 129 / 0.09);
    border: 1px solid rgb(16 185 129 / 0.38);
}
.gp-unlock-finish strong,
.gp-unlock-finish span {
    display: block;
}
.gp-unlock-finish strong {
    color: rgb(6 95 70);
    font-size: 15px;
    margin-bottom: 3px;
}
.gp-unlock-finish span {
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 13px;
}
.gp-scramble-game {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gp-scramble-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.gp-scramble-hud > div {
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
}
.gp-scramble-hud span {
    display: block;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}
.gp-scramble-hud strong {
    display: block;
    margin-top: 4px;
    color: rgb(var(--md-color-primary));
    font-size: 18px;
    line-height: 1;
}
.gp-scramble-stage {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.86);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    transition: border-color .18s ease, background .18s ease;
}
.gp-scramble-stage.is-error {
    border-color: rgb(239 68 68 / 0.45);
    background: rgb(239 68 68 / 0.055);
    animation: gp-hunt-shake .24s ease both;
}
.gp-scramble-stage.is-solved {
    border-color: rgb(16 185 129 / 0.45);
    background:
        radial-gradient(circle at 18% 0%, rgb(16 185 129 / 0.15), transparent 30%),
        rgb(16 185 129 / 0.07);
}
.gp-scramble-stage-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.gp-scramble-stage-top span {
    flex: 0 0 auto;
    color: rgb(var(--md-color-primary));
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.gp-scramble-meter {
    flex: 1 1 auto;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(var(--md-color-outline-variant, 226 232 240) / 0.72);
}
.gp-scramble-meter i {
    display: block;
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: rgb(var(--md-color-primary));
    transition: width .22s ease;
}
.gp-scramble-clue {
    min-height: 92px;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.76);
    background: rgb(var(--md-color-surface, 255 255 255));
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
}
.gp-scramble-clue span {
    color: rgb(var(--md-color-primary));
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.gp-scramble-clue strong {
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 18px;
    font-weight: 850;
    line-height: 1.34;
}
.gp-scramble-word {
    min-height: 76px;
    margin: 18px 0 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 16px;
    row-gap: 10px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.gp-scramble-word::-webkit-scrollbar { height: 4px; }
.gp-scramble-word::-webkit-scrollbar-thumb { background: rgb(var(--md-color-primary) / 0.25); border-radius: 999px; }
.gp-scramble-wordgroup {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.gp-scramble-slot {
    width: clamp(28px, 7vw, 46px);
    height: clamp(36px, 9vw, 54px);
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    cursor: pointer;
    font-size: clamp(15px, 4.4vw, 23px);
    font-weight: 950;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: inset 0 -3px 0 rgb(var(--md-color-outline-variant, 226 232 240) / 0.82);
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.gp-scramble-slot.is-filled {
    border-color: rgb(var(--md-color-primary) / 0.42);
    background: rgb(var(--md-color-surface, 255 255 255));
    box-shadow: inset 0 -3px 0 rgb(var(--md-color-primary) / 0.26), 0 14px 28px -24px rgba(15, 23, 42, 0.8);
}
.gp-scramble-slot.is-locked {
    border-color: rgb(var(--md-color-primary) / 0.5);
    background: rgb(var(--md-color-primary) / 0.08);
    color: rgb(var(--md-color-primary));
}
.gp-scramble-slot.is-solved {
    border-color: rgb(16 185 129 / 0.58);
    background: rgb(16 185 129 / 0.11);
    color: rgb(6 95 70);
    box-shadow: inset 0 -3px 0 rgb(16 185 129 / 0.24), 0 18px 30px -25px rgb(6 95 70 / 0.75);
}
.gp-scramble-space {
    width: 20px;
    height: 54px;
}
.gp-scramble-bank {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    padding: 12px;
    border-radius: 12px;
    background: rgb(var(--md-color-surface, 255 255 255) / 0.76);
    border: 1px dashed rgb(var(--md-color-outline-variant, 226 232 240));
}
.gp-scramble-tile {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-primary) / 0.26);
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-primary));
    cursor: pointer;
    font-size: 20px;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 12px 22px -20px rgba(15, 23, 42, 0.65);
    transition: transform .15s ease, border-color .15s ease, background .15s ease, opacity .15s ease;
}
.gp-scramble-tile:not(:disabled):hover {
    transform: translateY(-2px);
    border-color: rgb(var(--md-color-primary) / 0.52);
    background: rgb(var(--md-color-primary) / 0.065);
}
.gp-scramble-tile.is-used {
    opacity: 0.28;
    transform: scale(0.92);
}
.gp-scramble-tile.is-locked {
    opacity: 0.42;
}
.gp-scramble-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 9px;
}
.gp-scramble-secondary,
.gp-scramble-check,
.gp-scramble-next {
    height: 42px;
    min-width: 112px;
    padding: 0 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
}
.gp-scramble-secondary {
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
}
.gp-scramble-check,
.gp-scramble-next {
    border: 0;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary, 255 255 255));
    box-shadow: 0 14px 24px -20px rgba(15, 23, 42, 0.55);
}
.gp-scramble-secondary:disabled,
.gp-scramble-check:disabled {
    cursor: default;
    opacity: 0.48;
}
.gp-scramble-next[hidden] {
    display: none;
}
.gp-scramble-result {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgb(16 185 129 / 0.09);
    border: 1px solid rgb(16 185 129 / 0.32);
    color: rgb(6 95 70);
    font-size: 13px;
    font-weight: 760;
    line-height: 1.45;
}
.gp-scramble-feedback {
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}
.gp-scramble-finish {
    padding: 14px;
    border-radius: 10px;
    background: rgb(16 185 129 / 0.09);
    border: 1px solid rgb(16 185 129 / 0.38);
}
.gp-scramble-finish strong,
.gp-scramble-finish span {
    display: block;
}
.gp-scramble-finish strong {
    color: rgb(6 95 70);
    font-size: 15px;
    margin-bottom: 3px;
}
.gp-scramble-finish span {
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 13px;
}
.gp-panel-game {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gp-panel-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.gp-panel-hud > div {
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
}
.gp-panel-hud span {
    display: block;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}
.gp-panel-hud strong {
    display: block;
    margin-top: 4px;
    color: rgb(var(--md-color-primary));
    font-size: 18px;
    line-height: 1;
}
.gp-panel-stage {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgb(var(--md-color-primary) / 0.18);
    background: rgb(var(--md-color-primary) / 0.055);
}
.gp-panel-stage-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.gp-panel-stage-top span {
    flex: 0 0 auto;
    color: rgb(var(--md-color-primary));
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.gp-panel-meter {
    flex: 1 1 auto;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(var(--md-color-outline-variant, 226 232 240) / 0.72);
}
.gp-panel-meter i {
    display: block;
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: rgb(var(--md-color-primary));
    transition: width .22s ease;
}
.gp-panel-console {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.9);
    background: linear-gradient(180deg, rgb(var(--md-color-surface, 255 255 255)), rgb(var(--md-color-surface-container-low, 248 250 252)));
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.5), 0 22px 42px -34px rgba(15, 23, 42, 0.62);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.gp-panel-console.is-on {
    border-color: rgb(16 185 129 / 0.52);
    background: linear-gradient(180deg, rgb(16 185 129 / 0.08), rgb(var(--md-color-surface, 255 255 255)));
    box-shadow: inset 0 0 0 1px rgb(16 185 129 / 0.12), 0 24px 46px -34px rgba(15, 23, 42, 0.65);
}
.gp-panel-console.is-error {
    border-color: rgb(239 68 68 / 0.42);
    background: linear-gradient(180deg, rgb(239 68 68 / 0.06), rgb(var(--md-color-surface, 255 255 255)));
    animation: gp-hunt-shake .24s ease both;
}
.gp-panel-screen {
    min-height: 116px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.76);
    background: rgb(var(--md-color-surface, 255 255 255));
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "lights label"
        "lights goal";
    column-gap: 14px;
    align-items: center;
}
.gp-panel-lights {
    grid-area: lights;
    display: grid;
    gap: 8px;
}
.gp-panel-lights i {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: rgb(var(--md-color-outline-variant, 226 232 240));
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08);
}
.gp-panel-console.is-on .gp-panel-lights i {
    background: rgb(16 185 129);
    box-shadow: 0 0 14px rgb(16 185 129 / 0.42);
}
.gp-panel-console.is-error .gp-panel-lights i {
    background: rgb(239 68 68);
    box-shadow: 0 0 14px rgb(239 68 68 / 0.34);
}
.gp-panel-screen > span {
    grid-area: label;
    color: rgb(var(--md-color-primary));
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.gp-panel-screen > strong {
    grid-area: goal;
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 20px;
    font-weight: 850;
    line-height: 1.32;
}
.gp-panel-controls {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.gp-panel-control {
    min-width: 0;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    background: rgb(var(--md-color-surface, 255 255 255));
}
.gp-panel-control > span {
    display: block;
    margin-bottom: 9px;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.gp-panel-options {
    display: grid;
    gap: 7px;
}
.gp-panel-option {
    min-height: 38px;
    padding: 8px 9px;
    border-radius: 9px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    cursor: pointer;
    font-size: 12px;
    font-weight: 780;
    line-height: 1.25;
    overflow-wrap: anywhere;
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.gp-panel-option:not(:disabled):hover {
    border-color: rgb(var(--md-color-primary) / 0.45);
    background: rgb(var(--md-color-primary) / 0.045);
}
.gp-panel-option.is-selected {
    border-color: rgb(var(--md-color-primary) / 0.56);
    background: rgb(var(--md-color-primary) / 0.10);
    color: rgb(var(--md-color-primary));
}
.gp-panel-option.is-answer {
    border-color: rgb(16 185 129 / 0.56);
    background: rgb(16 185 129 / 0.11);
    color: rgb(6 95 70);
}
.gp-panel-option.is-wrong {
    border-color: rgb(239 68 68 / 0.5);
    background: rgb(239 68 68 / 0.08);
    color: rgb(127 29 29);
}
.gp-panel-actions {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.gp-panel-run,
.gp-panel-next {
    height: 44px;
    min-width: 150px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary, 255 255 255));
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 14px 24px -20px rgba(15, 23, 42, 0.55);
}
.gp-panel-run:disabled {
    cursor: default;
    opacity: 0.48;
}
.gp-panel-next[hidden] {
    display: none;
}
.gp-panel-result {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 13px;
    font-weight: 740;
    line-height: 1.45;
}
.gp-panel-feedback {
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}
.gp-panel-finish {
    padding: 14px;
    border-radius: 10px;
    background: rgb(16 185 129 / 0.09);
    border: 1px solid rgb(16 185 129 / 0.38);
}
.gp-panel-finish strong,
.gp-panel-finish span {
    display: block;
}
.gp-panel-finish strong {
    color: rgb(6 95 70);
    font-size: 15px;
    margin-bottom: 3px;
}
.gp-panel-finish span {
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 13px;
}
.gp-rescue-game {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gp-rescue-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.gp-rescue-hud > div {
    min-height: 58px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
}
.gp-rescue-hud span {
    display: block;
    font-size: 10px;
    font-weight: 850;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    text-transform: uppercase;
}
.gp-rescue-hud strong {
    display: block;
    margin-top: 4px;
    min-height: 18px;
    color: rgb(var(--md-color-primary));
    font-size: 18px;
    line-height: 1;
}
.gp-rescue-hint {
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-primary) / 0.18);
    background: rgb(var(--md-color-primary) / 0.055);
}
.gp-rescue-hint span {
    display: block;
    margin-bottom: 4px;
    color: rgb(var(--md-color-primary));
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}
.gp-rescue-hint strong {
    display: block;
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 14px;
    line-height: 1.45;
}
.gp-rescue-word {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    column-gap: 16px;
    row-gap: 10px;
    padding: 8px 4px 2px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.gp-rescue-word::-webkit-scrollbar { height: 4px; }
.gp-rescue-word::-webkit-scrollbar-thumb { background: rgb(var(--md-color-primary) / 0.25); border-radius: 999px; }
.gp-rescue-wordgroup {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}
.gp-rescue-slot {
    width: clamp(22px, 6.2vw, 38px);
    height: clamp(30px, 8vw, 46px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    box-shadow: inset 0 -2px 0 rgb(var(--md-color-primary) / 0.18);
    font-size: clamp(13px, 4vw, 20px);
    font-weight: 900;
    flex-shrink: 0;
}
.gp-rescue-slot.is-open {
    border-color: rgb(var(--md-color-primary) / 0.35);
    background: rgb(var(--md-color-primary) / 0.065);
}
.gp-rescue-game.is-win .gp-rescue-slot.is-open {
    border-color: rgb(16 185 129 / 0.56);
    background: rgb(16 185 129 / 0.12);
    color: rgb(6 95 70);
    box-shadow: inset 0 -2px 0 rgb(16 185 129 / 0.28), 0 8px 20px -18px rgb(6 95 70);
    animation: gp-rescue-win-pop .34s ease both;
}
@keyframes gp-rescue-win-pop {
    0% { transform: translateY(0) scale(1); }
    55% { transform: translateY(-2px) scale(1.035); }
    100% { transform: translateY(0) scale(1); }
}
.gp-rescue-slot.is-space {
    width: 18px;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.gp-rescue-clues {
    display: grid;
    gap: 8px;
}
.gp-rescue-clue {
    padding: 10px 12px;
    border-radius: 9px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 13px;
    line-height: 1.4;
}
.gp-rescue-actions {
    display: flex;
    justify-content: center;
}
.gp-rescue-clue-btn {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.gp-rescue-clue-btn:disabled {
    opacity: .45;
    cursor: default;
}
.gp-rescue-keyboard {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
}
.gp-rescue-key {
    min-height: 42px;
    border-radius: 9px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240));
    background: rgb(var(--md-color-surface, 255 255 255));
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.gp-rescue-key:not(:disabled):hover {
    border-color: rgb(var(--md-color-primary) / 0.45);
    color: rgb(var(--md-color-primary));
    transform: translateY(-1px);
}
.gp-rescue-key.is-hit {
    border-color: rgb(16 185 129 / 0.48);
    background: rgb(16 185 129 / 0.09);
    color: rgb(6 95 70);
}
.gp-rescue-key.is-miss {
    border-color: rgb(239 68 68 / 0.36);
    background: rgb(239 68 68 / 0.07);
    color: rgb(127 29 29);
}
.gp-rescue-key:disabled {
    cursor: default;
}
.gp-rescue-feedback {
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgb(var(--md-color-outline-variant, 226 232 240) / 0.78);
    background: rgb(var(--md-color-surface-container-low, 248 250 252));
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}
.gp-rescue-game.is-win .gp-rescue-feedback {
    border-color: rgb(16 185 129 / 0.42);
    background: rgb(16 185 129 / 0.08);
    color: rgb(6 95 70);
}
.gp-rescue-finish {
    padding: 14px;
    border-radius: 10px;
    background: rgb(var(--md-color-primary) / 0.08);
    border: 1px solid rgb(var(--md-color-primary) / 0.22);
}
.gp-rescue-finish.is-win {
    background: rgb(16 185 129 / 0.09);
    border-color: rgb(16 185 129 / 0.38);
}
.gp-rescue-finish.is-win strong {
    color: rgb(6 95 70);
}
.gp-rescue-finish strong,
.gp-rescue-finish span {
    display: block;
}
.gp-rescue-finish strong {
    color: rgb(var(--md-color-primary));
    font-size: 15px;
    margin-bottom: 3px;
}
.gp-rescue-finish span {
    color: rgb(var(--md-color-on-surface, 30 41 59));
    font-size: 13px;
}
.gp-gameify-loading {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    text-align: center;
    padding: 24px 16px;
}
.gp-gameify-loading-stage {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gp-gameify-loading-text {
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    max-width: 360px;
}
.gp-gameify-loading-text strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: rgb(var(--md-color-on-surface, 30 41 59));
    line-height: 1.3;
}
.gp-gameify-loading-text span {
    display: block;
    font-size: 13.5px;
    line-height: 1.5;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
    transition: opacity 0.4s ease;
    min-height: 40px;
}
.gp-gameify-progress {
    width: 240px;
    height: 4px;
    border-radius: 999px;
    background: rgb(var(--md-color-primary) / 0.10);
    overflow: hidden;
    position: relative;
}
.gp-gameify-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: rgb(var(--md-color-primary));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.gp-gameify-error {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
}
.gp-gameify-error strong {
    display: block;
    font-size: 16px;
    margin-bottom: 3px;
}
.gp-gameify-error span {
    display: block;
    font-size: 13px;
    color: rgb(var(--md-color-on-surface-variant, 71 85 105));
}
.gp-gameify-loader {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgb(var(--md-color-primary) / 0.15);
    border-top-color: rgb(var(--md-color-primary));
    animation: gp-gameify-spin 0.9s linear infinite;
}
.gp-gameify-error-action {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    border: 0;
    background: rgb(var(--md-color-primary));
    color: rgb(var(--md-color-on-primary, 255 255 255));
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
@keyframes gp-gameify-spin {
    to { transform: rotate(360deg); }
}
@keyframes gp-gameify-slide-up {
    from { transform: translateY(100%); opacity: 0.85; }
    to   { transform: translateY(0); opacity: 1; }
}
@media (max-width: 760px) {
    .gp-gameify-shell {
        left: 8px;
        right: 8px;
        bottom: 0;
        top: auto;
        width: auto;
        max-width: none;
        height: auto;
        max-height: 88vh;
        transform: none;
        border-radius: 18px 18px 0 0;
        border-bottom: 0;
        animation: gp-gameify-slide-up .26s cubic-bezier(0.4, 0, 0.2, 1);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .gp-gameify-shell::before {
        content: '';
        position: absolute;
        top: 7px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        border-radius: 999px;
        background: rgb(var(--md-color-outline-variant, 226 232 240));
        z-index: 1;
    }
    .gp-gameify-topbar {
        padding-top: 20px;
    }
    .gp-gameify-body {
        padding: 14px;
    }
    .gp-gameify-template-grid {
        grid-template-columns: 1fr;
    }
    .gp-gameify-template {
        min-height: 126px;
        padding: 14px;
    }
    .gp-gameify-template-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }
    .gp-gameify-template-icon svg {
        width: 17px;
        height: 17px;
    }
    .gp-gameify-template strong {
        font-size: 15px;
    }
    .gp-memory-hud {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .gp-memory-hud > div {
        min-height: 52px;
        padding: 9px;
    }
    .gp-memory-board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .gp-memory-card {
        min-height: 86px;
    }
    .gp-memory-face {
        padding: 8px;
        font-size: 11.5px;
    }
    .gp-hunt-hud {
        gap: 8px;
    }
    .gp-hunt-hud > div {
        min-height: 52px;
        padding: 9px;
    }
    .gp-hunt-board {
        gap: 8px;
    }
    .gp-hunt-card {
        min-height: 88px;
        padding: 8px;
        border-radius: 10px;
    }
    .gp-hunt-card span {
        font-size: 12px;
    }
    .gp-decision-hud {
        gap: 8px;
    }
    .gp-decision-hud > div {
        min-height: 52px;
        padding: 9px;
    }
    .gp-decision-stage {
        padding: 12px;
    }
    .gp-decision-card {
        min-height: 220px;
        padding: 16px;
        border-radius: 10px;
    }
    .gp-decision-card > strong {
        font-size: 17px;
    }
    .gp-decision-actions {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .gp-decision-choice {
        height: 48px;
        border-radius: 10px;
        font-size: 13.5px;
    }
    .gp-unlock-hud {
        gap: 8px;
    }
    .gp-unlock-hud > div {
        min-height: 52px;
        padding: 9px;
    }
    .gp-unlock-stage {
        padding: 12px;
    }
    .gp-unlock-scene {
        min-height: 0;
        padding: 14px;
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .gp-unlock-visual {
        width: 132px;
        height: 148px;
    }
    .gp-unlock-shackle {
        left: 30px;
        width: 72px;
        height: 72px;
        border-width: 11px;
    }
    .gp-unlock-body {
        left: 12px;
        right: 12px;
        height: 90px;
        border-radius: 14px;
    }
    .gp-unlock-body b {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }
    .gp-unlock-clue {
        padding: 12px;
    }
    .gp-unlock-clue strong {
        font-size: 16px;
    }
    .gp-unlock-keys {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .gp-unlock-key {
        min-height: 56px;
        padding: 9px 10px;
        border-radius: 10px;
    }
    .gp-unlock-key strong {
        font-size: 13px;
    }
    .gp-scramble-hud {
        gap: 8px;
    }
    .gp-scramble-hud > div {
        min-height: 52px;
        padding: 9px;
    }
    .gp-scramble-stage {
        padding: 12px;
    }
    .gp-scramble-clue {
        min-height: 82px;
        padding: 12px;
    }
    .gp-scramble-clue strong {
        font-size: 15px;
    }
    .gp-scramble-word {
        min-height: 62px;
        column-gap: 12px;
        row-gap: 8px;
        margin: 14px 0 12px;
    }
    .gp-scramble-wordgroup {
        display: flex;
        width: 100%;
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .gp-scramble-word {
        overflow: visible;
        flex-direction: column;
        row-gap: 8px;
    }
    .gp-scramble-slot {
        border-radius: 8px;
    }
    .gp-scramble-space {
        width: 10px;
        height: 42px;
    }
    .gp-scramble-bank {
        gap: 7px;
        padding: 10px;
    }
    .gp-scramble-tile {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        font-size: 17px;
    }
    .gp-scramble-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .gp-scramble-secondary,
    .gp-scramble-check,
    .gp-scramble-next {
        width: 100%;
        min-width: 0;
        height: 40px;
        padding: 0 10px;
        font-size: 12px;
    }
    .gp-scramble-check,
    .gp-scramble-next {
        grid-column: 1 / -1;
    }
    .gp-panel-hud {
        gap: 8px;
    }
    .gp-panel-hud > div {
        min-height: 52px;
        padding: 9px;
    }
    .gp-panel-stage {
        padding: 12px;
    }
    .gp-panel-console {
        padding: 12px;
        border-radius: 12px;
    }
    .gp-panel-screen {
        min-height: 96px;
        padding: 12px;
    }
    .gp-panel-screen > strong {
        font-size: 16px;
    }
    .gp-panel-controls {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .gp-panel-control {
        padding: 10px;
    }
    .gp-panel-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .gp-panel-option {
        min-height: 36px;
        font-size: 11.5px;
    }
    .gp-panel-actions {
        flex-direction: column;
    }
    .gp-panel-run,
    .gp-panel-next {
        width: 100%;
    }
    .gp-rescue-hud {
        gap: 8px;
    }
    .gp-rescue-hud > div {
        min-height: 52px;
        padding: 9px;
    }
    .gp-rescue-word {
        column-gap: 12px;
        row-gap: 8px;
    }
    .gp-rescue-wordgroup {
        display: flex;
        width: 100%;
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .gp-rescue-word {
        overflow: visible;
        flex-direction: column;
        row-gap: 8px;
    }
    .gp-rescue-slot {
        border-radius: 8px;
    }
    .gp-rescue-keyboard {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 7px;
    }
    .gp-rescue-key {
        min-height: 39px;
        font-size: 13px;
    }
}

/* ─── 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-game-btn {
    position: absolute;
    top: 10px;
    right: 72px;
    display: inline-flex; align-items: center; justify-content: center;
    height: 30px;
    width: 30px;
    padding: 0;
    background: rgb(248 250 252);
    border: 1px solid rgb(226 232 240);
    color: rgb(100 116 139);
    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;
}
.gp-section-game-btn:hover {
    background: rgb(241 245 249);
    border-color: rgb(148 163 184);
    color: rgb(15 23 42);
    opacity: 1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);
}
.gp-section-game-btn svg {
    width: 15px; height: 15px;
}
.gp-section-game-btn .gp-section-ai-menu-icon {
    color: inherit;
    width: 15px;
    height: 15px;
}
@media (max-width: 1023px) {
    .gp-section-game-btn { top: 8px; right: 68px; }
}
[dir="rtl"] .gp-section-ai-btn { right: auto; left: 10px; }
[dir="rtl"] .gp-section-game-btn { right: auto; left: 72px; }
@media (max-width: 1023px) {
    [dir="rtl"] .gp-section-ai-btn { right: auto; left: 8px; }
    [dir="rtl"] .gp-section-game-btn { right: auto; left: 68px; }
}

.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);
}
