@font-face {
  font-family: Literata;
  src: url(/static/fonts/literata-latin-wght-normal.woff2?v=b613bfc416d2) format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Hanken Grotesk;
  src: url(/static/fonts/hanken-grotesk-latin-wght-normal.woff2?v=72c134a33f66) format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
:root {
  --paper: #f4f6f4;
  --surface: #ffffff;
  --ink: #13302b;
  --ink2: #46564f;
  --line: #d8dfdb;
  --tint: #e7edea;
  --brand: #1e5b4f;
  --brand-hover: #174a40;
  --on-brand: #ffffff;
  --mark: #f6de8d;
  --danger: #a3262a;
  --warn: #fbf1cf;
  --err: #fbe7e6;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --read-font: var(--serif);
  --read-scale: 1;
  --measure: 68ch;
  --radius: 6px;
  --header-h: 60px;
  color-scheme: light dark;
}
/* Teman. Utan data-theme följer wikin enhetens läge (ljust eller mörkt). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #0e1a18;
    --surface: #142421;
    --ink: #e8f0ec;
    --ink2: #a9bab3;
    --line: #294039;
    --tint: #1b2e2a;
    --brand: #6fd1b8;
    --brand-hover: #9be3d0;
    --on-brand: #08201a;
    --mark: #6b5a1e;
    --danger: #ff9494;
    --warn: #3a3216;
    --err: #3e1d1d;
  }
}
:root[data-theme="ljust"] {
  --paper: #f4f6f4;
  --surface: #ffffff;
  --ink: #13302b;
  --ink2: #46564f;
  --line: #d8dfdb;
  --tint: #e7edea;
  --brand: #1e5b4f;
  --brand-hover: #174a40;
  --on-brand: #ffffff;
  --mark: #f6de8d;
  --danger: #a3262a;
  --warn: #fbf1cf;
  --err: #fbe7e6;
}
:root[data-theme="papper"] {
  --paper: #f4ecd8;
  --surface: #fbf6ea;
  --ink: #3b2f22;
  --ink2: #65553f;
  --line: #dfd2b6;
  --tint: #ece2c9;
  --brand: #875626;
  --brand-hover: #6c441d;
  --on-brand: #ffffff;
  --mark: #efd27c;
  --danger: #9b2c22;
  --warn: #f2e2b3;
  --err: #f2d8cc;
}
:root[data-theme="eblack"] {
  --paper: #e9e8e3;
  --surface: #f2f1ed;
  --ink: #2b2b2a;
  --ink2: #565652;
  --line: #cfcec7;
  --tint: #dfded8;
  --brand: #354e49;
  --brand-hover: #253834;
  --on-brand: #ffffff;
  --mark: #d8d3b8;
  --danger: #8c2a2a;
  --warn: #e4dfc9;
  --err: #e8d7d3;
}
:root[data-theme="gron"] {
  --paper: #e1efe5;
  --surface: #f0f7f2;
  --ink: #1d3326;
  --ink2: #46604f;
  --line: #c4dccb;
  --tint: #d3e7d9;
  --brand: #1c6643;
  --brand-hover: #154f34;
  --on-brand: #ffffff;
  --mark: #efdc8c;
  --danger: #9b2a2a;
  --warn: #eee7c3;
  --err: #f0dbd7;
}
:root[data-theme="morkt"] {
  --paper: #0e1a18;
  --surface: #142421;
  --ink: #e8f0ec;
  --ink2: #a9bab3;
  --line: #294039;
  --tint: #1b2e2a;
  --brand: #6fd1b8;
  --brand-hover: #9be3d0;
  --on-brand: #08201a;
  --mark: #6b5a1e;
  --danger: #ff9494;
  --warn: #3a3216;
  --err: #3e1d1d;
}
:root[data-theme="natt"] {
  --paper: #1b1a17;
  --surface: #22201c;
  --ink: #cfc6b4;
  --ink2: #9c9381;
  --line: #38342c;
  --tint: #2a2722;
  --brand: #d1a86a;
  --brand-hover: #e2c08b;
  --on-brand: #1b1a17;
  --mark: #5b4a1f;
  --danger: #e8968c;
  --warn: #353020;
  --err: #3d241f;
}
:root[data-theme="svart"] {
  --paper: #000000;
  --surface: #0b0b0b;
  --ink: #d6d6d6;
  --ink2: #9a9a9a;
  --line: #2a2a2a;
  --tint: #151515;
  --brand: #6fd1b8;
  --brand-hover: #9be3d0;
  --on-brand: #001a14;
  --mark: #5a4c18;
  --danger: #ff8f8f;
  --warn: #2b2510;
  --err: #2e1515;
}
:root[data-theme="mocka"] {
  --paper: #2a1d12;
  --surface: #33241a;
  --ink: #ecdcc6;
  --ink2: #bba58b;
  --line: #4d3828;
  --tint: #3b2a1e;
  --brand: #e0a96d;
  --brand-hover: #efc394;
  --on-brand: #2a1d12;
  --mark: #6b5124;
  --danger: #ff9e8f;
  --warn: #44361d;
  --err: #4a2620;
}
:root[data-mode="light"] {
  color-scheme: light;
}
:root[data-mode="dark"] {
  color-scheme: dark;
}
/* Mörka teman: dämpa bilder och ge sökfältet en kant. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .prose figure img {
    filter: brightness(0.92);
  }
  :root:not([data-theme]) .hero input[type="search"] {
    border-color: var(--line);
  }
}
:root[data-mode="dark"] .prose figure img {
  filter: brightness(0.92);
}
:root[data-mode="dark"] .hero input[type="search"] {
  border-color: var(--line);
}
/* Läsinställningar: textstorlek och typsnitt för brödtexten. */
:root[data-text="1"] {
  --read-scale: 0.9;
}
:root[data-text="3"] {
  --read-scale: 1.12;
}
:root[data-text="4"] {
  --read-scale: 1.25;
}
:root[data-text="5"] {
  --read-scale: 1.4;
}
:root[data-font="sans"] {
  --read-font: var(--sans);
}
*,
*:before,
*:after {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
}
a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--brand-hover);
}
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius);
  z-index: 30;
}
.skip:focus {
  left: 8px;
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.hdr {
  max-width: 1320px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.brand:hover {
  color: var(--ink);
}
.brand svg {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--brand);
}
.brand .sub {
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink2);
}
.hdr-search {
  margin-left: auto;
  position: relative;
  width: min(320px, 40vw);
}
.hdr-search input[type="search"] {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font: inherit;
}
.kbd {
  position: absolute;
  right: 10px;
  top: 8px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  font: 600 0.75rem var(--sans);
  color: var(--ink2);
  background: var(--surface);
  pointer-events: none;
}
.hdr-search svg {
  position: absolute;
  left: 12px;
  top: 11px;
  width: 16px;
  height: 16px;
  color: var(--ink2);
}
.home .hdr-search {
  display: none;
}
.menu-btn {
  display: none;
}
.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 48px;
}
.shell.has-toc {
  grid-template-columns: 250px minmax(0, 1fr) 210px;
}
.shell.wide {
  grid-template-columns: 250px minmax(0, 1fr);
}
.nav {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow: auto;
  padding: 28px 0 40px;
  font-size: 0.95rem;
}
.nav summary {
  display: none;
}
.nav details.sec {
  margin: 0 0 14px;
}
.nav details.sec > summary {
  display: block;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  padding: 4px 0;
}
.nav details.sec > summary::-webkit-details-marker {
  display: none;
}
.nav .sec-link {
  color: var(--ink);
  text-decoration: none;
}
.nav ul {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  border-left: 1px solid var(--line);
}
.nav li a {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 3px solid transparent;
  color: var(--ink2);
  text-decoration: none;
  line-height: 1.35;
}
.nav li a:hover {
  color: var(--ink);
  background: var(--tint);
}
.nav li a[aria-current="page"] {
  border-left-color: var(--brand);
  color: var(--ink);
  font-weight: 600;
}
.nav .tools {
  margin: 0 0 22px;
}
.nav .nav-h {
  margin: 0;
  padding: 4px 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink2);
}
/* Radera ligger sist och för sig själv, så att den inte trycks av misstag bredvid Redigera. */
.actions form.inline:has(> button.danger) {
  margin-left: auto;
}
.nav .new {
  display: inline-block;
  margin-top: 4px;
  padding-left: 14px;
  font-size: 0.88rem;
}
.main {
  padding: 32px 0 80px;
  min-width: 0;
}
.toc {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  padding: 36px 0;
  font-size: 0.88rem;
  max-height: calc(100vh - var(--header-h));
  overflow: auto;
}
.toc strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink2);
  font-weight: 600;
}
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}
.toc a {
  display: block;
  padding: 4px 0 4px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink2);
  text-decoration: none;
  line-height: 1.35;
}
.toc a:hover {
  color: var(--ink);
}
.toc a.l3 {
  padding-left: 28px;
}
.toc a[aria-current="true"] {
  border-left-color: var(--brand);
  color: var(--ink);
  font-weight: 600;
}
.crumbs {
  font-size: 0.88rem;
  color: var(--ink2);
  margin-bottom: 10px;
}
.crumbs a {
  color: var(--ink2);
}
.crumbs span {
  margin: 0 6px;
  color: var(--line);
}
h1 {
  font: 700 clamp(2rem, 1.45rem + 2.2vw, 2.8rem) / 1.12 var(--sans);
  letter-spacing: -0.022em;
  margin: 0 0 10px;
  text-wrap: balance;
}
.meta {
  color: var(--ink2);
  font-size: 0.9rem;
  margin: 0 0 18px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.prose {
  max-width: var(--measure);
  font: calc(1.125rem * var(--read-scale)) / 1.72 var(--read-font);
}
.prose > *:first-child {
  margin-top: 0;
}
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--sans);
  letter-spacing: -0.012em;
  line-height: 1.25;
  text-wrap: balance;
}
.prose h2 {
  font-size: 1.6rem;
  margin: 2.2em 0 0.6em;
  font-weight: 700;
}
.prose h3 {
  font-size: 1.25rem;
  margin: 1.8em 0 0.5em;
  font-weight: 650;
}
.prose h4 {
  font-size: 1.05rem;
  margin: 1.5em 0 0.4em;
  font-weight: 650;
}
.prose p {
  margin: 0 0 1.05em;
}
.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}
.prose li {
  margin: 0.25em 0;
}
.prose li.task {
  list-style: none;
  margin-left: -1.4em;
}
.prose li.task input {
  width: 1.05em;
  height: 1.05em;
  margin: 0 0.5em 0 0;
  vertical-align: -0.12em;
  accent-color: var(--brand);
}
.prose blockquote {
  margin: 1.4em 0;
  padding: 0.9em 1.2em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}
