:root {
    --fy-primary: #087f5b;
    --fy-primary-dark: #056044;
    --fy-primary-soft: #e8f7f1;
    --fy-ink: #16231f;
    --fy-muted: #60706a;
    --fy-line: #dce7e2;
    --fy-surface: #ffffff;
    --fy-background: #f5f8f7;
    --fy-warning: #9a6700;
    --fy-shadow: 0 14px 40px rgba(18, 63, 49, 0.08);
}

body.first-year-modern {
    color: var(--fy-ink);
    background: var(--fy-background);
}

body.first-year-modern .loader {
    display: none;
}

.year-topbar {
    z-index: 1000;
    height: 72px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    background: linear-gradient(90deg, #056044, #009970);
    box-shadow: 0 6px 24px rgba(5, 96, 68, 0.16);
}

.year-topbar-inner {
    display: flex;
    height: 72px;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
}

.year-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.year-brand .OurImage {
    width: 260px !important;
    max-width: 100%;
    height: auto;
    margin: 0 !important;
    object-fit: contain;
}

.year-desktop-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.year-desktop-nav a {
    padding: 10px 14px;
    border-radius: 10px;
    color: #e4fff5;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: 160ms ease;
}

.year-desktop-nav a:hover,
.year-desktop-nav a:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.year-desktop-nav .year-nav-cta {
    margin-left: 8px;
    color: var(--fy-primary-dark);
    background: #fff;
}

.year-desktop-nav .year-nav-cta:hover,
.year-desktop-nav .year-nav-cta:focus-visible {
    color: var(--fy-primary-dark);
    background: #dcfff1;
}

.year-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-weight: 700;
}

.year-topbar .theme-toggle {
    display: inline-flex;
    min-height: 40px;
    padding: 8px 11px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: background 160ms ease, transform 160ms ease;
}

.year-topbar .theme-toggle:hover,
.year-topbar .theme-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    outline: 2px solid rgba(255, 255, 255, 0.45);
    outline-offset: 2px;
}

.first-year-modern .year-sidebar {
    z-index: 999;
    top: 72px;
    bottom: 0;
    width: 280px;
    height: auto;
    padding: 26px 18px 22px;
    border-right: 1px solid var(--fy-line);
    background: #fff;
}

.year-sidebar-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0 8px 20px;
    border-bottom: 1px solid var(--fy-line);
}

.year-sidebar-kicker,
.year-sidebar-label {
    display: block;
    color: #7a8984;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.year-sidebar-heading h2 {
    margin: 4px 0 0;
    color: var(--fy-ink);
    font-size: 20px;
    font-weight: 800;
}

.year-sidebar-close {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--fy-line);
    border-radius: 10px;
    color: var(--fy-ink);
    background: #fff;
    cursor: pointer;
}

.year-sidebar-section {
    padding: 22px 0 0;
}

.year-sidebar-label {
    margin: 0 8px 9px;
}

.year-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
    padding: 11px 12px;
    border-radius: 11px;
    color: #3d4b46;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: 160ms ease;
}

.year-sidebar-link span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.year-sidebar-link:hover,
.year-sidebar-link:focus-visible,
.year-sidebar-link.is-current {
    color: var(--fy-primary-dark);
    background: var(--fy-primary-soft);
    text-decoration: none !important;
}

.first-year-modern .year-sidebar a,
.first-year-modern .year-sidebar a:hover,
.first-year-modern .year-sidebar a:focus,
.first-year-modern .year-sidebar a:active {
    text-decoration: none !important;
}

.year-current-badge {
    padding: 4px 7px;
    border-radius: 999px;
    color: var(--fy-primary-dark);
    background: #c9f3e3;
    font-size: 10px;
    text-transform: uppercase;
}

.year-sidebar-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.year-sidebar-filters button {
    display: flex;
    min-width: 0;
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid var(--fy-line);
    border-radius: 11px;
    color: var(--fy-ink);
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: 160ms ease;
}

