body {
    min-height: 100vh;
    margin: 0;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(180deg, #021124 0%, #0d1e44 45%, #0c2a54 100%);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 420px;
    background: url('/static/bigger_swoosh.png') no-repeat center top;
    background-size: cover;
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
}

/* Above the fixed swoosh. The page content sits one layer above the
   footer, and cards don't make layers of their own, so a menu that runs
   past the bottom of a card (major search, course search) is never
   painted over by what comes after it */
.navbar,
.footer {
    position: relative;
    z-index: 1;
}

main {
    position: relative;
    z-index: 2;
}

.card {
    position: relative;
}

/* The GPA tab stays out of the way of a full-screen map */
body.map-viewer-open .gpa-tab {
    display: none;
}

.navbar-top {
    background: #07192f;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.navbar-logo {
    height: 40px;
    width: auto;
}

.footer-logo {
    height: 32px;
    width: auto;
    opacity: 0.85;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.header p {
    font-size: 1.05rem;
    margin: 0;
    color: #ffffff;
}

.card {
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(15, 32, 78, 0.12);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 28px 70px rgba(2, 16, 52, 0.18);
    color: #0f172a;
}

.autocomplete-list {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid rgba(15, 68, 155, 0.15);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    display: none;
}

.autocomplete-item {
    border: none;
    color: #0f172a;
    padding: 0.75rem 1rem;
    text-align: left;
    border-radius: 0;
}

.autocomplete-item:hover,
.autocomplete-item:focus,
.autocomplete-item.is-active {
    background: rgba(2, 132, 255, 0.08);
    color: #0b1733;
}

.input-group.position-relative {
    position: relative;
}

.input-group .form-control {
    min-height: 48px;
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

#selected-courses {
    min-height: 3rem;
    background: #f8fafc;
    border: 1px dashed rgba(100, 116, 139, 0.35);
    border-radius: 14px;
    padding: 0.8rem;
}

#selected-courses .badge {
    background: #e2e8f0;
    color: #e2e8f0;
}

.btn-outline-light {
    color: #0f172a;
    border-color: rgba(15,23,42,0.12);
    background: rgba(255,255,255,0.88);
}

.btn-outline-light:hover {
    background: #f8fafc;
}

.card + .card {
    margin-top: 1.5rem;
}

.form-control,
.form-select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

.form-control:focus,
.form-select:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2);
    color: #0f172a;
}

.form-label {
    color: #0f172a;
}

.btn-primary {
    background: #2563eb;
    border: none;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover {
    background: #1d4ed8;
}

.badge {
    border-radius: 999px;
}

textarea.form-control {
    min-height: 10rem;
}

footer {
    text-align: center;
    margin-top: 2rem;
    color: #ffffff;
}

footer a {
    color: #ffffff;
    text-decoration: underline;
}

.step-badge {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.6rem;
}

.cs-level-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin: 0.9rem 0 0.4rem;
}

.cs-level-heading:first-child {
    margin-top: 0;
}

.cs-course-grid {
    max-height: 340px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.4rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.9rem;
}

.cs-course-check {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem 0.6rem 0.5rem 2.1rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cs-course-check:has(.cs-course-checkbox:checked),
.cs-course-check.is-checked {
    background: #eff6ff;
    border-color: #93c5fd;
}

.cs-course-check .form-check-input {
    margin-left: -1.6rem;
    margin-top: 0.3rem;
}

.cs-course-check .form-check-label {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    cursor: pointer;
}

.cs-course-code {
    font-weight: 700;
    font-size: 0.88rem;
    color: #0b1733;
}

.cs-course-title {
    font-size: 0.78rem;
    color: #64748b;
}

.requirement-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.75rem;
}

.requirement-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.requirement-row:last-child {
    margin-bottom: 0;
}

.requirement-row.requirement-row-complete {
    background: #f0fdf4;
    border-color: #86efac;
}

.requirement-row-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.requirement-row-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0b1733;
    margin: 0;
}

.requirement-row-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.requirement-hours-input {
    width: 64px;
    text-align: center;
}

.requirement-hours-max {
    font-size: 0.8rem;
    color: #475569;
    white-space: nowrap;
}

.requirement-mark-complete {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    min-width: 6.6rem;
}

.requirement-mark-complete.is-undo {
    color: #475569;
    border-color: #94a3b8;
}

.requirement-progress {
    height: 5px;
    background: #e2e8f0;
    border-radius: 999px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.requirement-fill {
    height: 100%;
    width: 0%;
    background: #2563eb;
    border-radius: 999px;
    transition: width 0.2s ease;
}

.requirement-row-complete .requirement-fill {
    background: #16a34a;
}

.requirement-suggestions {
    font-size: 0.8rem;
    color: #475569;
    margin-top: 0.4rem;
}

.requirement-auto-note {
    font-size: 0.76rem;
    color: #15803d;
    margin-top: 0.4rem;
}

.term-chart {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    padding: 1.25rem 1.25rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow-x: auto;
}

.term-bar-col {
    flex: 0 0 auto;
    width: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.term-bar-track {
    height: 110px;
    width: 28px;
    display: flex;
    align-items: flex-end;
    border-bottom: 2px solid #cbd5e1;
}

.term-bar {
    width: 100%;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 6px 6px 0 0;
}

.term-bar-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0b1733;
    margin-top: 0.5rem;
}

.term-bar-value-zero {
    color: #94a3b8;
    font-weight: 500;
}

.term-bar-label {
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
}

.requirement-group-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    margin-bottom: 0.6rem;
}

.requirement-check .form-check-label {
    font-size: 0.92rem;
}

/* --- Progress summary (plan page) --- */
.progress-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.75rem;
}

.progress-ring-wrap {
    flex: 0 0 auto;
}

