/* Education Quality Assurance Department page — scoped styles (prefix: .qa-)
   Reuses the site's brand blue (#0096db) and the Roboto Slab font from base.html,
   with the same values as the other department pages. */

.qa-page {
    --qa-primary: #0096db;
    --qa-primary-dark: #0987c2;
    --qa-primary-deep: #075e87;
    --qa-ink: #1e293b;
    --qa-muted: #64748b;
    --qa-line: #e2e8f0;
    --qa-bg-soft: #f4f8fb;
    --qa-tint: rgba(0, 150, 219, .12);
    --qa-radius: 16px;
    --qa-shadow: 0 10px 30px -12px rgba(2, 74, 110, .25);
    --qa-shadow-hover: 0 18px 40px -16px rgba(2, 74, 110, .35);
    --qa-space: clamp(48px, 7vw, 96px);
    /* connector lines of the org chart, the team tree and the levels; solid,
       so the segments meeting in a gap leave no darker seam */
    --qa-link: #99d5f1;
    --qa-link-gap: 32px;
    /* the site's navbar sticks to the top once the page scrolls: a section
       reached through an anchor starts below it, not under it */
    --qa-sticky-offset: 96px;
    color: var(--qa-ink);
    overflow-x: hidden;
}

.qa-page .container {
    max-width: 1200px;
}

.qa-page [id] {
    scroll-margin-top: var(--qa-sticky-offset);
}

.qa-page a:focus-visible {
    outline: 3px solid var(--qa-primary);
    outline-offset: 3px;
    border-radius: 6px;
}

.qa-hero a:focus-visible {
    outline-color: #fff;
}

.qa-section {
    padding: var(--qa-space) 0;
}

.qa-section:nth-of-type(even) {
    background: var(--qa-bg-soft);
}

.qa-section__head {
    max-width: 780px;
    margin: 0 auto clamp(28px, 4vw, 44px);
    text-align: center;
    /* overrides the global `header { background-color: #5d5d5d }` from styles.css */
    background: transparent;
}

.qa-section__title {
    font-size: clamp(26px, 3.4vw, 40px);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 12px;
    color: var(--qa-ink);
}

/* a second heading inside the same section */
.qa-section__head--next {
    margin-top: var(--qa-space);
}

.qa-section__lead {
    color: var(--qa-muted);
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.65;
    margin: 0;
}

/* the icon tiles of the cards */
.qa-direction__icon,
.qa-area__icon,
.qa-unit__icon,
.qa-practice__icon,
.qa-term__icon,
.qa-doc__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--qa-primary), var(--qa-primary-dark));
}

/* the white card the sections are built of */
.qa-direction,
.qa-area,
.qa-practice,
.qa-term,
.qa-achievement,
.qa-kpi,
.qa-doc,
.qa-unit,
.qa-legal {
    background: #fff;
    border: 1px solid var(--qa-line);
    border-radius: var(--qa-radius);
    box-shadow: var(--qa-shadow);
}

/* ---------- Buttons ---------- */
.qa-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
    border: 2px solid transparent;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
    cursor: pointer;
}

.qa-btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.qa-btn--primary {
    background: var(--qa-primary);
    color: #fff;
    box-shadow: 0 8px 20px -8px rgba(0, 150, 219, .8);
}

.qa-btn--primary:hover {
    background: var(--qa-primary-dark);
    color: #fff;
}

.qa-btn--ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, .55);
}

.qa-btn--ghost:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border-color: #fff;
}

/* ---------- Hero ---------- */
.qa-hero {
    position: relative;
    color: #fff;
    padding: clamp(48px, 8vw, 104px) 0 clamp(44px, 7vw, 84px);
    background:
        radial-gradient(120% 120% at 85% 0%, rgba(255, 255, 255, .16), transparent 55%),
        linear-gradient(135deg, var(--qa-primary) 0%, var(--qa-primary-dark) 45%, var(--qa-primary-deep) 100%);
    overflow: hidden;
}

