/* Grade Pilot page, saved module history, and saved module editor styles. */



.grade-dashboard {
    grid-template-columns: 1fr;
}



.grade-setup-dropdown {
    padding: 0;
    overflow: hidden;
}



.grade-setup-dropdown > summary {
    display: grid;
    grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 22px 24px;
    cursor: pointer;
    list-style: none;
}



.grade-setup-dropdown > summary::-webkit-details-marker {
    display: none;
}



.grade-setup-summary-copy strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 24px;
    line-height: 1.05;
    letter-spacing: -0.05em;
}



.grade-setup-summary-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}



.grade-setup-body {
    padding: 0 24px 24px;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.setup-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.setup-actions button {
    width: auto;
    min-width: 160px;
}



.grade-setup-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(10, 132, 255, 0.09);
    border: 1px solid rgba(10, 132, 255, 0.14);
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.4;
}



.grade-setup-prompt strong {
    flex: 0 0 auto;
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}



.grade-pilot-ready .grade-setup-prompt {
    display: none;
}



/* Hide assessment table header until at least one row exists */
#gradeAssessmentEntryCard:has(#rows:empty) .grade-row.header-row {
    display: none;
}



/* Hide syllabus structure metrics until at least one assessment exists */
.grade-pilot-ready #calcSection:has(#rows:empty) #courseSetupMetrics {
    display: none;
}



.grade-assessment-entry-card {
    position: relative;
    transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}



.grade-setup-needed .grade-assessment-entry-card {
    opacity: 0.62;
    background: rgba(248, 250, 252, 0.74);
}



.grade-setup-needed .grade-assessment-entry-card::before {
    content: "Pick your module above to start.";
    display: block;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 204, 0, 0.13);
    border: 1px solid rgba(255, 149, 0, 0.18);
    color: #8a5a00;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

/* Hide empty-state metric clutter when no module is selected */
.grade-setup-needed .result-panel,
.grade-setup-needed #predictorCard {
    display: none;
}



.grade-save-panel {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(239, 246, 255, 0.72), rgba(255, 255, 255, 0.82));
    border: 1px solid rgba(10, 132, 255, 0.1);
}



.grade-save-panel.saved {
    background: linear-gradient(145deg, rgba(236, 253, 245, 0.86), rgba(255, 255, 255, 0.9));
    border-color: rgba(52, 199, 89, 0.18);
    box-shadow: 0 16px 34px rgba(52, 199, 89, 0.08);
}



.grade-save-panel h3 {
    margin: 6px 0 0;
    font-size: 22px;
    letter-spacing: -0.045em;
}



.grade-save-panel p {
    max-width: 620px;
}

.grade-save-panel .setup-actions {
    margin-top: 0;
    justify-content: flex-end;
}



.grade-plan-locked .grade-setup-dropdown,
.grade-plan-locked .grade-row,
.grade-plan-locked .import-panel {
    opacity: 0.78;
}

.grade-plan-locked input:disabled,
.grade-plan-locked select:disabled,
.grade-plan-locked textarea:disabled {
    color: var(--muted-strong);
    background: rgba(248, 250, 252, 0.72);
    cursor: default;
}

.grade-plan-locked #rows .s,
.grade-plan-locked #rows .score-points-input {
    color: var(--text);
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(10, 132, 255, 0.26);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.08);
}



.grade-row {
    display: grid;
    grid-template-columns: 1.05fr 1.45fr 1.08fr 0.9fr minmax(170px, 1.15fr) minmax(118px, 0.9fr) 52px;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
    position: relative;
}



.grade-score-entry {
    display: grid;
    gap: 8px;
}



.score-mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.06);
}



.score-mode-option {
    min-height: 28px;
    padding: 5px 8px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}



.score-mode-option.active {
    background: rgba(255, 255, 255, 0.94);
    color: var(--accent-strong);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}



.score-points-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
    align-items: center;
}



.score-points-fields[hidden],
.score-entry-note[hidden] {
    display: none;
}



.score-points-fields span {
    color: var(--muted);
    font-weight: 800;
}



