* {
    box-sizing: border-box;
}

.usa-logo__text {
    font-size: 1.25rem;
}

body>nav {
    border-bottom: 1px solid rgba(0, 0, 0, .1);
}

header {
    background-color: var(--green-70);
}

svg[class^="lucide-"] {
    fill: none;
    stroke: black;
    stroke: light-dark(black, white);
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.usa-logo__text a {
    color: white;
}
.usa-logo__text a * {
    vertical-align: middle;
}
.usa-logo__text svg {
    stroke: white;
}

.usa-nav {
    background-color: white;
    border-bottom: 2px solid var(--gray-cool-5);
}

.usa-logo {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

body {
    background-color: var(--gray-cool-2);
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body > main {
    flex-grow: 1;
}

.usa-collection__meta-item :is(svg, span) {
    vertical-align: middle;
}

.usa-collection__item {
    border-top: 0;
}

button.usa-button {
    display: block;
    margin: 0;
}

form.usa-form {
    width: 100%;
    max-width: initial !important;
    margin: 1rem 0;
}

fieldset.usa-fieldset {
    display: block;
    margin-left: 2px;
    margin-right: 2px;
    padding-top: 0.35em;
    padding-bottom: 0.625em;
    padding-left: 0.75em;
    padding-right: 0.75em;
    border: 2px groove black;
}

legend.usa-legend {
    display: block;
    padding-left: 2px;
    padding-right: 2px;
    border: none;
}

label.usa-label:first-child {
    margin-top: 0;
}

td>ul.usa-collection {
    margin-top: 0;
}

td>ul.usa-collection>li.usa-collection__item {
    padding-top: 0;
}

td>ul.usa-collection>li.usa-collection__item h4.usa-collection__heading>* {
    vertical-align: middle;
}

.usa-button-group__item .usa-button {
    padding-top: .75rem;
    padding-bottom: .75rem;
    margin-top: 0;
}

#page-profile {
    & table.usa-table {
        grid-template-columns: auto 1fr;
        width: 100%;

        & td {
            padding-right: 0.25rem;

            & table {
                grid-template-columns: auto 1fr auto 1fr auto auto;
                gap: 0.25rem;

                &:not(:is(:empty, :-moz-only-whitespace)) {
                    padding-bottom: 0.25rem;
                }
                & td {
                    padding: 0;
                    border-width: 0;
                    display: flex;
                    align-items: center;

                    & >* {
                        display: inline-block;
                    }
                    & button {
                        margin-top: 0;
                    }
                }
                & tr.htmx-swapping td {
                    opacity: 0;
                    transition: opacity .25s ease-out;
                }
            }
        }
    }
    & form {
        margin: 0;
    }
}

#page-invites {
    & table {
        grid-template-columns: auto auto 1fr auto;

        & pre {
            margin: 0;
        }
        & tr.htmx-swapping td {
            opacity: 0;
            transition: opacity .25s ease-out;
        }
    }
}

#page-user {
    & table.usa-table {
        grid-template-columns: auto 1fr;
        width: 100%;
    }
    & table.keys {
        grid-template-columns: auto 1fr;

        & td {
            padding: 0;
            border-width: 0;
        }
    }
}

#page-verifykey {
    & .usa-label {
        margin-top: 1em;
    }
}

.nsa-input-otp {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.25em;
}

#page-view-group {
    & table {
        width: 100%;
        grid-template-columns: auto auto 1fr auto;
        border-collapse: collapse;

        & :is(th, td):not(:is(:nth-last-child(2), :nth-last-child(1))) {
            border-right: 0;
        }
        & td:empty, th:last-child:empty {
            padding: 0;
        }
        & button.usa-tag {
            background-color: var(--green-cool-40v);
        }
    }
}

#page-view-client {
    & dl {
        display: grid;
        grid-template-columns: auto auto;
        max-width: fit-content;

        & dt {
            font-weight: bold;
        }
        & dd {
            & kbd {
                display: block;
            }
        }
    }
}
