:root {
    color-scheme: light;
    --background: #f5f5f2;
    --paper: #fff;
    --text: #20201e;
    --muted: #66645f;
    --border: #cfcec8;
    --link: #174f78;
    --danger: #8a2525;
    --notice: #eef5e9;
}

* { box-sizing: border-box; }

html { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; }

body {
    margin: 0;
    color: var(--text);
    background: var(--background);
    line-height: 1.5;
}

a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: .12em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #e3a52b;
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: .75rem;
    top: -4rem;
    padding: .5rem .75rem;
    background: var(--paper);
    z-index: 10;
}
.skip-link:focus { top: .75rem; }

.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--border);
}
.site-header nav {
    max-width: 76rem;
    margin: 0 auto;
    padding: .8rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}
.wordmark { color: var(--text); font-weight: 700; text-decoration: none; margin-right: .5rem; }
.account { color: var(--muted); margin-left: auto; }
.inline-form { margin: 0; }
.link-button { background: none; border: 0; color: var(--link); padding: 0; text-decoration: underline; }

.page-shell { max-width: 76rem; min-height: calc(100vh - 8rem); margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.narrow { max-width: 42rem; }
.site-footer { max-width: 76rem; margin: 0 auto; padding: 1rem 1.25rem 2rem; color: var(--muted); font-size: .875rem; }

h1, h2, h3 { line-height: 1.2; margin-top: 0; }
h1 { font-size: 2rem; margin-bottom: 1.25rem; }
h2 { font-size: 1.35rem; margin-top: 2rem; }
h3 { font-size: 1.05rem; }
p { max-width: 76ch; }
.muted, .hint { color: var(--muted); }
.hint { margin: .4rem 0 .7rem; font-size: .925rem; }
.annotation { color: var(--muted); font-size: .85em; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }

form { max-width: 48rem; }
fieldset { border: 1px solid var(--border); padding: 1rem; margin: 0 0 1.25rem; background: var(--paper); }
legend { font-weight: 650; padding: 0 .35rem; }
.field { margin: 0 0 1rem; }
.field.compact { margin-bottom: .65rem; }
label { display: block; font-weight: 600; margin-bottom: .25rem; }
label input[type="checkbox"] { margin-right: .4rem; }
input, select, textarea, button { font: inherit; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    width: 100%;
    max-width: 42rem;
    padding: .5rem .6rem;
    color: var(--text);
    background: var(--paper);
    border: 1px solid #88867f;
    border-radius: 2px;
}
input[readonly] { background: #ecece8; }
textarea { resize: vertical; }
button, .button-link {
    display: inline-block;
    border: 1px solid #45443f;
    border-radius: 2px;
    padding: .48rem .8rem;
    background: #f0f0ec;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
}
button:hover, .button-link:hover { background: #e4e4df; }
button.danger { color: var(--danger); border-color: var(--danger); }
.field-error, .validation-summary { color: var(--danger); }
.field-error { display: block; min-height: 1.25em; font-size: .9rem; }
.validation-summary:empty, .field-error:empty { display: none; }
.validation-summary { border-left: 4px solid var(--danger); padding-left: .75rem; margin: 1rem 0; }

.heading-row, .action-row, .filter-form, .section-nav {
    display: flex;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
}
.heading-row { justify-content: space-between; align-items: start; }
.heading-row h1 { margin-bottom: .25rem; }
.action-row form { margin: 0; }
.filter-form { margin: 1.25rem 0; }
.filter-form .field { margin: 0; min-width: 12rem; }
.section-nav { margin: -1rem 0 1.5rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.stats div { background: var(--paper); padding: .8rem; }
.stats dt { color: var(--muted); font-size: .875rem; }
.stats dd { margin: .2rem 0 0; font-size: 1.5rem; font-weight: 650; }

.details { max-width: 55rem; border-top: 1px solid var(--border); }
.details div { display: grid; grid-template-columns: minmax(9rem, 1fr) 3fr; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

section { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1rem; }
.danger-zone { border-color: #c69c9c; }
.notice { padding: .65rem .8rem; background: var(--notice); border-left: 4px solid #527548; }
.secret-result { padding: 1rem; background: #fffbe6; border: 1px solid #c9b761; }
.secret-result h2 { margin-top: 0; }
.check-list { display: grid; gap: .4rem; margin: 0 0 1rem; }
.check-list label { font-weight: 400; }

.application-list { max-width: 55rem; border-top: 1px solid var(--border); }
.application-list article { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.application-list h2 { margin: 0 0 .35rem; }
.application-list p { margin: .35rem 0; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--paper); }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: .875rem; color: var(--muted); background: #ecece8; }
.status { font-weight: 650; }
.status-active, .status-accepted, .status-enabled { color: #315c2b; }
.status-locked, .status-revoked, .status-deleted { color: var(--danger); }
.status-pending, .status-disabled { color: #765b12; }
.pagination { margin-top: 1rem; }

@media (max-width: 42rem) {
    .site-header nav { align-items: flex-start; gap: .65rem 1rem; }
    .account { order: 3; width: 100%; margin-left: 0; }
    .page-shell { padding-top: 1.3rem; }
    h1 { font-size: 1.65rem; }
    .details div { grid-template-columns: 1fr; }
    .details dt { font-weight: 650; }
    table, thead, tbody, tr, th, td { display: block; }
    thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    tr { padding: .45rem 0; border-bottom: 1px solid var(--border); }
    td { display: grid; grid-template-columns: 7rem 1fr; gap: .5rem; border: 0; padding: .25rem .6rem; }
    td::before { content: attr(data-label); color: var(--muted); font-size: .875rem; }
}
