:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #5c667a;
    --line: #ccdce7;
    --paper: #ffffff;
    --surface: #edf5fa;
    --brand: #006da5;
    --brand-dark: #0b3161;
    --accent: #ffe23b;
    --danger: #a12622;
    --success: #17633b;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: url("branding/bg-top.jpg") top center no-repeat,
        url("branding/bg-bottom.jpg") bottom center no-repeat,
        url("branding/bg-tile.jpg") center repeat-y #01b1ed;
    font: 16px/1.5 "Century Gothic", "Trebuchet MS", Arial, sans-serif;
}

a {
    color: var(--brand);
}

.shell {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-masthead .shell {
    padding-block: .75rem;
}

.site-masthead a {
    display: block;
    width: min(940px, 100%);
    margin-inline: auto;
}

.organization-logo {
    display: block;
    width: 100%;
    height: auto;
}

main.shell {
    flex: 1 0 auto;
    padding: .5rem clamp(1rem, 3vw, 2rem) 2rem;
    background: var(--paper);
}

.site-header {
    color: var(--brand-dark);
}

.site-header .shell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .25rem 1rem;
    min-height: 64px;
    padding: .7rem clamp(1rem, 3vw, 2rem);
    background: #ccdde7;
    border-top: 4px solid var(--accent);
    border-bottom: 1px solid #b3cadb;
}

.brand {
    display: flex;
    align-items: baseline;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: .15rem .55rem;
    color: var(--brand-dark);
    text-decoration: none;
}

.brand span {
    color: var(--brand);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: .06em;
}

.nav {
    display: flex;
    position: relative;
    align-items: center;
    flex: 1 1 30rem;
    gap: 1rem;
    min-width: 0;
}

.nav-primary,
.nav-utilities {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
}

.nav-primary {
    flex: 1 1 auto;
    min-width: 0;
}

.nav-utilities {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
}

.nav > a,
.nav-primary > a,
.nav-utilities > a,
.nav-dropdown > summary {
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    margin: 0;
    padding: .5rem .7rem;
    color: var(--brand-dark);
    border-radius: .35rem;
    line-height: 1.5;
    text-decoration: none;
}

.nav > a:hover,
.nav > a:focus-visible,
.nav-primary > a:hover,
.nav-primary > a:focus-visible,
.nav-utilities > a:hover,
.nav-utilities > a:focus-visible,
.nav-dropdown > summary:hover,
.nav-dropdown > summary:focus-visible,
.nav-dropdown[open] > summary {
    background: rgba(255, 255, 255, .7);
}

.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.nav-utilities > .nav-dropdown {
    position: static;
}

.nav-dropdown > summary {
    gap: .4rem;
    cursor: pointer;
    list-style: none;
}

.nav-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown > summary::marker {
    content: "";
}

.nav-dropdown > summary::after {
    width: .45rem;
    height: .45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: "";
    transform: translateY(-.12rem) rotate(45deg);
}

.nav-dropdown[open] > summary::after {
    transform: translateY(.12rem) rotate(225deg);
}