/* the PDCA cycle on the right; from 992px only: on a narrower hero it would sit behind the text */
.qa-hero__cycle {
    display: none;
    position: absolute;
    right: max(24px, calc((100% - 1200px) / 2));
    top: 50%;
    width: min(36%, 400px);
    height: auto;
    transform: translateY(-50%);
    pointer-events: none;
}

.qa-hero__orbit {
    fill: none;
    stroke: rgba(255, 255, 255, .16);
    stroke-width: 1.5;
    stroke-dasharray: 4 8;
}

.qa-hero__arc {
    fill: none;
    stroke: rgba(255, 255, 255, .7);
    stroke-width: 10;
    stroke-linecap: round;
}

.qa-hero__arrowhead {
    fill: rgba(255, 255, 255, .7);
}

.qa-hero__letter {
    fill: #fff;
    font-size: 40px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: middle;
}

.qa-hero__shield {
    fill: rgba(255, 255, 255, .16);
    stroke: #fff;
    stroke-width: 4;
    stroke-linejoin: round;
}

.qa-hero__check {
    fill: none;
    stroke: #fff;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (prefers-reduced-motion: no-preference) {
    /* the four arcs are drawn once, one after the other; 200 is a little over each arc's length */
    .qa-hero__arc {
        stroke-dasharray: 200;
        stroke-dashoffset: 200;
        animation: qa-draw .6s ease-out forwards;
    }

    .qa-hero__arc:nth-of-type(1) { animation-delay: .2s; }
    .qa-hero__arc:nth-of-type(2) { animation-delay: .6s; }
    .qa-hero__arc:nth-of-type(3) { animation-delay: 1s; }
    .qa-hero__arc:nth-of-type(4) { animation-delay: 1.4s; }
}

@keyframes qa-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.qa-hero__inner {
    position: relative;
    z-index: 1;
}

.qa-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 14px;
    flex-wrap: wrap;
}

.qa-breadcrumb .breadcrumb-item,
.qa-breadcrumb .breadcrumb-item a,
.qa-breadcrumb .breadcrumb-item.active {
    color: rgba(255, 255, 255, .85);
}

.qa-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, .55);
}

.qa-hero__eyebrow {
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: 13px;
    font-weight: 600;
    opacity: .85;
    margin: 18px 0 10px;
}

.qa-hero__title {
    max-width: 680px;
    font-size: clamp(30px, 5vw, 54px);
    font-weight: 800;
    line-height: 1.12;
    margin: 0 0 20px;
    color: #fff;
}

.qa-hero__lead {
    color: rgba(255, 255, 255, .92);
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.7;
    max-width: 640px;
    margin: 0 0 28px;
}

.qa-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* ---------- Quick facts ---------- */
.qa-facts {
    background: var(--qa-primary-deep);
    padding: 0;
}

.qa-facts__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.qa-fact {
    padding: 26px 18px;
    text-align: center;
    color: #fff;
    border-left: 1px solid rgba(255, 255, 255, .14);
}

.qa-fact:first-child {
    border-left: none;
}

.qa-fact__value {
    display: block;
    font-size: clamp(24px, 3.2vw, 36px);
    font-weight: 800;
    line-height: 1.1;
}

.qa-fact__label {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .8);
}

/* ---------- Section links ---------- */
.qa-jumpnav {
    background: #fff;
    border-bottom: 1px solid var(--qa-line);
}

.qa-jumpnav__list {
    list-style: none;
    margin: 0;
    padding: 14px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.qa-jumpnav__list a {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--qa-ink);
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.qa-jumpnav__list a:hover {
    color: var(--qa-primary-deep);
    background: var(--qa-tint);
}

/* ---------- Mission ---------- */
.qa-mission {
    display: flex;
    align-items: center;
    gap: clamp(18px, 3vw, 28px);
    max-width: 960px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 40px);
    background: #fff;
    border: 1px solid var(--qa-line);
    border-left: 5px solid var(--qa-primary);
    border-radius: var(--qa-radius);
    box-shadow: var(--qa-shadow);
}

