/* --- Core Variables & Reset --- */
:root {
    --dark-blue: #0F2B5C;
    --primary-blue: #1E73E8;
    --light-blue-bg: #F5F9FF; 
    --card-shadow: 0 12px 40px -8px rgba(15, 43, 92, 0.08);
    --card-shadow-hover: 0 20px 50px -10px rgba(30, 115, 232, 0.20);
    --white: #FFFFFF;
    --text-dark: #1A202C;
    --text-muted: #4A5568;
    --gradient-blue: linear-gradient(135deg, #1E73E8 0%, #0F2B5C 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-blue-bg);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Hero Section --- */
.hero {
    background: var(--white);
    margin: 2rem auto 1.5rem auto;
    padding: 3rem 4rem; 
    max-width: 1300px; 
    width: 95%;
    border-radius: 2rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

/* Static Decorative Artifacts */
.static-design {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.shape-circle {
    width: 220px;
    height: 220px;
    background: var(--gradient-blue);
    right: -40px;
    top: -40px;
    opacity: 0.08;
}

.shape-blob {
    width: 150px;
    height: 150px;
    background: rgba(30, 115, 232, 0.05);
    right: 40px;
    bottom: -30px;
    border: 1px solid rgba(30, 115, 232, 0.1);
}

.hero-text {
    flex: 1;
    min-width: 200px;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    color: var(--dark-blue);
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero-text h1 span { color: var(--primary-blue); }
.hero-text p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.6; }

/* Mascot Wrapper */
.mascot-wrapper {
    flex: 0 0 330px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.mascot-wrapper img {
    width: 100%;
    max-width: 330px;
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 12px 20px rgba(30, 115, 232, 0.15));
}

/* --- Clean Single Search Bar Section --- */
body :where(.search-section),
.search-section {
    max-width: 1300px; 
    margin: 0 auto 2.5rem auto !important;
    width: 95%;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

body :where(.search-container),
.search-container {
    position: relative !important;
    width: 100% !important;
    max-width: 700px !important; 
    margin: 0 auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.search-container input {
    width: 100%;
    padding: 1.1rem 1.4rem 1.1rem 3.4rem !important;
    border-radius: 1.2rem !important;
    border: 2px solid #E2E8F0 !important;
    background: var(--white) !important;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    box-shadow: var(--card-shadow) !important;
    transition: all 0.25s ease;
    outline: none;
}

.search-container input:focus {
    border-color: var(--primary-blue) !important;
    box-shadow: 0 0 0 4px rgba(30, 115, 232, 0.14), var(--card-shadow) !important;
}

/* Suggestions Dropdown */
.suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    border-radius: 1.2rem;
    border: 1px solid #E2E8F0;
    background: var(--white);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    z-index: 9999;
}

.suggestion-item, .suggestion-empty {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 1rem 1.4rem;
    text-align: left;
    border: none;
    border-bottom: 1px solid #F1F5F9;
    background: transparent;
    cursor: pointer;
}

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

.suggestion-item:hover {
    background: rgba(30, 115, 232, 0.06);
}

.suggestion-item strong {
    font-size: 0.95rem;
    color: var(--dark-blue);
}

.suggestion-item span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Content & Cards Section --- */
.content-section {
    max-width: 1300px; 
    margin: 0 auto 4rem auto;
    padding: 0 1rem;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.pdf-card,
.note-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.pdf-card:hover,
.note-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(30, 115, 232, 0.2);
}

.pdf-card .card-body,
.note-card .card-body { margin-bottom: 1.2rem; }

.pdf-card h3,
.note-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag-subject {
    background: rgba(30, 115, 232, 0.08);
    color: var(--primary-blue);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tag-year {
    background: #F1F5F9;
    color: var(--text-muted);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.card-actions,
.note-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

/* Balanced Icon Buttons */
.btn-icon,
.note-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.2rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    flex: 1;
    gap: 0.5rem;
}

.btn-view,
.note-btn-view {
    background: rgba(30, 115, 232, 0.06);
    color: var(--primary-blue);
    border: 1px solid rgba(30, 115, 232, 0.15);
}
.btn-view:hover,
.note-btn-view:hover {
    background: #DBEAFE;
    transform: translateY(-2px);
}

.btn-download,
.note-btn-download {
    background: var(--gradient-blue);
    color: var(--white);
    border: 1px solid transparent;
    box-shadow: 0 4px 10px rgba(30, 115, 232, 0.2);
}
.btn-download:hover,
.note-btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 115, 232, 0.35);
}

.btn-view.is-disabled,
.btn-download.is-disabled,
.note-btn-view.is-disabled,
.note-btn-download.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Empty State / No Results */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    background: var(--white);
    padding: 4rem;
    border-radius: 2rem;
    box-shadow: var(--card-shadow);
    color: var(--text-muted);
}
.empty-state h3 { color: var(--dark-blue); margin-bottom: 0.5rem; font-size: 1.5rem; }
.empty-state span { color: var(--primary-blue); font-weight: 600; }

/* Coming Soon Wrapper */
.coming-soon-wrapper {
    text-align: center;
    margin-top: 3.5rem;
    padding: 3rem;
    background: var(--white);
    border-radius: 2rem;
    box-shadow: var(--card-shadow);
    border-top: 6px solid var(--primary-blue);
    display: none; 
}
.coming-soon-wrapper h3 {
    color: var(--dark-blue);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}
.coming-soon-wrapper h3 span { color: var(--primary-blue); }
.coming-soon-wrapper p { color: var(--text-muted); font-size: 1rem; }

/* PDF Language Modal */
body.pdf-language-open {
    overflow: hidden;
}

.pdf-language-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(7px);
}

.pdf-language-modal.is-open {
    display: flex;
}

.pdf-language-dialog {
    position: relative;
    width: min(420px, 100%);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
    text-align: center;
}

.pdf-language-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    color: #334155;
    background: #f1f5f9;
    font-size: 1.2rem;
    cursor: pointer;
}

.pdf-language-kicker {
    margin: 0 0 8px;
    padding: 0 40px; /* keeps the label clear of the close button */
    color: var(--primary-blue);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.pdf-language-dialog h2 {
    margin: 0 0 6px;
    color: var(--dark-blue);
    font-size: 1.35rem;
}

.pdf-language-dialog p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pdf-language-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.pdf-language-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    color: var(--text-dark);
    background: #f8fafc;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pdf-language-option:hover {
    border-color: var(--primary-blue);
    background: rgba(30, 115, 232, 0.08);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--white);
    border-top: 1px solid #E2E8F0;
}