.score-entry-note {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
}



.grade-row-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 11px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}



.grade-row-status.scored {
    background: rgba(52, 199, 89, 0.12);
    border-color: rgba(52, 199, 89, 0.16);
    color: #15703d;
}



.grade-row-status.upcoming {
    background: rgba(10, 132, 255, 0.1);
    border-color: rgba(10, 132, 255, 0.14);
    color: var(--accent-strong);
}



.grade-row-status.missing-score {
    background: rgba(255, 159, 10, 0.13);
    border-color: rgba(255, 159, 10, 0.18);
    color: #9a5d00;
}



.grade-row-status.missing-weight {
    background: rgba(255, 69, 58, 0.1);
    border-color: rgba(255, 69, 58, 0.14);
    color: #b42318;
}



.grade-date-suggestion {
    grid-column: 2 / 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(10, 132, 255, 0.18);
    background: rgba(10, 132, 255, 0.07);
    color: var(--muted-strong);
    font-size: 12px;
    line-height: 1.35;
}



.grade-date-suggestion label {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.grade-date-suggestion-select {
    min-height: 30px;
    padding: 4px 26px 4px 8px;
    border-radius: 10px;
    font-size: 12px;
}



.grade-date-suggestion-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}



.grade-date-suggestion-actions button {
    padding: 6px 9px;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: none;
}



.grade-date-dismiss {
    background: rgba(15, 23, 42, 0.06);
    color: var(--muted-strong);
}



.header-row {
    margin-bottom: 10px;
}



.delete-btn {
    background: var(--danger-soft);
    color: var(--danger);
    box-shadow: none;
    padding: 15px 0;
    border-radius: 16px;
}



.delete-btn:hover {
    background: rgba(255, 69, 58, 0.16);
}



.result-panel {
    margin-top: 26px;
    padding: 30px 24px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,247,250,0.88));
    border: 1px solid var(--line);
}



.grade-clarity-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}



.grade-clarity-heading h3 {
    margin: 5px 0 0;
    font-size: 20px;
    letter-spacing: -0.04em;
}



.course-setup-heading {
    margin-top: 18px;
}



.grade-clarity-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(10, 132, 255, 0.1);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 800;
}



.grade-clarity-pill.muted {
    background: rgba(15, 23, 42, 0.05);
    color: var(--muted-strong);
}



.predictor-card {
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,248,252,0.9));
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255,255,255,0.84);
    overflow: hidden;
    transition: box-shadow 0.24s ease, transform 0.24s ease, background 0.24s ease;
}



.predictor-card.risk-green {
    box-shadow: 0 18px 40px rgba(52, 199, 89, 0.08), inset 0 1px 0 rgba(255,255,255,0.84);
}



.predictor-card.risk-blue {
    box-shadow: 0 18px 40px rgba(10, 132, 255, 0.08), inset 0 1px 0 rgba(255,255,255,0.84);
}



.predictor-card.risk-yellow {
    box-shadow: 0 18px 40px rgba(245, 158, 11, 0.08), inset 0 1px 0 rgba(255,255,255,0.84);
}



.predictor-card.risk-red {
    box-shadow: 0 18px 40px rgba(255, 69, 58, 0.08), inset 0 1px 0 rgba(255,255,255,0.84);
}



.predictor-toggle {
    width: 100%;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: transform 0.24s ease, background 0.24s ease, box-shadow 0.24s ease;
}



.predictor-toggle:hover,
.predictor-toggle:focus-visible {
    background: rgba(255,255,255,0.48);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}



.predictor-toggle:hover {
    transform: translateY(-2px) scale(1.01);
}



.predictor-toggle-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}



.predictor-summary-line {
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 750;
    letter-spacing: -0.04em;
    color: var(--text);
}



.predictor-summary-meta {
    font-size: 13px;
    color: var(--muted);
}



.predictor-toggle-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}



.predictor-risk-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}



.predictor-risk-pill.risk-green {
    background: rgba(52, 199, 89, 0.12);
    color: #15703d;
}



