:root {
    --indigo: #1E1B4B;
    --cream: #FFFDF9;
    --gold: #F59E0B;
    --gold-hover: #FBBF24;
    --success: #10B981;
    --success-light: #D1EAD4;
    --error: #EF4444;
    --error-light: #FCE8E6;
    --muted: #9CA3AF;
    --muted-light: #E5E7EB;
    --accent-green: #E2F2E4;
    --accent-warm: #FFEAA7;
    --surface: #FFFFFF;
    --terminal-bg: #1a1a2e;
    --terminal-header: #16213e;
    --font-body: 'Outfit', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --border-width: 3px;
    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 28px;
    --shadow-sm: 0 4px 0 var(--indigo);
    --shadow-md: 0 6px 0 var(--indigo);
    --shadow-lg: 0 8px 0 var(--indigo);
    --shadow-xl: 0 10px 0 var(--indigo);
    --transition-tactile: all 0.1s ease;
    --nav-dock-height: 70px;
}

body {
    background-color: var(--cream);
    background-image: radial-gradient(#DDD6FE 1.8px, transparent 1.8px), radial-gradient(#DDD6FE 1.8px, transparent 1.8px);
    background-size: 36px 36px;
    background-position: 0 0, 18px 18px;
    font-family: var(--font-body);
}
.coding2-content-area {
    padding-top: 0.75rem;
    min-height: 100vh;
}

/* Navigation Dock */
.coding2-nav-dock {
    position: sticky;
    top: 15px;
    width: fit-content;
    margin: 15px auto;
    z-index: 1040;
    background: var(--surface);
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.2s ease;
}
.rotating-logo-badge {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    border: 2px solid var(--indigo);
    background: var(--surface);
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}
.rotating-logo-badge:hover {
    transform: rotate(360deg) scale(1.1);
}
.nav-dock-item {
    position: relative;
    font-size: 1.6rem;
    color: var(--indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}
.nav-dock-item:active { transform: translateY(2px); }
@media (hover: hover) {
    .nav-dock-item:hover {
        background: var(--accent-warm);
        border-color: var(--indigo);
        transform: scale(1.15) translateY(-3px);
        color: var(--indigo);
    }
}
.nav-dock-item.active {
    background: var(--accent-green);
    border-color: var(--indigo);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.nav-dock-item::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: var(--indigo);
    color: var(--surface);
    font-size: 0.75rem;
    font-weight: 800;
    font-family: var(--font-body);
    padding: 5px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
@media (hover: hover) {
    .nav-dock-item:hover::after {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}
/* Responsive Nav Dock */
@media (max-width: 768px) {
    .coding2-nav-dock {
        padding: 6px 10px;
        gap: 0.5rem;
        top: 8px;
        border-radius: var(--radius-md);
        max-width: calc(100vw - 16px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .coding2-nav-dock::-webkit-scrollbar { display: none; }
    .rotating-logo-badge { height: 32px; width: 32px; }
    .nav-dock-item { width: 36px; height: 36px; font-size: 1.2rem; flex-shrink: 0; }
    .nav-dock-item::after { display: none; }
    .coding2-nav-dock > div[style*="width: 2px"] { height: 18px !important; }
    .fruit-stats a span.fs-4 { font-size: 1rem !important; }
}

/* Top Bar (Legacy) */
.coding2-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--surface);
    border-bottom: var(--border-width) solid var(--indigo);
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}
.top-bar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 8px 16px;
    border: 2.5px solid var(--indigo);
    border-radius: 12px;
    color: var(--indigo);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 3px 0 var(--indigo);
    background: var(--surface);
    transition: var(--transition-tactile);
}
.top-bar-btn:hover {
    background: var(--accent-warm);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--indigo);
    color: var(--indigo);
}
.top-bar-btn:active { transform: translateY(2px); box-shadow: none; }

/* Tactile Buttons */
.btn-tactile {
    background: var(--gold);
    color: var(--indigo);
    font-weight: 800;
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-tactile);
    padding: 10px 18px;
    text-transform: uppercase;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-tactile:hover {
    background: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-tactile:active { transform: translateY(4px); box-shadow: none; }
.btn-tactile[disabled] {
    background: var(--muted-light) !important;
    border-color: var(--muted) !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none !important;
    color: var(--muted) !important;
}
.btn-tactile-secondary { background: var(--accent-green); color: var(--indigo) !important; }
.btn-tactile-locked {
    background: var(--muted-light);
    color: var(--muted) !important;
    border-color: var(--muted);
    box-shadow: 0 4px 0 var(--muted);
    cursor: not-allowed;
}

/* Bubble Card */
.bubble-card {
    background: var(--surface);
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* Progress Bar */
.progress-bubble {
    height: 18px;
    background-color: var(--accent-green);
    border: 2px solid var(--indigo);
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar-fill {
    background-color: var(--success);
    border-radius: 8px;
    height: 100%;
}

/* Quest Card (Lesson Step) */
.quest-card {
    background: var(--surface);
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    max-width: min(92vw, 1400px);
    margin: 2rem auto;
    position: relative;
}
.quest-card-fluid {
    max-width: 100% !important;
    margin: 1rem 0 !important;
    padding: 1.5rem !important;
}
.steps-tracker {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.tracker-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--indigo);
    background: var(--surface);
}
.tracker-dot.active { background: var(--gold); transform: scale(1.25); }
.tracker-dot.completed { background: var(--success); }

/* ── Letter Tiles Widget ── */
.tiles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 1rem;
}
.tile-btn {
    width: 52px;
    height: 52px;
    background: var(--surface);
    border: 3px solid var(--indigo);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--indigo);
    cursor: pointer;
    transition: var(--transition-tactile);
    text-transform: uppercase;
}
.tile-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.tile-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}
.tile-btn.used {
    background: var(--success-light);
    border-color: var(--success);
    opacity: 0.4;
    transform: scale(0.9);
    pointer-events: none;
}
.tiles-answer-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--indigo);
    letter-spacing: 0.3em;
}
    .tile-slot {
    display: inline-block;
    width: 40px;
    height: 44px;
    border-bottom: 4px solid var(--indigo);
    text-align: center;
    line-height: 44px;
}