.qa-mission__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    font-size: 26px;
    color: #fff;
    background: linear-gradient(135deg, var(--qa-primary), var(--qa-primary-deep));
}

.qa-mission__text {
    margin: 0;
    font-size: clamp(17px, 2vw, 21px);
    font-weight: 600;
    line-height: 1.6;
    color: var(--qa-ink);
}

/* ---------- The mission in seven steps ---------- */
.qa-steps__title {
    margin: clamp(36px, 5vw, 56px) 0 22px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--qa-primary-deep);
}

.qa-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.qa-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.qa-step__num {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--qa-primary), var(--qa-primary-deep));
    box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--qa-line);
}

.qa-step__text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--qa-ink);
}

/* ---------- Areas of work ---------- */
.qa-directions {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.qa-direction {
    display: flex;
    flex-direction: column;
    padding: 30px 26px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.qa-direction:hover {
    transform: translateY(-4px);
    box-shadow: var(--qa-shadow-hover);
}

.qa-direction__icon {
    align-self: flex-start;
    margin-bottom: 18px;
}

.qa-direction__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.35;
}

.qa-direction__text {
    color: var(--qa-muted);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* ---------- Functions ---------- */
.qa-areas {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

.qa-area {
    position: relative;
    padding: 30px 26px;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}

.qa-area::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--qa-primary), var(--qa-primary-deep));
}

.qa-area:hover {
    transform: translateY(-4px);
    box-shadow: var(--qa-shadow-hover);
}

.qa-area__head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    /* overrides the global `header { background-color: #5d5d5d }` from styles.css */
    background: transparent;
}

.qa-area__title {
    flex: 1;
    min-width: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.qa-area__num {
    flex: none;
    align-self: flex-start;
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    color: rgba(0, 150, 219, .2);
}

.qa-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qa-checklist li {
    position: relative;
    padding-left: 30px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--qa-muted);
}

.qa-checklist li::before {
    content: "\f00c"; /* fa-check */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 3px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 10px;
    color: var(--qa-primary-deep);
    background: var(--qa-tint);
}

/* ---------- Class monitoring ---------- */
/* the cycle: four steps in a row, an arrow between each and the next */
.qa-pdca {
    list-style: none;
    margin: 0 auto clamp(28px, 4vw, 40px);
    padding: 0;
    max-width: 760px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.qa-pdca__step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.qa-pdca__step:not(:last-child)::after {
    content: "\f061"; /* fa-arrow-right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 22px;
    right: -21px;
    font-size: 14px;
    line-height: 1;
    color: var(--qa-link);
}

.qa-pdca__letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 800;
    color: var(--qa-primary-deep);
    background: #fff;
    border: 3px solid var(--qa-primary);
    box-shadow: var(--qa-shadow);
}

.qa-pdca__word {
    font-size: 15px;
    font-weight: 700;
    color: var(--qa-ink);
}

.qa-practices {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.qa-practice {
    padding: 28px 24px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.qa-practice:hover {
    transform: translateY(-4px);
    box-shadow: var(--qa-shadow-hover);
}

.qa-practice__icon {
    margin-bottom: 18px;
}

.qa-practice__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px;
}

.qa-practice__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--qa-muted);
}

/* ---------- Work plan: the two half-years ---------- */
.qa-terms {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.qa-term {
    padding: 28px 26px;
}

.qa-term__head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    /* overrides the global `header { background-color: #5d5d5d }` from styles.css */
    background: transparent;
}

.qa-term__title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

/* a vertical line through a dot per item */
.qa-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.qa-timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--qa-link);
}

.qa-timeline__item {
    position: relative;
    padding-left: 34px;
}

.qa-timeline__item + .qa-timeline__item {
    margin-top: 20px;
}

