/* ═══════════════════════════════════════════════════════════
   style.css — CSS unificado para todas as páginas
   ═══════════════════════════════════════════════════════════ */

/* ── TOKENS ────────────────────────────────────────────── */
:root {
    --font: "Manrope", "Segoe UI", sans-serif;
    --font-display: "Manrope", sans-serif;
    --font-body: "Manrope", sans-serif;
    --font-mono: "Manrope", monospace;
    --radius: 1rem;
    --radius-sm: 0.75rem;
    --radius-chip: 7px;

    /* gradient accent colours */
    --g-purple: #90c7f4;
    --g-blue: #ffcfa1;
    --g-pink: #94e2a2;
}

/* ── TEMAS ─────────────────────────────────────────────── */
[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f6f7;
    --surface: #ffffff;
    --surface2: #f0f2f4;
    --panel-bg: #f5f6f7;
    --panel-bg-strong: #eef0f2;
    --border: #d7dbe0;
    --panel-border: #d7dbe0;
    --text: #2b323b;
    --text-muted: #6f7883;
    --text-contrast: #6f7883;
    --accent: #5c6b7a;
    --accent2: #ffcfa1;
    --success: #90c7f4;
    --success-light: #94e2a2;
    --warn-mid: #e9e27a;
    --danger: #ffcfa1;
    --danger-dark: #fb9999;
    --overlay-bg: rgba(0, 0, 0, 0.28);
    --surface3: #e8eaed;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #121212;
    --surface: #1e1e1e;
    --surface2: #252525;
    --panel-bg: #171717;
    --panel-bg-strong: #1d1d1d;
    --border: #3a3a3a;
    --panel-border: #343434;
    --text: #f1f1f1;
    --text-muted: #b0b0b0;
    --text-contrast: #ffffff;
    --accent: #a0a0a0;
    --accent2: #d75f00;
    --success: #90c7f4;
    --success-light: #96e294;
    --warn-mid: #f0f07c;
    --danger: #ffcfa1;
    --danger-dark: #fb9999;
    --overlay-bg: rgba(0, 0, 0, 0.62);
    --surface3: #2d2d2d;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
    transition:
        background 0.25s,
        color 0.25s;
    text-transform: lowercase;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font);
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* ── APP SHELL ─────────────────────────────────────────── */
.app {
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

/* gradient top (via .app) */
@keyframes slideGradientRight {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0%);
    }
}

.app::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 72px;
    background:
        radial-gradient(circle at 12.5% 0%,
            color-mix(in srgb, var(--g-purple) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 37.5% 0%,
            color-mix(in srgb, var(--g-pink) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 62.5% 0%,
            color-mix(in srgb, var(--g-purple) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 87.5% 0%,
            color-mix(in srgb, var(--g-pink) 50%, transparent) 0%,
            transparent 37.5%);
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    animation: slideGradientRight 3s linear infinite;
}

/* gradient bottom (via .app) */
.app::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background:
        radial-gradient(circle at 25% 0%,
            color-mix(in srgb, var(--g-purple) 50%, transparent) 0%,
            transparent 0%),
        radial-gradient(circle at 75% 0%,
            color-mix(in srgb, var(--g-pink) 50%, transparent) 0%,
            transparent 0%);
    mask-image: linear-gradient(to top, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    transform: transparent;
}

/* gradient top (via body — para páginas sem .app) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 72px;
    background:
        radial-gradient(circle at 12.5% 0%,
            color-mix(in srgb, var(--g-purple) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 37.5% 0%,
            color-mix(in srgb, var(--g-pink) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 62.5% 0%,
            color-mix(in srgb, var(--g-purple) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 87.5% 0%,
            color-mix(in srgb, var(--g-pink) 50%, transparent) 0%,
            transparent 37.5%);
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    animation: slideGradientRight 15s linear infinite;
}

/* gradient bottom (via body — para páginas sem .app) */
body::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background:
        radial-gradient(circle at 25% 0%,
            color-mix(in srgb, var(--g-purple) 50%, transparent) 0%,
            transparent 0%),
        radial-gradient(circle at 75% 0%,
            color-mix(in srgb, var(--g-pink) 50%, transparent) 0%,
            transparent 0%);
    mask-image: linear-gradient(to top, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    transform: transparent;
}

.shell {
    position: relative;
    z-index: 1;
    max-width: 1380px;
    margin: 0 auto;
    padding: 36px 20px;
}

/* ── HEADER ────────────────────────────────────────────── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0px;
    padding-bottom: 36px;
}

.logo {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: lowercase;
    color: var(--text);
}

.logo span {
    color: var(--text);
}

/* ── NAV ACTIONS ───────────────────────────────────────── */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: color 0.18s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-arrow {
    color: var(--text-muted);
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link:hover {
    color: var(--text-muted);
}

.btn-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    padding: 0 14px;
    border: 0px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    text-transform: lowercase;
    text-decoration: none;
}

.btn-nav:hover {
    background: color-mix(in srgb, var(--surface2) 55%, transparent);
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    color: var(--text);
}

/* ── HAMBURGER ─────────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 100;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;
        background: color-mix(in srgb, var(--surface) 65%, transparent);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-left: 1px solid var(--border);
        flex-direction: column;
        padding: 80px 40px;
        gap: 32px;
        transition: right 0.3s ease;
        z-index: 90;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        font-size: 14px;
        width: 100%;
    }
}

/* ── HERO ───────────────────────────────────────────────── */
.hero {
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: start;
    margin-bottom: 32px;
    border: 0px solid var(--panel-border);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 65%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 24px;
    overflow: hidden;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.chip {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: var(--radius-chip);
    border: 0px solid var(--border);
    background: var(--surface2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0em;
    transition:
        background 0.18s,
        border-color 0.18s,
        color 0.18s;
}

.hero-title {
    font-size: clamp(0px, 2.8vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--text);
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ── SHARED COMPONENTS ─────────────────────────────────── */
.meta-pill {
    border: 1px solid var(--border);
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    text-transform: lowercase;
}

.filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-muted);
    padding: 8px 12px;
    font-size: 12px;
    font-family: var(--font);
    font-weight: 500;
    cursor: pointer;
    transition:
        border-color 0.2s,
        color 0.2s,
        opacity 0.2s;
    text-transform: lowercase;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.filter-btn.is-active {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── FOOTER ────────────────────────────────────────────── */
footer {
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── RESPONSIVE BASE ───────────────────────────────────── */
@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: clamp(22px, 6.4vw, 30px);
    }
}

@media (max-width: 680px) {
    .shell {
        padding: 8px;
    }

    header {
        margin-bottom: 24px;
    }

    .hero {
        gap: 20px;
        margin-bottom: 24px;
    }
}

:root {
    --orange: #96e294;
    --orange-text: #90c7f4;
    --success-light: #96e294;
    --danger-dark: #fb9999;
    --sidebar-w: 26rem;
    --header-h: 4vw;
    --pad: 2rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

.hidden {
    display: none !important;
}

#login-form-aluno.hidden,
#login-form-externo.hidden,
#ext-login-form.hidden,
#ext-register-form.hidden,
#ext-forgot-form.hidden {
    display: none !important;
}

html,
body {
    height: 100%;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 10px;
    background: var(--bg);
    color: var(--text);
}

html.no-transitions *,
html.no-transitions *::before,
html.no-transitions *::after,
html.no-transitions,
body.no-transitions {
    transition: none !important;
    transition-property: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
}

/* ── ENTRANCE ANIMATIONS ───────────────────────────── */
body.index-entrance-prep .index-enter-item {
    opacity: 0 !important;
    transform: translate3d(0, var(--enter-y, 2.8rem), 0) scale(var(--enter-scale, 0.982));
    filter: blur(var(--enter-blur, 10px));
    will-change: transform, opacity, filter;
}

body.index-entrance-active .index-enter-item {
    animation: indexEntranceReveal var(--enter-duration, 960ms) cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--enter-delay, 0ms);
}

@keyframes indexEntranceReveal {
    0% {
        opacity: 0;
        transform: translate3d(0, var(--enter-y, 2.8rem), 0) scale(var(--enter-scale, 0.982));
        filter: blur(var(--enter-blur, 10px));
    }

    60% {
        opacity: 1;
        filter: blur(0);
    }

    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}

@media (prefers-reduced-motion: reduce) {

    body.index-entrance-prep .index-enter-item,
    body.index-entrance-active .index-enter-item {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    #login-overlay:not(.hidden),
    #profile-settings-overlay:not(.hidden),
    #stats-overlay:not(.hidden),
    #quest-stats-overlay:not(.hidden),
    #proficiency-overlay:not(.hidden),
    #pending-activities-popup:not(.hidden),
    #session-report-overlay:not(.hidden),
    #leaderboard-overlay:not(.hidden),
    #login-overlay:not(.hidden) .login-box,
    #profile-settings-overlay:not(.hidden) .profile-settings-box,
    #stats-overlay:not(.hidden) .stats-box,
    #quest-stats-overlay:not(.hidden) .stats-box,
    #proficiency-overlay:not(.hidden) .prof-overlay-box,
    #pending-activities-popup:not(.hidden) .login-box,
    #session-report-overlay:not(.hidden) #session-report-content,
    #leaderboard-overlay:not(.hidden) #leaderboard-content,
    #mobile-sidebar-drawer.open .mobile-drawer-backdrop,
    #mobile-sidebar-drawer.open .mobile-drawer-panel,
    #chat-box.visible,
    #login-overlay:not(.hidden) .login-box>*,
    #profile-settings-overlay:not(.hidden) .profile-settings-box>*,
    #stats-overlay:not(.hidden) .stats-box>*,
    #quest-stats-overlay:not(.hidden) .stats-box>*,
    #proficiency-overlay:not(.hidden) .prof-overlay-box>*,
    #pending-activities-popup:not(.hidden) .login-box>*,
    #session-report-overlay:not(.hidden) #session-report-content>*,
    #leaderboard-overlay:not(.hidden) #leaderboard-content>*,
    #mobile-sidebar-drawer.open .mobile-drawer-panel>*,
    #chat-box.visible .chat-header,
    #chat-box.visible .chat-messages>*,
    #chat-box.visible .chat-input-bar,
    #login-overlay:not(.hidden) .login-box button,
    #profile-settings-overlay:not(.hidden) .profile-settings-box button,
    #stats-overlay:not(.hidden) .stats-box button,
    #quest-stats-overlay:not(.hidden) .stats-box button,
    #proficiency-overlay:not(.hidden) .prof-overlay-box button,
    #pending-activities-popup:not(.hidden) .login-box button,
    #session-report-overlay:not(.hidden) #session-report-content button,
    #leaderboard-overlay:not(.hidden) #leaderboard-content button,
    #mobile-sidebar-drawer.open .mobile-drawer-panel button,
    #chat-box.visible #chat-send-btn,
    .quest-popup-overlay.show .quest-popup-title,
    .quest-popup-overlay.show .quest-popup-actions,
    .quest-popup-overlay.show .qr-divider,
    .quest-popup-overlay.show .qr-title,
    .quest-popup-overlay.show .qr-difficulty-row,
    .quest-popup-overlay.show .quest-feedback-categories,
    .quest-popup-overlay.show #quest-comment,
    .quest-popup-overlay.show .qr-submit-btn,
    #landing-home.animating .landing-card,
    #landing-greeting.animating,
    #landing-subview.animating,
    .prof-stat-card.animate-in,
    .notes-box .note-item.animate-in,
    .quests-box .note-item.animate-in,
    #note-view.view-entering,
    #note-view.view-entering>*,
    #quest-view.view-entering,
    #quest-view.view-entering>*,
    #quest-alternatives-container.animate-list .quest-alt,
    #quest-resolution-box.animate-in,
    #session-bar:not([hidden]),
    #empty-state:not([hidden]),
    #trilha-view.view-entering,
    #chat-fab.animate-in,
    footer.animate-in,
    #sidebar .section-header.animate-in,
    #content.animating>*,
    .report-shell.animating>* {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

@keyframes uiOverlayFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes uiSurfaceFloat {
    from {
        opacity: 0;
        transform: translate3d(0, 2.6rem, 0) scale(0.972);
        filter: blur(12px);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}

@keyframes uiChildCascade {
    from {
        opacity: 0;
        transform: translate3d(0, 1.4rem, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes uiDrawerBackdrop {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#login-overlay:not(.hidden),
#profile-settings-overlay:not(.hidden),
#stats-overlay:not(.hidden),
#quest-stats-overlay:not(.hidden),
#proficiency-overlay:not(.hidden),
#pending-activities-popup:not(.hidden),
#session-report-overlay:not(.hidden),
#leaderboard-overlay:not(.hidden) {
    animation: uiOverlayFade 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

#login-overlay:not(.hidden) .login-box,
#profile-settings-overlay:not(.hidden) .profile-settings-box,
#stats-overlay:not(.hidden) .stats-box,
#quest-stats-overlay:not(.hidden) .stats-box,
#proficiency-overlay:not(.hidden) .prof-overlay-box,
#pending-activities-popup:not(.hidden) .login-box,
#session-report-overlay:not(.hidden) #session-report-content,
#leaderboard-overlay:not(.hidden) #leaderboard-content {
    animation: uiSurfaceFloat 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
    transform-origin: center bottom;
}

#mobile-sidebar-drawer.open .mobile-drawer-backdrop {
    animation: uiDrawerBackdrop 360ms ease both;
}

#mobile-sidebar-drawer.open .mobile-drawer-panel,
#chat-box.visible {
    animation: uiSurfaceFloat 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
    transform-origin: center bottom;
}

#login-overlay:not(.hidden) .login-box>*,
#profile-settings-overlay:not(.hidden) .profile-settings-box>*,
#stats-overlay:not(.hidden) .stats-box>*,
#quest-stats-overlay:not(.hidden) .stats-box>*,
#proficiency-overlay:not(.hidden) .prof-overlay-box>*,
#pending-activities-popup:not(.hidden) .login-box>*,
#session-report-overlay:not(.hidden) #session-report-content>*,
#leaderboard-overlay:not(.hidden) #leaderboard-content>*,
#mobile-sidebar-drawer.open .mobile-drawer-panel>*,
#chat-box.visible .chat-header,
#chat-box.visible .chat-messages>*,
#chat-box.visible .chat-input-bar {
    opacity: 0;
    animation: uiChildCascade 640ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

#login-overlay:not(.hidden) .login-box>*:nth-child(1),
#profile-settings-overlay:not(.hidden) .profile-settings-box>*:nth-child(1),
#stats-overlay:not(.hidden) .stats-box>*:nth-child(1),
#quest-stats-overlay:not(.hidden) .stats-box>*:nth-child(1),
#proficiency-overlay:not(.hidden) .prof-overlay-box>*:nth-child(1),
#pending-activities-popup:not(.hidden) .login-box>*:nth-child(1),
#session-report-overlay:not(.hidden) #session-report-content>*:nth-child(1),
#leaderboard-overlay:not(.hidden) #leaderboard-content>*:nth-child(1),
#mobile-sidebar-drawer.open .mobile-drawer-panel>*:nth-child(1),
#chat-box.visible .chat-header,
#chat-box.visible .chat-messages>*:nth-child(1),
#chat-box.visible .chat-input-bar {
    animation-delay: 110ms;
}

#login-overlay:not(.hidden) .login-box>*:nth-child(2),
#profile-settings-overlay:not(.hidden) .profile-settings-box>*:nth-child(2),
#stats-overlay:not(.hidden) .stats-box>*:nth-child(2),
#quest-stats-overlay:not(.hidden) .stats-box>*:nth-child(2),
#proficiency-overlay:not(.hidden) .prof-overlay-box>*:nth-child(2),
#pending-activities-popup:not(.hidden) .login-box>*:nth-child(2),
#session-report-overlay:not(.hidden) #session-report-content>*:nth-child(2),
#leaderboard-overlay:not(.hidden) #leaderboard-content>*:nth-child(2),
#mobile-sidebar-drawer.open .mobile-drawer-panel>*:nth-child(2),
#chat-box.visible .chat-messages>*:nth-child(2) {
    animation-delay: 180ms;
}

#login-overlay:not(.hidden) .login-box>*:nth-child(3),
#profile-settings-overlay:not(.hidden) .profile-settings-box>*:nth-child(3),
#stats-overlay:not(.hidden) .stats-box>*:nth-child(3),
#quest-stats-overlay:not(.hidden) .stats-box>*:nth-child(3),
#proficiency-overlay:not(.hidden) .prof-overlay-box>*:nth-child(3),
#pending-activities-popup:not(.hidden) .login-box>*:nth-child(3),
#session-report-overlay:not(.hidden) #session-report-content>*:nth-child(3),
#leaderboard-overlay:not(.hidden) #leaderboard-content>*:nth-child(3),
#mobile-sidebar-drawer.open .mobile-drawer-panel>*:nth-child(3),
#chat-box.visible .chat-messages>*:nth-child(3) {
    animation-delay: 250ms;
}

#login-overlay:not(.hidden) .login-box>*:nth-child(4),
#profile-settings-overlay:not(.hidden) .profile-settings-box>*:nth-child(4),
#stats-overlay:not(.hidden) .stats-box>*:nth-child(4),
#quest-stats-overlay:not(.hidden) .stats-box>*:nth-child(4),
#proficiency-overlay:not(.hidden) .prof-overlay-box>*:nth-child(4),
#pending-activities-popup:not(.hidden) .login-box>*:nth-child(4),
#session-report-overlay:not(.hidden) #session-report-content>*:nth-child(4),
#leaderboard-overlay:not(.hidden) #leaderboard-content>*:nth-child(4),
#mobile-sidebar-drawer.open .mobile-drawer-panel>*:nth-child(4),
#chat-box.visible .chat-messages>*:nth-child(4) {
    animation-delay: 320ms;
}

#login-overlay:not(.hidden) .login-box>*:nth-child(5),
#profile-settings-overlay:not(.hidden) .profile-settings-box>*:nth-child(5),
#stats-overlay:not(.hidden) .stats-box>*:nth-child(5),
#quest-stats-overlay:not(.hidden) .stats-box>*:nth-child(5),
#proficiency-overlay:not(.hidden) .prof-overlay-box>*:nth-child(5),
#pending-activities-popup:not(.hidden) .login-box>*:nth-child(5),
#session-report-overlay:not(.hidden) #session-report-content>*:nth-child(5),
#leaderboard-overlay:not(.hidden) #leaderboard-content>*:nth-child(5),
#mobile-sidebar-drawer.open .mobile-drawer-panel>*:nth-child(5),
#chat-box.visible .chat-messages>*:nth-child(5) {
    animation-delay: 390ms;
}

#login-overlay:not(.hidden) .login-box button,
#profile-settings-overlay:not(.hidden) .profile-settings-box button,
#stats-overlay:not(.hidden) .stats-box button,
#quest-stats-overlay:not(.hidden) .stats-box button,
#proficiency-overlay:not(.hidden) .prof-overlay-box button,
#pending-activities-popup:not(.hidden) .login-box button,
#session-report-overlay:not(.hidden) #session-report-content button,
#leaderboard-overlay:not(.hidden) #leaderboard-content button,
#mobile-sidebar-drawer.open .mobile-drawer-panel button,
#chat-box.visible #chat-send-btn {
    opacity: 0;
    animation: uiChildCascade 660ms cubic-bezier(0.22, 1, 0.36, 1) 220ms both;
}

/* ── REUSABLE ENTRANCE KEYFRAMES ────────────────────── */

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translate3d(0, 1.6rem, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translate3d(0, 1.6rem, 0) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes listCascade {
    from {
        opacity: 0;
        transform: translate3d(0, 1rem, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes viewReveal {
    from {
        opacity: 0;
        transform: translate3d(0, 2rem, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes altSlideIn {
    from {
        opacity: 0;
        transform: translate3d(-1.2rem, 0, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes sessionBarSlide {
    from {
        opacity: 0;
        transform: translate3d(0, 100%, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes emptyStateReveal {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fabBounce {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    60% {
        opacity: 1;
        transform: scale(1.06);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}


/* ── PODIO / RANKING BAR VISIBILITY ────────────────── */
.ranking-card {
    display: block !important;
    visibility: visible !important;
}

.ranking-card .landing-main-btn {
    display: flex !important;
}

#prof-box-global {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.quest-active #session-bar:not([hidden]) {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ── LANDING CARDS ENTRANCE ─────────────────────────── */

#landing-home.animating .landing-card {
    opacity: 0;
    animation: cardReveal 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* coluna esquerda: areas-grid (5 cards) — stagger 100ms */
#landing-home.animating .landing-areas-grid .landing-card:nth-child(1) {
    animation-delay: 0ms;
}

#landing-home.animating .landing-areas-grid .landing-card:nth-child(2) {
    animation-delay: 100ms;
}

#landing-home.animating .landing-areas-grid .landing-card:nth-child(3) {
    animation-delay: 200ms;
}

#landing-home.animating .landing-areas-grid .landing-card:nth-child(4) {
    animation-delay: 300ms;
}

#landing-home.animating .landing-areas-grid .landing-card:nth-child(5) {
    animation-delay: 400ms;
}

/* coluna direita: card de trilhas (após areas terminar) */
#landing-home.animating .landing-column:last-child>.landing-card.student-only-block:nth-child(1) {
    animation-delay: 500ms;
}

/* coluna direita: others-grid (3 cards) — após trilhas */
#landing-home.animating .landing-others-grid .landing-card:nth-child(1) {
    animation-delay: 600ms;
}

#landing-home.animating .landing-others-grid .landing-card:nth-child(2) {
    animation-delay: 700ms;
}

#landing-home.animating .landing-others-grid .landing-card:nth-child(3) {
    animation-delay: 800ms;
}

/* ── LANDING GREETING ──────────────────────────────── */

#landing-greeting.animating {
    opacity: 0;
    animation: fadeSlideUp 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── LANDING SUBVIEW ───────────────────────────────── */

#landing-subview:not([hidden]) {
    animation: fadeSlideUp 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.landing-card-sub {
    animation: fadeSlideUp 490ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── PROF STAT CARDS ───────────────────────────────── */

.prof-stat-card.animate-in {
    opacity: 0;
    animation: fadeSlideUp 550ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.prof-stats-row .prof-stat-card.animate-in:nth-child(1) {
    animation-delay: 0ms;
}

.prof-stats-row .prof-stat-card.animate-in:nth-child(2) {
    animation-delay: 110ms;
}

.prof-stats-row .prof-stat-card.animate-in:nth-child(3) {
    animation-delay: 220ms;
}

/* ── SIDEBAR LIST ITEMS (notes + quests) ───────────── */

.notes-box .note-item.animate-in,
.quests-box .note-item.animate-in {
    opacity: 0;
    animation: listCascade 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* stagger set via inline --stagger in JS */
.notes-box .note-item.animate-in,
.quests-box .note-item.animate-in {
    animation-delay: var(--stagger, 0ms);
}

/* ── NOTE VIEW ENTRANCE ────────────────────────────── */

#note-view.view-entering {
    animation: viewReveal 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

#note-view.view-entering #note-header {
    opacity: 0;
    animation: fadeSlideUp 520ms cubic-bezier(0.22, 1, 0.36, 1) 0ms both;
}

#note-view.view-entering #note-scroll {
    opacity: 0;
    animation: fadeSlideUp 520ms cubic-bezier(0.22, 1, 0.36, 1) 160ms both;
}

#note-view.view-entering #backlinks-bar:not([hidden]) {
    opacity: 0;
    animation: fadeSlideUp 470ms cubic-bezier(0.22, 1, 0.36, 1) 260ms both;
}

#note-view.view-entering #vinculos-bar:not([hidden]) {
    opacity: 0;
    animation: fadeSlideUp 470ms cubic-bezier(0.22, 1, 0.36, 1) 340ms both;
}

/* ── QUEST VIEW ENTRANCE ───────────────────────────── */

#quest-view.view-entering {
    animation: viewReveal 570ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

#quest-view.view-entering #quest-header {
    opacity: 0;
    animation: fadeSlideUp 520ms cubic-bezier(0.22, 1, 0.36, 1) 0ms both;
}

#quest-view.view-entering #quest-content {
    opacity: 0;
    animation: fadeSlideUp 520ms cubic-bezier(0.22, 1, 0.36, 1) 130ms both;
}

#quest-view.view-entering #quest-alternatives-container {
    opacity: 0;
    animation: fadeSlideUp 520ms cubic-bezier(0.22, 1, 0.36, 1) 260ms both;
}

#quest-view.view-entering #btn-submit-answer {
    opacity: 0;
    animation: fadeSlideUp 470ms cubic-bezier(0.22, 1, 0.36, 1) 390ms both;
}

#quest-view.view-entering #quest-meta {
    opacity: 0;
    animation: fadeSlideUp 470ms cubic-bezier(0.22, 1, 0.36, 1) 470ms both;
}

/* ── QUEST ALTERNATIVES CASCADE ────────────────────── */

#quest-alternatives-container.animate-list .quest-alt {
    opacity: 0;
    animation: altSlideIn 470ms cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--stagger, 0ms);
}

/* ── QUEST RESOLUTION BOX ──────────────────────────── */

#quest-resolution-box.animate-in {
    opacity: 0;
    animation: fadeSlideUp 680ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── SESSION BAR ───────────────────────────────────── */

#session-bar:not([hidden]) {
    animation: sessionBarSlide 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── EMPTY STATE ───────────────────────────────────── */

#empty-state:not([hidden]) {
    animation: emptyStateReveal 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── TRILHA VIEW ───────────────────────────────────── */

#trilha-view.view-entering {
    animation: viewReveal 570ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── CHAT FAB ──────────────────────────────────────── */

#chat-fab.animate-in {
    opacity: 0;
    animation: fabBounce 780ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── FOOTER ────────────────────────────────────────── */

footer.animate-in {
    opacity: 0;
    animation: fadeSlideUp 780ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── DASHBOARD ENTRANCE ────────────────────────────── */

#content.animating>#student-header,
#content.animating>#top-row>* {
    opacity: 0;
    animation: fadeSlideUp 580ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

#content.animating>#top-row> :nth-child(1) {
    animation-delay: 0ms;
}

#content.animating>#top-row> :nth-child(2) {
    animation-delay: 120ms;
}

#content.animating>#top-row> :nth-child(3) {
    animation-delay: 240ms;
}

#content.animating>#top-row> :nth-child(4) {
    animation-delay: 360ms;
}

#content.animating>#top-row> :nth-child(5) {
    animation-delay: 480ms;
}

#content.animating>#top-row> :nth-child(6) {
    animation-delay: 600ms;
}

#content.animating>.section-stack>*,
#content.animating>#exp-carousel-section,
#content.animating>#lesson-carousel-section,
#content.animating>#bottom-grid {
    opacity: 0;
    animation: fadeSlideUp 580ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

#content.animating>#student-header {
    animation-delay: 0ms;
}

/* ── RELATÓRIO ENTRANCE ───────────────────────────── */

.report-shell.animating>.report-header,
.report-shell.animating>.section-label,
.report-shell.animating>.report-card,
.report-shell.animating>.perf-section-label,
.report-shell.animating>#rel-carousels-container,
.report-shell.animating>#connection-graph-box {
    opacity: 0;
    animation: fadeSlideUp 580ms cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--stagger, 0ms);
}

/* ── SECTION HEADERS (sidebar) ─────────────────────── */

#sidebar .section-header.animate-in {
    opacity: 0;
    animation: fadeSlideUp 490ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* topbar */
#topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: transparent;
    display: flex;
    align-items: center;
    gap: 1vw;
    padding: 0 2vw;
    z-index: 1;
    pointer-events: auto;
}

#topbar-logo {
    display: flex;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    white-space: nowrap;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;

    /* Text glassmorphism / transparency reflecting background */
    color: var(--text);
    transition: transform 0.2s ease, filter 0.2s ease;
}

#topbar-logo:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

#topbar-logo svg {
    width: 2rem;
    height: 2rem;
    opacity: 0.7;
}

#sidebar-search {
    padding: 1rem 2rem 0.6rem;
    flex-shrink: 0;
}

#topbar-search,
#topbar-search-quest {
    width: 100%;
    background: var(--surface);
    border: 0px;
    border-radius: 99px;
    color: var(--text);
    font-family: inherit;
    font-size: 1.2rem;
    padding: 0.7rem 1.2rem;
    outline: none;
    transition: background 0.2s;
}

#topbar-search:focus,
#topbar-search-quest:focus {
    background: color-mix(in srgb, var(--orange) 8%, var(--bg));
}

#topbar-search::placeholder,
#topbar-search-quest::placeholder {
    color: var(--text-muted);
}

#topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1vw;
    min-width: 0;
}

#note-count {
    font-size: 1.1rem;
    color: var(--text-muted);
    white-space: nowrap;
}

#btn-settings,
#btn-toggle-graph,
#btn-stats {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 2vw;
    white-space: nowrap;
    transition: color 0.18s;
}

#btn-note-studio {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 2.7rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        color 0.18s ease,
        opacity 0.18s ease;
}

body.is-teacher-mode #btn-note-studio {
    display: inline-flex;
}

#topbar-user-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 999px;
    min-width: 0;
    max-width: 100%;
    background: transparent;
    border: 0px solid color-mix(in srgb, var(--border) 82%, transparent);
    overflow: visible;
}

#btn-login-status {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.7rem;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    transition: background 0.18s;
    min-height: 0;
    border-radius: 999px;
}

#btn-login-status:hover {
    background: color-mix(in srgb, var(--surface2) 72%, transparent);
}

#btn-login-status-text {
    display: block;
    min-width: 0;
    font-size: inherit;
    font-weight: inherit;
    max-width: 100%;
    padding-bottom: 5%;
    line-height: 1.15;
    overflow: visible;
    text-overflow: clip;
}

#btn-user-settings {
    display: none !important;
    width: 0;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition:
        background 0.18s,
        color 0.18s;
}

#btn-user-settings:hover {
    background: color-mix(in srgb, var(--surface2) 85%, transparent);
    color: var(--text);
}

#btn-user-settings svg {
    width: 1.15rem;
    height: 1.15rem;
}

.user-chip-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    flex-shrink: 0;
    object-fit: cover;
}

.user-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--g-purple) 78%, white 22%) 0%,
            color-mix(in srgb, var(--g-pink) 80%, white 20%) 100%);
    color: #163042;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

