/* Fnugg-portalen. One stylesheet. Fonts and images are served by the portal itself (nothing is loaded from other sites).
   Brand: Fnugg AS "Naturnaer" v1.0. The seven brand tokens below are copied unchanged from brand.css.
   Icons live in /img and are used as CSS masks, so they take the text colour. The brand symbol is
   used as a background image, so it keeps its own colours. */

/* Brand fonts, self-hosted. Variable fonts, Latin subset (covers Norwegian), upright only.
   Source: @fontsource-variable/newsreader and @fontsource-variable/work-sans 5.3.0.
   Licence: SIL Open Font License 1.1, see /fonts/newsreader-LICENSE.txt and /fonts/work-sans-LICENSE.txt. */
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Work Sans";
  src: url("../fonts/work-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand tokens (Naturnaer v1.0), same names and values as brand.css */
  --brand-primary: #4A5D49;   /* Salvieskog: headings, primary button */
  --brand-accent:  #9A6638;   /* Varm leire: thin lines and small markers only, never body text */
  --brand-ink:     #2C322A;   /* Moerk mose: text */
  --brand-muted:   #6E6B60;   /* Graastein: secondary text (4.8:1 on Lin, 5.0:1 on Raaull) */
  --brand-bg:      #F6F2EA;   /* Lin: page background */
  --brand-surface: #FBF8F2;   /* Raaull: header, panels, inputs */
  --brand-line:    #DDD3C2;   /* Toerket sand: borders and dividers */

  /* Brand type stacks. The web fonts are bundled in /fonts; the fallbacks show while they load. */
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Work Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* Derived neutrals (warm, from the brand guide or mixed from the tokens) */
  --tint: #EDE6D8;            /* sand from the brand guide: hover fill, table head, code */
  --line-strong: #8F877A;     /* input borders, 3.3:1 on Raaull */
  --primary-hover: var(--brand-ink);

  /* Status: muted, warm tones that sit next to the palette. Each also has its own icon. */
  --ok: #3A5634;              /* moss green, 6.9:1 on its fill */
  --ok-bg: #E7EDDD;
  --ok-line: #C3CFB3;
  --info: var(--brand-ink);   /* neutral: ink on sand, told apart by the info icon */
  --info-bg: #F1EBDF;
  --info-line: var(--brand-line);
  --danger: #8A3A28;          /* brick, redder and darker than Varm leire; 6.3:1 on its fill */
  --danger-bg: #F6E4DC;
  --danger-line: #E2BFB1;

  /* Network zone badge: green with a lock on VPN, honey with a globe on the internet */
  --zone-internal-bg: #E1E9D6;
  --zone-internal-ink: #2F4A2C;
  --zone-public-bg: #EFDDB4;
  --zone-public-ink: var(--brand-ink);

  --radius: 8px;
  --radius-small: 4px;
  --space: 1rem;
  --tap: 2.75rem;             /* 44 px minimum touch target */
  --page: 68rem;
  --ease: 120ms ease-out;
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--brand-ink);
  background: var(--brand-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Brand scale (26/16/13 pt on 11 pt) translated for screen: a calmer step from body to h1 */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; color: var(--brand-primary); }
h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 1.25rem; }
h2 { font-size: 1.3125rem; line-height: 1.3; margin: 0 0 0.75rem; }
h3 { font-size: 1.125rem; line-height: 1.35; margin: 0 0 0.5rem; }
p { margin: 0 0 var(--space); }
strong { font-weight: 600; }

