:root {
  color-scheme: light;
  --background: #f3f6f9;
  --paper: #ffffff;
  --ink: #122338;
  --muted: #465972;
  --border: #d8e2eb;
  --nav: #142438;
  --nav-muted: #b7c6d6;
  --accent: #12634e;
  --accent-hover: #0c4c3b;
  --mint: #9ce6c9;
  --danger: #a22d36;
  --radius: .8rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  font-size: 15px;
  line-height: 1.5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
main { min-width: 0; }
.guest main { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.authenticated main { margin-left: 15rem; padding: 2.5rem clamp(1.3rem, 3.4vw, 3.5rem); max-width: 115rem; }
::selection { background: var(--mint); }
:focus-visible { outline: 3px solid #248e72; outline-offset: 3px; }
main:focus { outline: none; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 5; inset: .6rem auto auto .6rem; background: white; padding: .6rem 1rem; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 15rem; padding: 1.35rem 1rem; background: var(--nav);
  color: white; display: flex; flex-direction: column; gap: 2.3rem; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; font-weight: 750;
  font-size: 1.14rem; letter-spacing: -.025em; color: inherit; }
.sidebar .brand { padding: .2rem .45rem; color: white; }
.brand-icon { display: grid; place-items: center; background: var(--mint); color: #124d3e; width: 2rem;
  height: 2rem; border-radius: .55rem; font-size: 1.35rem; }
nav { display: grid; gap: .24rem; }
nav a { color: var(--nav-muted); padding: .58rem .75rem; border-radius: .45rem; text-decoration: none; font-weight: 590; }
nav a:hover, nav a[aria-current] { color: #fff; background: #253d52; }
nav a[aria-current] { box-shadow: inset 3px 0 var(--mint); }
.account { display: grid; margin-top: auto; padding: .85rem .45rem 0; border-top: 1px solid #3a4c60; }
.account a, .account small, .account .quiet { color: var(--nav-muted); }
.account a, .account form { margin-top: .4rem; }
a { color: var(--accent); text-underline-offset: .19em; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.05em; line-height: 1.12; }
h2 { font-size: 1.18rem; letter-spacing: -.02em; }
h3 { font-size: 1.04rem; }
h4 { font-size: .94rem; }
p { color: var(--muted); }
p + p { margin-top: .5rem; }
small, .muted { color: var(--muted); }
small { font-size: .85rem; font-weight: 450; }
.line { display: block; margin-top: .2rem; }
.page-head, .section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .7rem 1.4rem; }
.page-head { margin-bottom: 1.6rem; }
.page-head p, .section-head p { margin-top: .38rem; }
.back { display: inline-block; margin-bottom: .45rem; font-size: .88rem; }
.panel { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem;
  box-shadow: 0 2px 4px #17273c06; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.metric { display: grid; align-content: start; gap: .25rem; }
.metric h2 { font-size: .9rem; color: var(--muted); letter-spacing: 0; }
.metric strong { font-size: 2.2rem; letter-spacing: -.045em; }
.metric .date-value { font-size: 1.05rem; letter-spacing: -.01em; margin-top: .35rem; }
.detail-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.detail-list li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.detail-list small { display: block; }
.detail-list li:last-child { padding-bottom: 0; }
.split, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.stack { display: grid; gap: 1rem; }
.inline, .checks, .actions, .actions form, .form-footer { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .85rem; }
.form-footer { position: sticky; bottom: 0; z-index: 1; padding: .85rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--paper); box-shadow: 0 -4px 12px #1223380c; }
.compact { max-width: 48rem; }
.auth-panel { width: min(100%, 29rem); padding: clamp(1.3rem, 4vw, 2.4rem); }
.auth-panel h1 { margin-bottom: 1rem; }
.auth-panel .brand, .auth-panel p { margin-bottom: 1rem; }
.authenticated .auth-panel { margin: 1rem auto; }
label { display: grid; gap: .3rem; color: var(--ink); font-size: .9rem; font-weight: 640; }
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 2.7rem; background: #fff; border: 1px solid #aebdca; border-radius: .42rem; padding: .45rem .62rem; }
input[readonly] { background: var(--background); color: var(--muted); }
input[type=checkbox] { margin: 0; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex: 0 0 auto; }
.check { display: flex; gap: .55rem; align-items: center; font-weight: 520; min-height: 1.6rem; }
button, .button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid transparent; border-radius: .45rem;
  background: var(--accent); color: white; padding: .54rem .95rem; font-weight: 650; min-height: 2.6rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .button:hover { background: var(--accent-hover); color: white; }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: var(--paper); color: var(--accent); border-color: #a1beb4; }
.quiet { background: transparent; padding: 0; min-height: 1.6rem; border: 0; color: var(--accent); font-weight: inherit; text-decoration: underline; text-underline-offset: .19em; }
.quiet:hover { background: transparent; color: var(--accent-hover); }
.sidebar .quiet:hover { color: white; }
.danger, .danger:hover { color: var(--danger); }
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: #f7fafc; }
th { color: var(--muted); font-size: .82rem; white-space: nowrap; }
th, td { padding: .75rem .95rem; vertical-align: top; }
td { border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.actions { font-size: .87rem; min-width: 9rem; align-items: start; }
.status { display: inline-block; border-radius: 2rem; background: #e9eef3; color: #394e66; font-size: .8rem; font-weight: 670; padding: .19rem .55rem; white-space: nowrap; }
.good { background: #dff3eb; color: #135d4a; }
.bad, .alert { background: #fbe8e9; color: #8c2630; }
.notice, .alert { border-radius: .45rem; padding: .58rem .75rem; }
.notice { background: #e3f3ee; color: #144d40; }
.taxonomy { margin: 0; border: 1px solid var(--border); border-radius: .5rem; min-width: 0; display: grid; gap: .65rem; padding: .8rem; }
.taxonomy legend { font-weight: 740; padding: 0 .25rem; }
.term-list { max-height: 15rem; overflow-y: auto; border: 1px solid var(--border); border-radius: .4rem; padding: .35rem; min-height: 3rem; }
.term-list .check { padding: .26rem .35rem; border-radius: .25rem; overflow-wrap: anywhere; }
.term-list .check:hover { background: var(--background); }
.term-list small { margin-left: auto; }
#match-count { margin-top: 0; }
.preview-select { width: fit-content; margin-bottom: 1rem; align-items: end; }
.preview-select label { min-width: 12rem; }
.xml { background: #17283d; color: #e3f0ff; border-radius: .5rem; padding: 1rem; max-height: 29rem; overflow: auto; font-size: .85rem; }
.validation { margin-top: .5rem; }
.validation summary { color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.validation p, .panel + .stack, .page-nav { margin-top: .75rem; }
.article-text { margin-top: .55rem; overflow-wrap: anywhere; }
.article-text img { max-width: 100%; }
article.panel .split { margin-top: .8rem; }
article.panel a { overflow-wrap: anywhere; }

@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .taxonomy .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: static; width: auto; padding: .8rem 1rem; gap: .6rem; }
  .sidebar .brand { padding: 0; }
  nav { display: flex; overflow-x: auto; }
  nav a { white-space: nowrap; padding: .42rem .6rem; }
  .account { display: flex; align-items: baseline; flex-wrap: wrap; padding: .35rem 0 0; gap: .2rem .8rem; }
  .account a, .account form { margin-top: 0; }
  .authenticated main { margin: 0; padding: 1.25rem 1rem; }
}
@media (max-width: 560px) {
  .split, .form-grid { grid-template-columns: 1fr; }
  .metrics, .split { gap: .65rem; }
  .panel { padding: .9rem; }
  .table-wrap { padding: 0; }
  .form-footer { position: static; }
}
