:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #17211d;
    background: #eef3f0;
    line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; }
.site-header {
    min-height: 4rem;
    padding: 0.8rem clamp(1rem, 4vw, 3rem);
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
    background: #143b2c;
    color: white;
}
.brand { color: white; font-size: 1.35rem; font-weight: 750; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 1rem; }
nav a, nav span { color: white; text-underline-offset: 0.3rem; }
nav a[aria-current="page"] { font-weight: 750; text-decoration-thickness: 0.15rem; }
.container { width: min(70rem, 100% - 2rem); margin: 3rem auto; }
.panel {
    padding: clamp(1.25rem, 4vw, 2rem);
    background: white;
    border: 1px solid #cddbd4;
    border-radius: 0.4rem;
    box-shadow: 0 0.2rem 1rem rgb(20 59 44 / 7%);
}
.narrow { max-width: 34rem; margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-block: 1.5rem; }
.stack { display: grid; gap: 0.65rem; margin-top: 1.5rem; }
.eyebrow { color: #356c56; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
h1, h2 { line-height: 1.15; }
input, textarea, select, button { min-height: 2.8rem; padding: 0.65rem 0.8rem; font: inherit; }
input, textarea, select { width: 100%; border: 1px solid #81988e; border-radius: 0.25rem; background: white; }
textarea { resize: vertical; }
button { border: 0; border-radius: 0.25rem; background: #146c4b; color: white; font-weight: 700; cursor: pointer; }
button.secondary { background: #3d4c45; }
button.danger { background: #9c2828; }
button:disabled, input:disabled { opacity: 0.6; cursor: not-allowed; }
.alert { padding: 0.8rem; border-left: 0.3rem solid #a32323; background: #fff0f0; }
.notice { margin-bottom: 1rem; padding: 0.9rem 1rem; border-left: 0.3rem solid #218052; background: #e8f7ee; }
.button { display: inline-flex; min-height: 2.8rem; padding: 0.65rem 0.9rem; align-items: center; justify-content: center; border-radius: 0.25rem; background: #146c4b; color: white; font-weight: 700; text-decoration: none; }
.button.secondary { background: #3d4c45; }
.page-heading { display: flex; gap: 2rem; align-items: end; justify-content: space-between; margin-bottom: 1.5rem; }
.page-heading h1, .page-heading p { margin-block: 0.35rem; }
.empty-state { padding-block: 4rem; text-align: center; }
.sort-bar { display: flex; gap: 0.8rem; margin-bottom: 0.75rem; justify-content: flex-end; }
.flush { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.9rem 1rem; border-bottom: 1px solid #dce5e0; text-align: left; vertical-align: top; }
th { background: #f6f9f7; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: 0; }
.muted, .help { color: #607069; }
small.muted { display: block; margin-top: 0.25rem; font-size: 0.7rem; }
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 999px; background: #e1ebe6; font-size: 0.75rem; font-weight: 750; }
.badge.active { color: #0f6241; background: #dff5e8; }
.badge.inactive { color: #666; background: #e9e9e9; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.danger-link { color: #9c2828; }
.form-panel { max-width: 44rem; margin-inline: auto; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.field-error { margin: -0.35rem 0 0; color: #9c2828; font-weight: 650; }
[aria-invalid="true"] { border-color: #a32323; box-shadow: 0 0 0 1px #a32323; }
.danger-panel { border-color: #dbadad; }
.cards-list { display: grid; gap: 1rem; }
.recipient-card { display: flex; justify-content: space-between; gap: 2rem; }
.recipient-card.inactive { opacity: 0.72; }
.recipient-card h2, .recipient-card p { margin-block: 0.2rem 0.65rem; }
.title-line { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }
.notes { white-space: normal; }
.link-button { min-height: auto; padding: 0; border: 0; background: transparent; font-weight: 400; text-decoration: underline; }
.dashboard-card { color: inherit; text-decoration: none; }
.dashboard-card:hover { border-color: #4b8a70; }
.metric { display: block; font-size: 2.2rem; font-weight: 800; color: #146c4b; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.check-list { display: grid; gap: 0.5rem; }
.check-list label { display: flex; gap: 0.7rem; padding: 0.7rem; align-items: flex-start; border: 1px solid #dce5e0; border-radius: 0.3rem; }
.check-list input { width: 1.2rem; min-height: 1.2rem; margin-top: 0.15rem; }
.check-list small { display: block; color: #607069; }
fieldset { margin: 0.8rem 0; padding: 1rem; border: 1px solid #cddbd4; border-radius: 0.3rem; }
.credential-list dt { margin-top: 1rem; color: #607069; font-weight: 700; }
.credential-list dd { margin: 0.2rem 0; }
.access-code, .code-input { font-family: ui-monospace, monospace; font-size: 2rem; font-weight: 800; letter-spacing: 0.18em; }
.break-all { overflow-wrap: anywhere; }
.badge.paused { color: #755000; background: #fff0c7; }
.badge.revoked { color: #842323; background: #f8dddd; }
@media (max-width: 42rem) {
    .site-header { align-items: flex-start; flex-direction: column; }
    .container { margin-block: 1.5rem; }
    .page-heading, .recipient-card { align-items: stretch; flex-direction: column; }
    .page-heading .button { width: 100%; }
    table, thead, tbody, tr, th, td { display: block; }
    thead { position: absolute; clip: rect(0, 0, 0, 0); }
    tr { padding: 0.7rem; border-bottom: 1px solid #cddbd4; }
    td { display: grid; grid-template-columns: 8rem 1fr; gap: 0.5rem; padding: 0.45rem; border: 0; }
    td::before { content: attr(data-label); color: #607069; font-size: 0.8rem; font-weight: 700; }
    td.actions { display: flex; padding-top: 0.8rem; }
}
