body.notes-curriculum-page {
    --notes-accent-a: #5f8fff;
    --notes-accent-b: #37c8a7;
    --notes-accent-c: #f0b55a;
}

.notes-summary-shell,
.notes-group-card,
.notes-term-card,
.notes-legacy-shell,
.notes-resource-card,
.notes-unit-card {
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--border-color-strong) 88%, transparent);
    border-radius: 22px;
    background:
        linear-gradient(176deg, color-mix(in srgb, var(--surface-solid) 90%, transparent), color-mix(in srgb, var(--surface) 98%, transparent)),
        color-mix(in srgb, var(--surface) 98%, transparent);
    box-shadow:
        0 18px 34px -28px rgba(17, 28, 45, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.notes-summary-shell::before,
.notes-group-card::before,
.notes-term-card::before,
.notes-legacy-shell::before,
.notes-resource-card::before,
.notes-unit-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--accent-soft) 68%, transparent) 0%, transparent 36%),
        radial-gradient(circle at bottom left, color-mix(in srgb, var(--commerce-accent-soft) 66%, transparent) 0%, transparent 38%);
    opacity: 0.44;
    pointer-events: none;
}

html[data-theme="dark"] .notes-summary-shell,
html[data-theme="dark"] .notes-group-card,
html[data-theme="dark"] .notes-term-card,
html[data-theme="dark"] .notes-legacy-shell,
html[data-theme="dark"] .notes-resource-card,
html[data-theme="dark"] .notes-unit-card {
    border-color: rgba(95, 122, 161, 0.3);
    background:
        linear-gradient(180deg, rgba(14, 22, 35, 0.96), rgba(11, 18, 30, 0.94)),
        rgba(11, 18, 30, 0.92);
    box-shadow:
        0 28px 58px -44px rgba(0, 0, 0, 0.68),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .notes-summary-shell::before,
html[data-theme="dark"] .notes-group-card::before,
html[data-theme="dark"] .notes-term-card::before,
html[data-theme="dark"] .notes-legacy-shell::before,
html[data-theme="dark"] .notes-resource-card::before,
html[data-theme="dark"] .notes-unit-card::before {
    background:
        radial-gradient(circle at top right, rgba(95, 143, 255, 0.14) 0%, transparent 38%),
        radial-gradient(circle at bottom left, rgba(55, 200, 167, 0.1) 0%, transparent 40%);
    opacity: 0.5;
}

.notes-summary-grid,
.notes-term-grid,
.notes-unit-list,
.notes-resource-list {
    display: flex;
    flex-direction: column;
    gap: 0.56rem;
    min-width: 0;
}

.notes-summary-shell,
.notes-group-card,
.notes-legacy-shell {
    padding: 0.72rem;
}

.notes-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.58rem;
    position: relative;
    z-index: 1;
}

.notes-summary-stat {
    border: 1px solid color-mix(in srgb, var(--border-color) 92%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-solid) 74%, transparent);
    padding: 0.42rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.notes-summary-stat__label {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 760;
}

.notes-summary-stat__value {
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.notes-summary-grid .notes-summary-stat:nth-child(1) .notes-summary-stat__value {
    color: var(--notes-accent-a);
}

.notes-summary-grid .notes-summary-stat:nth-child(2) .notes-summary-stat__value {
    color: var(--text-primary);
}

.notes-summary-grid .notes-summary-stat:nth-child(3) .notes-summary-stat__value {
    color: var(--notes-accent-b);
}

.notes-chip,
.notes-link-btn {
    position: relative;
    z-index: 1;
}

.notes-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.26rem 0.72rem;
    border-radius: var(--radius-pill);
    border: 1px solid color-mix(in srgb, var(--border-color) 92%, transparent);
    background: color-mix(in srgb, var(--surface-muted) 86%, transparent);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.4;
}

.notes-chip--term,
.notes-chip--ok {
    border-color: color-mix(in srgb, var(--accent-color) 22%, transparent);
    background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface-solid));
    color: var(--accent-strong);
}

.notes-chip--soft {
    background: color-mix(in srgb, var(--surface-solid) 76%, transparent);
    color: var(--text-tertiary);
}

.notes-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    min-height: 34px;
    padding: 0.38rem 0.76rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--accent-color) 22%, transparent);
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 34%, transparent), transparent 80%),
        color-mix(in srgb, var(--surface-solid) 74%, transparent);
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 840;
    text-decoration: none;
    transition:
        transform var(--motion-fast) var(--motion-ease-standard),
        border-color var(--motion-fast) var(--motion-ease-standard),
        background var(--motion-fast) var(--motion-ease-standard);
}

.notes-link-btn--muted {
    border-color: color-mix(in srgb, var(--border-color) 92%, transparent);
    background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
    color: var(--text-tertiary);
}

.notes-inline-actions {
    display: flex;
    align-items: center;
    gap: 0.46rem;
    flex-wrap: wrap;
}

.notes-term-card {
    padding: 0;
}