.year-sidebar-filters button:hover,
.year-sidebar-filters button:focus-visible,
.year-sidebar-filters button.is-active {
    border-color: var(--fy-primary);
    color: var(--fy-primary-dark);
    background: var(--fy-primary-soft);
}

.year-sidebar-filters button span {
    margin-top: 2px;
    color: var(--fy-muted);
    font-size: 11px;
}

.year-sidebar-help {
    display: flex;
    gap: 11px;
    margin-top: 26px;
    padding: 15px;
    border: 1px solid #d3eadf;
    border-radius: 13px;
    color: #385248;
    background: #f1fbf7;
    font-size: 12px;
}

.year-sidebar-help > .fa {
    color: var(--fy-primary);
    font-size: 20px;
}

.year-sidebar-help strong,
.year-sidebar-help a {
    display: block;
}

.year-sidebar-help a {
    margin-top: 4px;
    color: var(--fy-primary-dark);
    font-weight: 800;
}

.first-year-modern .w3-main {
    margin-left: 280px !important;
    min-height: 100vh;
    background:
        radial-gradient(circle at 90% 2%, rgba(57, 181, 138, 0.13), transparent 28rem),
        var(--fy-background);
}

.first-year-modern .legacy-year-section {
    display: none;
}

.first-year-dashboard {
    width: min(1180px, calc(100% - 48px));
    margin: 72px auto 0;
    padding: 42px 0 64px;
    scroll-margin-top: 72px;
}

.year-hero {
    position: relative;
    overflow: hidden;
    padding: 46px;
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(135deg, #064e3b 0%, #07835f 55%, #12a275 100%);
    box-shadow: var(--fy-shadow);
}

.year-hero::after {
    content: "01";
    position: absolute;
    right: 30px;
    bottom: -52px;
    color: rgba(255, 255, 255, 0.09);
    font-size: clamp(150px, 22vw, 270px);
    font-weight: 800;
    line-height: 1;
}

.second-year-modern .year-hero::after {
    content: "02";
}

.third-year-modern .year-hero::after {
    content: "03";
}

.fourth-year-modern .year-hero::after {
    content: "04";
}

.second-year-modern .filter-options,
.third-year-modern .filter-options,
.fourth-year-modern .filter-options {
    flex-wrap: wrap;
}

.second-year-modern .second-year-toolbar {
    grid-template-columns: auto auto minmax(230px, 1fr);
}

.third-year-modern .third-year-toolbar {
    grid-template-columns: auto auto minmax(230px, 1fr);
}

.fourth-year-modern .fourth-year-toolbar {
    grid-template-columns: auto auto minmax(230px, 1fr);
}

.second-year-modern .second-year-branch-picker .filter-chip {
    min-width: 60px;
}

.third-year-modern .third-year-branch-picker .filter-chip {
    min-width: 60px;
}

.fourth-year-modern .fourth-year-branch-picker .filter-chip {
    min-width: 56px;
}

.third-year-modern .subject-card .panel .unit-card,
.fourth-year-modern .subject-card .panel .unit-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    grid-template-areas: "details actions";
    gap: 32px;
    align-items: start;
    margin-top: 12px;
    padding: 22px !important;
    border: 1px solid var(--fy-line);
    border-radius: 14px;
    color: var(--fy-ink);
    background: #fbfdfc;
}

.third-year-modern .subject-card .panel .unit-details,
.fourth-year-modern .subject-card .panel .unit-details {
    grid-area: details;
    min-width: 0;
}

.third-year-modern .subject-card .panel .unit-actions,
.fourth-year-modern .subject-card .panel .unit-actions {
    grid-area: actions;
    align-self: start;
}

.year-kicker,
.filter-label {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.year-kicker {
    color: #b9f6df;
}

.year-hero h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 5vw, 58px);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.year-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 650px;
    margin: 12px 0 0;
    color: #dff8ee;
    font-size: 17px;
}