.progress-ring {
    --ring-color: #2563eb;
    --track-color: #e2e8f0;
    width: 148px;
    height: 148px;
    border-radius: 50%;
    background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--track-color) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.18);
}

.progress-ring-inner {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-ring-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0b1733;
    line-height: 1.1;
}

.progress-ring-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.progress-summary-detail {
    flex: 1 1 320px;
    min-width: 0;
}

.category-bars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.category-bar-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.category-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #1e293b;
}

.category-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
}

.category-bar .progress-bar {
    background: #2563eb;
    border-radius: 999px;
}

.audit-item {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.audit-item:last-child {
    border-bottom: none;
}

.audit-item-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audit-item-status {
    flex: 0 0 auto;
    width: 1.1rem;
    text-align: center;
    color: #94a3b8;
}

.audit-item-done .audit-item-status {
    color: #16a34a;
}

.audit-item-label {
    flex: 1 1 auto;
    font-size: 0.9rem;
    color: #1e293b;
}

.audit-item-done .audit-item-label {
    color: #16a34a;
    font-weight: 600;
}

.audit-item-hours {
    flex: 0 0 auto;
    font-size: 0.82rem;
    color: #64748b;
}

.audit-item-suggestions {
    margin-left: 1.6rem;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    align-items: start;
}

/* Without summers: one school year (Fall | Spring) per row */
@media (min-width: 768px) {
    .term-grid-years {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.term-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.term-card-remaining {
    background: #f8fafc;
    border-style: dashed;
}

.term-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.term-card-title {
    font-weight: 700;
    color: #0b1733;
    font-size: 0.95rem;
}

.plan-item-table {
    display: flex;
    flex-direction: column;
}

.plan-item-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #eef2f7;
}

.plan-item-row:last-child {
    border-bottom: none;
}

.plan-item-tag {
    flex: 0 0 auto;
    width: 34px;
    text-align: center;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.15rem 0;
    border-radius: 6px;
    color: #ffffff;
}

.plan-item-course .plan-item-tag {
    background: #2563eb;
}

.plan-item-requirement .plan-item-tag {
    background: #7c3aed;
}

.plan-item-note .plan-item-tag {
    background: #94a3b8;
}

.plan-item-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
}

.plan-item-code {
    font-weight: 700;
    color: #0b1733;
    font-size: 0.9rem;
}

.plan-item-title {
    font-size: 0.9rem;
    color: #334155;
}

.plan-item-note .plan-item-title {
    color: #64748b;
    font-style: italic;
}

.plan-item-suggestion {
    flex-basis: 100%;
    font-size: 0.76rem;
    color: #94a3b8;
}

.plan-item-hours {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
}

.prereq-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #334155;
}

.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend-core { background: #2563eb; }
.legend-conc { background: #7c3aed; }
.legend-lang { background: #f59e0b; }
.legend-sup { background: #059669; }
.legend-ext {
    background: #e5e7eb;
    border: 1px dashed #9ca3af;
}

.prereq-graph-wrap {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.25rem;
    overflow-x: auto;
}

/* ── Program fields (major / second major / minors) ─────────────────────
   Each is a search bar that keeps showing the current pick, so the panel
   stays the same size whether the catalog has eight programs or several
   hundred. Major and minor sit side by side on wide screens. */

.program-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    padding: 1rem 1.25rem 1.1rem;
}

.program-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.program-optional {
    font-weight: 400;
    color: #64748b;
}

.program-subfield {
    margin-top: 0.75rem;
}

.combo-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.combo-row + .combo-row {
    margin-top: 0.5rem;
}

.combo {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.combo-input.form-control {
    padding-right: 2.25rem;
    border-radius: 10px;
    border-color: #cbd5e1;
    background-color: #ffffff;
    /* chevron so it reads as a dropdown */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 10px;
    text-overflow: ellipsis;
}

.combo.has-value .combo-input {
    font-weight: 600;
    color: #1e3a5f;
}

.combo-input:focus {
    font-weight: 400 !important;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.combo-clear {
    position: absolute;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.1rem 0.3rem;
}

.combo-clear:hover {
    color: #0f172a;
}

.combo-btn {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #2563eb;
    font-size: 1.2rem;
    line-height: 1;
}

.combo-btn:hover:not(:disabled),
.combo-btn:focus-visible {
    border-color: #2563eb;
    background: #eff6ff;
}

.combo-btn:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.combo-btn-remove {
    color: #64748b;
}

.combo-btn-remove:hover {
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
}

.program-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(2, 16, 52, 0.16);
    padding: 0.3rem;
}

.program-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
}

.program-option.is-active {
    background: #eff6ff;
}

.program-option.is-selected .program-option-name::after {
    content: " \2713";
    color: #2563eb;
}

.program-option.is-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.program-option-text {
    min-width: 0;
}

.program-option-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
}

.program-option-sub {
    font-size: 0.75rem;
    color: #64748b;
}

.program-option mark {
    padding: 0;
    background: #fde68a;
    color: inherit;
    border-radius: 2px;
}

.program-option-meta {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #475569;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 0.15rem 0.45rem;
}

.program-menu-empty,
.program-menu-more,
.autocomplete-more {
    padding: 0.6rem 0.65rem;
    font-size: 0.8rem;
    color: #64748b;
}

.program-menu-more,
.autocomplete-more {
    border-top: 1px solid #f1f5f9;
}

.cs-major-heading {
    margin: 0.75rem 0 0.25rem;
    font-size: 1rem;
    color: #1e3a5f;
}

.cs-major-heading:first-child {
    margin-top: 0;
}

.plan-item-second .plan-item-tag {
    background: #7c3aed;
}



.autocomplete-empty {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: #64748b;
}

.plan-item-minor .plan-item-tag {
    background: #0d9488;
}



/* ── Personal prerequisite legend (plan page) ───────────────────────────── */

.personal-prereq-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.personal-mermaid {
    min-height: 200px;
}

/* ── Mobile ───────────────────────────────────────────────────────────────
   Bootstrap's grid/flex-wrap handles most reflow; these tighten the pieces
   that were sized for desktop (oversized headings, wide min-widths that
   force premature wrapping/cramping on phone-width screens). */
@media (max-width: 576px) {
    .container {
        padding: 1.25rem 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header p {
        font-size: 0.95rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 18px;
    }

    .program-panel {
        grid-template-columns: 1fr;
    }

    .progress-summary {
        gap: 1.25rem;
        padding: 1.25rem;
    }

    .progress-ring {
        width: 112px;
        height: 112px;
    }

    .progress-ring-inner {
        width: 84px;
        height: 84px;
    }

    .progress-ring-value {
        font-size: 1.3rem;
    }

    .term-card-header {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    /* Plan rows stay one row (tag | course | hours); the course text wraps
       inside its own column instead of pushing the tag and hours onto
       separate lines */
    .plan-item-row {
        align-items: flex-start;
        gap: 0.6rem;
        padding: 0.6rem 0.85rem;
    }

    .plan-item-tag {
        margin-top: 0.1rem;
    }

    .plan-item-main {
        flex: 1 1 0;
        gap: 0.15rem 0.4rem;
    }

    .plan-item-hours {
        margin-top: 0.1rem;
    }

    .plan-item-main .plan-item-offered {
        margin-left: 0;
    }

    /* Header buttons: stacked full-width instead of one row off the screen */
    .plan-actions {
        flex-direction: column;
        width: 100%;
    }

    .plan-actions .btn {
        width: 100%;
    }

    /* Credit-hours chart: bars share the width so a normal plan fits
       without sideways scrolling (long plans still scroll inside the box) */
    .term-chart {
        gap: 0.5rem;
        padding: 1rem 0.75rem 0.75rem;
    }

    .term-bar-col {
        flex: 1 0 40px;
        width: auto;
    }

    .term-bar-track {
        height: 90px;
        width: 22px;
    }

    /* Long course names wrap instead of running off the card */
    .completed-badges .badge {
        white-space: normal;
        text-align: left;
        line-height: 1.3;
    }

    /* Requirement details: hour badges line up on the right */
    #auditAccordion .accordion-button {
        padding: 0.85rem 1rem;
        gap: 0.5rem;
    }

    #auditAccordion .accordion-button .badge {
        margin-left: auto !important;
        flex-shrink: 0;
    }

    #auditAccordion .accordion-button::after {
        margin-left: 0;
    }

    #auditAccordion .accordion-body {
        padding: 0.75rem 1rem;
    }

    /* Prerequisite graph: keep it readable and let it scroll sideways
       inside its box rather than shrinking to fit the phone */
    .prereq-graph-wrap {
        padding: 0.75rem;
    }

    .personal-mermaid {
        min-height: 0;
        margin: 0;
    }

    .personal-mermaid svg {
        min-width: 640px;
    }
}