.predictor-risk-pill.risk-blue {
    background: rgba(10, 132, 255, 0.12);
    color: #0a63c7;
}



.predictor-risk-pill.risk-yellow {
    background: rgba(245, 158, 11, 0.12);
    color: #a16207;
}



.predictor-risk-pill.risk-red {
    background: rgba(255, 69, 58, 0.12);
    color: #b42318;
}



.predictor-chevron {
    font-size: 16px;
    color: var(--muted);
    transition: transform 0.22s ease;
}



.predictor-card.expanded .predictor-chevron {
    transform: rotate(180deg);
}



.predictor-details {
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    overflow: hidden;
    padding: 0 22px;
    border-top: 1px solid transparent;
    pointer-events: none;
    transition: max-height 0.32s ease, opacity 0.22s ease, transform 0.24s ease, padding 0.24s ease, border-color 0.24s ease;
}



.predictor-card.expanded .predictor-details {
    max-height: 1100px;
    opacity: 1;
    transform: translateY(0);
    padding: 16px 22px 22px;
    border-top-color: rgba(15, 23, 42, 0.05);
    pointer-events: auto;
}



.predictor-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
    align-items: stretch;
}



.predictor-stat {
    min-height: 164px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}



.predictor-stat.secondary {
    min-height: 124px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    gap: 6px;
}



.predictor-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}



.predictor-value {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    color: var(--text);
}



.predictor-context {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: rgba(71, 85, 105, 0.82);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}



.predictor-risk-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}



.predictor-stat.secondary .predictor-value {
    font-size: clamp(22px, 2.6vw, 28px);
    opacity: 0.85;
}



.scenario-card {
    margin-top: 18px;
    padding: 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}



details.scenario-card > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}



details.scenario-card > summary::-webkit-details-marker {
    display: none;
}



.scenario-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}



.scenario-head-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}



.scenario-chevron {
    color: var(--muted);
    font-size: 14px;
    transition: transform 0.22s ease;
    line-height: 1;
}



details.scenario-card[open] .scenario-chevron {
    transform: rotate(180deg);
}



details.scenario-card > .scenario-grid,
details.scenario-card > #scenarioInsight {
    margin-top: 18px;
}



/* Hide the Remaining target card when a target grade is set */
#grade-pilot:has(#targetGrade:not(:placeholder-shown)) .target-grid > .summary-card.secondary-metric {
    display: none;
}



#grade-pilot:has(#targetGrade:not(:placeholder-shown)) .target-grid {
    grid-template-columns: 1fr;
}



.scenario-feedback {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}



.scenario-feedback.passing {
    background: rgba(52, 199, 89, 0.12);
    color: #15703d;
}



.scenario-feedback.risk {
    background: rgba(255, 69, 58, 0.12);
    color: #b42318;
}



.scenario-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 16px;
    margin-top: 18px;
    align-items: stretch;
}



.scenario-slider-wrap {
    padding: 18px;
    border-radius: 22px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.05);
}



.scenario-slider-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}



.scenario-slider-value {
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.03em;
}



.scenario-range {
    width: 100%;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(10,132,255,0.18), rgba(10,132,255,0.58));
    outline: none;
}



.scenario-range::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(10,132,255,0.16);
    box-shadow: 0 10px 20px rgba(10,132,255,0.16);
}



.scenario-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(10,132,255,0.16);
    box-shadow: 0 10px 20px rgba(10,132,255,0.16);
}



.scenario-slider-note {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}



.scenario-output {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}



.scenario-output.updating {
    transform: translateY(-2px);
    opacity: 0.92;
}



.scenario-output-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}



.scenario-output-value {
    font-size: clamp(34px, 5vw, 48px);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 1;
}



.scenario-insight {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}



.predictor-copy {
    margin-top: auto;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}



.summary-grid {
    display: grid;
    grid-template-columns: 1.2fr repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}



.result-panel > .summary-grid:first-of-type {
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.7fr);
    align-items: start;
}



.course-setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}