#user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.7rem);
    right: 0;
    min-width: 13rem;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    border-radius: 1rem;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
    padding: 0.45rem;
    z-index: 1001;
}

#user-menu-dropdown[hidden] {
    display: none !important;
}

.user-menu-btn {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s;
}

.user-menu-btn:hover {
    background: color-mix(in srgb, var(--surface2) 80%, transparent);
}

#btn-settings:hover,
#btn-toggle-graph:hover,
#btn-stats:hover,
#btn-note-studio:hover {
    color: var(--text);
}

#btn-note-studio:hover {
    transform: translateY(-1px);
    background: color-mix(in srgb, var(--surface2) 80%, transparent);
}

#btn-settings svg {
    display: block;
    width: 2rem;
    height: 2rem;
    transition: opacity 0.3s;
}

#theme-icon-moon {
    display: none;
}

#topbar-settings-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

#settings-dropdown {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    min-width: 18rem;
    max-width: min(22rem, 90vw);
    background: var(--surface);
    border: 0px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.9rem;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    z-index: 1000;
}

[data-theme="dark"] #settings-dropdown {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] #topbar-user-wrap,
[data-theme="dark"] #user-menu-dropdown {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.34);
}

#settings-dropdown[hidden] {
    display: none !important;
}

#settings-theme-btn {
    width: 100%;
    display: block;
    text-align: left;
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    border: none;
    border-radius: 0.6rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    text-transform: lowercase;
    transition: background 0.15s;
}

#settings-theme-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] #settings-theme-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* layout */
#app {
    display: flex;
    height: 100vh;
    padding: var(--header-h) 2vw 2vw;
    gap: 1vw;
    position: relative;
}

#sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.sidebar-box {
    background: var(--surface);
    border-radius: 1.4rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.sidebar-box.notes-box {
    flex: 0 0 auto;
    max-height: 40%;
}

.sidebar-box.quests-box {
    flex: 1;
}

/* ── 3 stat boxes (proficiência, acertos, %) ── */
.prof-stats-row {
    display: flex;
    gap: 0.6rem;
    flex: 0 0 auto;
}

.prof-stat-card {
    flex: 1;
    background: var(--surface);
    border-radius: 1.2rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.6rem 0.8rem;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background 0.2s;
    min-height: 7rem;
}

.prof-stat-card:hover {
    background: color-mix(in srgb, var(--orange) 8%, var(--surface));
}

.prof-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.prof-stat-value {
    font-size: 2rem;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--orange-text);
    letter-spacing: -0.04em;
    line-height: 1;
}

/* pie chart */
.prof-pie-wrap {
    position: relative;
    width: 4.2rem;
    height: 4.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prof-pie-wrap svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.prof-pie-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 3.5;
}

.prof-pie-fg {
    fill: none;
    stroke: var(--orange);
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s ease;
}

.prof-pie-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text);
    letter-spacing: -0.03em;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
    flex-shrink: 0;
}

.quest-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 2rem 0.4rem;
    flex-shrink: 0;
}

.section-header {
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-bottom: 0.5vw;
    opacity: 0;
}

.sidebar-box+.section-header {
    margin-top: 1vw;
}

.quest-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: -0.02em;
    line-height: 1;
}

#btn-random-quest,
.btn-quest-icon {
    background: white;
    border: 0px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0rem;
    width: 2rem;
    height: 2rem;
    color: var(--text-muted);
    transition: all 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    margin-bottom: 0.15vw;
}

#btn-random-quest svg,
.btn-quest-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    transition: transform 0.4s ease;
}

#btn-random-quest:hover,
.btn-quest-icon:hover {
    border-color: var(--orange);
    color: var(--orange-text);
    background: var(--surface2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 126, 54, 0.15);
}

#btn-random-quest:hover svg {
    transform: rotate(15deg) scale(1.1);
}

.btn-quest-icon.active {
    color: var(--orange-text);
    background: color-mix(in srgb, var(--orange) 12%, var(--surface2));
}

#quest-search-bar {
    background: var(--surface);
    border-radius: 1.4rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    padding: 0.8rem 1.2rem;
    margin-bottom: 1vw;
}

#quest-filter-panel {
    background: var(--surface);
    border-radius: 1.4rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    padding: 1rem 1.4rem;
    margin-bottom: 1vw;
    position: relative;
    z-index: 999;
}

#quest-filter-panel .qf-section-label,
#mobile-quest-filters .qf-section-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: lowercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
    margin-top: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.15s;
    user-select: none;
}

#quest-filter-panel .qf-section-label:hover,
#mobile-quest-filters .qf-section-label:hover {
    color: var(--text);
}

#quest-filter-panel .qf-section-label .qf-chevron,
#mobile-quest-filters .qf-section-label .qf-chevron {
    width: 1.2rem;
    height: 1.2rem;
    transition: transform 0.2s;
    opacity: 0.5;
}

#quest-filter-panel .qf-section-label.open .qf-chevron,
#mobile-quest-filters .qf-section-label.open .qf-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

#quest-filter-panel .qf-section-label:first-child {
    margin-top: 0;
}

#notes-list,
#quests-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.8rem 0;
}

#notes-list::-webkit-scrollbar,
#quests-list::-webkit-scrollbar {
    width: 4px;
}

#notes-list::-webkit-scrollbar-thumb {
    background: var(--border);
}

.note-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.9rem var(--pad);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.note-item:hover {
    background: var(--surface2);
}

.note-item.active {
    background: color-mix(in srgb, var(--orange) 8%, var(--surface));
    border-left-color: var(--orange);
}

.note-item-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.note-item-title-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-item-preview {
    font-size: 1.2rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.note-item-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.occurrence-code-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.16rem 0.7rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--orange) 10%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--orange) 24%, transparent);
    color: var(--text);
    font-family: "Manrope", monospace;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    white-space: nowrap;
}

.note-item-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: "Manrope", monospace;
}

/* --- CAIXA DE RESOLUÇÃO / EXPLICAÇÃO --- */
#quest-resolution-box {
    display: none;
    margin-top: 1rem;
    margin-bottom: 8rem;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#quest-resolution-box.visible {
    opacity: 1;
}

.resolution-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.6rem;
    padding: 2.4rem;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.resolution-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.8rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
}

.resolution-header svg {
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.resolution-header h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    text-transform: lowercase;
}

.resolution-body {
    font-size: 1.35rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 2rem;
    text-transform: none !important;
    font-family: var(--font);
}

.resolution-body[hidden] {
    display: none !important;
}

.resolution-body p,
.resolution-summary p,
.resolution-guide-content p,
.resolution-glossary-body p {
    text-transform: none !important;
}

.resolution-summary {
    margin: 0 0 1.8rem;
    padding: 1.4rem 1.6rem;
    border-radius: 1.2rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1.7;
    font-family: var(--font);
}

.resolution-summary[hidden] {
    display: none !important;
}

.resolution-guide-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.resolution-guide-list[hidden] {
    display: none !important;
}

.resolution-guide-item {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 1.2rem;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.resolution-guide-item.is-open {
    background: var(--surface);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.resolution-guide-item.is-current {
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.resolution-guide-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.4rem 1rem;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: background 0.15s;
}

.resolution-guide-toggle:hover {
    background: var(--surface2);
}

.resolution-guide-index {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
    font-family: var(--font);
}

.resolution-guide-item.is-current .resolution-guide-index {
    background: var(--text);
    color: var(--surface);
    border-color: var(--text);
}

.resolution-guide-title-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.resolution-guide-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.35;
    font-family: var(--font);
}

.resolution-guide-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    height: 2.2rem;
    padding: 0 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.resolution-guide-badge.correct {
    background: color-mix(in srgb, var(--success-light) 22%, var(--surface));
    border-color: color-mix(in srgb, var(--success-light) 42%, transparent);
    color: var(--text);
}

.resolution-guide-badge.wrong {
    background: color-mix(in srgb, var(--danger-dark) 18%, var(--surface));
    border-color: color-mix(in srgb, var(--danger-dark) 38%, transparent);
    color: var(--text);
}

.resolution-guide-content {
    display: none;
    padding: 0 1.4rem 1.4rem 4.6rem;
    color: var(--text);
    font-size: 1.3rem;
    line-height: 1.7;
    font-family: var(--font);
}

.resolution-guide-item.is-open .resolution-guide-content,
.inloco-resolution-popup .resolution-guide-content {
    display: block;
}

.resolution-guide-content ul,
.resolution-guide-content ol,
.resolution-summary ul,
.resolution-summary ol {
    padding-left: 1.4rem;
    margin: 0.7rem 0 0.9rem;
}

.resolution-guide-content li,
.resolution-summary li {
    margin-bottom: 0.45rem;
}

.resolution-guide-content strong,
.resolution-summary strong,
.resolution-alt-body strong {
    color: var(--text);
}

.resolution-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 1.2rem;
    border-radius: 1.2rem;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--border));
}

.resolution-nav[hidden] {
    display: none !important;
}

.resolution-nav-copy {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
    flex: 1;
    min-width: 0;
}

.resolution-progress-container {
    width: 100%;
    display: flex;
    gap: 3px;
    margin-bottom: 0.2rem;
}

.resolution-progress-segment {
    flex: 1;
    height: 6px;
    border-radius: 99px;
    background: var(--surface2);
    transition: background 0.35s ease, transform 0.35s ease;
}

.resolution-progress-segment.completed {
    background: linear-gradient(90deg, var(--g-pink), var(--g-purple));
}

.resolution-progress-segment.active {
    background: linear-gradient(90deg, var(--danger-dark), var(--warn-mid));
    transform: scaleY(1.4);
}

.resolution-nav-kicker {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-family: var(--font);
}

.resolution-nav-progress {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    font-family: var(--font);
}

.resolution-next-btn {
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 999px;
    padding: 0.75rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
    white-space: nowrap;
}

.resolution-next-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.resolution-next-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.resolution-alts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resolution-alt-item {
    background: var(--surface);
    border-radius: 1.2rem;
    padding: 1.2rem 1.4rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border);
}

.resolution-alt-letter {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--text);
    font-size: 1.1rem;
}

.resolution-alt-item.correct {
    background: color-mix(in srgb, var(--success-light) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--success-light) 40%, transparent);
}

.resolution-alt-item.correct .resolution-alt-letter {
    background: var(--success-light);
    color: white;
}

.resolution-alt-item.wrong {
    background: color-mix(in srgb, var(--danger-dark) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--danger-dark) 35%, transparent);
}

.resolution-alt-item.wrong .resolution-alt-letter {
    background: var(--danger-dark);
    color: white;
}

.resolution-alt-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.5;
    padding-top: 0.3rem;
}

.resolution-alt-body {
    font-size: 1.03rem;
    line-height: 1.6;
    color: var(--text);
    text-transform: none !important;
}

.resolution-glossary-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.resolution-glossary-item {
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface);
    overflow: hidden;
}

.resolution-glossary-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    font: inherit;
    color: var(--text);
    text-align: left;
}

.resolution-glossary-term {
    font-size: 1rem;
    font-weight: 800;
}

.resolution-glossary-body {
    display: none;
    padding: 0 1rem 1rem;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.55;
    text-transform: none !important;
}

.resolution-glossary-list,
.resolution-glossary-item,
.glossary-term {
    display: none !important;
}

.resolution-glossary-item.is-open .resolution-glossary-body {
    display: block;
}

@media (max-width: 720px) {
    .resolution-card {
        padding: 1.5rem;
    }

    .resolution-guide-toggle {
        grid-template-columns: auto 1fr;
        align-items: flex-start;
    }

    .resolution-guide-badge {
        grid-column: 2;
        justify-self: start;
    }

    .resolution-guide-content {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .resolution-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .resolution-next-btn {
        width: 100%;
        justify-content: center;
    }

    .resolution-alt-item {
        padding: 1rem 1.05rem;
    }
}

.res-fb-btn {
    background: var(--surface2);
    font-family: var(--font);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.55rem 1.1rem;
    border-radius: 99px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.res-fb-btn:hover {
    background: var(--surface);
    border-color: var(--text-muted);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.res-fb-btn.selected {
    background: var(--text);
    border-color: var(--text);
    color: var(--surface);
}

.note-tag {
    font-size: 0.85rem;
    padding: 0.1rem 0.6rem;
    backgrounda: var(--surface2);
    border-radius: 99px;
    color: var(--text-muted);
    font-weight: 600;
}

/* type dot removed */

.type-dot.forte {
    background: var(--orange);
}

.type-dot.fraca {
    background: var(---success-light);
}

/* ── filtros de questões ── */
#quest-filters {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.qf-row {
    display: none;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-bottom: 0.4rem;
}

.qf-row.open {
    display: flex;
}

.qf-collapsible-content {
    display: none;
    padding-bottom: 0.4rem;
}

.qf-collapsible-content.open {
    display: block;
    max-height: 12rem;
    overflow-y: auto;
}

.qf-pill {
    font-size: 1.2rem;
    padding: 0.3rem 0.9rem;
    border-radius: 99px;
    border: 0px solid var(--border);
    background: var(--surface2);
    color: var(--text-contrast);
    cursor: pointer;
    font-family: inherit;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
    white-space: nowrap;
}

.qf-pill:hover {
    border-color: var(--orange);
    color: var(--text);
}

.qf-pill.qf-active {
    background: color-mix(in srgb, var(--orange) 15%, var(--surface));
    border-color: var(--orange);
    color: var(--text);
    font-weight: 600;
}

.qf-list {
    display: none;
    flex-direction: column;
    gap: 0.1rem;
    margin-top: 0.3rem;
}

.qf-list.open {
    display: flex;
}

.qf-list-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition:
        border-color 0.15s,
        color 0.15s;
}

.qf-list-toggle:hover {
    border-color: var(--orange);
    color: var(--text);
}

.qf-list-toggle.has-active {
    border-color: var(--orange);
    color: var(--text);
}

.qf-list-toggle svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.qf-list-toggle.open svg {
    transform: rotate(180deg);
}

.qf-list-item {
    font-size: 1.05rem;
    padding: 0.35rem 0.7rem;
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    border: 1px solid transparent;
    background: none;
    font-family: inherit;
    text-align: left;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
}

.qf-list-item:hover {
    background: var(--surface2);
    color: var(--text);
}

.qf-list-item.qf-active {
    background: color-mix(in srgb, var(--orange) 12%, var(--surface));
    border-color: var(--orange);
    color: var(--text);
    font-weight: 600;
}

/* ── sub-grupos de habilidades ── */
.qf-disc-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1.2rem 0.7rem 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.4rem;
}

.qf-sub-group {
    margin-bottom: 0.2rem;
}

.qf-sub-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0.6rem 0.7rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    border-radius: 0.6rem;
    transition: background 0.2s;
}

.qf-sub-group-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.qf-sub-group-filter {
    border: 1px solid var(--border);
    background: var(--surface2);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s,
        color 0.15s;
    white-space: nowrap;
}

.qf-sub-group-filter:hover {
    background: color-mix(in srgb, var(--orange) 8%, var(--surface2));
    border-color: var(--orange);
    color: var(--text);
}

.qf-sub-group-filter.is-active {
    background: color-mix(in srgb, var(--orange) 12%, var(--surface));
    border-color: var(--orange);
    color: var(--text);
}

.qf-sub-group-header:hover {
    background: var(--surface2);
}

.qf-sub-group-header.has-active {
    color: var(--orange-text);
}

.qf-sub-group-header svg {
    width: 0.9rem;
    height: 0.9rem;
    transition: transform 0.2s;
    opacity: 0.6;
}

.qf-sub-group-header.open svg {
    transform: rotate(180deg);
}

.qf-sub-group-list {
    display: none;
    flex-direction: column;
    gap: 0.1rem;
    padding-left: 1rem;
    margin-top: 0.2rem;
    border-left: 1px solid var(--border);
    margin-left: 1.1rem;
}

.qf-sub-group-list.open {
    display: flex;
}

.qf-hab-count {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    background: var(--surface2);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

/* ── metadata da questão ── */
#quest-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 3rem;
    margin-bottom: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}

.qm-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.qm-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.qm-chip {
    background: var(--surface2);
    border: 0px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.25rem 0.8rem;
    font-size: 1.1rem;
    color: var(--text);
    cursor: pointer;
    transition:
        border-color 0.15s,
        background 0.15s;
}

.qm-chip:hover {
    border-color: var(--orange);
    background: color-mix(in srgb, var(--orange) 6%, var(--surface2));
}

.qm-chip.qm-active {
    border-color: var(--orange);
    background: color-mix(in srgb, var(--orange) 12%, var(--surface2));
}

/* ── parâmetros TRI ── */
.qm-tri-row {
    gap: 0.8rem;
}

.qm-tri-param {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    background: var(--surface2);
    border-radius: 0.7rem;
    padding: 0.25rem 0.8rem;
}

.qm-tri-key {
    font-family: var(--font-mono, monospace);
    font-size: 1rem;
    font-weight: 700;
    color: var(--orange-text);
}

.qm-tri-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.qm-tri-val {
    font-family: var(--font-mono, monospace);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

/* ── painel de avaliação de dificuldade ── */
#quest-rating-panel {
    margin-top: 2rem;
    padding: 1.4rem 0 0.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.qr-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
}

.quest-feedback-categories {
    width: 100%;
}

.quest-feedback-categories .ix-feedback-modal-content {
    background: transparent;
    border: none;
    padding: 0;
}

.quest-feedback-categories .ix-feedback-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.quest-feedback-categories .ix-feedback-option {
    width: auto;
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    border-radius: 99px;
}

.quest-feedback-categories .ix-feedback-textarea-row {
    margin-top: 0.5rem;
}

.qr-difficulty-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.qr-diff-btn {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    border: 0px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.qr-diff-btn:hover {
    border-color: var(--orange);
    color: var(--text);
}

.qr-diff-btn.selected {
    background: color-mix(in srgb, var(--orange) 15%, var(--surface));
    border-color: var(--orange);
    color: var(--text);
    font-weight: 700;
}

#quest-comment {
    width: 100%;
    min-height: 6rem;
    background: var(--surface);
    border: 0px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 1.2rem;
    color: var(--text);
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
}

#quest-comment:focus {
    border-color: var(--orange);
}

.qr-submit-btn {
    align-self: flex-start;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.6rem 1.6rem;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
}

.qr-submit-btn:hover {
    border-color: var(--orange);
    color: var(--orange-text);
}

.qr-submit-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.qr-divider {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* quest modules UI */
#quest-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.quest-alternatives {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin: 2.5rem 0 0;
    width: 100%;
}

.quest-option {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 1.4rem 1.8rem;
    font-size: 1.8rem;
    font: inherit;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    line-height: 1.55;
    font-weight: 400;
    width: 100%;
    text-transform: none !important;
}

.quest-option:hover {
    border-color: var(--orange);
    background: var(--surface2);
}

.quest-option .letter {
    font-weight: 800;
    color: var(--text);
    font: inherit;
    min-width: 1.8rem;
    flex-shrink: 0;
    text-transform: lowercase !important;
    font-size: 1.4rem;
}

.quest-option-text {
    flex: 1;
    min-width: 0;
    text-transform: none !important;
    white-space: normal;
    font-size: 1.4rem;
}

.quest-reference {
    font-size: 1rem;
    color: var(--text-muted);
    text-align: right;
    margin: 1.2rem 0;
    line-height: 1.6;
    font-style: italic;
}

#quest-content .quest-reference p {
    font-size: 1rem;
    text-align: right;
    margin-bottom: 0;
}

.quest-command {
    font-size: 1.4rem;
    color: var(--text);
    margin: 1.2rem 0 0.8rem;
    line-height: 1.7;
    text-transform: none !important;
}

#quest-content {
    font-size: 1.4rem;
    line-height: 1.7;
    text-transform: none !important;
}

#quest-content p {
    font-size: 1.4rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

#quest-content img {
    max-width: 100%;
    border-radius: 0.6rem;
    margin: 0.8rem 0;
}

.quest-option.correct {
    border-color: var(--success-light) !important;
    background: color-mix(in srgb, var(--success-light) 15%, var(--surface)) !important;
}

.quest-option.correct .quest-option-text,
.quest-option.correct .letter {
    color: var(--success-light) !important;
}

.quest-option.incorrect {
    border-color: var(--danger-dark) !important;
    background: color-mix(in srgb, var(--danger-dark) 10%, var(--surface)) !important;
}

.quest-option.incorrect .quest-option-text,
.quest-option.incorrect .letter {
    color: var(--danger-dark) !important;
}

.quest-option.is-marked-by-user,
.quest-option.is-marked-by-user .quest-option-text,
.quest-option.is-marked-by-user .letter {
    font-weight: 800 !important;
}

.selected-answer-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    margin-top: -0.4rem;
    margin-bottom: 0.8rem;
    letter-spacing: 0.02em;
}

.quest-option.selected-answer {
    border-color: var(--text-muted) !important;
    background: var(--surface2) !important;
    color: var(--text) !important;
}

#btn-submit-answer {
    transition:
        opacity 0.2s,
        background 0.2s;
}

#btn-submit-answer:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#btn-submit-answer:not(:disabled):hover {
    background: color-mix(in srgb, black 10%, var(--success-light));
}

/* backdrop escuro atrás do popup */
#quest-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

#quest-popup-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* popup de erro */
.quest-popup-overlay {
    position: fixed;
    bottom: calc(1.6rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg);
    border: 0px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-radius: 1.2rem;
    padding: 1.6rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.2rem;
    min-width: 28rem;
    max-width: 44rem;
    width: min(44rem, calc(100vw - 2rem));
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

.quest-popup-overlay.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.quest-popup-overlay.show .quest-popup-title,
.quest-popup-overlay.show .quest-popup-actions,
.quest-popup-overlay.show .qr-divider,
.quest-popup-overlay.show .qr-title,
.quest-popup-overlay.show .qr-difficulty-row,
.quest-popup-overlay.show #quest-comment,
.quest-popup-overlay.show .qr-submit-btn {
    opacity: 0;
    animation: uiChildCascade 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quest-popup-overlay.show .quest-popup-title {
    animation-delay: 90ms;
}

.quest-popup-overlay.show .quest-popup-actions {
    animation-delay: 150ms;
}

.quest-popup-overlay.show .qr-divider,
.quest-popup-overlay.show .qr-title {
    animation-delay: 210ms;
}

.quest-popup-overlay.show .qr-difficulty-row {
    animation-delay: 270ms;
}

.quest-popup-overlay.show #quest-comment {
    animation-delay: 330ms;
}

.quest-popup-overlay.show .qr-submit-btn {
    animation-delay: 390ms;
}

.quest-popup-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    width: 100%;
    text-align: center;
}

.quest-popup-actions {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
}

.btn-quest-action {
    background: var(--surface);
    border: 0px solid var(--border);
    padding: 0.8rem 1.6rem;
    border-radius: 99px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    width: 100%;
}

.btn-quest-action:hover {
    color: var(--text);
    background: var(--surface2);
}

.btn-quest-action.btn-primary {
    background: linear-gradient(135deg, #94e2a2, #90c7f4);
    color: #163042;
    font-size: 1.2rem;
    padding: 1rem 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-quest-action.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-quest-action.btn-secondary {
    background: var(--surface);
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.8rem 1.6rem;
}

.btn-quest-action.btn-secondary:hover {
    color: var(--text);
    background: var(--surface);
}



/* content area */
#content-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

#empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 3rem;
    text-align: center;
    gap: 1.6rem;
    color: var(--text-muted);
    flex: 1;
}

#empty-state svg {
    opacity: 0.4;
    margin-bottom: 0.5rem;
}

#empty-state h2 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
}

#empty-state p {
    margin: 0;
    max-width: 32rem;
    line-height: 1.5;
    font-size: 1.4rem;
}

#note-view,
#quest-view,
#trilha-view {
    background: var(--surface);
    border-radius: 1.4rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
}

/* ── TRILHA DE APRENDIZAGEM ── */
#trilha-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 0rem;
    align-items: center;
    position: relative;
    background: var(--bg);
}

#trilha-tabs {
    display: flex;
    gap: 0;
    width: 100%;
    max-width: 600px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface2);
    padding: 0.4rem;
    border-radius: 1.2rem;
    margin: 0rem auto 0;
    flex-shrink: 0;
}

.trilha-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: 0.9rem;
    font-family: "Manrope", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s;
    text-transform: lowercase;
}

.trilha-tab:hover {
    color: var(--text);
}

.trilha-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ── CONTROLES E ABAS DE ALTERNÂNCIA DE TRILHA ── */
.trilha-toggle-tabs {
    display: none;
}

#trilha-tabs {
    margin-top: 0;
}

.trilha-toggle-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0.6rem;
    padding: 0.7rem 1.6rem;
    background: transparent;
    border: none;
    border-radius: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.trilha-toggle-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.trilha-toggle-tab.active {
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .trilha-toggle-tab.active {
    background: var(--surface);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#trilha-temas-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* CARDS DE TEMAS */
.trilha-tema-card {
    background: var(--surface);
    border: 0px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trilha-tema-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.trilha-tema-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.2rem;
    margin-bottom: 1.5rem;
}

.trilha-tema-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.trilha-tema-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.trilha-tema-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.trilha-tema-progress {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.tema-progress-bar {
    width: 60px;
    height: 6px;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
}

.tema-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.tema-progress-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success);
}

/* LISTA DE EXPECTATIVAS/HABILIDADES */
.trilha-tema-habilidades {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.trilha-habilidade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    background: var(--surface2);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.trilha-habilidade-item:hover {
    background: var(--surface3);
    border-color: var(--border);
}

.habilidade-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 75%;
}

.habilidade-tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.habilidade-tag {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.habilidade-tag.enem {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.2);
}

.habilidade-tag.saeb {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
}

.habilidade-desc {
    font-size: 1.3rem;
    color: var(--text);
    line-height: 1.4;
}

.habilidade-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

/* DOMÍNIO VISUAL */
.habilidade-dominio-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

.dominio-score-badge {
    font-size: 1.3rem;
    font-weight: 800;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    color: #fff;
    background: var(--text-muted);
}

.dominio-score-badge.low {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}

.dominio-score-badge.medium {
    background: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
}

.dominio-score-badge.high {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.dominio-label {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* BADGES DE STATUS (SRS/PRAZO) */
.srs-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

.srs-status-badge.atrasado {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.srs-status-badge.agendada {
    background: rgba(245, 158, 11 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* NÓ DE EXAME FINAL DE TEMA */
.node-exame-final {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 0px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exame-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.exame-icon-wrap {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.exame-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.exame-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}

.exame-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.btn-exame-final {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.6rem;
    background: linear-gradient(135deg,
            var(--success-light) 0%,
            var(--success) 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--surface2);
    transition: all 0.2s ease;
}

.btn-exame-final:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px linear-gradient(135deg,
            var(--success-light) 0%,
            var(--success) 100%);
}

.btn-exame-final:disabled {
    background: var(--surface3);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

/* ── TRILHA CONTAINER: carousel mode resets ── */
#trilha-container {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y proximity;
}

/* ── HERO SCREEN (por aulas — viewport) ── */
.tc-hero-screen {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    flex-shrink: 0;
    padding-top: clamp(0.5rem, 2vw, 1.6rem);
    padding-bottom: 3rem;
}

/* aurora boreal background SVG */
.tc-aurora-bg {
    position: fixed;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-51%);
    width: 110vw;
    height: auto;
    pointer-events: none;
    z-index: 0;
    animation: auroraPulse 5s ease-in-out infinite;
}





@keyframes auroraPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ── TIMELINE curva (arco — aula anterior | atual | próxima) ── */
.tc-timeline {
    position: relative;
    width: 100%;
    max-width: 520px;
    height: clamp(8rem, 16vw, 12rem);
    margin: 0 auto;
    padding: 0 0.8rem;
    flex-shrink: 0;
    overflow: visible;
}

.tc-tl-arc {
    position: absolute;
    bottom: -2rem;
    width: calc(90%);
    height: auto;
    pointer-events: none;
    overflow: visible;
}

/* arc curve — blurred glow path + sharp core path stacked in SVG */
.tc-tl-arc path {
    fill: none;
    stroke: color-mix(in srgb, var(--g-purple) 50%, var(--g-pink) 50%);
    stroke-width: 0;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

/* ── CALENDAR DAYS ALONG THE ARC ── */
.tc-calendar {
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: -2rem;
    height: 14rem;
    pointer-events: none;
    z-index: 1;
}

.tc-cal-day {
    position: absolute;
    width: 2.4rem;
    height: 2.4rem;
    margin-left: -1.2rem;
    margin-top: -1.2rem;
    border-radius: 50%;
    border: 0px solid color-mix(in srgb, var(--g-purple) 60%, var(--g-pink) 40%);
    background: var(--surface);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.tc-cal-day:hover,
.tc-cal-day:active {
    background: color-mix(in srgb, var(--g-purple) 25%, var(--surface));
    border-color: var(--g-purple);
    color: var(--text);
    transform: scale(1.25);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.tc-cal-day.tc-cal-active {
    background: linear-gradient(135deg, var(--g-purple), var(--g-pink));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--g-purple) 50%, var(--g-pink) 50%);
}

.tc-handle-label {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: var(--tracking-wide);
}

.tc-handle-arrow {
    flex-shrink: 0;
}

/* ── CARD CAROUSEL (por aulas) ── */
.tc-cards-section {
    width: 100%;
    padding: clamp(0.4rem, 1.5vw, 1rem) 0 0;
    overflow: visible;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}

.tc-carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 1rem;
    align-items: center;
    align-self: stretch;
    padding: 0 clamp(1.2rem, 4vw, 5rem);
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

.tc-carousel-track::-webkit-scrollbar {
    display: none;
}

.tc-card {
    flex: 0 0 min(60vw);
    min-height: clamp(18rem, 35vw, 30rem);
    scroll-snap-align: center;
    border-radius: 2.4rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.35s ease,
        box-shadow 0.35s ease;
    transform: scale(0.84) translateY(8px);
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    color: var(--surface);
    text-align: center;
    position: relative;
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    will-change: transform, opacity;
    overflow: hidden;
}

.tc-card.tc-active {
    transform: scale(1) translateY(0);
    opacity: 1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.tc-card.tc-card-atividade {
    background: linear-gradient(145deg,
            color-mix(in srgb, var(--danger) 55%, transparent) 0%,
            color-mix(in srgb, var(--danger-dark) 55%, transparent) 100%);
}

/* ── TC-CARD FLIP ── */
.tc-card { perspective: 1000px; }
.tc-card-inner {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    width: 100%;
    min-height: clamp(18rem, 35vw, 30rem);
    position: relative;
}
.tc-card.tc-flipped .tc-card-inner { transform: rotateY(180deg); }
.tc-card-front, .tc-card-back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.tc-card-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(2rem, 3vw, 2rem);
    width: 100%;
    min-height: clamp(18rem, 35vw, 30rem);
    padding: clamp(2rem, 2vw, 2rem);
    color: inherit;
}
.tc-card-back {
    transform: rotateY(180deg);
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: clamp(1.5rem, 2vw, 2rem);
    border-radius: 2.4rem;
    background: var(--surface);
    color: var(--text);
    text-align: center;
    overflow-y: auto;
}

/* ── TC-CARD-BACK: dominio ── */
.tc-back-dominio-pct {
    font-family: var(--font-mono);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
}
.tc-back-dominio-label {
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: lowercase;
    margin-top: -0.5rem;
}

/* ── TC-CARD-BACK: info row ── */
.tc-back-info {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 600;
}
.tc-back-info strong { color: var(--text); }

/* ── TC-CARD-BACK: objetivos list ── */
.tc-back-objetivos {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.tc-back-obj-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    text-align: left;
}
.tc-back-obj-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.tc-back-obj-verbo {
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}
.tc-back-obj-title {
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

/* ── TC-CARD-BACK: enem badge ── */
.tc-back-enem {
    font-size: 1rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 99px;
    background: var(--surface2);
    color: var(--text-muted);
}
.tc-back-enem.done {
    background: rgba(148,226,162,.25);
    color: #2d7a4a;
}

.tc-card-date {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.0em;
    font-family: "Manrope", sans-serif;
}

.tc-card-icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--success-light) 0%, var(--success) 100%), 0%;
    border: 3.5px solid var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 -5px 0 rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
    backdrop-filter: blur(2px);
}

.tc-card-icon-wrap svg {
    width: 36px;
    height: 36px;
    stroke: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}

.tc-card-code {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: "Manrope", sans-serif;
    letter-spacing: 0.0em;
    text-transform: lowercase;
}

.tc-card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    max-width: 220px;
}

.tc-card-bullets {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 240px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.tc-card-bullets li {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.35;
    text-transform: lowercase;
}

.tc-card-bullets li::before {
    content: "– ";
    opacity: 0.7;
}

.tc-bullet-label {
    font-weight: 800;
    opacity: 0.75;
}

.tc-card-actions {
    display: flex;
    gap: 0.7rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tc-card.tc-active .tc-card-actions {
    pointer-events: auto;
    opacity: 1;
}

.tc-card-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    border: 0px solid rgba(255, 255, 255, 0.38);
    border-radius: 99px;
    color: white;
    font-family: var(--font);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    text-transform: lowercase;
}

.tc-card-btn-texto {
    background: linear-gradient(145deg, var(--success-light) 0%, var(--success) 100%);

}

.tc-card-btn-quest {
    background: linear-gradient(145deg, var(--danger) 0%, var(--danger-dark) 100%);
}

.tc-card-btn:hover,
.tc-card-btn:active {
    filter: brightness(1.12);
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.tc-card-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ── PATH PULL HANDLE ── */
.tc-path-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: clamp(0.3rem, 1vw, 0.8rem) 2rem clamp(0.2rem, 0.8vw, 0.6rem);
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    -webkit-user-select: none;
    user-select: none;
    flex-shrink: 0;
}

.tc-path-handle:hover {
    color: var(--text);
}

.tc-handle-pill {
    width: 36px;
    height: 4px;
    border-radius: 99px;
    background: var(--border);
    transition: background 0.2s, width 0.2s;
}

.tc-path-handle:hover .tc-handle-pill {
    background: var(--text-muted);
    width: 52px;
}

.tc-handle-label {
    font-size: 1rem;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.06em;
}

/* ── PATH PANEL (revealed on scroll down) ── */
.tc-path-panel {
    width: 100%;
    overflow: visible;
    scroll-snap-align: start;
    padding-bottom: 2rem;
}

.tc-path-close-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 2rem 0.4rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.05em;
}

.tc-path-close-row:hover {
    color: var(--text);
}

/* Inner path — uses the old .trilha-node-wrapper classes */
.tc-path-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1rem 1rem 2rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* SVG inside path-inner */
.tc-path-inner #trilha-svg-path {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    clip-path: inset(0 0 0% 0);
    transition: none;
}

.tc-path-inner #trilha-svg-path path {
    fill: none;
    stroke: var(--border);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.5;
}

/* DIVISOR DE MES */
.trilha-month-divider {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0rem 0;
    z-index: 2;
    /* entrance animation compatibility */
    opacity: 0;
    transform: translate3d(0, 10px, 0);
    transition: opacity 2s cubic-bezier(0.22, 1, 0.36, 1), transform 3s cubic-bezier(0.22, 1, 0.36, 1);
}

.trilha-month-divider.trilha-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.stats-blocked {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    animation: statsFadeIn 0.5s ease-out;
}

.stats-blocked-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.stats-blocked-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.8rem;
    letter-spacing: -0.02em;
}