/* Links: ink text, clay underline (clay is too weak for text on Lin) */
a {
  color: var(--brand-ink);
  text-decoration-color: var(--brand-accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em;
}
a:hover { color: var(--brand-primary); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 2px; border-radius: var(--radius-small); }

::selection { background: var(--ok-bg); color: var(--brand-ink); }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 10;
  background: var(--brand-surface); color: var(--brand-ink); padding: 0.7rem 1rem;
  border: 1px solid var(--brand-line); border-radius: var(--radius-small);
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.muted { color: var(--brand-muted); }

/* Header: a light, quiet bar. The symbol keeps its colours and the name is set in the serif. */

.site-header {
  background: var(--brand-surface); color: var(--brand-ink);
  border-bottom: 1px solid var(--brand-line);
}
.site-header__inner {
  max-width: var(--page); margin: 0 auto; padding: 0.5rem var(--space) 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.5rem;
}

.brand {
  display: inline-flex; align-items: center; gap: 0.55rem; min-height: var(--tap);
  color: var(--brand-ink); text-decoration: none;
  font-family: var(--font-serif); font-weight: 500; font-size: 1.25rem; line-height: 1.2; letter-spacing: 0.005em;
}
.brand:hover { color: var(--brand-ink); }
/* Symbol 56:62, used as-is from the brand files */
.brand__mark {
  flex: none; width: 1.9rem; height: 2.1rem;
  background: url("../img/fnugg-as-symbol.svg") center / contain no-repeat;
}

.brand, .site-user { flex: none; }

/* Main menu: its own row under the brand at every width, so it never runs out of room.
   At most six entries on the row (Hjem, Meg, Selskapet, Styret, Administrasjon, Min konto); the rest sit in
   groups that open as a small panel. The row wraps on a phone instead of scrolling, so nothing is out of sight. */
.site-nav {
  order: 3; flex: 1 0 100%; position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.1rem;
  margin: 0.4rem calc(-1 * var(--space)) 0; padding: 0 calc(var(--space) - 0.65rem);
  border-top: 1px solid var(--brand-line);
}
.site-nav__link {
  display: inline-flex; align-items: center; gap: 0.3rem; min-height: var(--tap); padding: 0 0.65rem;
  color: var(--brand-muted); text-decoration: none; white-space: nowrap;
  border-radius: var(--radius-small); position: relative;
  transition: color var(--ease), background-color var(--ease);
}
.site-nav__link:focus-visible, .site-nav__menu a:focus-visible { outline-offset: -3px; }
.site-nav__link[aria-current="page"] { color: var(--brand-ink); font-weight: 500; }
/* Current page: a thin clay line, the one accent in the header. A group gets it when one of its pages is open. */
.site-nav__link[aria-current="page"]::after,
.site-nav__group:has(a[aria-current="page"]) > .site-nav__link::after {
  content: ""; position: absolute; left: 0.65rem; right: 0.65rem; bottom: 0.4rem;
  height: 2px; background: var(--brand-accent);
}
.site-nav__group:has(a[aria-current="page"]) > .site-nav__link { color: var(--brand-ink); font-weight: 500; }
/* Min konto sits at the far right on wider screens, apart from the work menus */
.site-nav__account { margin-left: auto; }

/* Group: a details element, so it opens and closes without JavaScript */
.site-nav__group { position: relative; }
.site-nav__group > summary {
  list-style: none; cursor: pointer; user-select: none;
  margin: 0; font-weight: 400; color: var(--brand-muted); /* undo the general details > summary style */
}
.site-nav__group > summary::-webkit-details-marker { display: none; }
.site-nav__group > .site-nav__link { padding-right: 0.45rem; }
/* Chevron after the label: the sign that there is more */
.site-nav__chevron {
  flex: none; width: 1rem; height: 1rem; background-color: currentColor;
  -webkit-mask: url("../img/icon-chevron.svg") center / contain no-repeat;
  mask: url("../img/icon-chevron.svg") center / contain no-repeat;
  transition: transform var(--ease);
}
.site-nav__group[open] > .site-nav__link { margin: 0; color: var(--brand-ink); background: var(--tint); }
.site-nav__group[open] .site-nav__chevron { transform: rotate(180deg); }
/* The open group's own line would sit on the tint, so the tint is the sign instead */
.site-nav__group[open] > .site-nav__link::after { content: none; }

.site-nav__menu {
  position: absolute; z-index: 20; top: calc(100% + 0.25rem); left: 0; min-width: 15rem;
  list-style: none; margin: 0; padding: 0.35rem;
  background: var(--brand-surface); border: 1px solid var(--brand-line); border-radius: var(--radius);
  box-shadow: 0 0.5rem 1.5rem rgba(44, 50, 42, 0.12);
}
.site-nav__menu li { margin: 0; }
.site-nav__menu a {
  display: flex; align-items: center; min-height: var(--tap); padding: 0 0.75rem;
  color: var(--brand-ink); text-decoration: none; white-space: nowrap;
  border-radius: var(--radius-small);
  transition: background-color var(--ease);
}
.site-nav__menu a[aria-current="page"] {
  font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--brand-accent);
  text-decoration-thickness: 2px; text-underline-offset: 0.35em;
}

