.student-progress-shell {
    display: grid;
    gap: 12px;
    min-width: 0;
    color: #0f172a;
}

.student-progress-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #dbe3f0;
}

.student-progress-tabs button {
    margin: 0 0 -1px;
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 7px 7px 0 0;
    background: transparent;
    color: #64748b;
    font-weight: 800;
    box-shadow: none;
}

.student-progress-tabs button.active {
    border-bottom-color: #4f46e5;
    color: #3730a3;
    background: #f8fafc;
}

.student-progress-surface {
    min-width: 0;
    padding: 16px;
    border: 1px solid #dfe7f3;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
}

.student-progress-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px 16px;
    margin-bottom: 8px;
}

.student-progress-control-group {
    display: grid;
    gap: 6px;
}

.student-progress-ring-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 12px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.student-progress-ring-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.student-progress-legend-ring {
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.student-progress-legend-ring--inner {
    width: 8px;
    height: 8px;
    margin: 2px;
    color: #a866ff;
}

.student-progress-legend-ring--outer {
    color: #55efff;
}

.student-progress-scale-note {
    max-width: 420px;
    margin: 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
    text-align: right;
}

.student-progress-control-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.student-progress-retry:focus-visible,
.student-progress-tail-card:focus-visible,
.student-progress-theme-title-lane:focus-visible,
.student-progress-task-cell:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.student-progress-retry {
    min-height: 32px;
    margin: 8px 0 0;
    padding: 6px 12px;
    font-size: 13px;
}

.student-progress-tails-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 10px;
    margin-top: 10px;
    min-width: 0;
}

.student-progress-shell .student-progress-tail-card {
    position: relative;
    min-width: 0;
    padding: 12px 14px !important;
    border-radius: 10px !important;
    transition: border-color 0.14s ease, box-shadow 0.14s ease !important;
}

.student-progress-shell .student-progress-tail-card:hover {
    transform: none !important;
}

.student-progress-tail-header {
    position: relative;
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    align-items: center !important;
    gap: 12px !important;
    min-width: 0;
    min-height: 24px;
    margin-bottom: 7px !important;
}

.student-progress-theme-number {
    min-width: 0;
    color: #1e293b;
    font-size: 24px;
    font-weight: 850;
    line-height: 1;
}

.student-progress-theme-title-lane {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    line-height: 24px;
    white-space: nowrap;
}