.stats-blocked-text {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 320px;
}

@keyframes statsFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tmd-label {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: lowercase;
    white-space: nowrap;
}

.tmd-line {
    flex: 1;
    height: 1px;
    border-top: 2px dashed var(--border);
    opacity: 0.5;
}

.trilha-node-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100px;
}

.trilha-node-btn {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 3.5px solid var(--surface);
    background: linear-gradient(135deg,
            var(--success) 0%,
            var(--success-light) 100%);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.15),
        inset 0 -6px 0 rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.trilha-node-btn svg {
    width: 32px;
    height: 32px;
    transform: translateY(-10%);
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Gradientes estilo dashboard */
.trilha-node-btn {
    background: linear-gradient(135deg,
            var(--success-light) 0%,
            var(--success) 100%);
}

.trilha-node-btn.tipo-atividade {
    background: linear-gradient(135deg,
            var(--danger) 0%,
            var(--danger-dark) 100%);
}

.trilha-node-label {
    position: absolute;
    max-width: 180px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    pointer-events: none;
    text-shadow: 0 0 10px var(--surface);
}

.trilha-node-date {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

/* Lado com mais espaço */
.trilha-node-wrapper.align-left .trilha-node-label {
    left: calc(50% - 26px);
    text-align: left;
}

.trilha-node-wrapper.align-right .trilha-node-label {
    right: calc(50% - 26px);
    text-align: right;
}

.trilha-node-wrapper.align-center:nth-child(odd) .trilha-node-label {
    left: calc(50% + 50px);
    text-align: left;
}

.trilha-node-wrapper.align-center:nth-child(even) .trilha-node-label {
    right: calc(50% + 50px);
    text-align: right;
}

/* Lado com mais espaço para as ações */
.trilha-actions {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    left: calc(50% + 40px);
    /* Padrão: vai para a direita */
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    background: var(--surface);
    padding: 1rem;
    border-radius: 1.2rem;
    border: 0px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

/* Se o botão está na direita (ou se moveu para lá), as ações vão para a esquerda */
.trilha-node-wrapper.align-right .trilha-actions {
    left: auto;
    right: calc(50% - 60px);
    transform: translateY(-50%) translateX(-10px);
}

/* Se o botão está na esquerda ou no centro (que se move para a esquerda), as ações vão para a direita */
.trilha-node-wrapper.align-left .trilha-actions,
.trilha-node-wrapper.align-center .trilha-actions {
    right: auto;
    left: calc(50% - 60px);
    transform: translateY(-50%) translateX(10px);
}

.trilha-node-btn.expanded+.trilha-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0) !important;
}

.trilha-node-btn.expanded~.trilha-node-label {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.trilha-action-btn {
    background: var(--surface2);
    border: 0px solid transparent;
    padding: 1rem 1.2rem;
    border-radius: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.trilha-action-btn:hover {
    background: var(--surface);
    border-color: var(--orange);
    color: var(--orange-text);
}

/* Winding Path Shifts */
.trilha-node-wrapper.align-left .trilha-node-btn {
    transform: translateX(-100%);
}

.trilha-node-wrapper.align-right .trilha-node-btn {
    transform: translateX(100%);
}

.trilha-node-wrapper.align-center .trilha-node-btn {
    transform: translateX(0);
}

/* Estado Expandido - Novas Regras */
.trilha-node-wrapper.align-right .trilha-node-btn.expanded {
    transform: translateX(150%) scale(1.1) !important;
}

.trilha-node-wrapper.align-center .trilha-node-btn.expanded,
.trilha-node-wrapper.align-left .trilha-node-btn.expanded {
    transform: translateX(-150%) scale(1.1) !important;
}

.trilha-node-btn:hover {
    filter: brightness(1.1);
}

.trilha-node-btn.expanded {
    box-shadow: 0 0 0 5px var(--surface2);
}

/* note view */
#note-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-transform: none !important;
}

#note-header {
    padding: 1.6rem 0 1.2rem 3rem;
    border-bottom: none;
    background: transparent;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0rem;
}

#note-header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.note-header-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.note-objetivos-info-btn {
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 auto;
    text-transform: none;
}

.note-objetivos-info-btn[hidden] {
    display: none;
}

#note-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#note-title-display {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.note-icon-btn {
    width: 3.2rem;
    height: 3.2rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0px solid var(--border);
    border-radius: 999px;
    background: var(--surface2);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.note-icon-btn:hover {
    background: var(--surface2);
    color: var(--text);
    transform: translateY(-1px);
}

.note-icon-btn svg {
    width: 1.45rem;
    height: 1.45rem;
}

.note-icon-minimize {
    display: none;
}

#note-view.note-fullscreen .note-icon-maximize {
    display: none;
}

#note-view.note-fullscreen .note-icon-minimize {
    display: block;
}

body.note-fullscreen-active {
    overflow: hidden;
}

/* ── TTS — Text-to-Speech ────────────────────────────── */

#note-tts-btn[hidden] { display: none; }

#note-tts-btn { display: none !important; }

#note-tts-btn.playing {
    background: transparent;
    color: #fff;
}

#note-tts-btn.loading {
    background: transparent;
    color: var(--text-muted);
}

.note-tts-icon-pause,
.note-tts-icon-loading {
    display: none;
}

#note-tts-btn.playing .note-tts-icon-play { display: none; }
#note-tts-btn.playing .note-tts-icon-pause { display: block; }
#note-tts-btn.loading .note-tts-icon-play { display: none; }
#note-tts-btn.loading .note-tts-icon-loading {
    display: block;
    animation: tts-spin 1s linear infinite;
}

@keyframes tts-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mini-barra de controles TTS */
#note-tts-controls[hidden] { display: none; }

.tts-controls-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 3rem;
    background: var(--surface2);
    border-bottom: 1px solid rgba(0,0,0,.06);
    flex-shrink: 0;
}

.tts-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
    animation: tts-pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes tts-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.tts-status-label {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    text-transform: lowercase;
    color: var(--text-muted);
    letter-spacing: var(--tracking-wide);
}

.tts-rate-group {
    display: flex;
    gap: 0.3rem;
    margin-left: auto;
}

.tts-rate-btn {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    padding: 0.25rem 0.7rem;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: var(--tracking-wide);
}

.tts-rate-btn:hover {
    background: var(--surface);
    color: var(--text);
}

.tts-rate-btn.active {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
}

/* Destaque de palavras durante leitura */
.tts-word {
    transition: background 0.15s ease, color 0.15s ease;
    border-radius: 3px;
    padding: 0 1px;
}

.tts-word--active {
    background: var(--orange);
    color: #fff;
    border-radius: 3px;
}

/* Narrador — bloco oculto */
.ix-narrador[hidden] {
    display: none;
}

#note-view.note-fullscreen {
    position: fixed !important;
    inset: 0;
    z-index: 1200;
    width: 100dvw !important;
    height: 100dvh !important;
    min-height: 100dvh;
    max-height: 100dvh;
    background: var(--surface);
    border-radius: 0;
}

#note-view.note-fullscreen #note-header {
    padding: 1.4rem clamp(1.6rem, 4vw, 4rem) 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

#note-view.note-fullscreen #note-scroll {
    padding: 1.2rem clamp(1.6rem, 6vw, 6rem);
}

#note-view.note-fullscreen #preview-content {
    max-width: 920px;
    margin: 0 auto;
}

#note-view.note-fullscreen #note-pagination {
    padding-left: clamp(1.6rem, 4vw, 4rem);
    padding-right: clamp(1.6rem, 4vw, 4rem);
}

#note-meta-display {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-top: 0.6rem;
    font-size: 1rem;
    color: var(--text-muted);
    font-family: "Manrope", monospace;
}

#note-tags-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

/* type badge removed */

#note-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0rem 3rem;
    background: transparent;
}

#note-scroll::-webkit-scrollbar {
    width: 4px;
}

#note-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
}

/* markdown */
#preview-content {
    max-width: 100%;
    text-transform: none;
}

.note-page {
    min-height: 100%;
    padding-bottom: 0.4rem;
    animation: notePageFade 0.22s ease;
}

.note-page[hidden] {
    display: none !important;
}

@keyframes notePageFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#preview-content h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    letter-spacing: -0.02em;
}

#preview-content h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0.8rem 0 1rem;
}

#preview-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 1.6rem 0 0.8rem;
}

#preview-content p {
    font-size: 1.6rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

#preview-content ul,
#preview-content ol {
    margin: 0 0 1.2rem 2rem;
}

#preview-content li {
    font-size: 1.4rem;
    line-height: 1.7;
    margin-bottom: 0.4rem;
}

#preview-content code {
    font-family: "Manrope", monospace;
    font-size: 1.1rem;
    background: var(--surface2);
    padding: 0.1em 0.4em;
}

#preview-content pre {
    background: var(--surface2);
    padding: 1.2rem;
    overflow-x: auto;
    margin-bottom: 1.2rem;
}

#preview-content blockquote {
    border-left: 3px solid var(--orange);
    padding-left: 1.6rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1.2rem;
}

#preview-content strong {
    font-weight: 700;
}

#preview-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

#note-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 3rem 1.2rem;
    border-top: 1px solid var(--border);
    border-bottom: 0px solid var(--border);
    background: var(--surface2);
    flex-shrink: 0;
}

#note-page-indicator {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

#note-page-progress {
    width: min(100%, 320px);
    display: flex;
    align-items: center;
    gap: 0.42rem;
}

.note-progress-block {
    flex: 1;
    min-width: 0;
    height: 0.48rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 68%, transparent);
    overflow: hidden;
    transition:
        background 0.18s ease,
        transform 0.18s ease,
        opacity 0.18s ease;
}

.note-progress-block.completed {
    background: linear-gradient(90deg, var(--g-pink), var(--g-purple));
}

.note-progress-block.active {
    background: linear-gradient(90deg, var(--danger-dark), var(--warn-mid));
    transform: scaleY(1.25);
}

.note-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 1rem;
    border: 0px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        opacity 0.18s ease;
}

.note-page-btn svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.note-page-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.note-page-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

/* voltar: sutil, ghost */
#note-page-prev {
    background: transparent;
    color: var(--text-muted);
    padding: 0.8rem 1.2rem;
}

#note-page-prev:hover:not(:disabled) {
    background: var(--surface2);
    color: var(--text);
}

/* avançar: destacado, gradiente */
#note-page-next {
    background: linear-gradient(135deg, var(--g-pink), var(--g-purple));
    color: #fff;
    border: none;
    padding: 0.8rem 1.8rem;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--g-purple) 35%, transparent);
}

#note-page-next:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--g-pink), var(--g-purple));
    box-shadow: 0 4px 16px color-mix(in srgb, var(--g-purple) 45%, transparent);
    transform: translateY(-2px);
}

#note-page-next:disabled {
    background: var(--surface2);
    color: var(--text-muted);
    box-shadow: none;
}

/* note view mode toggle */
#note-view-mode-toggle {
    display: none;
    gap: 0.4rem;
    padding: 0 3rem;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.8rem;
    padding-top: 0.2rem;
}

.note-mode-btn {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: lowercase;
}

.note-mode-btn svg {
    flex-shrink: 0;
}

.note-mode-btn:hover {
    background: var(--surface2);
    color: var(--text);
}

.note-mode-btn.active {
    background: var(--surface);
    color: var(--text);
    border-color: color-mix(in srgb, var(--text) 25%, var(--border));
    font-weight: 700;
}

/* continuous view: each page becomes a standalone panel like sidebar-box */
#note-view.continuous-mode #note-scroll {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.8rem 2.4rem;
}

#note-view.continuous-mode #preview-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

#note-view.continuous-mode .note-page {
    min-height: auto;
    background: var(--surface);
    border-radius: 1.4rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    padding: 2.4rem 2.8rem;
    margin-bottom: 0;
    animation: none;
    flex-shrink: 0;
}

#note-view.continuous-mode .note-page[hidden] {
    display: block !important;
}

#note-view.continuous-mode .note-page::before {
    content: attr(data-page-label);
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: lowercase;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 768px) {
    #note-view-mode-toggle {
        padding: 0 2rem;
        padding-bottom: 0.6rem;
        padding-top: 0.1rem;
    }

    #note-view.continuous-mode #note-scroll {
        padding: 0.6rem 1.2rem;
    }

    #note-view.continuous-mode .note-page {
        padding: 1.6rem 1.8rem;
        border-radius: 1rem;
    }
}

.wikilink {
    color: var(--orange-text);
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.15s;
}

.wikilink:hover {
    opacity: 0.75;
}

.wikilink.broken {
    color: var(--text-muted);
}

/* backlinks */
#backlinks-bar {
    border-top: 1px solid var(--border);
    background: transparent;
    display: none;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem 3rem;
    flex-shrink: 0;
}

#backlinks-bar.visible {
    display: flex;
}

#backlinks-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

#backlinks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.backlink-chip {
    font-size: 1rem;
    padding: 0.2rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    color: var(--orange-text);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}

.backlink-chip:hover {
    border-color: var(--orange);
    background: var(--surface2);
}

/* vinculos */
#vinculos-bar {
    border-top: 1px solid var(--border);
    background: transparent;
    display: none;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 3rem 1.2rem;
    flex-shrink: 0;
}

#vinculos-bar.visible {
    display: flex;
}

.vinculos-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.vinculos-row-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.vinculos-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 1.6rem;
}

.vchip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.25rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 99px;
    white-space: nowrap;
    max-width: 32rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vchip.aula {
    background: var(--surface2);
    border-color: var(--border);
    color: #3a6b8f;
}

[data-theme="dark"] .vchip.aula {
    color: #78aeda;
}

.vchip.expectativa {
    background: var(--surface2);
    border-color: var(--border);
    color: var(---success-light);
}

.vinculos-empty {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ── LANDING PAGE ─────────────────────────────── */
.landing-greeting {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: lowercase;
    letter-spacing: -0.01em;
    width: 100%;
    margin-bottom: 2vh;
    text-align: left;
    display: none;
}

.landing-greeting strong {
    color: var(--text);
}

#landing-home {
    display: grid;
    grid-template-columns: minmax(30rem, 48rem) minmax(28rem, 42rem);
    align-content: start;
    justify-content: center;
    gap: 1.6rem 2rem;
    padding: 2.4rem 2rem 3rem;
    height: 100%;
    overflow-y: auto;
}

.landing-columns {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100vw;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.landing-column {
    width: 100%;
    display: grid;
    gap: 1.2rem;
}

.landing-areas-grid,
.landing-others-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.6rem;
    width: 100%;
    max-width: none;
}

.landing-areas-grid {
    margin-bottom: 0;
}

.landing-areas-grid .landing-card,
.landing-others-grid .landing-card {
    min-height: 10rem;
}

.landing-card {
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
    width: 100%;
    overflow: hidden;
}

.landing-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.landing-main-btn {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 1rem;
    font-family: inherit;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.4rem;
    transition:
        background 0.2s,
        color 0.2s;
    text-transform: lowercase;
    width: 100%;
    min-height: 10rem;
}

.landing-main-btn svg {
    width: 2.4rem;
    height: 2.4rem;
    flex-shrink: 0;
}

.lmb-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    font-size: 1.9rem;
}

.lmb-text span:first-child {
    white-space: nowrap;
}

.lmb-desc {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: lowercase;
    text-align: left;
}

.landing-main-btn:hover {
    color: var(--orange-text);
    background: color-mix(in srgb, var(--orange) 6%, var(--surface));
}

.landing-main-btn.active-sub {
    background: color-mix(in srgb, var(--orange) 12%, var(--surface));
    color: var(--orange-text);
}

.landing-main-btn.btn-green {
    background: var(--surface);
    border-radius: 1rem;
}

.landing-main-btn.btn-green:hover {
    background: color-mix(in srgb, var(--success-light) 12%, var(--surface));
}

.landing-main-btn.btn-purple {
    background: var(--surface);
    border-radius: 1rem;
}

.landing-main-btn.btn-purple:hover {
    background: color-mix(in srgb, #a855f7 10%, var(--surface));
    border-color: rgba(168, 85, 247, 0.3);
}

.lmb-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.landing-area-prof-box {
    background: linear-gradient(135deg, #94e2a265, #90c7f4a7);
    color: #2b323b;
    border-radius: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-left: auto;
    flex-shrink: 0;
    width: 8rem !important;
    height: 6rem !important;
    min-width: 8rem !important;
    min-height: 6rem !important;
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.landing-area-prof-box:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    background: color-mix(in srgb, var(--success-light) 85%, white);
}

[data-theme="dark"] .landing-area-prof-box {
    background: linear-gradient(135deg,
            rgba(150, 226, 148, 0.25),
            rgba(144, 199, 244, 0.25));
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .landing-area-prof-box:hover {
    background: color-mix(in srgb, var(--success-light) 35%, var(--surface));
}

.lap-score {
    font-family: var(--font-mono);
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 0.5vh;
}

.lap-label {
    font-size: 1rem;
    font-weight: 700;
    text-transform: lowercase;
    opacity: 1;
    padding: 0.5vh;
}

#prof-box-global {
    margin-left: auto !important;
    flex-shrink: 0 !important;
}

#prof-box-global .lap-score {
    font-size: 2rem !important;
    margin-bottom: 0.5vh !important;
}

.landing-card-sub {
    padding: 1.2rem 1.6rem 1.6rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border-top: 0px solid var(--border);
}

.landing-subview {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 92rem;
    border-top: 1px solid var(--border);
    padding-top: 1.6rem;
}

@media (min-width: 769px) {
    #landing-home {
        width: 100%;
        justify-items: center;
        padding: 2.6rem 2.4rem 3.2rem;
    }

    .landing-columns {
        width: 88vw;
        max-width: 88vw;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2.2rem;
    }

    .landing-column {
        gap: 1.4rem;
    }

    .landing-main-btn {
        min-height: 10.8rem;
        padding: 1.5rem 2.4rem;
    }

    .landing-greeting {
        max-width: none;
        margin-bottom: 3vh;
    }
}

/* botões dentro das sub-views */
.landing-btn {
    width: 100%;
    padding: 1rem 1.2rem;
    text-align: left;
    border: 0px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    cursor: pointer;
    font-size: 1.35rem;
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--text);
    transition:
        background 0.15s,
        border-color 0.15s;
}

.landing-btn:hover {
    background: color-mix(in srgb, var(--orange) 8%, var(--bg));
    border-color: var(--orange);
}

.landing-btn-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: color-mix(in srgb, var(--orange) 12%, var(--surface));
    border-color: var(--orange);
    padding: 1.2rem 1.4rem;
}

.landing-btn-hero:hover {
    background: color-mix(in srgb, var(--orange) 22%, var(--surface));
}

.landing-btn-hero .lb-label {
    font-size: 1.4rem;
    font-weight: 700;
}

.landing-btn-hero .lb-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--orange-text);
}

.lsv-title {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: lowercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.lsv-aula-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.lsv-aula-item {
    border: 0px solid var(--border);
    border-radius: 6px;
    padding: 0.9rem 1.2rem;
    cursor: pointer;
    background: var(--bg);
    transition:
        background 0.15s,
        border-color 0.15s;
}

.lsv-aula-item:hover {
    background: color-mix(in srgb, var(--orange) 8%, var(--bg));
    border-color: var(--orange);
}

.lsv-aula-tema {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.lsv-aula-date {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
}

.lsv-aula-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.lsv-chip {
    font-size: 0.95rem;
    padding: 0.15rem 0.7rem;
    border-radius: 99px;
    border: 0px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
}

/* Competências / habilidades */
.hab-tabs {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.hab-tab {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: none;
    font-size: 1.1rem;
    cursor: pointer;
    font-family: var(--font-body);
    color: var(--text);
}

.hab-tab.active {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.hab-comp-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.hab-comp-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.hab-comp-header {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.hab-comp-header:hover {
    background: color-mix(in srgb, var(--orange) 8%, var(--surface));
}

.hab-skills {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.8rem;
    background: var(--bg);
}

.hab-skill-btn {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    font-size: 1.1rem;
    font-family: var(--font-body);
    text-align: left;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hab-skill-btn:hover {
    background: color-mix(in srgb, var(--orange) 8%, var(--bg));
    border-color: var(--orange);
}

.hab-skill-count {
    font-size: 1rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Config de bloco/simulado */
.bloco-config {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.bloco-config-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bloco-config-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
}

.bloco-config-value {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--orange-text);
}

.bloco-slider {
    width: 100%;
    accent-color: var(--orange);
    border: 0px solid var(--border);
}

.bloco-toggle-row {
    display: flex;
    gap: 0.6rem;
}

.bloco-toggle-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-family: var(--font-body);
    color: var(--text);
    transition:
        background 0.15s,
        border-color 0.15s;
}

.bloco-toggle-btn.selected {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.bloco-start-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 6px;
    background: var(--orange-text);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    margin-top: 0.4rem;
    transition: opacity 0.15s;
}

.bloco-start-btn:hover {
    opacity: 0.85;
}

/* ── BLOCO CONFIG: HABILIDADE SECTION ────────── */
.bloco-section-toggle {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: none;
    font-size: 1rem;
    cursor: pointer;
    font-family: var(--font-body);
    color: var(--text-muted);
    transition: background 0.15s, border-color 0.15s;
}

.bloco-section-toggle:hover {
    background: color-mix(in srgb, var(--orange) 8%, var(--bg));
    border-color: var(--orange);
}

.bloco-hab-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 20rem;
    overflow-y: auto;
    padding: 0.4rem 0;
}

.bloco-hab-comp-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.bloco-hab-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.bloco-hab-chip {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s, border-color 0.15s;
}

.bloco-hab-chip:hover {
    background: color-mix(in srgb, var(--orange) 8%, var(--bg));
    border-color: var(--orange);
}

.bloco-hab-chip.selected {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.bloco-hab-chip.locked {
    opacity: 0.7;
    pointer-events: none;
}

.bloco-hab-selected-chips {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
}

.bloco-hab-selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: var(--orange);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.bloco-hab-selected-chip:hover {
    opacity: 0.8;
}

/* ── BLOCO CONFIG: DIFFICULTY ─────────────────── */
.bloco-diff-presets {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.bloco-diff-btn {
    padding: 0.4rem 0.8rem;
    border: 0px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text-muted);
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}

.bloco-diff-btn:hover {
    background: color-mix(in srgb, var(--orange) 8%, var(--bg));
    border-color: var(--orange);
}

.bloco-diff-btn.selected {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.bloco-diff-slider {
    padding: 0.4rem 0.5rem 0;
    margin-top: 0.3rem;
}

.bloco-diff-bar {
    position: relative;
    height: 24px;
    width: 100%;
    cursor: pointer;
    touch-action: none;
}

.bloco-diff-track {
    position: absolute;
    top: 9px;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    pointer-events: none;
}

.bloco-diff-fill {
    position: absolute;
    top: 9px;
    height: 6px;
    background: var(--orange);
    border-radius: 3px;
    pointer-events: none;
}

.bloco-diff-handle {
    position: absolute;
    top: 3px;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--orange);
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 2;
    touch-action: none;
}

.bloco-diff-handle:active {
    cursor: grabbing;
    background: var(--orange);
}

.bloco-diff-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 0.1rem;
}

.bloco-diff-val {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-size: 1rem;
    font-weight: 900;
    color: var(--text);
    font-family: var(--font-mono);
}

.bloco-pool-count {
    font-size: 1rem;
    color: var(--text-muted);
    text-align: center;
}

/* ── SIDEBAR DIFFICULTY BADGE ─────────────────── */
.sidebar-diff-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 99px;
    padding: 0.15rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 800;
    font-family: var(--font-mono);
    flex-shrink: 0;
    line-height: 1.4;
    min-width: 2.5rem;
    text-align: center;
}

.sidebar-diff-badge.diff-high {
    background: color-mix(in srgb, var(--danger-dark) 18%, var(--surface));
    color: var(--text);
}

.sidebar-diff-badge.diff-mid {
    background: color-mix(in srgb, var(--orange) 14%, var(--surface));
    color: var(--text);
}

.sidebar-diff-badge.diff-low {
    background: color-mix(in srgb, var(--success-light) 14%, var(--surface));
    color: var(--text);
}

/* ── SESSION BAR ───────────────────────────────── */
#session-bar {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0.7rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.sb-type {
    font-weight: 800;
    text-transform: lowercase;
    color: var(--text-muted);
}

.sb-progress {
    font-weight: 700;
    color: var(--orange-text);
}

.sb-timer {
    margin-left: auto;
    font-weight: 700;
    color: var(--text);
    transition: color 0.3s;
}

#session-bar.warning .sb-timer {
    color: #e08800;
}

#session-bar.critical .sb-timer {
    color: var(--danger-dark, #fb9999);
}

.sb-abort {
    background: none;
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.2rem 0.8rem;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    font-family: var(--font-body);
    margin-left: 0.6rem;
}

.sb-abort:hover {
    border-color: var(--danger-dark, #fb9999);
    color: var(--danger-dark, #fb9999);
}

/* ── SESSION REPORT ────────────────────────────── */
#session-report-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    overflow-y: auto;
    padding: 2rem;
}

#session-report-overlay.hidden {
    display: none !important;
}

#session-report-content {
    background: var(--surface);
    border: 0px solid var(--border);
    border-radius: 8px;
    padding: 2.4rem;
    max-width: 64rem;
    width: 100%;
}