.qa-timeline__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--qa-primary);
}

.qa-timeline__when {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--qa-primary-deep);
}

.qa-timeline__what {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--qa-muted);
}

/* ---------- Work plan: the annual plan table ---------- */
.qa-table-wrap {
    background: #fff;
    border: 1px solid var(--qa-line);
    border-radius: var(--qa-radius);
    box-shadow: var(--qa-shadow);
    overflow: hidden;
}

.qa-table {
    width: 100%;
    /* overrides the global `table { margin: 16px 0 }` from styles.css */
    margin: 0;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.55;
}

/* one gradient across the whole row, not one per cell */
.qa-table thead {
    background: linear-gradient(90deg, var(--qa-primary-dark), var(--qa-primary-deep));
}

.qa-table thead th {
    padding: 16px 18px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #fff;
}

.qa-table tbody th,
.qa-table tbody td {
    padding: 16px 18px;
    vertical-align: top;
    text-align: left;
    border-top: 1px solid var(--qa-line);
    color: var(--qa-muted);
}

.qa-table tbody th {
    font-weight: 700;
    color: var(--qa-ink);
}

/* the rows are not links, so they do not light up on hover */
.qa-table tbody tr:nth-child(even) {
    background: var(--qa-bg-soft);
}

.qa-table .qa-table__num {
    width: 56px;
    text-align: center;
}

.qa-table tbody .qa-table__num {
    font-weight: 800;
    color: var(--qa-primary-deep);
}

.qa-chip {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    color: var(--qa-primary-deep);
    background: var(--qa-tint);
}

/* ---------- Achievements ---------- */
.qa-achievements,
.qa-kpis {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.qa-achievement {
    flex: 0 1 calc((100% - 48px) / 3);
    min-width: 260px;
    padding: 30px 26px;
    text-align: center;
    background:
        linear-gradient(90deg, var(--qa-primary), var(--qa-primary-deep)) top / 100% 5px no-repeat,
        #fff;
}

.qa-achievement__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    border-radius: 50%;
    font-size: 22px;
    color: var(--qa-primary-deep);
    background: var(--qa-tint);
}

.qa-achievement__value {
    display: block;
    margin-bottom: 8px;
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.15;
    color: var(--qa-primary-deep);
}

.qa-achievement__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--qa-muted);
}

/* ---------- KPIs ---------- */
.qa-kpi {
    flex: 0 1 calc((100% - 48px) / 3);
    min-width: 260px;
    display: flex;
    flex-direction: column;
    padding: 28px 26px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.qa-kpi:hover {
    transform: translateY(-4px);
    box-shadow: var(--qa-shadow-hover);
}

.qa-kpi__value {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 56px;
    margin-bottom: 14px;
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--qa-primary), var(--qa-primary-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* the two indicators without a number show an icon in the number's place */
.qa-kpi__value--icon {
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 22px;
    color: #fff;
    background-clip: border-box;
    -webkit-background-clip: border-box;
}

.qa-kpi__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px;
}

.qa-kpi__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--qa-muted);
}

/* ---------- The quality assurance system: five levels ---------- */
.qa-levels {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    counter-reset: qa-level;
}

/* each level a row: its name, its body, and a line down the left joining them */
.qa-level {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 20px 24px 20px 76px;
    background: #fff;
    border: 1px solid var(--qa-line);
    border-radius: var(--qa-radius);
    box-shadow: var(--qa-shadow);
    counter-increment: qa-level;
}

.qa-level::before {
    content: counter(qa-level);
    position: absolute;
    left: 20px;
    top: 50%;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 800;
    color: var(--qa-primary-deep);
    background: var(--qa-tint);
}

.qa-level:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 37px;
    top: calc(50% + 18px);
    height: calc(50% - 18px + 14px + 50% - 18px);
    width: 2px;
    background: var(--qa-link);
}

