#syllabus-print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 0 0 18px;
}

#syllabus-print-actions button {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    background: var(--accent, #a7f3d0);
    color: #10251e;
    font: 700 .88rem/1.2 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}

#syllabus-print-actions button:hover {
    color: #10251e;
    background: var(--accent-2, #c0ffe0);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .36);
    transform: translateY(-2px);
}

#syllabus-print-actions button:focus-visible {
    outline: 3px solid var(--accent-2, #ffd28a);
    outline-offset: 3px;
}

#syllabus-print-header {
    display: none;
}

#syllabus-print-footer {
    display: none;
}

@media print {
    @page {
        size: A4;
        margin: 25mm 14mm 18mm;
    }

    html,
    body {
        height: auto !important;
        overflow: visible !important;
        color: #172033 !important;
        background: #fff !important;
        background-image: none !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body,
    .app,
    .content,
    main {
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        color: #172033 !important;
        box-shadow: none !important;
    }

    .content {
        width: 100% !important;
        max-width: none !important;
        padding-top: 0 !important;
    }

    #syllabus-print-actions,
    .topbar,
    .sidebar,
    .menu-btn,
    .beu-pyq-home-link,
    .topic-actions-container,
    .ask-ai-topic-button,
    .search-youtube-button,
    .mark-complete-button,
    [data-topic-action],
    .ad-container,
    ins.adsbygoogle {
        display: none !important;
    }

    #syllabus-print-header {
        position: static;
        display: block !important;
        box-sizing: border-box;
        min-height: 12mm;
        margin: 0;
        padding: 2.5mm 4mm;
        border: 0;
        border-radius: 3mm;
        background: linear-gradient(110deg, #172554 0%, #1d4ed8 55%, #0891b2 100%) !important;
        color: #fff !important;
        font: 8.5pt/1.35 Arial, sans-serif;
        box-shadow: 0 1.5mm 3mm rgba(15, 23, 42, .24);
    }

    #syllabus-print-heading {
        display: inline-block;
        margin: 0 5mm 0 0;
        color: #fff !important;
        font-size: 10pt;
        font-weight: 700;
    }

    #syllabus-print-source {
        display: inline-block;
        color: #dbeafe !important;
    }

    #syllabus-print-source a {
        display: inline-block;
        padding: 1mm 2.5mm;
        border: 1px solid rgba(255, 255, 255, .7);
        border-radius: 999px;
        color: #fff !important;
        text-decoration: none !important;
        font-weight: 700;
        overflow-wrap: anywhere;
    }

    #syllabus-print-source-url {
        /* The clickable source link is enough; printing the full URL can wrap
           the fixed header over the syllabus content. */
        display: none !important;
    }

    #syllabus-print-footer {
        position: fixed;
        right: 14mm;
        bottom: 6mm;
        left: 14mm;
        display: block !important;
        padding-top: 2mm;
        border-top: 1px solid #cbd5e1;
        color: #64748b !important;
        font: 8pt/1.25 Arial, sans-serif;
        text-align: center;
    }

    #syllabus-print-footer a {
        color: #1d4ed8 !important;
        text-decoration: underline !important;
    }

    .page-header {
        margin: 0 0 7mm !important;
        padding: 0 0 3mm !important;
        border-bottom: 1px solid #cbd5e1 !important;
        color: #172033 !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .page-header .page-title {
        margin: 0 0 2mm !important;
        color: #0f172a !important;
        font-size: 20pt !important;
        font-weight: 700 !important;
        letter-spacing: 0 !important;
        text-align: left !important;
    }

    .page-header .page-subtitle {
        margin: 0 !important;
        color: #475569 !important;
        font-size: 11pt !important;
        opacity: 1 !important;
        text-align: left !important;
    }

    h1,
    h2,
    h3 {
        color: #172033 !important;
        text-shadow: none !important;
    }

    #credits-table-container,
    #credits-table-container:not(.expanded),
    .tab-content,
    .subject-card,
    #syllabus-content,
    .course-unit,
    .unit-topics,
    .outcomes-details,
    details,
    details:not([open]) > :not(summary) {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    #filter-controls,
    .syllabus-tabs,
    .tab-btn,
    .credits-toggle svg {
        display: none !important;
    }

    .info-card,
    .info-card *,
    .subject-card,
    .subject-card * {
        color: #172033 !important;
        text-shadow: none !important;
    }

    .info-card,
    .subject-card,
    .theory-card,
    .lab-card,
    .course-unit,
    details {
        border: 1px solid #d9e1ec !important;
        border-radius: 8px !important;
        background: #fff !important;
        box-shadow: none !important;
        break-inside: auto;
    }

    .info-card,
    .subject-card {
        margin: 0 0 5mm !important;
        padding: 4mm !important;
        border-top: 2.5pt solid #2563eb !important;
    }

    .subject-card:nth-of-type(odd) {
        border-top-color: #0891b2 !important;
    }

    #syllabus-content > .subject-card {
        break-before: page;
        page-break-before: always;
    }

    .info-card h2,
    .subject-card > h2 {
        margin: 0 0 3mm !important;
        padding: 0 0 2mm !important;
        border-bottom: 1px solid #d9e1ec !important;
        color: #0f172a !important;
        font-size: 15pt !important;
        line-height: 1.25 !important;
        text-align: left !important;
    }

    .info-card h3,
    .info-card .unit-title {
        margin: 4mm 0 2mm !important;
        color: #1e3a8a !important;
        font-size: 11.5pt !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        text-align: left !important;
        break-after: avoid;
        page-break-after: avoid;
    }

    .info-card p,
    .info-card li,
    .info-card td,
    .info-card th {
        color: #172033 !important;
        font-size: 10.5pt !important;
        line-height: 1.5 !important;
    }

    .info-card p,
    .info-card li {
        opacity: 1 !important;
    }

    .info-card li {
        margin-bottom: 2mm !important;
    }

    .info-card strong {
        color: #0f172a !important;
        font-weight: 700 !important;
    }

    details {
        margin: 2.5mm 0 !important;
        padding: 2.5mm 3mm !important;
    }

    details > summary {
        color: #1e3a8a !important;
        font-weight: 700;
        font-size: 10.5pt !important;
        break-after: avoid;
        page-break-after: avoid;
    }

    .outcomes-list,
    .unit-topics,
    .reference-list,
    .subject-units {
        padding-left: 6mm !important;
        margin: 2mm 0 !important;
    }

    .unit-topics > li,
    .outcomes-list > li {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    table {
        width: 100% !important;
        height: auto !important;
        border-collapse: collapse !important;
        color: #172033 !important;
        background: #fff !important;
        font-size: 10pt !important;
    }

    thead {
        display: table-header-group;
    }

    th,
    td {
        border: 1px solid #cbd5e1 !important;
        padding: 2.5mm !important;
        color: #172033 !important;
        background: #fff !important;
        vertical-align: top !important;
    }

    th {
        background: #eef3fb !important;
        color: #1e3a8a !important;
        font-weight: 700 !important;
    }

    tbody tr:nth-child(even) td {
        background: #f8fbff !important;
    }

    tr,
    .course-unit {
        break-inside: auto;
        page-break-inside: auto;
    }

    .topic-completed,
    .topic-completed * {
        opacity: 1 !important;
    }

    a {
        color: #1458a6 !important;
    }
}
