/* Keep vendor branding out of every user-facing platform page. */
body :is(
    a[href*="moodle.org" i],
    img[alt*="Moodle" i],
    img[title*="Moodle" i],
    img[src*="moodle" i]
) {
    display: none !important;
}

.pa-welcome {
    color: #1f2328;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.55;
}

.pa-welcome p,
.pa-welcome li {
    font-weight: 400 !important;
}

.pa-welcome strong,
.pa-welcome b {
    font-weight: 600 !important;
}

body:has(.pa-m00-scope),
body:has(.pa-m00-scope) button,
body:has(.pa-m00-scope) input,
body:has(.pa-m00-scope) select,
body:has(.pa-m00-scope) textarea,
body:has(.pa-m00-scope) .main-inner,
body:has(.pa-m00-scope) .activity-header,
body:has(.pa-m00-scope) .activity-description,
body:has(.pa-m00-scope) .box.generalbox,
body:has(.pa-m00-scope) .book_content {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body:has(.pa-m00-scope) .activity-header h1,
body:has(.pa-m00-scope) .activity-header h2,
body:has(.pa-m00-scope) .page-header-headings h1,
body:has(.pa-m00-scope) .box.generalbox h2,
body:has(.pa-m00-scope) .box.generalbox h3,
body:has(.pa-m00-scope) .box.generalbox h4,
body:has(.pa-m00-scope) .book_content h2,
body:has(.pa-m00-scope) .book_content h3,
body:has(.pa-m00-scope) .book_content h4 {
    font-family: inherit;
    font-weight: 500;
    letter-spacing: -0.012em;
}

body:has(.pa-m00-scope) .box.generalbox strong,
body:has(.pa-m00-scope) .book_content strong {
    font-weight: 600;
}

body:has(.pa-m00-scope) .box.generalbox,
body:has(.pa-m00-scope) .book_content {
    color: #25282c;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.6;
}

body:has(.pa-m00-scope) .box.generalbox p,
body:has(.pa-m00-scope) .box.generalbox li,
body:has(.pa-m00-scope) .box.generalbox td,
body:has(.pa-m00-scope) .book_content p,
body:has(.pa-m00-scope) .book_content li,
body:has(.pa-m00-scope) .book_content td {
    font-weight: 400 !important;
}

body:has(.pa-m00-scope) .box.generalbox h2,
body:has(.pa-m00-scope) .book_content h2 {
    margin-top: 38px;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 600;
}

body:has(.pa-m00-scope) .box.generalbox h3,
body:has(.pa-m00-scope) .book_content h3 {
    margin-top: 32px;
    font-size: 26px;
    font-weight: 600;
}

body:has(.pa-m00-scope) .box.generalbox h4,
body:has(.pa-m00-scope) .book_content h4 {
    margin-top: 28px;
    font-size: 21px;
    font-weight: 600;
}

body:has(.pa-m00-scope) .box.generalbox summary,
body:has(.pa-m00-scope) .book_content summary {
    font-weight: 500 !important;
}

body:has(.pa-m00-scope) .box.generalbox button,
body:has(.pa-m00-scope) .box.generalbox [role="button"],
body:has(.pa-m00-scope) .book_content button,
body:has(.pa-m00-scope) .book_content [role="button"] {
    border-radius: 6px;
    font-weight: 600 !important;
}

body:has(.pa-m00-scope) .pa-learner-action {
    border-radius: 0 8px 8px 0;
}

body:has(.pa-m00-scope) .pa-learner-action > div:first-child {
    font-weight: 600 !important;
}

body:has(.pa-m00-scope) .pa-action-progress-note {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fff4df;
    color: #6b4b13;
    font-size: 14px;
    font-weight: 500;
}

body:has(.pa-m00-scope) .pa-action-progress-note.is-ready {
    background: #e7f3ea;
    color: #275d3b;
}

body:has(.pa-m00-scope) .pa-action-response.is-error {
    color: #9b2c2c !important;
}

body:has(.pa-m00-scope) .pa-micro-choice-option {
    color: #17212b;
    font-weight: 500;
    line-height: 1.4;
    transition: border-color .15s ease, background .15s ease;
}

body:has(.pa-m00-scope) .pa-micro-choice-option:hover,
body:has(.pa-m00-scope) .pa-micro-choice-option:focus-visible {
    border-color: #2f6f8f !important;
    background: #eef6fa !important;
}

body:has(.pa-m00-scope) .pa-micro-choice-option.is-correct {
    border-color: #2f855a !important;
    background: #e7f3ea !important;
}

body:has(.pa-m00-scope) .pa-micro-choice-option.is-wrong {
    border-color: #b7791f !important;
    background: #fff7e6 !important;
}

body:has(.pa-m00-scope) .pa-micro-choice-feedback.is-correct {
    background: #e7f3ea;
    color: #275d3b;
}

body:has(.pa-m00-scope) .pa-micro-choice-feedback.is-wrong {
    background: #fff7e6;
    color: #7a4a08;
}

body:has(.pa-m00-scope) a.pa-action-locked-next {
    opacity: .35;
    cursor: not-allowed;
    filter: grayscale(1);
}

.pa-activity-navigation {
    display: flex;
    width: min(980px, 100%);
    box-sizing: border-box;
    gap: 12px;
    justify-content: flex-end;
    margin: 28px auto 40px;
    padding: 18px 0 0;
}

.pa-previous-activity,
.pa-next-activity {
    display: inline-flex;
    max-width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    background: #1673c9;
    color: #fff !important;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none !important;
}

.pa-activity-navigation .pa-previous-activity {
    margin-right: auto;
    background: #e8edf1;
    color: #27313a !important;
}

.pa-previous-activity::before {
    margin-right: 10px;
    content: "←";
}

.pa-next-activity::after {
    margin-left: 10px;
    content: "→";
}

.pa-next-activity:hover,
.pa-next-activity:focus-visible {
    background: #115da4;
}

.pa-previous-activity:hover,
.pa-previous-activity:focus-visible {
    background: #d8e0e6;
}

body:has(.pa-m00-scope) .pa-visual-flow {
    position: relative;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px !important;
    margin: 20px 0 32px !important;
}

body:has(.pa-m00-scope) .pa-visual-step {
    position: relative;
    min-width: 0 !important;
    padding: 22px !important;
    border: 1px solid #d6e1e8;
    border-radius: 10px;
    background: #f7fafc !important;
    font-weight: 400 !important;
}

body:has(.pa-m00-scope) .pa-visual-step:not(:last-child)::after {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: -20px;
    color: #2f6f8f;
    content: "→";
    font-size: 24px;
    font-weight: 500;
    transform: translateY(-50%);
}

body:has(.pa-m00-scope) .pa-visual-number {
    margin-bottom: 12px !important;
    background: #2f6f8f !important;
    font-weight: 600 !important;
}

body:has(.pa-m00-scope) .pa-visual-step strong {
    display: block;
    font-size: 18px;
    font-weight: 600;
}

body:has(.pa-m00-scope) .pa-visual-flow--comparison {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body:has(.pa-m00-scope) .pa-visual-flow--comparison .pa-visual-step:nth-child(2) {
    background: #fffaf0 !important;
}

body:has(.pa-m00-scope) .pa-visual-flow--layers,
body:has(.pa-m00-scope) .pa-visual-flow--conversation {
    grid-template-columns: 1fr;
}

body:has(.pa-m00-scope) .pa-visual-flow--layers .pa-visual-step {
    margin-right: calc(var(--pa-layer, 0) * 22px);
    border-left: 5px solid #2f6f8f;
}

body:has(.pa-m00-scope) .pa-visual-flow--layers .pa-visual-step:nth-child(2) {
    margin-left: 24px;
}

body:has(.pa-m00-scope) .pa-visual-flow--layers .pa-visual-step:nth-child(3) {
    margin-left: 48px;
}

body:has(.pa-m00-scope) .pa-visual-flow--layers .pa-visual-step:nth-child(4) {
    margin-left: 72px;
}

body:has(.pa-m00-scope) :is(.pa-visual-flow--hub, .pa-visual-flow--groups, .pa-visual-flow--checklist, .pa-visual-flow--checkpoints) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body:has(.pa-m00-scope) .pa-visual-flow--systems .pa-visual-step {
    border: 2px solid #8fb7ca;
    border-radius: 999px;
    text-align: center;
}

body:has(.pa-m00-scope) .pa-visual-flow--checklist .pa-visual-number,
body:has(.pa-m00-scope) .pa-visual-flow--groups .pa-visual-number {
    background: #e4f2e8 !important;
    color: #287a4b !important;
}

body:has(.pa-m00-scope) .pa-visual-flow--conversation .pa-visual-step {
    width: 78%;
    border-radius: 18px 18px 18px 4px;
}

body:has(.pa-m00-scope) .pa-visual-flow--conversation .pa-visual-step:nth-child(even) {
    margin-left: auto;
    border-radius: 18px 18px 4px;
    background: #eef6fa !important;
}

body:has(.pa-m00-scope) .pa-visual-flow--decision {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body:has(.pa-m00-scope) .pa-visual-flow--decision .pa-visual-step:first-child {
    grid-column: 1 / -1;
    width: 48%;
    margin: 0 auto;
}

body:has(.pa-m00-scope) .pa-visual-flow:not(.pa-visual-flow--timeline):not(.pa-visual-flow--conversation):not(.pa-visual-flow--checkpoints) .pa-visual-number {
    width: 18px !important;
    height: 18px !important;
    color: transparent !important;
}

body:has(.pa-m00-scope) .pa-visual-flow:not(.pa-visual-flow--timeline):not(.pa-visual-flow--systems) .pa-visual-step::after,
body:has(.pa-m00-scope) .pa-visual-flow--comparison .pa-visual-step::after,
body:has(.pa-m00-scope) .pa-visual-flow--hub .pa-visual-step::after,
body:has(.pa-m00-scope) .pa-visual-flow--groups .pa-visual-step::after,
body:has(.pa-m00-scope) .pa-visual-flow--checklist .pa-visual-step::after,
body:has(.pa-m00-scope) .pa-visual-flow--decision .pa-visual-step::after {
    content: none;
}

@media (max-width: 767.98px) {
    body:has(.pa-m00-scope) .pa-visual-flow {
        grid-template-columns: 1fr;
    }

    body:has(.pa-m00-scope) .pa-visual-flow--conversation .pa-visual-step,
    body:has(.pa-m00-scope) .pa-visual-flow--decision .pa-visual-step:first-child {
        width: auto;
    }

    body:has(.pa-m00-scope) .pa-visual-flow--layers .pa-visual-step {
        margin-left: 0 !important;
    }

    body:has(.pa-m00-scope) .pa-visual-step:not(:last-child)::after {
        top: auto;
        right: 50%;
        bottom: -23px;
        content: "↓";
        transform: translateX(50%);
    }
}

body:has(.pa-m00-scope) .activity-header h1,
body:has(.pa-m00-scope) .page-header-headings h1 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

body.path-course-view:has(.pa-m00-scope) #page-content {
    padding-top: 24px;
}

body.path-course-view:has(.pa-m00-scope) .course-section-header h2,
body.path-course-view:has(.pa-m00-scope) .course-section-header .sectionname {
    font-weight: 600;
    letter-spacing: -0.02em;
}

body.path-course-view:has(.pa-m00-scope) .pa-m00-section-summary {
    max-width: 760px;
    margin: 18px 0 28px;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.6;
}

.pa-welcome h3,
.pa-welcome h4 {
    color: #17191c;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.pa-note {
    margin: 24px 0;
    padding: 18px 20px;
    border: 1px solid #dedede;
    background: #f7f7f5;
    color: #30343a;
}

.pa-note--result {
    border-left: 3px solid #34383d;
    background: #fff;
}

.pa-journey {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    counter-reset: pa-journey;
    margin: 40px 0;
    padding: 0;
    list-style: none;
}

.pa-journey::before {
    position: absolute;
    top: 16px;
    right: 16.666%;
    left: 16.666%;
    height: 1px;
    background: #c9cdd1;
    content: "";
}

.pa-journey-step {
    position: relative;
    padding: 0 24px;
    counter-increment: pa-journey;
}

.pa-journey-step::before {
    position: relative;
    z-index: 1;
    display: flex;
    width: 32px;
    height: 32px;
    margin: 0 auto 18px;
    align-items: center;
    justify-content: center;
    border: 1px solid #34383d;
    border-radius: 50%;
    background: #fff;
    color: #202327;
    content: counter(pa-journey);
    font-size: 14px;
    font-weight: 500;
}

.pa-journey-content {
    max-width: 250px;
    margin: 0 auto;
}

.pa-journey-title {
    margin: 0 0 8px;
    font-size: 20px;
}

.pa-journey-text {
    margin: 0;
    color: #50555b;
    font-size: 16px;
}

.pa-start-action {
    margin-top: 32px;
    padding: 28px;
    border: 1px solid #d7dadd;
    background: #fff;
}

.pa-practice-step {
    display: none;
    margin: 12px 0;
    padding: 20px;
    border: 1px solid #d8e0e6;
    border-radius: 10px;
    background: #fff;
}

.pa-practice-step.is-active {
    display: block;
}

.pa-practice-input {
    display: block;
    width: 100%;
    margin: 12px 0;
    padding: 12px;
    border: 1px solid #aebfcb;
    border-radius: 7px;
    font: inherit;
}

.pa-practice-previous,
.pa-practice-next {
    padding: 11px 17px;
    border: 0;
    border-radius: 7px;
    background: #1673c9;
    color: #fff;
    font-weight: 600;
}

.pa-practice-previous {
    margin-right: 10px;
    background: #e8edf1;
    color: #27313a;
}

.pa-practice-next:disabled {
    background: #8fa7b8;
}

.pa-practice-feedback {
    margin-top: 10px;
}

.pa-practice-feedback.is-correct {
    color: #23683c;
}

.pa-practice-feedback.is-wrong {
    color: #9b2c2c;
}

@media (max-width: 767.98px) {
    .pa-journey {
        display: block;
        margin: 32px 0;
    }

    .pa-journey::before {
        top: 16px;
        right: auto;
        bottom: 24px;
        left: 16px;
        width: 1px;
        height: auto;
    }

    .pa-journey-step {
        min-height: 112px;
        padding: 0 0 28px 56px;
    }

    .pa-journey-step::before {
        position: absolute;
        top: 0;
        left: 0;
        margin: 0;
    }

    .pa-journey-content {
        max-width: none;
        margin: 0;
    }

    .pa-start-action {
        padding: 22px;
    }

}
/* Мінімальний особистий кабінет, доки календар і часова шкала не використовуються. */
#page-my-index #block-region-content .block_timeline,
#page-my-index #block-region-content .block_recentlyaccesseditems,
#page-my-index .drawer-right,
#page-my-index .drawer-right-toggle,
#page-my-index .editmode-switch-form {
    display: none !important;
}

#page-my-index .main-inner {
    max-width: 960px;
    margin-inline: auto !important;
}