.nav-dropdown-menu {
    position: absolute;
    z-index: 1000;
    top: calc(100% + .45rem);
    right: 0;
    width: max-content;
    min-width: 0;
    max-width: calc(100vw - 2rem);
    padding: .35rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: .45rem;
    box-shadow: 0 10px 30px rgba(23, 32, 51, .22);
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .6rem .7rem;
    color: var(--ink);
    border-radius: .3rem;
    text-decoration: none;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible {
    color: var(--brand-dark);
    background: var(--surface);
}

.word-icon {
    display: block;
    width: auto;
    height: 1em;
    flex: 0 0 auto;
}

.page-heading {
    margin: 1.5rem 0;
    color: #0081c3;
    text-align: center;
}

h1,
h2,
h3 {
    line-height: 1.2;
}

h1 {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 500;
}

.card {
    margin-bottom: 1.25rem;
    padding: clamp(1rem, 3vw, 1.7rem);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: .35rem;
}

.card h2,
.card h3 {
    margin-top: 0;
}

.form-grid,
.detail-grid,
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.field {
    display: grid;
    gap: .35rem;
}

.field-wide {
    grid-column: 1 / -1;
}

label,
legend {
    font-weight: 700;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: .67rem .72rem;
    color: var(--ink);
    background: white;
    border: 1px solid #9ea8b8;
    border-radius: .35rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(0, 129, 195, .25);
    border-color: var(--brand);
}

input[readonly] {
    color: var(--muted);
    background: #eef1f5;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-weight: 500;
}

.field-error,
.required {
    color: var(--danger);
}

.field-error {
    margin: 0;
    font-size: .9rem;
}

.help,
.muted {
    color: var(--muted);
    font-size: .92rem;
}

.help-article {
    max-width: 58rem;
}

.help-article section + section {
    margin-top: 2rem;
}

.help-article li + li {
    margin-top: .5rem;
}

.help-document-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.button,
button {
    display: inline-block;
    padding: .7rem 1rem;
    color: white;
    background: var(--brand);
    border: 0;
    border-radius: .4rem;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
}

.button:hover,
button:hover {
    background: var(--brand-dark);
}

.button-secondary {
    color: var(--ink);
    background: #e6ebf2;
}

.button-danger {
    background: var(--danger);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    align-items: center;
    margin-top: 1.25rem;
}

.notice {
    margin: 1rem 0;
    padding: .85rem 1rem;
    border-left: 5px solid var(--brand);
    background: white;
}

.notice-error {
    border-color: var(--danger);
}

.notice-success {
    border-color: var(--success);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: .7rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

th {
    background: #ccdde7;
}

.number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.status {
    display: inline-block;
    padding: .2rem .5rem;
    background: #e6ebf2;
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 750;
}

.demo-bar {
    color: #332500;
    background: #ffe8a3;
    border-bottom: 1px solid #d7b343;
    font-size: .9rem;
}

.demo-bar .shell,
.identity-strip,
.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
}

.demo-bar .shell {
    min-height: 38px;
}

.identity-strip {
    justify-content: flex-end;
    margin-top: 1rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.kpi {
    display: grid;
    gap: .3rem;
}

.kpi span {
    color: var(--muted);
    font-weight: 700;
}

.kpi strong {
    color: var(--brand-dark);
    font-size: 2rem;
}

.card-heading h2,
.card-heading p {
    margin: 0;
}

.compact-row {
    align-items: end;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.status-approved,
.status-completed,
.status-sent,
.status-success {
    color: #0e4c2c;
    background: #d9f2e3;
}

.status-pending,
.status-needs_information {
    color: #624600;
    background: #fff0bd;
}

.status-declined,
.status-failed {
    color: #7d1b18;
    background: #f8dddd;
}

.summary-list {
    margin: 0;
}

.summary-list div {
    display: grid;
    grid-template-columns: minmax(130px, .45fr) 1fr;
    gap: .75rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--line);
}

.summary-list dt {
    color: var(--muted);
    font-weight: 700;
}

.summary-list dd {
    margin: 0;
}

.site-footer {
    color: var(--ink);
    font-size: .9rem;
    text-align: center;
}

.site-footer .shell {
    padding: 1.5rem clamp(1rem, 3vw, 2rem);
    background: #edf5fa;
    border-top: 1px solid var(--line);
}

.site-footer a {
    color: var(--brand);
}

.site-footer .release-version {
    color: var(--muted);
}

@media (max-width: 760px) {
    .site-header .shell,
    .form-grid,
    .detail-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .site-header .shell {
        align-items: flex-start;
        flex-direction: column;
        padding-block: 1rem;
    }

    .nav {
        width: 100%;
        flex-basis: auto;
        flex-wrap: wrap;
    }

    .nav-staff {
        flex-wrap: wrap;
    }

    .nav-staff .nav-primary {
        flex-basis: 100%;
    }

    .field-wide {
        grid-column: auto;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
