@layer base, layout, components, pages, responsive;

@layer base {
    :root {
        color-scheme: light;
        --ink: #172722;
        --muted: #53655e;
        --line: #dce6e0;
        --paper: #fff;
        --wash: #f3f7f5;
        --green: #146849;
        --forest: #12392c;
        --lime: #dcf9a9;
        --radius: 15px;
        --shadow: 0 14px 35px -25px #233e3355;
        font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
        font-size: 15px;
        line-height: 1.5;
        color: var(--ink);
        background: var(--wash);
    }
    *, *::before, *::after { box-sizing: border-box; }
    body { margin: 0; min-height: 100vh; }
    h1, h2, h3, p { margin: 0; }
    h1, h2, h3 { line-height: 1.13; letter-spacing: -.035em; overflow-wrap: anywhere; }
    h1 { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 760; }
    h2 { font-size: 1.55rem; }
    h3 { font-size: 1.14rem; }
    p { color: var(--muted); }
    a { color: inherit; text-decoration: none; }
    button, input, textarea, select { font: inherit; }
    button { cursor: pointer; }
    img { max-width: 100%; display: block; }
    :focus-visible { outline: 3px solid #4689dd; outline-offset: 3px; }
    ::selection { background: #d7f2ba; color: #163a2c; }
    .icon { width: 1.2em; height: 1.2em; vertical-align: middle; flex: none; }
    .skip { position: fixed; z-index: 10; inset: 10px auto auto 10px; padding: .6rem 1rem; background: white; border-radius: 8px; transform: translateY(-180%); }
    .skip:focus { transform: none; }
    .preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
}

@layer layout {
    .site-wrap { width: min(1150px, calc(100% - 72px)); margin-inline: auto; }
    .public-site { background: #fbfdfa; }
    .site-header { position: sticky; top: 0; z-index: 3; background: #fcfdfa; border-bottom: 1px solid #dfeae2; box-shadow: 0 4px 20px #16392c0a; }
    @supports (backdrop-filter: blur(12px)) {
        .site-header { background: #fcfdfaf2; backdrop-filter: blur(12px); }
    }
    .public-site :is(main, section, footer)[id] { scroll-margin-top: 90px; }
    .site-nav { min-height: 76px; display: flex; align-items: center; gap: clamp(16px, 3vw, 48px); padding-block: 10px; }
    .site-links { flex: 1; display: flex; align-items: center; gap: 14px; }
    .site-main-links { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 4px; margin-inline: auto; border: 1px solid #e1ebe3; border-radius: 14px; background: #f0f5f0; }
    .site-main-links a, .site-nav-actions > a:not(.button) { padding: 9px 12px; border-radius: 10px; color: #3d5148; font-size: .9rem; font-weight: 700; line-height: 1.2; }
    .site-main-links a:is(:hover, [aria-current]) { background: white; color: var(--green); box-shadow: 0 1px 4px #16392c18; }
    .site-nav-actions { display: flex; align-items: center; gap: 8px; }
    .site-nav-actions > a:not(.button) { border: 1px solid transparent; }
    .site-nav-actions > a:not(.button):is(:hover, [aria-current]) { background: #ecf5ec; border-color: #dfeae2; color: var(--green); }
    .site-section { padding-block: 60px; }
    .site-footer { background: #102d24; color: #f0f7f2; padding-top: 47px; }
    .site-footer p, .site-footer a:not(.brand) { color: #c0d3c8; }
    .site-footer a:hover { color: var(--lime); }
    .footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; padding-bottom: 36px; }
    .footer-grid > :is(div, nav) { display: flex; align-items: flex-start; flex-direction: column; gap: .55rem; min-width: 0; }
    .footer-grid p { max-width: 32ch; }
    .footer-grid strong { margin-bottom: .35rem; }
    .footer-grid > .footer-contact { align-items: stretch; overflow-wrap: anywhere; }
    .footer-contact-details { display: grid; gap: 12px; font-style: normal; }
    .footer-contact-row {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        color: #e2eee7;
        line-height: 1.45;
    }
    .site-footer a.footer-contact-row { color: #e2eee7; }
    .footer-contact-row small {
        display: block;
        margin-bottom: 2px;
        color: #acc7b8;
        font-size: .78rem;
        font-weight: 650;
    }
    .footer-contact-icon {
        display: grid;
        width: 34px;
        height: 34px;
        place-items: center;
        border: 1px solid #426356;
        border-radius: 9px;
        background: #ffffff0b;
        color: var(--lime);
    }
    .footer-support-links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .88rem; font-weight: 650; }
    .footer-contact-details + .footer-support-links { margin-top: 5px; padding-top: 12px; border-top: 1px solid #345548; }
    .footer-support-links .icon { margin-inline-start: 2px; color: var(--lime); }
    .site-footer .footer-contact a:is(:hover, :focus-visible) { color: var(--lime); }
    .footer-support-links a:is(:hover, :focus-visible) { text-decoration: underline; text-underline-offset: 3px; }
    .site-footer.has-whatsapp { padding-bottom: 64px; }
    .whatsapp-float {
        position: fixed;
        z-index: 4;
        inset: auto max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) auto;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-width: 52px;
        min-height: 52px;
        padding-inline: 15px;
        border: 1px solid #ffffff5c;
        border-radius: 999px;
        background: #08754b;
        color: white;
        font-weight: 720;
        box-shadow: 0 8px 26px #082d2560;
    }
    .whatsapp-float:hover { background: #075b3c; }
    .whatsapp-float .icon { width: 25px; height: 25px; }
    @media (max-width: 640px) {
        .whatsapp-float { padding-inline: 0; }
        .whatsapp-float span { display: none; }
    }
    .footer-social-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .35rem; }
    .footer-social-links a { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #527365; border-radius: 50%; }
    .site-footer .footer-social-links a:hover { background: var(--lime); border-color: var(--lime); color: #102d24; }
    .footer-bottom, .footer-bottom div { display: flex; gap: 1.25rem; }
    .footer-bottom { align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid #345548; padding-block: 20px; color: #b9cec2; font-size: .87rem; }
    .site-footer a.footer-credit { display: inline-flex; align-items: center; gap: 9px; color: #f0f7f2; line-height: 1.25; }
    .footer-credit svg { width: 25px; height: 25px; flex: none; color: #ff4d28; }
    .footer-credit span { display: grid; gap: 2px; }
    .footer-credit small { color: #b9cec2; font-size: .7rem; }
    .footer-credit strong { font-size: .75rem; letter-spacing: .02em; }
    .site-footer a.footer-credit:hover, .site-footer a.footer-credit:focus-visible { color: var(--lime); }
    .workspace { display: grid; grid-template-columns: 235px minmax(0, 1fr); }
    .sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; background: #152d26; color: #e5efe8; }
    .sidebar-brand { padding: 23px 18px 21px; border-bottom: 1px solid #31473e; }
    .side-links { padding: 6px 12px 14px; }
    .side-links a { display: flex; align-items: center; gap: 10px; margin: 2px 0; padding: 9px 12px; color: #d6e3dc; border: 1px solid transparent; border-radius: 9px; font-weight: 580; }
    .side-links a:hover, .website-link:hover { background: #233f35; }
    .side-links a[aria-current] { color: #e2f7c5; background: #294b3b; border-color: #456754; box-shadow: inset 3px 0 #bcdf8f; }
    .nav-count { margin-left: auto; min-width: 22px; padding: 2px 7px; border-radius: 999px; background: #d5f3ae; color: #183a2b; font-size: .75rem; font-weight: 750; text-align: center; }
    .nav-label { margin: 17px 11px 6px; color: #9fb8aa; font-size: .68rem; font-weight: 800; letter-spacing: .13em; }
    .sidebar-bottom { padding: 0 12px 12px; margin-top: auto; }
    .website-link { display: flex; align-items: center; gap: 10px; border: 1px solid #486357; border-radius: 9px; color: #dbe9df; padding: 8px 10px; }
    .sidebar-user { margin-top: 12px; display: flex; gap: 9px; align-items: center; border-top: 1px solid #3c5349; padding: 12px 3px 0; }
    .sidebar-user > a { min-width: 0; flex: 1; }
    .sidebar-user strong { font-size: .87rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sidebar-user small { display: block; color: #afc6b9; font-size: .73rem; }
    .workspace-main { min-width: 0; }
    .topbar { min-height: 63px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; gap: 12px; }
    .topbar > div, .top-account { display: flex; align-items: center; gap: 10px; }
    .topbar > div > span { color: var(--muted); }
    .top-account { font-size: .87rem; font-weight: 700; white-space: nowrap; }
    .workspace-content { max-width: 1560px; margin-inline: auto; padding: 25px 30px 42px; }
    .workspace-content > * + * { margin-top: 20px; }
    .page-heading, .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
    .page-heading h1 { font-size: clamp(2rem, 3.5vw, 2.65rem); margin-top: 4px; }
    .page-heading p, .section-heading p { margin-top: 5px; }
    .heading-actions, .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
    .two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
    .form-aside { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
}

@layer components {
    .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 790; font-size: 1.04rem; line-height: 1.15; letter-spacing: -.02em; }
    .brand small { display: block; margin-top: 5px; font-size: .58rem; letter-spacing: .15em; opacity: .82; }
    .brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--green); color: #fff; flex: none; }
    .brand-mark .icon { width: 25px; height: 25px; }
    .site-brand { flex: none; max-width: 34%; gap: 12px; color: #17392a; font-size: 1.12rem; overflow-wrap: anywhere; }
    .site-brand .brand-mark { width: 46px; height: 46px; }
    .site-brand small { color: var(--green); }
    .public-brand-image { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: white; }
    .sidebar-brand .brand-mark, .site-footer .brand-mark { background: #d5f3ae; color: #214133; }
    .button { display: inline-flex; min-height: 41px; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; font-size: .9rem; font-weight: 720; text-align: center; line-height: 1.2; white-space: nowrap; }
    .button.primary { background: var(--green); color: white; }
    .button.primary:hover { background: #0d5037; }
    .site-nav-actions .button { min-height: 44px; padding-inline: 16px; border-radius: 12px; box-shadow: 0 3px 8px #1c6a4526; }
    .button.secondary { background: #fff; border-color: #cfded5; color: #203f32; }
    .button.secondary:hover { background: #edf5ee; border-color: #8db6a0; }
    .button.lime { background: var(--lime); color: #21392b; }
    .button.lime:hover { background: #edfaca; }
    .site-links .admission-nav-button { background: var(--lime); color: #203f32; border-color: #c9e69a; }
    .site-links .admission-nav-button:hover, .site-links .admission-nav-button[aria-current] { background: #ddf2af; color: #173c2b; }
    .button.hero-outline { background: transparent; color: #eff8f0; border-color: #789888; }
    .button.hero-outline:hover { background: #ffffff13; }
    .button.danger { color: #9c252c; background: #fff2f1; border-color: #f0d5d4; }
    .button.danger:hover { background: #ffe5e4; }
    .button.small { min-height: 34px; padding: 6px 10px; font-size: .8rem; }
    .icon-button { display: inline-grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: inherit; }
    .icon-button:hover { background: #8caa9a2b; }
    .avatar, .icon-box { display: inline-grid; place-items: center; flex: none; border-radius: 10px; }
    .avatar { width: 34px; height: 34px; background: #dceee0; color: #23563e; font-weight: 800; }
    .icon-box { width: 39px; height: 39px; }
    .mint { color: #23614a; background: #e1f3e7; }
    .lilac { color: #574c90; background: #ece8f9; }
    .peach { color: #864922; background: #fae9da; }
    .blue { color: #2b5976; background: #e1eff7; }
    .eyebrow, .caption { color: #34634e; text-transform: uppercase; letter-spacing: .105em; font-size: .73rem; font-weight: 790; }
    .eyebrow i, .hero-tag i { display: inline-block; width: 7px; height: 7px; background: #6fc195; border-radius: 50%; vertical-align: 1px; margin-right: 4px; }
    .date-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .87rem; font-weight: 650; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: white; white-space: nowrap; }
    .panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; box-shadow: var(--shadow); }
    .admission-dialog { width: min(480px, calc(100% - 32px)); margin: auto; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); }
    .admission-dialog::backdrop { background: rgb(15 35 25 / 55%); }
    .padded { padding: clamp(17px, 3vw, 26px); }
    .padded > h2 + p, .padded > h3 + p { margin-top: 7px; }
    .padded > p + h3 { margin-top: 20px; }
    .padded > .stack { margin-top: 16px; }
    .panel-head, .panel-foot { padding: 16px 19px; }
    .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
    .panel-head h2 { font-size: 1.14rem; }
    .panel-head p { margin-top: 4px; font-size: .84rem; }
    .panel-foot { border-top: 1px solid var(--line); }
    .split { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
    .arrow-link, .back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: .86rem; font-weight: 750; }
    .arrow-link:hover, .back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
    .back-link { margin-bottom: 6px; }
    .badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; font-weight: 700; font-size: .75rem; padding: 4px 9px; border-radius: 100px; white-space: nowrap; }
    .badge.green, .badge.approved, .badge.present { color: #236044; background: #e1f3e8; }
    .badge.pending, .badge.late { color: #79501a; background: #fff0ce; }
    .badge.declined, .badge.absent { color: #923640; background: #fbe6e8; }
    .badge.neutral, .badge.excused { color: #495d54; background: #edf1ef; }
    .pill-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
    .stack { display: grid; align-content: start; gap: 15px; }
    .max-form { max-width: 780px; }
    .tracking-form { margin-inline: auto; }
    .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .field { display: grid; align-content: start; gap: 5px; min-width: 0; font-size: .89rem; font-weight: 680; }
    .field small { color: var(--muted); font-weight: 450; }
    .field input, .field select, .field textarea, .table-select { min-height: 40px; width: 100%; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid #c7d6cd; color: var(--ink); background: #fff; font-weight: 500; }
    .field textarea { resize: vertical; }
    .field input::placeholder { color: #63776d; }
    .student-result-preview { border-radius: 10px; object-fit: cover; }
    .course-setup { max-width: 1120px; }
    .course-setup > fieldset { padding: 12px 16px 16px; }
    .course-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); gap: 14px; }
    .course-repeat-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
    .course-repeat-row > .field { flex: 1 1 140px; }
    .course-repeat-row > .button { min-height: 40px; }
    .course-setup [data-repeat-list]:not(:has([data-repeat-row])) { display: none; }
    .course-setup .form-hint { color: var(--muted); font-size: .82rem; }
    .course-batch-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-top: 8px; }
    .course-copy > * + * { margin-top: .65rem; }
    .course-copy ul, .course-copy ol, .course-list { padding-inline-start: 1.4em; }
    .course-copy a { color: var(--green); text-decoration: underline; }
    .admission-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 20px; align-items: start; }
    .admission-layout fieldset { padding: 14px 16px 16px; }
    .admission-layout .field > span { color: var(--muted); font-size: .75rem; font-weight: 500; }
    .admission-aside { position: sticky; top: 20px; }
    .admission-steps { display: grid; gap: 16px; padding-left: 20px; margin-top: 20px; }
    @media (max-width: 720px) { .admission-layout { grid-template-columns: minmax(0, 1fr); } .admission-aside { position: static; } }
    .inline-check { display: flex; align-items: center; gap: 7px; font-size: .88rem; }
    input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--green); }
    fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 12px; margin: 0; min-width: 0; }
    legend { padding-inline: 5px; font-size: .89rem; font-weight: 700; }
    .checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
    .filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; padding: 15px 19px; }
    .filters .grow { flex: 1 1 220px; }
    .filters .field { min-width: 125px; }
    .table-scroll { width: 100%; overflow-x: auto; }
    table { border-collapse: collapse; width: 100%; text-align: left; }
    th { color: #4a6357; background: #f4f8f5; font-size: .76rem; white-space: nowrap; }
    th, td { padding: 10px 14px; border-bottom: 1px solid #e7eeea; }
    th:first-child, td:first-child { padding-left: 19px; }
    td { font-size: .88rem; overflow-wrap: anywhere; }
    td small { display: block; color: var(--muted); margin-top: 3px; }
    tbody tr:last-child td { border-bottom: 0; }
    tbody tr:hover td { background: #f9fbf9; }
    .table-select { width: min(100%, 220px); min-width: 128px; }
    .empty { display: grid; justify-items: center; gap: 7px; padding: 34px 16px; text-align: center; }
    .empty p { max-width: 39ch; font-size: .89rem; }
    .empty .button { margin-top: 5px; }
    .pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 19px; color: var(--muted); font-size: .84rem; }
    .pagination > div { display: flex; gap: 6px; }
    .flash { padding: 12px 15px; border: 1px solid; border-radius: 10px; font-size: .9rem; }
    .flash.success { background: #e5f6e9; color: #24593d; border-color: #b9dec5; display: flex; align-items: center; gap: 7px; }
    .flash.error { background: #fff0ef; color: #84292f; border-color: #edcbcd; }
    .flash ul { margin: 4px 0 0; padding-left: 22px; }
}

@layer pages {
    .public-hero, .dashboard-banner, .auth-story { background: radial-gradient(ellipse at 74% 35%, #285c45 0, transparent 62%), linear-gradient(120deg, #112d24, #163e31); color: #f6faf3; }
    .hero-grid { min-height: 430px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; align-items: center; padding-block: 30px; }
    .hero-tag { width: fit-content; display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid #769c86; border-radius: 100px; background: #e4ffdd10; color: #e1f1d9; font-weight: 780; letter-spacing: .12em; font-size: .66rem; }
    .hero-tag i { background: #c5ed8c; margin: 0; }
    .public-hero h1 { margin: 16px 0; font-size: clamp(2.65rem, 5.15vw, 4.65rem); letter-spacing: -.065em; line-height: .995; }
    .public-hero h1 em { color: #d9f6aa; font-style: normal; }
    .public-hero p, .dashboard-banner p, .auth-story p { color: #d8e9dd; }
    .public-hero p { max-width: 47ch; font-size: clamp(1rem, 1.5vw, 1.12rem); }
    .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 19px; }
    .hero-image { width: 100%; max-width: 490px; height: auto; justify-self: center; }
    .value-strip { background: #edf5ec; border-bottom: 1px solid #dce9dd; }
    .value-row { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
    .value-row span { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 16px 8px; font-weight: 690; color: #375b48; }
    .value-row span + span { border-left: 1px solid #d8e7dc; }
    .site-section h2 { margin-top: 7px; font-size: clamp(1.85rem, 3.6vw, 2.75rem); }
    .site-section .panel h2 { font-size: 1.6rem; }
    .course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
    .course-card { overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); background: white; border-radius: 17px; box-shadow: var(--shadow); }
    .course-art { position: relative; min-height: 117px; display: flex; align-items: start; justify-content: space-between; gap: 7px; padding: 14px; overflow: hidden; }
    .course-art::after { content: ""; position: absolute; width: 190px; height: 190px; right: -20px; top: -49px; border-radius: 50%; border: 1px solid currentColor; opacity: .16; box-shadow: 0 0 0 17px currentColor, inset 0 0 0 17px currentColor; pointer-events: none; }
    .course-art-lines { position: absolute; inset: 0; opacity: .14; background: repeating-linear-gradient(135deg, transparent 0 13px, currentColor 14px, transparent 15px 21px); mask-image: linear-gradient(90deg, transparent 30%, #000); }
    .course-category, .course-glyph { position: relative; z-index: 1; }
    .course-category { padding: 5px 9px; border-radius: 100px; background: #ffffffb5; font-size: .75rem; font-weight: 760; max-width: 68%; overflow-wrap: anywhere; }
    .course-glyph { display: grid; width: 57px; height: 57px; border-radius: 14px; margin: 15px 14px 0 0; background: #ffffff95; place-items: center; transform: rotate(-8deg); flex: none; }
    .course-glyph .icon { width: 29px; height: 29px; }
    .course-card-body { display: flex; flex-direction: column; flex: 1; padding: 16px; }
    .course-card h3 { margin: 4px 0 6px; }
    .course-card h3 a:hover { color: var(--green); }
    .course-card p { flex: 1; font-size: .9rem; overflow-wrap: anywhere; }
    .course-seat-list { display: grid; gap: 5px; margin-top: 12px; font-size: .8rem; }
    .course-seat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: #496257; }
    .course-seat-row span { overflow-wrap: anywhere; }
    .course-seat-row strong { color: var(--green); text-align: right; flex-shrink: 0; }
    .course-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
    .journey { background: #edf5ef; border-block: 1px solid #e2eee5; }
    .journey-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 21px; }
    .journey-grid article { padding: 20px; border: 1px solid #d8e8dc; border-radius: 12px; background: #fafdff9c; }
    .journey-grid article span { display: inline-grid; width: 34px; height: 34px; place-items: center; background: #dcefe0; color: #2a6147; border-radius: 8px; font-size: .82rem; font-weight: 800; }
    .journey-grid h3 { margin: 12px 0 6px; }
    .faq-grid, .course-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
    .faq-grid p { margin-top: 8px; }
    .faq-grid details { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: white; }
    .faq-grid details + details { margin-top: 8px; }
    .faq-grid summary { cursor: pointer; font-weight: 700; }
    .public-banner { padding-block: 42px; background: #eaf5ec; border-bottom: 1px solid var(--line); }
    .public-banner h1 { margin: 6px 0; }
    .public-banner .back-link { display: block; }
    .catalog-filters + .results-count { margin-block: 15px 10px; color: var(--muted); font-weight: 680; font-size: .87rem; }
    .course-detail { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
    .course-detail .flash { margin-bottom: 12px; }
    .batch-choice { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
    .batch-choice small { display: block; color: var(--muted); margin-top: 5px; }
    .batch-choice .button { margin-top: 8px; }
    .prose { max-width: 800px; }
    .auth-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: clamp(20px, 5vw, 62px); padding-block: 38px; }
    .auth-story, .auth-card { padding: clamp(22px, 4vw, 42px); border-radius: 18px; }
    .auth-story h1 { margin: 13px 0 8px; }
    .auth-story img { width: 100%; max-width: 390px; height: auto; margin-inline: auto; }
    .auth-card h2 { margin: 6px 0; }
    .auth-card .flash { margin-top: 11px; }
    .auth-card .stack { margin-top: 17px; }
    .auth-switch { margin-top: 14px; }
    .auth-switch a { color: var(--green); font-weight: 740; text-decoration: underline; }
    .password-field { display: flex; position: relative; }
    .password-field input { padding-right: 61px; }
    .password-field button { position: absolute; right: 4px; top: 4px; bottom: 4px; color: var(--green); background: #edf5ee; border: 0; border-radius: 6px; font-size: .78rem; font-weight: 730; }
    .dashboard-banner { display: flex; align-items: center; justify-content: space-between; min-height: 180px; padding: 20px 24px; border-radius: 16px; overflow: hidden; position: relative; }
    .dashboard-banner > div { z-index: 1; position: relative; }
    .dashboard-banner h2 { margin: 9px 0 5px; font-size: clamp(1.55rem, 3vw, 2.45rem); }
    .dashboard-banner .hero-actions { margin-top: 13px; }
    .dashboard-banner img { position: absolute; right: 1.5%; top: 50%; transform: translateY(-50%); width: 274px; height: auto; opacity: .9; }
    .dashboard-banner p { max-width: 45ch; }
    .metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
    .metric { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 13px; }
    .metric:hover { border-color: #8ab49b; }
    .metric span:not(.icon-box), .metric small { display: block; color: var(--muted); font-size: .78rem; }
    .metric strong { display: block; font-size: clamp(1.45rem, 2.5vw, 2rem); line-height: 1.16; letter-spacing: -.05em; margin: 3px 0; overflow-wrap: anywhere; }
    .metric .metric-arrow { color: #5d7a6c; }
    .overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
    .chart { padding: 13px 19px; }
    .chart > strong { font-size: 1.55rem; }
    .chart small { font-size: .83rem; color: var(--muted); }
    .chart-bars { display: flex; justify-content: space-between; gap: 8px; padding-top: 7px; }
    .chart-column { flex: 1; min-width: 0; display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: .68rem; }
    .chart-track { position: relative; width: 100%; max-width: 22px; height: 62px; border-radius: 5px; background: #eaf3ed; overflow: hidden; }
    .chart-track i { position: absolute; inset: auto 0 0; height: var(--height); background: #72b795; }
    .batch-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 11px 15px; gap: 8px; }
    .batch-preview a { display: flex; gap: 8px; align-items: center; padding: 7px; border-radius: 9px; }
    .batch-preview a:hover { background: var(--wash); }
    .batch-preview a > span:nth-child(2) { flex: 1; }
    .batch-preview small { display: block; color: var(--muted); }
    .notice { padding: 13px 18px; }
    .notice + .notice { border-top: 1px solid var(--line); }
    .notice h3 { margin: 4px 0; }
    .notice p { font-size: .88rem; }
    .note-attachment { margin-top: 12px; }
    .note-attachment summary { cursor: pointer; list-style: none; }
    .note-attachment summary::-webkit-details-marker { display: none; }
    .note-attachment iframe { display: block; width: 100%; height: min(70vh, 700px); min-height: 320px; margin-top: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f5f8f6; }
    .assignment-detail { gap: 20px; }
    .assignment-section-heading, .assignment-attachment-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
    .assignment-section-heading h2, .assignment-attachments h2, .assignment-attachment-heading h3 { margin-top: 4px; }
    .assignment-meta { display: flex; flex-wrap: wrap; gap: 12px 28px; color: var(--muted); font-size: .9rem; }
    .assignment-meta strong { color: var(--ink); margin-right: 5px; }
    .assignment-attachment { padding: clamp(14px, 2vw, 22px); border: 1px solid var(--line); border-radius: 12px; background: #fafcfb; }
    .assignment-attachment .note-attachment iframe { height: min(75vh, 850px); min-height: 400px; background: #eef2ef; }
    .invoice-details { margin-bottom: 0; }
    .invoice-details div { display: flex; justify-content: space-between; align-items: center; gap: 18px; border-top: 1px solid var(--line); padding: 10px 0; }
    .invoice-details dd { margin: 0; text-align: right; font-weight: 650; }
    .invoice-total { font-size: 1.16rem; font-weight: 760; }
}

@layer responsive {
    .mobile-site-toggle, .menu-toggle { display: none; }
    @media (max-width: 1100px) {
        .workspace { grid-template-columns: 205px minmax(0, 1fr); }
        .topbar, .workspace-content { padding-inline: 20px; }
        .dashboard-banner img { right: 0; }
        .overview-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
    }
    @media (max-width: 900px) {
        .site-wrap { width: min(100% - 42px, 1150px); }
        .site-nav { min-height: 66px; justify-content: space-between; }
        .site-brand { flex: 0 1 auto; min-width: 0; max-width: none; }
        .mobile-site-toggle { display: inline-flex; flex: none; }
        .site-links { display: none; position: absolute; top: calc(100% + 8px); inset-inline: 15px; max-height: calc(100dvh - 88px); overflow: auto; padding: 12px; align-items: stretch; flex-direction: column; border: 1px solid #dfeae2; border-radius: 16px; background: white; box-shadow: 0 12px 26px #244b332b; }
        .site-links.is-open { display: flex; gap: 10px; }
        .site-main-links, .site-nav-actions { flex-direction: column; align-items: stretch; margin: 0; }
        .site-main-links a, .site-nav-actions > a:not(.button) { padding-block: 12px; }
        .site-nav-actions > a:not(.button) { border-color: #dfeae2; }
        .overview-grid, .form-aside { grid-template-columns: minmax(0, 1fr); }
        .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .dashboard-banner img { opacity: .35; }
        .site-section { padding-block: 38px; }
    }
    @media (max-width: 720px) {
        .workspace { display: block; }
        .sidebar { display: none; position: fixed; z-index: 4; left: 0; top: 61px; width: min(85vw, 265px); height: calc(100dvh - 61px); box-shadow: 5px 10px 30px #112d2455; }
        .sidebar.is-open { display: flex; }
        .menu-toggle { display: inline-grid; margin-left: -6px; }
        .topbar { min-height: 61px; position: sticky; top: 0; z-index: 3; }
        .topbar > div > span { display: none; }
        .hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 37px; }
        .hero-image { max-width: 365px; }
        .course-grid, .journey-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .faq-grid, .course-detail, .auth-grid { grid-template-columns: minmax(0, 1fr); }
        .auth-story img { display: none; }
        .value-row span { font-size: .74rem; gap: 5px; }
    }
    @media (max-width: 500px) {
        .site-wrap { width: calc(100% - 30px); }
        .topbar, .workspace-content { padding-inline: 13px; }
        .page-heading, .section-heading { align-items: start; flex-direction: column; gap: 10px; }
        .course-grid, .journey-grid, .two-columns, .form-grid, .batch-preview, .footer-grid { grid-template-columns: minmax(0, 1fr); }
        .footer-grid { gap: 1rem; }
        .dashboard-banner { padding: 17px; }
        .dashboard-banner img { right: -18%; width: 235px; opacity: .21; }
        .hero-actions .button { white-space: normal; }
        .panel-head { align-items: flex-start; }
        .top-account > span:last-child { display: none; }
        .filters .field { flex: 1 1 130px; }
    }
    @media print {
        body { background: white; }
        .workspace { display: block; }
        .sidebar, .topbar, .page-heading, .flash, .no-print { display: none !important; }
        .workspace-content, .invoice-sheet { display: block; padding: 0; }
        .invoice-sheet { border: 0; box-shadow: none; }
    }
}


@layer pages {
    .exam-settings, .question-editor, .exam-answer { padding: 12px 15px 16px; }
    .question-editor, .exam-answer { background: #f8fbf9; }
    .question-remove { align-self: end; }
    .exam-answer { gap: 7px; }
    .report-heading { margin-bottom: 18px; }
    .report-heading h2 { margin: 5px 0; overflow-wrap: anywhere; }
    .report-heading p, .result-note { color: var(--muted); }
    .report-metrics { margin-bottom: 20px; }
    .result-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; }
    .result-summary > div, .result-review { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbf9; }
    .result-summary span, .result-summary small { display: block; color: var(--muted); font-size: .82rem; }
    .result-summary strong { display: block; margin: 5px 0; font-size: 1.3rem; }
    .result-review p { margin-top: 8px; overflow-wrap: anywhere; }
    .exam-answer label { padding: 7px; border-radius: 6px; cursor: pointer; }
    .exam-answer label:hover { background: #e7f2ea; }
    .exam-answer input { accent-color: var(--green); }
}

@layer pages {
    [hidden] { display: none !important; }
    .account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 8px; padding: 12px 15px; }
    .account-grid a { display: flex; align-items: center; gap: 9px; padding: 8px; border: 1px solid transparent; border-radius: 9px; }
    .account-grid a:hover, .account-grid a[aria-current] { background: var(--wash); border-color: var(--line); }
    .account-grid a > span:nth-child(2) { flex: 1; }
    .account-grid small { display: block; color: var(--green); }
    .finance-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); background: #f8fbf9; }
    .finance-totals div { padding: 12px 15px; display: grid; gap: 3px; overflow-wrap: anywhere; }
    .finance-totals div + div { border-left: 1px solid var(--line); }
    .finance-totals span, .simple-list small { color: var(--muted); }
    .simple-list div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-block: 6px; }
    button:disabled { opacity: .55; cursor: default; }
}

@layer layout {
    .sidebar { scrollbar-width: thin; scrollbar-color: #637f71 #152d26; }
}

@layer pages {
    .auth-options { justify-content: space-between; }
    .contact-message { margin-bottom: 12px; overflow-wrap: anywhere; }
    .contact-message summary { cursor: pointer; }
    .contact-message > .stack { margin-top: 12px; }
}

