/* Public Service ITSM Reference — one stylesheet.
   1. Tokens.  2. Base.  3. Layout.  4. Components.
   Components use tokens only, never a colour value, so both themes stay consistent. */

/* 1. Tokens: each colour is light-dark(light, dark), resolved by color-scheme. */
:root {
    --bg: light-dark(#f6f7f9, #0e1117);
    --surface: light-dark(#ffffff, #161a22);
    --surface-2: light-dark(#eef0f5, #1e2430);
    --text: light-dark(#161b26, #e8ebf2);
    --muted: light-dark(#4b5466, #a9b1c2);
    --border: light-dark(#d9dde6, #2c3340);
    --accent: light-dark(#3346c4, #9eabff);
    --accent-strong: light-dark(#26359a, #c3cbff);
    --accent-soft: light-dark(#e8ebfb, #232a45);
    --on-accent: light-dark(#ffffff, #0e1117);
    --focus: light-dark(#b3550c, #ffb366);
    --hero-from: light-dark(#eef0fc, #171c2e);
    --hero-to: light-dark(#f6f7f9, #0e1117);
    --must-bg: light-dark(#fde8e8, #3b1a1d);
    --must-text: light-dark(#8f1d22, #ffb4b8);
    --should-bg: light-dark(#fff1d9, #3a2a10);
    --should-text: light-dark(#6e4300, #ffd48a);
    --could-bg: light-dark(#e2f3e7, #173023);
    --could-text: light-dark(#1a5c33, #9ee0b4);
    --none-text: light-dark(#5c6577, #a9b1c2);
    --note-bg: light-dark(#eef3ff, #1b2140);
    --note-border: light-dark(#3346c4, #9eabff);
    --consider-bg: light-dark(#f1f8f3, #15291e);
    --consider-border: light-dark(#2f7d4a, #6fcf8f);
    --warning-bg: light-dark(#fff6e6, #33260f);
    --warning-border: light-dark(#b06d00, #f0b24a);
    --radius: 12px;
    --radius-small: 8px;
    --shadow-a: light-dark(rgb(16 24 40 / 6%), rgb(0 0 0 / 40%));
    --shadow-b: light-dark(rgb(16 24 40 / 5%), rgb(0 0 0 / 30%));
    --shadow: 0 1px 2px var(--shadow-a), 0 4px 16px var(--shadow-b);
    --wrap: 76rem;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
    color-scheme: light dark;
}

/* The reader's choice (Shell/Theme.cs) overrides the device setting; "system" keeps "light dark". */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }


/* 2. Base ------------------------------------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 1rem/1.6 var(--font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; outline: none; }

h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem); margin-top: 0; letter-spacing: -0.02em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p, ul, ol, table { margin: 0 0 1em; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

code { font-family: var(--mono); font-size: 0.92em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--surface); color: var(--text); padding: 0.6rem 1rem; border-radius: var(--radius-small); box-shadow: var(--shadow); }
.skip-link:focus { top: 1rem; }

.muted { color: var(--muted); }

/* 3. Layout ---------------------------------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 48rem; }

.topbar {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar__inner { display: flex; align-items: center; gap: 1.25rem; min-height: 4rem; }

.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand__mark { width: 2rem; height: 2rem; }
.brand__tile { fill: var(--accent); }
.brand__line { fill: none; stroke: var(--on-accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand__text { max-width: 11rem; line-height: 1.15; font-size: 0.95rem; }

.mainnav { flex: 1; min-width: 0; }
.mainnav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.mainnav a, .subbar a {
    display: block; padding: 0.45rem 0.7rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.mainnav a:hover, .subbar a:hover { color: var(--text); background: var(--surface-2); }
.mainnav a[aria-current="true"], .subbar a[aria-current="true"] { color: var(--accent-strong); background: var(--accent-soft); }

.topbar__tools { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }

.subbar { border-top: 1px solid var(--border); }
.subbar__inner { display: flex; gap: 0.25rem; align-items: center; padding-top: 0.35rem; padding-bottom: 0.35rem; }
.subbar__first { margin-left: auto; }
.quicksearch--bar input { width: 18rem; }
/* Desktop: search sits in the second bar, leaving the menu room for one line; the top-bar box is for tablets. */
@media (min-width: 64.001rem) {
    .topbar__tools .quicksearch { display: none; }
}
.subbar a { font-size: 0.875rem; padding: 0.25rem 0.7rem; }

.mobilenav { display: none; }

@media (max-width: 64rem) {
    .mainnav, .subbar { display: none; }
    .mobilenav { display: block; }
    .topbar__tools .quicksearch input { width: 9rem; }
}
/* Small phones: the header keeps the brand, theme and menu; search moves to the home page and the menu. */
@media (max-width: 30rem) {
    .topbar__tools .quicksearch { display: none; }
    .wrap { padding: 0 1rem; }
    .topbar__inner { gap: 0.5rem; }
    .topbar__tools { gap: 0.15rem; }
    .brand { flex-shrink: 1; min-width: 0; }
    .brand__text { font-size: 0.85rem; max-width: 9rem; }
}

.footer { margin-top: 4rem; border-top: 1px solid var(--border); background: var(--surface); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; padding-top: 2rem; padding-bottom: 2.5rem; font-size: 0.9rem; color: var(--muted); }
.footer__about { max-width: 34rem; }
.footer__name { font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }

/* Guide pages: section navigation | article | on this page. */
.guide { display: grid; gap: 2rem; grid-template-columns: 15rem minmax(0, 1fr) 13rem; align-items: start; padding-top: 0.5rem; }
.guide__nav, .guide__toc { position: sticky; top: 7.5rem; max-height: calc(100vh - 9rem); overflow: auto; }
.guide__body { min-width: 0; }

@media (max-width: 75rem) {
    .guide { grid-template-columns: 14rem minmax(0, 1fr); }
    .guide__toc { display: none; }
}
@media (max-width: 52rem) {
    .guide { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .guide__nav { position: static; max-height: none; }
}

/* 4. Components ------------------------------------------------------------------------------------------------ */
.sheet { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.25rem, 1rem + 1.5vw, 2.5rem); }

.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin-bottom: 0.5rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }

.pagehead { border-bottom: 1px solid var(--border); padding-bottom: 1.25rem; margin-bottom: 1.5rem; }
.pagehead .lede { margin-bottom: 0.75rem; }

.applies { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0; font-size: 0.875rem; }
.applies__label { color: var(--muted); margin-right: 0.25rem; }

.tag { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.8rem; font-weight: 600; text-decoration: none; }
a.tag:hover { color: var(--accent-strong); text-decoration: underline; }

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.65rem 1.15rem; border-radius: var(--radius-small); border: 1px solid var(--accent);
    background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.button--secondary { background: transparent; color: var(--accent); }
.button--secondary:hover { background: var(--accent-soft); color: var(--accent-strong); }
.button--danger { background: var(--must-text); border-color: var(--must-text); color: var(--surface); }
.button--danger:hover { background: var(--text); border-color: var(--text); color: var(--surface); }

.icon-button {
    display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 999px;
    border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; list-style: none;
}
.icon-button::-webkit-details-marker { display: none; }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.icon-button svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentcolor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.quicksearch { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding-left: 0.9rem; }
.quicksearch:focus-within { border-color: var(--accent); }
.quicksearch input { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.9rem; width: 12rem; outline: none; }
.quicksearch .icon-button { width: 2.1rem; height: 2.1rem; }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown__panel {
    position: absolute; right: 0; top: calc(100% + 0.5rem); min-width: 14rem; z-index: 60;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.5rem;
}
.dropdown__title { font-size: 0.8rem; color: var(--muted); margin: 0.25rem 0.6rem 0.4rem; font-weight: 600; }
.dropdown__panel button, .dropdown__panel a {
    display: block; width: 100%; text-align: left; padding: 0.5rem 0.7rem; border: 0; border-radius: var(--radius-small);
    background: transparent; color: var(--text); font: inherit; text-decoration: none; cursor: pointer;
}
.dropdown__panel button:hover, .dropdown__panel a:hover { background: var(--surface-2); color: var(--text); }
.dropdown__panel button[aria-pressed="true"], .dropdown__panel a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.dropdown__panel ul { list-style: none; margin: 0; padding: 0; }

.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; padding: 0; margin: 1.25rem 0 1rem; font-size: 0.875rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.35rem; color: var(--border); }
.breadcrumbs a { color: var(--muted); }

.hero { background: linear-gradient(180deg, var(--hero-from), var(--hero-to)); border-bottom: 1px solid var(--border); }
.hero__inner { padding-top: clamp(2.5rem, 2rem + 4vw, 5rem); padding-bottom: clamp(2.5rem, 2rem + 3vw, 4rem); }
.hero h1 { max-width: 44rem; font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
.hero__search { display: flex; gap: 0.5rem; max-width: 40rem; margin-top: 1.5rem; }
.hero__search input {
    flex: 1; min-width: 0; padding: 0.75rem 1rem; font: inherit; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-small); box-shadow: var(--shadow);
}
.hero__search input:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }

.block { margin-top: 3rem; }
.block > h2 { margin-top: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; }
.chip {
    display: inline-block; padding: 0.5rem 0.95rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
    color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.chip:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.chip[aria-current="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); list-style: none; padding: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card__title { margin: 0 0 0.4rem; font-size: 1.15rem; }
.card__title a { color: var(--text); text-decoration: none; }
.card__title a:hover { color: var(--accent); text-decoration: underline; }
.card > p { color: var(--muted); font-size: 0.95rem; }
.card__links { list-style: none; padding: 0; margin: auto 0 0; font-size: 0.9rem; display: grid; gap: 0.25rem; }

.callout {
    display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between;
    background: var(--accent-soft); border-radius: var(--radius); padding: 1.75rem; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}
.callout h2 { margin: 0 0 0.35rem; }
.callout p { margin: 0; color: var(--muted); max-width: 40rem; }

.sectionnav > summary { font-weight: 700; cursor: pointer; padding: 0.35rem 0; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sectionnav ul, .guide__toc ul { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.1rem; }
.sectionnav a { display: block; padding: 0.4rem 0.75rem; border-radius: var(--radius-small); color: var(--text); text-decoration: none; font-size: 0.925rem; }
.sectionnav a:hover { background: var(--surface-2); }
.sectionnav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.toc__title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin: 0.4rem 0 0; }
.guide__toc { border-left: 1px solid var(--border); padding-left: 1rem; }
.guide__toc a { display: block; padding: 0.25rem 0; color: var(--muted); text-decoration: none; font-size: 0.875rem; }
.guide__toc a:hover { color: var(--accent); }

.pagelist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.25rem; }
.pagelist li { padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.pagelist li:last-child { border-bottom: 0; }
.pagelist a { font-weight: 600; font-size: 1.05rem; }
.pagelist p { margin: 0.2rem 0 0; color: var(--muted); }

.pager { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.pager a { display: grid; gap: 0.1rem; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-small); text-decoration: none; font-weight: 600; max-width: 22rem; }
.pager a:hover { border-color: var(--accent); background: var(--accent-soft); }
.pager span { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.pager__next { margin-left: auto; text-align: right; }

/* Long-form text from Markdown. */
.prose { max-width: 46rem; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.35rem; }
.prose a.external::after { content: "\2197"; font-size: 0.8em; margin-left: 0.15em; text-decoration: none; display: inline-block; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose blockquote { margin: 1.5rem 0; padding: 0.25rem 1.25rem; border-left: 4px solid var(--border); color: var(--muted); }
.prose .note, .prose .consider, .prose .warning {
    border-radius: var(--radius-small); padding: 1rem 1.25rem; margin: 1.5rem 0; border-left: 4px solid;
}
.prose .note { background: var(--note-bg); border-color: var(--note-border); }
.prose .consider { background: var(--consider-bg); border-color: var(--consider-border); }
.prose .warning { background: var(--warning-bg); border-color: var(--warning-border); }
.prose .note > :last-child, .prose .consider > :last-child, .prose .warning > :last-child { margin-bottom: 0; }
.prose .note > :first-child, .prose .consider > :first-child, .prose .warning > :first-child { margin-top: 0; }

/* Print: just the content. */
@media print {
    .topbar, .footer, .guide__nav, .guide__toc, .pager, .skip-link, .breadcrumbs { display: none !important; }
    .guide { display: block; }
    .sheet { border: 0; box-shadow: none; padding: 0; }
    body { background: #fff; color: #000; }
    .prose a.external::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}

/* Matrix, instruments and search ------------------------------------------------------------------------------- */
.narrowish { max-width: 60rem; }
.pagehead--plain { border: 0; padding-bottom: 0; margin-bottom: 1.5rem; }

.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.badge--must { background: var(--must-bg); color: var(--must-text); }
.badge--should { background: var(--should-bg); color: var(--should-text); }
.badge--could { background: var(--could-bg); color: var(--could-text); }

.filters {
    display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}
.filters__field { display: grid; gap: 0.35rem; }
.filters label { font-weight: 600; font-size: 0.875rem; }
.filters select {
    font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-small);
    padding: 0.55rem 0.6rem; width: 100%;
}
.filters__actions { display: flex; gap: 0.5rem; }

.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 1.25rem 0 0; font-size: 0.875rem; color: var(--muted); }
.legend div { display: flex; gap: 0.5rem; align-items: baseline; max-width: 24rem; }
.legend dt, .legend dd { margin: 0; }

.resultcount { margin: 1.5rem 0 1rem; font-weight: 600; }

.obgroup h2 { display: flex; align-items: center; gap: 0.6rem; font-size: 1.1rem; }
.obgroup h2 .badge { font-size: 0.95rem; padding: 0.2rem 0.75rem; }
.obgroup h2 span:last-child { color: var(--muted); font-weight: 500; }
.instrumentlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr)); }
.instrument { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.instrument__name { font-weight: 700; font-size: 1.02rem; text-decoration: none; }
.instrument__name:hover { text-decoration: underline; }
.instrument__meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.4rem 0 0.5rem; font-size: 0.85rem; color: var(--muted); }
.instrument > p:last-child { margin: 0; font-size: 0.95rem; }
.status { display: inline-block; font-size: 0.85rem; font-weight: 600; color: var(--should-text); background: var(--should-bg); padding: 0.1rem 0.55rem; border-radius: 6px; }

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.grid { border-collapse: collapse; width: 100%; min-width: 62rem; font-size: 0.9rem; }
.grid caption { text-align: left; padding: 0.75rem 1rem; color: var(--muted); font-size: 0.85rem; }
.grid th, .grid td { padding: 0.55rem 0.6rem; border-top: 1px solid var(--border); text-align: center; vertical-align: middle; }
.grid thead th { background: var(--surface-2); font-size: 0.8rem; position: sticky; top: 0; }
.grid abbr { text-decoration: none; }
.grid th[scope="row"] { text-align: left; font-weight: 500; min-width: 18rem; }
.grid th[scope="row"] a { font-weight: 600; }
.grid__type { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.grid__none { color: var(--none-text); }
.grid tbody tr:hover { background: var(--surface-2); }

.applytable { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.applytable th, .applytable td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.applytable thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.applytable th[scope="row"] { font-weight: 500; }
.sources { padding-left: 1.2rem; }
.sources a.external::after, .instrument a.external::after { content: "\2197"; font-size: 0.8em; margin-left: 0.15em; }
.checked { margin-top: 1.5rem; padding: 0.9rem 1rem; border-radius: var(--radius-small); background: var(--surface-2); font-size: 0.925rem; }

.searchpage__form { margin: 0 0 1rem; max-width: none; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.result__title { display: block; font-weight: 700; font-size: 1.05rem; margin: 0.35rem 0 0.25rem; }
.result p { margin: 0; color: var(--muted); font-size: 0.95rem; }
mark { background: var(--should-bg); color: var(--text); border-radius: 3px; padding: 0 0.1em; }

/* Forms, accounts and admin ------------------------------------------------------------------------------------ */
.form { display: grid; gap: 1.25rem; margin: 1.5rem 0 0; }
.form--inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; }
.form--inline .field { flex: 1 1 12rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 600; }
.field input, .field select {
    font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--muted); border-radius: var(--radius-small);
    padding: 0.6rem 0.75rem; width: 100%; max-width: 28rem;
}
.field input:focus, .field select:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.field--short input { max-width: 12rem; font-family: var(--mono); letter-spacing: 0.08em; }
.field--error { border-left: 4px solid var(--must-text); padding-left: 0.9rem; }
.field--error input { border-color: var(--must-text); }
.hint { margin: 0; color: var(--muted); font-size: 0.925rem; }
.field__error { margin: 0; color: var(--must-text); font-weight: 600; }
.form .button { justify-self: start; }
.formnote { margin-top: 1.5rem; font-size: 0.925rem; color: var(--muted); }

.error-summary { border: 3px solid var(--must-text); border-radius: var(--radius-small); padding: 1rem 1.25rem; margin: 1rem 0; }
.error-summary h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: var(--must-text); font-weight: 600; }

.notice { background: var(--could-bg); color: var(--text); border-left: 4px solid var(--could-text); border-radius: var(--radius-small); padding: 0.9rem 1.1rem; margin: 1rem 0; }
.notice p { margin: 0 0 0.5rem; }
.notice p:last-child { margin: 0; }
.notice--link { background: var(--note-bg); border-color: var(--note-border); }

.keybox { margin: 0.75rem 0; }
.keybox code { display: inline-block; font-size: 1.15rem; padding: 0.6rem 0.9rem; letter-spacing: 0.06em; background: var(--surface-2); border: 1px dashed var(--border); }
.wrapcode { word-break: break-all; white-space: normal; }
.keybox .wrapcode { font-size: 0.9rem; letter-spacing: 0; }
.disclosure summary { cursor: pointer; color: var(--accent); }
.howto { padding-left: 1.25rem; }
.howto li { margin-bottom: 0.75rem; }

.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.5rem; margin: 1rem 0 1.5rem; }
.codes code { display: block; text-align: center; padding: 0.5rem; font-size: 1rem; }

.steps { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: 0.85rem; counter-reset: step; }
.steps li { counter-increment: step; padding: 0.25rem 0.75rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.steps li::before { content: counter(step) ". "; }
.steps li[aria-current="step"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.steps .steps__done { background: var(--could-bg); color: var(--could-text); }

.summary { display: grid; gap: 0; margin: 0 0 1.5rem; }
.summary div { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.summary dt { font-weight: 600; }
.summary dd { margin: 0; }
.actions { padding-left: 1.2rem; }
.buttonrow { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.actionforms { display: grid; gap: 1.25rem; }
.actionforms form > .hint { margin-top: 0.35rem; }

.datatable { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.datatable th, .datatable td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.datatable thead th { background: var(--surface-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.datatable th[scope="row"] { font-weight: 600; }
.nowrap { white-space: nowrap; }
.state { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; background: var(--surface-2); }
.state--active, .state--succeeded { background: var(--could-bg); color: var(--could-text); }
.state--invited { background: var(--should-bg); color: var(--should-text); }
.state--disabled, .state--refused { background: var(--must-bg); color: var(--must-text); }
.filters--compact { grid-template-columns: repeat(auto-fit, minmax(14rem, 22rem)); }

/* Downloads ------------------------------------------------------------------------------------------------------- */
.shelf { margin-top: 2rem; }
.shelf h2 { margin-bottom: 0.25rem; }
.filelist { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.75rem; }
.fileitem {
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem;
}
.fileitem > div { flex: 1 1 18rem; min-width: 0; }
.fileitem p { margin: 0.2rem 0 0; }
.fileitem__title { font-weight: 700; font-size: 1.02rem; }
.fileitem__meta { color: var(--muted); font-size: 0.875rem; }
.fileitem--withdrawn { opacity: 0.75; }
.package {
    margin: 1rem 0; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface);
}
.package .fileitem { background: var(--surface-2); }
.package h3 { margin: 0 0 0.25rem; }
.package__summary { margin: 0.5rem 0 0; font-weight: 600; }
.package__description { margin-top: 0.5rem; }
.package__description :is(h4, h5, h6) { font-size: 1rem; margin: 1rem 0 0.25rem; }
.package__description > :last-child { margin-bottom: 0; }
.package .filelist { margin-bottom: 0; }
.field input[type="file"] { border-style: dashed; padding: 0.75rem; }