.site-user { display: flex; align-items: center; gap: 0.5rem 0.9rem; margin-left: auto; }
.site-user form { margin: 0; }
.site-user__name { font-size: 0.92rem; color: var(--brand-muted); }

/* Zone badge: tells the user whether they are on VPN. Colour, icon and word all differ. */

/* Layout */

.site-main { flex: 1; width: 100%; max-width: var(--page); margin: 0 auto; padding: 2.5rem var(--space) 4rem; }
.site-footer { border-top: 1px solid var(--brand-line); color: var(--brand-muted); font-size: 0.875rem; }
.site-footer p { max-width: var(--page); margin: 0 auto; padding: 1.25rem var(--space); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space); flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }

.panel {
  background: var(--brand-surface); border: 1px solid var(--brand-line); border-radius: 12px;
  padding: 1.25rem 1.4rem; margin: 0 0 1.25rem;
}
.panel--narrow { max-width: 34rem; }
.panel--plain { background: transparent; border-style: dashed; }
.panel--highlight { border-color: var(--brand-accent); }
.panel > :last-child { margin-bottom: 0; }

/* Centred sign-in panels (sign in, confirm, sign out, invitation): the symbol on top, one large button */
.panel--center,
.panel:has(> #passkey-form[data-passkey="invitation"]) {
  max-width: 26rem; margin: 3rem auto 2rem; padding: 2.25rem 1.75rem 2rem;
}
.panel--center { text-align: center; }
.panel--center::before,
.panel:has(> #passkey-form[data-passkey="invitation"])::before {
  content: ""; display: block; width: 2.6rem; height: 2.88rem; margin: 0 0 1.5rem;
  background: url("../img/fnugg-as-symbol.svg") center / contain no-repeat;
}
.panel--center::before { margin-left: auto; margin-right: auto; }
.panel--center h1 { font-size: 1.75rem; margin-bottom: 0.75rem; }
.panel--center > p { color: var(--brand-muted); }
.panel--center .message, .panel--center .help { text-align: left; }
.panel--center > p > a:only-child { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 0.5rem; }

/* Sign-in: the e-mail field with its button first, then the passkey button below a quiet "eller" */
.sign-in__email { text-align: left; margin-bottom: 0.75rem; }
.panel--center > form + .hint { margin-top: 0.75rem; }
.sign-in__or { display: flex; align-items: center; gap: 0.75rem; margin: 1.5rem 0; font-size: 0.9375rem; }
.sign-in__or::before, .sign-in__or::after { content: ""; flex: 1; border-top: 1px solid var(--brand-line); }

/* Home cards */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--space); margin-bottom: 1.5rem; }
.card {
  position: relative; display: block; background: var(--brand-surface); border: 1px solid var(--brand-line); border-radius: var(--radius);
  padding: 1.25rem 3rem 1.25rem 1.5rem; color: inherit; text-decoration: none;
  transition: border-color var(--ease);
}
.card::after {
  content: ""; position: absolute; right: 1.25rem; top: 1.45rem; width: 1.25rem; height: 1.25rem;
  background-color: var(--brand-muted); transition: transform var(--ease), background-color var(--ease);
  -webkit-mask: url("../img/icon-arrow.svg") center / contain no-repeat;
  mask: url("../img/icon-arrow.svg") center / contain no-repeat;
}
.card h2 { margin-bottom: 0.35rem; }
.card p { margin: 0; color: var(--brand-muted); }
.card:hover { color: inherit; border-color: var(--line-strong); }
.card:hover::after { background-color: var(--brand-accent); transform: translateX(3px); }