/* --- Responsive Perfection --- */
@media (max-width: 768px) {
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding: 2rem 1.5rem;
        margin-top: 1rem;
    }
    .hero-text h1 { font-size: 2.2rem; }
    .card-grid { grid-template-columns: 1fr; }
    .btn-icon { padding: 0.8rem; font-size: 0.95rem; }
    
    .shape-circle { width: 180px; height: 180px; right: -30px; top: -30px; }
    .mascot-wrapper { flex: 0 0 200px; }
    .mascot-wrapper img { max-width: 200px; }
}

@media (max-width: 480px) {
    .mascot-wrapper { flex: 0 0 100px; }
    .mascot-wrapper img { max-width: 100px; }
    .hero-text h1 { font-size: 1.8rem; }
    .empty-state { padding: 2.5rem; }
}

/* Notes use the same structured paper-card language as the PYQ archive, but
   show only the details that genuinely exist for a note. */
body#notes-page .card-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}
body#notes-page .note-paper-card {
    position: relative;
    overflow: hidden;
    padding: clamp(1.1rem, 2.4vw, 2rem) !important;
    border: 1px solid #d5e5ff !important;
    border-radius: clamp(1.25rem, 2.5vw, 2rem) !important;
    background: linear-gradient(135deg, #ffffff 0%, #fbfdff 58%, #f3f7ff 100%) !important;
    box-shadow: 0 18px 42px rgba(20, 69, 137, 0.1) !important;
}
body#notes-page .note-paper-card::before {
    content: "";
    position: absolute;
    top: -165px;
    right: -130px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(75, 149, 255, 0.16), rgba(75, 149, 255, 0));
    pointer-events: none;
}
body#notes-page .note-paper-topline {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    color: #536684;
    font-size: clamp(0.7rem, 1.25vw, 0.92rem);
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}
body#notes-page .note-paper-topline > span,
body#notes-page .note-paper-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
}
body#notes-page .note-paper-topline img {
    width: 1.7rem;
    height: 1.7rem;
    object-fit: contain;
    flex: 0 0 auto;
}
body#notes-page .note-paper-badge {
    flex: 0 0 auto;
    padding: 0.5rem 0.78rem;
    border: 1px solid #f3cf7b;
    border-radius: 999px;
    background: #fffaf0;
    color: #a96800;
    letter-spacing: 0;
}
body#notes-page .note-paper-badge img { width: 1.55rem; height: 1.55rem; }
body#notes-page .note-paper-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(132px, 0.23fr) minmax(0, 1fr);
    gap: clamp(1.2rem, 3vw, 2.5rem);
    align-items: center;
    padding: 0.5rem 0 1.45rem;
}
body#notes-page .note-paper-icon {
    display: grid;
    place-items: center;
    min-height: 150px;
    padding: 0.55rem;
    border: 1px solid #85c0ff;
    border-radius: 1.45rem;
    background: linear-gradient(145deg, #8ac4ff, #2978e9);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.5), 0 14px 28px rgba(41,120,233,.22);
}
body#notes-page .note-paper-icon img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 128px;
    object-fit: contain;
}
body#notes-page .note-paper-details { min-width: 0; }
body#notes-page .note-paper-card .card-body { margin: 0; }
body#notes-page .note-paper-card h3 {
    margin: 0 0 1rem;
    color: #071d4e;
    font-size: clamp(1.5rem, 3.3vw, 3rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.045em;
}
body#notes-page .note-paper-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
body#notes-page .note-paper-metric {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 82px;
    gap: 0.68rem;
    padding: 0.72rem 0.8rem;
    border-radius: 1rem;
}
body#notes-page .note-paper-subject { background: #edf5ff; color: #1253bd; }
body#notes-page .note-paper-language { background: #ecf9f4; color: #155b56; }
body#notes-page .note-paper-metric img {
    width: 2.7rem;
    height: 2.7rem;
    object-fit: contain;
    flex: 0 0 auto;
}
body#notes-page .note-paper-metric div { min-width: 0; }
body#notes-page .note-paper-metric span {
    display: block;
    margin-bottom: 0.16rem;
    color: currentColor;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.1;
    opacity: 0.67;
    text-transform: uppercase;
}
body#notes-page .note-paper-metric strong {
    display: block;
    overflow: hidden;
    color: #0b1c48;
    font-size: clamp(0.92rem, 1.55vw, 1.25rem);
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body#notes-page .note-paper-card .card-actions {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1rem;
    margin: 0;
    padding-top: 1.25rem;
    border-top: 1px solid #dce8fa;
}
body#notes-page .note-paper-card .note-btn {
    min-height: 62px;
    border-radius: 999px;
    font-size: clamp(1rem, 1.9vw, 1.22rem);
    font-weight: 850;
}
body#notes-page .note-paper-card .note-btn img {
    width: 1.8rem;
    height: 1.8rem;
    object-fit: contain;
    flex: 0 0 auto;
}
body#notes-page .note-paper-card .note-btn-view { border-color: #9fc8ff; background: #f5f9ff; color: #112e68; }
body#notes-page .note-paper-card .note-btn-download { background: linear-gradient(135deg, #2674df, #0c347d); }
body#notes-page .note-paper-card .note-btn-view:hover,
body#notes-page .note-paper-card .note-btn-view:focus-visible {
    border-color: #9fc8ff;
    background: #f5f9ff;
    color: #112e68;
    transform: none;
    box-shadow: none;
}
body#notes-page .note-paper-card .note-btn-download:hover,
body#notes-page .note-paper-card .note-btn-download:focus-visible {
    border-color: transparent;
    background: linear-gradient(135deg, #2674df, #0c347d);
    color: #fff;
    transform: none;
    box-shadow: 0 4px 10px rgba(30, 115, 232, 0.2);
}