/* ── Planner: completed-courses summary under the steps ── */

.completed-box {
    padding: 1.25rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}

.completed-box #selected-courses {
    max-height: 40vh;
    overflow-y: auto;
    align-content: flex-start;
}

.completed-box #selected-courses:empty::before {
    content: "Check off courses in step 1, or search for them in step 2.";
    font-size: 0.85rem;
    color: #64748b;
}

.side-count {
    display: inline-block;
    min-width: 1.6rem;
    margin-left: 0.25rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.8rem;
    text-align: center;
    vertical-align: middle;
}

.side-clear {
    padding: 0;
    font-size: 0.85rem;
    text-decoration: none;
}

/* ── Plan page: second major / minors progress, tracked apart from the 120 ── */

.extra-progress-title {
    margin-bottom: 0.25rem;
}

.extra-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.extra-progress-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0d9488;
    border-radius: 14px;
    background: #ffffff;
}

.extra-progress-card.extra-progress-second {
    border-left-color: #7c3aed;
}

.extra-progress-card .progress-ring {
    --ring-color: #0d9488;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    box-shadow: none;
}

.extra-progress-second .progress-ring {
    --ring-color: #7c3aed;
}

.extra-progress-card .progress-ring-inner {
    width: 54px;
    height: 54px;
}

.extra-progress-card .progress-ring-value {
    font-size: 0.95rem;
}

.extra-progress-name {
    font-weight: 600;
    color: #0f172a;
}

.extra-progress-hours {
    font-size: 0.85rem;
    color: #475569;
}

.extra-progress-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.audit-item-applied {
    margin-left: 1.6rem;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: #475569;
}

/* ── GPA tools: a quiet tab on the right edge, opens an offcanvas panel ── */

/* Students missed the old small gray tab: it's now white, labeled, and also
   linked from the top navigation */
.gpa-tab {
    position: fixed;
    right: 0;
    top: 50%;
    z-index: 1030;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.55rem;
    border: 1px solid #93c5fd;
    border-right: none;
    border-radius: 12px 0 0 12px;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: -6px 0 18px rgba(2, 16, 52, 0.35);
    transition: background 0.15s, color 0.15s;
}

.gpa-tab .bi {
    writing-mode: horizontal-tb;
    font-size: 1.1rem;
}

.gpa-tab:hover,
.gpa-tab:focus-visible {
    background: #2563eb;
    color: #ffffff;
}

.nav-link-button {
    background: none;
    border: 0;
}

.gpa-missing {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.25) !important;
}

.gpa-panel {
    --bs-offcanvas-width: 400px;
    color: #0f172a;
}