/* Buttons */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-weight: 500; line-height: 1.2; cursor: pointer; text-decoration: none; text-align: center;
  padding: 0.6rem 1.1rem; min-height: var(--tap); border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--brand-surface); color: var(--brand-ink);
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}
.button:hover { border-color: var(--brand-ink); color: var(--brand-ink); background: var(--tint); }
.button--primary { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-bg); }
.button--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--brand-bg); }
.button--large { width: 100%; min-height: 3.25rem; padding: 0.9rem 1.2rem; font-size: 1.0625rem; }
.button--quiet {
  background: transparent; border-color: transparent; padding: 0.4rem 0.6rem; font-weight: 400;
  text-decoration: underline; text-decoration-color: var(--brand-accent); text-underline-offset: 0.2em;
}
.button--quiet:hover { background: var(--tint); border-color: transparent; }
.button--danger { color: var(--danger); border-color: var(--danger-line); }
.button--danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.button--quiet.button--danger { border-color: transparent; text-decoration-color: currentColor; }
.button:disabled, .button:disabled:hover {
  opacity: 0.45; cursor: not-allowed; background: var(--brand-surface); border-color: var(--line-strong); color: var(--brand-ink);
}
.button--primary:disabled, .button--primary:disabled:hover { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-bg); }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: var(--space); }
.actions form { margin: 0; }

/* Forms */

.form { display: grid; gap: 1.25rem; }
.form--inline { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: end; gap: var(--space); margin-top: 1.25rem; }
.form--inline:first-child { margin-top: 0; }
.form__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.form__actions a { display: inline-flex; align-items: center; min-height: var(--tap); }
.form > .button { justify-self: start; }

.field { display: grid; gap: 0.35rem; }
.field--check { grid-template-columns: auto 1fr; align-items: center; gap: 0.7rem; min-height: var(--tap); }
.field--check input { width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--brand-primary); }
label { font-weight: 500; }
.field--check label { font-weight: 400; cursor: pointer; }
.hint { margin: 0; font-size: 0.875rem; color: var(--brand-muted); }

.input {
  font: inherit; width: 100%; min-height: var(--tap); padding: 0.55rem 0.75rem;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--brand-surface); color: var(--brand-ink);
}
.input:hover { border-color: var(--brand-muted); }
.input:focus-visible { border-color: var(--brand-primary); outline-offset: 1px; }
.input::placeholder { color: var(--brand-muted); }
select.input {
  -webkit-appearance: none; appearance: none; padding-right: 2.5rem; cursor: pointer;
  background: var(--brand-surface) url("../img/icon-chevron.svg") right 0.7rem center / 1.1rem no-repeat;
}
.input[type="file"] { padding: 0.35rem; cursor: pointer; }
.input[type="file"]::file-selector-button {
  font: inherit; font-weight: 500; margin-right: 0.75rem; padding: 0.45rem 0.9rem; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--tint); color: var(--brand-ink);
}
.input--code {
  font-family: var(--font-mono); font-size: 1.5rem; letter-spacing: 0.18em; text-align: center; text-transform: uppercase;
  min-height: 3.5rem;
}
.input--code::placeholder { letter-spacing: 0.18em; color: var(--brand-muted); }

#passkey-form { display: grid; gap: 0.75rem; margin: 1.5rem 0; text-align: left; }
#passkey-form[data-passkey="add"] { display: block; margin-bottom: 0; }

/* Messages: a soft fill, one thin border and an icon; no loud colour */

.message {
  position: relative; margin: 0 0 1.25rem; padding: 0.8rem 1rem 0.8rem 2.75rem;
  border: 1px solid transparent; border-radius: 6px; font-size: 0.95rem; line-height: 1.5;
}
.message::before {
  content: ""; position: absolute; left: 0.9rem; top: 0.95rem; width: 1.2rem; height: 1.2rem;
  background-color: currentColor;
  -webkit-mask: url("../img/icon-info.svg") center / contain no-repeat;
  mask: url("../img/icon-info.svg") center / contain no-repeat;
}
.message--ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.message--ok::before { -webkit-mask-image: url("../img/icon-ok.svg"); mask-image: url("../img/icon-ok.svg"); }
.message--info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.message--info::before { background-color: var(--brand-primary); }
.message--error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.message--error::before { -webkit-mask-image: url("../img/icon-error.svg"); mask-image: url("../img/icon-error.svg"); }
#passkey-form + .message { margin-top: -0.5rem; }