@media (max-width: 680px) {
    body#notes-page .note-paper-topline > span:first-child { max-width: 62%; line-height: 1.35; }
    body#notes-page .note-paper-layout { grid-template-columns: 86px minmax(0, 1fr); gap: 1rem; padding-bottom: 1.1rem; }
    body#notes-page .note-paper-icon { min-height: 108px; border-radius: 1rem; }
    body#notes-page .note-paper-icon img { min-height: 92px; }
    body#notes-page .note-paper-metrics { gap: 0.55rem; }
    body#notes-page .note-paper-metric { min-height: 65px; gap: 0.45rem; padding: 0.6rem 0.65rem; }
    body#notes-page .note-paper-metric img { width: 2.2rem; height: 2.2rem; }
    body#notes-page .note-paper-card .card-actions { grid-template-columns: 1fr; gap: .65rem; padding-top: 1rem; }
    body#notes-page .note-paper-card .note-btn { min-height: 52px; }
}

@media (max-width: 390px) {
    body#notes-page .note-paper-topline { align-items: flex-start; }
    body#notes-page .note-paper-badge { padding: .42rem .55rem; font-size: .64rem; }
}

/* Hero: same composition as the test series page. Title, copy and search on
   the left, study mascot on the right; stacked on tablets and phones. The
   artwork carries its own backdrop, so the card and shapes are dropped. */
