.roster-vatcan-note {
    background-color: #3d842a;
    border: 0;
    color: var(--czvr-white);
}

.roster-cert-table thead th {
    white-space: nowrap;
}

.roster-toggle-option {
    background-color: var(--czvr-white);
    border: 1px solid var(--czvr-green);
    color: var(--czvr-green-dark);
    padding: 0.4rem 1rem;
}

.btn-check:not(:checked) + .roster-toggle-option:hover {
    background-color: var(--czvr-surface-muted);
    border-color: var(--czvr-green);
    color: var(--czvr-green-dark);
}

.roster-reset-warning,
.roster-inactive-warning,
.roster-active-warning {
    display: none;
}

.roster-edit-toggles :has(#rating_hours-true:checked) .roster-reset-warning,
.roster-edit-toggles :has(#active-0:checked) .roster-inactive-warning,
.roster-edit-toggles :has(#active-1:checked) .roster-active-warning {
    display: block;
}

.roster-edit-toggles .btn-check:checked + .roster-toggle-option {
    background-color: var(--czvr-green);
    border-color: var(--czvr-green);
    color: var(--czvr-white);
}

.roster-edit-toggles .btn-check:focus-visible + .roster-toggle-option {
    box-shadow: 0 0 0 0.2rem var(--czvr-focus) !important;
}

.roster-cert-table thead tr:first-child th {
    border-bottom: 0;
    padding-bottom: 0.25rem;
}

.roster-cert-position span {
    border-bottom: 2px solid var(--czvr-border);
    display: block;
    font-weight: 600;
    margin: 0 0.6rem;
    padding-bottom: 0.35rem;
}

.roster-cert-option {
    cursor: pointer;
    margin: 0;
    padding: 0.15rem;
}

.btn-check:not(:checked) + .roster-cert-option {
    opacity: 0.25;
}

.btn-check:not(:checked) + .roster-cert-option:hover {
    opacity: 0.6;
}

.btn-check:focus-visible + .roster-cert-option {
    border-radius: 50%;
    box-shadow: 0 0 0 0.2rem var(--czvr-focus);
}

.flex-container {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    margin: 0;
}

@media (max-width: 767.98px) {
    .roster-cert-table { table-layout: fixed; width: 100%; font-size: .72rem; }
    .roster-cert-table th,
    .roster-cert-table td { padding: .3rem .1rem !important; overflow-wrap: anywhere; hyphens: auto; }
    .roster-cert-table thead th { font-size: .62rem; line-height: 1.15; white-space: normal; }
    .roster-cert-table thead [data-short] { font-size: 0; }
    .roster-cert-table thead th { overflow-wrap: normal; overflow: visible; }
    .roster-cert-table thead [data-short]::after { content: attr(data-short); font-size: .62rem; white-space: nowrap; }
    .roster-cert-table thead tr:first-child th:first-child,
    .roster-cert-table tbody th { width: 4.2rem; }
    .roster-cert-position span { margin: 0 .1rem; padding: 0 .1rem; }
    .roster-cert-option { padding: .15rem; font-size: .85rem; }
}

@media (max-width: 767.98px) {
    :is(#rosterTable, #visitRosterTable) thead { display: none; }
    :is(#rosterTable, #visitRosterTable),
    :is(#rosterTable, #visitRosterTable) tbody { display: block; width: 100% !important; }
    :is(#rosterTable, #visitRosterTable) tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .35rem .6rem;
        margin-bottom: .75rem;
        padding: .7rem .75rem;
        border: 1px solid var(--czvr-border);
        border-radius: .6rem;
        background: var(--czvr-surface);
    }
    :is(#rosterTable, #visitRosterTable) tbody tr::before,
    :is(#rosterTable, #visitRosterTable) tbody tr::after {
        content: "";
        flex-basis: 100%;
        height: 0;
    }
    :is(#rosterTable, #visitRosterTable) tbody tr::before { order: 1; }
    :is(#rosterTable, #visitRosterTable) tbody tr::after { order: 3; }

    :is(#rosterTable, #visitRosterTable) tbody tr > * {
        display: block;
        flex: 0 0 auto;
        padding: 0 !important;
        border: 0 !important;
        background: none;
        text-align: left !important;
    }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(-n+3) { order: 0; }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(2),
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(3) { font-weight: 600; }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(n+4):nth-child(-n+9) { order: 2; min-width: 3.2rem; }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(n+4):nth-child(-n+9)::before {
        display: block;
        color: var(--czvr-text-muted);
        font-size: .7rem;
        font-weight: 500;
    }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(4)::before { content: "FSS"; }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(5)::before { content: "DEL/GND"; }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(6)::before { content: "TWR"; }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(7)::before { content: "DEP"; }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(8)::before { content: "APP"; }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(9)::before { content: "CTR"; }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(10) { order: 4; flex-basis: 100%; color: var(--czvr-text-muted); font-size: var(--czvr-font-size-base); }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(11) { order: 5; padding: .1rem .5rem !important; border-radius: .35rem; font-size: var(--czvr-font-size-base); }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(11).bg-success { background: var(--czvr-green) !important; }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(11).bg-danger { background: #e51c23 !important; }
    :is(#rosterTable, #visitRosterTable) tbody tr > :nth-child(12) { order: 5; }
    :is(#rosterTable, #visitRosterTable) tbody tr > td[colspan] { flex-basis: 100%; }
    :is(#rosterTable, #visitRosterTable) tbody tr > td[colspan] { flex-basis: 100%; }

    .roster-legend { padding: .5rem; }
    #rosterLegend { table-layout: fixed; width: 100%; margin-bottom: 0; font-size: .75rem; }
    #rosterLegend th, #rosterLegend td { padding: .45rem .15rem; }
    #rosterLegend thead th { font-size: .68rem; line-height: 1.2; vertical-align: bottom; }
    #rosterLegend thead th:first-child, #rosterLegend tbody th { width: 30%; padding-left: .35rem; }
    #rosterLegend thead [data-short] { font-size: 0; }
    #rosterLegend thead [data-short]::after { content: attr(data-short); font-size: .68rem; font-weight: 700; }
    #rosterLegend td i { font-size: 1.1rem; }
}