#page-my-index #block-region-content .block_calendar_month {
    display: block !important;
    max-width: 680px;
    margin-top: 16px;
}

.pa-module-overview {
    max-width: 980px;
    margin: 0 auto;
    color: #20252b;
}

.pa-module-overview-hero {
    padding: clamp(28px, 5vw, 52px);
    background: linear-gradient(135deg, #eef7fb 0%, #f7f4ff 100%);
    border: 1px solid #dce6ed;
    border-radius: 24px;
}

.pa-module-overview-meta {
    margin-bottom: 14px;
    color: #35657b;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pa-module-overview-hero h2 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(30px, 5vw, 50px);
    font-weight: 650;
    letter-spacing: -.025em;
    line-height: 1.08;
}

.pa-module-overview-result {
    max-width: 720px;
    margin: 22px 0 0;
    color: #44515c;
    font-size: clamp(18px, 2.2vw, 22px);
    line-height: 1.5;
}

.pa-module-overview-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.pa-module-overview-card {
    padding: 24px;
    background: #fff;
    border: 1px solid #dfe4e8;
    border-radius: 18px;
}

.pa-module-overview-card > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 22px;
    background: #eaf4f8;
    border-radius: 50%;
    color: #35657b;
    font-size: 13px;
    font-weight: 700;
}