body#notes-page .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.94fr);
    grid-template-areas:
        "text mascot"
        "search mascot";
    align-items: center;
    gap: clamp(14px, 2vw, 24px) clamp(20px, 3.5vw, 56px);
    width: min(1250px, 100% - 44px) !important;
    max-width: none;
    margin: clamp(14px, 2.4vw, 30px) auto clamp(22px, 3vw, 38px);
    /* The site-wide sheets style every .hero as a clipped card. */
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;
    box-shadow: none !important;
    overflow: visible !important;
    text-align: left;
    /* Keeps the suggestions list above the cards that follow. */
    position: relative;
    z-index: 20;
}

body#notes-page .hero .static-design { display: none; }

body#notes-page .hero-text {
    grid-area: text;
    align-self: end;
    min-width: 0;
}

body#notes-page .hero-text h1 { margin-bottom: 0.6rem; }

body#notes-page .hero-text p {
    max-width: 560px;
    margin-bottom: 0;
    hyphens: manual;
}

body#notes-page .hero .search-section {
    grid-area: search;
    align-self: start;
    width: 100% !important;
    max-width: none;
    margin: 0 !important;
}

body#notes-page .hero .search-container {
    max-width: 620px !important;
    margin: 0 !important;
}

body#notes-page .hero .search-icon { color: #1f63f0; }

body#notes-page .hero .search-container input {
    border-width: 1px !important;
    border-color: #d5e1ff !important;
    border-radius: 999px !important;
    padding-block: 1.25rem !important;
}

body#notes-page .mascot-wrapper {
    grid-area: mascot;
    display: block;
    min-width: 0;
}

body#notes-page .mascot-wrapper img {
    width: 100%;
    max-width: none;
    height: auto;
    filter: none;
}

@media (max-width: 960px) {
    body#notes-page .hero {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "text"
            "mascot"
            "search";
        row-gap: 12px;
    }

    body#notes-page .mascot-wrapper {
        width: min(100%, 520px);
        justify-self: center;
    }

    body#notes-page .hero .search-container { max-width: none !important; }
}