.sr-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-transform: lowercase;
}

.sr-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-bottom: 2.4rem;
}

.sr-stat {
    background: var(--bg);
    border: 0px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.4rem;
}

.sr-stat-label {
    font-size: 1rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    margin-bottom: 0.3rem;
}

.sr-stat-val {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--orange-text);
}

.sr-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: lowercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.8rem;
    margin-top: 1.8rem;
}

/* ── Card de proficiência do simulado ── */
.sr-prof-card {
    background: linear-gradient(135deg,
            color-mix(in srgb, var(--orange-text) 12%, var(--surface)),
            var(--surface));
    border: 1.5px solid color-mix(in srgb, var(--orange-text) 35%, var(--border));
    border-radius: 1rem;
    padding: 1.4rem 1.6rem 1.2rem;
    margin-bottom: 1.6rem;
}

.sr-prof-card-pending {
    background: var(--surface);
    border-color: var(--border);
}

.sr-prof-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: lowercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sr-prof-card-score {
    font-size: 3.6rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.sr-prof-card-meta {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.sr-prof-bar-track {
    height: 5px;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.7rem;
}

.sr-prof-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.sr-prof-card-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    opacity: 0.75;
    line-height: 1.4;
}

.sr-bar-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.sr-bar-label {
    width: 16rem;
    flex-shrink: 0;
    font-weight: 600;
}

.sr-bar-track {
    flex: 1;
    height: 0.8rem;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.sr-bar-fill {
    height: 100%;
    background: var(--orange-text);
    border-radius: 99px;
}

.sr-bar-pct {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-muted);
    width: 4rem;
    text-align: right;
}

.sr-hab-row {
    font-size: 1.05rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.8rem;
}

.sr-hab-row.errou .sr-hab-name {
    color: var(--danger-dark, #fb9999);
}

.sr-hab-badge {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.sr-quest-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sr-quest-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 1.1rem;
}

.sr-quest-n {
    font-family: var(--font-mono);
    color: var(--text-muted);
    width: 2.5rem;
    flex-shrink: 0;
}

.sr-quest-result {
    font-weight: 800;
    width: 2rem;
    flex-shrink: 0;
}

.sr-quest-gabarito {
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.sr-quest-resp {
    font-family: var(--font-mono);
}

.sr-quest-tempo {
    margin-left: auto;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.sr-quest-clickable {
    cursor: pointer;
    border-radius: 6px;
    padding: 0.6rem 0.4rem;
    transition: background 0.15s;
}

.sr-quest-clickable:hover {
    background: color-mix(in srgb, var(--orange) 8%, var(--bg));
}

.sr-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.sr-btn {
    padding: 0.8rem 1.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: none;
    cursor: pointer;
    font-size: 1.2rem;
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--text);
    transition: background 0.15s;
}

.sr-btn:hover {
    background: var(--bg);
}

.sr-btn-primary {
    background: var(--orange-text);
    border-color: var(--orange-text);
    color: #fff;
}

.sr-btn-primary:hover {
    opacity: 0.85;
    background: var(--orange-text);
}

/* landing fullscreen — esconde sidebar e grafo em qualquer tela */
body.landing-active #sidebar {
    display: none !important;
}

body.landing-active #graph-col {
    display: none !important;
}

body.landing-active #content-col {
    flex: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* esconde mobile nav na landing page */
body.landing-active #mobile-nav {
    display: none !important;
}

/* esconde todo conteúdo que não seja a landing */
body.landing-active #empty-state,
body.landing-active #note-view,
body.landing-active #quest-view,
body.landing-active #session-bar {
    display: none !important;
}

/* header de conteúdo: escondido por padrão, aparece via JS */
#content-section-header {
    position: relative;
    z-index: 101;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

body:not(.landing-active) #content-section-header {
    pointer-events: auto;
    opacity: 1;
}

body.landing-active #btn-proficiency,
body.landing-active #btn-stats {
    display: none !important;
}

#content-section-header.visible {
    pointer-events: auto !important;
    opacity: 1 !important;
}

/* esconde conteúdo principal na landing page */
body.landing-active #content-area {
    background: transparent !important;
}

/* ── NON-STUDENT LANDING: hide student column, center areas ── */
body:not(.is-student) .landing-column:nth-child(2) {
    display: none;
}

body:not(.is-student) .landing-columns {
    grid-template-columns: minmax(0, 1fr);
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

/* modo questão — tela cheia, sem sidebar nem grafo */
body.quest-active #sidebar {
    display: none !important;
}

body.quest-active #graph-col {
    display: none !important;
}

body.quest-active #mobile-nav {
    display: none !important;
}

body.quest-active #content-col {
    flex: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* session next button in feedback popup */
.btn-session-next {
    width: 100%;
    padding: 0.9rem;
    margin-top: 0.6rem;
    border: none;
    border-radius: 6px;
    background: var(--orange-text);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-session-next:hover {
    opacity: 0.85;
}

/* ── graph panel ───────────────────────────────── */
#graph-col {
    width: 25%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition:
        width 0.3s ease,
        opacity 0.3s ease,
        margin-left 0.3s ease;
}

/* Graph hidden by default, shown when toggled */
#graph-col:not(.visible):not(.constelacao-active) {
    width: 0;
    opacity: 0;
    overflow: hidden;
    margin-left: 0;
    pointer-events: none;
}

/* Constellation mode: graph takes full width */
body.constelacao-active #graph-col {
    width: 100%;
    flex: 1;
}

body.constelacao-active #content-col {
    display: none !important;
}

#graph-col.visible > .section-header {
    display: none !important;
}

body.constelacao-active #graph-col > .section-header {
    display: none !important;
}

body.constelacao-active #empty-state {
    display: none !important;
}

body.constelacao-active #content-area {
    display: none !important;
}

body.constelacao-active #note-view {
    display: none !important;
}

body.constelacao-active #note-header {
    display: none !important;
}

body.constelacao-active #chat-fab {
    display: none !important;
}

#graph-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--surface);
    border-radius: 1.4rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

#graph-col.collapsed {
    width: 0;
    opacity: 0;
    display: none !important;
    margin-left: -1rem;
}

#graph-header {
    padding: 1rem 1.6rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

#graph-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-muted);
    flex: 1;
    letter-spacing: -0.02em;
}

#graph-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    padding: 1.4rem 1.4rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
}

.legend-dot.forte {
    background: var(--orange);
}

.legend-dot.fraca {
    background: var(--success-light);
}

.legend-dot.aula {
    background: #90c7f4;
}

.legend-dot.objeto {
    background: #fb9999;
    border-radius: 0;
    transform: rotate(45deg);
}

.legend-dot.avaliacao {
    background: #ca9de1;
    border-radius: 2px;
}

.legend-dot.questao {
    background: #f0f07c;
    border-radius: 0;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.legend-dot.conteudo {
    background: #ffcfa1;
    border-radius: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.legend-dot.tema {
    background: #f996b9;
    border-radius: 99px;
    width: 1.4rem;
    height: 0.6rem;
}

.legend-dot.ano {
    background: #90c7f4;
    border-radius: 0;
    clip-path: polygon(50% 0%, 100% 38%, 81% 100%, 19% 100%, 0% 38%);
}

#graph-toggles {
    display: flex;
    gap: 0.4rem;
    margin-right: auto;
    align-items: center;
}

.graph-toggle-pill {
    font-size: 1rem;
    padding: 0.25rem 0.9rem;
    border-radius: 99px;
    border: 0px solid var(--border);
    background: var(--surface2, var(--surface));
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    text-transform: lowercase;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
}

.graph-toggle-pill:hover {
    border-color: var(--orange);
    color: var(--text);
}

.graph-toggle-pill.active {
    background: color-mix(in srgb, var(--orange) 15%, var(--surface));
    border-color: var(--orange);
    color: var(--text);
}

#graph-container {
    flex: 1;
    position: relative;
    min-height: 0;
}

#graph-canvas-wrap {
    width: 100%;
    height: 100%;
}

/* loading overlay */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    z-index: 1000;
}

.prof-filter-btn {
    background: var(--surface2);
    border: 0px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.prof-filter-btn:hover {
    background: var(--surface);
    border-color: var(--orange);
    color: var(--orange-text);
}

.prof-filter-btn.active {
    background: var(--orange);
    color: white;
    border-color: var(--orange-dark);
}

.prof-filter-btn svg {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
    opacity: 0.7;
}

/* Turmas filter styles */
#btn-filter-turmas {
    background: var(--surface2);
    border: 0px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#btn-filter-turmas:hover {
    background: var(--surface);
    border-color: var(--orange);
}

#btn-filter-turmas.active {
    background: var(--orange);
    border-color: var(--orange-dark);
}

#btn-filter-turmas svg {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
    opacity: 0.7;
}

#turmas-filter-panel {
    display: none;
}

.turmas-filter-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    padding: 1.2rem;
    animation: slideDown 0.3s ease-out;
}

.turmas-filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 300px;
    overflow-y: auto;
}

.turmas-filter-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    cursor: pointer;
    transition: background 0.2s;
}

.turmas-filter-item:hover {
    background: var(--surface2);
}

.turmas-filter-item input[type="checkbox"] {
    width: 1.4rem;
    height: 1.4rem;
    cursor: pointer;
    accent-color: var(--orange);
}

.turmas-filter-item label {
    font-size: 1.2rem;
    color: var(--text);
    cursor: pointer;
    flex: 1;
}

.prof-filter-box {
    background: var(--surface2);
    border: 0px solid var(--border);
    border-radius: 1.2rem;
    padding: 1.5rem;
    margin: 1rem 0 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pfb-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pfb-row label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pfb-row select,
.pfb-row input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 0.8rem;
    color: var(--text);
    font-family: inherit;
}

#proficiency-overlay.hidden {
    display: none;
}

#loading-overlay.hidden {
    display: none;
}

#loading-overlay svg {
    opacity: 0.25;
}

#loading-overlay p {
    font-size: 1.4rem;
    color: var(--text-muted);
}

#loading-error {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 44rem;
    display: none;
}

#loading-error code {
    font-family: "Manrope", monospace;
    background: var(--surface2);
    padding: 0.15em 0.5em;
}

/* LOGIN OVERLAY */
#login-overlay,
#profile-settings-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    z-index: 200;
}

#login-overlay.hidden,
#profile-settings-overlay.hidden {
    display: none;
}

.login-box {
    background: var(--surface);
    border-radius: 1.4rem;
    box-shadow: 0 4px 34px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: min(440px, calc(100% - 2rem));
    display: flex;
    flex-direction: column;
    gap: clamp(0.8rem, 2vw, 1.4rem);
    padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.2rem, 4vw, 2.5rem);
    border: 0px solid var(--border);
}


#login-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    min-height: 100dvh;
    background: var(--bg);
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#login-overlay .login-box {
    position: relative;
    width: 100%;
    max-width: min(48rem, 100%);
    min-height: 100dvh;
    margin: 0 auto;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    background: var(--bg);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: clamp(2rem, 5vw, 3.5rem) clamp(1.2rem, 4vw, 2.5rem);
}

#login-overlay .login-box>* {
    width: min(44rem, 100%);
    max-width: 100%;
}

#login-overlay .login-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: clamp(4rem, 8vw, 6rem);
    background:
        radial-gradient(circle at 12.5% 0%,
            color-mix(in srgb, var(--g-purple) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 37.5% 0%,
            color-mix(in srgb, var(--g-pink) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 62.5% 0%,
            color-mix(in srgb, var(--g-purple) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 87.5% 0%,
            color-mix(in srgb, var(--g-pink) 50%, transparent) 0%,
            transparent 37.5%);
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    animation: slideGradientRight 3s linear infinite;
}

#profile-settings-overlay {
    background: var(--bg);
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    overflow-y: auto;
}

#profile-settings-overlay .profile-settings-box {
    width: 100%;
    max-width: none;
    min-height: 100svh;
    margin: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    background: var(--bg);
    padding: clamp(2.2rem, 6vw, 5rem) max(2rem, calc((100vw - 48rem) / 2));
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

#profile-settings-overlay .profile-settings-box>* {
    width: min(48rem, 100%);
}

.login-screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
}

.login-screen-header h2 {
    margin: 0;
    text-align: left;
}

.login-screen-header .btn-close-stats {
    flex-shrink: 0;
}

.login-box h2 {
    font-size: clamp(2rem, 3.5vw, 2.2rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    text-align: center;
}

.profile-settings-box {
    max-width: 520px;
}

.profile-settings-box .stats-header h2 {
    text-align: left;
    margin-bottom: 0;
}

.profile-avatar-editor {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.profile-avatar-shell {
    width: 5.4rem;
    height: 5.4rem;
    flex-shrink: 0;
}

.profile-avatar-preview {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
}

.profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--g-purple) 80%, white 20%) 0%,
            color-mix(in srgb, var(--g-blue) 78%, white 22%) 100%);
    color: #18364a;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.profile-avatar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.profile-avatar-btn {
    margin-top: 0;
    background: var(--surface2);
    color: var(--text);
    padding: 0.75rem 1rem;
}

.profile-avatar-btn:hover {
    background: color-mix(in srgb, var(--surface2) 75%, var(--orange) 25%);
}

.profile-logout-btn {
    margin-top: 0;
    color: var(--danger-dark);
    background: color-mix(in srgb, var(--danger) 18%, transparent);
}

.profile-logout-btn:hover {
    color: var(--danger-dark);
    background: color-mix(in srgb, var(--danger) 28%, transparent);
}

.profile-settings-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-select {
    width: 100%;
    padding: clamp(1rem, 2vw, 1.3rem) clamp(1.2rem, 2.5vw, 1.6rem);
    font-size: clamp(1.4rem, 2.5vw, 1.6rem);
    font-family: inherit;
    color: var(--text);
    background: var(--surface2);
    border: 0px solid var(--border);
    border-radius: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}

.login-select:focus {
    border-color: var(--orange);
}

.login-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-login-primary {
    background: linear-gradient(135deg, var(--g-pink), var(--g-purple));
    color: white;
    border: none;
    padding: clamp(1rem, 2.5vw, 1.4rem);
    border-radius: 99px;
    font-size: clamp(1.4rem, 3vw, 1.6rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.btn-login-primary:hover {
    background: var(--orange-text);
}

.btn-login-primary:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-login-secondary {
    background: transparent;
    color: var(--text-muted);
    padding: clamp(0.6rem, 1.5vw, 0.9rem);
    border-radius: 99px;
    font-size: clamp(1.1rem, 2vw, 1.2rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.4rem;
}

.btn-login-secondary:hover {
    border-color: var(--border);
    color: var(--text);
}

#login-password-area {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

#login-password-area.hidden {
    display: none;
}

.login-select.hidden {
    display: none;
}

#ext-login-form,
#ext-register-form,
#ext-forgot-form,
#login-form-aluno,
#login-form-externo,
#login-school-check-area,
#login-student-select-area {
    display: flex;
    flex-direction: column;
    gap: 2vh;
}

#ext-login-form,
#ext-forgot-form {
    gap: 1.4rem;
}

.login-hint {
    font-size: 1.15rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

.login-hint strong {
    color: var(--text);
    font-weight: 700;
}

.login-error {
    font-size: 1.1rem;
    color: #d9534f;
    text-align: center;
    min-height: 0;
    display: none;
}

.login-error:not(:empty) {
    display: block;
}

/* LOGIN TABS */
.login-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.4rem;
}

.login-tab {
    flex: 1;
    padding: clamp(0.6rem, 1.5vw, 0.8rem);
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: clamp(1.2rem, 2.5vw, 1.3rem);
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    text-transform: lowercase;
}

.login-tab:hover {
    color: var(--text);
}

.login-tab.active {
    color: var(--text);
    border-bottom-color: var(--orange);
}

.login-sub-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0.4rem;
}

.login-sub-tab {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid var(--border);
    background: transparent;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.login-sub-tab:first-child {
    border-radius: 0.6rem 0 0 0.6rem;
}

.login-sub-tab:last-child {
    border-radius: 0 0.6rem 0.6rem 0;
    border-left: none;
}

.login-sub-tab:hover {
    color: var(--text);
}

.login-sub-tab.active {
    background: color-mix(in srgb, var(--orange) 15%, var(--surface));
    border-color: var(--orange);
    color: var(--text);
}

.btn-login-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.6rem 0;
    text-align: center;
    width: 100%;
    transition: color 0.15s;
}

/* STATS OVERLAY */
#stats-overlay,
#quest-stats-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    gap: 1.6rem;
    z-index: 200;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow-y: auto;
}

.prof-area-section {
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.prof-area-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.prof-filter-btn {
    background: var(--surface2);
    border: 0px solid var(--border);
    border-radius: 3rem;
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s;
    margin-bottom: 2rem;
}

.prof-filter-btn:hover {
    background: var(--surface);
    border-color: var(--orange);
    color: var(--orange-text);
}

.prof-filter-btn.active {
    background: var(--orange);
    color: white;
    border-color: var(--orange-dark);
}

.prof-filter-btn svg {
    width: 1.9rem;
    height: 1.9rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.prof-filter-box {
    background: var(--bg);
    border: 0px solid var(--border);
    border-radius: 1.2rem;
    padding: 1.5rem;
    margin: 1rem 0 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    animation: profSlideDown 0.3s ease-out;
}

@keyframes profSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pfb-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pfb-row label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pfb-row select,
.pfb-row input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    padding: 0.8rem;
    color: var(--text);
    font-family: inherit;
    font-size: 1.1rem;
}

/* DUAL SLIDER PROFICIENCY */
.pfb-double-slider-wrap {
    position: relative;
    width: 100%;
    height: 30px;
    display: flex;
    align-items: center;
}

.pfb-double-slider-wrap::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--surface);
    border-radius: 99px;
    border: 1px solid var(--border);
}

.dual-range-slider.prof-slider {
    position: absolute;
    width: 100%;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: transparent;
    outline: none;
    margin: 0;
}

.dual-range-slider.prof-slider::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--orange);
    cursor: pointer;
    border: 4px solid var(--surface);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s;
}

.dual-range-slider.prof-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.prof-area-section:last-child {
    border-bottom: none;
}

#stats-overlay.hidden,
#quest-stats-overlay.hidden,
#pending-activities-popup.hidden {
    display: none !important;
}

#pending-activities-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-box {
    background: var(--surface);
    border-radius: 1.4rem;
    padding: 2.8rem;
    box-shadow: 0 4px 34px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    border: 0px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
}

/* ── abas de stats ── */
.stats-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.8rem;
    flex-wrap: wrap;
}

.stats-tab {
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.4rem 1.1rem;
    border-radius: 99px;
    border: none;
    background: var(--surface2);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.stats-tab:hover {
    color: var(--text);
}

.stats-tab.active {
    background: color-mix(in srgb, var(--orange) 15%, var(--surface));
    color: var(--text);
}

/* ── breakdown por dimensão ── */
.stats-breakdown-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.stats-breakdown-scroll::-webkit-scrollbar {
    width: 4px;
}

.stats-breakdown-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
}

.stats-breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.85rem 1rem;
    border-radius: 0.8rem;
    background: var(--bg);
    border: 1px solid transparent;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    cursor: pointer;
    overflow: hidden;
}

.stats-breakdown-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.stats-breakdown-details {
    display: none;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 0.2rem 0.5rem;
    border-top: 1px solid var(--surface3);
    margin-top: 0.4rem;
    animation: fadeIn 0.2s ease;
}

.stats-breakdown-item.expanded {
    border-color: var(--orange);
    background: var(--surface);
}

.stats-breakdown-item.expanded .stats-breakdown-details {
    display: flex;
}

.stats-breakdown-item.expanded .stats-breakdown-label {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.stats-breakdown-label {
    font-size: 1.1rem;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-breakdown-pie-wrap {
    width: 1.6rem;
    height: 1.6rem;
    position: relative;
    flex-shrink: 0;
}

.stats-breakdown-pie-wrap svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.stats-breakdown-pie-bg {
    fill: none;
    stroke: var(--surface3);
    stroke-width: 5;
}

.stats-breakdown-pie-fg {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.stats-breakdown-pct {
    font-size: 1rem;
    color: var(--text-muted);
    width: 2rem;
    text-align: right;
    font-family: "Manrope", monospace;
    flex-shrink: 0;
}

.stats-breakdown-count {
    font-size: 0.95rem;
    color: var(--text-muted);
    width: 2rem;
    text-align: right;
    flex-shrink: 0;
}

.stats-breakdown-questions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}

.stats-breakdown-quest {
    background: var(--bg);
    padding: 0.8rem 1rem;
    border-radius: 0.8rem;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    transition: all 0.2s;
    border: 1px solid var(--surface3);
}

.stats-breakdown-quest:hover {
    background: var(--surface);
    border-color: var(--orange);
    transform: translateX(4px);
}

.stats-breakdown-quest-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.stats-breakdown-quest-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
}

.stats-breakdown-quest-text {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-breakdown-count {
    font-size: 0.95rem;
    color: var(--text-muted);
    width: 2rem;
    text-align: right;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

#proficiency-overlay .stats-header {
    align-items: flex-start;
}

.stats-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    margin: 0;
}

.btn-close-stats {
    background: var(--surface2);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-stats:hover {
    background: var(--surface3);
    color: var(--text);
}

#quest-title-display,
.quest-title-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    flex-wrap: wrap;
}

/* ── difficulty display ao lado do botão stats ── */
.quest-diff-display {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.quest-diff-badge {
    display: inline-flex;
    align-items: center;
    gap: 0rem;
    background: var(--surface2);
    border: 0px solid var(--border);
    border-radius: 99px;
    height: 3.4rem;
    padding: 0 1.4rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.quest-diff-badge.diff-high {
    background: color-mix(in srgb, var(--danger-dark) 18%, var(--surface));
    color: var(--text);
}

.quest-diff-badge.diff-mid {
    background: color-mix(in srgb, var(--orange) 14%, var(--surface));
    color: var(--text);
}

.quest-diff-badge.diff-low {
    background: color-mix(in srgb, var(--success-light) 14%, var(--surface));
    color: var(--text);
}

.quest-diff-badge .diff-label {
    font-weight: 500;
}

.quest-diff-badge .diff-val {
    font-weight: 800;
}

.btn-quest-stats {
    height: 3.4rem;
    padding: 0 1.4rem;
    border-radius: 99px;
    border: 0px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.btn-quest-stats:hover {
    border-color: var(--orange);
    color: var(--orange-text);
    background: var(--surface2);
}

/* ── LEADERBOARD POPUP ── */
#leaderboard-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 2rem;
    overflow-y: auto;
}

@media (max-width: 768px) {
    #leaderboard-overlay {
        padding: 0;
        align-items: flex-start;
    }
}

#leaderboard-overlay.hidden {
    display: none !important;
}

#leaderboard-content {
    background: var(--surface);
    border-radius: 1.6rem;
    padding: 2.8rem;
    max-width: 70rem;
    width: 100%;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    position: relative;
}

@media (max-width: 768px) {
    #leaderboard-content {
        max-width: 100%;
        width: 100%;
        min-height: 100vh;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 6vw;
    }
}

.lb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    position: sticky;
    top: 0;
    background: var(--surface);
    padding: 0rem 0rem 1rem 0;
    z-index: 0;
}

.lb-controls-stack {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1.8rem;
}

.lb-toggles-row {
    display: flex;
    gap: 0.6rem;
}

.lb-toggles-row .lb-mode-toggle {
    flex: 1 1 0;
    width: 100%;
}

.lb-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text);
}

.lb-info-btn {
    background: var(--surface);
    color: var(--text-muted);
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.lb-info-btn:hover {
    background: var(--orange);
    color: #fff;
}

.lb-help-overlay {
    position: fixed;
    inset: 0;
    background: var(--surface);
    z-index: 10000;
    padding: 6vw;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: uiSurfaceFloat 0.72s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
}

@media (min-width: 769px) {
    .lb-help-overlay {
        padding: 2.8rem;
    }

    .lb-help-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3.2rem 4.8rem;
        padding-top: 1.5rem;
    }

    .lb-help-footer {
        padding-top: 4rem;
        margin-top: 2rem;
    }
}

.lb-help-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.lb-help-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.lb-help-icon {
    width: 4rem;
    height: 4rem;
    background: var(--surface2);
    border-radius: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.lb-help-item-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    margin-top: -0.2rem;
}

.lb-help-text b {
    color: var(--text);
    font-weight: 800;
}

.lb-help-text span {
    color: var(--text-muted);
    font-size: 1.3rem;
    line-height: 1.4;
}

.lb-help-footer {
    margin-top: auto;
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 2.5rem 0;
}

.lb-mode-toggle {
    display: flex;
    flex-wrap: wrap;
    background: var(--surface2);
    padding: 0.4rem;
    border-radius: 1.2rem;
    gap: 0.4rem;
    margin: 0;
    width: fit-content;
    max-width: 100%;
    font-family: "Manrope", sans-serif;
}

.lb-period-toggle {
    width: fit-content;
}

.lb-mode-btn {
    background: transparent;
    border: none;
    padding: 0.7rem 1.6rem;
    border-radius: 0.9rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s;
}

.lb-period-caption {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.4;
    padding: 0 0.2rem;
    text-transform: lowercase;
    display: none;
}

.lb-period-range {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
    padding: 0 0.2rem;
    text-transform: lowercase;
    display: none;
}

.lb-mode-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lb-close {
    background: var(--surface2);
    border: none;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    font-size: 2.2rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lb-close:hover {
    background: var(--surface3);
    color: var(--text);
    transform: rotate(90deg);
}

.lb-eye-btn {
    background: var(--surface2);
    border: none;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.lb-eye-btn:hover {
    background: var(--success-light);
    color: var(--text-muted);
}

.hide-score-popup {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    animation: popupSlideUp 0.3s ease forwards;
}

.hide-score-popup-content {
    background: var(--surface);
    border: 0cqmax solid var(--border);
    border-radius: 1.2rem;
    padding: 1.4rem 1.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

@keyframes popupSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 768px) {
    .lb-toggles-row {
        flex-direction: column;
        gap: 0.8rem;
    }

    .lb-mode-toggle {
        width: 100%;
        display: flex;
    }

    .lb-mode-btn {
        flex: 1;
        text-align: center;
    }
}

/* ── PÓDIUM ── */
.lb-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 2.4rem;
    padding: 0 1rem;
}

.lb-podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 20rem;
    min-width: 0;
}

.lb-podium-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding-bottom: 0.8rem;
}

.lb-podium-avatar {
    width: 6.4rem;
    height: 6.4rem;
    border-radius: 50%;
    background: #ffffff !important;
    margin-bottom: 0.4rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.lb-podium-1 .lb-podium-avatar {
    border: 4.5px solid #ffd900;
    box-shadow: 0 0 20px rgba(255, 217, 0, 0.45);
}

.lb-podium-2 .lb-podium-avatar {
    border: 3.5px solid #c0c8d8;
    box-shadow: 0 0 14px rgba(192, 200, 216, 0.3);
}

.lb-podium-3 .lb-podium-avatar {
    border: 3.5px solid #f08e2d;
    box-shadow: 0 0 14px rgba(240, 142, 45, 0.3);
}

.lb-podium-avatar .lb-avatar {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

.lb-podium-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: lowercase;
}

.lb-podium-1 .lb-podium-name {
    font-size: 1.5rem;
}

.lb-podium-badge {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin: 0.4rem;
    text-transform: lowercase;
    background: var(--surface2);
    padding: 0.15rem 0.8rem;
    border-radius: 99px;
}

.lb-podium-pts {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text);
    font-family: var(--font-mono), monospace;
    line-height: 1.1;
}

.lb-podium-pts-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 0.2rem;
}

.lb-podium-1 .lb-podium-pts {
    font-size: 2.2rem;
    color: #ffa600 !important;
}

.lb-podium-2 .lb-podium-pts {
    color: #8b92a0 !important;
}

.lb-podium-3 .lb-podium-pts {
    color: #8f4827 !important;
}

.lb-podium-step {
    width: 100%;
    border-radius: 0.8rem 0.8rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.lb-podium-1 .lb-podium-step {
    background: linear-gradient(135deg, #ffd900df 0%, #ffa600e0 100%) !important;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.lb-podium-2 .lb-podium-step {
    background: linear-gradient(135deg, #d6dae0df 0%, #8b92a0e0 100%) !important;
    box-shadow: 0 4px 16px rgba(192, 200, 216, 0.12);
}

.lb-podium-3 .lb-podium-step {
    background: linear-gradient(135deg, #f08e2ddf 0%, #8f4827e0 100%) !important;
    box-shadow: 0 4px 16px rgba(205, 127, 50, 0.12);
}

.lb-podium-step-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: #111213 !important;
    opacity: 0.75;
    letter-spacing: -0.05em;
    position: relative;
    z-index: 1;
}

.lb-podium-1 .lb-podium-step-num {
    font-size: 2.4rem;
}

.lb-podium-me .lb-podium-avatar {
    box-shadow: 0 0 0 3px var(--orange), 0 0 20px rgba(255, 133, 62, 0.25);
}

.lb-podium-empty {
    visibility: hidden;
}

@media (max-width: 768px) {
    .lb-podium {
        gap: 0.6rem;
        padding: 0;
    }

    .lb-podium-avatar {
        width: 4.8rem;
        height: 4.8rem;
    }

    .lb-podium-name {
        font-size: 1.1rem;
    }

    .lb-podium-1 .lb-podium-name {
        font-size: 1.2rem;
    }

    .lb-podium-pts {
        font-size: 1.4rem;
    }

    .lb-podium-1 .lb-podium-pts {
        font-size: 1.6rem;
    }

    .lb-podium-step-num {
        font-size: 1.6rem;
    }
}

[data-theme="dark"] .lb-podium-step::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
}

[data-theme="dark"] .lb-podium-avatar {
    background: #ffffff !important;
}

[data-theme="dark"] .lb-avatar {
    background: transparent;
}

[data-theme="dark"] .lb-podium-badge {
    background: rgba(255, 255, 255, 0.08);
}

/* ── END PÓDIUM ── */

.lb-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
    position: relative;
    background: var(--surface);
}

.lb-box {
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
    border: 1px solid var(--border);
    border-radius: 1.4rem;
    padding: 1.6rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition:
        transform 0.2s,
        border-color 0.2s;
    width: 100%;
}

.lb-box:hover {
    border-color: var(--orange);
    transform: translateX(5px);
}

.lb-box-me {
    background: color-mix(in srgb, var(--orange) 6%, var(--bg));
    border-color: var(--orange);
}

.lb-box-pos-wrap {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-muted);
    flex-shrink: 0;
    border: 0px solid var(--border);
    padding-left: 0.25rem;
    /* Compensa o peso do º na direita */
    padding-bottom: 0.1rem;
    /* Ajuste fino vertical */
}