/* ── Drag Order Widget ── */
.drag-order-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 520px;
    margin: 0 auto;
}
.drag-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 3px solid var(--indigo);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 0.75rem 1rem;
    cursor: grab;
    transition: var(--transition-tactile);
    user-select: none;
}
.drag-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.drag-item:active {
    cursor: grabbing;
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--indigo);
}
.drag-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}
.drag-handle {
    color: var(--muted);
    font-size: 1.2rem;
    flex-shrink: 0;
}
.drag-label {
    flex-grow: 1;
    font-weight: 600;
    color: var(--indigo);
}
.drag-index {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--muted);
    background: var(--muted-light);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.drag-item.drag-correct {
    background: var(--success-light) !important;
    border-color: var(--success) !important;
}
.drag-item.drag-wrong {
    background: var(--error-light) !important;
    border-color: var(--error) !important;
}

/* ── Shape Sorter Widget ── */
.sorter-buckets {
    min-height: 180px;
}
.sorter-bucket {
    border: 4px dashed var(--indigo);
    border-radius: var(--radius-lg);
    min-height: 160px;
    display: flex;
    flex-direction: column;
}
.sorter-bucket-header {
    color: white;
    font-weight: 800;
    text-align: center;
    padding: 0.5rem;
    border-radius: 14px 14px 0 0;
    font-size: 0.95rem;
}
.sorter-bucket-drop {
    flex-grow: 1;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 100px;
    transition: background 0.15s ease;
}
.sorter-bucket-drop.drop-hover {
    background: rgba(30, 27, 75, 0.05);
}
.sorter-item {
    background: var(--surface);
    border: 3px solid var(--indigo);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 0.6rem 1rem;
    font-weight: 600;
    color: var(--indigo);
    cursor: grab;
    transition: var(--transition-tactile);
    user-select: none;
    display: inline-block;
}
.sorter-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.sorter-item.dragging {
    opacity: 0.4;
}
.sorter-item.sorter-correct {
    background: var(--success-light) !important;
    border-color: var(--success) !important;
}
.sorter-item.sorter-wrong {
    background: var(--error-light) !important;
    border-color: var(--error) !important;
}

/* ── Flow Chart Widget ── */
.flow-chart-canvas {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1rem;
    min-height: 200px;
}
.flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: var(--shadow-sm);
    max-width: 320px;
    width: 100%;
    text-align: center;
}
.flow-node-start {
    background: var(--success-light);
    border: 3px solid var(--success);
    color: var(--success);
}
.flow-node-question {
    background: var(--accent-warm);
    border: 3px solid var(--gold);
    color: #92400E;
    border-radius: 50px;
}
.flow-node-action {
    background: var(--surface);
    border: 3px solid var(--indigo);
    color: var(--indigo);
}
.flow-node-result {
    background: var(--success-light);
    border: 3px solid var(--success);
    color: var(--success);
}
.flow-node-enter {
    animation: flowNodeEnter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.flow-branch-btn {
    background: var(--gold);
    border: 2px solid var(--indigo);
    border-radius: 20px;
    padding: 0.3rem 1rem;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--indigo);
    cursor: pointer;
    transition: var(--transition-tactile);
    margin: 0.25rem;
}
.flow-branch-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.flow-branch-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}
.flow-branch-selected {
    background: var(--success) !important;
    color: white !important;
}
.flow-connector {
    width: 3px;
    height: 30px;
    background: var(--gold);
    border-radius: 2px;
}