.prose blockquote > *:last-child {
  margin-bottom: 0;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}
.prose code {
  font:
    0.88em ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  background: var(--tint);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow: auto;
  line-height: 1.5;
}
.prose pre code {
  background: none;
  padding: 0;
}
.prose table {
  border-collapse: collapse;
  margin: 1.4em 0;
  font: 0.95rem/1.45 var(--sans);
  display: block;
  overflow-x: auto;
  max-width: 100%;
}
.prose th,
.prose td {
  border-bottom: 1px solid var(--line);
  padding: 8px 14px 8px 0;
  text-align: left;
  vertical-align: top;
}
.prose th {
  font-weight: 650;
  border-bottom: 2px solid var(--ink);
}
.prose figure {
  margin: 1.6em 0;
}
.prose figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.prose figcaption {
  font: 0.88rem/1.45 var(--sans);
  color: var(--ink2);
  margin-top: 8px;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  max-width: var(--measure);
}
.pager a {
  display: block;
  text-decoration: none;
  max-width: 48%;
}
.pager small {
  display: block;
  color: var(--ink2);
}
.pager .next {
  text-align: right;
  margin-left: auto;
}
.pager b {
  font-weight: 650;
}
.btn,
button {
  font: 600 0.95rem var(--sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--on-brand);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover,
button:hover {
  background: var(--brand-hover);
  color: var(--on-brand);
}
.btn.quiet,
button.quiet {
  background: transparent;
  color: var(--brand);
  border-color: transparent;
  padding: 0 10px;
}
.btn.quiet:hover,
button.quiet:hover {
  background: var(--tint);
  color: var(--brand-hover);
}
.btn.outline,
button.outline {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--line);
}
.btn.outline:hover,
button.outline:hover {
  background: var(--tint);
  border-color: var(--brand);
}
.btn.danger,
button.danger {
  background: transparent;
  color: var(--danger);
  border-color: transparent;
}
.btn.danger:hover,
button.danger:hover {
  background: var(--err);
  color: var(--danger);
}
form.inline {
  display: inline;
}
label {
  display: block;
  font-weight: 600;
  margin: 20px 0 6px;
}
input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  font: inherit;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
}
.help {
  color: var(--ink2);
  font-size: 0.9rem;
  margin: 4px 0 0;
}
.notice,
.error {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 0 0 20px;
  max-width: var(--measure);
}
.notice {
  background: var(--warn);
}
.error {
  background: var(--err);
}
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-in {
  max-width: 1320px;
  margin: 0 auto;
  padding: 72px 20px 64px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero h1 {
  max-width: 14ch;
  font-size: clamp(2.4rem, 1.4rem + 4vw, 4.2rem);
  line-height: 1.04;
  margin-bottom: 12px;
}
.hero p {
  max-width: 46ch;
  font-size: 1.15rem;
  color: var(--ink2);
  margin: 0 0 28px;
  font-family: var(--serif);
  line-height: 1.6;
}
.hero form {
  position: relative;
  max-width: 560px;
}
.hero input[type="search"] {
  height: 56px;
  padding: 0 20px 0 52px;
  font-size: 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--ink2);
}
.hero form svg {
  position: absolute;
  left: 20px;
  top: 18px;
  width: 20px;
  height: 20px;
  color: var(--ink2);
}
.rings {
  position: absolute;
  right: -120px;
  top: 50%;
  width: 760px;
  height: 760px;
  transform: translateY(-50%);
  color: var(--line);
  pointer-events: none;
}
.rings circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
}
.rings .core {
  fill: var(--tint);
  stroke: none;
}
.cols {
  max-width: 1320px;
  margin: 0 auto;
  padding: 56px 20px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.col {
  padding: 0 32px;
  border-left: 1px solid var(--line);
}
.col:first-child {
  padding-left: 0;
  border-left: 0;
}
.col h2 {
  font: 700 1.4rem/1.2 var(--sans);
  letter-spacing: -0.012em;
  margin: 0 0 6px;
}
.col h2 a {
  color: var(--ink);
  text-decoration: none;
}
.col h2 a:hover {
  color: var(--brand);
}
.col p {
  margin: 0 0 14px;
  color: var(--ink2);
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.55;
}
.col ul {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}
.col li a {
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.col li a:hover {
  color: var(--brand);
}
.col .all {
  font-size: 0.92rem;
}
.recent-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
.recent-wrap h2 {
  font: 700 1.4rem/1.2 var(--sans);
  margin: 0 0 12px;
}
.recent {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 760px;
}
.recent li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.recent time {
  color: var(--ink2);
  font-size: 0.9rem;
}
.recent .by {
  display: block;
  color: var(--ink2);
  font-size: 0.85rem;
}
.plist {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}
.plist li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.plist a {
  font-weight: 650;
  font-size: 1.1rem;
  text-decoration: none;
}
.plist small {
  display: block;
  color: var(--ink2);
}
.empty {
  max-width: var(--measure);
  padding: 24px 0;
  color: var(--ink2);
}
.hit {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  max-width: var(--measure);
}
.hit a {
  font-weight: 650;
  font-size: 1.1rem;
}
.hit p {
  margin: 4px 0 0;
  font-family: var(--serif);
  color: var(--ink2);
}
.hit small {
  color: var(--ink2);
}
mark {
  background: var(--mark);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
.big-search {
  display: flex;
  gap: 8px;
  max-width: var(--measure);
  margin-bottom: 20px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.table th,
.table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.table th {
  font-weight: 650;
  color: var(--ink2);
}
input.ed-title {
  font: 700 clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem) / 1.2 var(--sans);
  letter-spacing: -0.02em;
  padding: 10px 0;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  background: transparent;
}
input.ed-title:focus {
  border-bottom-color: var(--brand);
}
.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.toolbar button {
  min-height: 34px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.9rem;
}
.toolbar button:hover {
  background: var(--tint);
  color: var(--ink);
}
.toolbar .sep {
  width: 1px;
  background: var(--line);
  margin: 4px 6px;
}
.tabs {
  display: none;
  gap: 4px;
  margin: 12px 0 0;
}
.tabs button {
  background: transparent;
  color: var(--ink2);
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0 12px;
}
.tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--brand);
}
.panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 14px;
}
.panes textarea {
  min-height: 520px;
  resize: vertical;
  font:
    0.95rem/1.6 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
}
.panes .prose {
  min-height: 520px;
  padding: 0 4px;
  overflow: auto;
}
.status {
  min-height: 1.4em;
  color: var(--ink2);
  font-size: 0.9rem;
  margin-top: 8px;
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}
.dropping textarea {
  border-color: var(--brand);
  background: var(--tint);
}
.row-form {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 130px minmax(0, 2.4fr) auto;
  gap: 10px 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.row-form.sec-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 90px auto;
}
.checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  margin: 0 14px 0 0;
}
.checks input {
  accent-color: var(--brand);
}
.admin h2 {
  font: 700 1.3rem/1.2 var(--sans);
  margin: 40px 0 6px;
}
@media (max-width: 1180px) {
  .shell.has-toc {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}
@media (max-width: 900px) {
  .shell,
  .shell.has-toc,
  .shell.wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .nav {
    position: static;
    max-height: none;
    padding: 12px 0 0;
    border-bottom: 1px solid var(--line);
  }
  .nav > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }
  .nav > summary::-webkit-details-marker {
    display: none;
  }
  .nav > summary:after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: 10px;
    border-right: 2px solid var(--ink2);
    border-bottom: 2px solid var(--ink2);
    transform: rotate(45deg) translateY(-2px);
  }
  .nav[open] > summary:after {
    transform: rotate(-135deg);
  }
  .nav-body {
    padding-bottom: 12px;
  }
  .main {
    padding-top: 24px;
  }
  .hdr-search {
    width: auto;
    flex: 1;
  }
  .kbd {
    display: none;
  }
  .hdr {
    gap: 10px;
  }
  .brand .sub {
    display: none;
  }
  .cols {
    grid-template-columns: 1fr;
    padding-top: 40px;
  }
  .col,
  .col:first-child {
    padding: 0 0 28px;
    border-left: 0;
  }
  .hero-in {
    padding: 44px 20px 40px;
  }
  .rings {
    right: -420px;
    width: 560px;
    height: 560px;
    opacity: 0.45;
  }
  .rings .core {
    display: none;
  }
  .tabs {
    display: flex;
  }
  .panes {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .panes[data-tab="write"] .prose,
  .panes[data-tab="preview"] textarea {
    display: none;
  }
  .row-form,
  .row-form.sec-form {
    grid-template-columns: 1fr;
  }
  .recent li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
@media (max-width: 600px) {
  .brand span {
    display: none;
  }
}
@media (min-width: 901px) {
  .nav > summary {
    display: none;
  }
}
.btn,
button {
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.08s;
}
@media (prefers-reduced-motion: no-preference) {
  .btn:active,
  button:active {
    transform: translateY(1px);
  }
  .col li a,
  .plist li,
  .hit,
  .recent li {
    transition: transform 0.18s ease;
  }
  .col li a:hover {
    transform: translate(3px);
  }
  .plist li:hover,
  .hit:hover {
    transform: translateY(-2px);
  }
  .prose figure img {
    transition: transform 0.35s ease;
  }
  .prose figure:hover img {
    transform: scale(1.015);
  }
  .prose figure {
    overflow: hidden;
    border-radius: var(--radius);
  }
  .rings {
    animation: rings-in 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero h1,
  .hero p,
  .hero form {
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero p {
    animation-delay: 0.08s;
  }
  .hero form {
    animation-delay: 0.16s;
  }
  @keyframes rise {
    0% {
      opacity: 0;
      transform: translateY(14px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes rings-in {
    0% {
      opacity: 0;
      transform: translateY(-50%) scale(0.94);
    }
    to {
      opacity: 1;
      transform: translateY(-50%) scale(1);
    }
  }
}
@media print {
  .site-header,
  .nav,
  .toc,
  .actions,
  .pager,
  .skip {
    display: none;
  }
  .shell,
  .shell.has-toc {
    display: block;
  }
  body {
    background: #fff;
  }
  .prose {
    max-width: none;
  }
}
.auth-body {
  min-height: 100vh;
}
.auth {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  align-content: start;
  padding: 8vh 20px 40px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px 32px 28px;
}
.auth-card .brand {
  margin-bottom: 22px;
}
.auth-card h1 {
  font-size: 1.9rem;
  margin-bottom: 14px;
}
.auth-card h2 {
  font: 700 1.15rem var(--sans);
  margin: 0 0 6px;
}
.auth-card .lead {
  margin: 0 0 8px;
}
.auth-card .help {
  color: var(--ink2);
  font-size: 0.92rem;
  margin: 6px 0 14px;
}
.auth-card .stack {
  display: grid;
  gap: 6px;
}
.auth-card .stack label,
.auth-card label {
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 6px;
}
.auth-card button.big {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  font-size: 1rem;
}
.auth-card .error {
  max-width: none;
}
.split {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
.codebox {
  letter-spacing: 0.3em;
  font: 600 1.3rem var(--sans);
  text-align: center;
}
.status {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-size: 0.92rem;
  color: var(--ink2);
}
.status.bad {
  color: var(--danger);
}
code.code {
  font:
    700 1.05rem ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  letter-spacing: 0.12em;
  background: var(--tint);
  padding: 2px 8px;
  border-radius: 5px;
}
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 12px;
}
.chips li {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 2px 4px 2px 14px;
}
.chips form {
  display: flex;
  align-items: center;
  gap: 4px;
}
.chips button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.82rem;
}
.row-form.inv-form {
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 90px 90px auto;
}
.row-form.dom-form {
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: 520px;
  border-bottom: 0;
}
.row-form.user-form .row-meta {
  grid-column: 1/-1;
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.row-form.user-form .row-meta button {
  min-height: 30px;
  font-size: 0.85rem;
}
.flag {
  color: var(--danger);
}
.addkey {
  max-width: 420px;
  margin: 18px 0 8px;
}
.actions.off {
  border-bottom: 0;
}
@media (max-width: 900px) {
  .row-form.inv-form {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .auth {
    padding-top: 4vh;
  }
  .auth-card {
    padding: 24px 20px;
  }
}
pre.codes {
  font:
    700 1.05rem/1.9 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  letter-spacing: 0.1em;
  margin: 0.6rem 0 0;
  white-space: pre;
  user-select: all;
}
.badge {
  display: inline-block;
  min-width: 1.3em;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
}
.fld {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink2);
}
.fld small {
  font-weight: 400;
  font-size: 0.8rem;
}
.row-form.inv-form,
.row-form.log-filter {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: start;
}
.row-form.owner-row {
  background: var(--tint);
  padding: 12px;
  border-radius: var(--radius);
}
.table.rights th[scope="row"] {
  color: var(--ink);
}
.table.rights td {
  font-size: 0.9rem;
}
.diff-tabs .legend {
  margin-left: auto;
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
}
.d-add {
  background: #2ea05a38;
  padding: 0 4px;
  border-radius: 3px;
  text-decoration: none;
}
.d-del {
  background: #c8323233;
  padding: 0 4px;
  border-radius: 3px;
}
.diff .blk {
  position: relative;
  padding: 2px 12px;
  margin: 0 0 10px;
  border-left: 4px solid transparent;
}
.diff .blk-add {
  background: #2ea05a24;
  border-left-color: #2ea05a;
}
.diff .blk-del {
  background: #c8323221;
  border-left-color: #c83232;
}
.diff .blk-del > *:not(.tag) {
  text-decoration: line-through;
  text-decoration-color: #c83232b3;
}
.diff .tag {
  display: block;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--ink2);
  margin-top: 4px;
}
.review-form {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  max-width: var(--measure);
}
.pager-line {
  margin-top: 16px;
  color: var(--ink2);
}
.checks .acc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
  margin: 0 0 4px;
}
.checks .acc select {
  width: auto;
  min-width: 9.5em;
}

/* Sidhuvud: knappar, Utseende och kontomeny. */
.home .hdr-search {
  display: none;
}
.home .hdr-review {
  margin-left: auto;
}
.hdr-review .badge {
  margin-left: 2px;
}
.hdr-btn {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
}
.hdr-btn::-webkit-details-marker {
  display: none;
}
.hdr-btn:hover,
.pop[open] > .hdr-btn {
  background: var(--tint);
}
.aa {
  font: 700 1.05rem/1 var(--serif);
  letter-spacing: -0.02em;
}
.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  font-size: 0.95rem;
}
.dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}
.pop {
  position: relative;
}
.pop-body {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: min(330px, calc(100vw - 24px));
  max-height: calc(100vh - var(--header-h) - 16px);
  overflow: auto;
  padding: 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px #0003;
}
.acct-who {
  display: grid;
  gap: 6px;
  justify-items: start;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink2);
}
.acct-who .email {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.role {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 10px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.8rem;
}
.acct-links {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.acct-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  margin: 0 -10px;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.acct-links a:hover {
  background: var(--tint);
}
.pop-body form button {
  width: 100%;
}
.look-form fieldset {
  border: 0;
  margin: 0 0 14px;
  padding: 0;
}
.look-form legend {
  font-weight: 700;
  margin-bottom: 8px;
  padding: 0;
}
.grp {
  margin: 10px 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.swatches:first-of-type {
  grid-template-columns: 1fr;
}
.sw,
.size,
.font {
  position: relative;
  cursor: pointer;
}
.sw input,
.size input,
.font input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sw {
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--ink2);
  text-align: center;
}
.chip {
  display: grid;
  place-items: center;
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 600 1rem/1 var(--serif);
}
.chip[data-swatch="auto"] {
  background: linear-gradient(135deg, #f4f6f4 0 50%, #0e1a18 50% 100%);
  color: transparent;
}
.swatches:first-of-type .sw {
  grid-template-columns: 44px 1fr;
  justify-items: start;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}
.swatches:first-of-type .chip {
  width: 44px;
}
.sw input:checked + .chip {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.sw input:checked ~ .sw-name {
  color: var(--ink);
  font-weight: 700;
}
.sw input:focus-visible + .chip,
.size input:focus-visible + span,
.font input:focus-visible + span {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.sizes,
.fonts {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.size,
.font {
  flex: 1;
}
.size + .size,
.font + .font {
  border-left: 1px solid var(--line);
}
.size span,
.font span {
  display: grid;
  place-items: center;
  height: 44px;
  font-family: var(--serif);
}
.font .font-sans {
  font-family: var(--sans);
}
.font span {
  font-size: 0.92rem;
}
.size input:checked + span,
.font input:checked + span {
  background: var(--brand);
  color: var(--on-brand);
}
.size-a.s1 {
  font-size: 0.8rem;
}
.size-a.s2 {
  font-size: 0.95rem;
}
.size-a.s3 {
  font-size: 1.1rem;
}
.size-a.s4 {
  font-size: 1.3rem;
}
.size-a.s5 {
  font-size: 1.5rem;
}
.chip[data-swatch="ljust"] {
  background: #f4f6f4;
  color: #13302b;
  border-color: #d8dfdb;
}
.chip[data-swatch="papper"] {
  background: #f4ecd8;
  color: #3b2f22;
  border-color: #dfd2b6;
}
.chip[data-swatch="eblack"] {
  background: #e9e8e3;
  color: #2b2b2a;
  border-color: #cfcec7;
}
.chip[data-swatch="gron"] {
  background: #e1efe5;
  color: #1d3326;
  border-color: #c4dccb;
}
.chip[data-swatch="morkt"] {
  background: #0e1a18;
  color: #e8f0ec;
  border-color: #294039;
}
.chip[data-swatch="natt"] {
  background: #1b1a17;
  color: #cfc6b4;
  border-color: #38342c;
}
.chip[data-swatch="svart"] {
  background: #000000;
  color: #d6d6d6;
  border-color: #2a2a2a;
}
.chip[data-swatch="mocka"] {
  background: #2a1d12;
  color: #ecdcc6;
  border-color: #4d3828;
}

/* Mobil: inget får bli bredare än skärmen. */
html,
body {
  overflow-x: clip;
}
@media (max-width: 900px) {
  .table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
  /* Tabellen rullar i sidled i stället för att bryta varje ord på en egen rad. */
  .table th,
  .table td {
    white-space: nowrap;
  }
  .hdr-review {
    display: none;
  }
}
@media (max-width: 600px) {
  .hdr {
    padding: 0 10px 0 14px;
    gap: 4px;
  }
  .brand {
    min-width: 44px;
    min-height: 44px;
  }
  .hdr-search {
    margin: 0 4px;
  }
  .nav details.sec > summary,
  .nav li a {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .toc a {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .toolbar button,
  .tabs button,
  .btn,
  button {
    min-height: 44px;
  }
}
.look-form label {
  margin: 0;
  font-weight: 400;
}
.pop-body form button.quiet {
  display: flex;
  align-items: center;
  width: calc(100% + 20px);
  min-height: 44px;
  margin: 0 -10px;
  padding: 0 10px;
  text-align: left;
}
.sw input:checked + .chip,
.sw input:focus-visible + .chip {
  outline-offset: -3px;
  box-shadow: inset 0 0 0 5px var(--surface);
}
.auth-card .brand span {
  display: inline;
}
.auth-card .brand .sub {
  display: inline;
}
/* Friskrivning längst ner på varje sida. */
.site-footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  border-top: 1px solid var(--line);
  color: var(--ink2);
  font-size: 0.85rem;
}
.site-footer p {
  max-width: var(--measure);
  margin: 0;
}
/* "En tjänst från Duxe": liten avsändarrad under friskrivningen och under inloggningskortet. */
.made-by {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink2);
}
.site-footer .made-by {
  margin-top: 12px;
}
.made-by a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
.made-by a:hover,
.made-by a:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}
.company {
  margin: 4px 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink2);
}
.site-footer .company {
  margin-top: 4px;
}
.company a {
  color: inherit;
}
.auth > .company {
  text-align: center;
}
.auth > .made-by {
  margin: 16px 0 0;
  text-align: center;
}
/* Inloggning: koden är valfri och ligger hopfälld. */
.code-opt {
  margin: 14px 0 4px;
}
.code-opt summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Lagkartan */
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  margin-top: 20px;
  color: var(--ink2);
}
.hero-links a {
  font-weight: 600;
}
.law-area h2,
.law-queue h2 {
  margin-top: 32px;
}
.law-queue {
  border-left: 3px solid var(--brand);
  padding-left: 16px;
}
.law-queue form.inline {
  margin-top: 6px;
}
.law-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 32px;
  margin: 16px 0 24px;
}
.law-links h2 {
  font-size: 1.05rem;
  margin: 0 0 6px;
}
.law-links ul {
  margin: 0;
  padding-left: 18px;
}
.law-links small {
  color: var(--ink2);
}
.law-toc {
  margin: 0 0 24px;
}
.law-toc ul {
  columns: 2 260px;
  padding-left: 18px;
}
.law-text h2 {
  margin-top: 40px;
}
.law-p {
  scroll-margin-top: 80px;
  margin-left: -15px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid transparent;
}
.law-p:target {
  border-left-color: var(--brand);
}
.law-p.kommande {
  border-left-color: var(--warn);
}
.law-p.upphör {
  opacity: 0.8;
}
.law-p-head {
  margin: 16px 0 4px;
  font-weight: 700;
}
.law-p-head a {
  color: inherit;
  text-decoration: none;
}
.law-text .tag,
.notice .tag {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--warn);
  color: var(--ink);
  vertical-align: middle;
}
.meta .review {
  display: inline-block;
  margin-left: 10px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  color: var(--brand);
  font-size: 0.85em;
  white-space: nowrap;
}
.meta .review.unsure {
  border-color: var(--ink2);
  color: var(--ink2);
}
/* Bevakningsläget på startsidan */
.watch {
  border-bottom: 1px solid var(--line);
}
.watch-in {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px 40px;
}
.watch h2 {
  font-size: 1.1rem;
  margin: 0 0 10px;
}
.watch details summary {
  cursor: pointer;
  color: var(--ink2);
  margin-top: 8px;
}
.law-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.law-chip {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
}
.law-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
/* Kartan */
.map {
  height: min(75svh, 760px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
  touch-action: none;
}
.map-svg {
  width: 100%;
  height: 100%;
  cursor: grab;
  user-select: none;
}
.map-svg .edge {
  stroke: var(--line);
  stroke-width: 1;
}
.map-svg .e-ref {
  stroke: var(--brand);
  stroke-opacity: 0.5;
}
.map-svg .e-mention {
  stroke-dasharray: 3 3;
}
.map-svg .node circle {
  stroke: var(--bg);
  stroke-width: 2;
}
.map-svg .node text {
  font-size: 11px;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
}
.map-svg .n-area circle,
.map-legend .k-area::before {
  fill: var(--brand);
  background: var(--brand);
}
.map-svg .n-law circle,
.map-legend .k-law::before {
  fill: var(--ink);
  background: var(--ink);
}
.map-svg .n-section circle,
.map-legend .k-section::before {
  fill: var(--ink2);
  background: var(--ink2);
}
.map-svg .n-page circle,
.map-legend .k-page::before {
  fill: var(--warn);
  background: var(--warn);
}
.map-svg .n-page circle {
  stroke: var(--ink2);
  stroke-width: 1;
}
.map-svg .n-page text {
  display: none;
}
.map-svg.focus .node,
.map-svg.focus .edge {
  opacity: 0.15;
}
.map-svg.focus .node.near,
.map-svg.focus .edge.near {
  opacity: 1;
}
.map-svg.focus .node.near text {
  display: inline;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 10px;
  color: var(--ink2);
  font-size: 0.9rem;
}
.map-legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

/* Fråga Hållpunkt (AI-assistenten) */
.lede {
  max-width: var(--measure);
  color: var(--ink2);
  margin: 0 0 18px;
}
.ai-ask {
  max-width: var(--measure);
  margin: 0 0 24px;
}
.ai-ask textarea {
  width: 100%;
  min-height: 5.5em;
  font: inherit;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
}
.ai-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.ai-row small,
.ai-who small,
.ai-escalate small {
  color: var(--ink2);
}
.ai-answers {
  max-width: var(--measure);
}
.ai-entry {
  margin: 0 0 28px;
}
.ai-question {
  font-weight: 650;
  margin: 0 0 10px;
  padding: 10px 14px;
  background: var(--tint);
  border-radius: var(--radius);
}
.ai-answer {
  padding: 14px 16px;
  margin: 0 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ai-answer.ai-colleague {
  border-left: 4px solid var(--brand);
}
.ai-answer.ai-error {
  background: var(--err);
}
.ai-who {
  margin: 0 0 8px;
}
.ai-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
}
.ai-colleague .ai-badge {
  background: var(--ink);
  color: var(--surface);
}
a.cite {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 4px;
  margin: 0 1px;
  font-size: 0.75em;
  line-height: 1.5;
  vertical-align: super;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  background: var(--tint);
}
.ai-sources {
  margin: 12px 0 0;
  padding: 10px 0 0 1.6em;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}
.ai-sources li {
  margin: 4px 0;
  overflow-wrap: anywhere;
}
.ai-sources li:target {
  background: var(--mark);
}
.ai-kind {
  font-size: 0.8rem;
  color: var(--ink2);
}
.ai-kind.k-webb {
  color: var(--danger);
}
.ai-escalate {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--warn);
  border-radius: var(--radius);
}
.ai-escalate p {
  margin: 0 0 8px;
}
.ai-escalate p:last-child {
  margin: 0;
}
.ai-wait {
  color: var(--ink2);
  font-style: italic;
}
.ai-wait::before {
  content: '';
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 8px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  vertical-align: -1px;
  animation: ai-spin 0.9s linear infinite;
}
@keyframes ai-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ai-wait::before {
    animation: none;
  }
}
.ai-feedback {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink2);
  font-size: 0.9rem;
}
.ai-examples ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-examples button {
  text-align: left;
}
.ai-note {
  max-width: var(--measure);
  color: var(--ink2);
  font-size: 0.85rem;
}
.table-wrap {
  overflow-x: auto;
}
.ai-log pre {
  white-space: pre-wrap;
  max-width: 60ch;
}
.home-ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