.lb-pos-1 .lb-box-pos-wrap {
    background: #ffd700;
    color: #5c4100;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.lb-pos-2 .lb-box-pos-wrap {
    background: #c0c0c0;
    color: #333;
}

.lb-pos-3 .lb-box-pos-wrap {
    background: #cd7f32;
    color: #4d2600;
}

.lb-box-main {
    width: 100%;
}

.lb-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    width: 100%;
}

.lb-box-left-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.lb-avatar {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    background: var(--surface);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: none;
    position: relative;
}

.lb-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Garante que não haja espaço extra abaixo da imagem */
}

.lb-avatar-fallback {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}

.lb-box-avatar {
    width: 3.2rem !important;
    height: 3.2rem !important;
    border: 2px solid var(--border);
    border-radius: 50% !important;
    overflow: hidden !important;
}

.lb-box-avatar .lb-avatar-fallback {
    font-size: 1rem;
}

.lb-box-name {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.lb-box-turma-badge {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-muted);
    padding: 0.3rem 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: lowercase;
    white-space: nowrap;
    margin-left: auto;
    /* Empurra a badge para a direita */
}

.lb-box-stats {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.lb-box-stat {
    flex: 1;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(5px);
    border: 0px solid rgba(255, 255, 255, 0.50);
    padding: 1.2rem 1rem;
    border-radius: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.lb-box-stat-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}

.lb-box-stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: lowercase;
}

.lb-box {
    background: var(--bg);
    border: 0px solid var(--border);
    border-radius: 1.2rem;
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: all 0.2s;
    position: relative;
}

.lb-box:hover {
    border-color: color-mix(in srgb, var(--orange) 40%, var(--border));
    box-shadow: 0 4px 16px color-mix(in srgb, var(--text) 6%, transparent);
}

.lb-box-me {
    border-color: var(--orange);
    background: color-mix(in srgb, var(--orange) 6%, var(--bg));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 20%, transparent);
}

.lb-pos-1 {
    background: linear-gradient(135deg, color-mix(in srgb, #ffd700 40%, var(--bg)), color-mix(in srgb, #f9a825 65%, var(--bg)));
}

.lb-pos-2 {
    background: linear-gradient(135deg, color-mix(in srgb, #c0c0c0 40%, var(--bg)), color-mix(in srgb, #a8a8a8 65%, var(--bg)));
}

.lb-pos-3 {
    background: linear-gradient(135deg, color-mix(in srgb, #cd7f32 40%, var(--bg)), color-mix(in srgb, #a0522d 65%, var(--bg)));
}

.lb-box-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
}

.lb-box-pos {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-muted);
    min-width: 3rem;
}

.lb-box-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.lb-box-turma {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: lowercase;
    margin-top: -0.2rem;
}

.lb-box-stats {
    display: flex;
    gap: 1.2rem;
    margin-top: 0.4rem;
}

.lb-box-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    background: rgb(255, 255, 255, 0.5);
    border: 0px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0.8rem;
    padding: 0.6rem 0.4rem;
}

.lb-box-stat-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.lb-box-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: lowercase;
}

.lb-my-footer {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    margin-top: 1.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
    font-size: 1rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.lb-my-footer strong {
    color: var(--text);
}

/* ── clãs ── */
.cla-action-bar {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.cla-create-btn,
.cla-manage-btn {
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 99px;
    padding: 0.7rem 1.6rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: lowercase;
    transition: all 0.2s;
}

.cla-create-btn:hover,
.cla-manage-btn:hover {
    background: var(--orange-text);
}

.cla-leave-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.cla-leave-btn:hover {
    border-color: #e55;
    color: #e55;
}

.cla-or-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── cla card header (2 linhas: nome + sigla) ── */
.cla-header-lines {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.cla-sigla {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cla-avatar {
    width: 3.2rem !important;
    height: 3.2rem !important;
    border-radius: 50% !important;
    /* Estava 0%, agora circular como os outros */
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
    overflow: hidden !important;
}

.cla-avatar-placeholder {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: var(--orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.cla-members-btn {
    background: var(--surface2);
    color: var(--text-muted);
    padding: 0.3rem 1rem;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s;
    text-transform: lowercase;
    white-space: nowrap;
}

.cla-members-btn:hover {
    border-color: var(--orange);
    color: var(--orange-text);
}

/* ── cla detail topbar ── */
.cla-detail-topbar {
    align-items: flex-start;
    gap: 0.5rem;
}


.cla-detail-titles {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.cla-detail-close,
.cla-config-btn,
.cla-back-btn {
    background: var(--surface2);
    border: none;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    font-size: 2.2rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.cla-detail-close:hover,
.cla-config-btn:hover,
.cla-back-btn:hover {
    background: var(--orange);
    color: #fff;
}

.cla-detail-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

/* ── cla detail page ── */
.cla-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.cla-detail-nome {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cla-detail-sigla {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cla-avatar-lg {
    width: 4rem;
    height: 4rem;
}

.cla-detail-stats {
    display: flex;
    gap: 0.8rem;
    margin: 1.5rem 0;
}

.cla-detail-stat-box {
    flex: 1;
    background: var(--bg);
    border: 0px solid var(--border);
    border-radius: 1.2rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.cla-detail-stat-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
}

.cla-detail-stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: lowercase;
}

.cla-detail-members-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    text-transform: lowercase;
}

.cla-detail-members-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cla-member-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem 1.4rem;
    gap: 1rem;
    transition: border-color 0.2s;
}

.cla-member-me {
    border-color: var(--orange);
    background: color-mix(in srgb, var(--orange) 6%, var(--bg));
}

.cla-member-card-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.cla-member-nome {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cla-member-turma {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: lowercase;
}

.cla-member-card-stats {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

.cla-member-stat {
    background: var(--surface2);
    border-radius: 0.8rem;
    padding: 0.5rem 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-width: 4.5rem;
}

.cla-member-stat-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.cla-member-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: lowercase;
}

/* ── cla forms ── */
.cla-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cla-label {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: lowercase;
    margin-bottom: 0.2rem;
}

.cla-input {
    background: var(--bg);
    border: 0px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.8rem 1rem;
    font-size: 1.2rem;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.cla-input:focus {
    border-color: var(--orange);
}

.cla-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cla-members-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cla-member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: var(--bg);
    border-radius: 0.6rem;
    border: 1px solid var(--border);
    font-size: 0.95rem;
}

.cla-kick-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.cla-kick-btn:hover {
    border-color: #e55;
    color: #e55;
}

.cla-invite-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.8rem;
    background: var(--bg);
    border-radius: 0.6rem;
    border: 1px solid var(--border);
    margin-top: 0.3rem;
}

.cla-invite-add-btn {
    background: var(--success-light);
    color: #fff;
    border: none;
    border-radius: 99px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cla-invite-add-btn:hover {
    opacity: 0.85;
}

.cla-invite-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 1rem;
    text-align: center;
}

.cla-form-grid {
    display: grid;
    grid-template-columns: 1fr 12rem;
    gap: 1.5rem;
    width: 100%;
}

@media (max-width: 600px) {
    .cla-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.cla-form-group {
    display: flex;
    flex-direction: column;
}

.cla-save-btn {
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 1.2rem;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.cla-save-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.cla-request-btn {
    background: var(--surface2);
    color: var(--text);
    border: 0px solid var(--border);
    border-radius: 99px;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.cla-request-btn:hover:not(.disabled) {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
}

.cla-request-btn.disabled {
    opacity: 0.6;
    cursor: default;
    background: var(--surface2);
}

.cla-notification-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    background: #ff4757;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0px solid var(--surface2);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.cla-members-management {
    margin-top: 2rem;
    background: var(--surface2);
    padding: 1.5rem;
    border-radius: 1.4rem;
}

.cla-members-list-simple {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1rem;
}

.cla-member-row-name {
    font-weight: 700;
    color: var(--text);
}

.cla-invite-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    width: 100%;
}

.cla-invite-controls {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.6rem;
    width: 100%;
}

.cla-invite-results-box {
    margin-top: 1rem;
    max-height: 20rem;
    overflow-y: auto;
    background: var(--surface2);
    border-radius: 1rem;
}

@media (max-width: 768px) {
    .cla-card-body {
        flex-wrap: wrap;
    }

    .cla-card-right {
        width: 100%;
        justify-content: space-between;
    }

    .cla-detail-stats {
        flex-wrap: wrap;
    }

    .cla-detail-stat-box {
        min-width: calc(50% - 0.6rem);
    }

    .cla-member-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .cla-member-card-stats {
        width: 100%;
        justify-content: space-between;
    }
}

/* ── Difficulty popup backdrop ── */
#dp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

#dp-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* ── Difficulty popup overlay (fixed bottom, matches response popup) ── */
.dp-panel {
    position: fixed;
    bottom: calc(1.6rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg);
    border: 0px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-radius: 1.2rem;
    padding: 1.6rem 2rem;
    max-width: 44rem;
    width: min(44rem, calc(100vw - 2rem));
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    max-height: 80vh;
    overflow-y: auto;
    transition:
        opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

.dp-panel.dp-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* cascade animation for difficulty popup children (matches response popup) */
.dp-panel.dp-open .dp-cascade {
    opacity: 0;
    animation: uiChildCascade 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.dp-panel.dp-open .dp-cascade-1 {
    animation-delay: 90ms;
}

.dp-panel.dp-open .dp-cascade-2 {
    animation-delay: 210ms;
}

.dp-panel.dp-open .dp-cascade-3 {
    animation-delay: 330ms;
}

.dp-panel.dp-open .dp-cascade-4 {
    animation-delay: 420ms;
}

.dp-close-btn {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: none;
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dp-close-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.dp-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1.2rem;
    text-transform: lowercase;
    letter-spacing: 0rem;
    line-height: 1.2;
}

.dp-desc {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--text-muted);
    margin-bottom: 2rem;
    padding-right: 0.5rem;
}

.dp-desc strong {
    color: var(--orange-text);
    font-weight: 700;
}

.dp-params-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.2rem;
    text-transform: lowercase;
    letter-spacing: 0.03em;
}

.dp-params {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.dp-param {
    flex: 1;
    background: var(--surface2);
    border: 0px solid var(--border);
    border-radius: 1.2rem;
    padding: 1.4rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dp-param-label {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--orange-text);
}

.dp-param-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.dp-param-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.2rem;
}

.dp-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: color-mix(in srgb, var(--orange-text) 10%, var(--surface));
    border: 0px solid var(--orange);
    border-radius: 1.2rem;
    padding: 1.4rem 1.6rem;
}

.dp-current-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.dp-current-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--orange-text);
}

/* ── painel de dificuldade: mobile ── */
@media (max-width: 600px) {

    .dp-panel,
    .dp-panel.dp-open {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .dp-title {
        font-size: 1.6rem;
    }

    .dp-desc {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    .dp-params {
        gap: 0.8rem;
    }

    .dp-param {
        padding: 1.2rem 0.8rem;
    }

    .dp-param-label {
        font-size: 1.4rem;
    }

    .dp-param-val {
        font-size: 1.3rem;
    }

    .dp-current {
        flex-direction: column;
        gap: 0.6rem;
        align-items: flex-start;
        padding: 1.2rem 1.4rem;
    }

    .dp-current-val {
        font-size: 1.6rem;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stats-chart-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* PIE CHART using conic-gradient */
.stats-pie {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(---success-light) 0% 0%,
            var(--orange) 0% 100%);
    position: relative;
    /* add a hole for donut effect */
    mask-image: radial-gradient(circle, transparent 40%, black 41%);
    -webkit-mask-image: radial-gradient(circle, transparent 40%, black 41%);
    transition: background 0.5s ease-out;
}

.stats-legend {
    display: flex;
    gap: 1rem;
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 600;
}

.legend-acertos {
    color: var(--success-light);
}

.legend-erros {
    color: var(--danger-dark);
}

.stats-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.3rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.stat-val {
    font-weight: 800;
    color: var(--text);
    font-size: 1.5rem;
}

.stats-history {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-right: 1rem;
}

.stats-history::-webkit-scrollbar {
    width: 4px;
}

.stats-history::-webkit-scrollbar-thumb {
    background: var(--border);
}

.stats-history-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.4rem;
    background: var(--bg);
    border-radius: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    justify-content: space-between;
}

.stats-history-item:hover {
    border-color: var(--orange);
}

.stats-history-item.acertou {
    border-left: 4px solid var(--success-light);
}

.stats-history-item.errou {
    border-left: 4px solid var(--danger-dark);
}

.stats-tri-section {
    display: none;
    gap: 1.6rem;
    margin-bottom: 1.8rem;
    flex-shrink: 0;
}

.stats-tri-area-block {
    display: grid;
    gap: 1rem;
}

.stats-tri-area-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: lowercase;
    color: var(--text-muted);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.stats-tri-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
}

.stats-tri-card {
    background: color-mix(in srgb, var(--orange) 10%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--orange) 18%, var(--border));
    border-radius: 1rem;
    padding: 1.2rem 1.3rem;
    display: grid;
    gap: 0.5rem;
}

.stats-tri-card.is-muted {
    background: var(--bg);
    border-color: var(--border);
}

.stats-tri-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    font-weight: 800;
}

.stats-tri-value {
    font-size: 2rem;
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.stats-tri-meta {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.stats-tri-status {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.95rem;
    font-weight: 700;
    background: var(--surface2);
    color: var(--text-muted);
}

.stats-tri-status.ready {
    background: color-mix(in srgb, var(--success-light) 18%, var(--surface));
    color: var(--text);
}

.stats-tri-status.pending {
    background: color-mix(in srgb, var(--orange) 16%, var(--surface));
    color: var(--text);
}

.stats-tri-history-list {
    display: grid;
    gap: 0.6rem;
    max-height: 16rem;
    overflow: auto;
    padding-right: 0.4rem;
}

.stats-tri-history-list::-webkit-scrollbar {
    width: 4px;
}

.stats-tri-history-list::-webkit-scrollbar-thumb {
    background: var(--border);
}

.stats-tri-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: var(--bg);
    border-radius: 0.8rem;
    border: 1px solid transparent;
}

.stats-tri-history-item strong {
    color: var(--text);
    font-size: 1.05rem;
}

.stats-tri-history-item span {
    color: var(--text-muted);
    font-size: 0.98rem;
    text-align: right;
}

.stats-tri-empty {
    padding: 1.1rem 1.2rem;
    background: var(--bg);
    border-radius: 0.8rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.5;
}

.quest-tri-feedback {
    display: grid;
    gap: 0.7rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: color-mix(in srgb, var(--orange) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--orange) 18%, var(--border));
    margin-bottom: 1rem;
}

.quest-tri-feedback.hidden {
    display: none;
}

.quest-tri-feedback-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.quest-tri-feedback-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.quest-tri-feedback-row strong {
    color: var(--text);
    font-size: 1.5rem;
    letter-spacing: -0.04em;
}

.quest-tri-feedback-row span {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.4;
}

.quest-tri-feedback-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.quest-tri-feedback-pill.ready {
    background: color-mix(in srgb, var(--success-light) 18%, var(--surface));
    color: var(--text);
}

.quest-tri-feedback-pill.pending {
    background: color-mix(in srgb, var(--orange) 16%, var(--surface));
    color: var(--text);
}

/* ── proficiency button (topbar) ── */
#btn-proficiency {
    background: var(--surface);
    border: 0px solid var(--border);
    border-radius: 99px;
    padding: 0.5rem 1.6rem;
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: right;
    gap: 0.6rem;
    white-space: nowrap;
    transition: all 0.2s;
    letter-spacing: -0.02em;
}

#btn-proficiency:hover {
    border-color: var(--orange);
    background: color-mix(in srgb, var(--orange) 8%, var(--surface));
}

#btn-proficiency .prof-label {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-body);
    letter-spacing: 0.01em;
}

#btn-proficiency .prof-value {
    color: var(--orange-text);
}

#btn-proficiency.is-pending .prof-value {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ── proficiency overlay ── */
#proficiency-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    z-index: 200;
}

#proficiency-overlay.hidden {
    display: none !important;
}

.prof-overlay-box {
    background: var(--surface);
    border-radius: 1.4rem;
    padding: 2.8rem;
    box-shadow: 0 4px 34px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    border: 0px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
}

.prof-score-hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.prof-score-number {
    font-family: var(--font-mono);
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--orange-text);
    line-height: 1;
}

.prof-score-number.is-pending {
    font-size: 2.4rem;
    color: var(--text-muted);
}

.prof-score-detail {
    display: grid;
    gap: 0.4rem;
}

.prof-score-detail .prof-detail-label {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.prof-score-detail .prof-detail-value {
    font-size: 1rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.prof-recent-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    border: 0px solid color-mix(in srgb, var(--teal) 20%, var(--border));
    border-radius: 1rem;

    margin-bottom: 1.5rem;
}

.prof-recent-card.is-muted {
    background: var(--bg);
    border-color: var(--border);
}

.prof-recent-label {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    min-width: 7rem;
}

.prof-recent-score {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--teal);
    line-height: 1;
}

.prof-recent-card.is-muted .prof-recent-score {
    color: var(--text-muted);
    font-size: 1.3rem;
}

.prof-recent-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    flex: 1;
}

.prof-explain {
    background: var(--bg);
    border-radius: 1rem;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.prof-explain strong {
    color: var(--text);
}

/* Seções de área */
.prof-area-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.prof-area-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.prof-area-header {
    margin-bottom: 1.5rem;
}

.prof-area-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    text-transform: lowercase;
    letter-spacing: 0.03em;
}

.prof-area-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.prof-history-section {
    margin-bottom: 1rem;
}

/* Proficiência Ruler */
.prof-ruler-container {
    margin: 2rem 0 5rem;
    padding: 0 1.2rem;
    position: relative;
    width: 100%;
}

.prof-ruler-track {
    height: 1.2rem;
    background: linear-gradient(to right,
            var(--danger-dark),
            var(--danger),
            #fff4b1,
            var(--success-light),
            var(--success));
    border-radius: 1rem;
    position: relative;
    border: 0px solid var(--border);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.prof-ruler-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 1.6rem;
    background: var(--border);
}

.prof-ruler-marker::after {
    content: attr(data-value);
    position: absolute;
    bottom: -2.2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-family: var(--font-mono);
    font-weight: 700;
    pointer-events: none;
}

.prof-ruler-marker::before {
    content: attr(data-label);
    position: absolute;
    bottom: -3.8rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: lowercase;
    pointer-events: none;
}

.prof-ruler-marker.marker-avg {
    background: var(--text);
    width: 2px;
    height: 2.2rem;
    opacity: 1;
    z-index: 2;
}

.prof-ruler-marker.marker-avg::after {
    bottom: -2.2rem;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 1.1rem;
}

.prof-ruler-marker.marker-avg::before {
    color: var(--text-muted);
}

.prof-ruler-value {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1.6rem;
    height: 1.6rem;
    background: var(--orange-text);
    border: 3px solid var(--surface);
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    z-index: 5;
    transition: left 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.prof-ruler-value::after {
    content: attr(data-score);
    position: absolute;
    top: -3.2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--current-prof-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 0.6rem;
    font-size: 1.3rem;
    font-weight: 900;
    font-family: var(--font-mono);
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.prof-ruler-value::before {
    content: '';
    position: absolute;
    top: -0.8rem;
    left: 50%;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 8px solid var(--current-prof-color);
}

.prof-section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 0.8rem;
}

.prof-questions-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-right: 0.5rem;
}

.prof-questions-list::-webkit-scrollbar {
    width: 4px;
}

.prof-questions-list::-webkit-scrollbar-thumb {
    background: var(--border);
}

.prof-q-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.1rem;
    background: var(--bg);
    border-radius: 0.8rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    gap: 0.8rem;
    border: 1px solid transparent;
}

.prof-q-item.acertou {
    border-left: 4px solid var(--success-light);
}

.prof-q-item.errou {
    border-left: 4px solid var(--danger-dark);
}

.prof-q-item .prof-q-label {
    flex: 1;
}

.prof-q-item .prof-q-result {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.prof-q-item .prof-q-params {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.prof-q-item:hover {
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.prof-q-item .prof-q-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── proficiency chart ── */
.prof-chart-wrap {
    position: relative;
    width: 100%;
    background: var(--bg);
    border-radius: 1rem;
    padding: 0.8rem 0.4rem;
    overflow: hidden;
}

.prof-chart-svg {
    width: 100%;
    height: auto;
    display: block;
}

.prof-chart-dot {
    cursor: pointer;
    transition: r 0.15s;
}

.prof-chart-dot:hover {
    r: 6;
}

.prof-chart-tooltip {
    display: none;
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.35rem 0.7rem;
    font-size: 1rem;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* gradient top */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: var(--header-h);
    background:
        radial-gradient(circle at 12.5% 0%,
            color-mix(in srgb, var(--g-purple) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 37.5% 0%,
            color-mix(in srgb, var(--g-pink) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 62.5% 0%,
            color-mix(in srgb, var(--g-purple) 50%, transparent) 0%,
            transparent 37.5%),
        radial-gradient(circle at 87.5% 0%,
            color-mix(in srgb, var(--g-pink) 50%, transparent) 0%,
            transparent 37.5%);
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    animation: slideGradientRight 4s linear infinite;
}

/* ── CHATBOT ────────────────────────────────────────── */
#chat-fab {
    position: fixed;
    width: 4rem;
    height: 4rem;
    border-radius: 99px;
    background: linear-gradient(135deg, var(--g-pink), var(--g-purple));
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 9000;
    pointer-events: auto !important;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: width 0.9s cubic-bezier(0.22, 0, 0, 1),
        padding 0.9s cubic-bezier(0.22, 0, 0, 1),
        border-radius 0.9s cubic-bezier(0.22, 0, 0, 1),
        box-shadow 0.3s ease;
}

body.overlay-open #chat-fab {
    display: none !important;
}

#chat-fab:hover {
    box-shadow: 0 6px 28px #94e2a200;
}

.chat-fab-icon {
    position: absolute;
    left: auto;
    right: calc((4rem - 2.9rem));
    top: 50%;
    transform: translateY(-50%);
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-fab-icon svg {
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease;
}

#chat-fab.open .chat-fab-icon svg {
    transform: rotate(90deg) scale(0.9);
}

.chat-fab-label {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    font-family: var(--font-display);
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    line-height: 1.4;
    padding-bottom: 0.4rem;
    padding-right: 1rem;
    transition: max-width 0.9s cubic-bezier(0.22, 0, 0, 1),
        opacity 0.2s cubic-bezier(0.22, 0, 0, 1);
    text-transform: lowercase;
}

/* expandido: mostra label quando nota/questão está aberta */
#chat-fab.chat-fab-expanded {
    width: auto;
    padding: 1rem 4rem 1rem 2rem;
    border-radius: 99px;
}

#chat-fab.chat-fab-expanded .chat-fab-label {
    max-width: 20rem;
    opacity: 1;
}

#chat-box {
    position: fixed;
    bottom: 8.5rem;
    right: 2rem;
    width: 38rem;
    max-width: calc(100vw - 3rem);
    height: 50rem;
    max-height: calc(100vh - 12rem);
    background: var(--surface);
    border: 0px solid var(--border);
    border-radius: 1.6rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition:
        opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

#chat-box.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

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

.chat-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.chat-header-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.chat-header-context {
    font-size: 1rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 26rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 99px;
}

.chat-bubble {
    max-width: 85%;
    padding: 1rem 1.4rem;
    border-radius: 1.2rem;
    font-size: 1.2rem;
    line-height: 1.6;
    word-wrap: break-word;
    animation: chatFadeIn 0.3s ease;
}

@keyframes chatFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #90c7f4, #94e2a2);
    color: #fff;
    font-weight: 500;
    border-bottom-right-radius: 0.3rem;
}

.chat-bubble.bot {
    align-self: flex-start;
    background: var(--bg);
    color: var(--text);
    border: 0px solid var(--border);
    border-bottom-left-radius: 0.3rem;
}

.chat-bubble.bot p {
    margin: 0 0 0.6rem 0;
}

.chat-bubble.bot p:last-child {
    margin-bottom: 0;
}

.chat-typing {
    align-self: flex-start;
    display: flex;
    gap: 0.4rem;
    padding: 1rem 1.4rem;
    background: var(--bg);
    border: 0px solid var(--border);
    border-radius: 1.2rem;
    border-bottom-left-radius: 0.3rem;
}

.chat-typing span {
    width: 0.7rem;
    height: 0.7rem;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.2s infinite;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    text-align: center;
    padding: 2rem;
}

.chat-empty-icon {
    font-size: 3rem;
    opacity: 0.4;
}

.chat-input-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.4rem;
    border-top: 0px solid var(--border);
    flex-shrink: 0;
}

#chat-input {
    flex: 1;
    background: var(--bg);
    border: 0px solid var(--border);
    border-radius: 99px;
    padding: 1rem 1.4rem;
    font-size: 1.2rem;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: var(--orange);
}

#chat-input::placeholder {
    color: var(--text-muted);
}

#chat-send-btn {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--g-pink), var(--g-purple));
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#chat-send-btn:hover {
    background: var(--orange-text);
}

#chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#chat-send-btn svg {
    width: 1.6rem;
    height: 1.6rem;
}

/* ── CHAT MIC BUTTON ── */
.chat-mic-btn {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    background: var(--surface2);
    border: 0px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-mic-btn svg {
    width: 1.6rem;
    height: 1.6rem;
}

.chat-mic-btn:hover {
    background: color-mix(in srgb, var(--orange) 10%, var(--surface));
    color: var(--text);
    border-color: var(--orange);
}

.chat-mic-btn.recording {
    background: var(--success-light);
    color: #fff;
    animation: mic-pulse 1s ease-in-out infinite;
}

.chat-mic-btn.transcribing {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
    opacity: 0.7;
    pointer-events: none;
}

@keyframes mic-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 0.8rem rgba(239, 68, 68, 0);
    }
}

/* ── RECORDING BALLOON ── */
.recording-balloon {
    position: absolute;
    bottom: calc(100% + 0.6rem);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--danger-dark), var(--danger));
    border: 0px solid var(--orange);
    color: var(--surface);
    padding: 0.5rem 0.9rem;
    border-radius: 99px;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    letter-spacing: var(--tracking-wide);
    text-transform: lowercase;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    pointer-events: none;
    animation: balloon-in 0.2s ease-out;
}

.recording-balloon::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 0px solid transparent;
    border-top-color: var(--danger);
}

@keyframes balloon-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ── DISSERTATIVA MIC BUTTON ── */
.ix-dissertativa-input-row {
    position: relative;
    display: flex;
    align-items: stretch;
}

.ix-dissertativa-input-row .ix-dissertativa-input {
    flex: 1;
    min-height: 12rem;
}

.ix-dissertativa-mic {
    position: absolute;
    bottom: 0.8rem;
    right: 0.8rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.ix-dissertativa-mic svg {
    width: 1.4rem;
    height: 1.4rem;
}

.ix-dissertativa-mic:hover {
    background: color-mix(in srgb, var(--orange) 10%, var(--surface));
    color: var(--text);
    border-color: var(--orange);
}

.ix-dissertativa-mic.recording {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    animation: mic-pulse 1s ease-in-out infinite;
}

.ix-dissertativa-mic.transcribing {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
    opacity: 0.7;
    pointer-events: none;
}

/* ── MOBILE NAV BUTTONS (hidden on desktop) ── */
#mobile-nav {
    display: none;
}

/* ── RESOLUTION DRAWER (bottom popup, like mobile-sidebar-drawer) ── */
#resolution-drawer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#resolution-drawer.open {
    pointer-events: auto;
    opacity: 1;
}

.res-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.res-drawer-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 88%;
    background: var(--bg);
    border-radius: 1.6rem 1.6rem 0 0;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

#resolution-drawer.open .res-drawer-panel {
    transform: translateY(0);
}

.res-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 2rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.res-drawer-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    text-transform: lowercase;
}

.res-drawer-close {
    background: var(--surface2);
    border: none;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.res-drawer-close:hover {
    background: var(--danger);
    color: white;
}

.res-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    -webkit-overflow-scrolling: touch;
}

/* resolution steps inside drawer */
.res-step {
    margin-bottom: 1.6rem;
}

.res-step-header {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.res-step-num {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--orange-text);
    min-width: 2rem;
}

.res-step-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.res-step-content {
    font-size: 1.2rem;
    line-height: 1.75;
    color: var(--text-muted);
    padding-left: 2.8rem;
    text-transform: none !important;
}

.res-step-content p {
    margin: 0 0 0.8rem;
}

.res-step-content p:last-child {
    margin-bottom: 0;
}

/* auto-detected text base links */
.textbase-link {
    color: var(--orange-text);
    cursor: pointer;
    border-bottom: 1px dashed var(--orange-text);
    transition: all 0.15s;
    font-weight: 600;
}

.textbase-link:hover {
    color: var(--orange);
    border-bottom-style: solid;
}

/* alternative verdict badges inside resolution */
.res-alt-badge {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 800;
    padding: 0.2rem 0.8rem;
    border-radius: 99px;
    margin-left: 0.6rem;
    vertical-align: middle;
}

.res-alt-badge.correct {
    background: color-mix(in srgb, var(--success-light) 20%, transparent);
    color: var(--success-light);
}