.notes-term-card__link {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    padding: 0.66rem 0.72rem;
    color: inherit;
    text-decoration: none;
    position: relative;
    z-index: 1;
}

.notes-term-card__head,
.notes-group-card__head,
.notes-unit-card__head,
.notes-resource-card__head,
.notes-legacy-shell__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.46rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.notes-term-card__title,
.notes-group-card__title,
.notes-unit-card__title,
.notes-resource-card__title,
.notes-legacy-shell__title {
    margin: 0;
    color: var(--text-primary);
    font-family: var(--font-accent);
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.38;
}

.notes-term-card__desc,
.notes-group-card__desc,
.notes-unit-card__desc,
.notes-resource-card__desc,
.notes-legacy-shell__desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.58;
    position: relative;
    z-index: 1;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.notes-term-card__desc {
    -webkit-line-clamp: 1;
}

.notes-term-card__preview,
.notes-resource-card__meta,
.notes-unit-card__preview,
.notes-term-card__stats,
.notes-unit-card__stats {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.notes-term-card__preview,
.notes-unit-card__preview {
    display: none;
}

.notes-group-card {
    display: flex;
    flex-direction: column;
    gap: 0.56rem;
}

.notes-unit-card,
.notes-resource-card {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    padding: 0.68rem 0.72rem;
}

.notes-unit-card__action,
.notes-resource-card__action {
    align-self: flex-start;
}

.notes-term-card__stats .notes-summary-stat,
.notes-unit-card__stats .notes-summary-stat {
    padding: 0.34rem 0.44rem;
    border-radius: 12px;
    min-width: 58px;
}

.notes-term-card__stats .notes-summary-stat__label,
.notes-unit-card__stats .notes-summary-stat__label {
    font-size: 0.6rem;
}

.notes-term-card__stats .notes-summary-stat__value,
.notes-unit-card__stats .notes-summary-stat__value {
    font-size: 0.78rem;
}

.notes-legacy-shell {
    display: flex;
    flex-direction: column;
    gap: 0.88rem;
}

.notes-curriculum-page[data-notes-view="unit"] .hero-title,
.notes-curriculum-page[data-notes-view="legacy-term"] .hero-title {
    max-width: 18ch;
    margin-inline: auto;
}

.notes-curriculum-page[data-notes-view="unit"] .archive-term,
.notes-curriculum-page[data-notes-view="legacy-term"] .archive-term {
    gap: 0.82rem;
}

.notes-curriculum-page #notes-home-list,
.notes-curriculum-page #notes-term-cards {
    position: relative;
    min-width: 0;
}

@media (hover: hover) and (pointer: fine) {
    .notes-link-btn:hover,
    .notes-term-card__link:hover {
        transform: translateY(-1px);
    }
}

.notes-link-btn:focus-visible,
.notes-term-card__link:focus-visible {
    transform: translateY(-1px);
}

@media (min-width: 721px) {
    .notes-term-card__link {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.32rem 0.7rem;
        align-items: center;
    }

    .notes-term-card__head,
    .notes-term-card__desc,
    .notes-term-card__stats {
        grid-column: 1 / 2;
    }

    .notes-term-card__link > .notes-link-btn {
        grid-column: 2 / 3;
        grid-row: 1 / span 3;
        justify-self: end;
        align-self: center;
        white-space: nowrap;
    }

    .notes-unit-card,
    .notes-resource-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.3rem 0.7rem;
        align-items: center;
    }

    .notes-unit-card__head,
    .notes-unit-card__desc,
    .notes-unit-card__stats,
    .notes-resource-card__head,
    .notes-resource-card__desc,
    .notes-resource-card__meta {
        grid-column: 1 / 2;
    }

    .notes-unit-card__action,
    .notes-resource-card__action {
        grid-column: 2 / 3;
        grid-row: 1 / span 3;
        justify-self: end;
        align-self: center;
        white-space: nowrap;
    }
}

@media (max-width: 720px) {
    .notes-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .notes-summary-shell,
    .notes-group-card,
    .notes-legacy-shell,
    .notes-term-card__link,
    .notes-unit-card,
    .notes-resource-card {
        padding: 0.68rem;
    }

    .notes-term-card__title,
    .notes-group-card__title,
    .notes-unit-card__title,
    .notes-resource-card__title,
    .notes-legacy-shell__title {
        font-size: 0.86rem;
    }

    .notes-term-card__link > .notes-link-btn,
    .notes-unit-card__action .notes-link-btn,
    .notes-resource-card__action .notes-link-btn {
        width: auto;
        min-width: 0;
    }

    .notes-inline-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .notes-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .notes-link-btn,
    .notes-term-card__link {
        transition: none;
    }
}

html[data-performance-mode="lite"] .notes-summary-shell,
html[data-performance-mode="lite"] .notes-group-card,
html[data-performance-mode="lite"] .notes-term-card,
html[data-performance-mode="lite"] .notes-legacy-shell,
html[data-performance-mode="lite"] .notes-resource-card,
html[data-performance-mode="lite"] .notes-unit-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