/* Search suggestions: plain white rows, not the site-wide gradient buttons. */
body#notes-page .suggestions .suggestion-item,
body#notes-page .suggestions .suggestion-empty {
    min-height: 0 !important;
    padding: 0.7rem 1.1rem !important;
    border: 0 !important;
    border-bottom: 1px solid #eef2f9 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    align-items: flex-start !important;
    text-align: left !important;
    transform: none !important;
}

body#notes-page .suggestions .suggestion-item:hover,
body#notes-page .suggestions .suggestion-item:focus-visible {
    background: #f2f7ff !important;
}

/* "New" tag for recently added items */
.gx-new-tag {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(120deg, #ff7a18, #ff3d54);
  box-shadow: 0 3px 8px rgba(255, 77, 77, .28);
  color: #fff !important;
  font: 800 10px/1 Inter, Arial, sans-serif !important;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.card-status-row .gx-new-tag { margin-left: 0; }

/* Card icons are Lucide line icons; the large 3D artwork on each card stays. */
body#notes-page .note-paper-topline lucide-icon { width: 18px; height: 18px; color: #1d4ed8; }
body#notes-page .note-paper-badge lucide-icon { width: 16px; height: 16px; color: #b7791f; }
body#notes-page .note-paper-metric lucide-icon,
body#notes-page .note-paper-course lucide-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 10px;
  background: #e8f0ff;
  color: #1d4ed8;
}
body#notes-page .note-paper-card .btn-icon lucide-icon { width: 18px; height: 18px; }

/* Phones: a compact card. A small icon sits beside the title and the details
   run full width below it. The site-wide phone rule forces every "layout"
   into one column, which blew the icon up to the full card width, so the
   columns are pinned here. */
@media (max-width: 680px) {
    body#notes-page .note-paper-card { padding: 0.9rem !important; border-radius: 1.1rem !important; }
    body#notes-page .note-paper-topline { gap: 0.6rem; padding-bottom: 0.7rem; font-size: 0.66rem; }
    body#notes-page .note-paper-topline lucide-icon { width: 15px; height: 15px; }
    body#notes-page .note-paper-badge { padding: 0.32rem 0.58rem; }
    body#notes-page .note-paper-layout {
        grid-template-columns: 50px minmax(0, 1fr) !important;
        gap: 0.55rem 0.7rem;
        padding: 0 0 0.85rem;
    }
    body#notes-page .note-paper-details,
    body#notes-page .note-paper-card .card-body { display: contents; }
    body#notes-page .note-paper-icon {
        display: grid;
        width: 50px;
        height: 50px;
        min-height: 0;
        padding: 0.22rem;
        border-radius: 0.8rem;
        box-shadow: inset 0 1px 1px rgba(255,255,255,.5), 0 6px 12px rgba(41,120,233,.18);
    }
    body#notes-page .note-paper-icon img { min-height: 0; }
    body#notes-page .note-paper-card h3 {
        margin: 0;
        font-size: 1.05rem !important;
        line-height: 1.22 !important;
        letter-spacing: -0.02em;
    }
    body#notes-page .note-paper-metrics,
    body#notes-page .note-paper-course { grid-column: 1 / -1; }
    body#notes-page .note-paper-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.5rem; }
    body#notes-page .note-paper-metric,
    body#notes-page .note-paper-course { min-height: 0; margin-top: 0; gap: 0.5rem; padding: 0.5rem 0.6rem; border-radius: 0.8rem; }
    body#notes-page .note-paper-metric lucide-icon,
    body#notes-page .note-paper-course lucide-icon { width: 30px; height: 30px; padding: 6px; border-radius: 8px; }
    body#notes-page .note-paper-metric span,
    body#notes-page .note-paper-course span { font-size: 0.58rem; }
    body#notes-page .note-paper-metric strong,
    body#notes-page .note-paper-course strong { font-size: 0.86rem; line-height: 1.2; white-space: normal; overflow-wrap: break-word; }
    body#notes-page .note-paper-card .card-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.5rem;
        padding-top: 0.8rem;
    }
    body#notes-page .note-paper-card .card-actions .btn-icon {
        min-height: 44px !important;
        padding: 0.45rem 0.5rem !important;
        gap: 0.4rem;
        font-size: 0.86rem !important;
        white-space: nowrap !important;
    }
    body#notes-page .note-paper-card .btn-icon lucide-icon { width: 16px; height: 16px; }
}