.student-progress-theme-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-progress-tail-count {
    color: #475569;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}

.student-progress-shell .student-progress-task-grid--tails,
.student-progress-admin-tails .student-progress-task-grid--tails {
    display: grid;
    grid-template-columns: repeat(auto-fill, 48px);
    gap: 8px;
}

.student-progress-task-grid--tails .student-progress-task-details {
    position: relative;
    width: 48px;
    height: 48px;
}

.student-progress-task-cell--tails {
    position: relative;
    display: grid;
    width: 48px;
    min-width: 48px;
    height: 48px;
    place-items: center;
    padding: 0;
    overflow: visible;
    border: 1px solid rgba(125, 156, 181, .19);
    border-radius: 8px;
    background:
        linear-gradient(155deg, rgba(255, 255, 255, .055), transparent 28%),
        linear-gradient(180deg, #151d27, #090d13);
    color: #dff8ff;
    cursor: help;
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1;
    list-style: none;
    box-shadow: 0 4px 0 #030508, inset 0 1px rgba(255, 255, 255, .05);
    transition: border-color 150ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.student-progress-task-cell::-webkit-details-marker {
    display: none;
}

.student-progress-task-cell::marker {
    content: "";
}

.student-progress-task-cell:hover,
.student-progress-task-cell:focus-visible,
.student-progress-task-details[open] .student-progress-task-cell {
    z-index: 41;
    border-color: rgba(85, 239, 255, .52);
    box-shadow:
        0 5px 0 #030508,
        0 0 14px rgba(85, 239, 255, .15),
        inset 0 1px rgba(255, 255, 255, .08);
    transform: translateY(-1px);
}

.student-progress-rings {
    position: absolute;
    inset: -1px;
    width: 48px;
    height: 48px;
    overflow: visible;
}

.student-progress-ring-track,
.student-progress-ring-value {
    fill: none;
    vector-effect: non-scaling-stroke;
}

.student-progress-ring-track {
    stroke: rgba(151, 183, 211, .1);
    stroke-width: 1.2;
    stroke-linecap: round;
}

.student-progress-ring-track--inner {
    stroke: rgba(168, 102, 255, .09);
}

.student-progress-ring-track.state-missing,
.student-progress-ring-track.state-na {
    stroke: rgba(151, 183, 211, .14);
}

.student-progress-ring-track.state-missing {
    stroke-width: 1.5;
}

.student-progress-ring-track.state-na {
    stroke-width: 1.2;
}

.student-progress-ring-value {
    stroke-dasharray: var(--ring-value);
    stroke: var(--ring-color);
    stroke-linecap: round;
}

.student-progress-ring-active {
    opacity: var(--ring-opacity);
    filter:
        brightness(var(--ring-brightness))
        drop-shadow(0 0 var(--ring-glow-radius) var(--ring-glow));
}

.student-progress-ring-active--outer.student-progress-ring-intensity--low {
    --ring-color: #3e90aa;
    --ring-opacity: .7;
    --ring-brightness: .82;
    --ring-glow-radius: 1px;
    --ring-glow: rgba(62, 144, 170, .12);
}

.student-progress-ring-active--outer.student-progress-ring-intensity--medium {
    --ring-color: #3dbbd5;
    --ring-opacity: .84;
    --ring-brightness: .94;
    --ring-glow-radius: 1.5px;
    --ring-glow: rgba(61, 187, 213, .2);
}

.student-progress-ring-active--outer.student-progress-ring-intensity--high {
    --ring-color: #55dff3;
    --ring-opacity: .94;
    --ring-brightness: 1.02;
    --ring-glow-radius: 2px;
    --ring-glow: rgba(85, 223, 243, .3);
}

.student-progress-ring-active--outer.student-progress-ring-intensity--maximum {
    --ring-color: #82f4ff;
    --ring-opacity: 1;
    --ring-brightness: 1.08;
    --ring-glow-radius: 2px;
    --ring-glow: rgba(85, 239, 255, .36);
}

.student-progress-ring-active--inner.student-progress-ring-intensity--low {
    --ring-color: #75529d;
    --ring-opacity: .7;
    --ring-brightness: .82;
    --ring-glow-radius: 1px;
    --ring-glow: rgba(117, 82, 157, .12);
}

.student-progress-ring-active--inner.student-progress-ring-intensity--medium {
    --ring-color: #9e61d8;
    --ring-opacity: .84;
    --ring-brightness: .94;
    --ring-glow-radius: 1.5px;
    --ring-glow: rgba(158, 97, 216, .2);
}

.student-progress-ring-active--inner.student-progress-ring-intensity--high {
    --ring-color: #c75ee9;
    --ring-opacity: .94;
    --ring-brightness: 1.02;
    --ring-glow-radius: 2px;
    --ring-glow: rgba(199, 94, 233, .3);
}

.student-progress-ring-active--inner.student-progress-ring-intensity--maximum {
    --ring-color: #ef78ff;
    --ring-opacity: 1;
    --ring-brightness: 1.08;
    --ring-glow-radius: 2.1px;
    --ring-glow: rgba(239, 120, 255, .38);
}

.student-progress-ring-active--constant .student-progress-ring-value--outer {
    stroke-width: 3px;
}

.student-progress-ring-active--constant .student-progress-ring-value--inner {
    stroke-width: 2.5;
}

.student-progress-ring-ribbon,
.student-progress-ring-ribbon-cap {
    fill: var(--ring-color);
    stroke: none;
}

.student-progress-ring-reveal {
    fill: none;
    stroke: #fff;
    stroke-width: 6px;
    stroke-linecap: butt;
    stroke-dasharray: var(--ring-to) 1;
}

.student-progress-task-number {
    position: absolute;
    top: 34px;
    left: 50%;
    z-index: 2;
    max-width: 27px;
    overflow: hidden;
    color: #e5faff;
    pointer-events: none;
    text-overflow: clip;
    transform: translateX(-50%);
    white-space: nowrap;
    text-shadow: 0 0 7px rgba(85, 239, 255, .22);
}

.student-progress-task-details:hover .student-progress-ring-active,
.student-progress-task-details:focus-within .student-progress-ring-active,
.student-progress-task-details[open] .student-progress-ring-active {
    filter:
        brightness(calc(var(--ring-brightness) + .06))
        drop-shadow(0 0 calc(var(--ring-glow-radius) + .5px) var(--ring-glow));
}

.student-progress-tooltip-layer {
    position: fixed;
    z-index: 9000;
    width: max-content;
    min-width: min(230px, calc(100vw - 14px));
    max-width: min(310px, calc(100vw - 14px));
    padding: 8px 10px;
    border: 1px solid rgba(109, 231, 250, .42);
    border-radius: 6px;
    background: rgba(4, 8, 13, .98);
    color: #e5faff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: pre-line;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .68), inset 0 0 14px rgba(115, 75, 255, .08);
    pointer-events: none;
}

.student-progress-tooltip-layer::before {
    content: "";
    position: absolute;
    top: -2px;
    right: 8px;
    left: 8px;
    height: 2px;
    background: linear-gradient(90deg, #55f7ff, #477dff, #a866ff, #ed4fff);
}

.student-progress-tooltip-secondary {
    display: block;
    margin-top: 5px;
    color: #91a2b1;
    font-size: 11px;
    font-weight: 500;
}

.student-progress-tooltip-secondary[hidden],
.student-progress-tooltip-layer[hidden] {
    display: none;
}

.student-progress-ring-reveal.student-progress-motion--entry {
    animation: student-progress-ring-reveal 1400ms cubic-bezier(.2, .74, .18, 1) both;
}

.student-progress-ring-reveal.student-progress-motion--update {
    animation: student-progress-ring-reveal 1400ms cubic-bezier(.2, .74, .18, 1) both;
}

@keyframes student-progress-ring-reveal {
    from { stroke-dasharray: var(--ring-from) 1; }
    to { stroke-dasharray: var(--ring-to) 1; }
}

html[data-visual-skin="tron"] .student-progress-tabs {
    border-color: var(--skin-line);
}

html[data-visual-skin="tron"] .student-progress-tabs button.active {
    color: var(--skin-energy);
    background: var(--skin-energy-soft);
    border-color: var(--skin-energy);
}

html[data-visual-skin="tron"] .student-progress-surface {
    border-color: var(--skin-line);
    background: var(--skin-graphite-grain);
    box-shadow: var(--skin-shell-shadow);
}

html[data-visual-skin="tron"] .student-progress-control-label {
    color: var(--skin-text-muted);
}

html[data-visual-skin="tron"] .student-progress-ring-legend,
html[data-visual-skin="tron"] .student-progress-scale-note {
    color: var(--skin-text-muted);
}

html[data-visual-skin="tron"] .student-progress-tail-card {
    border-color: var(--skin-line) !important;
    border-top-color: var(--skin-line-bright) !important;
    background: var(--skin-graphite-grain) !important;
    box-shadow: var(--skin-shell-shadow) !important;
}

html[data-visual-skin="tron"] .student-progress-tail-card:hover {
    border-color: var(--skin-line-bright) !important;
    border-top-color: var(--skin-line-bright) !important;
    box-shadow: var(--skin-shell-shadow) !important;
}

html[data-visual-skin="tron"] :where(
    .student-progress-tail-card,
    .student-progress-theme-title-lane,
    .student-progress-task-cell
):focus-visible {
    outline: 2px solid var(--skin-focus);
    outline-offset: 3px;
}

html[data-visual-skin="tron"] .student-progress-shell .admin-tail-title {
    color: var(--skin-text) !important;
}

html[data-visual-skin="tron"] .student-progress-theme-number,
html[data-visual-skin="tron"] .student-progress-theme-title-lane,
html[data-visual-skin="tron"] .student-progress-tail-count {
    color: var(--skin-text-muted);
}

/* Keep the accepted pre-experiment presentation for student and admin preview. */
.student-progress-shell .student-progress-tail-card {
    border: 1px solid #e2e8f0 !important;
    border-top-width: 1px !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

.student-progress-shell .student-progress-tail-card:hover {
    border-color: #cbd5e1 !important;
    border-top-color: #cbd5e1 !important;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.055) !important;
}

.student-progress-shell .student-progress-theme-tooltip {
    position: absolute;
    z-index: 60;
    bottom: calc(100% + 8px);
    left: 0;
    display: -webkit-box;
    width: max-content;
    min-width: 190px;
    max-width: min(360px, calc(100vw - 24px));
    padding: 8px 10px;
    overflow: hidden;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.24);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.student-progress-shell .student-progress-theme-title-lane[data-title-truncated]:hover
    ~ .student-progress-theme-tooltip,
.student-progress-shell .student-progress-theme-title-lane[data-title-truncated]:focus-visible
    ~ .student-progress-theme-tooltip {
    opacity: 1;
    visibility: visible;
}

html[data-visual-skin="tron"] .student-progress-shell .admin-tail-card {
    border-color: var(--skin-line) !important;
    border-top-color: var(--skin-line-bright) !important;
    background: var(--skin-surface-1) !important;
}

@media (max-width: 720px) {
    body:has(.student-progress-shell) .cabinet-shell {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body:has(.student-progress-shell) .cabinet-sidebar {
        display: block;
        overflow-x: auto;
        padding: 8px;
        border-right: 0;
        border-bottom: 1px solid #dbe2ea;
    }

    body:has(.student-progress-shell) .cabinet-sidebar-toggle {
        display: none;
    }

    body:has(.student-progress-shell) #cabinetMenu {
        display: flex;
        width: max-content;
        gap: 4px;
    }

    body:has(.student-progress-shell) .cabinet-menu-button {
        width: auto;
        white-space: nowrap;
    }

    .student-progress-surface {
        padding: 12px;
    }

    .student-progress-toolbar {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .student-progress-control-group {
        width: 100%;
    }

    .student-progress-ring-legend {
        justify-content: flex-start;
    }

    .student-progress-scale-note {
        text-align: left;
    }

    .student-progress-shell .student-progress-tail-card {
        padding: 11px 12px !important;
    }

    .student-progress-tails-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .student-progress-shell *,
    .student-progress-shell *::before,
    .student-progress-shell *::after,
    .student-progress-admin-tails *,
    .student-progress-admin-tails *::before,
    .student-progress-admin-tails *::after {
        animation: none !important;
        transition: none !important;
    }
}

@media (forced-colors: active) {
    .student-progress-task-cell,
    .student-progress-tooltip-layer {
        border: 1px solid ButtonText;
        background: Canvas;
        color: CanvasText;
        box-shadow: none;
    }

    .student-progress-ring-track {
        stroke: GrayText;
    }

    .student-progress-ring-active--pulse {
        animation: none !important;
    }

    .student-progress-ring-active--outer .student-progress-ring-value {
        stroke: Highlight;
        stroke-width: 3;
        filter: none !important;
    }

    .student-progress-ring-active--inner .student-progress-ring-value {
        stroke: LinkText;
        stroke-width: 2;
        filter: none !important;
    }

    .student-progress-ring-active--outer .student-progress-ring-ribbon,
    .student-progress-ring-active--outer .student-progress-ring-ribbon-cap {
        fill: Highlight;
    }

    .student-progress-ring-active--inner .student-progress-ring-ribbon,
    .student-progress-ring-active--inner .student-progress-ring-ribbon-cap {
        fill: LinkText;
    }

    .student-progress-ring-track.state-missing {
        stroke: GrayText;
        stroke-width: 2;
    }

    .student-progress-ring-track.state-na {
        stroke: GrayText;
        stroke-width: 1;
    }

    .student-progress-task-cell:focus-visible,
    .student-progress-tail-card:focus-visible,
    .student-progress-theme-title-lane:focus-visible {
        outline: 2px solid Highlight;
        outline-offset: 3px;
    }
}

/* Admin Tails host; the final two-arc renderer is shared with the student surface. */
.student-progress-admin-tails.admin-tails-section {
    padding: 16px;
    border-color: rgba(94, 142, 174, .24) !important;
    background:
        radial-gradient(circle at 18% -20%, rgba(45, 185, 215, .12), transparent 42%),
        linear-gradient(155deg, #101923, #070b11 72%) !important;
    color: #dff8ff;
    box-shadow: inset 0 1px rgba(255, 255, 255, .04), 0 18px 42px rgba(0, 0, 0, .28) !important;
}

.student-progress-admin-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: 12px;
    margin-bottom: 12px;
}

.student-progress-admin-control {
    display: grid;
    gap: 5px;
}

.student-progress-admin-control > span,
.student-progress-help,
.student-progress-admin-help {
    color: #91a6b5;
    font-size: 11px;
    font-weight: 700;
}

.student-progress-help,
.student-progress-admin-help {
    margin: 0 0 12px;
    font-weight: 500;
}

.student-progress-admin-tails .student-progress-tails-list,
.student-progress-admin-tails.admin-tails-section .admin-tails-list {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    align-items: start;
}

.student-progress-admin-tails .student-progress-tail-card,
html[data-visual-skin="tron"] .student-progress-admin-tails .student-progress-tail-card {
    align-self: start;
    border: 1px solid rgba(103, 154, 184, .24) !important;
    border-top-color: rgba(85, 239, 255, .34) !important;
    background:
        linear-gradient(155deg, rgba(255, 255, 255, .045), transparent 28%),
        linear-gradient(180deg, #151d27, #090d13) !important;
    color: #dff8ff;
    box-shadow: 0 7px 18px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .04) !important;
}

.student-progress-admin-tails .student-progress-theme-number,
.student-progress-admin-tails .student-progress-theme-title-lane,
.student-progress-admin-tails .student-progress-tail-count {
    color: #b8d2de;
}

.student-progress-admin-tails .student-progress-theme-title-lane {
    line-height: 1.35;
    white-space: normal;
}

.student-progress-admin-tails .student-progress-theme-name {
    display: -webkit-box;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.student-progress-tooltip-error,
.student-progress-tooltip-time {
    display: block;
}

.student-progress-tooltip-error {
    color: #ef78ff;
}

.student-progress-tooltip-error--generic {
    color: inherit;
}

.student-progress-tooltip-time {
    color: #55dff3;
}

@media (max-width: 620px) {
    .student-progress-admin-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }
}