/* Vägval: en fråga i taget, stora knappar för mobil och stress. */
.vagval { margin: 1rem 0 2rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scroll-margin-top: calc(var(--header-h) + 8px); }
.vv-step { margin: 0 0 .25rem; font-family: var(--sans); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); }
.vagval h2 { margin: 0 0 .5rem; font-size: 1.35rem; line-height: 1.25; }
.vv-options { display: grid; gap: .6rem; margin-top: 1rem; }
.vv-opt { display: block; padding: .95rem 1rem; min-height: 3rem; border-radius: var(--radius); background: var(--brand); color: var(--on-brand); font-family: var(--sans); font-size: 1.1rem; font-weight: 600; text-decoration: none; }
.vv-opt:hover, .vv-opt:focus-visible { background: var(--brand-hover); color: var(--on-brand); }
@media (min-width: 640px) { .vv-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vv-result h3 { margin: 1rem 0 .35rem; font-size: 1rem; font-family: var(--sans); }
.vv-result ul { margin: 0; padding-left: 1.2rem; }
.vv-result li { margin: .3rem 0; }
.vv-not li::marker { content: "✕  "; color: var(--danger); }
.vv-may li::marker { content: "✓  "; color: var(--brand); }
.vv-note { margin-top: 1rem; padding: .6rem .75rem; border-radius: var(--radius); background: var(--warn); color: #3b2f05; }
.vv-nav { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.vv-answers { margin-top: 1rem; font-size: .95rem; }
.vv-answers li { margin: .25rem 0; }
.vv-answers a { margin-left: .35rem; font-size: .85rem; }

/* Startsidans hero: namnet, en lugn rubrik, sök och tre ingångar. */
.hero-eyebrow { margin: 0 0 10px !important; font-family: var(--sans) !important; font-size: .85rem !important; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--brand) !important; }
.hero-in > :not(.rings) { position: relative; z-index: 1; }
.hero p.hero-lead { margin-bottom: 24px; }
.hero-cards { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 980px; }
.hero-cards a { display: grid; gap: 4px; align-content: start; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.hero-cards a:hover, .hero-cards a:focus-visible { border-color: var(--brand); box-shadow: 0 4px 16px #0000000f; }
.hero-cards b { font-family: var(--sans); font-size: 1.05rem; color: var(--brand); }
.hero-cards span { font-size: .95rem; line-height: 1.45; color: var(--ink2); }
.hero-trust { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-family: var(--sans); font-size: .9rem; color: var(--ink2); }
.hero-trust li::before { content: "✓"; margin-right: 6px; color: var(--brand); font-weight: 700; }
@media (max-width: 900px) { .hero-cards { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .hero-in { padding: 32px 16px 32px; }
  .hero h1 { font-size: 2.3rem; }
  .hero p.hero-lead { font-size: 1.05rem; }
  .hero input[type="search"] { height: 50px; }
  .hero form svg { top: 15px; }
  .hero-cards { margin-top: 20px; gap: 10px; }
}

/* Sidhuvud: knapparna till höger även när sökfältet saknas (startsidan) och i mobil. */
.brand { margin-right: auto; }
.hdr-search { margin-left: 0; }
@media (max-width: 600px) {
  .pop-body { position: fixed; left: 12px; right: 12px; top: calc(var(--header-h) + 6px); width: auto; }
}

/* Granskning 2026-11-22: jämna rader på startsidan, luft och träffytor i mobil. */
@media (min-width: 901px) {
  .cols { row-gap: 48px; }
  .col:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
}
.col .all { display: inline-block; margin-top: 6px; padding: 6px 0; }
.prose th, .prose td { padding: 10px 12px; }
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose td a { white-space: nowrap; }
.vv-nav .btn { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; }
.vv-options { gap: 10px; }
.vv-answers a { display: inline-block; padding: 8px 6px; margin-left: 2px; }
@media (max-width: 600px) {
  .hero-in { padding-left: 20px; padding-right: 20px; }
  .brand span { display: inline; font-size: 1rem; }
  .hdr-search { min-width: 0; }
  .hdr-search input[type="search"] { padding-right: 10px; }
  .actions { gap: 8px; }
  .actions .btn, .actions form.inline button { min-height: 40px; }
}

/* Mobil, ej startsidan: sökningen bakom en ikon. Ikonen öppnar ett sökfält som tar hela sidhuvudet. */
.hdr-search-open, .hdr-search-close { display: none; }
.hdr-search-open svg { width: 20px; height: 20px; }
@media (max-width: 600px) {
  .hdr { position: relative; }
  .hdr-search-open { display: grid; }
  .hdr-search { display: none; }
  .site-header.searching .hdr-search {
    display: flex; align-items: center; gap: 6px;
    position: absolute; inset: 0; z-index: 5; margin: 0; width: auto;
    padding: 0 8px 0 12px; background: var(--surface);
  }
  .site-header.searching .hdr-search svg { left: 24px; top: 50%; transform: translateY(-50%); }
  .site-header.searching .hdr-search input[type="search"] { flex: 1; height: 42px; font-size: 16px; }
  .site-header.searching .hdr-search-close { display: grid; flex: none; font-size: 1.6rem; line-height: 1; background: none; border: 0; padding: 0; }
}
.site-header.searching .hdr-search input::-webkit-search-cancel-button { display: none; }

/* Finputs för läsning och mobil (2026-11-29). */
::selection {
  background: var(--mark);
  color: var(--ink);
}
a,
button,
summary,
label {
  -webkit-tap-highlight-color: transparent;
}
.prose p,
.prose li,
.prose blockquote,
.hero p,
.hero-cards span,
.help {
  text-wrap: pretty;
}
/* Långa ord, adresser och e-post ska radbrytas i stället för att tränga ut sidan. */
.prose,
.notice,
.error,
.hero-cards a {
  overflow-wrap: break-word;
}
.meta,
.notice a,
.error a,
.prose a {
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  /* Svenska sammansättningar blir långa i smala kolumner: avstava brödtexten. */
  .prose p,
  .prose li,
  .prose td {
    -webkit-hyphens: auto;
    hyphens: auto;
  }
  .prose h2 {
    font-size: 1.4rem;
    margin-top: 1.9em;
  }
  .prose h3 {
    font-size: 1.15rem;
  }
  /* Större träffytor för tummen. */
  .crumbs a {
    display: inline-block;
    padding: 6px 0;
  }
  .actions {
    gap: 8px 12px;
  }
}
@media (hover: none) {
  /* Inga hovringsrörelser på pekskärm, där de fastnar efter ett tryck. */
  .col li a:hover,
  .plist li:hover,
  .hit:hover,
  .prose figure:hover img {
    transform: none;
  }
}

/* Min roll (2026-11-30): rollväljaren i sidhuvudet. Rollen står synligt som en knapp, så att läsaren
   ser vilken roll sidan anpassas efter. */
.role-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font: 500 0.9rem/1.2 var(--sans);
  color: var(--ink2);
}
.role-btn::-webkit-details-marker { display: none; }
.role-val {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  max-width: 13em;
  padding: 0 14px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.15s;
}
.role-val.none { border-style: dashed; color: var(--brand); }
.role-btn:hover .role-val,
.role-pick[open] .role-val { background: var(--tint); }
.role-btn:focus-visible { outline: none; }
.role-btn:focus-visible .role-val { outline: 2px solid var(--brand); outline-offset: 2px; }
.role-form fieldset { border: 0; margin: 0; padding: 0; }
.role-form legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.role-lead { margin: 0 0 10px; font-size: 0.9rem; line-height: 1.45; color: var(--ink2); }
.role-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  margin: 0 -10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}
.role-opt:hover { background: var(--tint); }
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }
.role-opt small { font-weight: 400; font-size: 0.85rem; color: var(--ink2); }
.role-check { width: 18px; height: 18px; margin-left: auto; color: var(--brand); visibility: hidden; flex: none; }
.role-opt input:checked ~ .role-name { color: var(--brand); }
.role-opt input:checked ~ .role-check { visibility: visible; }
.role-opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: -2px; }
.role-opt:last-of-type { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 760px) {
  .role-du { display: none; }
}
@media (max-width: 600px) {
  .role-val { min-height: 34px; padding: 0 12px; font-size: 0.85rem; max-width: 9.5em; }
}
/* Smal mobil: märket räcker som hemknapp, så att rollen får plats i sidhuvudet. */
@media (max-width: 430px) {
  .site-header .brand span { display: none; }
  .hdr { gap: 8px; }
}

/* Min roll, artikeln (2026-11-30): ingressen som ruta "I korthet" och knapprad nertill i mobil. */
.lead-box {
  margin: 20px 0 28px;
  padding: 18px 22px 6px;
  border-radius: 14px;
  background: var(--brand);
  color: var(--on-brand);
  max-width: 72ch;
}
.lead-box h2 {
  margin: 0 0 8px;
  font: 700 0.95rem/1.2 var(--sans);
  color: inherit;
}
.lead-box p {
  margin: 0 0 12px;
  font-size: 1.08em;
  line-height: 1.55;
}
.lead-box a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lead-box a:hover { text-decoration-thickness: 2px; }
.lead-box a:focus-visible { outline-color: var(--on-brand); }
.lead-box ::selection { background: var(--on-brand); color: var(--brand); }

.article-bar { display: none; }
@media (max-width: 600px) {
  .article-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px #00000014;
  }
  body:has(.article-bar) { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .ab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--ink);
    font: 600 0.8rem/1.1 var(--sans);
    text-decoration: none;
    cursor: pointer;
  }
  .ab-item[hidden] { display: none; }
  .ab-item svg { width: 22px; height: 22px; }
  .ab-item:hover, .ab-item:active { background: var(--tint); color: var(--ink); }
  .ab-item[aria-pressed="true"] { color: var(--brand); }
  .ab-item[aria-pressed="true"] svg { fill: currentColor; }
  .ab-ask { background: var(--brand); color: var(--on-brand); }
  .ab-ask:hover, .ab-ask:active { background: var(--brand); color: var(--on-brand); filter: brightness(1.08); }

  /* Avsnitten fälls ihop i mobil (app.js): rubriken blir en knapp, texten visas vid tryck. */
  .prose h2.fold { margin: 0; border-bottom: 1px solid var(--line); font-size: 1.2rem; }
  .prose h2.fold + .fold-body { padding: 4px 0 18px; }
  .fold-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 10px 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .fold-btn:hover, .fold-btn:active { background: none; color: var(--brand); transform: none; }
  .fold-btn svg { width: 20px; height: 20px; flex: none; color: var(--ink2); transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
  .fold-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
  .lead-box { margin: 16px 0 12px; padding: 16px 18px 4px; }
}
@media print {
  .article-bar { display: none; }
  .lead-box { background: none; color: inherit; border: 1px solid; }
}
.saved-wrap { max-width: 1320px; margin: 0 auto; padding: 28px 20px 4px; }
.saved-wrap[hidden] { display: none; }
.saved-wrap h2 { font: 700 1.1rem/1.2 var(--sans); margin: 0 0 10px; }
.saved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.saved-list a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink); font: 600 0.95rem/1.2 var(--sans); text-decoration: none;
}
.saved-list a:hover { border-color: var(--brand); color: var(--brand); }