/* ── Mind Map Widget ── */
.mind-map-container {
    overflow-x: auto;
    min-height: 240px;
    background: var(--cream);
}
.mind-map-container .mermaid {
    min-width: 400px;
}
.mind-map-container .mermaid svg {
    max-width: 100%;
    height: auto;
}
.mind-map-container .mermaid .node rect,
.mind-map-container .mermaid .node circle,
.mind-map-container .mermaid .node polygon {
    stroke-width: 2px;
}
.mind-map-container .mermaid .edgeLabel {
    background-color: var(--cream) !important;
}
.mind-map-container .mermaid .cluster-label span {
    color: var(--indigo) !important;
}

/* ── Keyframes ── */
@keyframes flowNodeEnter {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Quiz */
.quiz-option {
    background: white;
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    padding: 1rem 1.5rem;
    transition: var(--transition-tactile);
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.quiz-option:hover {
    background: #F3F4F6;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.quiz-option:active { transform: translateY(4px); box-shadow: none; }
.quiz-option.correct {
    background: var(--success-light) !important;
    border-color: var(--success) !important;
    box-shadow: 0 4px 0 var(--success) !important;
}
.quiz-option.incorrect {
    background: var(--error-light) !important;
    border-color: var(--error) !important;
    box-shadow: 0 4px 0 var(--error) !important;
}

/* Lego Bricks */
.lego-brick {
    background: var(--surface);
    border: var(--border-width) solid var(--indigo);
    border-radius: 12px;
    padding: 10px 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-tactile);
}
.lego-brick:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lego-brick.active-brick {
    background: var(--accent-warm);
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--indigo);
}

/* Floating Fruit */
.floating-fruit-badge {
    position: absolute;
    z-index: 2000;
    pointer-events: none;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1.35rem;
    animation: floatUpAndFade 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 6px 14px;
    border-radius: 16px;
    border: var(--border-width) solid var(--indigo);
}
.floating-fruit-badge.gain {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
    box-shadow: 0 4px 0 var(--success);
}
.floating-fruit-badge.loss {
    background: var(--error-light);
    color: var(--error);
    border-color: var(--error);
    box-shadow: 0 4px 0 var(--error);
}

/* App Drawer */
.app-drawer-container {
    max-width: min(92vw, 1200px);
    margin: 0 auto;
    padding: 3rem 1.5rem;
    text-align: center;
}
.drawer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    justify-content: center;
}
.app-launcher-card {
    background: var(--surface);
    border: 4px solid var(--indigo);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.75rem 1rem;
    text-decoration: none;
    color: var(--indigo) !important;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}