/* Help disclosure on sign-in */

.help { margin-top: 1.5rem; padding-top: 0.5rem; border-top: 1px solid var(--brand-line); font-size: 0.95rem; }
.help summary {
  display: flex; align-items: center; gap: 0.5rem; min-height: var(--tap);
  cursor: pointer; font-weight: 500; list-style: none;
}
.help summary::-webkit-details-marker { display: none; }
.help summary::before {
  content: ""; flex: none; width: 1rem; height: 1rem; background-color: var(--brand-muted);
  transform: rotate(-90deg); transition: transform var(--ease);
  -webkit-mask: url("../img/icon-chevron.svg") center / contain no-repeat;
  mask: url("../img/icon-chevron.svg") center / contain no-repeat;
}
.help[open] summary::before { transform: none; }
.help p { color: var(--brand-muted); }

/* Numbered steps (invitation): serif numerals in sage */

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 1.5rem; }
.steps li {
  counter-increment: step; position: relative; padding: 0.55rem 0 0.55rem 2.25rem;
  border-bottom: 1px solid var(--brand-line);
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.45rem;
  font-family: var(--font-serif); font-size: 1.125rem; font-weight: 500; color: var(--brand-primary);
  font-variant-numeric: tabular-nums;
}

/* Lists */

.list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.list__row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem var(--space); flex-wrap: wrap;
  padding: 0.85rem 0; border-bottom: 1px solid var(--brand-line); min-height: 3.25rem;
}
.list__row:first-child { padding-top: 0.25rem; }
.list__row:last-child { border-bottom: 0; }
.list__row form { margin: 0; }
.list__row .muted { display: block; font-size: 0.9rem; }

.tag {
  display: inline-block; vertical-align: 0.1em; font-size: 0.78rem; font-weight: 500; line-height: 1.4;
  padding: 0.1rem 0.45rem; border-radius: var(--radius-small); background: var(--tint); color: var(--brand-ink); white-space: nowrap;
}
.tag + .tag { margin-left: 0.25rem; }
.tag--strong { background: var(--brand-primary); color: var(--brand-bg); }
.tag--danger { background: var(--danger-bg); color: var(--danger); }

/* Tables: thin lines, no zebra rows */