.res-alt-badge.wrong {
    background: color-mix(in srgb, var(--danger) 15%, transparent);
    color: var(--danger);
}

/* highlight animation when scrolling to text base quote */
.textbase-highlight {
    background: color-mix(in srgb, var(--orange) 20%, transparent);
    border-radius: 0.3rem;
    transition: background 0.3s;
    animation: highlightFade 2.5s ease forwards;
}

@keyframes highlightFade {
    0% {
        background: color-mix(in srgb, var(--orange) 30%, transparent);
    }

    70% {
        background: color-mix(in srgb, var(--orange) 30%, transparent);
    }

    100% {
        background: transparent;
    }
}

/* ── MOBILE SIDEBAR DRAWER ── */
#mobile-sidebar-drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    flex-direction: column;
}

#mobile-sidebar-drawer.open {
    display: flex;
}

.mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay-bg);
}

.mobile-drawer-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90%;
    background: var(--surface);
    border-radius: 1.6rem 1.6rem 0 0;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: drawerSlideUp 0.68s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes drawerSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 2rem;
    border-bottom: 0px solid var(--border);
    flex-shrink: 0;
}

.mobile-drawer-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
}

.mobile-drawer-close {
    background: var(--surface2);
    border: none;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-drawer-search {
    padding: 0rem 2rem 0.6rem;
    flex-shrink: 0;
}

.mobile-drawer-search input {
    width: 100%;
    background: var(--bg);
    border: none;
    border-radius: 99px;
    color: var(--text);
    font-family: inherit;
    font-size: 1.2rem;
    padding: 0.7rem 1.2rem;
    outline: none;
}

.mobile-drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.8rem 0;
}

/* ══════════════════════════════════════════════ */
/* ── MOBILE ─────────────────────────────────── */
/* ══════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --header-h: 5.4rem;
    }

    /* ── topbar ── */
    #topbar {
        padding: 0 4vw;
        gap: 2vw;
        display: flex;
        pointer-events: none;
    }

    #topbar * {
        pointer-events: auto;
    }

    #topbar-logo {
        font-size: 1.8rem;
    }

    #topbar-right {
        margin-left: auto;
        flex: 0 0 auto;
        gap: 3vw;
        min-width: 0;
        justify-content: flex-start;
    }

    #topbar-right button {
        font-size: 1.3rem;
    }

    #topbar-right a {
        font-size: 1.1rem;
    }

    #topbar-user-wrap {
        flex: 0 0 auto;
        width: auto;

    }

    #btn-login-status {
        min-height: 2.85rem;
        font-size: 1.6rem;
        padding: 0.35rem 0.75rem 0.35rem 0.2rem;
        gap: 0.55rem;
        justify-content: flex-start;
        width: auto;
        display: flex;
    }


    #btn-login-status-text {
        font-size: inherit;
        max-width: min(28vw, 11rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #btn-user-settings {
        width: 2.8rem;
        min-width: 2.8rem;
    }

    .user-chip-avatar {
        width: 2rem;
        height: 2rem;
    }

    #btn-settings svg {
        width: 1.85rem;
        height: 1.85rem;
        display: block;
    }

    #topbar-settings-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    #btn-toggle-graph {
        display: none !important;
    }

    #content-section-header {
        display: none !important;
    }

    .quest-title {
        display: none !important;
    }

    /* ── landing mobile ── */
    .landing-areas-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .landing-others-grid {
        grid-template-columns: 1fr !important;
        gap: 1.2rem;
    }

    #landing-home {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0;
        gap: 2vw;
    }

    .landing-columns {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .landing-column {
        width: 100%;
        gap: 1rem;
    }

    .landing-greeting {
        display: block;
        max-width: 48rem;
        margin-bottom: 1vh;
        z-index: 5;
    }

    .landing-main-btn {
        padding: 2vh;
        font-size: 2rem;
    }

    .landing-main-btn svg {
        width: 6vw;
        height: 6vw;
    }

    .lap-score {
        font-size: 2rem;
    }

    .lap-label {
        font-size: 1rem;
        padding: 0.5vw;
    }

    body.landing-active #sidebar {
        display: none !important;
    }

    body.landing-active #content-col {
        width: 100% !important;
    }

    /* ── layout: vertical stack ── */
    #app {
        flex-direction: column;
        padding: var(--header-h) 4vw 2vw;
        gap: 4vw;
        height: auto;
        min-height: 100vh;
    }

    /* ── sidebar: hidden entirely ── */
    #sidebar {
        display: none;
    }

    /* ── mobile nav buttons ── */
    #mobile-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        flex-shrink: 0;
        z-index: 5;
    }

    .mobile-nav-btn {
        background: var(--surface);
        border: 0px solid var(--border);
        border-radius: 1rem;
        padding: 1.2rem 1.6rem;
        font-family: inherit;
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--text);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.6rem;
        transition: all 0.2s;
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    }

    .mobile-nav-btn:hover,
    .mobile-nav-btn:active {
        border-color: var(--orange);
        color: var(--orange-text);
    }

    .mobile-nav-btn svg {
        width: 1.6rem;
        height: 1.6rem;
        flex-shrink: 0;
    }

    /* ── content: always visible, main focus ── */
    #content-col {
        flex: 1;
        order: 1;
    }

    #content-area {
        min-height: 50vh;
        z-index: 20;
    }

    /* ── graph: below content ── */
    #graph-col {
        display: none !important;
        width: 100% !important;
        order: 2;
        opacity: 1 !important;
        margin-left: 0 !important;
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    }

    #graph-col.collapsed {
        display: none !important;
        width: 100% !important;
        opacity: 1 !important;
        margin-left: 0 !important;
    }

    #graph-panel {
        height: 40vh;
    }

    /* ── content padding adjustments ── */
    #note-header {
        padding: 1.2rem 1.2rem 1.2rem 2rem;
    }

    #note-scroll {
        padding: 0 2rem;
    }

    #note-pagination {
        padding-left: 2rem;
        padding-right: 2rem;
        gap: 0.75rem;
    }

    #note-title-display {
        font-size: 2rem;
    }

    #note-page-indicator {
        flex: 1;
    }

    #note-page-progress {
        gap: 0.3rem;
    }

    .note-page-btn {
        padding: 0.72rem 0.92rem;
    }

    #backlinks-bar,
    #vinculos-bar {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    #quest-header {
        padding: 1.2rem 2rem 1rem !important;
    }

    #quest-scroll-area {
        padding: 0 2rem !important;
    }

    /* ── chatbot ── */
    #chat-fab {
        bottom: 1.4rem;
        right: 1.4rem;
        width: 4.6rem;
        height: 4.6rem;
    }

    #chat-box {
        bottom: 7rem;
        right: 1rem;
        width: calc(100vw - 2rem);
        max-height: calc(100vh - 9rem);
    }

    /* ── overlays ── */
    .login-box {
        margin: 6vw;
        padding: 6vw;
    }

    .profile-avatar-editor {
        flex-direction: column;
        align-items: flex-start;
    }

    #stats-overlay,
    #quest-stats-overlay,
    #proficiency-overlay {
        padding: 0;
        justify-content: flex-start;
        z-index: 200;
    }

    .stats-box,
    .prof-overlay-box {
        max-width: 100%;
        max-height: 100%;
        min-height: 100vh;
        border-radius: 0;
        margin: 0;
        padding: 6vw;
        border: none;
        box-shadow: none;
    }

    .prof-score-hero {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    #btn-proficiency {
        padding: 0.35rem 1rem;
        font-size: 1.3rem;
    }

    #btn-proficiency .prof-label {
        font-size: 1.2rem;
    }

    /* prof stat cards mobile */
    .prof-stats-row {
        gap: 0.4rem;
    }

    .prof-stat-card {
        min-height: 5.5rem;
        padding: 0.6rem 0.4rem 0.6rem;
        border-radius: 0.8rem;
    }

    .prof-stat-label {
        font-size: 0.65rem;
    }

    .prof-stat-value {
        font-size: 1.5rem;
    }

    .prof-pie-wrap {
        width: 3.2rem;
        height: 3.2rem;
    }

    .prof-pie-pct {
        font-size: 0.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* ── gradient ── */
    body::before {
        height: var(--header-h);
    }

    /* ── section headers ── */
    .section-header {
        height: 2.6rem;
    }

    /* ── mobile quest filters ── */
    #mobile-quest-filters {
        padding: 0;
    }

    #mobile-quest-filters .qf-section-label {
        margin-top: 0.5rem;
    }

    #mobile-quest-filters .qf-section-label:first-child {
        margin-top: 2rem;
    }
}

.q-checkbox {
    display: none;
}

/* ── PAINEL DE NAVEGAÇÃO POR AULAS ── */
#aula-nav-panel {
    background: var(--surface);
    border-radius: 1.4rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    margin-bottom: 1vw;
    max-height: 50vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#aula-nav-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.aula-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.4rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.aula-nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
}

.aula-nav-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.2rem;
    line-height: 1;
}

.aula-nav-close:hover {
    color: var(--text);
}

.aula-nav-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem 0;
}

.aula-nav-list::-webkit-scrollbar {
    width: 4px;
}

.aula-nav-list::-webkit-scrollbar-thumb {
    background: var(--border);
}

.aula-nav-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.8rem 1.4rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}

.aula-nav-item:hover {
    background: var(--surface2);
}

.aula-nav-item.active {
    background: color-mix(in srgb, var(--orange) 8%, var(--surface));
    border-left-color: var(--orange);
}

.aula-nav-item-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.aula-nav-item-code {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.aula-nav-item-theme {
    font-size: 1rem;
    color: var(--text-muted);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aula-nav-item-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--surface2);
    padding: 0.1rem 0.5rem;
    border-radius: 99px;
    font-weight: 600;
    white-space: nowrap;
}