.app-launcher-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 0 var(--indigo);
}
.app-launcher-card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--indigo); }
.launcher-icon { font-size: 3.5rem; margin-bottom: 0.75rem; }
.launcher-label {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.05rem;
}
.launcher-sub { font-size: 0.75rem; color: #6B7280; margin-top: 0.25rem; }

/* Unit Accordion (Map) */
.unit-card {
    background: var(--surface);
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
}
.unit-card-header {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: background 0.15s ease;
}
.unit-card-header:hover { background: #FFFBEB; }
.unit-card-header .unit-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    border: var(--border-width) solid var(--indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.unit-card-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.unit-card-body.expanded { max-height: 2000px; }
.unit-card-body-inner { padding: 0 1.5rem 1.5rem; }

.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.lesson-card {
    background: var(--surface);
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-md);
    box-shadow: 0 5px 0 var(--indigo);
    padding: 1.25rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-tactile);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}
.lesson-card:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--indigo); color: inherit; }
.lesson-card:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--indigo); }
.lesson-card.locked { opacity: 0.6; cursor: not-allowed; box-shadow: 0 3px 0 var(--muted); border-color: var(--muted); }
.lesson-card.locked:hover { transform: none; box-shadow: 0 3px 0 var(--muted); }
.lesson-card.completed { border-color: var(--success); box-shadow: 0 5px 0 var(--success); }
.lesson-card .lesson-icon {
    font-size: 2rem; width: 56px; height: 56px;
    border-radius: 50%;
    border: var(--border-width) solid var(--indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
}
.lesson-card.completed .lesson-icon { background: var(--success); color: white; border-color: var(--success); }
.lesson-card .lesson-title { font-weight: 700; font-size: 0.95rem; color: var(--indigo); font-family: var(--font-heading); }
.lesson-card .lesson-badge { font-size: 0.7rem; font-weight: 700; padding: 2px 10px; border-radius: 20px; border: 2px solid; }
.lesson-card .lesson-badge.passed { background: var(--success-light); color: var(--success); border-color: var(--success); }
.lesson-card .lesson-badge.locked-badge { background: var(--muted-light); color: var(--muted); border-color: var(--muted); }
.lesson-card .lesson-badge.active-badge { background: #FEF3C7; color: var(--gold); border-color: var(--gold); }

/* App Builder */
.editor-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    gap: 1.5rem;
}
@media (min-width: 992px) {
    .editor-layout { flex-direction: row; }
    .canvas-section { flex: 1.2; }
    .command-section { flex: 0.8; max-width: min(35vw, 500px); }
}
.bubble-container {
    background: var(--surface);
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.canvas-section { position: relative; }
.sandbox-frame { width: 100%; height: 100%; border: none; background: white; }
.chat-log {
    background: #F8F9FA;
    border-bottom: var(--border-width) solid var(--indigo);
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}
.mascot-status-card {
    background: var(--accent-warm);
    border: 2px solid var(--indigo);
    border-radius: var(--radius-md);
    padding: 1rem;
}
.mascot-avatar { height: 70px; border: 2px solid var(--indigo); animation: bob 3s ease-in-out infinite; background: var(--accent-warm); border-radius: 14px; padding: 6px; }
.prompt-deck { padding: 1rem; background: white; }
.prompt-input {
    border: var(--border-width) solid var(--indigo);
    border-radius: 16px;
    font-size: 1rem;
    font-family: var(--font-body);
    resize: none;
}
.prompt-input:focus { outline: none; border-color: #8B5CF6; box-shadow: none; }
.peek-drawer {
    position: fixed;
    bottom: -450px;
    left: 0; right: 0;
    height: 400px;
    background: #1E1E24;
    border-top: 5px solid var(--indigo);
    z-index: 1050;
    transition: bottom 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}
.peek-drawer.show { bottom: 0; }
.CodeMirror { height: 100% !important; font-family: var(--font-mono); font-size: 13px; }
.config-popover {
    position: absolute;
    top: 60px; right: 20px;
    z-index: 1000;
    background: white;
    border: var(--border-width) solid var(--indigo);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
    display: none;
    width: 280px;
}
.config-color-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--indigo);
    cursor: pointer;
    transition: transform 0.1s ease;
}
.config-color-dot:hover { transform: scale(1.15); }

/* Vault */
.vault-container { max-width: min(92vw, 1000px); margin: 1.5rem auto; }
.vault-card {
    background: var(--surface);
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
}
.level-selector { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.level-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: var(--border-width) solid var(--indigo);
    font-weight: 800; font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.15s ease;
    background: white; box-shadow: 0 3px 0 var(--indigo);
}
.level-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--indigo); }
.level-btn:active { transform: translateY(3px); box-shadow: none; }
.level-btn.active { background: var(--gold); color: white; }
.level-btn.completed { background: var(--success); color: white; }
.level-btn.locked { background: var(--muted-light); color: var(--muted); cursor: not-allowed; box-shadow: none; }
.tutu-face { width: 120px; height: 120px; object-fit: contain; transition: all 0.3s ease; }
.tutu-face-small { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }

/* Vault Notification Bar */
.vault-notification-bar {
    display: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    border: 3px solid var(--indigo);
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-size: 0.95rem;
    align-items: center;
    gap: 0.75rem;
    animation: notificationSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.vault-notification-bar.show { display: flex; }
.vault-notification-bar.unlock { background: #F0FDF4; border-color: var(--success); color: var(--success); }
.vault-notification-bar.xp { background: #FFFBEB; border-color: var(--gold); color: #92400E; }
.vault-notification-bar.error { background: #FEF2F2; border-color: var(--error); color: var(--error); }
.vault-notification-bar .notif-icon { font-size: 1.5rem; }

/* Vault Chat Area */
.vault-chat-area {
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
}
.vault-head {
    position: sticky;
    top: calc(var(--nav-dock-height) + 15px);
    z-index: 5;
    background: var(--surface);
}
.vault-mid {
    /* natural block flow — no height constraints */
}
.vault-input {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: var(--surface);
}
.vault-chat-messages {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.chat-bubble {
    max-width: 85%;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.5;
    animation: chatBubbleIn 0.25s ease forwards;
}
.chat-bubble-tutu {
    align-self: flex-start;
    background: var(--accent-green);
    border: 2px solid var(--indigo);
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    color: var(--indigo);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    max-width: 90%;
}
.chat-bubble-tutu .chat-avatar { width: 28px; height: 28px; flex-shrink: 0; margin-top: 2px; }
.chat-bubble-user {
    align-self: flex-end;
    background: var(--indigo);
    border: 2px solid var(--indigo);
    border-radius: var(--radius-md) 0 var(--radius-md) var(--radius-md);
    color: white;
}
.chat-bubble-system {
    align-self: center;
    background: #FFFBEB;
    border: 2px solid var(--gold);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1.25rem;
    color: #92400E;
    width: 100%;
}
.chat-bubble-unlock {
    align-self: center;
    background: #F0FDF4;
    border: 3px solid var(--success);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    color: var(--success);
    width: 100%;
    animation: unlockPulse 1s ease-in-out infinite;
}

/* Vault Thinking Dots */
.chat-thinking {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
}
.chat-thinking .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--muted);
    animation: bounceDot 1.2s ease-in-out infinite;
}
.chat-thinking .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking .dot:nth-child(3) { animation-delay: 0.4s; }

/* Vault Input */
.vault-chat-input {
    border-top: 3px solid var(--indigo);
    padding: 0.75rem 1rem;
    display: flex; gap: 0.5rem;
    background: var(--cream);
}
.vault-chat-input input {
    flex: 1;
    border: 3px solid var(--indigo);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-family: var(--font-body);
    outline: none;
    background: var(--surface);
}
.vault-chat-input input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15); }
.vault-chat-input input::placeholder { color: var(--muted); }

@keyframes notificationSlideIn {
    0% { opacity: 0; transform: translateY(-10px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes chatBubbleIn {
    0% { opacity: 0; transform: translateY(8px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes unlockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}
@keyframes bounceDot {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
}

/* Responsive Vault */
@media (max-width: 576px) {
    .vault-card { padding: 1rem; }
    .tutu-face { width: 80px; height: 80px; }
    .vault-chat-messages { padding: 0.75rem; }
    .chat-bubble { font-size: 0.85rem; padding: 0.5rem 0.75rem; }
    .chat-bubble-tutu { max-width: 95%; }
    .chat-bubble-user { max-width: 85%; }
    .vault-chat-input { padding: 0.5rem 0.75rem; }
    .vault-chat-input input { font-size: 0.85rem; padding: 0.5rem 0.75rem; }
    .level-btn { width: 42px; height: 42px; font-size: 0.9rem; }
    .vault-notification-bar { font-size: 0.8rem; padding: 0.5rem 0.75rem; }
}

/* Report Card */
.report-card-container { max-width: min(92vw, 1000px); margin: 2rem auto; padding: 0 1rem; }
.certificate-card {
    background: var(--surface);
    border: 4px solid var(--indigo);
    border-radius: 36px;
    box-shadow: 0 12px 0 var(--indigo);
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}
.certificate-card::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0;
    height: 12px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--success) 50%, var(--error) 100%);
}
.adventure-header { text-align: center; margin-bottom: 2.5rem; }
.rotating-logo-large {
    height: 90px; width: 90px;
    border-radius: 50%;
    border: var(--border-width) solid var(--indigo);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    animation: floatMascot 4s ease-in-out infinite;
}
.log-title {
    font-family: var(--font-heading);
    font-weight: 700; font-size: 2.2rem;
    color: var(--indigo);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.student-badge {
    background: var(--accent-warm);
    border: var(--border-width) solid var(--indigo);
    border-radius: 20px;
    padding: 0.75rem 2rem;
    display: inline-block;
    box-shadow: var(--shadow-sm);
    font-weight: 800; color: var(--indigo);
    font-size: 1.25rem;
    margin-top: 0.5rem;
}
.rank-banner {
    background: var(--accent-green);
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2.5rem;
    display: flex; align-items: center; gap: 1.25rem;
    box-shadow: var(--shadow-md);
}
.rank-icon { font-size: 2.5rem; }
.rank-details h5 { color: var(--success); font-weight: 800; margin: 0; text-transform: uppercase; font-size: 0.9rem; }
.rank-details h3 { color: var(--indigo); font-weight: 800; margin: 0; }
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}
.stat-box {
    background: var(--surface);
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease;
}
.stat-box:hover { transform: translateY(-4px); }
.stat-box .icon { font-size: 2.5rem; margin-bottom: 0.5rem; display: block; }
.stat-box .val { font-size: 1.8rem; font-weight: 800; color: var(--indigo); display: block; line-height: 1; margin-bottom: 0.25rem; }
.stat-box .lbl { font-size: 0.85rem; font-weight: 600; color: #6B7280; text-transform: uppercase; }
.quest-log-section { margin-bottom: 3rem; }
.section-title {
    font-family: var(--font-heading);
    font-weight: 700; color: var(--indigo);
    margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 0.5rem;
    text-transform: uppercase;
}
.course-card {
    border: var(--border-width) solid var(--indigo);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    background: white;
    overflow: hidden;
}
.course-card-header {
    background: #F3F4F6;
    border-bottom: var(--border-width) solid var(--indigo);
    padding: 1rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
}
.course-card-header h4 { color: var(--indigo); font-weight: 800; margin: 0; }
.lesson-item {
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid #E5E7EB;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.lesson-item:last-child { border-bottom: none; }
.lesson-info { display: flex; align-items: center; gap: 0.75rem; }
.lesson-icon-wrapper {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid var(--indigo);
    display: flex; align-items: center; justify-content: center;
    background: #F3F4F6; font-weight: 800;
}
.lesson-item.completed .lesson-icon-wrapper { background: var(--success-light); border-color: var(--success); color: var(--success); }
.lesson-title-text { font-weight: 700; color: var(--indigo); }
.lesson-rewards { font-size: 0.85rem; color: #6B7280; }
.stars-display { color: var(--gold); font-size: 1.2rem; display: flex; gap: 2px; }
.empty-star { color: var(--muted-light); }
.stamp-container { display: flex; justify-content: center; margin-top: 2rem; }
.jss-stamp {
    border: 4px dashed var(--error);
    color: var(--error);
    background: rgba(239, 68, 68, 0.03);
    padding: 0.75rem 2rem;
    border-radius: 16px;
    font-family: var(--font-heading);
    font-size: 1.4rem; font-weight: 800;
    text-transform: uppercase;
    transform: rotate(-5deg);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
    animation: pulseStamp 2.5s ease-in-out infinite;
}

/* Course Overview */
.unit-accordion-btn {
    background: none; border: none; padding: 0; width: 100%;
    text-align: left; color: inherit;
    display: flex; align-items: center; justify-content: space-between;
}
.unit-accordion-btn:focus { outline: none; }
.lesson-row-item {
    border-bottom: 2px dashed #E5E7EB;
    padding: 1.25rem 0;
    transition: background-color 0.2s ease;
}
.lesson-row-item:last-child { border-bottom: none; }
.lesson-row-item.unlocked:hover { background-color: #FFFDF5; }
.lesson-row-item.locked { opacity: 0.65; }
.topic-pill {
    background: #F3F4F6;
    border: 1.5px solid var(--indigo);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 0.75rem; font-weight: 700;
    color: var(--indigo);
    display: inline-block;
    margin-right: 0.3rem; margin-bottom: 0.3rem;
}

/* Trunk */
.cartridge-card {
    background: var(--surface);
    border: var(--border-width) solid var(--indigo);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    height: 100%;
    display: flex; flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: all 0.15s ease;
}
.cartridge-card:hover { transform: translateY(-6px); box-shadow: 0 14px 0 var(--indigo); }
.cartridge-label {
    height: 110px;
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem;
    position: relative;
    border-bottom: var(--border-width) solid var(--indigo);
    overflow: hidden;
}
.cartridge-body { padding: 1.25rem; flex-grow: 1; display: flex; flex-direction: column; }
.cartridge-title { font-weight: 800; font-size: 1.15rem; color: var(--indigo); margin-bottom: 0.25rem; }
.cartridge-meta { font-size: 0.8rem; font-weight: 600; color: #6B7280; }

/* Notification Modal */
.notification-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1060;
    display: none;
    align-items: flex-start; justify-content: flex-start;
}
.notification-modal-overlay.show { display: flex; }
.notification-modal-overlay.closing { display: flex; }
.notification-modal {
    background: var(--surface);
    border: 4px solid var(--indigo);
    border-right-width: 8px;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    box-shadow: 0 12px 0 var(--indigo);
    padding: 2rem 2.5rem;
    max-width: min(85vw, 450px);
    width: 100%;
    text-align: center;
    margin-top: 15vh;
    animation: notifSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform: translateX(-120%);
}
.notification-modal-overlay.closing .notification-modal {
    animation: notifSlideOut 0.3s ease-in forwards;
}
.notification-modal-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.notification-modal-title {
    font-family: var(--font-heading);
    font-weight: 800; font-size: 1.4rem;
    color: var(--indigo);
    margin-bottom: 0.5rem;
}
.notification-modal-message {
    color: #6B7280;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Timer Widget */
.timer-widget {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1rem; justify-content: center;
}
.timer-circle {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 4px solid var(--indigo);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.3rem;
    font-family: var(--font-mono);
    color: var(--indigo);
    position: relative;
    background: var(--surface);
    box-shadow: 0 3px 0 var(--indigo);
}
.timer-circle.urgent { border-color: var(--error); color: var(--error); animation: pulse 0.5s ease-in-out infinite; }
.timer-bar {
    height: 8px;
    background: var(--muted-light);
    border-radius: 4px;
    overflow: hidden; flex: 1;
    border: 2px solid var(--indigo);
}
.timer-bar-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width 1s linear; }
.timer-bar-fill.urgent { background: var(--error); }

/* Lesson Step wide layout */
@media (min-width: 1024px) {
    .lesson-step-layout {
        display: grid;
        grid-template-columns: 1fr minmax(280px, 350px);
        gap: 2rem;
        align-items: start;
    }
    .lesson-step-sidebar {
        position: sticky;
        top: calc(var(--nav-dock-height) + 30px);
    }
}

/* Keyframes */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes floatUpAndFade { 0% { transform: translateY(0) scale(0.8); opacity: 1; } 50% { transform: translateY(-40px) scale(1.1); opacity: 1; } 100% { transform: translateY(-80px) scale(0.9); opacity: 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); } 20%, 40%, 60%, 80% { transform: translateX(8px); } }
.shake-card { animation: shake 0.4s ease-in-out; }
@keyframes tutuHappy { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-15px) scale(1.15) rotate(10deg); } }
.tutu-happy { animation: tutuHappy 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes tutuSad { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.tutu-sad { animation: tutuSad 0.5s ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes floatMascot { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-8px) rotate(5deg); } }
@keyframes pulseStamp { 0%, 100% { transform: scale(1) rotate(-5deg); } 50% { transform: scale(1.05) rotate(-3deg); } }
@keyframes notifSlideIn { 0% { transform: translateX(-120%); } 70% { transform: translateX(8px); } 85% { transform: translateX(-4px); } 100% { transform: translateX(0); } }
@keyframes notifSlideOut { 0% { transform: translateX(0); } 100% { transform: translateX(-120%); } }

/* ── Tutu Corner AI Sidekick Widget ─────────────────────────────────── */
.tutu-corner-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}
.tutu-corner-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: 3px solid var(--indigo);
    background: var(--accent-warm);
    box-shadow: 0 4px 0 var(--indigo);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.15s ease;
    animation: bob 3.5s ease-in-out infinite;
}
.tutu-corner-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 0 var(--indigo);
}
.tutu-corner-avatar:active {
    transform: scale(0.95);
    box-shadow: 0 2px 0 var(--indigo);
}
.tutu-corner-avatar img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}
.tutu-corner-bubble {
    background: var(--surface);
    border: 3px solid var(--indigo);
    border-radius: 20px;
    box-shadow: 0 6px 0 var(--indigo);
    padding: 1rem;
    width: 280px;
    display: none;
    position: relative;
    animation: modalPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tutu-corner-bubble.open {
    display: block;
}
.tutu-corner-bubble::after {
    content: "";
    position: absolute;
    bottom: -10px;
    right: 18px;
    width: 16px;
    height: 16px;
    background: var(--surface);
    border-right: 3px solid var(--indigo);
    border-bottom: 3px solid var(--indigo);
    transform: rotate(45deg);
}
.tutu-corner-greeting {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--indigo);
    margin-bottom: 0.5rem;
}
.tutu-corner-tip {
    background: var(--accent-warm);
    border: 2px solid var(--indigo);
    border-radius: 14px;
    padding: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--indigo);
    margin-bottom: 0.75rem;
    display: none;
}
.tutu-corner-tip.show {
    display: block;
}
.tutu-corner-input-group {
    display: flex;
    gap: 0.5rem;
}
.tutu-corner-input {
    flex: 1;
    border: 2px solid var(--indigo);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-family: var(--font-body);
    outline: none;
}
.tutu-corner-input:focus {
    border-color: var(--gold);
}
.tutu-corner-send {
    background: var(--gold);
    border: 2px solid var(--indigo);
    border-radius: 12px;
    box-shadow: 0 3px 0 var(--indigo);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-weight: 800;
    color: var(--indigo);
    transition: all 0.1s ease;
}
.tutu-corner-send:active {
    transform: translateY(3px);
    box-shadow: none;
}