.table-wrap { overflow-x: auto; margin: 0 -0.25rem; padding: 0 0.25rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 0.7rem 0.75rem 0.7rem 0; border-bottom: 1px solid var(--brand-line); vertical-align: top; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table th { font-size: 0.875rem; font-weight: 500; color: var(--brand-muted); white-space: nowrap; border-bottom-color: var(--line-strong); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td a { font-weight: 500; }
.table--dense { font-size: 0.875rem; }
.table--dense td { padding-top: 0.45rem; padding-bottom: 0.45rem; }
.table--dense td .muted { display: block; }
.table__actions { text-align: right; white-space: nowrap; }
.table__actions form { margin: 0; }
.table__actions .button--quiet { min-height: 2rem; margin: -0.35rem 0; }

/* Denied actions in the audit log: an icon and brick text in the first cell, not a coloured row */
.table__row--warn td:first-child { color: var(--danger); font-weight: 600; }
.table__row--warn td:first-child::before {
  content: ""; display: inline-block; vertical-align: -0.15em; width: 1em; height: 1em; margin-right: 0.35rem;
  background-color: currentColor;
  -webkit-mask: url("../img/icon-error.svg") center / contain no-repeat;
  mask: url("../img/icon-error.svg") center / contain no-repeat;
}

/* Facts (invitation ready) */

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 1.25rem; margin: 0; }
.facts dt { font-weight: 500; }
.facts dd { margin: 0; min-width: 0; }
.secret {
  font-family: var(--font-mono); font-size: 0.9rem; word-break: break-all; user-select: all;
  background: var(--tint); padding: 0.2rem 0.4rem; border-radius: var(--radius-small);
}
.secret--code { font-size: 1.35rem; letter-spacing: 0.14em; }

.pager { display: flex; gap: 0.6rem; margin-top: 1.25rem; }

/* Hover only where there is a real pointer */
/* Text typed by a user: keep their line breaks */
.prose { white-space: pre-line; overflow-wrap: anywhere; max-width: 68ch; }
textarea.input { resize: vertical; line-height: 1.5; }

/* Checklists: one row per item, the tick is the brand green */
.checklist__item { display: grid; grid-template-columns: auto 1fr auto; gap: 0.25rem 0.7rem; align-items: center; }
.checklist__state {
  display: grid; place-items: center; width: 1.4rem; height: 1.4rem;
  border: 1px solid var(--line-strong); border-radius: 50%; font-size: 0.85rem;
}
.checklist__item form { margin: 0; }
@media (max-width: 40rem) {
  /* On a phone the button goes under the text, so the text keeps the full width */
  .checklist__item { grid-template-columns: auto 1fr; }
  .checklist__item form { grid-column: 2; }
}
.checklist__item--done .checklist__state { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-surface); }
details.panel > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
details.panel[open] > summary { margin-bottom: 0.75rem; }
details > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; color: var(--brand-primary); font-weight: 500; }
details[open] > summary { margin-bottom: 0.75rem; }

/* Agenda: one block per item, a thin line between them */
.agenda-item { padding: 1rem 0; border-top: 1px solid var(--brand-line); }
.agenda-item:first-of-type { border-top: 0; padding-top: 0; }
.agenda-item h3 { margin-bottom: 0.25rem; }
.agenda-item h4 { margin: 0.75rem 0 0.25rem; font-size: 0.95rem; }

@media (hover: none) {
  .card:hover { border-color: var(--brand-line); }
  .card:hover::after { background-color: var(--brand-muted); transform: none; }
  .button:hover { background: var(--brand-surface); border-color: var(--line-strong); }
  .button--primary:hover { background: var(--brand-primary); border-color: var(--brand-primary); }
  .button--quiet:hover { background: transparent; border-color: transparent; }
}

/* Desktop header: nav hover */
@media (hover: hover) {
  .site-nav__link:hover, .site-nav__menu a:hover { color: var(--brand-ink); background: var(--tint); }
}

/* Organisation chart: a plain nested list with thin connecting lines */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 0.6rem; padding-left: 1rem; border-left: 1px solid var(--brand-line); }
.tree li { padding: 0.3rem 0; }
.tree li > a { display: inline-block; padding: 0.35rem 0; font-weight: 500; }
.tree li > .muted { margin-left: 0.5rem; font-size: 0.9rem; }

/* Tablet and phone: a little tighter on top */
@media (max-width: 62rem) {
  .site-header__inner { padding-top: 0.25rem; gap: 0 0.75rem; }
}