/* wide enough for the longest level name in each language, so every body starts on one line */
.qa-level__name {
    flex: 0 0 190px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--qa-primary-deep);
}

.qa-level__body {
    flex: 1 1 260px;
    min-width: 0;
}

.qa-level__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 4px;
}

.qa-level__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--qa-muted);
}

/* the Department's own level */
.qa-level--current {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--qa-primary) 0%, var(--qa-primary-deep) 100%);
}

.qa-level--current::before {
    color: var(--qa-primary-deep);
    background: #fff;
}

.qa-level--current .qa-level__name,
.qa-level--current .qa-level__title {
    color: #fff;
}

.qa-level--current .qa-level__text {
    color: rgba(255, 255, 255, .92);
}

.qa-level__badge {
    flex: none;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--qa-primary-deep);
    background: #fff;
}

/* ---------- Department structure (org chart) ---------- */
.qa-org__head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 420px;
    margin: 0 auto;
    padding: 22px 26px;
    border-radius: var(--qa-radius);
    color: #fff;
    background: linear-gradient(135deg, var(--qa-primary) 0%, var(--qa-primary-deep) 100%);
    box-shadow: var(--qa-shadow);
}

.qa-org__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 22px;
    background: rgba(255, 255, 255, .16);
}

.qa-org__title {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: #fff;
}

.qa-org__units {
    list-style: none;
    margin: 28px auto 0;
    padding: 0;
    max-width: 760px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

/* a position: its icon, title and area of work; the accent bar is a background layer, as
   ::before and ::after draw the connector lines */
.qa-unit {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background:
        linear-gradient(90deg, var(--qa-primary), var(--qa-primary-deep)) top / 100% 4px no-repeat,
        #fff;
    padding: 30px 22px 28px;
    text-align: center;
}

.qa-unit__icon {
    margin-bottom: 16px;
}

.qa-unit__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 6px;
}

.qa-unit__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--qa-muted);
}

/* ---------- Team ---------- */
.qa-team__grid {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.qa-team__item {
    position: relative;
    flex: 0 1 340px;
    display: flex;
}

.qa-person {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--qa-line);
    border-radius: var(--qa-radius);
    box-shadow: var(--qa-shadow);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.qa-person:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 150, 219, .45);
    box-shadow: var(--qa-shadow-hover);
}

/* the photo whole, on top of the card: the Staff photos are square */
.qa-person__photo {
    flex: none;
    aspect-ratio: 1 / 1;
    background: var(--qa-bg-soft);
}

.qa-person__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* without a photo, the initials stand in its place */
.qa-person__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 72px;
    font-weight: 800;
    letter-spacing: .04em;
    color: rgba(0, 150, 219, .35);
    background:
        radial-gradient(circle at 50% 38%, rgba(0, 150, 219, .14), transparent 60%),
        var(--qa-bg-soft);
}

.qa-person__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 22px 22px 24px;
}

.qa-person__badge {
    align-self: flex-start;
    margin-bottom: 12px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--qa-primary-deep);
    background: var(--qa-tint);
}

.qa-person__name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 6px;
    color: var(--qa-ink);
}

.qa-person__role {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--qa-muted);
}

/* at the bottom, so the contacts line up across a row whatever the length of the roles */
.qa-person__contacts {
    list-style: none;
    margin: auto 0 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--qa-line);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qa-person__contacts li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--qa-ink);
}

.qa-person__contacts i {
    flex: none;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    color: var(--qa-primary-deep);
    background: var(--qa-tint);
}