.aula-nav-item-content {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aula-nav-empty {
    padding: 2rem 1.4rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ── AULA NAV NO MOBILE ── */
@media (max-width: 768px) {
    #aula-nav-panel {
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .aula-nav-header {
        padding: 0.8rem 0;
        border-bottom: none;
    }

    .aula-nav-item {
        padding: 0.8rem 0;
    }
}

/* Footer responsive adjustments */
@media (min-width: 769px) {
    footer {
        padding: 1rem 0 !important;
        margin-top: 1rem !important;
        min-height: auto !important;
        border: none !important;
        box-shadow: none !important;
    }

    footer>div:last-child {
        flex-direction: row !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    footer>div:last-child>div:first-child {
        text-align: left !important;
    }

    footer>div:last-child>div:last-child {
        text-align: right !important;
    }
}

@media (max-width: 768px) {
    footer {
        padding: 1.5rem 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    footer>div:last-child {
        flex-direction: row !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    footer>div:last-child>div:last-child {
        text-align: right !important;
    }

    /* Adjust font sizes for mobile */
    footer>div:last-child>div:first-child {
        font-size: 1.6rem !important;
    }

    footer>div:last-child>div:last-child {
        font-size: 1.2rem !important;
    }
}

/* ── PROFICIENCY FILTERS PER AREA ── */
.prof-filter-btn {
    background: var(--bg);
    border: 0px solid var(--border);
    margin-bottom: 0px;
    color: var(--text-muted);
    border-radius: 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    transition: all 0.2s ease;
    text-transform: lowercase;
}

.prof-filter-btn:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--orange-text);
}

.prof-filter-btn.active {
    background: var(--success);
    color: var(--surface);
    border-color: var(--orange-text);
}

.prof-area-filter-box {
    background: var(--surface);
    border: 0px solid var(--border);
    border-radius: 1rem;
    padding: 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Difficulty Dual-Range Slider */
.qf-diff-slider {
    padding: 0.4rem 0.5rem 0;
}

.qf-diff-bar {
    position: relative;
    height: 24px;
    width: 100%;
    cursor: pointer;
    touch-action: none;
}

.qf-diff-track {
    position: absolute;
    top: 9px;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    pointer-events: none;
}

.qf-diff-fill {
    position: absolute;
    top: 9px;
    height: 6px;
    background: var(--orange);
    border-radius: 3px;
    pointer-events: none;
}

.qf-diff-handle {
    position: absolute;
    top: 3px;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--orange);
    cursor: grab;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 2;
    touch-action: none;
}

.qf-diff-handle:active {
    cursor: grabbing;
    background: var(--orange);
}

.qf-diff-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 0.1rem;
}

.qf-diff-val {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-size: 1rem;
    font-weight: 900;
    color: var(--text);
    font-family: var(--font-mono);
    letter-spacing: var(--tracking-wide, 0.04em);
}

.qf-diff-hints {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.3rem;
    text-transform: lowercase;
    letter-spacing: var(--tracking-wide, 0.04em);
    font-family: var(--font-display);
}

.prof-filter-presets {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.prof-preset-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.3rem 0.6rem;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.prof-preset-btn:hover {
    border-color: var(--orange-text);
    color: var(--orange-text);
}

/* Trilha de Aprendizagem Animations */
.trilha-node-wrapper {
    opacity: 0;
    transform: translate3d(0, 20px, 0) scale(0.95);
    transition: opacity 3.2s cubic-bezier(0.22, 1, 0.36, 1), transform 4s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.trilha-node-wrapper.trilha-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

#trilha-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 0;
    /* no CSS transition — driven by JS on scroll via rAF */
}

#trilha-svg-path.revealing {
    animation: trilhaLineReveal 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes trilhaLineReveal {
    from {
        clip-path: inset(0 0 100% 0);
    }

    to {
        clip-path: inset(0 0 var(--reveal-stop, 0%) 0);
    }
}

/* ─────────────────────────────────────────────────────────────
   COMPETÊNCIAS CAROUSEL — Proficiency Overlay
   ───────────────────────────────────────────────────────────── */

.competencias-carousel-section {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comp-carousel-label {
    font-family: var(--font-display, "Manrope", sans-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    text-transform: lowercase;
    letter-spacing: var(--tracking-snug, -0.02em);
}

.competencias-carousel {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.competencias-carousel::-webkit-scrollbar {
    height: 0.4rem;
}

.competencias-carousel::-webkit-scrollbar-track {
    background: transparent;
}

.competencias-carousel::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 0.2rem;
}

.comp-carousel-card {
    flex: 0 0 20rem;
    height: 24rem;
    background: transparent;
    border-radius: var(--radius);
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.comp-carousel-card:hover {
    transform: translateY(-0.4rem);
}

.comp-carousel-card:active {
    transform: translateY(0);
}

.cc-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.comp-carousel-card.active-flip .cc-inner {
    transform: rotateY(180deg);
}

.cc-front,
.cc-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transform: translateZ(0);
}

.cc-back {
    transform: rotateY(180deg) translateZ(0);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--surface);
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
}

.cc-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    transition: height 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cc-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    height: 100%;
    pointer-events: none;
}

.cc-header-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    justify-content: center;
}

.cc-label {
    font-family: var(--font-display, "Manrope", sans-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: var(--tracking-snug, -0.02em);
    text-transform: lowercase;
}

.cc-name {
    font-family: var(--font-display, "Manrope", sans-serif);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.cc-value {
    font-family: var(--font-display, "Manrope", sans-serif);
    font-size: 4.5rem;
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text);
    text-align: center;
    margin: auto 0;
    line-height: 1;
}

.cc-value.is-pending {
    font-size: 2.8rem;
    color: var(--text-muted) !important;
    font-weight: 700;
}

.cc-desc {
    font-family: var(--font-body, "Manrope", sans-serif);
    font-size: 1rem;
    color: var(--text);
    line-height: 1.5;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cc-front-desc {
    margin-top: auto;
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.4;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-top: 1rem;
}

.cc-back-stats {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cc-back-prof {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.cc-back-pct {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
}

.cc-back-count {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.prof-competencias-toggle-wrap {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0 1rem;
}

.prof-competencias-toggle-btn {
    background: var(--surface2);
    border: 0px solid var(--border);
    padding: 0.6rem 1.4rem;
    border-radius: 99px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;

}

.prof-competencias-toggle-btn:hover {
    background: var(--surface2);
    border-color: var(--orange);
    color: var(--orange-text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.prof-competencias-toggle-btn:active {
    transform: translateY(0);
}

/* ── lb-box dark mode overrides ── */
[data-theme="dark"] .lb-pos-1 {
    background: linear-gradient(135deg, color-mix(in srgb, #ffd700 20%, var(--bg)), color-mix(in srgb, #f9a825 35%, var(--bg)));
}

[data-theme="dark"] .lb-pos-2 {
    background: linear-gradient(135deg, color-mix(in srgb, #c0c0c0 20%, var(--bg)), color-mix(in srgb, #a8a8a8 35%, var(--bg)));
}

[data-theme="dark"] .lb-pos-3 {
    background: linear-gradient(135deg, color-mix(in srgb, #cd7f32 20%, var(--bg)), color-mix(in srgb, #a0522d 35%, var(--bg)));
}

[data-theme="dark"] .lb-pos-1 .lb-box-pos-wrap {
    background: #ffd700;
    color: #3d2e00;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

[data-theme="dark"] .lb-pos-2 .lb-box-pos-wrap {
    background: #c0c0c0;
    color: #2a2a2a;
}

[data-theme="dark"] .lb-pos-3 .lb-box-pos-wrap {
    background: #cd7f32;
    color: #3a1e00;
}

[data-theme="dark"] .lb-box-me {
    background: color-mix(in srgb, var(--orange) 12%, var(--bg));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 30%, transparent);
}

[data-theme="dark"] .lb-box:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .lb-box-stat {
    background: rgba(255, 255, 255, 0.1);
    border: 0px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .lb-box-turma-badge {
    background: rgba(255, 255, 255, 0.15);
}

/* ═══════════════════════════════════════════════════════════
   INTERACTIVE BLOCKS — textos didáticos (.ix-*)
   ═══════════════════════════════════════════════════════════ */

/* ── shared ──────────────────────────────────────────── */
[class^="ix-"] {
    text-transform: none;
}

/* ── FLASHCARD ───────────────────────────────────────── */
.ix-flashcard {
    perspective: 800px;
    margin: 1.6rem 0;
    cursor: pointer;
    user-select: none;
}

.ix-flashcard-inner {
    position: relative;
    width: 100%;
    min-height: 120px;
    transition: transform 0.5s cubic-bezier(.4, .2, .2, 1);
    transform-style: preserve-3d;
}

.ix-flashcard {
    position: relative;
}

.ix-flashcard.flipped .ix-flashcard-inner {
    transform: rotateY(180deg);
}

.ix-flashcard-front,
.ix-flashcard-back {
    backface-visibility: hidden;
    border-radius: var(--radius);
    border: none;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    padding: 1.6rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    font-size: 1.4rem;
    line-height: 1.5;
}

.ix-flashcard-front {
    background: linear-gradient(135deg, #94e2a27f, #90c7f475);
    color: var(--text);
    font-weight: 700;
    justify-content: center;
    border-radius: var(--radius);
}

.ix-flashcard-back {
    position: absolute;
    inset: 0;
    background: var(--surface);
    color: var(--text);
    transform: rotateY(180deg);
    border-radius: var(--radius);
    overflow: hidden;
}

.ix-flashcard-back::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, #94e2a226, #90c7f43b);
    opacity: 1;
    z-index: -1;
    border-radius: inherit;
}

.ix-flashcard-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    letter-spacing: 0.04em;
}

.ix-flashcard.flipped .ix-flashcard-hint {
    opacity: 0;
}

/* ── FLASHCARD SWIPE ─────────────────────────────────── */
.ix-flashcard {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ix-flashcard.swiping {
    transition: none;
}

.ix-flashcard.swipe-right {
    animation: swipeRight 0.5s ease forwards;
    border: 0px solid var(--success-light);
}

.ix-flashcard.swipe-left {
    animation: swipeLeft 0.5s ease forwards;
    border: 0px solid var(--danger-dark);
}

.ix-flashcard.swipe-right .ix-flashcard-front,
.ix-flashcard.swipe-right .ix-flashcard-back {
    border: 0px solid var(--success-light);
}

.ix-flashcard.swipe-left .ix-flashcard-front,
.ix-flashcard.swipe-left .ix-flashcard-back {
    border: 0px solid var(--danger-dark);
}

@keyframes swipeRight {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    50% {
        transform: translateX(100px);
        opacity: 0.5;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes swipeLeft {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    50% {
        transform: translateX(-100px);
        opacity: 0.5;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.ix-flashcard-swipe-hint {
    display: none;
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.2s;
}

.ix-flashcard-swipe-left {
    background: color-mix(in srgb, var(--danger-dark) 40%, transparent);
}

.ix-flashcard-swipe-right {
    background: color-mix(in srgb, var(--success-light) 40%, transparent);
}

.ix-flashcard.swipe-left-hint .ix-flashcard-swipe-left,
.ix-flashcard.swipe-right-hint .ix-flashcard-swipe-right {
    display: block;
}

/* ── QUIZ (mini-pergunta) ────────────────────────────── */
.ix-quiz {
    margin: 2.4rem 0;
    border: none;
    border-radius: var(--radius);
    background: var(--surface2);
    padding: 2rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
}

.ix-quiz-question {
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    line-height: 1.4;
}

.ix-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.ix-quiz-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ix-quiz-opt:hover {
    background: color-mix(in srgb, var(--surface2) 80%, var(--text));
    transform: translateX(4px);
}

.ix-quiz-opt.selected {
    background: color-mix(in srgb, var(--orange) 15%, var(--surface2));
    box-shadow: inset 0 0 0 0px var(--text);
}

.ix-quiz-opt.correct {
    background: var(--success-light);
    color: var(--text);
    font-weight: 700;
}

.ix-quiz-opt.wrong {
    background: var(--danger-dark);
    color: var(--text);
    opacity: 1;
}

.ix-quiz-feedback {
    margin-top: 1.2rem;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.5rem;
}

.ix-quiz-feedback.correct {
    color: var(--success-light);
}

.ix-quiz-feedback.wrong {
    color: var(--danger-dark);
}

/* ── COMPLETAR ───────────────────────────────────────── */
.ix-completar {
    margin: 2.4rem 0;
    border: none;
    border-radius: var(--radius);
    background: var(--surface2);
    padding: 2rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
}

.ix-completar-frase {
    font-size: 1.1rem;
    line-height: 2.2;
    margin-bottom: 1.5rem;
    font-family: var(--font-body);
}

.ix-completar-blank {
    display: inline-block;
    min-width: 100px;
    text-align: center;
    padding: 0.4rem 0.8rem;
    border-bottom: 1px solid var(--orange-text);
    color: var(--surface2);
    font-weight: 700;
}

.ix-completar-opcoes {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.ix-completar-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1rem 1.5rem;
    border: 0px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ix-completar-opt:hover:not(:disabled) {
    border-color: var(--orange);
    background: color-mix(in srgb, var(--orange) 5%, var(--surface2));
}

.ix-completar-opt.selected {
    border-color: var(--orange);
    background: var(--success);
}

.ix-completar-opt.correct {
    border-color: var(--success-light);
    background: var(--success-light);
}

.ix-completar-opt.wrong {
    border-color: var(--danger-dark);
    background: var(--danger-dark);
}

.ix-completar-opt.highlighted {
    background: var(--success-light);
}

.ix-completar-opt:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ix-completar-feedback {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 700;
}

.ix-completar-feedback.correct {
    color: var(--success-light);
}

.ix-completar-feedback.wrong {
    color: var(--danger-dark);
}

/* ── CONECTAR (connect columns) ──────────────────────── */
.ix-conectar {
    margin: 2.4rem 0;
    border: none;
    border-radius: var(--radius);
    background: var(--surface2);
    padding: 2rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.ix-conectar-col {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ix-conectar-col-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.0em;
    margin-bottom: 0.3rem;
}

.ix-conectar-arrow {
    display: flex;
    align-items: center;
    font-size: 1.4rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.ix-conectar-item {
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.ix-conectar-item:hover {
    background: color-mix(in srgb, var(--surface2) 85%, var(--text));
    transform: translateY(-1px);
}

.ix-conectar-item.selected {
    background: color-mix(in srgb, var(--orange) 15%, var(--surface2));
    box-shadow: inset 0 0 0 2px var(--orange);
}

.ix-conectar-item.paired {
    opacity: 0.6;
    background: var(--border);
    cursor: default;
    transform: none;
}

.ix-conectar-item.correct {
    background: var(--success-light);
    color: #1a4d1a;
}

.ix-conectar-item.wrong {
    background: var(--danger);
    color: #4d1a1a;
}

.ix-conectar-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 99px;
    background: linear-gradient(135deg, var(--success-light), var(--success));
    color: var(--surface);
    font-family: var(--surface);
    font-size: 1.4rem;
    font-weight: 800;
    cursor: pointer;
    flex-basis: 100%;
    transition: all 0.2s;
}

.ix-conectar-btn:hover {
    background: var(--orange);
    color: white;
}

.ix-conectar-feedback {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    flex-basis: 100%;
}

.ix-conectar-feedback.correct {
    color: var(--success-light);
}

.ix-conectar-feedback.wrong {
    color: var(--danger);
}

/* ── CLICÁVEL (reveal on click) ──────────────────────── */
.ix-clicavel-block {
    margin: 1.6rem 0;
    line-height: 1.6;
    font-size: 1.6rem
}

.ix-clicavel {
    display: inline;
    background: color-mix(in srgb, var(--success) 20%, transparent);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    cursor: pointer;
    font-weight: 600;
    position: relative;
    transition: background 0.2s;
    user-select: none;
}

.ix-clicavel:hover {
    background: color-mix(in srgb, var(--success) 35%, transparent);
}

.ix-clicavel.revealed {
    background: color-mix(in srgb, var(--success-light) 20%, transparent);
}

.ix-clicavel.revealed::after {
    content: attr(data-info);
    display: block;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    font-weight: 400;
    white-space: nowrap;
    max-width: 1040px;
    white-space: normal;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
    color: var(--text);
    line-height: 1.4;
}

/* ── NOTE QUESTIONS SECTION ──────────────────────────── */
/* ── PÁGINA TESTE (questões ao final da nota) ───────────── */
.note-page-test {
    padding-top: 0;
}

.note-page-test-intro {
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-test-intro {
    max-width: 760px;
    margin: 0vh auto 0;
    text-align: top;
}

.note-test-intro .note-test-title {
    font-size: clamp(2.2rem, 5vw, 4rem);
    margin-bottom: 1.4rem;
    margin-top: 1.4rem;
}

.note-test-intro p {
    max-width: 720px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1.75;
}

.note-test-header {
    text-align: center;
    margin-bottom: 2rem;
}

.note-test-title {
    font-size: 2rem;
    margin-top: 2rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--danger-dark), var(--danger));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
    text-transform: lowercase;
    margin-bottom: 0.4rem;
    text-align: center;
}

.note-test-step {
    display: inline-block;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.0em;
    text-transform: lowercase;
}

.note-test-body {
    max-width: 720px;
    margin: 0 auto;
}

.note-test-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 100%;
}

.note-test-body .table-scroll,
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

.note-test-body th,
.note-test-body td {
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.6rem 0.8rem;
    text-align: left;
    white-space: nowrap;
}

.note-test-body th {
    font-weight: 700;
    background: var(--surface2, #f0ede8);
}

.note-test-body td:first-child,
.note-test-body th:first-child {
    white-space: normal;
}

.note-test-body tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

/* ── AUTOAVALIAÇÃO ─────────────────────────────────────── */
.note-page-autoavaliacao {
    max-width: 720px;
    margin: 0 auto;
    padding: 0rem 0rem;
}

.autoavaliacao-container {
    max-width: 100%;
}

.autoavaliacao-section {
    margin-top: -1rem;
    padding: 0rem;
    border: 0px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.autoavaliacao-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
    color: var(--text);
    text-transform: lowercase;
}

.autoavaliacao-obj-card {
    border: 0px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    background: var(--bg);
    margin-bottom: 1rem;
}

.objetivos-intro-container .autoavaliacao-obj-card {
    border: none;
    border-radius: 1rem;
    padding: 1rem;
    background: var(--surface);
    margin-bottom: 0;
}

.autoavaliacao-obj-verbo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    text-transform: lowercase;
    letter-spacing: 0.0em;
}

.autoavaliacao-obj-titulo {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.4;
}

.autoavaliacao-obj-complexidade {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface2);
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    margin-left: 0.3rem;
}

.autoavaliacao-obj-complexidade.nivel-1 { background: var(--success); color: #fff; }
.autoavaliacao-obj-complexidade.nivel-2 { background: var(--success-light); color: var(--text); }
.autoavaliacao-obj-complexidade.nivel-3 { background: var(--warn-mid); color: var(--text); }
.autoavaliacao-obj-complexidade.nivel-4 { background: var(--danger); color: var(--text); }
.autoavaliacao-obj-complexidade.nivel-5 { background: var(--danger-dark); color: var(--text); }

.autoavaliacao-slider-wrap {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 1rem;
    background: var(--surface);
}

.autoavaliacao-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--danger-dark), var(--danger), var(--warn-mid), var(--success-light), var(--success));
    outline: none;
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.autoavaliacao-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s;
}

.autoavaliacao-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.autoavaliacao-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.autoavaliacao-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.autoavaliacao-label {
    text-align: center;
    flex: 1;
    padding: 0.2rem;
    transition: color 0.2s, font-weight 0.2s;
}

.autoavaliacao-label.active {
    color: var(--text);
    font-weight: 700;
}

.autoavaliacao-comentario {
    width: 100%;
    min-height: 60px;
    border: 0px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    resize: vertical;
    background: var(--surface);
    color: var(--text);
}

.autoavaliacao-comentario::placeholder {
    color: var(--text-muted);
}

.autoavaliacao-comentario:focus {
    outline: none;
    border-color: var(--primary);
}

.autoavaliacao-submit {
    display: block;
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--success-light), var(--success));
    color: white;
    border: none;
    border-radius: 99px;
    font-family: var(--font-body);
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: lowercase;
    transition: background 0.2s;
}

.autoavaliacao-submit:hover {
    background: var(--primary-hover);
}

/* ── PAINEL DE OBJETIVOS ─────────────────────────────── */
.objetivos-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.objetivos-panel {
    background: var(--surface);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.objetivos-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.objetivos-panel-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    text-transform: lowercase;
}

.objetivos-panel-close {
    background: var(--surface2);
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem 1rem;
    line-height: 1;
    border-radius: 99px;
}

.objetivos-panel-close:hover {
    color: var(--text);
}

.objetivos-panel-content {
    padding: 1.5rem;
}

.objetivos-geral-label,
.objetivos-menores-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
}

.objetivos-geral-card {
    background: linear-gradient(135deg, var(--primary), var(--success-light));
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.objetivos-geral-verbo {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.objetivos-geral-texto {
    margin: 0.5rem 0 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    line-height: 1.4;
}

.objetivos-menores-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.8rem;
}

.objetivos-menores-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.objetivos-menores-verbo {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: lowercase;
}

.objetivos-menores-nivel {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface2);
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
}

.objetivos-menores-texto {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.4;
}

.objetivos-intro-popup {
    max-width: 680px;
}

.objetivos-intro-popup-content {
    padding: 1.5rem;
}

.objetivos-intro-popup .objetivos-intro-container {
    max-width: none;
}

.objetivos-intro-popup .objetivos-intro-header {
    margin-bottom: 1.5rem;
}

.objetivos-intro-popup .objetivos-intro-start {
    display: none;
}

/* ── PÁGINA INTRO DE OBJETIVOS ───────────────────────── */
.note-page-objetivos-intro-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.objetivos-intro-container {
    max-width: 600px;
    width: 100%;
}

.objetivos-intro-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.objetivos-intro-header svg {
    color: var(--primary);
    flex-shrink: 0;
    width: 2.6rem;
    height: 2.6rem;
}

.objetivos-intro-header h2 {
    margin-top: 0;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    text-transform: lowercase;
}

.objetivos-intro-geral-label,
.objetivos-intro-menores-label,
.objetivos-intro-autoavaliacao-label {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 0.8rem;
    opacity: 0.8;
}

.objetivos-intro-geral-card {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.objetivos-intro-geral-verbo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--surface);
    text-transform: lowercase;
    letter-spacing: 0.00em;
}

.objetivos-intro-geral-texto {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--surface);
    line-height: 1.4;
}

.objetivos-intro-expectativa {
    margin-top: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--surface);
}
.objetivos-intro-expectativa-label {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: lowercase;
    opacity: 0.8;
}

.objetivos-intro-menores {
    margin-bottom: 1.5rem;
}

.objetivos-intro-menores-card {
    border: 0cm solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1cqmax;
    background: var(--bg);
}

.objetivos-intro-menores-verbo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    text-transform: lowercase;
    letter-spacing: 0.00em;
}

.objetivos-intro-menores-texto {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.4;
}

.objetivos-intro-menores-nivel {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--surface2);
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    margin-left: 0.3rem;
}

.objetivos-intro-menores-nivel.nivel-1 { background: var(--success); color: #fff; }
.objetivos-intro-menores-nivel.nivel-2 { background: var(--success-light); color: var(--text); }
.objetivos-intro-menores-nivel.nivel-3 { background: var(--warn-mid); color: var(--text); }
.objetivos-intro-menores-nivel.nivel-4 { background: var(--danger); color: var(--text); }
.objetivos-intro-menores-nivel.nivel-5 { background: var(--danger-dark); color: var(--text); }

.objetivos-intro-autoavaliacao {
    background: var(--surface2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

#preview-content .objetivos-intro-autoavaliacao-desc {
    margin: 0 0 1rem;
    font-size: 1.4rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.objetivos-intro-start {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 99px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: lowercase;
    transition: background 0.2s;
}

.objetivos-intro-start:hover {
    background: var(--primary-hover);
}

/* ── BOTÃO OBJETIVOS NO HEADER ───────────────────────── */
.note-header-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.note-objetivos-info-btn {
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 auto;
    text-transform: none;
}

.note-objetivos-info-btn[hidden] {
    display: none;
}

.note-icon-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.note-icon-btn:hover {
    background: var(--surface2);
    color: var(--text);
}

.note-icon-btn svg {
    width: 20px;
    height: 20px;
}

#preview-content .note-test-title {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 1rem;
    background: linear-gradient(to right, var(--danger-dark), var(--danger));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
    text-transform: lowercase;
    text-align: center;
}

#preview-content .note-test-intro .note-test-title {
    font-size: clamp(2.2rem, 5vw, 4rem);
    margin: 1rem;
}

#preview-content .note-test-intro p {
    max-width: 720px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1.35rem;
    line-height: 1.75;
}

/* ── MARCAR (multiple choice question) ────────────────── */
.ix-marcar {
    margin: 2rem 0;
    padding: 0rem;
    background: var(--surface);
    border: 0px solid var(--border);
    border-radius: var(--radius);
}

.ix-marcar-question {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2rem;
}

.ix-marcar-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ix-marcar-opt {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 1.2rem;
    font-weight: 400;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    color: var(--text);
    font-family: var(--font);
}

.ix-marcar-opt:hover {
    background: var(--panel-bg-strong);
}

.ix-marcar-opt.selected {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface2));
}

.ix-marcar-opt.correct {
    background: var(--success-light);
    border-color: var(--success-light);
}

.ix-marcar-opt.wrong {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
}

.ix-marcar-opt:disabled {
    cursor: default;
    opacity: 0.85;
}

.ix-marcar-submit {
    margin-top: 1rem;
    padding: 0.7rem 2rem;
    border: none;
    border-radius: 99px;
    background: linear-gradient(135deg, var(--g-pink), var(--g-purple));
    color: #fff;
    font-weight: 700;
    font-size: 1.4em;
    cursor: pointer;
    font-family: var(--font);
    width: 100%;
}

.ix-marcar-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ix-marcar-feedback {
    margin-top: 0.8rem;
    font-weight: 700;
    font-size: 1rem;
}

.ix-marcar-feedback.correct {
    color: var(--success-light);
}

.ix-marcar-feedback.wrong {
    color: var(--danger-dark);
}

/* ── MARCAR FEEDBACK MODAL ──────────────────────────── */
.ix-marcar-feedback-modal {
    margin-top: 1.2rem;
}

.ix-feedback-modal-content {
    padding: 1.2rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.ix-feedback-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.8rem;
}

.ix-feedback-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.ix-feedback-option {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.ix-feedback-option:hover {
    border-color: var(--g-purple);
    background: var(--surface);
}

.ix-feedback-option.selected {
    border-color: var(--g-purple);
    background: rgba(144, 199, 244, 0.12);
    font-weight: 600;
}

.ix-feedback-option.ix-feedback-primary {
    border-left: 3px solid var(--g-purple);
}

.ix-feedback-option.ix-feedback-other {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.ix-feedback-option.ix-feedback-sugestao {
    border-left: 3px solid var(--g-pink);
    background: rgba(148, 226, 162, 0.08);
}

.ix-feedback-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.ix-feedback-textarea-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
}

.ix-feedback-textarea {
    flex: 1;
    min-height: 2.5rem;
    max-height: 6rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    resize: vertical;
}

.ix-feedback-textarea:focus {
    outline: none;
    border-color: var(--g-purple);
}

.ix-feedback-mic {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.ix-feedback-mic:hover {
    border-color: var(--g-purple);
    color: var(--text);
}

.ix-feedback-mic.recording {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    color: #fff;
    animation: ix-mic-pulse 1s infinite;
}

@keyframes ix-mic-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.ix-feedback-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.ix-feedback-confirm {
    padding: 0.5rem 1.2rem;
    background: var(--g-purple);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.15s;
}

.ix-feedback-confirm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ix-feedback-skip {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

.ix-feedback-skip:hover {
    color: var(--text);
}

/* ── DISSERTATIVA (essay question) ────────────────────── */
.ix-dissertativa {
    position: relative;
    margin: 2rem 0;
    padding: 1.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ix-dissertativa-question {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
}

.ix-dissertativa-input {
    width: 100%;
    min-height: 10rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1.1rem;
    resize: vertical;
    background: var(--surface2);
    color: var(--text);
}

/* ── ARTEFATO INTERATIVO ────────────────────────────── */
.ix-artefato {
    margin: 2.4rem 0;
    background: var(--surface2);
    border: 0px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ix-artefato-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.4rem;
    background: var(--surface);
    border-bottom: 0px solid var(--border);
    user-select: none;
}

.ix-artefato-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.ix-artefato-title {
    font-family: var(--font-display, var(--font));
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    visibility: hidden;
}

.ix-artefato-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ix-artefato-btn {
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.ix-artefato-btn:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--border) 50%, transparent);
}

.ix-artefato-body {
    position: relative;
    width: 100%;
}

.ix-artefato-iframe {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    transition: height 0.2s ease;
}

/* collapsible code panel */
.ix-artefato-code-panel {
    background: #1e1e2e;
    /* dark theme syntax-like background */
    color: #cdd6f4;
    border-top: 1px solid var(--border);
    font-family: Consolas, Monaco, "Andale Mono", monospace;
    font-size: 0.9rem;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
}

.ix-artefato-code-panel.open {
    max-height: 400px;
    overflow-y: auto;
}

.ix-artefato-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.4rem;
    background: #11111b;
    border-bottom: 1px solid #313244;
    font-size: 0.8rem;
    color: #a6adc8;
}

.ix-artefato-code-content {
    padding: 1rem 1.4rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: normal;
    overflow-wrap: anywhere;
}

.ix-artefato-copy-btn {
    width: auto;
    min-width: 4.5rem;
    padding: 0 0.75rem;
    font-weight: 700;
}

.ix-artefato.expanded {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--surface);
    margin: 0;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.ix-artefato.expanded .ix-artefato-body {
    flex: 1;
    overflow: hidden;
    height: calc(100% - 3.4rem);
}

.ix-artefato.expanded .ix-artefato-iframe {
    height: 100% !important;
}

.ix-artefato.expanded .ix-artefato-code-panel.open {
    max-height: 34vh;
}

@media (max-width: 680px) {
    .ix-artefato-header {
        padding: 0.75rem 0.85rem;
        gap: 0.75rem;
    }

    .ix-artefato-title {
        font-size: 0.95rem;
    }

    .ix-artefato.expanded {
        inset: 0;
        height: 100vh;
        border-radius: 0;
    }
}

/* ── WIDGET ──────────────────────────────────── */
.ix-widget {
    margin: 2.4rem 0;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 1.1rem;
    overflow: hidden;
}

.ix-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.95rem 1.2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.ix-widget-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.ix-widget-icon {
    display: hidden;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    background: var(--surface);
    color: #fff;
    flex-shrink: 0;
}

.ix-widget-title {
    font-family: var(--font-display, var(--font));
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text=muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ix-widget-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ix-widget-btn {
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: 0px solid color-mix(in srgb, var(--border) 82%, transparent);
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}

.ix-widget-btn:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--border) 50%, transparent);
}

.ix-widget-body {
    position: relative;
    width: 100%;
}

.ix-widget-iframe {
    display: block;
    width: 100%;
    border: none;
    background: var(--surface);
}

.ix-widget.expanded {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--surface);
    margin: 0;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.ix-widget.expanded .ix-widget-body {
    flex: 1;
    overflow: hidden;
    height: calc(100% - 3.4rem);
}

.ix-widget.expanded .ix-widget-iframe {
    height: 100% !important;
}

@media (max-width: 600px) {
    .ix-widget-header {
        padding: 0.75rem 0.85rem;
        gap: 0.75rem;
    }

    .ix-widget-title {
        font-size: 0.95rem;
    }

    .ix-widget.expanded {
        inset: 0;
        height: 100vh;
        border-radius: 0;
    }
}

.ix-dissertativa-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.ix-dissertativa-counter {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.ix-dissertativa-submit {
    padding: 0.6rem 1.6rem;
    border: none;
    border-radius: 99px;
    background: linear-gradient(135deg, var(--g-pink), var(--g-purple));
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: var(--font);
}

.ix-dissertativa-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ix-dissertativa-feedback {
    margin-top: 0.8rem;
    font-size: 1rem;
}

.ix-dissertativa-feedback.pending {
    color: var(--text-muted);
}

.ix-dissertativa-feedback.error {
    color: var(--danger);
}

.ix-dissertativa-feedback.correct {
    color: var(--success);
}

.ix-dissertativa-feedback-label {
    display: none;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: var(--tracking-wide);
    text-transform: lowercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.ix-dissertativa-analysis {
    color: var(--text);
    background: var(--bg);
    border: 0px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 0.4rem;
}

.ix-dissertativa-analysis .md-content> :first-child {
    margin-top: 0;
}

.ix-dissertativa-analysis .md-content> :last-child {
    margin-bottom: 0;
}

.ix-dissertativa-analysis .md-content h1,
.ix-dissertativa-analysis .md-content h2,
.ix-dissertativa-analysis .md-content h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: var(--tracking-snug);
    text-transform: lowercase;
    margin: 1rem 0 0.4rem;
    color: var(--orange);
}

.ix-dissertativa-analysis .md-content p {
    margin: 0.4rem 0;
}

.ix-dissertativa-analysis .md-content ul,
.ix-dissertativa-analysis .md-content ol {
    padding-left: 1.4rem;
    margin: 0.4rem 0;
}

.ix-dissertativa-analysis .md-content li {
    margin: 0.2rem 0;
}

.ix-dissertativa-analysis .md-content strong {
    color: var(--orange-text);
}

.ix-dissertativa-analysis .md-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--surface);
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

/* ── WIKILINK POPUP ──────────────────────────────────── */
.wikilink-popup {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
    max-height: 340px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s;
    text-transform: none;
}

.wikilink-popup.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.wikilink-popup-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text);
}

.wikilink-popup-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0.3rem;
    line-height: 1;
}

.wikilink-popup-close:hover {
    color: var(--text);
}

.wikilink-popup-body {
    padding: 1rem;
    overflow-y: auto;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text);
    flex: 1;
}

.wikilink-popup-body p {
    margin: 0 0 0.5rem;
}

.wikilink-popup-footer {
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.wikilink-popup-open {
    display: block;
    width: 100%;
    padding: 0.45rem 0;
    border: 1px solid var(--border);
    border-radius: 99rem;
    background: var(--surface2);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}

.wikilink-popup-open:hover {
    background: var(--border);
}

/* ── GLOSSARY HOVER ─────────────────────────── */
.gloss-term {
    border-bottom: 1.5px dashed var(--accent);
    cursor: help;
    font-weight: 600;
    transition: background 0.15s;
    border-radius: 2px;
    padding: 0 2px;
}

.gloss-term:hover {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.gloss-hover-popup {
    position: fixed;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 1rem 1.2rem;
    max-width: 28rem;
    width: max-content;
    z-index: 11000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}

.gloss-hover-popup.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.gloss-hover-term {
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    text-transform: lowercase;
}

.gloss-hover-def {
    color: var(--text);
    line-height: 1.5;
}

.gloss-hover-def p {
    margin: 0;
}

/* ── HINT SYSTEM ─────────────────────────── */
.btn-hint {
    background: none;
    border: 1px solid var(--border);
    border-radius: 99px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s, border-color 0.15s;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-hint:hover {
    color: var(--orange);
    border-color: var(--orange);
}

.hint-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
    max-width: 44rem;
    width: 90%;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

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

.hint-popup-title {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
    text-transform: lowercase;
}

.hint-popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0.3rem;
    line-height: 1;
}

.hint-popup-close:hover {
    color: var(--text);
}

.hint-popup-body {
    padding: 1.4rem;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
    color: var(--text);
}

.hint-popup-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.4rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hint-nav-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.4rem 1rem;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    transition: background 0.15s;
}

.hint-nav-btn:hover {
    background: var(--border);
}

.hint-nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* ── EXTERNAL LINKS IN NOTES ─────────────────────────── */
.ix-external-link,
#preview-content a[href^="http"] {
    color: var(--accent2, #5c6b7a);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.ix-external-link:hover,
#preview-content a[href^="http"]:hover {
    opacity: 0.8;
}

/* ── REPORT ERROR MODAL ───────────────────────────────── */
.btn-report-error {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.6rem;
    height: 3.6rem;
    background: var(--danger-dark);
    border: 0px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s;
    color: var(--surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-report-error:hover {
    background: var(--border);
    color: var(--orange);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.report-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.report-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.report-box {
    background: var(--surface);
    width: 90%;
    max-width: 450px;
    padding: 2.5rem;
    border-radius: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 0px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.report-overlay.show .report-box {
    transform: translateY(0);
}

.report-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    text-align: center;
    margin-bottom: 0.5rem;
}

.report-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -1rem;
}

.report-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.report-opt-btn {
    background: var(--surface2);
    border: 0px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.report-opt-btn:hover {
    border-color: var(--orange);
    color: var(--text);
}

.report-opt-btn.active {
    background: var(--orange);
    border-color: var(--orange);
    color: white;
}

.report-textarea {
    width: 100%;
    min-height: 100px;
    background: var(--surface2);
    border: 0px solid var(--border);
    border-radius: 1.2rem;
    padding: 1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 1.1rem;
    resize: vertical;
    outline: none;
}

.report-textarea:focus {
    border-color: var(--orange);
}

.report-actions {
    display: flex;
    gap: 1rem;
}

.btn-report-cancel,
.btn-report-submit {
    flex: 1;
    padding: 1rem;
    border-radius: 1.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-report-cancel {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-report-cancel:hover {
    background: var(--surface2);
    color: var(--text);
}

.btn-report-submit {
    background: var(--orange);
    border: none;
    color: white;
}

.btn-report-submit:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* ── IN-LOCO RESOLUTION POPUPS & FLOATING NAV ── */

.resolution-floating-nav {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--accent);
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.resolution-floating-nav.hidden {
    display: none !important;
}

.resolution-nav-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 3.2rem;
    height: 3.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s;
    flex-shrink: 0;
}

.resolution-nav-btn:hover {
    background: var(--text);
    color: var(--surface);
    border-color: var(--text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: scale(1.05);
}

.resolution-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: var(--surface2);
    color: var(--text-muted);
    border-color: var(--border);
    transform: none;
}

.inloco-resolution-trigger {
    display: block;
    margin-top: 0.5rem;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 99px;
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.inloco-resolution-trigger:hover {
    background: var(--accent);
    color: white;
}

.inloco-resolution-popup {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    padding: 1.6rem;
    margin-top: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    position: relative;
    font-size: 1.3rem;
    font-family: var(--font);
    z-index: 10;
}

.inloco-popup-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.btn-close-inloco {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.btn-close-inloco:hover {
    color: var(--danger);
}

.quest-option {
    flex-wrap: wrap;
    /* Para permitir que o conteúdo in-loco ocupe a largura toda abaixo */
}

.quest-option .inloco-resolution-popup {
    flex-basis: 100%;
    margin-top: 1rem;
    border: none;
    border-top: 1px dashed var(--border);
    border-radius: 0;
    padding: 1rem 0 0 0;
    box-shadow: none;
    background: transparent;
}

.quest-option.has-resolution-open {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

/* ── BOTTOM DRAWER RESOLUTION ── */
.resolution-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 32vh;
    background: var(--surface);
    border: 0px solid var(--border);
    border-bottom: none;
    border-radius: 1.6rem 1.6rem 0 0;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.1), 0 -1px 0 var(--border);
    z-index: 2000;
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    font-family: var(--font);
}

.resolution-drawer.is-expanded {
    max-height: 85vh;
}

.resolution-drawer.hidden {
    transform: translateY(120%) !important;
    pointer-events: none !important;
}

.resolution-drawer.is-minimized {
    transform: translateY(calc(100% - 120px));
}

.drawer-handle {
    width: 100%;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.drawer-handle::after {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    transition: background 0.2s, width 0.2s;
}

.drawer-handle:hover::after {
    background: var(--text-muted);
    width: 48px;
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 0.4rem 1.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
}

.btn-close-drawer {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

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

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.6rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

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

.drawer-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 99px;
}

.btn-ver-inloco {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ver-inloco:hover {
    background: var(--accent);
    color: white;
}

/* ── PAGE-SPECIFIC: dashboard ───────────────────────── */
*,
body::before,
body::after {
    text-transform: lowercase !important;
}

html,
body {
    height: 100%;
    line-height: 1.45;
    font-size: 10px;
    background-image: none;
}

:root {
    --header-h: 6.4rem;
    --pad: 2rem;
    --section-gap: 2vw;
    --label-gap: 1.2rem;
}

/* ── GRAFO DE AULAS ─────────────────────────────────── */
#grafo-box {
    width: 100%;
    height: 100%;
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .05);
}

#grafo-container {
    width: 100%;
    height: 100%;
}

#grafo-info-panel {
    position: absolute;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    width: 20rem;
    display: none;
    flex-direction: column;
    gap: 0.8rem;
    z-index: 1000;
    pointer-events: auto;
}

#grafo-info-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    margin-right: 1.5rem;
    word-break: break-word;
    line-height: 1.3;
}

#grafo-info-type {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.grafo-info-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.grafo-info-close:hover {
    color: var(--text);
}

.grafo-report-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.7rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 0.5rem;
}

.grafo-report-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#grafo-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 1.2rem;
    pointer-events: none;
}

#grafo-legend {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    pointer-events: none;
    max-width: calc(100% - 30px);
    z-index: 5;
}

.grafo-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.grafo-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

@media (max-width: 50rem) {
    :root {
        --header-h: 5.6rem;
        --pad: 1.2rem;
    }

    #header {
        flex-wrap: wrap;
        height: auto;
        min-height: var(--header-h);
        padding: 0.8rem var(--pad);
        gap: 0.8rem;
    }

    #url-input {
        width: 18rem;
        max-width: 18rem;
        font-size: 1.1rem;
        padding: 0.6rem 1rem;
    }

    .hbtn {
        padding: 0.6rem 1.2rem;
        font-size: 1.1rem;
    }

    #header-filter-row {
        flex-wrap: wrap;
        gap: 0.6rem;
        margin-left: 0 !important;
    }

    .header-fi select {
        min-width: 8rem;
        max-width: 10rem;
        font-size: 1.1rem;
        padding: 0.3rem 0.5rem;
    }

    .header-fi label {
        font-size: 1rem;
    }

    #main {
        padding-bottom: 2.4rem;
        min-height: auto;
    }

    #left-column {
        width: 100%;
    }

    #student-name {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        font-weight: 800;
        color: var(--text-muted);
        text-transform: lowercase;
        letter-spacing: -0.01em;
        line-height: 1.15;
    }

    #student-name strong {
        color: var(--text);
        font-weight: 800;
    }

    #student-meta {
        font-size: 1.1rem;
    }

    #notas-atividade-section {
        display: none !important;
    }

    .nota-card {
        height: 120px;
        padding: 0.8rem 1.2rem;
    }

    .nota-card .nc-value {
        font-size: 2.4rem;
    }

    .nota-card.final .nc-value {
        font-size: 2.4rem;
    }

    .nota-card .nc-label {
        font-size: 1rem;
    }

    .nota-card .nc-name {
        font-size: 1rem;
    }

    .math-op {
        height: 120px;
        font-size: 2rem;
        padding: 0 0.2rem;
    }

    #eac-comparison-wrapper {
        display: none !important;
    }

    #eac-lines-svg {
        display: none !important;
    }

    #eac-comparison-container {
        display: none !important;
    }

    .comp-card {
        width: 120px !important;
        height: 120px;
        padding: 0.8rem 1.2rem;
    }

    .comp-card .nc-value {
        font-size: 2.4rem;
    }

    #chart-section {
        margin-bottom: 0;
    }

    #chart-wrap {
        height: 300rem;
        padding: 1.4rem;
        margin-bottom: 1.4rem;
    }

    .canvas-wrap {
        height: 250px;
    }

    .section-label {
        font-size: 1rem;
        margin-bottom: 1.2rem;
    }

    #summary-box,
    #objectives-box {
        padding: 0.8rem 1.4rem;
        margin-bottom: 0;
    }

    #calendar-box {
        margin-bottom: 0;
        padding: 0.8rem 1.2rem;
    }

    .calendar-grid {
        gap: 0.4rem;
    }

    .calendar-day {
        min-height: 44px;
        padding: 0.2rem;
    }

    .calendar-day-number,
    .calendar-day-content {
        font-size: 1rem;
    }

    .calendar-day-header {
        font-size: 1rem;
        padding: 0.2rem 0;
    }

    .calendar-nav button {
        padding: 0.2rem 0.6rem;
        font-size: 1rem;
    }

    .calendar-title {
        font-size: 1rem;
    }

    #obs-section {
        padding: 1.4rem;
        margin-bottom: 0;
        font-size: 1rem;
    }

    :root {
        --section-gap: 4vw;
    }

}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.6rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 99px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
    text-transform: lowercase;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.share-btn:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.share-btn:active {
    transform: scale(0.97);
}

.share-btn.success {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.share-btn svg {
    transition: transform 0.2s ease;
}

.share-btn:hover svg {
    transform: rotate(-15deg);
}

#student-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.4rem;
    padding: 1.2rem 2.4rem;
    background: transparent;
    border-radius: var(--radius);
    box-shadow: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

#student-header.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#student-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

#header {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    display: none;
    align-items: center;
    gap: 10px;
    padding: 0 2vw;
    z-index: 1100;
    background: transparent;
    border-bottom: none;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

#menu-toggle {
    position: absolute;
    top: 0rem;
    right: 0rem;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: transparent;
    opacity: 0;
    border: 0px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

#menu-toggle:hover {
    transform: scale(1.1);
    background: var(--surface2);
    border-color: var(--accent);
}

#menu-toggle svg {
    width: 2rem;
    height: 2rem;
    stroke: var(--text);
    transition: transform 0.3s ease;
}

body.header-collapsed #menu-toggle {
    top: 2rem;
    background: transparent;
    opacity: 0;
}

body.header-collapsed #menu-toggle:hover {
    opacity: 1;
}

body.header-collapsed #menu-toggle svg {
    transform: rotate(180deg);
}

#logo {
    display: flex;
    align-items: center;
    gap: var(--pad);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

#url-input {
    max-width: 130px;
    width: 130px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1rem;
    padding: 0.8rem 1.4rem;
    outline: none;
    transition: border-color 0.2s;
    box-shadow: none;
}

#url-input::placeholder {
    color: var(--text-muted);
}

#url-input:focus {
    border-color: var(--accent);
}

.hbtn {
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s, transform 0.1s, background 0.2s;
    background: transparent;
    box-shadow: none;
}

.hbtn:active {
    transform: scale(0.97);
}

#btn-load {
    border: 1px solid var(--accent);
    color: var(--accent);
}

#btn-load:hover {
    opacity: 0.88;
}

#btn-clear {
    border: 1px solid var(--border);
    color: var(--text-muted);
}

#btn-clear:hover {
    color: var(--danger);
    border-color: var(--danger);
}

#status-dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
    transition: background 0.3s;
}

#status-dot.ok {
    background: var(--success);
}

#status-dot.err {
    background: var(--danger);
}

#status-dot.load {
    background: var(--accent);
    animation: blink 0.9s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.2
    }
}

#header-filter-row {
    display: none;
    align-items: center;
    gap: 10px;
}

#header-filter-row.visible {
    display: flex;
}

.header-fi {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-fi label {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
}

.header-fi select {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    max-width: 90%;
    text-overflow: ellipsis;
}

.header-fi select:hover {
    background: color-mix(in srgb, var(--accent) 7%, var(--surface2));
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.header-fi select:focus {
    border-color: var(--accent);
    outline: 0.3rem solid color-mix(in srgb, var(--accent) 26%, transparent);
    outline-offset: 0.1rem;
}

#settings-wrapper {
    position: relative;
    margin-left: auto;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.8rem;
}

#settings-top {
    display: flex;
    align-items: center;
    gap: var(--pad);
    height: 2rem;
}

#btn-timeline,
#btn-settings {
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
    text-decoration: none;
    vertical-align: middle;
}

#btn-timeline:hover,
#btn-settings:hover {
    opacity: 0.9;
}

#btn-timeline:active,
#btn-settings:active {
    transform: scale(0.97);
}

#settings-dropdown {
    position: absolute;
    bottom: calc(100% + 0.8rem);
    right: 0;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: none;
    flex-direction: column;
    gap: 1rem;
    min-width: 18rem;
    text-align: left;
    z-index: 201;
    animation: settings-drop-down 0.16s ease-out;
    transform-origin: bottom right;
}

@keyframes settings-drop-down {
    from {
        opacity: 0;
        transform: translateY(-0.8rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.check-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.2rem;
    cursor: pointer;
}

.check-label input {
    accent-color: var(--accent);
}

#main {
    margin-top: 2vw;
    margin-left: 20vw;
    margin-right: 20vw;
    width: auto;
    min-width: 0;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

#left-column {
    width: 100%;
    min-width: 0;
}

#calendar-box {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    padding: 1.2rem 1.6rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .05);
    display: flex;
    flex-direction: column;
    gap: 0;
    height: fit-content;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--section-gap);
    align-items: start;
}

.bottom-column {
    min-width: 0;
}

.section-stack {
    display: flex;
    flex-direction: column;
    gap: var(--section-gap);
}

#lesson-carousel-section {
    margin-bottom: 0;
}

@media (max-width: 50rem) {
    .bottom-grid {
        grid-template-columns: 1fr;
    }

    #main {
        margin-left: 4vw;
        margin-right: 4vw;
    }
}

#filter-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.fi {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.fi label {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
}

.fi select {
    background: transparent;
    border: 0px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.fi select:hover {
    background: color-mix(in srgb, var(--accent) 7%, var(--surface2));
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.fi select:focus {
    border-color: var(--accent);
    outline: 0.3rem solid color-mix(in srgb, var(--accent) 26%, transparent);
    outline-offset: 0.1rem;
}

#student-select {
    border-color: var(--accent);
    color: var(--accent);
    max-width: 14rem;
    min-width: 8rem;
}

.fi-div {
    width: 0.1rem;
    height: 1.8rem;
    background: var(--border);
}

#student-header {
    display: none;
    padding: 0 0 var(--section-gap);
    border-bottom: 1px solid var(--border);
    margin-top: 0;
    margin-bottom: var(--section-gap);
    align-items: center;
    gap: 3.2rem;
}

#student-header.visible {
    display: flex;
}

#student-info {
    flex: 1;
}

#student-name {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: lowercase;
    letter-spacing: -0.01em;
    width: 100%;
    text-align: left;
    line-height: 1.15;
}