.pa-module-overview-card h3 {
    margin: 0 0 10px !important;
    font-size: 21px !important;
    font-weight: 650 !important;
}

.pa-module-overview-card p {
    margin: 0;
    color: #59636c;
    font-size: 16px;
    line-height: 1.55;
}

.pa-module-overview-route {
    padding: 26px 28px;
    background: #202a33;
    border-radius: 18px;
    color: #fff;
}

.pa-module-overview-route h3 {
    margin: 0 0 18px !important;
    color: inherit;
    font-size: 20px !important;
}

.pa-module-overview-route ol {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: 0;
    margin: 0;
    counter-reset: module-route;
    list-style: none;
}

.pa-module-overview-route li {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #e8edf0;
    font-size: 14px;
}

.pa-module-overview-route li::before {
    display: inline-flex;
    flex: 0 0 26px;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid #71808c;
    border-radius: 50%;
    content: counter(module-route);
    counter-increment: module-route;
    font-size: 12px;
}

.pa-module-overview-footer {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    padding: 24px 4px 4px;
}

.pa-module-overview-footer p {
    margin: 0;
    color: #66717a;
    font-size: 14px;
}

.pa-module-overview-footer .pa-start-module {
    min-height: 48px;
    padding-inline: 24px;
    border-radius: 10px;
    font-weight: 650;
}