.qa-person__contacts a {
    min-width: 0;
    color: var(--qa-primary-dark);
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.qa-person__contacts a:hover {
    text-decoration: underline;
}

/* the profile links from the Staff record */
.qa-person__links {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.qa-person__links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 16px;
    color: var(--qa-primary-deep);
    background: var(--qa-tint);
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.qa-person__links a:hover {
    color: #fff;
    background: var(--qa-primary);
}

/* the Head of the Department: a wide card with the photo on the left */
.qa-team__head .qa-person--head {
    max-width: 820px;
    margin: 0 auto;
}

.qa-person--head .qa-person__badge {
    color: #fff;
    background: linear-gradient(135deg, var(--qa-primary), var(--qa-primary-deep));
}

.qa-person--head .qa-person__name {
    font-size: clamp(22px, 2.6vw, 28px);
}

.qa-person--head .qa-person__role {
    font-size: 16px;
}

@media (min-width: 768px) {
    .qa-person--head {
        flex-direction: row;
    }

    .qa-person--head .qa-person__photo {
        flex: 0 0 300px;
    }

    .qa-person--head .qa-person__body {
        justify-content: center;
        padding: 32px 36px;
    }

    .qa-person--head .qa-person__contacts {
        margin-top: 0;
    }
}

/* ---------- Documents ---------- */
/* the link at the foot of each card opens the document, so the card itself does not lift as if it were the link */
.qa-docs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.qa-doc {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
    padding: 24px 22px;
}

.qa-doc__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 6px;
}

.qa-doc__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--qa-muted);
}

.qa-doc__meta {
    margin: 12px 0 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--qa-primary-deep);
}

/* the body fills the card's height, so the links of a row line up at its foot */
.qa-doc__body {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.qa-doc__link {
    margin-top: auto;
    padding-top: 14px;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--qa-primary-dark);
    text-decoration: none;
}

.qa-doc__link:hover {
    color: var(--qa-primary-deep);
    text-decoration: underline;
}

/* the laws the Department works under */
.qa-legal {
    margin-top: 24px;
    padding: 26px 26px 22px;
}

.qa-legal__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 14px;
}

.qa-legal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.qa-legal__list a {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--qa-primary-dark);
    text-decoration: none;
}

.qa-legal__list a i {
    font-size: 12px;
}

.qa-legal__list a:hover {
    color: var(--qa-primary-deep);
    text-decoration: underline;
}

.qa-legal__note {
    display: flex;
    gap: 10px;
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--qa-line);
    font-size: 14px;
    line-height: 1.6;
    color: var(--qa-muted);
}

.qa-legal__note i {
    margin-top: 4px;
    color: var(--qa-primary);
}

/* ---------- Columns ---------- */
@media (min-width: 768px) {
    .qa-directions,
    .qa-practices,
    .qa-areas,
    .qa-terms,
    .qa-docs {
        grid-template-columns: repeat(2, 1fr);
    }

    .qa-docs > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (min-width: 992px) {
    .qa-hero__cycle {
        display: block;
    }

    .qa-directions,
    .qa-practices {
        grid-template-columns: repeat(4, 1fr);
    }

    .qa-areas,
    .qa-docs {
        grid-template-columns: repeat(3, 1fr);
    }

    .qa-docs > :last-child:nth-child(odd) {
        grid-column: auto;
    }
}

/* ---------- Connector lines (desktop) ---------- */
@media (min-width: 992px) {
    /* the seven steps joined by a line through their numbers */
    .qa-step:not(:last-child)::after {
        content: "";
        position: absolute;
        top: 21px;
        left: 50%;
        width: calc(100% + 16px);
        height: 2px;
        background: var(--qa-link);
    }

    /* org chart: the two positions in one row under the head */
    .qa-org__units {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 0;
        padding-top: calc(var(--qa-link-gap) * 2);
    }

    /* the head's stem, then a bar, then a drop to each card */
    .qa-org__head::after,
    .qa-team__head::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: calc(-1 * var(--qa-link-gap));
        width: 2px;
        height: var(--qa-link-gap);
        margin-left: -1px;
        background: var(--qa-link);
    }

    .qa-team__head {
        position: relative;
        margin-bottom: var(--qa-link-gap);
    }

    .qa-team__grid {
        flex-wrap: nowrap;
        margin-top: 0;
        padding-top: var(--qa-link-gap);
    }

    /* half the 24px gap, plus 1px so neighbouring segments overlap
       instead of leaving a sub-pixel seam where they meet */
    .qa-unit::before,
    .qa-team__item::before {
        content: "";
        position: absolute;
        left: -13px;
        right: -13px;
        height: 2px;
        background: var(--qa-link);
    }

    .qa-unit::before {
        top: calc(-1 * var(--qa-link-gap) - 1px);
    }

    .qa-team__item::before {
        top: calc(-1 * var(--qa-link-gap));
    }

    .qa-unit:first-child::before,
    .qa-team__item:first-child::before {
        left: 50%;
    }

    .qa-unit:last-child::before,
    .qa-team__item:last-child::before {
        right: 50%;
    }

    /* the drop from the bar to the card */
    .qa-unit::after,
    .qa-team__item::after {
        content: "";
        position: absolute;
        left: 50%;
        top: calc(-1 * var(--qa-link-gap));
        width: 2px;
        height: var(--qa-link-gap);
        margin-left: -1px;
        background: var(--qa-link);
    }
}