.year-stats {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 12px;
    margin-top: 26px;
}

.year-stat {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.resource-toolbar {
    position: sticky;
    top: 54px;
    z-index: 2;
    display: grid;
    grid-template-columns: auto auto minmax(240px, 1fr);
    gap: 22px;
    align-items: end;
    margin: 24px 0;
    padding: 20px;
    border: 1px solid rgba(220, 231, 226, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 30px rgba(18, 63, 49, 0.07);
    backdrop-filter: blur(14px);
}

.filter-label {
    display: block;
    color: var(--fy-muted);
}

.filter-options {
    display: flex;
    gap: 8px;
}

.filter-chip {
    min-width: 76px;
    padding: 10px 14px;
    border: 1px solid var(--fy-line);
    border-radius: 12px;
    color: var(--fy-ink);
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    transition: 160ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
    border-color: var(--fy-primary);
    color: var(--fy-primary);
}

.filter-chip.is-active {
    border-color: var(--fy-primary);
    color: #fff;
    background: var(--fy-primary);
    box-shadow: 0 6px 16px rgba(8, 127, 91, 0.22);
}

.subject-search-wrap {
    position: relative;
}

.subject-search-wrap .fa {
    position: absolute;
    left: 15px;
    bottom: 13px;
    color: var(--fy-muted);
}

#subjectSearch {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 42px;
    border: 1px solid var(--fy-line);
    border-radius: 12px;
    color: var(--fy-ink);
    background: #fbfdfc;
    outline: none;
}

#subjectSearch:focus {
    border-color: var(--fy-primary);
    box-shadow: 0 0 0 3px rgba(8, 127, 91, 0.12);
}

.results-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 2px 14px;
}

.results-summary h2 {
    margin: 0;
    color: var(--fy-ink);
    font-size: 24px;
    font-weight: 800;
}

