/* College details: "Courses & fees" (prefix agd-crs-). Tokens from css/site/tokens.css; dark via html[data-theme="dark"].
   No dots: solid hairlines, gradient accents, soft glows; transform/opacity motion only. */
.agd-crs { position: relative; }

/* Level palette (index from the level order, 0-5), light + dark */
.agd-crs { --lv0: #05664F; --lv0b: #12A37A; --lv1: #2563EB; --lv1b: #60A5FA; --lv2: #7C3AED; --lv2b: #A78BFA;
           --lv3: #C2410C; --lv3b: #F59E0B; --lv4: #0E7490; --lv4b: #22D3EE; --lv5: #BE185D; --lv5b: #F472B6; }
html[data-theme="dark"] .agd-crs { --lv0: #34D399; --lv0b: #6EE7B7; --lv1: #60A5FA; --lv1b: #93C5FD; --lv2: #A78BFA; --lv2b: #C4B5FD;
           --lv3: #FB923C; --lv3b: #FCD34D; --lv4: #22D3EE; --lv4b: #67E8F9; --lv5: #F472B6; --lv5b: #F9A8D4; }
.agd-crs [data-lv="0"] { --lv: var(--lv0); --lvb: var(--lv0b); }
.agd-crs [data-lv="1"] { --lv: var(--lv1); --lvb: var(--lv1b); }
.agd-crs [data-lv="2"] { --lv: var(--lv2); --lvb: var(--lv2b); }
.agd-crs [data-lv="3"] { --lv: var(--lv3); --lvb: var(--lv3b); }
.agd-crs [data-lv="4"] { --lv: var(--lv4); --lvb: var(--lv4b); }
.agd-crs [data-lv="5"] { --lv: var(--lv5); --lvb: var(--lv5b); }


/* Slim header row: title + count, level pills, search */
.agd-crs { container: agdcrs / inline-size; }
.agd-crs-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .6rem; min-width: 0; }
.agd-crs .agd-crs-h { margin: 0; font-size: 1.2rem; flex: 0 0 auto; display: inline-flex; align-items: center; }
.agd-crs .agd-crs-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 1.7rem; height: 1.35rem; padding: 0 .45rem; margin-left: .4rem;
    border-radius: 999px; background: var(--ag-grad); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1;
}
.agd-crs-tabs {
    flex: 1 1 14rem; min-width: 0; display: flex; gap: .3rem; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px;
}
.agd-crs-tabs::-webkit-scrollbar { display: none; }
.agd-crs-tab {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; height: 1.85rem; padding: 0 .7rem;
    border: 1px solid var(--ag-line); border-radius: 999px; background: var(--ag-surface); color: var(--ag-text);
    font: 600 .78rem/1 var(--ag-font); white-space: nowrap; cursor: pointer;
    transition: background-color .2s var(--ag-ease), border-color .2s var(--ag-ease), color .2s var(--ag-ease);
}
.agd-crs-tab:hover { border-color: color-mix(in srgb, var(--lv, var(--ag-brand)) 45%, var(--ag-line)); color: var(--ag-ink); }
.agd-crs-tab:focus-visible { outline: 2px solid var(--ag-brand); outline-offset: 1px; }
.agd-crs-tab-n {
    min-width: 1.2rem; padding: .15rem .3rem; border-radius: 999px; text-align: center; font-size: .68rem; font-weight: 700;
    background: color-mix(in srgb, var(--lv, var(--ag-brand)) 13%, transparent); color: var(--lv, var(--ag-brand)); font-variant-numeric: tabular-nums;
}
.agd-crs-tab.is-active { background: var(--ag-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 12px var(--ag-glow); }
.agd-crs-tab.is-active .agd-crs-tab-n { background: rgba(255, 255, 255, .22); color: #fff; }

.agd-crs-search { position: relative; flex: 0 1 15rem; min-width: min(100%, 10rem); margin-left: auto; }
.agd-crs-search-ico { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--ag-muted); font-size: .8rem; pointer-events: none; }
.agd-crs-search-input {
    width: 100%; height: 2rem; padding: 0 2rem 0 1.9rem; border: 1px solid var(--ag-line); border-radius: 999px;
    background: var(--ag-surface); color: var(--ag-ink); font: 500 .82rem/1 var(--ag-font);
    transition: border-color .2s var(--ag-ease), box-shadow .2s var(--ag-ease);
}
.agd-crs-search-input::-webkit-search-cancel-button { display: none; }
.agd-crs-search-input::placeholder { color: var(--ag-muted); }
.agd-crs-search-input:focus { outline: none; border-color: var(--ag-brand); box-shadow: 0 0 0 3px var(--ag-brand-soft); }
.agd-crs-clear {
    position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); width: 1.5rem; height: 1.5rem; display: grid; place-items: center;
    border: 0; border-radius: 50%; background: var(--ag-surface-2); color: var(--ag-muted); font-size: .65rem; cursor: pointer;
}
.agd-crs-clear[hidden] { display: none; }
.agd-crs-status { margin: 0 0 .4rem; color: var(--ag-muted); font-size: .76rem; }