.course-setup-metrics[hidden] {
    display: none;
}



.course-setup-complete-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.16);
    color: #15703d;
}



.course-setup-complete-strip[hidden] {
    display: none;
}



.course-setup-complete-strip strong {
    display: block;
    margin-top: 4px;
    color: #14532d;
    font-size: 16px;
    letter-spacing: -0.03em;
}



.course-setup-complete-strip > span {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    font-size: 12px;
    font-weight: 800;
}



.summary-card {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}



.summary-card.secondary-metric {
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.035);
}



.summary-card .label {
    display: block;
    margin-bottom: 6px;
}



.summary-value {
    display: block;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.05em;
}



.summary-note {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}



.current-grade {
    display: block;
    margin: 10px 0;
    font-size: clamp(56px, 9vw, 92px);
    font-weight: 850;
    letter-spacing: -0.08em;
}



.status-badge {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(17, 19, 24, 0.05);
    color: var(--muted-strong);
    border: 1px solid rgba(15, 23, 42, 0.06);
}



.target-block {
    margin-top: 18px;
    padding: 22px;
    border-radius: 24px;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.06);
}



.target-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
    gap: 16px;
    align-items: end;
}



.target-output {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}



.target-output strong {
    display: block;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.05em;
}



.target-output span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}



.import-panel {
    margin-top: 18px;
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.54);
    overflow: hidden;
}



.import-panel summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 20px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}



.import-panel summary::-webkit-details-marker {
    display: none;
}



.import-panel summary span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}



.import-content {
    padding: 0 20px 20px;
}



.status-platinum {
    background: linear-gradient(180deg, rgba(244, 248, 255, 0.98), rgba(231, 241, 255, 0.9));
    border-color: rgba(62, 115, 255, 0.24);
    box-shadow: 0 16px 34px rgba(62, 115, 255, 0.12);
}



.status-green {
    background: linear-gradient(180deg, rgba(245, 255, 249, 0.98), rgba(232, 249, 239, 0.92));
    border-color: rgba(52, 199, 89, 0.22);
    box-shadow: 0 16px 34px rgba(52, 199, 89, 0.12);
}



.status-yellow {
    background: linear-gradient(180deg, rgba(255, 251, 242, 0.98), rgba(255, 244, 214, 0.92));
    border-color: rgba(255, 159, 10, 0.24);
    box-shadow: 0 16px 34px rgba(255, 159, 10, 0.12);
}



.status-red {
    background: linear-gradient(180deg, rgba(255, 245, 245, 0.98), rgba(255, 231, 231, 0.92));
    border-color: rgba(255, 69, 58, 0.22);
    box-shadow: 0 16px 34px rgba(255, 69, 58, 0.12);
}



.badge-platinum {
    background: rgba(62, 115, 255, 0.12);
    color: #3053cc;
    border-color: rgba(62, 115, 255, 0.18);
}



.badge-green {
    background: rgba(52, 199, 89, 0.12);
    color: #15703d;
    border-color: rgba(52, 199, 89, 0.18);
}



.badge-yellow {
    background: rgba(255, 159, 10, 0.14);
    color: #9a5d00;
    border-color: rgba(255, 159, 10, 0.18);
}



.badge-red {
    background: rgba(255, 69, 58, 0.12);
    color: #b3261e;
    border-color: rgba(255, 69, 58, 0.18);
}



.saved-modules {
    display: grid;
    gap: 14px;
}



.saved-modules-dropdown {
    padding: 0;
    overflow: hidden;
}



.saved-modules-dropdown > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    cursor: pointer;
    list-style: none;
}



.saved-modules-dropdown > summary::-webkit-details-marker {
    display: none;
}



.saved-modules-dropdown > summary strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 28px;
    line-height: 1.05;
    letter-spacing: -0.055em;
}

.saved-modules-dropdown > summary .card-subtitle {
    display: block;
    margin-top: 8px;
}



.saved-modules-dropdown-cue {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(10, 132, 255, 0.08);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 800;
}