.results-count {
    color: var(--fy-muted);
    font-size: 14px;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.subject-card {
    scroll-margin-top: 96px;
    overflow: hidden;
    border: 1px solid var(--fy-line);
    border-radius: 18px;
    background: var(--fy-surface);
    box-shadow: 0 7px 24px rgba(25, 70, 56, 0.06);
    transition: 180ms ease;
}

.subject-card:hover {
    border-color: #b8d4ca;
    transform: translateY(-2px);
    box-shadow: var(--fy-shadow);
}

.subject-card:has(.accordion.active) {
    grid-column: 1 / -1;
}

.first-year-modern .subject-card .accordion {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr auto;
    gap: 6px 16px;
    align-items: center;
    padding: 22px;
    border: 0;
    outline: 0;
    color: var(--fy-ink);
    background: #fff;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    transition: 160ms ease;
}

.first-year-modern .subject-card .accordion:hover,
.first-year-modern .subject-card .accordion.active {
    color: var(--fy-primary-dark);
    background: var(--fy-primary-soft);
}

.subject-code {
    display: block;
    margin-bottom: 4px;
    color: var(--fy-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.subject-name {
    display: block;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

.subject-meta {
    grid-column: 1;
    color: var(--fy-muted);
    font-size: 13px;
}

.first-year-modern .subject-card .accordion::after {
    content: "+";
    grid-column: 2;
    grid-row: 1 / span 2;
    display: grid;
    width: 34px;
    height: 34px;
    margin: 0;
    place-items: center;
    border-radius: 50%;
    color: var(--fy-primary);
    background: var(--fy-primary-soft);
}

.first-year-modern .subject-card .accordion.active::after {
    content: "−";
}

.first-year-modern .subject-card .panel {
    padding: 8px 22px 22px;
    color: var(--fy-ink);
    background: #fff;
}

.first-year-modern .subject-card .panel .w3-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    grid-template-areas: "details actions";
    gap: 32px;
    align-items: start;
    margin-top: 12px;
    padding: 22px !important;
    border: 1px solid var(--fy-line);
    border-radius: 14px;
    background: #fbfdfc;
}

.first-year-modern .subject-card .panel .unit-card::before,
.first-year-modern .subject-card .panel .unit-card::after {
    content: none !important;
    display: none !important;
}

.first-year-modern .subject-card .panel .w3-twothird,
.first-year-modern .subject-card .panel .w3-third {
    float: none;
    width: auto;
    padding: 0;
}

.first-year-modern .subject-card .panel .unit-details {
    grid-area: details;
    min-width: 0;
    justify-self: stretch;
}

.first-year-modern .subject-card .panel .unit-actions {
    grid-area: actions;
    align-self: start;
    justify-self: stretch;
    padding-top: 0 !important;
}

.first-year-modern .subject-card .panel h3 {
    margin: 0 0 8px;
    color: var(--fy-primary) !important;
    font-size: 20px;
    font-weight: 800;
}

.first-year-modern .subject-card .panel .unit-description {
    width: 100%;
    margin: 14px 0 0;
    color: #34463f;
    text-align: left;
}

.first-year-modern .unit-topic-heading {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--fy-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.first-year-modern .unit-topic-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 20px;
    color: #34463f;
    font-size: 15px;
    line-height: 1.55;
}

.first-year-modern .unit-topic-list li {
    padding-left: 4px;
    text-wrap: pretty;
}

.first-year-modern .unit-topic-list li::marker {
    color: var(--fy-primary);
}

.first-year-modern .OurButton {
    display: flex;
    width: 220px;
    min-width: 0;
    margin: 0 !important;
    flex-direction: column;
    gap: 10px;
}

.first-year-modern .OurMade {
    position: relative;
    isolation: isolate;
    display: grid;
    min-height: 180px;
    margin: 0 !important;
    overflow: hidden;
    place-items: center;
    color: #52615c;
    background:
        radial-gradient(circle at center, rgba(8, 127, 91, 0.08), transparent 23rem),
        var(--fy-background);
}

.first-year-modern .OurMade p {
    position: relative;
    z-index: 2;
    margin: 0;
    color: #53635d;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.first-year-modern .OurMade i {
    color: #e03131;
}

.first-year-modern .OurMade img {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: min(520px, 82vw) !important;
    max-height: 150px;
    margin: 0;
    object-fit: contain;
    opacity: 0.09;
    mix-blend-mode: multiply;
    transform: translate(-50%, -44%);
}

.year-footer {
    margin-top: 24px;
}

.year-footer-main {
    padding: 0 24px;
    color: #d7eee6;
    background: linear-gradient(120deg, #064b37, #087f5b);
}

.year-footer-links {
    display: flex;
    width: min(1180px, 100%);
    min-height: 76px;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px 30px;
}

.year-footer-links a {
    color: #d7eee6;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.year-footer-links a:hover,
.year-footer-links a:focus-visible {
    color: #fff;
    text-decoration: none;
    outline: none;
}

.year-footer-disclaimer {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 0 0 20px;
    color: #b7d8cd;
    font-size: 10px;
    line-height: 1.7;
}

.year-footer-bottom {
    display: flex;
    width: min(1180px, 100%);
    min-height: 64px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #b7d8cd;
    font-size: 10px;
}

.year-footer-bottom p {
    margin: 0;
}

.year-footer-bottom a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: inherit;
    text-decoration: none;
}

.year-footer-bottom a:hover,
.year-footer-bottom a:focus-visible {
    color: #fff;
    text-decoration: none;
    outline: none;
}

.first-year-modern .OurButton a {
    text-decoration: none;
}

.first-year-modern .OurButton .btn {
    width: 100%;
    margin-top: 0 !important;
    padding: 11px 16px;
    border: 1px solid var(--fy-primary);
    border-radius: 10px;
    color: #fff;
    background: var(--fy-primary);
    font-size: 14px;
    font-weight: 700;
}

.first-year-modern .OurButton a + a .btn {
    color: var(--fy-primary-dark);
    background: #fff;
}

.first-year-modern .OurButton .btn:hover {
    color: #fff;
    background: var(--fy-primary-dark);
}

.first-year-modern .OurButton a.is-unavailable {
    pointer-events: none;
}

.first-year-modern .OurButton a.is-unavailable .btn {
    border-color: #d8dedb;
    color: #87918d;
    background: #eef1f0;
    cursor: not-allowed;
}

.first-year-modern .OurButton > .btn:disabled {
    border-color: #d8dedb;
    color: #87918d;
    background: #eef1f0;
    cursor: not-allowed;
}

.empty-results {
    grid-column: 1 / -1;
    padding: 48px 20px;
    border: 1px dashed #b9cbc4;
    border-radius: 18px;
    color: var(--fy-muted);
    background: #fff;
    text-align: center;
}

.empty-results .fa {
    display: block;
    margin-bottom: 12px;
    color: var(--fy-primary);
    font-size: 28px;
}

html[data-theme="dark"] {
    --fy-primary: #45d3a0;
    --fy-primary-dark: #70e0b8;
    --fy-primary-soft: #24483b;
    --fy-ink: #f1f7f4;
    --fy-muted: #b8c7c1;
    --fy-line: #40564d;
    --fy-surface: #263630;
    --fy-background: #1a2722;
    --fy-shadow: 0 14px 40px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] .year-topbar {
    background: linear-gradient(90deg, #063b2d, #087052);
}

html[data-theme="dark"] .year-desktop-nav .year-nav-cta {
    color: #064b37;
    background: #dffff3;
}

html[data-theme="dark"] body.first-year-modern .year-sidebar,
html[data-theme="dark"] .year-sidebar-close,
html[data-theme="dark"] .year-sidebar-filters button,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .first-year-modern .subject-card .accordion,
html[data-theme="dark"] .first-year-modern .subject-card .panel,
html[data-theme="dark"] .empty-results {
    background: var(--fy-surface);
}

html[data-theme="dark"] .year-sidebar-link {
    color: var(--fy-ink);
}

html[data-theme="dark"] .year-sidebar-kicker,
html[data-theme="dark"] .year-sidebar-label {
    color: var(--fy-muted);
}

html[data-theme="dark"] .year-current-badge {
    color: #9af0d1;
    background: #194b3b;
}

html[data-theme="dark"] .year-sidebar-help {
    border-color: var(--fy-line);
    color: var(--fy-ink);
    background: #21342c;
}

html[data-theme="dark"] .first-year-modern .w3-main {
    background:
        radial-gradient(circle at 90% 2%, rgba(57, 181, 138, 0.1), transparent 28rem),
        var(--fy-background);
}

html[data-theme="dark"] .third-year-modern .subject-card .panel .unit-card,
html[data-theme="dark"] .fourth-year-modern .subject-card .panel .unit-card,
html[data-theme="dark"] .first-year-modern .subject-card .panel .w3-row,
html[data-theme="dark"] #subjectSearch {
    background: #202f29;
}

html[data-theme="dark"] .resource-toolbar {
    border-color: var(--fy-line);
    background: rgba(38, 54, 48, 0.96);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .first-year-modern .subject-card .panel h3 {
    color: #fff !important;
}

html[data-theme="dark"] .first-year-modern .subject-card .panel .unit-description,
html[data-theme="dark"] .first-year-modern .unit-topic-list {
    color: #f3f8f6;
}

html[data-theme="dark"] .first-year-modern .unit-topic-heading {
    color: #7fe4bf;
}

html[data-theme="dark"] .filter-chip.is-active,
html[data-theme="dark"] .first-year-modern .OurButton .btn {
    color: #fff;
    background: #147b5b;
}

html[data-theme="dark"] #subjectSearch::placeholder {
    color: #83958e;
}

html[data-theme="dark"] .first-year-modern .OurButton a + a .btn {
    color: var(--fy-primary);
    background: transparent;
}

html[data-theme="dark"] .first-year-modern .OurButton .btn:hover {
    color: #fff;
    background: #249b73;
}

html[data-theme="dark"] .first-year-modern .OurButton a.is-unavailable .btn,
html[data-theme="dark"] .first-year-modern .OurButton > .btn:disabled {
    border-color: #34463f;
    color: #809089;
    background: #202b27;
}

html[data-theme="dark"] .first-year-modern .OurMade p {
    color: var(--fy-muted);
}

html[data-theme="dark"] .first-year-modern .OurMade img {
    opacity: 0.06;
    mix-blend-mode: screen;
    filter: invert(1) grayscale(1);
}

@media (max-width: 900px) {
    .resource-toolbar {
        position: static;
        grid-template-columns: 1fr 1fr;
    }

    .second-year-modern .second-year-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .third-year-modern .third-year-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .fourth-year-modern .fourth-year-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .second-year-modern .second-year-branch-picker {
        grid-column: 1 / -1;
    }

    .third-year-modern .third-year-branch-picker {
        grid-column: 1 / -1;
    }

    .fourth-year-modern .fourth-year-branch-picker {
        grid-column: 1 / -1;
    }

    .subject-search-wrap {
        grid-column: 1 / -1;
    }
}

@media (max-width: 992px) {
    .year-topbar-inner {
        padding: 0 16px;
    }

    .year-desktop-nav {
        display: none;
    }

    .first-year-modern .year-sidebar {
        width: min(86vw, 320px);
        box-shadow: 14px 0 40px rgba(14, 45, 36, 0.18);
    }

    .first-year-modern .w3-main {
        margin-left: 0 !important;
    }
}

@media (max-width: 680px) {
    .year-topbar .theme-toggle-label {
        display: none;
    }

    .year-topbar .theme-toggle {
        width: 40px;
        padding-inline: 0;
    }

    .first-year-dashboard {
        width: min(100% - 24px, 1180px);
        padding-top: 18px;
    }

    .year-brand .OurImage {
        width: min(210px, 55vw) !important;
        max-width: none;
        height: auto;
    }

    .year-menu-button span {
        display: none;
    }

    .year-menu-button {
        width: 40px;
        padding-inline: 0;
        justify-content: center;
    }

    .year-hero {
        padding: 30px 24px;
        border-radius: 20px;
    }

    .year-stats {
        align-items: flex-start;
        flex-direction: column;
    }

    .resource-toolbar {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }

    .second-year-modern .second-year-toolbar {
        grid-template-columns: 1fr;
    }

    .third-year-modern .third-year-toolbar {
        grid-template-columns: 1fr;
    }

    .fourth-year-modern .fourth-year-toolbar {
        grid-template-columns: 1fr;
    }

    .second-year-modern .second-year-branch-picker {
        grid-column: auto;
    }

    .third-year-modern .third-year-branch-picker {
        grid-column: auto;
    }

    .fourth-year-modern .fourth-year-branch-picker {
        grid-column: auto;
    }

    .subject-search-wrap {
        grid-column: auto;
    }

    .subject-grid {
        grid-template-columns: 1fr;
    }

    .subject-card:has(.accordion.active) {
        grid-column: auto;
    }

    .first-year-modern .subject-card .panel .w3-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "details"
            "actions";
        gap: 18px;
        padding: 18px !important;
    }

    .third-year-modern .subject-card .panel .unit-card,
    .fourth-year-modern .subject-card .panel .unit-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "details"
            "actions";
        gap: 18px;
        padding: 18px !important;
    }

    .first-year-modern .OurButton {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    .results-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .year-footer-main {
        padding: 0 16px;
    }

    .year-footer-links {
        padding: 20px 0;
        gap: 10px 22px;
    }

    .year-footer-disclaimer {
        text-align: center;
    }

    .year-footer-bottom {
        min-height: auto;
        padding: 18px 0;
        flex-direction: column;
        gap: 9px;
        text-align: center;
    }
}
