/**
 * Area studente sul telefono, con l'aspetto di un'app: barra a schede in basso,
 * pannello «Altro», testata compatta, schede grandi da toccare.
 * Tutto sotto i 768px: il computer non cambia.
 */

/* Scheda «Il tuo prossimo passo»: solo sul telefono. */
.tl-next-step { display: none; }

/* Base da app: niente lampo grigio al tocco, niente zoom sui campi. */
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
.tl-tabbar, .tl-sheet { display: none; }

@media (max-width: 768px) {
    body.tutor-lab-canvas-body { overscroll-behavior-y: none; }
    /* Il contenitore era largo quanto lo schermo più i margini: la pagina scorreva di lato. */
    body.tutor-lab-canvas-body .tl-container { box-sizing: border-box; max-width: 100%; }
    body.tutor-lab-canvas-body input,
    body.tutor-lab-canvas-body textarea,
    body.tutor-lab-canvas-body select { font-size: 16px; }
    body.tutor-lab-canvas-body a,
    body.tutor-lab-canvas-body button { touch-action: manipulation; }

    /* Testata compatta, che rispetta il notch. */
    .tl-site-header { padding-top: env(safe-area-inset-top, 0px); }
    body.tl-has-tabbar .tl-header-inner { min-height: 56px !important; padding: 0 14px; }
    body.tl-has-tabbar .tl-nav,
    body.tl-has-tabbar .tl-nav-toggle,
    body.tl-has-tabbar .tl-back-site { display: none !important; }
    .tl-app-back { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 10px 0 4px; margin-left: -6px; border-radius: 10px; color: #fff !important; font-weight: 600; font-size: .95rem; text-decoration: none !important; flex: 0 0 auto; }
    .tl-app-back i { font-size: 22px; }
    .tl-app-back:active { background: rgba(255, 255, 255, .14); }
    body:has(.tl-app-back) .tl-back-site { display: none !important; }

    /* Barra a schede. */
    .tl-tabbar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
        background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
        border-top: 1px solid #E2E8F0;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    }
    .tl-tab {
        flex: 1 1 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        min-height: 50px; padding: 4px 2px; border: 0; background: none; border-radius: 12px;
        color: #64748B !important; font: 600 11px/1.1 Inter, system-ui, sans-serif; text-decoration: none !important; cursor: pointer;
        user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
        transition: transform 120ms ease-out, background-color 120ms ease-out;
    }
    .tl-tab i { font-size: 24px; line-height: 1; }
    .tl-tab.is-active { color: #002E5B !important; }
    .tl-tab.is-active::before { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: #FEC10D; }
    .tl-tab:active { transform: scale(.94); background: #F1F5F9; }
    .tl-tab-badge, .tl-sheet-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #EF4444; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
    .tl-tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); border: 2px solid #fff; line-height: 14px; }
    .tl-sheet-badge { margin-left: auto; }

    body.tl-has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important; }
    body.tl-has-tabbar .tl-site-footer { margin-top: 24px; padding-bottom: 20px; }
    body.tl-has-tabbar .tl-a11y { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

    /* Pannello «Altro» che sale dal basso. */
    .tl-sheet-backdrop { position: fixed; inset: 0; z-index: 9991; background: rgba(15, 23, 42, .45); opacity: 0; transition: opacity 200ms ease-out; }
    .tl-sheet-backdrop.is-open { opacity: 1; }
    .tl-sheet {
        display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9992; max-height: 82dvh; overflow-y: auto; overscroll-behavior: contain;
        background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(15, 23, 42, .18);
        padding: 8px 12px calc(14px + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%); transition: transform 240ms cubic-bezier(.32, .72, 0, 1);
    }
    .tl-sheet[hidden], .tl-sheet-backdrop[hidden] { display: none; }
    .tl-sheet.is-open { transform: translateY(0); }
    .tl-sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: #CBD5E1; margin: 2px auto 10px; }
    .tl-sheet-list { list-style: none; margin: 0; padding: 0; }
    .tl-sheet-list li { margin: 0; }
    .tl-sheet-item {
        display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 12px; border: 0; background: none; border-radius: 12px;
        color: #0F172A !important; font: 500 16px/1.2 Inter, system-ui, sans-serif; text-decoration: none !important; text-align: left; cursor: pointer;
        user-select: none; -webkit-user-select: none;
    }
    .tl-sheet-item i { font-size: 22px; color: #002E5B; width: 24px; text-align: center; }
    .tl-sheet-item:active, .tl-sheet-item.is-active { background: #F1F5F9; }
    .tl-sheet-item.is-danger, .tl-sheet-item.is-danger i { color: #B91C1C !important; }
    .tl-sheet-hint { margin: 0 12px 10px 50px; font-size: 14px; color: #475569; line-height: 1.45; }

    /* Scheda «Il tuo prossimo passo». */
    .tl-next-step {
        display: block; margin: 0 0 18px; padding: 16px 16px 14px; border-radius: 18px;
        background: #002E5B; color: #fff !important; text-decoration: none !important;
        box-shadow: 0 10px 24px -14px rgba(0, 46, 91, .7);
        transition: transform 120ms ease-out;
    }
    .tl-next-step:active { transform: scale(.98); }
    .tl-next-step-eyebrow { display: block; font-size: 12.5px; font-weight: 600; color: #9FC2EA; margin-bottom: 4px; }
    .tl-next-step-title { display: block; font-size: 18px; font-weight: 700; line-height: 1.3; color: #fff; }
    .tl-next-step-bar { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .18); margin: 12px 0 2px; overflow: hidden; }
    .tl-next-step-bar span { display: block; height: 100%; border-radius: 99px; background: #FEC10D; }
    .tl-next-step-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
    .tl-next-step-count { font-size: 13px; color: #C7D7EC; }
    .tl-next-step-cta { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; background: #FEC10D; color: #002E5B; font-weight: 700; font-size: 15px; }
    .tl-next-step.is-all_done, .tl-next-step.is-locked { background: #fff; color: #0F172A !important; border: 1px solid #E2E8F0; box-shadow: none; }
    .tl-next-step.is-all_done .tl-next-step-eyebrow, .tl-next-step.is-locked .tl-next-step-eyebrow { color: #64748B; }
    .tl-next-step.is-all_done .tl-next-step-title, .tl-next-step.is-locked .tl-next-step-title { color: #002E5B; font-size: 16px; }
    .tl-next-step.is-all_done .tl-next-step-count, .tl-next-step.is-locked .tl-next-step-count { color: #64748B; }

    /* Hub e Laboratorio: titoli da app, schede grandi da toccare. */
    .tutor-lab-student-hub .hub-header h1, .tutor-lab-dashboard-v2 .dashboard-header h1 { font-size: 1.6rem; line-height: 1.2; text-align: left; }
    .tutor-lab-student-hub .hub-header p, .tutor-lab-dashboard-v2 .dashboard-header p { font-size: .98rem; text-align: left; margin-left: 0; }
    .tutor-lab-dashboard-v2 .dashboard-header { text-align: left; margin-bottom: 16px; }
    .tutor-lab-student-hub .hub-top-grid { gap: 16px; margin-bottom: 24px; }
    .tutor-lab-dashboard-v2 .phase-title { font-size: 1.05rem; margin: 22px 0 10px; }
    .tutor-lab-dashboard-v2 .exercise-grid { grid-template-columns: 1fr !important; gap: 12px; }
    .tutor-lab-dashboard-v2 .exercise-card-v2 { padding: 16px; border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
    .tutor-lab-dashboard-v2 .exercise-card-v2 .card-icon-container { display: none; }
    .tutor-lab-dashboard-v2 .exercise-card-v2 .card-title { font-size: 1.05rem; margin: 4px 0 6px; }
    .tutor-lab-dashboard-v2 .exercise-card-v2 .card-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .9rem; margin-bottom: 10px; }
    .tutor-lab-dashboard-v2 .card-cta-button { min-height: 48px; padding: 0 18px; border-radius: 12px; }
    .tutor-lab-dashboard-v2 .card-cta-button-small { min-height: 46px; }
    .tutor-lab-dashboard-v2 .card-cta-button:active, .tutor-lab-dashboard-v2 .card-cta-button-small:active { transform: scale(.97); }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    .tl-sheet, .tl-sheet-backdrop, .tl-tab, .tl-next-step { transition: none; }
}

/* Elenco esercizi: pagina di lavoro. Il blu pieno segnala solo ciò che è già in corso. */
.tl-container:has(> .tutor-lab-dashboard-v2) { box-sizing: border-box; max-width: 100%; }
.tutor-lab-dashboard-v2 { box-sizing: border-box; max-width: min(1120px, 100%); margin-top: 16px; }
.tutor-lab-dashboard-v2 .dashboard-header { text-align: left; margin-bottom: 22px; }
.tutor-lab-dashboard-v2 .dashboard-header h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; color: #002E5B; margin-bottom: 4px; }
.tutor-lab-dashboard-v2 .dashboard-header p { font-size: .95rem; max-width: 62ch; margin: 0; color: #64748b; }

.tl-ex-new { background: #FFF6D1; border-radius: 16px; padding: 14px; margin-bottom: 20px; }
.tl-ex-new h2 { display: flex; align-items: center; gap: 7px; font-size: .95rem; font-weight: 700; margin: 2px 4px 10px; color: #002E5B; }
.tl-ex-new h2 i { font-size: 18px; color: #C78F00; }
.tl-ex-new h2 span { background: #002E5B; color: #fff; border-radius: 999px; font-size: .72rem; line-height: 1; padding: 3px 7px; }
.tl-ex-new ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tl-ex-new li { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 8px 8px 8px 14px; background: #fff; border-radius: 11px; }
.tl-ex-new-title { font-size: .95rem; font-weight: 600; color: #0f172a; min-width: 0; }
.tl-ex-new a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 38px; padding: 0 18px; border-radius: 9px; background: #002E5B; color: #fff !important; font-size: .88rem; font-weight: 600; text-decoration: none !important; touch-action: manipulation; transition: background .15s ease-out; }

.tl-ex-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 28px; }
.tl-ex-overall { flex: 0 0 100%; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tl-ex-overall strong { flex: 0 0 auto; font-size: .88rem; font-weight: 600; color: #334155; }
.tl-ex-overall-bar { flex: 1 1 auto; height: 5px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.tl-ex-overall-bar span { display: block; height: 100%; border-radius: 999px; background: #16a34a; }
.tl-ex-overall-pct { flex: 0 0 auto; font-style: normal; font-size: .82rem; font-weight: 600; color: #166534; font-variant-numeric: tabular-nums; }
.tl-ex-summary a { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: 9px; background: #e9eef5; color: #334155 !important; font-size: .82rem; font-weight: 600; text-decoration: none !important; touch-action: manipulation; transition: background .15s ease-out, color .15s ease-out; }
.tl-ex-summary a span { color: #64748b; font-weight: 500; font-variant-numeric: tabular-nums; }

.tutor-lab-dashboard-v2 .exercise-phase-section { margin-bottom: 32px; scroll-margin-top: 90px; }
.tutor-lab-dashboard-v2 .exercise-phase-section .phase-title { display: block; font-size: 1.05rem; font-weight: 700; color: #002E5B; margin: 0 0 12px; padding: 0; border: 0; }
.tutor-lab-dashboard-v2 .exercise-grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.tutor-lab-dashboard-v2 .exercise-card-v2 { padding: 14px; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: none; background: #fff; transition: border-color .15s ease-out, box-shadow .15s ease-out; }
.tutor-lab-dashboard-v2 .exercise-card-v2:hover { transform: none; }
.tutor-lab-dashboard-v2 .card-cover { display: block; width: calc(100% + 28px); max-width: none; height: auto; aspect-ratio: 16 / 9; object-fit: cover; margin: -14px -14px 14px; border-radius: 13px 13px 0 0; }
.tutor-lab-dashboard-v2 .is-done .card-cover { opacity: .75; }
/* Segnaposto: numero in filigrana e titolo sopra l'immagine. */
.tutor-lab-dashboard-v2 .card-cover--mark { position: relative; overflow: hidden; }
.tutor-lab-dashboard-v2 .card-cover--mark img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tutor-lab-dashboard-v2 .card-cover-text { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 12px; padding: 16px; background: linear-gradient(to top, rgba(0, 46, 91, .94) 0%, rgba(0, 46, 91, .62) 48%, rgba(0, 46, 91, .08) 100%); color: #fff; }
.tutor-lab-dashboard-v2 .card-cover-num { flex: none; font-size: 3.5rem; font-weight: 800; line-height: .85; letter-spacing: -.04em; color: rgba(255, 255, 255, .34); transition: color .15s ease-out, text-shadow .15s ease-out; }
@media (hover: hover) and (pointer: fine) { .tutor-lab-dashboard-v2 .exercise-card-v2:hover .card-cover-num { color: #FEC10D; text-shadow: 0 0 18px rgba(254, 193, 13, .65); } }
/* Copertina scelta: il numero c'è anche qui, con una sfumatura leggera per non coprire l'immagine. */
.tutor-lab-dashboard-v2 .card-cover--photo .card-cover-text { background: linear-gradient(to top, rgba(0, 46, 91, .6) 0%, rgba(0, 46, 91, 0) 45%); }
.tutor-lab-dashboard-v2 .card-cover--photo .card-cover-num { color: rgba(255, 255, 255, .7); }
.tutor-lab-dashboard-v2 .card-cover-title { min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 1.05rem; font-weight: 700; line-height: 1.25; color: #fff; overflow-wrap: anywhere; }
.tutor-lab-dashboard-v2 .card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; min-height: 28px; }
.tutor-lab-dashboard-v2 .exercise-card-v2 .card-icon-container { display: flex; width: 28px; height: 28px; margin: 0 2px 0 0; border-radius: 8px; }
.tutor-lab-dashboard-v2 .exercise-card-v2 .card-icon-container i { font-size: 16px; }
.tutor-lab-dashboard-v2 .card-status-tag { align-self: center; font-size: .72rem; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 4px 8px; margin: 0; border-radius: 7px; }
.tutor-lab-dashboard-v2 .tl-ex-new-tag { background: #FEC10D; color: #002E5B; }
.tutor-lab-dashboard-v2 .card-xp-badge,
.tutor-lab-dashboard-v2 .card-xp-badge.redeemed { position: static; margin-left: auto; padding: 0; background: none; border: 0; box-shadow: none; transform: none; animation: none; color: #94a3b8; font-size: .72rem; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.tutor-lab-dashboard-v2 .card-number { font-size: .72rem !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important; color: #94a3b8 !important; margin-bottom: 1px !important; }
.tutor-lab-dashboard-v2 .exercise-card-v2 .card-title { font-size: 1rem; font-weight: 600; line-height: 1.32; letter-spacing: -.005em; color: #0f172a; margin: 0 0 14px; flex-grow: 1; }
.tutor-lab-dashboard-v2 .exercise-card-v2 .card-excerpt { display: none !important; }

.tutor-lab-dashboard-v2 .card-progress-container { margin-bottom: 12px; }
.tutor-lab-dashboard-v2 .progress-labels { font-size: .75rem; margin-bottom: 5px; }
.tutor-lab-dashboard-v2 .progress-bar-background { height: 5px; border-radius: 999px; background: #e2e8f0; }
.tutor-lab-dashboard-v2 .progress-bar-foreground { border-radius: 999px; background: #2563EB; }

.tutor-lab-dashboard-v2 .card-cta-container { margin-top: 0; }
.tutor-lab-dashboard-v2 .card-cta-button { min-height: 40px; padding: 0 12px; border-radius: 9px; font-size: .88rem; box-shadow: none; transform: none; touch-action: manipulation; transition: background .15s ease-out, color .15s ease-out; }
.tutor-lab-dashboard-v2 .card-cta-button i { font-size: 15px; }
.tutor-lab-dashboard-v2 .exercise-card-v2:not(.is-locked) { position: relative; cursor: pointer; }
.tutor-lab-dashboard-v2 .card-cta-container, .tutor-lab-dashboard-v2 .card-cta-button { position: static; }
.tutor-lab-dashboard-v2 .card-feedback-badge { pointer-events: none; }
.tutor-lab-dashboard-v2 .card-cta-button::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: 14px; }
.tutor-lab-dashboard-v2 .is-todo .card-cta-button { background: #FEC10D; color: #002E5B !important; font-weight: 700; }
.tutor-lab-dashboard-v2 .is-doing .card-cta-button { background: #2563EB; color: #fff !important; }
.tutor-lab-dashboard-v2 .is-done .card-cta-button { background: transparent; color: #475569 !important; box-shadow: inset 0 0 0 1px #cbd5e1; }
.tutor-lab-dashboard-v2 .exercise-card-v2.is-done { background: #fbfcfd; }
.tutor-lab-dashboard-v2 .is-done .card-title { color: #475569; }
.tutor-lab-dashboard-v2 .exercise-card-v2:focus-within { border-color: #2563EB; }
.tutor-lab-dashboard-v2 .card-cta-button:active { transform: scale(.98); }

@media (hover: hover) and (pointer: fine) {
    .tutor-lab-dashboard-v2 .exercise-card-v2:hover { border-color: #93b4f5; box-shadow: 0 4px 14px rgba(15, 23, 42, .06); }
    .tutor-lab-dashboard-v2 .is-todo:hover .card-cta-button { background: #f0b400; }
    .tutor-lab-dashboard-v2 .is-doing:hover .card-cta-button { background: #1d4ed8; }
    .tutor-lab-dashboard-v2 .is-done:hover .card-cta-button { background: #f1f5f9; }
    .tl-ex-new a:hover { background: #014078; }
    .tl-ex-summary a:hover { background: #dbe5f3; color: #002E5B !important; }
    .tl-ex-summary a.tl-ex-phase:hover { color: #2563eb !important; }
}
@media (max-width: 768px) {
    .tutor-lab-dashboard-v2 { margin-top: 0; }
    .tutor-lab-dashboard-v2 .dashboard-header { margin-bottom: 14px; }
    .tutor-lab-dashboard-v2 .dashboard-header h1 { font-size: 1.5rem; }
    .tutor-lab-dashboard-v2 .dashboard-header p { display: none; }
    .tutor-lab-dashboard-v2 .exercise-grid { grid-template-columns: 1fr !important; gap: 10px; }
    .tutor-lab-dashboard-v2 .exercise-card-v2 { padding: 14px; border-radius: 14px; box-shadow: none; }
    .tutor-lab-dashboard-v2 .exercise-card-v2 .card-icon-container { display: flex; }
    .tutor-lab-dashboard-v2 .exercise-phase-section .phase-title { font-size: 1rem; margin: 0 0 10px; }
    .tutor-lab-dashboard-v2 .card-cta-button { min-height: 44px; border-radius: 10px; padding: 0 14px; }
    /* Le fasi scorrono di lato: non spingono in basso gli esercizi. */
    .tl-ex-summary { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin-bottom: 20px; }
    .tl-ex-overall { display: none; }
    .tl-ex-summary a { flex: 0 0 auto; white-space: nowrap; }
}
/* Da desktop: più aria nei box, che qui non devono stare in poco spazio. */
@media (min-width: 769px) {
    .tutor-lab-dashboard-v2 .dashboard-header { margin-bottom: 32px; }
    .tutor-lab-dashboard-v2 .exercise-phase-section { margin-bottom: 44px; }
    .tutor-lab-dashboard-v2 .exercise-phase-section .phase-title { font-size: 1.15rem; margin-bottom: 16px; }
    .tutor-lab-dashboard-v2 .exercise-grid { gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
    .tutor-lab-dashboard-v2 .exercise-card-v2 { padding: 24px; border-radius: 16px; }
    .tutor-lab-dashboard-v2 .card-cover { width: calc(100% + 48px); margin: -24px -24px 20px; border-radius: 15px 15px 0 0; }
    .tutor-lab-dashboard-v2 .card-top { margin-bottom: 20px; gap: 8px; }
    .tutor-lab-dashboard-v2 .exercise-card-v2 .card-icon-container { width: 34px; height: 34px; margin-right: 4px; border-radius: 10px; }
    .tutor-lab-dashboard-v2 .exercise-card-v2 .card-icon-container i { font-size: 19px; }
    .tutor-lab-dashboard-v2 .exercise-card-v2 .card-title { font-size: 1.1rem; line-height: 1.4; margin-bottom: 24px; }
    .tutor-lab-dashboard-v2 .card-progress-container { margin-bottom: 18px; }
    .tutor-lab-dashboard-v2 .card-cta-button { min-height: 44px; border-radius: 10px; }
    .tutor-lab-dashboard-v2 .card-cta-button::after { border-radius: 16px; }
    .tl-ex-new { padding: 18px; margin-bottom: 32px; }
    .tl-ex-new ul { gap: 8px; }
    .tl-ex-new li { padding: 10px 10px 10px 16px; }
}

/* Elenco dei contenuti sotto ogni modulo nel riepilogo (Esercitazioni, Lezioni, Risorse: includes/student-sidebar.php). */
/* Una riga per contenuto, con un segnaposto tondo unito agli altri da una linea: vuoto da fare, verde con la spunta
   fatto, blu il prossimo. Il segnaposto è disegnato qui su uno span: lo stile non sta mai sull'icona, che su alcuni
   siti viene sostituita da un altro elemento. */
.tl-ex-tree { margin: 2px 0 6px; padding: 0; list-style: none; }
.tl-ex-tree li { position: relative; margin: 0; }
.tl-ex-tree li::before { content: ""; position: absolute; left: 16px; top: 0; bottom: 0; width: 2px; background: #e2e8f0; }
.tl-ex-tree li:first-child::before { top: 16px; }
.tl-ex-tree li:last-child::before { bottom: auto; height: 16px; }
.tl-ex-tree li:only-child::before { display: none; }
.tl-ex-summary .tl-ex-tree a { position: relative; display: flex; align-items: flex-start; justify-content: flex-start; gap: 10px; min-height: 0; margin: 0; padding: 7px 8px; border-radius: 10px; background: none; color: #334155 !important; font-size: 13px; font-weight: 500; line-height: 18px; white-space: normal; transition: background .12s ease-out; }
.tl-ex-summary .tl-ex-tree a span { flex: 1 1 auto; min-width: 0; padding: 0; background: none; overflow-wrap: anywhere; color: inherit; font-weight: inherit; font-size: inherit; }
.tl-ex-summary .tl-ex-tree a .tl-ex-mark { flex: none; position: relative; box-sizing: border-box; width: 18px; height: 18px; border: 2px solid #cbd5e1; border-radius: 50%; background: #fff; }
.tl-ex-summary .tl-ex-tree .is-done .tl-ex-mark { border-color: #16a34a; background: #16a34a; }
.tl-ex-tree .is-done .tl-ex-mark::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tl-ex-summary .tl-ex-tree .is-done a { color: #64748b !important; }
.tl-ex-summary .tl-ex-tree .is-next .tl-ex-mark { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.tl-ex-summary .tl-ex-tree .is-next a { color: #002E5B !important; font-weight: 600; }
[id^="tutor-lab-card-"], [id^="tl-card-"], [id^="tl-lesson-mod-"], [id^="tl-resource-mod-"] { scroll-margin-top: 116px; }
@media (hover: hover) and (pointer: fine) { .tl-ex-summary .tl-ex-tree a:hover { background: #f1f5f9; color: #002E5B !important; } }
.tl-ex-summary a:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
/* Su telefono e tablet il riepilogo resta una riga di moduli: l'elenco dei contenuti si vede da desktop. */
@media (max-width: 1023px) { .tl-ex-tree { display: none; } }

/* Da desktop largo: il riepilogo diventa una sidebar che resta visibile mentre si scorre. */
@media (min-width: 1024px) {
    .tutor-lab-dashboard-v2 { max-width: min(1240px, 100%); }
    .tl-ex-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 36px; align-items: start; }
    .tl-ex-new { grid-column: 2; grid-row: 1; }
    .tl-ex-list { grid-column: 2; grid-row: 2; min-width: 0; }
    .tl-ex-summary { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 116px; display: block; max-height: calc(100vh - 136px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; margin: 0; padding: 18px 12px 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
    .tl-ex-overall { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 12px; margin: 0 8px 6px; padding-bottom: 16px; }
    .tl-ex-overall strong { flex: 1 1 auto; margin: 0; font-size: .95rem; color: #002E5B; }
    .tl-ex-overall-bar { flex: 0 0 100%; display: block; height: 8px; }
    /* Il modulo: nome a sinistra, conteggio in una pastiglia a destra (verde quando è tutto fatto). */
    .tl-ex-summary a.tl-ex-phase { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 0; margin: 0; padding: 14px 8px 6px; border-top: 1px solid #eef2f7; border-radius: 0; background: none; color: #0f172a !important; font-size: .875rem; font-weight: 600; line-height: 1.35; }
    .tl-ex-summary a.tl-ex-phase:first-child { padding-top: 2px; border-top: 0; }
    .tl-ex-summary a.tl-ex-phase span { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 600; line-height: 18px; }
    .tl-ex-summary a.tl-ex-phase.is-complete span { background: #dcfce7; color: #166534; }
    .tl-ex-summary .tl-ex-tree { margin-bottom: 10px; }
    .tutor-lab-dashboard-v2 .exercise-phase-section { scroll-margin-top: 116px; }
    /* Lezioni e Risorse: il primo modulo della colonna parte in alto, accanto al riepilogo. */
    .tl-ex-list > .tl-phase-heading:first-child, .tl-ex-list > .tl-lib-phase:first-child { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .tutor-lab-dashboard-v2 .exercise-card-v2, .tutor-lab-dashboard-v2 .card-cta-button { transition: none; }
}