#student-name strong {
    color: var(--text);
    font-weight: 800;
}


#student-meta {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

#empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 8rem 0;
    color: var(--text-muted);
}

#empty svg {
    opacity: 0.3;
}

#empty p {
    font-size: 1.3rem;
}

#content {
    display: none;
}

#content.visible {
    display: block;
}

#top-row {
    display: flex;
    flex-direction: column;
    gap: var(--section-gap);
    align-items: stretch;
    margin-bottom: var(--section-gap);
}

#notes-side,
#calendar-side {
    display: contents;
}

#calendar-side>.section-label:first-child {
    margin-top: 0px;
}

#summary-box,
#objectives-box {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    padding: 1.2rem 1.6rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .05);
    margin-top: 0;
    margin-bottom: 0;
}

#calendar-box {
    margin-top: 0;
    margin-bottom: 0;
}

#summary-text {
    font-size: 1.2rem;
    color: var(--text);
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 0;
}

#summary-text.is-empty {
    color: var(--text-muted);
}

#objectives-list {
    overflow-x: auto;
}

#objectives-empty {
    font-size: 12px;
    color: var(--text-muted);
}

#exp-carousel-section {
    width: 100%;
}

.exp-card {
    flex: 0 0 40rem;
    height: 40rem;
    background: transparent;
    border-radius: var(--radius);
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.exp-card:hover {
    transform: translateY(-0.5rem);
}

.exp-card.active-flip .cc-inner {
    transform: rotateY(180deg);
}

.exp-back-scroll {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    overflow-y: auto;
    padding-right: 4px;
}

.exp-back-scroll::-webkit-scrollbar {
    width: 4px;
}

.exp-back-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.obj-nivel-pill {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 900;
    padding: 0;
    border: none;
    white-space: nowrap;
    background: transparent;
    color: var(--text);
    letter-spacing: -0.02em;
}

.obj-autoav-select {
    font-family: var(--font-body);
    font-size: 1.1rem;
    padding: 0 1rem;
    height: 2.4rem;
    line-height: 2.4rem;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
}

.obj-comment-btn {
    background: #262626;
    color: #fff;
    border: none;
    padding: 1rem 2.4rem;
    border-radius: 999px;
    font-family: var(--font-display, "Manrope", sans-serif);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    white-space: nowrap;
}

.obj-comment-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.objective-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
    padding-bottom: 0.8rem;
}

.objective-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.objective-text {
    font-size: 1.2rem;
    color: var(--text);
    line-height: 1.45;
    flex: 1;
    min-width: 0;
}

.objective-level {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    font-weight: 700;
    border: 0px solid transparent;
    padding: 0.3rem 0.6rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.objective-level.level-below {
    color: var(--danger-dark);
    background: rgba(230, 141, 170, 0.12);
}

.objective-level.level-basic {
    color: var(--danger);
    background: rgba(212, 140, 225, 0.12);
}

.objective-level.level-adequado {
    color: var(--success-light);
    background: rgba(172, 225, 239, 0.12);
}

.objective-level.level-avancado {
    color: var(--success);
    background: rgba(120, 174, 218, 0.12);
}

.objective-level.level-unknown {
    color: var(--text-muted);
    background: rgba(153, 153, 153, 0.08);
}

[data-tip] {
    position: relative;
    cursor: help;
}

[data-tip]::after,
[data-tip]::before {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

[data-tip]::after {
    content: attr(data-tip);
    bottom: calc(100% + 0.8rem);
    left: 0;
    max-width: 24rem;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    line-height: 1.35;
    color: var(--surface);
    background: var(--text);
    border-radius: 1rem;
    transform: translateY(4px);
    z-index: 20;
}

[data-tip]::before {
    content: "";
    bottom: calc(100% + 0.3rem);
    left: 1.2rem;
    width: 0.8rem;
    height: 0.8rem;
    background: var(--text);
    transform: translateY(4px) rotate(45deg);
    border-radius: 2px;
    z-index: 19;
}

[data-tip]:hover::after,
[data-tip]:hover::before {
    opacity: 1;
    transform: translateY(0);
}

.section-label {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: var(--label-gap);
    letter-spacing: -0.02em;
}

#notas-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0;
    margin-bottom: 0;
    align-items: flex-start;
}

.nota-card-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 14rem;
}

.nota-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    padding: 1.2rem 1.6rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .05);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    height: 13rem;
    justify-content: space-between;
}

.math-op {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
    font-family: "Manrope", "Segoe UI", sans-serif;
    height: 13rem;
    flex-shrink: 0;
    padding: 0 0.4rem;
    position: relative;
    z-index: 2;
}

.nota-card-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 14rem;
    position: relative;
    z-index: 2;
}

.comp-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    padding: 1.2rem 1.6rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .05);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 14rem;
    height: 13rem;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.comp-card .nc-label {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.comp-card .nc-value {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    margin-top: 0.4rem;
    font-family: "Manrope", "Segoe UI", sans-serif;
}

.nota-card.final {
    border-color: var(--accent);
    background: var(--surface);
}

.nota-card .nc-label {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.nota-card .nc-name {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nota-card .nc-value {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    margin-top: 0.4rem;
    font-family: "Manrope", "Segoe UI", sans-serif;
}

.nota-card.final .nc-value {
    font-size: 3.6rem;
    color: var(--accent);
}

.nota-card .nc-value.perf-vhigh {
    color: #96e294;
}

.nota-card .nc-value.perf-high {
    color: #d0eea7;
}

.nota-card .nc-value.perf-mid {
    color: #f0f07c;
}

.nota-card .nc-value.perf-low {
    color: #ffcfa1;
}

.nota-card .nc-value.perf-vlow {
    color: #fb9999;
}

.nc-weight-wrap {
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nc-weight-bar {
    flex: 1;
    height: 1rem;
    background: var(--surface2);
    border-radius: 99.9rem;
    position: relative;
    overflow: hidden;
}

.nc-weight-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 99.9rem;
    transition: width 0.4s;
}

#carousel-section {
    width: 100%;
}

.carousel-view {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    display: flex;
    gap: 3.5rem;
    padding: 0.4rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    perspective: 1000px;
    margin-bottom: 0;
}

.carousel-card {
    flex: 0 0 40rem;
    height: 40rem;
    background: transparent;
    border-radius: var(--radius);
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.cc-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.carousel-card.active-flip .cc-inner {
    transform: rotateY(180deg);
}

.cc-front,
.cc-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: none;
    transform: translateZ(0);
    box-shadow: 0 2px 16px rgba(0, 0, 0, .05);
}

.cc-back {
    transform: rotateY(180deg) translateZ(0);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background: var(--surface);
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.cc-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    transition: height 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cc-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 1.75rem;
    height: 100%;
    gap: 1.2rem;
    pointer-events: none;
}

.cc-preview-btn {
    background: #262626;
    color: #fff;
    border: none;
    padding: 1rem 2.4rem;
    border-radius: 999px;
    font-family: var(--font-display, "Manrope", sans-serif);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.cc-preview-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.carousel-card:hover {
    border-color: var(--accent);
    transform: translateY(-0.5rem);
}

.carousel-card .cc-label {
    font-family: "Manrope", sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    text-transform: lowercase !important;
}

.carousel-card .cc-name {
    font-family: "Manrope", sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.carousel-card .cc-value {
    font-family: "Manrope", sans-serif;
    font-size: 5rem;
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text);
    text-align: center;
    margin: auto 0;
    line-height: 1;
}

.carousel-card .cc-weight-pct {
    font-family: "Manrope", sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    display: block;
    margin-top: auto;
}

.lesson-card {
    flex: 0 0 30rem;
    height: 30rem;
    background: transparent;
    border-radius: var(--radius);
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.lesson-card:hover {
    transform: translateY(-0.5rem);
}

.lesson-card.active-flip .cc-inner {
    transform: rotateY(180deg);
}

.lesson-card .cc-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    height: 100%;
}

.lesson-card .cc-name {
    font-size: 2rem !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    width: 100%;
    text-align: center;
}

.lesson-card .cc-label {
    font-size: 1.4rem !important;
}

.lesson-card .cc-weight-pct {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    display: block;
    margin-top: auto;
    opacity: 0.8;
}

.lc-details {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
}

.lc-details::-webkit-scrollbar {
    width: 4px;
}

.lc-details::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.lc-detail-item {
    font-size: 1.2rem;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.lc-detail-item strong {
    color: var(--text);
    font-weight: 700;
}

.lc-back-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    text-align: center !important;
    width: 100%;
    color: var(--text);
    text-transform: lowercase;
}

.exp-card .cc-back {
    text-align: left !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding: 2.4rem !important;
}

.exp-card .lc-detail-item {
    text-align: left !important;
    width: 100%;
}

.carousel-nav-wrap {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
}

@media (max-width: 50rem) {
    .carousel-view {
        gap: 1.5rem;
        padding: 1.5rem var(--pad);
        scroll-padding: var(--pad);
    }

    .carousel-card,
    .lesson-card {
        flex: 0 0 30rem;
        height: 30rem;
    }

    .carousel-card,
    .exp-card {
        flex: 0 0 28rem;
        height: 38rem;
        padding: 1.5rem;
    }

    .carousel-card .cc-value {
        font-size: 5rem;
    }

    .carousel-card .cc-name {
        font-size: 1.8rem;
    }
}

.nc-weight-pct {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.anexo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: flex;
    font-family: "Manrope", sans-serif;
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
    white-space: nowrap;
}

.anexo-btn:hover {
    color: var(--accent);
}

.anexo-btn svg {
    opacity: 0.8;
}

.anexo-slot {
    min-height: 1rem;
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    border: transparent;
    padding: 0.4rem 0.6rem;
    background: transparent;
}

.anexo-slot.empty {
    opacity: 0.7;
}

.anexo-slot.empty .anexo-btn {
    pointer-events: none;
    cursor: default;
}

#chart-section {
    margin-top: 0;
    margin-bottom: 0;
}

#chart-wrap {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    padding: 2rem;
    height: 40rem;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .05);
}

#chart-wrap h4 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 1.6rem;
}

.canvas-wrap {
    height: 32rem;
    position: relative;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.6rem;
}

.calendar-title {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
}

.calendar-nav {
    display: flex;
    gap: 0.8rem;
}

.calendar-nav button {
    background: transparent;
    border: 0px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.calendar-nav button:hover {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    background: color-mix(in srgb, var(--accent) 7%, var(--surface2));
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.6rem;
}

.calendar-day-header {
    text-align: center;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.4rem 0;
}

.calendar-day {
    min-height: 5.2rem;
    padding: 0.4rem;
    background: transparent;
    border: 0px solid transparent;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: border-color 0.15s, background 0.15s;
}

.calendar-day.has-lessons {
    cursor: pointer;
}

.calendar-day.has-lessons:hover {
    background: color-mix(in srgb, var(--accent) 6%, transparent) !important;
    border-color: var(--accent) !important;
}

.calendar-day.selected {
    border-color: var(--accent) !important;
    background: color-mix(in srgb, var(--accent) 8%, transparent) !important;
}

.calendar-day-number {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1rem;
    color: var(--text-muted);
    text-align: right;
    line-height: 1;
}

.calendar-day.has-lessons .calendar-day-number {
    color: var(--text);
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today .calendar-day-number {
    color: var(--accent);
    font-weight: 700;
}

#lesson-panel {
    margin-top: 1.6rem;
    border-top: 0px solid var(--border);
    padding-top: 1.4rem;
    display: none;
    flex-direction: column;
    gap: 0;
    animation: lpSlideIn 0.18s ease;
}

#lesson-panel.visible {
    display: flex;
}

@keyframes lpSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#lp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

#lp-title {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    line-height: 1.4;
}

#lp-title .lp-dot {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    flex-shrink: 0;
}

#lp-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}

#lp-close:hover {
    color: var(--text);
}

.lp-row {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.lp-key {
    color: var(--text-muted);
    width: 7.2rem;
    flex-shrink: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding-top: 0.1rem;
}

.lp-val {
    color: var(--text);
    font-weight: 500;
    flex: 1;
    word-break: break-word;
}

.lp-val.mono {
    font-family: "Manrope", "Segoe UI", sans-serif;
}

#lp-nav {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 0px solid var(--border);
}

#lp-nav button {
    background: transparent;
    border: 0px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.3rem 0.8rem;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.2s;
}

#lp-nav button:hover {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    background: color-mix(in srgb, var(--accent) 7%, var(--surface2));
}

#occurrence-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2vw, 2rem);
    background: var(--overlay-bg);
    z-index: 3000;
}

#occurrence-modal.visible {
    display: flex;
}

#occurrence-card {
    width: min(72rem, 100%);
    max-height: min(88vh, 56rem);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
    padding: clamp(1.25rem, 2.5vw, 2rem);
}

.occ-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.occ-modal-title {
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.occ-modal-sub {
    margin-top: 0.4rem;
    font-size: 0.98rem;
    color: var(--text-muted);
}

#occ-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition:
        color 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease;
}

#occ-modal-close:hover {
    color: var(--text);
    background: var(--surface3);
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.occ-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.occ-modal-section {
    min-width: 0;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.occ-modal-label {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.occ-modal-text {
    font-size: 1.1rem;
    color: var(--text);
    line-height: 1.5;
}

.occ-lesson {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.occ-lesson+.occ-lesson {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.occ-lesson-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
}

.occ-lesson-item {
    font-size: 1.05rem;
    color: var(--text);
}

.occ-lesson-item strong {
    color: var(--text-muted);
    font-weight: 700;
}

@media (max-width: 680px) {
    #occurrence-modal {
        padding: 0.75rem;
        align-items: flex-end;
    }

    #occurrence-card {
        width: 100%;
        max-height: 92vh;
    }

    .occ-modal-grid {
        grid-template-columns: 1fr;
    }
}

/* ── VÍDEO DAILYMOTION ────────────────────────────────── */
.review-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #050505;
}

.review-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.review-video-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    background: color-mix(in srgb, var(--surface2) 40%, #050505);
}

#obs-section {
    background: var(--surface2);
    border: 0px solid var(--border);
    border-radius: var(--radius);
    padding: 2.4rem;
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

#obs-section strong {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 0.6rem;
    color: var(--text-muted);
}

/* RESOLUTION TEXTO CORRIDO OVERRIDES - FORCED */
.resolution-guide-item.texto-corrido {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    margin-bottom: 2.5rem !important;
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
}

.resolution-guide-item.texto-corrido.is-open,
.resolution-guide-item.texto-corrido.is-current {
    box-shadow: none !important;
    background: transparent !important;
    border: none !important;
    transform: none !important;
}

.resolution-guide-item.texto-corrido .resolution-guide-content {
    padding: 0 !important;
    font-size: 1.15rem !important;
    line-height: 1.6 !important;
    color: var(--text) !important;
    display: block !important;
}

.res-text-kicker {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--text-muted) !important;
    margin: 0 0 0.8rem 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.res-text-kicker.correct {
    color: var(--success) !important;
}

.res-text-kicker.wrong {
    color: var(--danger) !important;
}

/* ABSOLUTE HIDE FOR STAND-BY ELEMENTS */
.inloco-resolution-trigger,
.inloco-resolution-popup,
.resolution-guide-actions,
.resolution-guide-toggle {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   UNIFIED NAVIGATION BAR
   ═══════════════════════════════════════════════════════════════ */

/* ── Topbar menu links are always inside the hamburger drawer ── */
.nav-links {
    display: none;
    align-items: center;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.nav-links a,
.nav-links button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    text-transform: lowercase;
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover,
.nav-links button:hover {
    color: var(--text);
    background: var(--surface2);
}

.nav-links a.active {
    color: var(--accent);
}

/* ── Hamburger button ── */
.nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav-hamburger:hover,
.nav-hamburger[aria-expanded="true"] {
    background: var(--surface2);
}

.nav-hamburger[aria-expanded="true"] {
    transform: translateY(1px);
}

.nav-hamburger svg {
    width: 2rem;
    height: 2rem;
}

.nav-drawer-login {
    padding: 1rem 1rem;
    flex-shrink: 0;
}

.nav-drawer-login #btn-login-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    min-width: 0;
    padding: 0.6rem 0.6rem;
    background: transparent;
    border: none;
    border-radius: 0rem;
    color: var(--text);
    font-family: var(--font);
    font-size: 1.6rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
    text-transform: lowercase;
}

.nav-drawer-login #btn-login-status:hover {
    background: var(--surface2);
}

.nav-drawer-login #btn-login-status .user-chip-avatar {
    width: 2.4rem;
    height: 2.4rem;
}

.nav-drawer-login #btn-login-status-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Nav drawer overlay ── */
.nav-drawer-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

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

/* ── Nav drawer (popover from hamburger) ── */
.nav-drawer {
    position: fixed;
    top: calc(var(--header-h) - 0.4rem);
    right: 2vw;
    width: min(32rem, calc(100vw - 4vw));
    max-height: calc(100svh - var(--header-h) - 1.2rem);
    background: var(--surface);
    border: 0px solid var(--border);
    border-radius: 1.4rem;
    z-index: 301;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-0.8rem) scale(0.96);
    transform-origin: top right;
    transition:
        opacity 0.18s ease,
        transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
}

.nav-drawer.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}


.nav-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0rem 0;
}

.nav-drawer-body a,
.nav-drawer-body button {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0rem 1.6rem 1.6rem;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 1.35rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    text-transform: lowercase;
}

.nav-drawer-body a:hover,
.nav-drawer-body button:hover {
    background: var(--surface2);
}

.nav-drawer-body a.active {
    color: var(--accent);
    font-weight: 700;
}

.nav-drawer-footer {
    padding: 0.8rem 1.6rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.nav-theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.8rem 0.4rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, background 0.15s ease;
    text-transform: lowercase;
}

.nav-theme-toggle:hover {
    color: var(--text);
    background: var(--surface2);
}

.nav-theme-toggle svg {
    width: 1.6rem;
    height: 1.6rem;
    flex-shrink: 0;
}

/* ── Mobile sizing for hamburger drawer ── */
@media (max-width: 768px) {
    .nav-drawer {
        right: 4vw;
        width: min(32rem, 92vw);
    }
}

/* ══════════════════════════════════════════════════════
   NOTE LEARNING REPORT (nlr-*)
   ══════════════════════════════════════════════════════ */

.nlr {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    padding: 1rem 0;
}

/* ── Summary card (IA) ── */
.nlr-summary-card {
    background: linear-gradient(135deg, #94e2a282, #90c7f47d);
    border: 0px solid color-mix(in srgb, var(--orange) 15%, var(--border));
    border-radius: 1.4rem;
    padding: 0 2rem 2rem 2rem;
}

.nlr-summary-card h3 {
    font-size: 1.6rem;
    font-weight: 800;
    padding: 0;
    margin-bottom: 0.8rem;
    color: var(--text);
}

#preview-content .nlr-summary-text {
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1.5;
    margin-bottom: 0rem;
}

/* ── Dominio card ── */
.nlr-dominio-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.4rem;
}

.nlr-dominio-number {
    font-family: var(--font-mono);
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
}

.nlr-dominio-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.nlr-dominio-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nlr-dominio-detail {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ── Metrics ── */
.nlr-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}

.nlr-metric {
    background: var(--surface2);
    border-radius: 0.8rem;
    padding: 1.2rem 1.4rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nlr-metric-val {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--orange-text);
}

.nlr-metric-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ── Section cards (didatic, test, enem) ── */
.nlr-section-card {
    background: var(--surface);
    border: 0px solid var(--border);
    border-radius: 1.4rem;
    padding: 0;
}

.nlr-section-card h3 {
    font-size: 1.6em;
    font-weight: 800;
    margin-bottom: 1.2rem;
    color: var(--text);
}

/* ── Didatic panorama rows ── */
.nlr-didatic-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.nlr-didatic-row:last-child {
    border-bottom: none;
}

.nlr-didatic-type {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    min-width: 10rem;
    letter-spacing: 0.03em;
}

.nlr-didatic-score {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.15rem;
}

.nlr-didatic-score.good {
    color: #10b981;
}

.nlr-didatic-score.bad {
    color: #ef4444;
}

.nlr-didatic-score.neutral {
    color: var(--text-muted);
}

/* ── Objetivo performance rows ── */
.nlr-objetivo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-bottom: px solid var(--border);
    border-radius: 8px;
    cursor: default;
    transition: background 0.15s;
    background: var(--bg);
    margin-bottom: 1rem;
}

.nlr-objetivo-row:hover {
    background: var(--surface2);
}

.nlr-objetivo-row:last-child {
    border-bottom: none;
}

.nlr-objetivo-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    flex: 1;
}

.nlr-objetivo-nivel {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface2);
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    flex-shrink: 0;
}

.nlr-objetivo-nivel.nivel-1 { background: var(--success); color: #fff; }
.nlr-objetivo-nivel.nivel-2 { background: var(--success-light); color: var(--text); }
.nlr-objetivo-nivel.nivel-3 { background: var(--warn-mid); color: var(--text); }
.nlr-objetivo-nivel.nivel-4 { background: var(--danger); color: var(--text); }
.nlr-objetivo-nivel.nivel-5 { background: var(--danger-dark); color: var(--text); }

.nlr-objetivo-num {
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 99px;
    background: var(--surface3);
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.nlr-objetivo-desc {
    font-size: 1rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nlr-objetivo-score {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nlr-objetivo-score.good {
    color: #10b981;
}

.nlr-objetivo-score.bad {
    color: #ef4444;
}

.nlr-objetivo-score.neutral {
    color: var(--text-muted);
}

/* ── Test answer rows ── */
.nlr-answer-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border);
}

.nlr-answer-row:last-child {
    border-bottom: none;
}

.nlr-answer-idx {
    font-family: var(--font-mono);
    font-weight: 800;
    color: var(--text-muted);
    min-width: 2.4rem;
    font-size: 1.1rem;
    padding-top: 0.1rem;
}

.nlr-answer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nlr-answer-question {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

.nlr-answer-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    font-size: 1rem;
}

.nlr-answer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.95rem;
}

.nlr-answer-badge.correct {
    background: color-mix(in srgb, var(--success-light) 22%, var(--surface));
    color: #059669;
}

.nlr-answer-badge.wrong {
    background: color-mix(in srgb, var(--danger-dark) 18%, var(--surface));
    color: #dc2626;
}

.nlr-answer-badge.pending {
    background: var(--surface2);
    color: var(--text-muted);
}

/* ── TEST ANSWERS CAROUSEL ── */
.nlr-test-carousel {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    display: flex;
    gap: 2rem;
    padding: 0.5rem 0 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.nlr-test-carousel::-webkit-scrollbar {
    height: 4px;
}

.nlr-test-carousel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 99px;
}

.nlr-test-card {
    flex: 0 0 18rem;
    height: 24rem;
    position: relative;
    scroll-snap-align: start;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 0px solid var(--border);
    background: var(--bg);
    transition: border-color 0.2s, transform 0.2s;
}

.nlr-test-card:hover,
.nlr-test-card.active {
    border-color: var(--accent);
    transform: translateY(-0.3rem);
}

.nlr-test-card-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: height 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.nlr-test-card-content {
    position: relative;
    z-index: 2;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    pointer-events: none;
    text-align: center !important;
}

.nlr-test-card-idx {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    letter-spacing: var(--tracking-wide);
    text-transform: lowercase;
    text-align: center !important;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.nlr-test-card-type {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    letter-spacing: var(--tracking-wide);
    text-transform: lowercase;
    padding: 0rem;
    border-radius: 99px;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    align-self: center;
    text-align: center !important;
    margin-bottom: auto;
}

.nlr-test-card-question {
    font-size: 1.2rem;
    line-height: 1.4;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-align: center !important;
    overflow: hidden;
}

.nlr-test-card-pct {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center !important;
    pointer-events: none;
}

/* ── INLINE DETAIL (report-question style) ── */
.rq-inline {
    margin-top: 1.6rem;
    padding: 1.6rem;
    background: var(--bg);
    border-radius: var(--radius);
    border: 0px solid var(--border);
}

.rq-inline .report-question-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0;
}

.rq-inline .report-question-head-main {
    flex: 1;
    min-width: 0;
}

.rq-inline .report-question-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: break-word;
}

.rq-inline .report-question-subtitle {
    margin-top: 0.35rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.5;
}

.rq-inline .report-question-fill-card {
    width: 10rem;
    min-width: 10rem;
    height: 10rem;
    border-radius: 1.4rem;
    border: 1px solid var(--border);
    background: var(--surface);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.rq-inline .report-question-fill-bg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.rq-inline .report-question-fill-center {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.8rem;
}

.rq-inline .report-question-fill-value {
    font-size: 2.15rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text);
}

.rq-inline .report-question-fill-meta {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rq-inline-analysis {
    margin-top: 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
}

/* ── ENEM recommendation cards ── */
.nlr-enem-quest {
    background: var(--surface2);
    border-radius: 0.8rem;
    padding: 1.2rem 1.4rem;
    margin-bottom: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.nlr-enem-quest:last-child {
    margin-bottom: 0;
}

.nlr-enem-quest-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.nlr-enem-quest-meta {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.nlr-enem-quest-preview {
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nlr-enem-quest-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.3rem;
}

.nlr-enem-empty {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-style: italic;
    padding: 1rem 0;
}

/* ── Offline warning ── */
.nlr-offline-warning {
    background: color-mix(in srgb, var(--warn-mid) 15%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--warn-mid) 30%, var(--border));
    border-radius: 0.8rem;
    padding: 1rem 1.4rem;
    font-size: 1.05rem;
    color: var(--text-muted);
}

/* ── Activity overlay ── */
#activity-overlay.hidden {
    display: none !important;
}

#activity-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

/* ── SLIDES DIDÁTICOS INTERATIVOS ───────────────────── */

.slide-deck {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    --app-pad: clamp(12px, 1.8vw, 24px);
    --controls-h: clamp(48px, 6dvh, 72px);
    --stage-w: min(calc(100vw - (var(--app-pad) * 2)),
            calc((100dvh - var(--controls-h) - (var(--app-pad) * 3)) * 16 / 9));
    --stage-h: calc(var(--stage-w) * 9 / 16);
    --su: calc(var(--stage-w) / 100);
    outline: none;
}

.slide-stage {
    position: relative;
    width: var(--stage-w);
    height: var(--stage-h);
    border-radius: calc(var(--su) * 2);
    box-shadow: 0 calc(var(--su) * 2) calc(var(--su) * 5) rgba(0, 0, 0, 0.12);
    background: var(--surface);
    overflow: hidden;
    display: flex;
}

[data-theme="dark"] .slide-stage {
    box-shadow: 0 calc(var(--su) * 2) calc(var(--su) * 5) rgba(0, 0, 0, 0.4);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.slide-inner {
    padding: calc(var(--su) * 6);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.slide-eyebrow {
    font-size: clamp(0.7rem, calc(var(--su) * 2.5), 1.2rem);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: lowercase;
    margin-bottom: calc(var(--su) * 2);
}

.slide-title {
    font-size: clamp(1.6rem, calc(var(--su) * 6.5), 4.5rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-weight: 800;
    text-transform: lowercase;
    color: var(--text);
}

.slide-title-sm {
    font-size: clamp(1.4rem, calc(var(--su) * 4.5), 3rem);
    margin-bottom: calc(var(--su) * 4);
}

.slide-body {
    font-size: clamp(0.9rem, calc(var(--su) * 2.8), 2rem);
    line-height: 1.5;
    color: var(--text-muted);
    margin-top: calc(var(--su) * 3);
}

.slide-list-numbered {
    list-style-type: decimal;
    padding-left: calc(var(--su) * 4);
}

.slide-list-numbered li {
    margin-bottom: calc(var(--su) * 2);
}

.slide-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.slide-content-area>* {
    max-width: 100%;
}

.slide-content-area p {
    font-size: clamp(0.9rem, calc(var(--su) * 2.8), 2rem);
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: calc(var(--su) * 3);
}

/* Layout adjustments */
.slide--capa .slide-inner {
    justify-content: center;
    align-items: flex-start;
    background: linear-gradient(135deg, color-mix(in srgb, var(--g-purple) 15%, transparent), color-mix(in srgb, var(--g-pink) 15%, transparent));
}

.slide--atividade .slide-inner {
    background: color-mix(in srgb, var(--surface2) 50%, var(--surface));
}

.slide--contraste .slide-inner {
    background: var(--text);
    color: var(--surface);
}

.slide--contraste .slide-title,
.slide--contraste .slide-body {
    color: var(--surface);
}

/* Navigation */
.slide-nav {
    display: flex;
    align-items: center;
    gap: calc(var(--su) * 2);
    margin-top: calc(var(--su) * 3);
    height: var(--controls-h);
}

.slide-btn {
    width: clamp(36px, calc(var(--su) * 6), 52px);
    height: clamp(36px, calc(var(--su) * 6), 52px);
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.slide-btn:hover:not(:disabled) {
    background: var(--surface2);
    border-color: var(--accent);
}

.slide-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slide-btn svg {
    width: 50%;
    height: 50%;
}

.slide-progress {
    width: clamp(100px, calc(var(--su) * 30), 300px);
    height: 6px;
    border-radius: 3px;
    background: var(--surface2);
    overflow: hidden;
}

.slide-progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

/* Interactive Elements within Slides */
.slide-deck .ix-quiz,
.slide-deck .ix-flashcard,
.slide-deck .ix-completar,
.slide-deck .ix-conectar {
    font-size: clamp(0.8rem, calc(var(--su) * 2.5), 1.5rem);
    max-width: 100%;
    margin: 0;
}

.slide-deck .ix-quiz-opt {
    padding: calc(var(--su) * 1.5) calc(var(--su) * 2);
    margin-bottom: calc(var(--su) * 1.5);
    font-size: inherit;
}

.slide-deck .ix-flashcard-front,
.slide-deck .ix-flashcard-back {
    padding: calc(var(--su) * 3);
}

@media (orientation: portrait) {
    .slide-deck::before {
        content: "gire o celular para paisagem";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: var(--surface);
        color: var(--text);
        padding: 1rem 2rem;
        border-radius: 99px;
        font-weight: 700;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        z-index: 100;
        text-align: center;
        white-space: nowrap;
    }

    .slide-stage {
        opacity: 0.2;
        pointer-events: none;
    }
}