:root {
  color-scheme: light;
  --ink: #102649;
  --muted: #52647b;
  --blue: #1654c2;
  --line: #d9e4f3;
  --page: #f3f7fd;
  --surface: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--blue); text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; }
button, a, input, textarea { outline-offset: .2rem; }
:focus-visible { outline: 3px solid #2472e6; }
button { padding: .7rem 1rem; border: 1px solid transparent; border-radius: .65rem; font-weight: 650; background: var(--blue); color: white; cursor: pointer; }
button:hover { background: #11439d; }
button:disabled { cursor: default; opacity: .55; }
button.secondary { background: white; color: var(--ink); border-color: var(--line); }
button.secondary:hover { background: var(--page); }
input, textarea { width: 100%; border: 1px solid #b6c8e0; border-radius: .6rem; padding: .72rem .85rem; background: white; color: var(--ink); }
input[type=file] { padding: .5rem; }
textarea { min-height: 3.4rem; resize: vertical; }
label { display: grid; gap: .36rem; font-size: .94rem; font-weight: 600; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.12; letter-spacing: -.035em; margin-bottom: .7rem; }
h2 { font-size: 1.35rem; line-height: 1.3; margin-bottom: .85rem; }
h3 { font-size: 1rem; }
p { line-height: 1.65; }
.container { width: min(100% - 2rem, 68rem); margin-inline: auto; }
.top { background: white; border-bottom: 1px solid var(--line); }
.masthead, .footer, .heading-row, .actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.masthead { min-height: 4.5rem; }
.brand { display: inline-block; }
.brand img { display: block; width: 10.5rem; height: auto; }
.quiet { font-size: .94rem; color: var(--muted); }
.hero { color: white; background: linear-gradient(113deg, #08184f 10%, #164fae 92%); padding-block: clamp(2.5rem, 7vw, 5.4rem); }
.hero h1 { font-size: clamp(2.45rem, 6.4vw, 4.25rem); }
.hero p { color: #e5eeff; margin-bottom: 1.6rem; }
.search { display: flex; gap: .4rem; max-width: 39rem; padding: .35rem; border-radius: .75rem; background: white; }
.search input { border: 0; min-width: 0; }
.search button { flex: 0 0 auto; }
.catalog, .reader, .admin, .auth { padding-block: 2rem 4rem; }
.heading-row { flex-wrap: wrap; align-items: baseline; }
.topic { margin-top: 1.15rem; }
.card-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: .85rem; }
.card { display: grid; gap: .35rem; height: 100%; border: 1px solid var(--line); border-radius: .85rem; padding: 1.2rem; text-decoration: none; color: var(--ink); background: white; }
.card:hover { border-color: var(--blue); text-decoration: none; }
.card:hover strong { color: var(--blue); text-decoration: underline; }
.card span { color: var(--muted); line-height: 1.55; }
.reader { max-width: 52rem; }
.back { display: inline-block; margin-bottom: .85rem; font-weight: 600; }
.panel { border: 1px solid var(--line); border-radius: .9rem; background: white; padding: clamp(1.1rem, 4vw, 2rem); }
.category { font-weight: 650; color: var(--blue); margin-bottom: .4rem; }
.summary, .muted { color: var(--muted); }
.steps { padding-left: 1.5rem; display: grid; gap: 1.35rem; margin-block: 1.65rem; }
.steps li { padding-left: .3rem; }
.steps li::marker { color: var(--blue); font-weight: 700; }
.steps h2, .related h2 { font-size: 1.07rem; margin-bottom: .35rem; }
.steps p { margin-bottom: .6rem; white-space: pre-wrap; }
.screenshot { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: .65rem; margin-block: .75rem; }
.related { border-top: 1px solid var(--line); padding-top: 1.15rem; }
.auth { max-width: 32rem; }
.auth .back { margin-block: 1rem 0; }
.fields, .editor-step, .image-editor { display: grid; gap: .85rem; min-inline-size: 0; }
.admin-grid { display: grid; grid-template-columns: minmax(12rem, 16rem) minmax(0,1fr); gap: 1rem; align-items: start; }
.admin-nav ul, .account-list { padding: 0; margin: 0; list-style: none; display: grid; gap: .5rem; }
.admin-nav a { display: block; border-radius: .55rem; padding: .45rem; }
.admin-nav [aria-current] { background: var(--page); font-weight: 650; }
.editor-step { margin: 0; border: 1px solid var(--line); border-radius: .7rem; padding: .9rem; }
.editor-step legend { padding-inline: .4rem; font-weight: 650; }
.image-editor { padding: .8rem; background: var(--page); border-radius: .6rem; }
.image-editor img { max-height: 18rem; object-fit: contain; width: auto; margin: 0; }
.image-editor button { justify-self: start; }
.actions { justify-content: flex-start; flex-wrap: wrap; }
.contributors { margin-top: 1rem; }
.account-list { margin-top: 1rem; }
.account-list li { display: flex; gap: .6rem; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: .75rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.error, .notice { border-radius: .55rem; padding: .7rem; }
.error { color: #992626; background: #fff1f0; }
.notice { color: #174d34; background: #eaf9ef; }
.footer { margin-top: auto; padding-block: 1.2rem; border-top: 1px solid var(--line); color: var(--muted); }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { position: absolute; z-index: 1; padding: .8rem; background: white; }
@media (max-width: 44rem) { .admin-grid { grid-template-columns: 1fr; } }