/* ── Embedded Step Builder ──────────────────────────────────────────── */
.embedded-builder-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}
@media (min-width: 768px) {
    .embedded-builder-layout {
        flex-direction: row;
    }
    .embedded-preview { flex: 3.5; }
    .embedded-deck { flex: 1; max-width: 360px; }
}
.embedded-preview {
    border: 3px solid var(--indigo);
    border-radius: 14px;
    overflow: hidden;
    background: white;
}
.embedded-frame {
    width: 100%;
    height: 65vh;
    min-height: 520px;
    border: none;
    background: white;
}
.embedded-deck {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.embedded-input {
    flex: 1;
    border: 2px solid var(--indigo);
    border-radius: 12px;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    font-family: var(--font-body);
    outline: none;
}
.embedded-input:focus { border-color: var(--gold); }
.embedded-send {
    background: var(--gold);
    border: 2px solid var(--indigo);
    border-radius: 12px;
    box-shadow: 0 3px 0 var(--indigo);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-weight: 800;
    color: var(--indigo);
    transition: all 0.1s ease;
}
.embedded-send:active {
    transform: translateY(3px);
    box-shadow: none;
}

/* ── Prompt History ── */
.prompt-history-section {
    border-bottom: 3px solid var(--indigo);
}
.prompt-history-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: var(--cream);
    border: none;
    border-top: 3px solid var(--indigo);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--indigo);
    cursor: pointer;
    transition: background 0.1s ease;
}
.prompt-history-toggle:hover { background: #F3F4F6; }
.prompt-history-toggle:active { background: var(--muted-light); }
.prompt-history-body {
    display: none;
    max-height: 180px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--surface);
}
.prompt-history-body.show { display: block; }
.prompt-history-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.3;
    border-left: 3px solid transparent;
    margin-bottom: 0.25rem;
    transition: background 0.1s ease;
}
.prompt-history-item:hover { background: var(--cream); }
.prompt-history-item .h-num {
    font-weight: 800;
    color: var(--muted);
    flex-shrink: 0;
    width: 20px;
    text-align: right;
}
.prompt-history-item .h-prompt {
    flex: 1;
    color: var(--indigo);
    word-break: break-word;
}
.prompt-history-item .h-result {
    flex-shrink: 0;
    font-size: 0.85rem;
}
.prompt-history-item.success { border-left-color: var(--success); }
.prompt-history-item.fail { border-left-color: var(--error); }