/* Min roll, källmarginalen (från Lagboken): paragraflänkarna i avsnittet som läses, under
   innehållsförteckningen. Syns där innehållsförteckningen syns (bredare än 1180 px). */
.src-margin { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.src-margin > strong { display: block; margin-bottom: 8px; color: var(--ink2); font-weight: 600; }
.src-group[hidden] { display: none; }
.src-sec { margin: 0 0 6px; font-size: 0.8rem; color: var(--ink2); }
.src-group ul { list-style: none; margin: 0 0 14px; padding: 0; }
.src-group a {
  display: grid;
  gap: 1px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.3;
}
.src-group li:last-child a { border-bottom: 0; }
.src-p { font-family: var(--serif); font-size: 0.95rem; }
.src-law { font-size: 0.78rem; color: var(--ink2); }
.src-group a:hover .src-p { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .src-group:not([hidden]) { animation: src-in 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
  @keyframes src-in { from { opacity: 0.4; transform: translateY(4px); } }
}
.toc .src-group ul { border-left: 0; }
.toc .src-group a { padding: 7px 0; margin: 0; border-left: 0; color: var(--ink); }
.toc .src-group a:hover { color: var(--ink); }

/* Min roll: rollstartsidan, rollmärkningen i redigeraren och märket på artikeln. */
.role-home { border-bottom: 1px solid var(--line); background: var(--surface); }
.role-home-in { max-width: 1320px; margin: 0 auto; padding: 36px 20px 40px; }
.role-home h2 { margin: 0; font: 700 clamp(1.6rem, 3vw, 2.2rem)/1.15 var(--sans); letter-spacing: -0.02em; text-wrap: balance; }
.role-home-lead { margin: 6px 0 24px; font-family: var(--serif); font-size: 1.05rem; color: var(--ink2); }
.role-groups { display: grid; gap: 16px 32px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.role-group h3 { margin: 0 0 6px; font: 700 1.05rem/1.2 var(--sans); }
.role-group h3 a { color: var(--ink); text-decoration: none; }
.role-group h3 a:hover { color: var(--brand); }
.role-group ul { list-style: none; margin: 0; padding: 0; }
.role-group li a { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; line-height: 1.35; }
.role-group li a:hover { color: var(--brand); }
.role-group .all { display: inline-block; margin-top: 6px; padding: 6px 0; font-size: 0.92rem; }
.role-new { margin-top: 28px; max-width: 760px; }
.role-new h3 { margin: 0 0 6px; font: 700 1.05rem/1.2 var(--sans); }
.role-new ol { list-style: none; margin: 0; padding: 0; }
.role-new li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.role-new time { color: var(--ink2); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.role-new a { color: var(--ink); text-decoration: none; }
.role-new a:hover { color: var(--brand); text-decoration: underline; }
.role-tag { display: inline-flex; align-items: center; margin: 4px 0 6px; padding: 3px 12px; border: 1px solid var(--brand); border-radius: 999px; color: var(--brand); font: 600 0.85rem/1.3 var(--sans); }
.ed-roles { border: 1px solid var(--line); border-radius: 10px; margin: 18px 0; padding: 12px 16px 6px; }
.ed-roles legend { font-weight: 700; padding: 0 6px; }
.ed-roles .help { margin-top: 0; }
.ed-role-list { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ed-role-list label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; cursor: pointer; }
.ed-role-list input { width: 18px; height: 18px; accent-color: var(--brand); }
@media (max-width: 600px) {
  .role-home-in { padding: 26px 20px 28px; }
  .role-new li { grid-template-columns: 1fr; gap: 2px; }
}
