/* Mobile first. Brand tokens mirror site/styles.css; the portal keeps its own copy so the two deploy apart. */
:root {
  --navy: #160850; --blue: #0c98d4; --bg: #faf9f8; --panel: #ffffff; --ink: #1b1630; --muted: #5d5a70; --line: #e3e0ea;
  --code-bg: #f1eff7; --ok: #0b7a4b; --warn: #a15c00; --bad: #b3261e; --chip: #ece9f5; --radius: 10px;
  --link: #0a6f9c; --btn: #160850; --btn-ink: #ffffff; --field: #ffffff; --field-line: #8b879c;
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0b24; --panel: #17123a; --ink: #f1eff8; --muted: #a9a4c4; --line: #2c2658; --code-bg: #211a4d; --chip: #251e55;
    --ok: #5fd3a0; --warn: #f0b354; --bad: #ff8a80; --link: #5cc4ee; --btn: #0c98d4; --btn-ink: #06121a; --field: #0f0b24; --field-line: #6d6894;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); overflow-wrap: anywhere; }
a { color: var(--link); } a:hover { text-decoration: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: #160850; padding: 8px 12px; z-index: 30; }
.skip:focus { left: 8px; top: 8px; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 16px; background: var(--navy); color: #fff; }
.brand { display: flex; flex-direction: column; line-height: 1.15; color: #fff; text-decoration: none; margin-right: auto; }
.brand .mark { font-weight: 700; } .brand .sub { font-size: .75rem; opacity: .85; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a { color: #fff; text-decoration: none; padding: 10px 10px; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a:focus-visible { background: rgba(255,255,255,.16); }

main { max-width: 44rem; margin: 0 auto; padding: 16px; min-height: 70vh; }
main.wide { max-width: 60rem; }
h1 { font-size: 1.5rem; line-height: 1.2; margin: 8px 0 6px; }
h2 { font-size: 1.15rem; margin: 26px 0 8px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
p { margin: 0 0 12px; }
.lead, .muted { color: var(--muted); }
.small { font-size: .88rem; }
.foot { padding: 18px 16px 28px; color: var(--muted); font-size: .82rem; max-width: 44rem; margin: 0 auto; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.card > :last-child { margin-bottom: 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

form { margin: 0; }
.field { margin: 0 0 14px; }
label, legend { display: block; font-weight: 600; margin: 0 0 4px; }
.hint { display: block; color: var(--muted); font-size: .88rem; margin: 0 0 4px; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="date"], textarea, select {
  display: block; width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--field); border: 1px solid var(--field-line); border-radius: 8px;
}
textarea { min-height: 8rem; resize: vertical; }
input.code { font-family: var(--mono); font-size: 1.25rem; letter-spacing: .2em; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0 0 14px; min-width: 0; }
legend { padding: 0 6px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-weight: 500; }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; font: inherit; font-weight: 600;
  color: var(--btn-ink); background: var(--btn); border: 1px solid var(--btn); border-radius: 8px; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.12); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--field-line); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #1b0502; } }
.btn.block { display: flex; width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 0; }
/* A row of buttons standing on the page itself, not inside a card, keeps its distance from what follows. */
main > .actions { margin-bottom: 14px; }
.linkrow { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }

.error, .field-validation-error { display: block; color: var(--bad); font-weight: 600; margin: 4px 0 0; }
.field-validation-valid, .validation-summary-valid { display: none; }
.validation-summary-errors, .alert { border: 1px solid var(--bad); border-left-width: 5px; color: var(--bad); background: var(--panel); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; font-weight: 600; }
.validation-summary-errors ul { margin: 0; padding: 0; list-style: none; }
.notice { border: 1px solid var(--ok); border-left-width: 5px; background: var(--panel); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; }
.warnbox { border: 1px solid var(--warn); border-left-width: 5px; background: var(--panel); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; }

.secret { font-family: var(--mono); font-size: 1.1rem; background: var(--code-bg); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; user-select: all; }
ul.secret { list-style: none; columns: 2; }
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--ink); white-space: nowrap; }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); }
.incident h3 { margin: 0 0 6px; }
.incident .badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 3px solid var(--line); }
.timeline li { margin: 0 0 10px; }
.timeline .when { display: block; color: var(--muted); font-size: .86rem; }

.release-item { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.release-item:first-of-type { border-top: 0; padding-top: 0; }
.release-item h3 { margin: 0 0 6px; }
.release-item h4 { font-size: .86rem; color: var(--muted); margin: 10px 0 4px; }
.release-item ul { margin: 0 0 6px; padding-left: 20px; }
.release-item .step { margin: 0 0 4px; }
.release-item h3, .release-item li, .release-item p { overflow-wrap: anywhere; }
input[type="file"] { max-width: 100%; }
textarea.short { min-height: 4.5rem; }
.choice .meta { display: block; color: var(--muted); font-size: .86rem; font-weight: 400; overflow-wrap: anywhere; }
details > summary { cursor: pointer; font-weight: 600; padding: 10px 0; min-height: 44px; }
details[open] > summary { margin-bottom: 4px; }
fieldset .field:last-child { margin-bottom: 0; }

/* Records are stacked blocks, never tables: nothing needs more than 375 px. */
.rows { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--line); }
.rows > li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; }
.rows .main { min-width: 0; flex: 1 1 14rem; }
.rows .meta { color: var(--muted); font-size: .86rem; display: block; }
dl.facts { margin: 0 0 12px; display: grid; grid-template-columns: 1fr; gap: 2px; }
dl.facts dt { color: var(--muted); font-size: .86rem; margin-top: 8px; }
dl.facts dd { margin: 0; }
pre.plain { white-space: pre-wrap; font-family: var(--mono); font-size: .86rem; background: var(--code-bg); border-radius: 8px; padding: 8px 10px; margin: 4px 0 0; }

@media (min-width: 720px) {
  main { padding: 28px 24px; } h1 { font-size: 1.85rem; }
  dl.facts { grid-template-columns: 12rem 1fr; gap: 6px 12px; } dl.facts dt { margin-top: 0; }
}

/* ---- the guides: a list of pages beside the page being read */
main.wide { max-width: 72rem; }
.docsets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.docs { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; }
.docs-nav { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.docs-nav ol { margin: 0; padding-left: 22px; } .docs-nav li { padding: 4px 0; }
.docs-nav a { text-decoration: none; } .docs-nav a[aria-current="page"] { font-weight: 700; color: var(--ink); }
.prose { min-width: 0; } .prose h1 { margin-top: 0; } .prose h2 { margin-top: 1.6em; border-top: 1px solid var(--line); padding-top: .8em; } .prose h3 { margin-top: 1.3em; }
.prose code { font: .88em var(--mono); background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
.prose pre { background: var(--code-bg); padding: 12px 14px; border-radius: 8px; overflow-x: auto; } .prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; margin: 12px 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; } .prose th { background: var(--chip); }
.prose blockquote { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--blue); background: var(--panel); }
.prose li { margin: 4px 0; } .prose img { max-width: 100%; }
/* On a phone the page being read comes first and the list of pages follows it. */
.docs-nav { order: 2; } .docs-jump { margin-left: 8px; }
@media (min-width: 60rem) { .docs-nav { order: 0; } .docs-jump { display: none; } .docs { grid-template-columns: 17rem minmax(0, 1fr); } .docs-nav { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; } }