/* The module overview has its own single, descriptive primary action. */
body:has(.pa-module-overview) .pa-activity-navigation,
body:has(.pa-module-overview) .activity-navigation {
    display: none !important;
}

/* Presentation books: one concise chapter per screen with button navigation. */
body:has(.pa-book-presentation) .activity-description,
body:has(.pa-book-presentation) .block_book_toc,
body:has(.pa-book-presentation) .book_toc,
body:has(.pa-book-presentation) .pa-activity-navigation,
body:has(.pa-book-presentation) #page-header,
body:has(.pa-book-presentation) .secondary-navigation,
body:has(.pa-book-presentation) .activity-header {
    display: none !important;
}

body:has(.pa-book-presentation) #page {
    min-height: calc(100vh - 70px);
    overflow: visible;
}

body:has(.pa-book-presentation) .main-inner {
    padding-top: 16px !important;
}

body:has(.pa-book-presentation) #region-main {
    position: relative;
    padding: 0 !important;
}

body:has(.pa-book-presentation) #mod_book-chapter.book_content {
    box-sizing: border-box;
    max-width: 1040px;
    height: auto;
    min-height: 0;
    margin: 0 auto;
    padding: 0;
    overflow: visible;
    border: 1px solid #dce5eb;
    border-radius: 24px;
    background: linear-gradient(145deg, #fff 0%, #f7fafc 100%);
    box-shadow: 0 22px 60px rgb(26 55 75 / 10%);
}