/* ---------- Table as cards (below 768px) ---------- */
@media (max-width: 767px) {
    .qa-table-wrap {
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .qa-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .qa-table,
    .qa-table tbody,
    .qa-table tr,
    .qa-table tbody th,
    .qa-table tbody td {
        display: block;
        width: 100%;
    }

    /* :nth-child(n) to outweigh the zebra of the table above */
    .qa-table tbody tr:nth-child(n) {
        position: relative;
        margin-bottom: 16px;
        padding: 18px 18px 8px;
        background: #fff;
        border: 1px solid var(--qa-line);
        border-radius: var(--qa-radius);
        box-shadow: var(--qa-shadow);
    }

    .qa-table tbody th,
    .qa-table tbody td {
        padding: 0 0 10px;
        border-top: 0;
    }

    .qa-table tbody th {
        padding-right: 44px;
        font-size: 16px;
    }

    .qa-table tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--qa-ink);
    }

    /* the number in the card's corner */
    .qa-table tbody .qa-table__num {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 30px;
        height: 30px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 14px;
        background: var(--qa-tint);
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .qa-facts__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .qa-fact:nth-child(3) {
        border-left: none;
    }

    .qa-fact:nth-child(n + 3) {
        border-top: 1px solid rgba(255, 255, 255, .14);
    }

    .qa-pdca {
        gap: 18px;
    }

    .qa-pdca__step:not(:last-child)::after {
        right: -16px;
    }
}

@media (max-width: 575px) {
    .qa-facts__grid {
        grid-template-columns: 1fr;
    }

    .qa-fact {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, .14);
        padding: 20px 16px;
    }

    .qa-fact:first-child {
        border-top: none;
    }

    .qa-mission {
        flex-direction: column;
        align-items: flex-start;
    }

    .qa-steps {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .qa-step {
        flex-direction: row;
        text-align: left;
    }

    .qa-step__num {
        flex: none;
    }

    .qa-pdca__letter {
        width: 48px;
        height: 48px;
        font-size: 21px;
    }

    .qa-pdca__step:not(:last-child)::after {
        top: 17px;
        right: -14px;
        font-size: 11px;
    }

    .qa-pdca__word {
        font-size: 13px;
    }

    .qa-achievement,
    .qa-kpi {
        flex: 1 1 100%;
        min-width: 0;
    }

    .qa-area,
    .qa-term {
        padding: 26px 20px;
    }

    .qa-level {
        padding: 18px 18px 18px 68px;
    }

    .qa-level::before {
        left: 16px;
    }

    .qa-level:not(:last-child)::after {
        left: 33px;
    }

    .qa-level__name {
        flex-basis: 100%;
    }

    .qa-org__head {
        padding: 18px 20px;
    }

    .qa-jumpnav__list a {
        padding: 8px 14px;
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .qa-page .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}