/* ── Touch device hover prevention ── */
@media (hover: none) {
    .tile-btn:hover, .drag-item:hover, .sorter-item:hover, 
    .quiz-option:hover, .lego-brick:hover, .level-btn:hover,
    .flow-branch-btn:hover, .config-color-dot:hover,
    .nav-dock-item:hover, .rotating-logo-badge:hover,
    .btn-tactile:hover, .top-bar-btn:hover, .app-launcher-card:hover,
    .unit-card-header:hover, .lesson-card:hover, .cartridge-card:hover,
    .stat-box:hover, .lesson-row-item.unlocked:hover,
    .tutu-corner-avatar:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* ── Tutorial Cards ── */
.tutorial-section {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tutorial-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    border: 3px solid var(--indigo);
    background: var(--surface);
    transition: all 0.15s ease;
}
.tutorial-step.locked {
    opacity: 0.5;
    border-color: var(--muted);
    background: var(--muted-light);
}
.tutorial-step.done {
    border-color: var(--success);
    background: var(--success-light);
}
.tutorial-step-badge {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gold);
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--indigo);
}
.tutorial-step.done .tutorial-step-badge {
    background: var(--success);
}
.tutorial-step.locked .tutorial-step-badge {
    background: var(--muted);
}
.tutorial-step-body {
    flex: 1;
}
.tutorial-step-prompt {
    font-weight: 700;
    font-size: 0.83rem;
    color: var(--indigo);
    margin: 0;
    line-height: 1.3;
}
.tutorial-step-btn {
    background: var(--gold);
    border: 2px solid var(--indigo);
    border-radius: var(--radius-sm);
    padding: 3px 12px;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--indigo);
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 0 2px 0 var(--indigo);
}
.tutorial-step-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--indigo); }
.tutorial-step-btn:active { transform: translateY(2px); box-shadow: none; }
.tutorial-step-locked-text {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}
.tutorial-done-badge {
    font-size: 1.1rem;
}
.tutorial-hidden { display: none !important; }
.tutorial-celebrate {
    text-align: center;
    padding: 0.75rem;
    font-weight: 700;
    color: var(--success);
    font-size: 0.85rem;
}
