.gpa-tool-form {
    --gpa-primary: #4f46e5;
    --gpa-primary-soft: #eef2ff;
    --gpa-warm: #ffd9b3;
    --gpa-border: rgba(79, 70, 229, .14);
    --gpa-shadow: 0 18px 45px rgba(15, 23, 42, .055);
}

.gpa-builder,
.gpa-result-shell {
    display: grid;
    gap: 1rem;
}

.gpa-section,
.gpa-course-card,
.gpa-details-toggle {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gpa-border);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .98) 0%, rgba(238, 242, 255, .38) 100%);
    box-shadow: var(--gpa-shadow);
}

.gpa-section {
    padding: 1.05rem;
}

.gpa-section-has-course-list,
.gpa-course-card {
    overflow: visible;
}

.gpa-course-card {
    padding: 1rem;
}

.gpa-section::before,
.gpa-course-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--gpa-primary), var(--gpa-primary-soft), var(--gpa-warm));
    pointer-events: none;
}

.gpa-section-head,
.gpa-course-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.gpa-section-head h5 {
    margin: .15rem 0 0;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.02em;
}

.gpa-section-copy {
    margin: .25rem 0 0;
    color: #64748b;
    font-size: .9rem;
    line-height: 1.45;
}

.gpa-add-btn {
    border-radius: 999px;
    color: var(--gpa-primary);
    font-weight: 800;
    white-space: nowrap;
    border-color: var(--gpa-border);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.gpa-course-list {
    display: grid;
    gap: .85rem;
    margin-top: 1rem;
}

.gpa-course-card-head {
    margin-bottom: .95rem;
    padding-bottom: .85rem;
    border-bottom: 1px dashed rgba(15, 23, 42, .10);
}

.gpa-card-title {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

.gpa-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--gpa-primary-soft);
    color: var(--gpa-primary);
    font-weight: 900;
}

.gpa-card-title strong {
    display: block;
    color: #0f172a;
    font-weight: 850;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.gpa-card-title small {
    display: block;
    color: #64748b;
    margin-top: .15rem;
}

.gpa-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(79, 70, 229, .14);
    background: rgba(255, 255, 255, .95);
    color: #64748b;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    flex: 0 0 auto;
    transition: transform .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.gpa-icon-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(79, 70, 229, .24);
    color: var(--gpa-primary);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

.gpa-icon-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.gpa-grade-select {
    z-index: 20;
}

.gpa-grade-select.is-open {
    z-index: 120;
}

.gpa-grade-select .custom-select-menu {
    z-index: 125;
}

.gpa-summary-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gpa-border);
    border-radius: 24px;
    padding: 1.25rem;
    background:
        radial-gradient(circle at top right, rgba(255, 217, 179, .62), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, .99) 0%, rgba(238, 242, 255, .52) 100%);
    box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}

.gpa-summary-card::after {
    content: "";
    position: absolute;
    width: 130px;
    height: 130px;
    right: -46px;
    bottom: -60px;
    border-radius: 999px;
    background: rgba(255, 217, 179, .42);
    pointer-events: none;
}

.gpa-summary-value {
    font-size: clamp(1.85rem, 3vw, 2.75rem);
    line-height: 1.1;
    font-weight: 850;
    color: #0f172a;
    letter-spacing: -.045em;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.gpa-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
}

.gpa-mini-card {
    position: relative;
    height: 100%;
    border-radius: 22px;
    padding: 18px;
    background: rgba(255, 255, 255, .95);
    border: 1px solid rgba(79, 70, 229, .12);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .055);
}

.gpa-mini-card::before {
    content: "";
    display: block;
    width: 34px;
    height: 4px;
    border-radius: 999px;
    background: var(--gpa-warm);
    margin-bottom: 12px;
}

.gpa-mini-card small {
    color: #64748b;
    display: block;
    margin-bottom: 7px;
    font-size: .8rem;
    font-weight: 700;
}

.gpa-mini-card strong {
    display: block;
    color: #0f172a;
    font-size: 1.15rem;
    line-height: 1.2;
    letter-spacing: -.03em;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.gpa-weighted-point-card {
    max-width: 420px;
}

.gpa-course-result-list {
    display: grid;
    gap: .7rem;
}

.gpa-course-result-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    border-radius: 18px;
    background: rgba(238, 242, 255, .42);
    border: 1px solid rgba(79, 70, 229, .10);
    border-left: 4px solid var(--gpa-primary);
    padding: .85rem .95rem;
}

.gpa-course-result-item strong {
    display: block;
    color: #0f172a;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.gpa-course-result-item small {
    display: block;
    color: #64748b;
    margin-top: .15rem;
}

.gpa-course-result-score {
    color: var(--gpa-primary);
    font-size: 1.05rem;
    font-weight: 850;
    overflow-wrap: anywhere;
    white-space: nowrap;
}

.gpa-empty-state {
    color: #64748b;
    font-weight: 750;
    padding: .25rem 0;
}

.gpa-details-toggle {
    padding: .95rem 1rem;
}

.gpa-details-toggle > summary {
    cursor: pointer;
    font-weight: 850;
    color: #1e293b;
    list-style: none;
}

.gpa-details-toggle > summary::-webkit-details-marker {
    display: none;
}

.gpa-details-toggle > summary::marker {
    content: "";
}

.gpa-details-toggle > summary::after {
    content: "+";
    float: right;
    font-size: 1.1rem;
}

.gpa-details-toggle[open] > summary {
    color: var(--gpa-primary);
}

.gpa-details-toggle[open] > summary::after {
    content: "−";
}

.gpa-section:focus-within,
.gpa-course-card:focus-within {
    border-color: rgba(79, 70, 229, .24);
    box-shadow: 0 20px 48px rgba(79, 70, 229, .08);
}

@media (max-width: 991.98px) {
    .gpa-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .gpa-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .gpa-add-btn,
    .gpa-detail-grid,
    .gpa-weighted-point-card {
        width: 100%;
        max-width: none;
    }

    .gpa-detail-grid,
    .gpa-course-result-item {
        grid-template-columns: 1fr;
    }

    .gpa-course-result-score {
        white-space: normal;
    }
}