/* Phone */
@media (max-width: 40rem) {
  h1 { font-size: 1.625rem; }
  h2 { font-size: 1.1875rem; }
  /* Keep symbol, name, zone badge and sign-out on one line down to 360 px wide. */
  .site-header__inner { padding-left: 0.75rem; padding-right: 0.75rem; gap: 0 0.5rem; }
  .brand { font-size: 1.0625rem; gap: 0.4rem; }
  .brand__mark { width: 1.5rem; height: 1.66rem; }
  .site-user { gap: 0.25rem 0.35rem; }
  .site-user__name { display: none; }
  .zone { font-size: 0.75rem; gap: 0.3rem; padding: 0.35rem 0.45rem; }
  .zone::before { width: 0.85rem; height: 0.85rem; }
  .site-header .button--quiet { padding: 0.4rem 0.2rem; }
  .site-nav { margin: 0.25rem -0.75rem 0; padding: 0 0.1rem; }
  .site-nav__link { padding: 0 0.6rem; }
  .site-nav__group > .site-nav__link { padding-right: 0.4rem; }
  /* Min konto follows the others when the row wraps */
  .site-nav__account { margin-left: 0; }
  /* The open panel spans the screen under the menu, so it never runs off the right edge */
  .site-nav__group { position: static; }
  .site-nav__menu { left: 0.75rem; right: 0.75rem; top: calc(100% + 0.25rem); min-width: 0; }
  .site-nav__menu a { white-space: normal; }

  .site-main { padding: 1.5rem 0.75rem 2.5rem; }
  .panel { padding: 1.25rem 1rem; }
  .panel--center,
  .panel:has(> #passkey-form[data-passkey="invitation"]) { margin-top: 1rem; padding: 1.75rem 1.25rem; }
  .panel--center h1 { font-size: 1.5rem; }
  .cards { grid-template-columns: 1fr; gap: 0.75rem; }

  .form--inline { grid-template-columns: 1fr; }
  .form--inline > .button, .form > .button, .form__actions .button { width: 100%; }
  .form__actions { flex-direction: column; align-items: stretch; }
  .form__actions a { justify-content: center; }
  .page-head .button { flex: none; }

  .facts { grid-template-columns: 1fr; gap: 0.15rem; }
  .facts dd + dt { margin-top: 0.6rem; }

  /* Tables marked .table--stack become one block per row. Each td needs data-label="Column". */
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; }
  .table--stack tr { padding: 0.75rem 0; border-bottom: 1px solid var(--brand-line); }
  .table--stack tbody tr:first-child { padding-top: 0; }
  .table--stack tbody tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .table--stack td { border: 0; padding: 0.1rem 0; }
  .table--stack td[data-label]::before {
    content: attr(data-label); display: inline-block; min-width: 6.5rem; padding-right: 0.5rem;
    color: var(--brand-muted); font-size: 0.875rem;
  }
  .table--stack td:first-child { font-size: 1.0625rem; padding-bottom: 0.25rem; }
  .table--stack td:first-child::before { display: none; }
  .table--stack td:empty { display: none; }
  .table--stack .table__actions { text-align: left; padding-top: 0.25rem; }
  .table--stack .table__actions .button--quiet { min-height: var(--tap); margin: 0 0 0 -0.6rem; }
}

/* Sub-navigation inside one company or one profile: tabs that are links. Scrolls sideways on a phone. */
.subnav { display: flex; gap: 0.25rem; overflow-x: auto; margin: 0 0 1.25rem; border-bottom: 1px solid var(--brand-line); }
.subnav a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 0.9rem; margin-bottom: -1px;
  color: var(--brand-muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent;
}
.subnav a:hover { color: var(--brand-ink); }
.subnav a[aria-current="page"] { color: var(--brand-ink); font-weight: 500; border-bottom-color: var(--brand-accent); }

.tag--ok { background: var(--ok-bg); color: var(--ok); }

/* Key figures: a grid of a label over a number */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem 1.5rem; margin: 0 0 1.25rem; }
.stats > div { border-top: 1px solid var(--brand-line); padding-top: 0.6rem; }
.stats dt { font-size: 0.875rem; color: var(--brand-muted); }
.stats dd { margin: 0.1rem 0 0; font-family: var(--font-serif); font-size: 1.5rem; color: var(--brand-primary); }

/* The top of a profile: a round mark with initials, the name, and what the person is */
.profile-head { display: flex; align-items: flex-start; gap: var(--space); flex-wrap: wrap; margin-bottom: 1.25rem; }
.profile-head__text { flex: 1 1 14rem; min-width: 0; }
.profile-head h1 { margin: 0 0 0.15rem; }
.profile-head p { margin: 0 0 0.35rem; }
.avatar {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 4rem; height: 4rem; border-radius: 50%;
  background: var(--tint); color: var(--brand-primary); font-family: var(--font-serif); font-size: 1.5rem; font-weight: 500; letter-spacing: 0.02em;
}

fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field > legend { padding: 0; font-weight: 500; margin-bottom: 0.35rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .button, .pager { display: none; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; }
}