/* Dense table-like list (CSS grid rows, never a wide table) */
.agd-crs-thead, .agd-crs-item {
    display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem 6.5rem minmax(6.5rem, 9.5rem) 2rem;
    grid-template-areas: "n l d f a"; column-gap: .75rem; align-items: center;
}
.agd-crs-thead { padding: 0 .85rem .3rem; color: var(--ag-muted); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.agd-crs-thead > :nth-child(4) { text-align: right; }
.agd-crs-grid {
    list-style: none; margin: 0; padding: 0; min-width: 0;
    border: 1px solid var(--ag-line); border-radius: var(--ag-radius-sm); background: var(--ag-surface); overflow: hidden;
}
.agd-crs-item {
    position: relative; min-height: 3rem; padding: .45rem .85rem; border-top: 1px solid color-mix(in srgb, var(--ag-line) 70%, transparent);
    transition: background-color .18s var(--ag-ease);
}
.agd-crs-item[hidden] { display: none; }
.agd-crs-item:first-child { border-top: 0; }
.agd-crs-item:nth-child(even) { background: color-mix(in srgb, var(--ag-surface-2) 55%, transparent); }
@supports selector(:nth-child(1 of .x)) {
    .agd-crs-item:nth-child(even) { background: transparent; }
    .agd-crs-item:nth-child(even of :not([hidden])) { background: color-mix(in srgb, var(--ag-surface-2) 55%, transparent); }
}
.agd-crs-item::before {
    content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0;
    background: var(--lv, var(--ag-brand)); opacity: 0; transition: opacity .18s var(--ag-ease);
}
.agd-crs .agd-crs-grid .agd-crs-item:hover { background: color-mix(in srgb, var(--lv, var(--ag-brand)) 7%, var(--ag-surface)); }
.agd-crs-item:hover::before { opacity: 1; }
.agd-crs-nc { grid-area: n; min-width: 0; }
.agd-crs .agd-crs-name {
    margin: 0; color: var(--ag-ink); font: 600 .88rem/1.3 var(--ag-font); overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.agd-crs-spec { margin: .1rem 0 0; color: var(--ag-muted); font-size: .75rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agd-crs-lvc { grid-area: l; min-width: 0; }
.agd-crs-level {
    display: inline-block; max-width: 100%; padding: .2rem .5rem; border-radius: 999px; vertical-align: middle;
    background: color-mix(in srgb, var(--lv, var(--ag-brand)) 12%, transparent); color: var(--lv, var(--ag-brand));
    font-size: .7rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agd-crs-dur { grid-area: d; min-width: 0; color: var(--ag-text); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agd-crs-dur .bi { margin-right: .3rem; color: var(--ag-muted); font-size: .72rem; }
.agd-crs-fee { grid-area: f; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.2; }
.agd-crs-fee b { color: var(--ag-brand); font-size: .9rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.agd-crs-fee small { color: var(--ag-muted); font-size: .68rem; overflow-wrap: anywhere; }
.agd-crs-ask {
    grid-area: a; justify-self: end; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%;
    border: 1px solid var(--ag-line); color: var(--ag-brand); background: var(--ag-surface); font-size: .82rem; text-decoration: none;
    transition: background-color .18s var(--ag-ease), color .18s var(--ag-ease), border-color .18s var(--ag-ease), transform .18s var(--ag-ease);
}
.agd-crs-ask:hover, .agd-crs-ask:focus-visible { background: var(--ag-grad); color: #fff; border-color: transparent; transform: scale(1.06); }
.agd-crs-ask:focus-visible { outline: 2px solid var(--ag-brand); outline-offset: 2px; }

.agd-crs-empty { padding: 1.2rem; text-align: center; color: var(--ag-muted); font-size: .85rem; }
.agd-crs-empty[hidden] { display: none; }
.agd-crs-empty .bi { font-size: 1.2rem; }
.agd-crs-empty p { margin: .3rem 0 .6rem; }
.agd-crs-reset, .agd-crs .agd-crs-more {
    display: inline-flex; align-items: center; gap: .4rem; height: 2rem; padding: 0 .9rem; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--ag-line); background: var(--ag-surface); color: var(--ag-brand); font: 600 .8rem/1 var(--ag-font);
    transition: background-color .2s var(--ag-ease), color .2s var(--ag-ease), border-color .2s var(--ag-ease);
}
.agd-crs .agd-crs-more { display: flex; margin: .6rem auto 0; }
.agd-crs .agd-crs-more[hidden] { display: none; }
.agd-crs .agd-crs-more .bi { transition: transform .25s var(--ag-ease); }
.agd-crs .agd-crs-more[aria-expanded="true"] .bi { transform: rotate(180deg); }
.agd-crs-reset:hover, .agd-crs .agd-crs-more:hover { background: var(--ag-grad); color: #fff; border-color: transparent; }
.agd-crs-reset:focus-visible, .agd-crs .agd-crs-more:focus-visible { outline: 2px solid var(--ag-brand); outline-offset: 2px; }

/* Fee structure (compact accordions) */
.agd-crs-feeblock { margin-top: 1rem; }
.agd-crs-fees-title { display: flex; align-items: center; gap: .45rem; margin: 0 0 .5rem; color: var(--ag-ink); font-size: 1rem; font-weight: 700; }
.agd-crs-fees-title .bi { color: var(--ag-brand); }
.agd-crs-acc {
    position: relative; border: 1px solid var(--ag-line); border-radius: var(--ag-radius-sm); background: var(--ag-surface);
    overflow: hidden; transition: border-color .3s var(--ag-ease), box-shadow .3s var(--ag-ease);
}
.agd-crs-acc::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ag-grad);
    transform: scaleY(0); transform-origin: 50% 0; transition: transform .4s var(--ag-ease);
}
.agd-crs-acc[open]::before { transform: none; }
.agd-crs-acc + .agd-crs-acc { margin-top: .45rem; }
.agd-crs-acc[open] { border-color: color-mix(in srgb, var(--ag-brand) 35%, var(--ag-line)); box-shadow: var(--ag-shadow); }
.agd-crs-acc > summary {
    display: flex; align-items: center; gap: .8rem; padding: .6rem .85rem; list-style: none; cursor: pointer;
    color: var(--ag-ink); font-weight: 600; font-size: .9rem; transition: background-color .25s var(--ag-ease);
}
.agd-crs-acc > summary::-webkit-details-marker { display: none; }
.agd-crs-acc > summary::marker { content: ""; }
.agd-crs-acc > summary:hover { background: var(--ag-surface-2); }
.agd-crs-acc > summary:focus-visible { outline: 2px solid var(--ag-brand); outline-offset: -2px; border-radius: var(--ag-radius-sm); }
.agd-crs-acc-ico {
    flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center;
    border-radius: 8px; background: var(--ag-brand-soft); color: var(--ag-brand); font-size: .85rem;
    transition: transform .35s var(--ag-ease);
}
.agd-crs-acc[open] .agd-crs-acc-ico { background: var(--ag-grad); color: #fff; }
.agd-crs-acc > summary:hover .agd-crs-acc-ico { transform: scale(1.06) rotate(-4deg); }
.agd-crs-acc-t { flex: 1 1 auto; min-width: 0; }
.agd-crs-acc-chev { flex: 0 0 auto; color: var(--ag-muted); transition: transform .35s var(--ag-ease), color .25s; }
.agd-crs-acc[open] .agd-crs-acc-chev { transform: rotate(180deg); color: var(--ag-brand); }
.agd-crs-acc-body {
    padding: .75rem .9rem .85rem; border-top: 1px solid var(--ag-line);
    color: var(--ag-text); overflow-wrap: anywhere; 
}
.agd-crs-acc-body > :first-child { margin-top: 0; }
.agd-crs-acc-body > :last-child { margin-bottom: 0; }
.agd-crs-acc-body table {
    display: block; width: max-content; min-width: 100%; max-width: 100%; overflow-x: auto;
    margin: .75rem 0; border-collapse: collapse; font-size: .84rem;
    -webkit-overflow-scrolling: touch;
}
.agd-crs-acc-body th, .agd-crs-acc-body td {
    padding: .45rem .65rem; border: 1px solid var(--ag-line); text-align: left; vertical-align: top;
    color: var(--ag-text); background: transparent; overflow-wrap: normal; min-width: 7rem;
}
.agd-crs-acc-body th, .agd-crs-acc-body thead td, .agd-crs-acc-body tr:first-child > td:only-child { background: var(--ag-surface-2); color: var(--ag-ink); font-weight: 600; }
.agd-crs-acc-body tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--ag-surface-2) 60%, transparent); }
.agd-crs-acc-body img { max-width: 100%; height: auto; }

html[data-theme="dark"] .agd-crs .agd-crs-tab.is-active, html[data-theme="dark"] .agd-crs .agd-crs-ask:hover,
html[data-theme="dark"] .agd-crs .agd-crs-ask:focus-visible { color: #fff; }

/* Narrow panel / phones: each row stacks into a compact 2-line item */
@container agdcrs (max-width: 640px) {
    .agd-crs-thead { display: none; }
    .agd-crs-item {
        grid-template-columns: auto auto minmax(0, 1fr) 2rem; grid-template-areas: "n n n a" "l d f f";
        row-gap: .3rem; column-gap: .5rem; padding: .55rem .7rem;
    }
    .agd-crs-fee { flex-direction: row; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 0 .35rem; }
    .agd-crs-search { flex: 1 1 100%; margin-left: 0; }
    .agd-crs-tabs { flex-basis: 100%; order: 2; }
}
@media (prefers-reduced-motion: reduce) {
    .agd-crs *, .agd-crs *::before { transition: none !important; animation: none !important; }
}