.gpa-panel-header {
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.gpa-current-card {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.gpa-hint {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.gpa-label {
    margin-bottom: 0.2rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
}

.gpa-tabs .nav-link {
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
}

.gpa-row-head,
.gpa-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px 64px 72px 20px;
    gap: 0.35rem;
    align-items: center;
}

.gpa-row-head {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.25rem;
}

.gpa-row + .gpa-row {
    margin-top: 0.35rem;
}

.gpa-row .form-select-sm {
    padding-right: 1.4rem;
    background-position: right 0.35rem center;
}

.gpa-remove {
    font-size: 0.6rem;
}

.gpa-add {
    padding: 0.4rem 0;
    text-decoration: none;
}

.gpa-result {
    margin-top: 0.5rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #f1f5f9;
    font-size: 0.85rem;
    color: #334155;
}

.gpa-big {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0b1733;
    line-height: 1.2;
}

.gpa-big span {
    font-size: 0.95rem;
    font-weight: 600;
}

.gpa-up {
    color: #15803d;
}

.gpa-down {
    color: #b91c1c;
}

.gpa-big.gpa-up,
.gpa-big.gpa-down {
    font-size: 1.25rem;
}

.gpa-compare {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1.15fr;
    gap: 0.3rem;
    align-items: stretch;
}

.gpa-stat {
    padding: 0.5rem 0.4rem;
    border-radius: 10px;
    background: #ffffff;
    text-align: center;
}

.gpa-stat-label {
    font-size: 0.66rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.gpa-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0b1733;
    line-height: 1.25;
}

.gpa-stat-sub {
    font-size: 0.72rem;
    color: #64748b;
}

.gpa-stat-main {
    border: 2px solid #0b1733;
}

.gpa-stat-main .gpa-stat-value {
    font-size: 1.55rem;
}

.gpa-stat-up {
    border-color: #15803d;
}

.gpa-stat-up .gpa-stat-value,
.gpa-stat-up .gpa-stat-sub {
    color: #15803d;
}

.gpa-stat-down {
    border-color: #b91c1c;
}

.gpa-stat-down .gpa-stat-value,
.gpa-stat-down .gpa-stat-sub {
    color: #b91c1c;
}

.gpa-arrow {
    align-self: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.gpa-sentence {
    margin-top: 0.6rem;
}

.gpa-range {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.75rem;
    color: #64748b;
}

.gpa-range strong {
    color: #0b1733;
}

.gpa-footnote {
    margin-top: 1.25rem;
    font-size: 0.72rem;
    color: #94a3b8;
}

/* ── Grade requirement info icon ── */

.grade-req-icon {
    position: absolute;
    top: 0.35rem;
    right: 0.45rem;
    font-size: 0.85rem;
    color: #3b82f6;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}

/* ── Button loading state ── */

.btn-primary:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

/* ── Unrecognized courses alert ── */

.unrecognized-alert {
    border-radius: 14px;
    border-color: #fbbf24;
    background: #fffbeb;
    color: #78350f;
}

.unrecognized-alert .badge {
    font-size: 0.78rem;
    background: #92400e !important;
}

/* ── Plan card: tighten top spacing on mobile ── */

.plan-card {
    container-type: inline-size;
}

/* ── Accordion: softer open state ── */

.accordion-button:not(.collapsed) {
    background: #f0f6ff;
    color: #1e3a5f;
    box-shadow: inset 0 -1px 0 rgba(37, 99, 235, 0.12);
}


/* ── Navbar brand: tighter spacing on narrow screens ── */

@media (max-width: 400px) {
    .navbar-brand {
        font-size: 0.9rem;
    }
    .navbar-logo {
        height: 30px;
    }
}

/* ── Course grid: tighter columns on small phones ── */

@media (max-width: 480px) {
    .cs-course-grid {
        grid-template-columns: 1fr;
        max-height: 280px;
    }
}

/* ── Term grid: single column on small phones ── */

@media (max-width: 480px) {
    .term-grid {
        grid-template-columns: 1fr;
    }
}

/* ── GPA panel: full-width on narrow screens ── */

@media (max-width: 480px) {
    .gpa-panel {
        --bs-offcanvas-width: 100vw;
    }
}

/* ── Progress summary: stack ring + detail on very narrow screens ── */

@media (max-width: 400px) {
    .progress-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Smooth focus outline for accessibility ── */

:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ── Print / "Download PDF": the full plan, every section expanded ── */

.print-only {
    display: none;
}

@media print {
    @page {
        margin: 0.6in;
    }

    body {
        background: #ffffff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body::before,
    .navbar,
    .header,
    .footer,
    .gpa-tab,
    .gpa-panel,
    .plan-actions,
    .no-print,
    .flash-messages,
    .accordion-button::after {
        display: none !important;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: none;
        padding: 0;
        background: #ffffff;
    }

    .print-only {
        display: block;
    }

    .print-header {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #0b1733;
    }

    .print-header span {
        display: block;
        font-size: 0.8rem;
        color: #475569;
    }

    .accordion-collapse.collapse {
        display: block !important;
        height: auto !important;
    }

    .progress-ring,
    .progress-summary {
        box-shadow: none;
    }

    /* Compact type so the plan fits in a few pages */
    html {
        font-size: 13px;
    }

    h4 {
        font-size: 1.2rem;
        break-after: avoid;
        page-break-after: avoid;
    }

    /* Small blocks stay whole; long sections flow across pages, with no
       requirement row or term card split in half */
    .progress-summary,
    .extra-progress-card,
    .plan-chart,
    .plan-completed,
    .term-card,
    .audit-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .accordion-item {
        border: 1px solid #e2e8f0 !important;
        margin-bottom: 0.4rem;
    }

    .accordion-header {
        break-after: avoid;
        page-break-after: avoid;
    }

    .accordion-button {
        padding: 0.45rem 0.75rem;
        font-size: 0.95rem;
    }

    .accordion-body {
        padding: 0.35rem 0.75rem 0.5rem;
    }

    .audit-item {
        padding-top: 0.2rem;
        padding-bottom: 0.2rem;
    }

    .term-grid,
    .term-grid-years {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .term-card-header {
        padding: 0.4rem 0.7rem;
    }

    .plan-item-row {
        padding: 0.3rem 0.7rem;
    }

    .plan-item-suggestion {
        font-size: 0.72rem;
    }

    /* The prerequisite map gets its own page, scaled to the page width */
    .plan-prereq-path {
        break-before: page;
        page-break-before: always;
    }

    .map-viewer .prereq-graph-wrap,
    .prereq-graph-wrap {
        overflow: visible;
        max-height: none;
        padding: 0.25rem;
        border: none;
    }

    .prereq-graph-wrap svg {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
}

/* ── Catalog-driven programs ─────────────────────────────────────────────── */
.program-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    margin-top: 0.5rem;
}

.program-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 500;
}

.program-chip-verified {
    background: #ecfdf5;
    color: #047857;
}

.program-link {
    font-size: 0.78rem;
    color: #2563eb;
    text-decoration: none;
}

.program-link:hover {
    text-decoration: underline;
}

.program-option-verified {
    margin-left: 0.35rem;
    color: #059669;
    font-size: 0.78rem;
}

.req-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 0.35rem;
    border-radius: 50%;
    background: #2563eb;
    vertical-align: middle;
}


.auto-pill {
    display: inline-block;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #ede9fe;
    color: #5b21b6;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: 1px;
}

.footer-catalog {
    font-size: 0.8rem;
    opacity: 0.75;
}

.prereq-picker {
    min-width: 260px;
    max-width: 420px;
}

@media (max-width: 576px) {
    .prereq-picker {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}

.navbar-sub {
    margin-left: 0.4rem;
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.8;
}

@media (max-width: 400px) {
    .navbar-sub {
        display: none;
    }
}

.checklist-count {
    margin-left: 0.35rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0;
    vertical-align: 1px;
}

.checklist-note {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #64748b;
}

.checklist-more {
    margin-top: 0.75rem;
}

.checklist-more > summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.checklist-more > summary::-webkit-details-marker {
    display: none;
}

.checklist-more > summary::before {
    content: "\25B8";
    display: inline-block;
    margin-right: 0.4rem;
    transition: transform 0.15s;
}

.checklist-more[open] > summary::before {
    transform: rotate(90deg);
}

.error-card {
    max-width: 560px;
    margin: 2rem auto;
    padding: 2.5rem 2rem;
}

.error-code {
    font-size: 3rem;
    font-weight: 700;
    color: #2563eb;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.plan-item-offered,
.cs-course-offered {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

.plan-item-prereq {
    background: #e0e7ff;
    color: #3730a3;
    cursor: help;
}

.cs-course-offered {
    display: block;
    width: fit-content;
    margin: 0.15rem 0 0;
}

.next-step-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    background: #f0fdf4;
    color: #14532d;
}

.next-course-badge {
    background: #ffffff;
    color: #14532d;
    border: 1px solid #86efac;
    font-weight: 600;
}

@media (max-width: 576px) {
    .next-step-actions {
        width: 100%;
    }
}

/* ── Checklist filters ── */
.checklist-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.checklist-search {
    max-width: 240px;
}

.cs-course-check[hidden],
.cs-course-grid[hidden],
.cs-level-heading[hidden],
.checklist-more[hidden] {
    display: none !important;
}

@media (max-width: 576px) {
    .checklist-filters .btn-group {
        width: 100%;
    }

    .checklist-search {
        max-width: none;
    }
}

/* ── Prerequisite map viewer: full screen, zoom, drag to pan ─────────────── */

.map-viewer-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.map-zoom-label {
    min-width: 3.6rem;
    opacity: 1 !important;
}

.map-viewer-hint {
    color: #64748b;
    font-size: 0.8rem;
}

/* Left-to-right maps are fitted to the box's width and shown at full
   height (the page scrolls), so nothing is cut off inside a scroll box */
.map-viewer .prereq-graph-wrap {
    overflow: auto;
    cursor: grab;
}

.map-viewer .prereq-graph-wrap.is-panning {
    cursor: grabbing;
    user-select: none;
}

.map-viewer .prereq-graph-wrap pre.mermaid {
    margin: 0;
    overflow: visible;
}

/* Full screen: the map fills the window (a fixed overlay, so it also works
   where the browser's Fullscreen API isn't available, e.g. iPhone Safari) */
.map-viewer.map-viewer-full {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    padding: 0.75rem;
}

.map-viewer.map-viewer-full .prereq-graph-wrap {
    flex: 1;
    max-height: none;
}

body.map-viewer-open {
    overflow: hidden;
}

@media print {
    .map-viewer-toolbar {
        display: none;
    }
}

/* ── Prerequisites checked automatically ─────────────────────────────────── */

.auto-prereq-list {
    padding-left: 1.1rem;
    margin-bottom: 0.75rem;
}

.auto-prereq-list li {
    margin-bottom: 0.25rem;
}

/* "Go back and edit": briefly highlight the courses that were added */
.cs-course-check.auto-flash {
    animation: auto-flash 2.4s ease-out;
}

@keyframes auto-flash {
    0%, 35% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.55); background-color: #eff6ff; }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* ── Plan page: courses with no prerequisite links, colored like the map ── */

.prereq-chip {
    font-weight: 500;
    white-space: normal;
    text-align: left;
    border: 1px solid transparent;
}

.prereq-chip-completed { background: #16a34a; color: #ffffff; }
.prereq-chip-next { background: #2563eb; color: #ffffff; }
.prereq-chip-planned { background: #bfdbfe; color: #1e3a5f; border-color: #3b82f6; }
.prereq-chip-external { background: #f1f5f9; color: #475569; border: 1px dashed #cbd5e1; }

/* ── Plan page: the bachelor's degree checks ───────── */

.bachelors-list {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
}

.bachelors-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.bachelors-row:last-child {
    border-bottom: none;
}

.bachelors-icon {
    font-size: 1.05rem;
    line-height: 1.4;
    cursor: help;
}

.bachelors-ok .bachelors-icon { color: #16a34a; }
.bachelors-warn .bachelors-icon { color: #d97706; }
.bachelors-info .bachelors-icon { color: #64748b; }
.bachelors-warn { background: #fffbeb; }

.bachelors-title {
    font-weight: 600;
    color: #0f172a;
}

.bachelors-detail {
    font-size: 0.88rem;
    color: #475569;
}

@media print {
    .plan-bachelors {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}


/* ── Student-feedback round (Nov 2026): clearer guidance, contrast ─────── */

/* Helper text was light gray and easy to miss: darker and a bit larger */
.card .form-text,
.card .text-muted {
    color: #475569 !important;
}

.step-help {
    font-size: 0.95rem;
    color: #1e293b;
    margin: 0 0 0.9rem;
    line-height: 1.5;
}

#plannerAccordion .accordion-button {
    font-size: 1.05rem;
    font-weight: 600;
}

.cs-level-heading {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e3a5f;
}

.requirement-group-title {
    font-weight: 700;
    color: #1e3a5f;
}

.step-next-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Course details on touch screens */
.cs-course-check {
    padding-right: 1.9rem;
}

.cs-info-btn {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    padding: 0.1rem 0.3rem;
    border: 0;
    background: none;
    color: #64748b;
    line-height: 1;
    font-size: 0.9rem;
}

.cs-info-btn:hover,
.cs-info-btn:focus-visible {
    color: #2563eb;
}

.course-popover {
    --bs-popover-max-width: 340px;
    --bs-popover-body-padding-x: 0.85rem;
    --bs-popover-body-padding-y: 0.7rem;
    white-space: pre-line;
    font-size: 0.8rem;
}

/* Step 2: confirmation after Add, and the courses added there */
.course-add-status {
    min-height: 0;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s;
}

.course-add-status.is-visible {
    opacity: 1;
}

.course-add-status-ok { color: #15803d; }
.course-add-status-info { color: #1d4ed8; }
.course-add-status-warn { color: #b45309; }

.step-added {
    margin-top: 0.75rem;
}

.step-added-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.35rem;
}

.step-added-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.4rem 0.2rem 0.65rem;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e3a5f;
    font-size: 0.82rem;
    font-weight: 600;
}

.step-added-chip .btn-close {
    width: 0.55em;
    height: 0.55em;
    padding: 0.2em;
}

/* Step 3: the courses that count toward a row */
.requirement-picks {
    margin-top: 0.45rem;
}

.requirement-picks > summary {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1d4ed8;
    cursor: pointer;
}

.requirement-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.3rem;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 0.45rem;
    padding: 0.6rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.requirement-pick {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.3rem 0.4rem;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #1e293b;
    cursor: pointer;
}

.requirement-pick:hover {
    background: #eff6ff;
}

.requirement-pick .form-check-input {
    flex: 0 0 auto;
    margin-top: 0.15rem;
}

/* Plan page: what the MAJ / GEN / MIN / 2ND tags mean */
.plan-tag-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    margin-bottom: 0.9rem;
    font-size: 0.82rem;
    color: #334155;
}

.plan-tag-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.plan-tag-legend .plan-item-tag {
    margin: 0;
    flex: 0 0 auto;
}

.plan-actions {
    flex-wrap: wrap;
}

.plan-item-row[title] {
    cursor: help;
}

/* Only offer "drag" when there's somewhere to drag to */
.map-viewer .prereq-graph-wrap:not(.can-pan) {
    cursor: default;
}


@media (max-width: 767.98px) {
    .gpa-tab {
        padding: 0.7rem 0.4rem;
    }
    .gpa-tab span {
        display: none;
    }
}

/* ── Cleaner planner: one level of boxes, fewer words ────────────────────── */

/* Major / minor sit straight on the card, not in a panel of their own */
.program-panel {
    border: 0;
    background: none;
    padding: 0;
}

.step-help {
    font-size: 0.92rem;
    color: #334155;
}

/* Step 3: plain rows split by thin lines instead of boxes inside boxes */
.requirement-group {
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1.5rem;
}

.requirement-group:last-of-type {
    margin-bottom: 0;
}

.requirement-group-title {
    margin-bottom: 0.25rem;
}

.requirement-row {
    background: none;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    padding: 0.75rem 0;
    margin: 0;
}

.requirement-row:last-child {
    border-bottom: 0;
}

.requirement-row.requirement-row-complete {
    background: none;
}

.requirement-row-complete .requirement-row-label::after {
    content: "\2713";
    margin-left: 0.4rem;
    color: #16a34a;
}

.requirement-progress {
    height: 4px;
}

/* "Mark complete": a small outlined button, the same height as the hours
   box beside it; "Undo" is the same button in gray */
.requirement-mark-complete {
    /* one width for "Mark complete" and "Undo", so every row lines up */
    width: 7.75rem;
    min-width: 0;
    height: 31px;
    padding: 0 0.75rem;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: none;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.requirement-mark-complete:hover,
.requirement-mark-complete:focus-visible {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.requirement-mark-complete:active {
    background: #dbeafe;
}

.requirement-mark-complete.is-undo {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #475569;
}

.requirement-mark-complete.is-undo:hover,
.requirement-mark-complete.is-undo:focus-visible {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #334155;
}

.requirement-hours-input {
    height: 31px;
    border-radius: 8px;
}

.step-next {
    font-weight: 600;
    text-decoration: none;
}

/* Completed courses: no box around the box */
.completed-box {
    padding: 0;
    border: 0;
    background: none;
}

/* Desktop users hover for course details; the (i) is for touch screens */
@media (hover: hover) and (pointer: fine) {
    .cs-info-btn {
        display: none;
    }
    .cs-course-check {
        padding-right: 0.6rem;
    }
}

/* The progress bar already separates rows; no extra divider line */
.requirement-row {
    border-bottom: 0;
    padding: 0.6rem 0 0.7rem;
}

/* Step 1: course cards sit on the step itself, not in a gray tray */
.cs-course-grid {
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0.1rem 0.2rem 0.2rem 0;
}

/* ── Degree Works import ─────────────────────────────────────────────────── */

.dw-drop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    padding: 0.9rem 1.1rem;
    border: 2px dashed #93c5fd;
    border-radius: 14px;
    background: #f8fbff;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.dw-drop > .bi {
    font-size: 1.5rem;
    color: #2563eb;
}

.dw-private {
    font-size: 0.8rem;
    color: #475569;
    white-space: nowrap;
}

.dw-drop:hover,
.dw-drop.is-dragging,
#dw-file:focus-visible + .dw-drop {
    background: #eff6ff;
    border-color: #2563eb;
}

.dw-drop.is-dragging {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.dw-status {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1d4ed8;
}

.dw-status-ok { color: #15803d; }
.dw-status-warn { color: #b45309; }

.dw-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem 1rem;
    margin-bottom: 1rem;
}

.dw-summary dt {
    font-weight: 600;
    color: #334155;
}

.dw-summary dd {
    margin: 0;
}

.dw-heading {
    margin: 0.9rem 0 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e3a5f;
}

.dw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.dw-chip {
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a5f;
    font-size: 0.8rem;
    font-weight: 600;
}

.dw-chip-ip {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.dw-note {
    font-size: 0.85rem;
    color: #475569;
}

.dw-plan-note {
    font-size: 0.88rem;
    color: #166534;
}

.plan-done {
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

/* ── Degree Works card: its own box above the planner ─────────────────────── */

.dw-card {
    margin-bottom: 1.5rem;
    padding: 1rem;
}

.dw-card .dw-drop {
    flex-wrap: nowrap;
    gap: 1.25rem;
    padding: 1.4rem 1.6rem;
    border-radius: 18px;
}

.dw-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.dw-text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dw-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

.dw-sub {
    font-size: 0.95rem;
    color: #475569;
}

.dw-action {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.dw-button {
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}

.dw-card .dw-status {
    margin: 0.75rem 0.4rem 0.1rem;
}

@media (max-width: 760px) {
    .dw-card .dw-drop {
        flex-direction: column;
        text-align: center;
        padding: 1.4rem 1.1rem;
    }
}

/* ── First visit: the Degree Works box and the planner fill the screen,
      so the footer starts below it ─────────────────────────────────────── */

body.first-visit main {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 110px);
    padding-bottom: 3rem;
}

body.first-visit .dw-card {
    padding: 1.25rem;
}

body.first-visit .dw-card .dw-drop {
    flex: 1 1 auto;
    gap: 2rem;
    padding: 2.5rem 3rem;
    border-radius: 22px;
}

body.first-visit .dw-icon {
    width: 5rem;
    height: 5rem;
    font-size: 2.2rem;
}

body.first-visit .dw-title {
    font-size: 1.65rem;
}

body.first-visit .dw-sub {
    font-size: 1.1rem;
}

body.first-visit .dw-button {
    padding: 0.8rem 1.8rem;
    font-size: 1.1rem;
}

@media (max-width: 760px) {
    body.first-visit .dw-card .dw-drop {
        gap: 0.9rem;
        padding: 2rem 1.25rem;
    }
    body.first-visit .dw-title {
        font-size: 1.35rem;
    }
}

/* Step 3: a row courses or Degree Works fill shows "done", not a 0 box */
.requirement-done-label {
    display: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: #15803d;
    white-space: nowrap;
}

.requirement-row.is-auto-done .requirement-hours-input,
.requirement-row.is-auto-done .requirement-hours-max,
.requirement-row.is-auto-done .requirement-mark-complete {
    display: none;
}

.requirement-row.is-auto-done .requirement-done-label {
    display: inline;
}

/* The label's own check mark is enough when "done" shows */
.requirement-row.is-auto-done .requirement-row-label::after {
    content: none;
}

/* Degree Works box once an audit is in use */
.dw-loaded {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1rem 1.4rem;
    border: 1px solid #bbf7d0;
    border-radius: 18px;
    background: #f0fdf4;
}

.dw-icon.dw-icon-done {
    width: 2.8rem;
    height: 2.8rem;
    font-size: 1.4rem;
    background: #16a34a;
    box-shadow: none;
}

.dw-loaded .dw-title {
    font-size: 1.05rem;
}

.dw-loaded .dw-sub {
    font-size: 0.88rem;
}

.dw-loaded-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dw-replace {
    border-radius: 999px;
    margin: 0;
}

.dw-remove {
    color: #475569;
}

@media (max-width: 760px) {
    .dw-loaded {
        flex-wrap: wrap;
    }
    .dw-loaded-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* "No PDF yet?" -- where Degree Works' Create PDF button is */
.dw-howto {
    padding: 0.7rem 0.6rem 0.1rem;
}

.dw-howto-line {
    font-size: 0.88rem;
    color: #475569;
}

.dw-howto-line > .bi {
    color: #2563eb;
    margin-right: 0.2rem;
}

.dw-chip-print {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.05rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #1e3a8a;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.dw-howto-toggle {
    padding: 0 0.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    vertical-align: baseline;
}

.dw-howto-panel {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

/* A drawing of Degree Works' top-right buttons, arrow on the printer */
.dw-art {
    position: relative;
    flex: 0 0 auto;
    width: 190px;
    height: 112px;
}

.dw-art-bar {
    position: absolute;
    top: 8px;
    right: 6px;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.dw-art-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #475569;
    font-size: 1.15rem;
}

.dw-art-target {
    color: #1d4ed8;
    background: #eff6ff;
    box-shadow: 0 0 0 2px #2563eb;
}

.dw-art-arrow {
    position: absolute;
    left: 14px;
    top: 30px;
    width: 64px;
    height: 48px;
    color: #f59e0b;
}

.dw-art-tip {
    position: absolute;
    left: 6px;
    bottom: 4px;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: #374151;
    color: #ffffff;
    font-size: 0.8rem;
    white-space: nowrap;
}

.dw-howto-steps {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.6;
}

@media (max-width: 760px) {
    .dw-howto-panel {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* GPA calculator: which courses the What-if list shows */
.gpa-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.gpa-source {
    padding: 0.2rem 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
}

.gpa-source:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
}

.gpa-source.is-active {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

/* ── Planner card: plain and well set ────────────────────────────────────── */

.planner-main {
    background: #ffffff;
    padding: 2.5rem 2.75rem;
}

.planner-title {
    margin: 0 0 1.75rem;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.program-panel {
    gap: 1.25rem 2rem;
}

.program-label {
    margin-bottom: 0.45rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.program-optional {
    margin-left: 0.15rem;
    font-weight: 400;
    color: #64748b;
}

.combo-input.form-control {
    min-height: 3rem;
    padding-left: 1rem;
    border-color: #cbd5e1;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.combo-input.form-control::placeholder {
    color: #94a3b8;
}

.combo-input.form-control:hover {
    border-color: #94a3b8;
}

.combo-input.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.combo-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 10px;
}

.program-info {
    margin-top: 0.5rem;
}

@media (max-width: 760px) {
    .planner-main {
        padding: 1.75rem 1.25rem;
    }
    .planner-title {
        font-size: 1.45rem;
        margin-bottom: 1.25rem;
    }
}

.dw-card {
    background: #ffffff;
}

/* ── Plan page: one consistent look ─────────────────────────────────────────
   Plain section headings, one divider between sections, one button style,
   neutral cards. */

.plan-card {
    background: #ffffff;
    padding: 2.5rem 2.75rem;
}

.plan-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.plan-header-text {
    min-width: 0;
}

.plan-title {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.plan-subtitle {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    color: #475569;
}

.plan-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

/* One button style for the page; the main action is filled */
.plan-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: none;
    color: #1e293b;
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
}

.plan-btn:hover,
.plan-btn:focus-visible {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #0f172a;
}

.plan-btn-primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.plan-btn-primary:hover,
.plan-btn-primary:focus-visible {
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: #ffffff;
}

/* Progress summary: no tinted box, just the ring and bars */
.progress-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 0 !important;
}

.progress-summary-detail h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
}

/* Sections: same heading, same spacing, one thin line between them */
.plan-section {
    margin: 0 !important;
    padding: 2rem 0 0;
    margin-top: 2rem !important;
    border-top: 1px solid #e2e8f0;
}

.plan-section-title {
    margin: 0 0 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #0f172a;
}

.plan-subsection-title {
    margin-top: 1.75rem;
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
}

.plan-section > .text-muted:first-of-type {
    margin-top: -0.5rem;
}

/* Next step: a plain card, buttons side by side */
.next-step-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 12px;
    background: #ffffff;
    color: #1e293b;
}

.next-step-title {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}

.next-step-sub {
    margin: 0 0 0.6rem;
    font-size: 0.9rem;
    color: #475569;
}

.next-step-courses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.next-course-badge {
    padding: 0.2rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 600;
}

.next-step-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Plan overview */
.plan-tag-legend {
    gap: 0.4rem 1.1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #64748b;
}

.plan-tag-hint {
    color: #94a3b8;
}

.term-grid-single {
    grid-template-columns: minmax(0, 1fr) !important;
}

.term-card {
    border-radius: 12px;
}

.term-card-header {
    background: #f8fafc;
}

.term-card-header .badge {
    padding: 0.25rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff !important;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Completed courses: one folded, tidy list */
.plan-fold > summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    cursor: pointer;
    list-style: none;
}

.plan-fold > summary::-webkit-details-marker {
    display: none;
}

.plan-fold > summary::after {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    margin-left: 0.35rem;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.15s;
}

.plan-fold[open] > summary::after {
    transform: rotate(-135deg) translateY(-2px);
}

.plan-count {
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
}

.completed-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0 2rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.completed-list li {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.completed-code {
    flex: 0 0 5.2rem;
    font-weight: 600;
    color: #0f172a;
}

.completed-title {
    flex: 1 1 auto;
    min-width: 0;
    color: #334155;
}

.completed-hours {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 0.82rem;
}

@media (max-width: 860px) {
    .plan-card {
        padding: 1.75rem 1.25rem;
    }
    .plan-header {
        flex-direction: column;
    }
    .plan-actions {
        flex-wrap: wrap;
        width: 100%;
    }
    .plan-actions .plan-btn {
        flex: 1 1 auto;
    }
}

@media print {
    .plan-section {
        border-top: none;
        padding-top: 0.5rem;
    }
    .plan-fold > summary::after {
        display: none;
    }
}

/* Requirement details: quiet hour counts, green when met */
#auditAccordion .accordion-button .badge {
    padding: 0.25rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff !important;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
}

#auditAccordion .accordion-button .badge.bg-success {
    border-color: #bbf7d0;
    background: #f0fdf4 !important;
    color: #15803d;
}