/* Notes published as web pages (utils/webNotes.js): one card per note, with a
   cover in the brand colours. Listed above the PDF notes. */
.wn-section { max-width: 1300px; width: 100%; margin: 0 auto 2rem; padding: 0 1rem; text-align: left; font-family: "Inter", Arial, sans-serif; }
.wn-section[hidden], .wn-card[hidden], .wn-subject[hidden], .wn-category[hidden] { display: none; }
.wn-subject { margin: 0 0 2.5rem; }
.wn-subject__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #dbe5f5; }
.wn-subject__head h2 { margin: 0; color: var(--dark-blue); font-size: clamp(1.25rem, 3vw, 1.65rem); }
.wn-subject__head > span { color: var(--text-muted); font-size: .85rem; white-space: nowrap; }
.wn-category { margin-bottom: 24px; }
.wn-category > h3 { margin: 0 0 14px; color: var(--text-muted); font-size: .9rem; font-weight: 600; }
.wn-cover__topic { position: relative; z-index: 1; max-width: 85%; font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
.wn-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; perspective: 1200px; }

/* The site-wide link rule centres everything inside links with !important. */
.wn-card { position: relative; display: flex; flex-direction: column; align-items: stretch !important; text-align: left; text-decoration: none; color: var(--text-dark); background: var(--white); border: 1px solid #dbe5f5; border-radius: 18px; overflow: hidden; transform-style: preserve-3d; box-shadow: 0 1px 2px rgba(15, 43, 92, .06), 0 8px 18px -10px rgba(15, 43, 92, .28), 0 18px 34px -24px rgba(15, 43, 92, .35); transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s cubic-bezier(.2, .8, .2, 1), border-color .2s; }
.wn-card:hover, .wn-card:focus-visible { transform: translateY(-8px) rotateX(5deg); border-color: #b9cdf0; box-shadow: 0 2px 4px rgba(15, 43, 92, .08), 0 20px 34px -14px rgba(15, 43, 92, .38), 0 34px 60px -30px rgba(30, 115, 232, .45); }
.wn-card:focus-visible { outline: 3px solid var(--primary-blue); outline-offset: 3px; }

.wn-cover { position: relative; display: flex; flex-direction: column; justify-content: space-between; height: 150px; padding: 16px 18px; color: #fff; background: radial-gradient(circle at 88% 12%, rgba(255, 255, 255, .22), transparent 42%), linear-gradient(135deg, #1b1f7a 0%, #0f2b5c 45%, #1e73e8 100%); border-bottom: 4px solid #f0b400; overflow: hidden; }
.wn-cover::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 220px; height: 220px; border-radius: 50%; border: 26px solid rgba(255, 255, 255, .07); }
.wn-cover__mark { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .25)); }
.wn-cover__subject { position: relative; z-index: 1; max-width: 75%; font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #dbe8ff; }
.wn-cover__unit { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 8px; font: 800 3rem/1 "Manrope", "Inter", Arial, sans-serif; letter-spacing: -.02em; text-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.wn-cover__unit small { font: 700 .78rem/1 "Inter", Arial, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: #f0b400; }

.wn-card__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 22px; }
.wn-card__body strong { font: 700 1.12rem/1.3 "Inter", Arial, sans-serif; color: var(--dark-blue); }
.wn-card__text { font-size: .9rem; line-height: 1.55; color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  .wn-card, .wn-card:hover, .wn-card:focus-visible { transition: none; transform: none; }
}
.wn-card__languages { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.wn-card__languages > span { display:inline-block; padding:3px 7px; border-radius:6px; background:#eaf5ee; color:#276444; font-size:.7rem; }