body:has(.pa-book-presentation) #mod_book-chapter > .no-overflow,
body:has(.pa-book-presentation) #mod_book-chapter > .overflow-auto {
    box-sizing: border-box;
    height: auto;
    overflow: visible !important;
}

.pa-presentation-slide {
    position: relative;
    display: flex;
    box-sizing: border-box;
    height: auto;
    min-height: calc(100vh - 220px);
    padding: 54px 72px 86px;
    flex-direction: column;
    justify-content: flex-start;
}

.pa-page-presentation {
    width: 100%;
}

.pa-page-presentation .pa-presentation-slide {
    max-width: 1040px;
    margin: 0 auto;
}

.pa-presentation-slide__progress {
    margin-bottom: 18px;
    color: #39718e;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pa-presentation-slide h4 {
    max-width: 820px;
    margin: 0 0 28px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.pa-presentation-slide p,
.pa-presentation-slide li,
.pa-presentation-slide td,
.pa-presentation-slide th {
    font-size: 17px;
    line-height: 1.45;
}

body:has(.pa-book-presentation) #mod_book-chaptersnavigation {
    display: none !important;
}

.pa-presentation-controls {
    display: flex;
    max-width: 1040px;
    width: auto;
    margin: 20px auto 0;
    padding: 0 24px;
    align-items: center;
    justify-content: space-between;
    transform: none;
}

.pa-presentation-details {
    max-width: 880px;
    margin: 56px auto 96px;
    padding: 0 24px;
}

.pa-presentation-details__title {
    margin-bottom: 24px;
}

.pa-presentation-control {
    display: inline-flex;
    min-width: 120px;
    padding: 12px 18px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 750;
}

.pa-presentation-control--previous::after {
    content: "Назад";
    margin-left: 8px;
}

.pa-presentation-control--next,
.pa-presentation-control--finish {
    margin-left: auto;
    color: #fff;
    background: #1673c9;
}

.pa-presentation-control--next::before {
    content: "Далі";
    margin-right: 8px;
}

@media (max-width: 820px), (max-height: 720px) {
    body:has(.pa-book-presentation) #mod_book-chapter.book_content {
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .pa-presentation-slide {
        height: auto;
        min-height: 480px;
        padding: 34px 28px 82px;
    }
}

@media (max-width: 760px) {
    .pa-module-overview-cards,
    .pa-module-overview-route ol {
        grid-template-columns: 1fr;
    }

    .pa-module-overview-footer {
        align-items: stretch;
        flex-direction: column;
    }
}