.saved-modules-dropdown[open] .saved-modules-dropdown-cue {
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
    font-size: 0;
}



.saved-modules-dropdown[open] .saved-modules-dropdown-cue::before {
    content: "Close";
    font-size: 12px;
}



.saved-modules-dropdown-body {
    padding: 0 22px 22px;
}



.saved-modules[hidden] {
    display: none;
}



.history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}



.history-card {
    padding: 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--shadow-md);
    animation: historyCardIn 0.36s ease both;
}



.history-card h4 {
    margin: 10px 0 6px;
    font-size: 20px;
    letter-spacing: -0.04em;
}



.history-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}



.history-card-subtitle {
    margin-top: 6px;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 600;
}



.history-card-note {
    margin-top: 8px;
    color: #15703d;
    font-size: 12px;
    font-weight: 700;
}



.previous-modules-upload-card {
    display: grid;
    gap: 14px;
}



.previous-modules-upload-card[hidden] {
    display: none;
}



.previous-module-form {
    display: grid;
    gap: 14px;
}



.previous-module-form[hidden] {
    display: none;
}



.previous-module-status {
    margin: 0;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}



.saved-modules-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}



.saved-modules-toolbar[hidden] {
    display: none;
}



.previous-module-upload-trigger {
    min-height: 38px;
    border-radius: 999px;
}



.history-pass-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(52, 199, 89, 0.12);
    color: #15703d;
    border: 1px solid rgba(52, 199, 89, 0.16);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}



.history-card.passed {
    background: linear-gradient(180deg, rgba(247, 255, 250, 0.96), rgba(238, 250, 243, 0.9));
    border-color: rgba(52, 199, 89, 0.16);
    box-shadow: 0 18px 36px rgba(52, 199, 89, 0.1), 0 0 0 1px rgba(52, 199, 89, 0.04);
    transform: translateY(-2px);
    animation: passedHistoryCardIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

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

@keyframes passedHistoryCardIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(-2px);
    }
}



.history-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}



.history-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}



.history-stat {
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.05);
}



.history-stat strong {
    display: block;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}



.history-stat span {
    display: block;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.03em;
}



.history-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}



.history-actions button {
    width: auto;
    min-width: 110px;
}

.celebration-burst {
    position: absolute;
    top: 50%;
    right: 62px;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 3;
}

.burst-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    opacity: 0;
    animation: burst-pop 820ms ease-out forwards;
}

.nice-work-tag {
    position: absolute;
    top: -8px;
    right: 4px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(17, 19, 24, 0.88);
    color: white;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
    opacity: 0;
    transform: translateY(6px);
    animation: tag-rise 1200ms ease-out forwards;
    pointer-events: none;
}

@keyframes burst-pop {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.5);
    }
    15% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(1.05);
    }
}

@keyframes tag-rise {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-18px);
    }
}

.saved-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}



.saved-editor-rows {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}



.saved-editor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

@media (max-width: 860px) {
    .summary-grid,
    .target-grid,
    .setup-grid,
    .history-grid,
    .history-meta,
    .predictor-grid,
    .scenario-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .grade-row {
        grid-template-columns: 1fr;
    }

    .grade-date-suggestion {
        grid-column: 1 / -1;
        align-items: flex-start;
        flex-direction: column;
    }

    .grade-date-suggestion-actions {
        width: 100%;
    }

    .header-row {
        display: none;
    }

    .delete-btn {
        width: 100%;
    }
}


/* Saved module editor overlay */

.saved-editor-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s ease, visibility 0s linear 0.24s;
    z-index: 130;
}

.saved-editor-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.saved-editor-modal {
    width: min(1080px, 100%);
    max-height: min(88vh, 920px);
    overflow: auto;
    padding: 28px;
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(245,248,252,0.94));
    border: 1px solid rgba(255, 255, 255, 0.76);
    box-shadow: 0 40px 90px rgba(15, 23, 42, 0.18);
    transform: translateY(22px) scale(0.98);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.saved-editor-overlay.open .saved-editor-modal {
    transform: translateY(0) scale(1);
}
