* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f2f2f7;
    color: #1d1d1f;
    min-height: 100vh;
    padding: 2.5rem 1.5rem;
    font-size: 16px;
    line-height: 1.6;
}

.container {
    max-width: 920px;
    margin: 0 auto;
}

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

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.02em;
}

.subtitle {
    color: #86868b;
    font-size: 1rem;
    margin-top: 0.3rem;
}

/* Disclaimer */
.disclaimer {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    font-size: 0.9rem;
    color: #92400e;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: center;
}

/* Card */
.card {
    background: #fff;
    border: 1px solid #e5e5ea;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* Step labels */
.step-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0071e3;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}

/* Selection grid */
.select-grid {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.select-group {
    flex: 1;
    min-width: 260px;
}

.select-group > label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #3a3a3c;
    margin-bottom: 0.6rem;
}

.radio-cards {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.radio-card {
    display: flex !important;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    background: #f5f5f7;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.95rem;
    font-weight: 600;
    color: #3a3a3c;
    margin-bottom: 0;
}

.radio-card:has(input:checked) {
    border-color: #0071e3;
    background: #e8f0fe;
    color: #0071e3;
}

.radio-card input {
    display: none;
}

.radio-card:hover {
    background: #e5e5ea;
}

.total-preview {
    font-size: 0.95rem;
    color: #86868b;
    padding: 0.8rem 0 0;
    font-weight: 500;
}

/* Hint box */
.hint-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
    color: #1e40af;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.example-toggle {
    margin-top: 0.6rem;
}

.example-toggle summary {
    cursor: pointer;
    font-size: 0.9rem;
    color: #1d4ed8;
    font-weight: 600;
}

.example-toggle summary:hover {
    text-decoration: underline;
}

.example-img {
    margin-top: 0.6rem;
    width: 100%;
    border-radius: 10px;
    border: 1px solid #d2d2d7;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.hint-box kbd {
    background: #fff;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    padding: 0.15rem 0.5rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
}

label {
    display: block;
    font-size: 1rem;
    color: #6e6e73;
    margin-bottom: 0.5rem;
}

textarea {
    width: 100%;
    height: 220px;
    background: #f9fafb;
    border: 2px solid #e5e5ea;
    border-radius: 12px;
    color: #1d1d1f;
    font-family: "SF Mono", "Fira Code", "Menlo", monospace;
    font-size: 0.85rem;
    padding: 1rem 1.2rem;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: #0071e3;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
    background: #fff;
}

textarea::placeholder {
    color: #aeaeb2;
}

.btn-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

button {
    padding: 0.75rem 2.2rem;
    background: #0071e3;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button:hover {
    background: #0077ed;
}

button:active {
    background: #006edb;
    transform: scale(0.98);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #6e6e73;
    cursor: pointer;
    font-weight: 500;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0071e3;
}

/* Summary */
#summary-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.summary-item {
    flex: 1;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e5e5ea;
    border-radius: 14px;
    padding: 1.4rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.summary-item .label {
    font-size: 0.9rem;
    color: #86868b;
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.summary-item .value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.summary-item .value.complete {
    color: #34c759;
}

.summary-item .value.incomplete {
    color: #ff3b30;
}

/* Missing summary */
#missing-section {
    margin-bottom: 1.5rem;
}

#missing-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff3b30;
    margin-bottom: 0.6rem;
}

#missing-summary {
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 14px;
    padding: 0.6rem 1.2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.missing-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0;
    font-size: 0.95rem;
    border-bottom: 1px solid #f3f3f5;
}

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

.missing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff3b30;
    flex-shrink: 0;
}

.missing-course {
    font-weight: 600;
    color: #1d1d1f;
}

.missing-cat {
    color: #86868b;
    font-size: 0.85rem;
    margin-left: auto;
}

.missing-credits {
    color: #ff3b30;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    min-width: 3.5rem;
    text-align: right;
}

/* Overflow (excess credits) */
#overflow-section {
    margin-bottom: 1.5rem;
}

#overflow-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff9f0a;
    margin-bottom: 0.6rem;
}

#overflow-summary {
    background: #fff;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    padding: 0.6rem 1.2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.overflow-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0;
    font-size: 0.95rem;
    border-bottom: 1px solid #f3f3f5;
}

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

.overflow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff9f0a;
    flex-shrink: 0;
}

.overflow-cat {
    font-weight: 600;
    color: #1d1d1f;
}

.overflow-detail {
    color: #86868b;
    font-size: 0.85rem;
    margin-left: auto;
}

.overflow-excess {
    color: #ff9f0a;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Section */
.section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 2px solid #e5e5ea;
    margin-bottom: 0.8rem;
}

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.section-header .credits-badge {
    font-size: 1rem;
    font-weight: 700;
}

/* Category */
.category {
    background: #fff;
    border: 1px solid #e5e5ea;
    border-radius: 14px;
    margin-bottom: 0.7rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.category-header:hover {
    background: #f5f5f7;
}

.category-header .left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.category-header .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.done {
    background: #34c759;
}

.status-dot.partial {
    background: #ff9f0a;
}

.status-dot.missing {
    background: #ff3b30;
}

.category-header .cat-name {
    font-size: 1rem;
    font-weight: 600;
}

.category-header .right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-text {
    font-size: 0.9rem;
    color: #86868b;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.progress-bar-bg {
    width: 100px;
    height: 6px;
    background: #e5e5ea;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-bar-fill.done {
    background: #34c759;
}

.progress-bar-fill.partial {
    background: #ff9f0a;
}

.progress-bar-fill.missing {
    background: #ff3b30;
}

.chevron {
    color: #aeaeb2;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.category.open .chevron {
    transform: rotate(90deg);
}

.category-body {
    display: none;
    padding: 0 1.2rem 1.2rem;
    border-top: 1px solid #e5e5ea;
}

.category.open .category-body {
    display: block;
}

/* Subcategory */
.subcategory {
    margin-top: 1rem;
}

.subcat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.subcat-header .name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1d1d1f;
}

.subcat-header .credits {
    font-size: 0.9rem;
    color: #86868b;
    font-weight: 600;
}

/* Course list */
.course-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #f3f3f5;
}

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

.course-item .name {
    color: #1d1d1f;
    font-weight: 500;
}

.course-item .code {
    color: #aeaeb2;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.course-item .meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
}

.course-item .credits {
    color: #86868b;
    font-weight: 500;
}

.course-item .score {
    color: #86868b;
    min-width: 2.5rem;
    text-align: right;
    font-weight: 500;
}

/* Score hiding */
body.hide-scores .course-item .score {
    filter: blur(8px);
    user-select: none;
}

/* Required course checklist */
.req-course {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0;
    font-size: 0.9rem;
}

.req-course .check {
    width: 20px;
    height: 20px;
    border: 2px solid #d2d2d7;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
}

.req-course .check.done {
    background: #34c759;
    border-color: #34c759;
    color: #fff;
}

.req-course .check.missing {
    border-color: #ff3b30;
}

.req-course .name {
    font-weight: 500;
}

.req-course.is-missing .name {
    color: #ff3b30;
    font-weight: 600;
}

.note {
    font-size: 0.85rem;
    color: #aeaeb2;
    margin-top: 0.4rem;
    font-style: italic;
}

/* Uncategorized */
#uncategorized-section {
    margin-top: 1.5rem;
}

#uncategorized-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff9f0a;
    margin-bottom: 0.4rem;
}

#uncategorized {
    background: #fff;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    padding: 0.8rem 1.2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
