/* Restrained, content-first. Palette taken from the LaTeX document. */
:root {
  --accent: #1f4e79;
  --accent-soft: #d6e4f0;
  --row: #f3f6fa;
  --rule-bg: #fff8e1;
  --rule-edge: #c9a227;
  --obs: #b22222;
  --text: #1c2026;
  --muted: #5b6470;
  --line: #d9dee5;
  --measure: 42rem;
  font-size: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); background: #fff;
  font: 1.0625rem/1.65 "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 56rem; margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 10; }

a { color: var(--accent); text-underline-offset: .15em; }
a:hover { color: #0f2f4d; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* header / footer */
.site-header { border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; gap: .5rem 2rem; align-items: baseline; justify-content: space-between; padding-top: 1rem; padding-bottom: 1rem; }
.brand { font-weight: 700; color: var(--accent); text-decoration: none; font-size: 1.15rem; }
.bar-right { display: flex; align-items: center; gap: .5rem 1.75rem; flex-wrap: wrap; }
.site-header .main-nav { display: flex; gap: 1.5rem; }
.site-header .main-nav a { color: var(--text); text-decoration: none; }
.site-header .main-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-footer { margin-top: 5rem; padding: 2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-footer p { margin: .25rem 0; }
.site-footer a { color: var(--muted); }

main { padding-top: 2.5rem; min-height: 60vh; }

/* typography */
h1, h2, h3 { color: var(--accent); line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw + .5rem, 2.5rem); margin: 0 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; margin: 2.5rem 0 .75rem; padding-bottom: .3rem; border-bottom: 1px solid var(--accent); }
h3 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
.prose { max-width: var(--measure); }
.prose p, .prose ul, .prose ol { margin: .9rem 0; }
.prose li { margin: .3rem 0; }
.prose li::marker { color: var(--accent); }
.crumbs { font-size: .9rem; color: var(--muted); margin: 0 0 .5rem; }
.lead { font-size: 1.25rem; color: #2d3540; max-width: var(--measure); }
.obs { color: var(--obs); font-weight: 700; }
del, s { color: var(--obs); }
em.ex, .ex { font-style: italic; }

/* tables (grammar tables, like the PDF) */
.table-scroll { overflow-x: auto; margin: 1.25rem 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
th { background: var(--accent-soft); text-align: start; font-weight: 700; }
th, td { padding: .45rem .7rem; vertical-align: top; }
tbody tr:nth-child(even) { background: var(--row); }
tbody td { border-top: 1px solid #e6eaf0; }

/* rule box (the PDF's "regel") */
.regel, blockquote {
  background: var(--rule-bg); border: 1px solid var(--rule-edge); border-radius: 3px;
  padding: .75rem 1rem; margin: 1.25rem 0;
}
blockquote > :first-child { margin-top: 0; } blockquote > :last-child { margin-bottom: 0; }

/* components */
.hero { padding: 1rem 0 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin: 1.5rem 0; }
.btn {
  display: inline-block; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--accent); color: #fff; border: 2px solid var(--accent); border-radius: 3px;
  padding: .7rem 1.4rem; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: #0f2f4d; border-color: #0f2f4d; color: #fff; }
.btn.secondary { background: #fff; color: var(--accent); }
.btn.secondary:hover { background: var(--accent-soft); color: var(--accent); }
.compare { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: 1.5rem 0; max-width: 48rem; }
.compare > div { border-top: 3px solid var(--accent); padding-top: .5rem; }
.compare h3 { margin-top: .25rem; }
.compare ul { padding-inline-start: 1.2rem; margin: .5rem 0; }
.buybox { max-width: var(--measure); margin: 3rem 0; padding: 1.5rem; border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--row); }
.buybox h2 { margin-top: 0; border: 0; padding: 0; }
.consent { display: flex; gap: .75rem; align-items: flex-start; margin: 1rem 0; font-size: .95rem; }
.consent input { margin-top: .35rem; width: 1.15rem; height: 1.15rem; flex: none; }
.fine { font-size: .85rem; color: var(--muted); }
.cta-inline { margin: 2.5rem 0 1rem; padding: 1rem 1.25rem; background: var(--row); border-inline-start: 3px solid var(--accent); }
.cta-inline p { margin: 0; }
.more ul { columns: 2 16rem; padding-inline-start: 1.2rem; }
.topic-list { list-style: none; padding: 0; }
.topic-list li { padding: .9rem 0; border-top: 1px solid var(--line); }
.topic-list li:last-child { border-bottom: 1px solid var(--line); }
.topic-list a { font-weight: 700; font-size: 1.1rem; }
.topic-list p { margin: .15rem 0 0; color: var(--muted); }
.tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); padding: 0 .4rem; border-radius: 2px; margin-inline-start: .4rem; vertical-align: middle; }
.placeholder { background: #ffe9e9; padding: 0 .2em; }

@media print { .site-header, .site-footer, .buybox, .cta-inline, .more { display: none; } }

.langs { position: relative; font-size: .9rem; }
.langs summary { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; list-style: none; padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 4px; color: var(--text); user-select: none; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: ""; width: .4rem; height: .4rem; border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.langs summary:hover, .langs[open] summary { border-color: var(--accent); color: var(--accent); }
.langs ul { position: absolute; inset-inline-end: 0; top: calc(100% + .35rem); z-index: 20; margin: 0; padding: .25rem 0; list-style: none; min-width: 9rem; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.langs li a { display: block; padding: .4rem .9rem; color: var(--text); text-decoration: none; }
.langs li a:hover { background: var(--row); color: var(--accent); }
.langs li a[aria-current] { font-weight: 700; color: var(--accent); }
@media (max-width: 34rem) { .bar { gap: .75rem; } .bar-right { width: 100%; justify-content: space-between; } .site-header .main-nav { gap: 1rem; } }

/* Swedish (object language) fragments inside RTL pages */
[dir=rtl] [lang=sv] { unicode-bidi: isolate; }
