.org,
.org *,
.org *::before,
.org *::after {
    box-sizing: border-box;
}

.org {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.org-lead {
    align-self: stretch;
    margin: 0 0 28px;
    max-width: 68ch;
}

.org-tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.org-tier::after {
    content: "";
    width: 2px;
    height: 22px;
    background: var(--brown);
}

.org-node,
.org-roles p {
    margin: 0;
}

.org-board,
.org-director,
.org-head {
    width: min(100%, 280px);
    padding: 14px 18px;
    border-radius: 14px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.org-board {
    background: var(--brown);
    color: var(--white);
}

.org-director {
    background: var(--red);
    color: var(--white);
}

.org-director-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
}

.org-director {
    grid-column: 2;
    justify-self: center;
}

.org-finance {
    grid-column: 3;
    display: flex;
    align-items: center;
    min-width: 0;
    padding-right: 4px;
}

.org-hline {
    flex: none;
    width: 28px;
    height: 2px;
    background: var(--brown);
}

.org-side,
.org-head,
.org-roles p {
    background: var(--light);
    color: var(--black);
    border: 2px solid var(--brown);
    border-radius: 14px;
}

.org-side {
    width: min(100%, 240px);
    padding: 12px 14px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.org-heads {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "hm ps"
        "roles roles";
    column-gap: 20px;
    row-gap: 0;
    width: 100%;
    align-items: start;
}

.org-hm {
    grid-area: hm;
    gap: 0;
}

.org-hm::after {
    content: "";
    width: 2px;
    height: 18px;
    background: var(--brown);
}

.org-ps {
    grid-area: ps;
}

.org-heads::before {
    content: "";
    position: absolute;
    top: 0;
    left: calc(25% + 5px);
    right: calc(25% + 5px);
    height: 2px;
    background: var(--brown);
}

.org-col {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding-top: 18px;
}

.org-col.org-hm {
    gap: 0;
}

.org-col::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 18px;
    background: var(--brown);
    transform: translateX(-50%);
}

.org-roles {
    grid-area: roles;
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 18px 0 0;
    list-style: none;
}

.org-roles::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: var(--brown);
}

.org-roles li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 18px 0 0;
    background: transparent;
    border: 0;
}

.org-roles li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 18px;
    background: var(--brown);
    transform: translateX(-50%);
}

.org-roles p {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 72px;
    margin: 0;
    padding: 12px 10px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.org-vline {
    width: 2px;
    height: 16px;
    flex: none;
    background: var(--brown);
}

html[data-theme="dark"] .org-tier::after,
html[data-theme="dark"] .org-hline,
html[data-theme="dark"] .org-heads::before,
html[data-theme="dark"] .org-col::before,
html[data-theme="dark"] .org-hm::after,
html[data-theme="dark"] .org-roles::before,
html[data-theme="dark"] .org-roles li::before,
html[data-theme="dark"] .org-vline {
    background: #c4a08e;
}

html[data-theme="dark"] .org-side,
html[data-theme="dark"] .org-head,
html[data-theme="dark"] .org-roles p {
    background: #3a2d26;
    color: #f4eee9;
    border-color: #c4a08e;
}

@media (max-width: 800px) {
    .org-tier::after,
    .org-hline,
    .org-heads::before,
    .org-col::before,
    .org-hm::after,
    .org-roles::before,
    .org-roles li::before {
        display: none;
    }

    .org-tier + .org-tier,
    .org-tier + .org-heads,
    .org-heads {
        margin-top: 18px;
    }

    .org-director-row {
        grid-template-columns: 1fr;
        justify-items: center;
        row-gap: 10px;
        width: min(100%, 280px);
    }

    .org-director,
    .org-finance {
        grid-column: 1;
    }

    .org-finance {
        display: block;
        width: 100%;
        padding-right: 0;
    }

    .org-side {
        width: 100%;
    }

    .org-heads {
        grid-template-columns: 1fr;
        grid-template-areas:
            "hm"
            "roles"
            "ps";
        row-gap: 18px;
    }

    .org-col,
    .org-roles li {
        padding-top: 0;
    }

    .org-roles {
        padding-top: 0;
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
