/* meetings: the app's own styles. Loaded AFTER design/tokens.css and design/komponenter.css.
   Tokens only: hex colours exist only in the :root blocks at the top (enforced by tests/core/test_reuse_conventions.py).
   SHARED FILE: each track writes under its own heading  / * --- track X: ... --- * /  at the bottom.
   Ported from _design/mote.css, veiledning.css, instans.css and logo-anim.css. */

:root {
  --color-brand: #0f766e;
  /* The Figure (logo) */
  --fig-page: #0f766e;
  --fig-face: #ffffff;
  --fig-accent: #f5b83d;
  --ring: #0b4b46;
  --extra: #0b4b46;
  /* Organization tiles (white text, contrast >= 4.5:1) */
  --org-tile-text: #ffffff;
  --org-0: #0f766e;
  --org-1: #1d4ed8;
  --org-2: #15803d;
  --org-3: #7e22ce;
  --org-4: #b45309;
  --org-5: #be123c;
  /* People (app/avatars): one colour per person, the organization tiles' six + two; white initials >= 4.5:1 */
  --person-text: #ffffff;
  --person-0: var(--org-0);
  --person-1: var(--org-1);
  --person-2: var(--org-2);
  --person-3: var(--org-3);
  --person-4: var(--org-4);
  --person-5: var(--org-5);
  --person-6: #4d7c0f;
  --person-7: #a21caf;
  /* Admin mode */
  --admin-text-strong: #ffffff;
  --admin-count-text: #111111;
}
:root[data-theme="dark"] { --extra: #c9e9e4; }

/* --- R: basics --- */

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--space-2); top: calc(var(--space-12) * -1); z-index: var(--z-modal); background: var(--color-bg-raised); color: var(--color-text); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.skip-link:focus { top: var(--space-2); }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: var(--radius-md); background: none; color: var(--color-text-secondary); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.icon-btn:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
.icon-btn .icon { width: 18px; height: 18px; }
.btn-link { border: 0; background: none; padding: 0; font: inherit; color: var(--color-text-secondary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--color-border-strong); }
.btn-link:hover { color: var(--color-text); }
.btn-link:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px; border-radius: var(--radius-sm); }

/* Button order across the app: primary action far right, cancel/delete/back far left. */
.dialog-foot [data-close], .dialog-foot .btn-cancel, .dialog-foot .btn-danger { margin-right: auto; }

/* Small popup menus (organization switcher, + menu, suggestions) */
.pop { position: absolute; z-index: var(--z-dropdown); min-width: 220px; background: var(--color-bg-raised); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: var(--space-1); }
.pop button, .pop .opt { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-3); row-gap: 2px; width: 100%; text-align: left; padding: var(--space-2) var(--space-3); border: 0; background: none; color: var(--color-text); font: inherit; border-radius: var(--radius-sm); cursor: pointer; }
.pop button:hover, .pop .opt:hover, .pop button[aria-selected="true"] { background: var(--color-bg-subtle); text-decoration: none; }
.pop .k { margin-left: auto; color: var(--color-text-muted); font-size: var(--text-xs); }
.pop .k .icon { width: 14px; height: 14px; }
.pop .hd { padding: var(--space-2) var(--space-3) var(--space-1); font-size: var(--text-xs); color: var(--color-text-muted); }
.pop hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-1) 0; }
.pop .d { display: block; font-size: var(--text-xs); color: var(--color-text-secondary); }
/* THE option layout (guidelines §2 item 6; markup from components/option.html / frontend/lib/option.js):
   [check column] icon|avatar|tile, label on the first line; the description wraps to its own line, starting under
   the label. Only the label grows: never side-by-side 50/50 columns. Single choice: a reserved check column first. */
.pop :is(button, .opt, [role="option"]) > .lbl { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.pop :is(button, .opt, [role="option"]) > .d { flex: 0 0 100%; min-width: 0; overflow-wrap: anywhere; }
.pop :is(button, .opt, [role="option"]) > span:not([class]) { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.pop :is(.opt, [role="option"]) > :is(.av, .org-tile, .icon, .ck, .k) { flex: none; }
.pop .ck { width: 16px; height: 16px; display: grid; place-items: center; color: var(--color-primary); }
.pop .ck .icon { width: 16px; height: 16px; color: inherit; visibility: hidden; }
.pop :is([aria-checked="true"], [aria-current="true"]) > .ck .icon { visibility: visible; }
/* The description starts under the label, not under the icon: indent it by the leading column(s) (check, icon,
   avatar or tile) plus the gap. */
.pop :is(button, .opt, [role="option"]) > .icon { width: 16px; height: 16px; }
.pop :is(button, .opt, [role="option"]):has(> .ck) { --lead-ck: calc(16px + var(--space-3)); }
.pop :is(button, .opt, [role="option"]):has(> .icon) { --lead-x: calc(16px + var(--space-3)); }
.pop :is(button, .opt, [role="option"]):has(> .av) { --lead-x: calc(24px + var(--space-3)); }
.pop :is(button, .opt, [role="option"]):has(> .org-tile) { --lead-x: calc(28px + var(--space-3)); }
.pop :is(button, .opt, [role="option"]) > .d { padding-left: calc(var(--lead-ck, 0px) + var(--lead-x, 0px)); }

/* Menus: an icon before each item, separators between groups */
.kebab-item .icon, .pop .opt > .icon, .pop button > .icon, .menu-item .icon { width: 16px; height: 16px; flex: none; color: var(--color-text-muted); }
.kebab-sep, .menu .kebab-sep { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-1) calc(var(--space-1) * -1); }
.menu form { margin: 0; }
.theme-choice .icon { color: currentColor; }

/* --- R: sidebar --- */

.side { width: 264px; flex-shrink: 0; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--color-bg-raised); border-right: 1px solid var(--color-border); overflow-y: auto; font-size: var(--text-sm); }
[data-side="closed"] .side { display: none; }
.side-open { display: none; }
[data-side="closed"] .side-open { display: grid; }
.side-head { position: relative; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-3) var(--space-2) var(--space-4); }
.side-nav { display: flex; flex-direction: column; padding: 0 var(--space-2); gap: 1px; }
.side-link { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2); border-radius: var(--radius-md); color: var(--color-text-secondary); }
.side-link:hover { background: var(--color-bg-subtle); color: var(--color-text); text-decoration: none; }
.side-link[aria-current="page"] { background: var(--color-primary-subtle); color: var(--color-text); font-weight: var(--weight-medium); }
.side-link .icon { width: 18px; height: 18px; }
.side-n { margin-left: auto; font-size: var(--text-xs); color: var(--color-text-muted); }
.side-sec { padding: var(--space-4) var(--space-2) 0; position: relative; }
.side-h { display: flex; align-items: center; padding: 0 var(--space-2) var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.side-add { margin-left: auto; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: none; color: var(--color-text-muted); cursor: pointer; }
.side-add .icon { width: 14px; height: 14px; }
.side-add:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.side-add:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
/* Quiet «+» (e.g. «Nytt møte» next to «Kommende»): shown on hover/focus of its section, always on touch screens. */
.side-add.is-quiet { opacity: 0; transition: opacity var(--transition-fast); }
.side-sec:hover .side-add.is-quiet, .side-sec:focus-within .side-add.is-quiet { opacity: 1; }
@media (hover: none) { .side-add.is-quiet { opacity: 1; } }
.side-menu { right: var(--space-2); top: var(--space-8); }

.live { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--color-success); flex-shrink: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 25%, transparent); }
.nodot { width: 8px; flex-shrink: 0; }
/* A meeting's state before its title (shell/macros.html _dot): one circle, the colour says the state. */
.mdot { width: 8px; height: 8px; border-radius: var(--radius-full); flex-shrink: 0; box-sizing: border-box; }
.mdot[data-state="draft"] { border: 1.5px dashed var(--color-text-muted); }
.mdot[data-state="planned"] { border: 1.5px solid var(--color-primary); }
.mdot[data-state="in_progress"] { background: var(--color-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 25%, transparent); }
.mdot[data-state="ended"] { background: var(--color-warning); }
.mdot:is([data-state="minutes_sent"], [data-state="locked"], [data-state="historical"]) { background: var(--color-text-muted); }
.side-recent { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2); border-radius: var(--radius-md); color: var(--color-text); min-width: 0; }
.side-recent:hover { background: var(--color-bg-subtle); text-decoration: none; }
.side-recent[aria-current="page"] { background: var(--color-primary-subtle); }
.side-recent .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-recent .d { font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.side-recent .side-lock { flex: none; }

.side-folder { border-radius: var(--radius-md); }
.side-folder.drop { background: var(--color-primary-subtle); outline: 1px dashed var(--color-primary); }
.side-fh { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-1) var(--space-2); border: 0; background: none; font: inherit; color: var(--color-text-secondary); cursor: pointer; border-radius: var(--radius-md); text-align: left; }
.side-fh:hover { background: var(--color-bg-subtle); }
.side-fh .icon { width: 16px; height: 16px; color: var(--color-text-muted); }
.side-fh .tw, .side-tw .icon { width: 12px; height: 12px; transition: transform var(--transition-fast); }
.side-fh[aria-expanded="true"] .tw, .side-tw[aria-expanded="true"] .icon { transform: rotate(90deg); }
.side-fh[aria-expanded="false"] + .side-list { display: none; }
.side-list { list-style: none; margin: 0 0 var(--space-1); padding: 0 0 0 var(--space-4); }
.side-folder[data-folder=""] .side-list { padding-left: 0; }
.side-empty { padding: var(--space-1) var(--space-6); color: var(--color-text-muted); font-size: var(--text-xs); }
.side-series.dragging { opacity: 0.4; }
.side-row { display: flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2) 2px 0; border-radius: var(--radius-md); }
.side-row:hover { background: var(--color-bg-subtle); }
.side-row.is-here { background: var(--color-primary-subtle); }
.side-row a { flex: 1; min-width: 0; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: var(--space-1) 0; }
.side-row a:hover { text-decoration: none; }
.side-row a[aria-current="page"] { font-weight: var(--weight-medium); }
.side-tw { width: 22px; height: 22px; display: grid; place-items: center; border: 0; background: none; color: var(--color-text-muted); cursor: pointer; border-radius: var(--radius-sm); flex-shrink: 0; }
.side-rec .icon { width: 13px; height: 13px; color: var(--color-text-muted); }
.side-ms { display: flex; flex-direction: column; padding: 0 0 var(--space-1) var(--space-6); }
.side-ms[hidden] { display: none; }
.side-loose { padding-left: var(--space-5); }
.side-m { display: flex; align-items: center; gap: var(--space-2); padding: 3px var(--space-2); border-radius: var(--radius-sm); color: var(--color-text-secondary); font-variant-numeric: tabular-nums; min-width: 0; }
.side-m > span:not(.mdot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-m:hover { background: var(--color-bg-subtle); color: var(--color-text); text-decoration: none; }
.side-m[aria-current="page"] { background: var(--color-primary-subtle); color: var(--color-text); font-weight: var(--weight-medium); }
.side-older { color: var(--color-text-muted); font-size: var(--text-xs); }
.side-tag { font-size: var(--text-xs); color: var(--color-text-muted); border: 1px solid var(--color-border); border-radius: var(--radius-full); padding: 0 var(--space-1); }
.side-lock { width: 12px; height: 12px; color: var(--color-text-muted); }
.side-tip { margin: var(--space-3) var(--space-2) var(--space-4); font-size: var(--text-xs); color: var(--color-text-muted); }
.side-foot { margin-top: auto; padding: var(--space-2); border-top: 1px solid var(--color-border); }
/* «Mer» in the sidebar: the occasional pages (Vedtak, Arkiv, Årshjul) behind one quiet row; a <details>, so it
   works without JS (shell.js remembers it). The summary is a side-link with a chevron at the end. */
.side-more > summary { list-style: none; cursor: pointer; }
.side-more > summary::-webkit-details-marker { display: none; }
.side-more > summary .side-more-chev { margin-left: auto; width: 12px; height: 12px; color: var(--color-text-muted); transition: transform var(--transition-fast); }
.side-more[open] > summary .side-more-chev { transform: rotate(90deg); }
.side-more > summary:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px; }
.side-more-list { display: flex; flex-direction: column; gap: 1px; padding-left: var(--space-4); }
.side-all { margin-top: var(--space-1); }

/* Switch organization (top of the sidebar, R-4) */
.org-tile { width: 28px; height: 28px; flex: none; border-radius: var(--radius-md); display: grid; place-items: center; font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--org-tile-text); background: var(--org-0); }
.org-tile[data-c="1"] { background: var(--org-1); }
.org-tile[data-c="2"] { background: var(--org-2); }
.org-tile[data-c="3"] { background: var(--org-3); }
.org-tile[data-c="4"] { background: var(--org-4); }
.org-tile[data-c="5"] { background: var(--org-5); }
.org-tile.add { background: var(--color-bg-subtle); color: var(--color-text-secondary); font-size: var(--text-base); }
.org-menu { left: var(--space-3); right: var(--space-3); top: calc(100% - var(--space-1)); }

@media (max-width: 720px) {
  .side { display: none; position: fixed; inset: 0 auto 0 0; z-index: var(--z-modal); box-shadow: var(--shadow-lg); }
  [data-side-mobile] .side { display: flex; }
  .side-open { display: grid; }
}

/* --- R: admin mode (dark menu, badge in the topbar) --- */

.admin .side { background: var(--console-bg); border-right-color: var(--console-border); color: var(--console-text); }
.admin .side-head { padding: var(--space-3) var(--space-3) var(--space-2) var(--space-4); }
/* Logo row (R, item L): small still Figuren + product name; the org switcher is its own row below. */
.side-brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2); color: var(--color-text); font-weight: var(--weight-bold); font-size: var(--text-base); text-decoration: none; }
.side-brand:hover { text-decoration: none; }
.side-brand .brand-fig { width: 28px; height: 28px; flex: none; overflow: visible; }
.admin .side-brand { color: var(--admin-text-strong); }
.side-orgrow { position: relative; padding: 0 var(--space-3) var(--space-2) var(--space-4); }
.admin .side-h { color: var(--console-text-muted); }
.admin .side .side-link { color: var(--console-text); }
.admin .side .side-link .icon { color: var(--console-text-muted); }
.admin .side .side-link:hover { background: var(--console-bg-interactive); color: var(--admin-text-strong); }
.admin .side .side-link[aria-current] { background: var(--console-bg-interactive); color: var(--admin-text-strong); font-weight: var(--weight-medium); }
.admin .side .side-link[aria-current] .icon { color: var(--color-warning); }
.admin .side-foot { border-top-color: var(--console-border); }
.admin-n { background: var(--color-warning); color: var(--admin-count-text); border-radius: var(--radius-full); padding: 0 6px; font-weight: var(--weight-bold); }
.admin-badge { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-3); border-radius: var(--radius-full); background: var(--color-warning-subtle); color: var(--color-text); font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.admin-badge .icon { width: 14px; height: 14px; color: var(--color-warning); }
.admin-scope { display: flex; align-items: center; gap: var(--space-3); padding-bottom: var(--space-4); scroll-margin-top: var(--space-6); }
.admin-scope > .txt { flex: 1; min-width: 0; }
.admin-scope.inst { margin-top: var(--space-12); }
.admin-scope h1 { font-size: var(--text-2xl); margin: 0; }
.admin-scope p { margin: 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
.admin-scope .org-tile, .admin-scope .ic { width: 40px; height: 40px; font-size: var(--text-sm); }
.admin-scope .ic { display: grid; place-items: center; border-radius: var(--radius-md); background: var(--console-bg); color: var(--color-warning); flex: none; }
.admin-scope .ic .icon { width: 20px; height: 20px; }
/* A search above a long admin list (organizations, users): field + button on one line. */
.list-search { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.list-search .input { flex: 1 1 16rem; max-width: none; }
/* components/pager.html: range on the left, Forrige / Neste on the right, under a list */
.pager { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.pager .spacer { flex: 1; }
.set-group-head .list-search { flex: 1; margin: 0; }
/* right under tabs the tab line is the list's top edge: no second line */
.tabs + .set-sec > .set-list { border-top: 0; }
.is-danger-text { color: var(--color-danger); }
.set-row .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- R: settings pages (from instans.css) --- */

.set { width: 100%; max-width: 820px; margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-12); }
@media (max-width: 720px) { .set { padding: var(--space-6) var(--space-4) var(--space-10); } }
.set-sec { margin-top: var(--space-8); }
.content .set-sec:first-child { margin-top: 0; }
.set-sec > h2 { font-size: var(--text-lg); margin: 0 0 var(--space-1); }
.set-sec > p { margin: 0 0 var(--space-3); color: var(--color-text-secondary); font-size: var(--text-sm); }
.set-list { border-top: 1px solid var(--color-border); }
.set-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.set-row .ic { width: 32px; height: 32px; flex: none; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--color-bg-subtle); color: var(--color-text-secondary); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.set-row .txt { flex: 1; min-width: 0; }
.set-row .t { font-weight: var(--weight-medium); }
.set-row .s { font-size: var(--text-xs); color: var(--color-text-secondary); }

/* --- R: welcome, empty states and sign-in (from veiledning.css) --- */

.fig-slot .mk { display: block; width: 100%; height: auto; overflow: visible; }
.welcome { max-width: 520px; margin: var(--space-12) auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.welcome[hidden] { display: none; }
.welcome .fig-slot { width: 136px; cursor: pointer; }
.welcome h1 { font-size: var(--text-3xl); letter-spacing: -0.02em; margin: 0; }
.welcome p { margin: 0; color: var(--color-text-secondary); line-height: var(--leading-normal); }
.welcome-actions { display: flex; flex-direction: column; gap: var(--space-2); width: min(340px, 100%); margin-top: var(--space-2); }
.welcome-actions .btn { justify-content: center; }
.welcome-quiet { display: flex; gap: var(--space-4); justify-content: center; flex-wrap: wrap; font-size: var(--text-sm); }

.empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; padding: var(--space-8) var(--space-4); }
.empty .fig-slot { width: 84px; margin-bottom: var(--space-2); }
.empty b { font-size: var(--text-base); }
.empty p { margin: 0; color: var(--color-text-secondary); font-size: var(--text-sm); max-width: 40ch; }
.empty .btn { margin-top: var(--space-2); }

.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-6) var(--space-4); background: var(--color-bg); }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; padding: var(--space-8) var(--space-6); background: var(--color-bg-raised); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.login-card .fig-slot { width: 96px; }
.login-card h1 { font-size: var(--text-2xl); margin: 0; }
.login-card p { margin: 0; }
.login-actions { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; margin-top: var(--space-2); }
.login-actions .btn { justify-content: center; }

/* --- R: the Figure (from logo-anim.css). Each animation is a class (a-...); "on" plays once. --- */

.fg .page { fill: var(--fig-page); }
.fg .eye, .fg .o { fill: var(--fig-face); }
.fg .mouth { stroke: var(--fig-face); }
.fg .ring { fill: var(--ring); }
.fg .zzz, .fg .think { fill: var(--extra); }
.fg .sparks, .fg .bang { fill: var(--fig-accent); }
.fg .fig { transform-box: view-box; transform-origin: 32px 57px; }
.fg .eyes { transition: transform 0.15s ease-out; }
.fg.following .eyes { animation: none; } /* follow.js steers the eyes (data-follow) */
.fg .eye, .fg .ring, .fg .spark, .fg .bang, .fg .zzz text, .fg .think circle, .fg .o, .fg .mouth { transform-box: fill-box; transform-origin: center; }
.fg .ring { transform-origin: 50% 100%; }
.fg .zzz text, .fg .think circle, .fg .spark, .fg .bang, .fg .o { opacity: 0; }
.fg .eye { animation: fg-blink 4.2s infinite; }
.a-idle .fig { animation: fg-breathe 4s ease-in-out infinite; }
.a-idle .eyes { animation: fg-look 7s ease-in-out infinite; }
.a-joy.on .fig { animation: fg-joy 1s ease-out; }
.a-joy.on .eye { animation: fg-happy 1s; }
.a-joy.on .spark { animation: fg-sparkle 0.9s ease-out 0.3s backwards; }
.a-joy.on .spark:nth-child(2n) { animation-delay: 0.42s; }
.a-think .think circle { animation: fg-think 2.4s ease-in-out infinite; }
.a-think .think circle:nth-child(2) { animation-delay: 0.3s; }
.a-think .think circle:nth-child(3) { animation-delay: 0.6s; }
.a-think .eyes { transform: translate(2px, -2px); }
@keyframes fg-blink { 0%, 91%, 100% { transform: scaleY(1); } 94% { transform: scaleY(0.1); } }
@keyframes fg-look { 0%, 30%, 100% { transform: translateX(0); } 40%, 55% { transform: translateX(-3px); } 65%, 80% { transform: translateX(3px); } }
@keyframes fg-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, 0.985); } }
@keyframes fg-happy { 0%, 100% { transform: scaleY(1); } 10%, 85% { transform: scaleY(0.35) translateY(5px); } }
@keyframes fg-joy { 0%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.12, 0.86); } 40% { transform: translateY(-18px) scale(0.92, 1.1); } 55% { transform: translateY(-20px) scale(1, 1); } 75% { transform: translateY(0) scale(1.1, 0.9); } 88% { transform: translateY(0) scale(0.97, 1.03); } }
@keyframes fg-sparkle { 0% { opacity: 0; transform: scale(0) rotate(0); } 40% { opacity: 1; transform: scale(1.3) rotate(45deg); } 100% { opacity: 0; transform: scale(0.5) rotate(90deg); } }
@keyframes fg-think { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .fg *, .fg { animation: none !important; transition: none !important; }
}

/* --- components (track R2): templates/components/*.html + frontend/components/*.js. Catalogue: /dev/components --- */

:root { --seat: #0b4b46; --toast-bg: #1f2937; --toast-text: #ffffff; --toast-muted: #d1d5db; }
:root[data-theme="dark"] { --seat: #6cc3b7; --toast-bg: #f3f4f6; --toast-text: #111111; --toast-muted: #374151; }

/* Field: label + input + hint + error (wraps fikt .field) */
.field-error { display: flex; gap: var(--space-1); align-items: flex-start; margin: 0; color: var(--color-danger); font-size: var(--text-xs); line-height: 1.5; }
.field-error .icon { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.field .req { color: var(--color-text-muted); font-weight: var(--weight-normal); }
.field [aria-invalid="true"] { border-color: var(--color-danger); }
.err-card .err-fields { margin: 0; padding-left: var(--space-5); text-align: left; color: var(--color-text-secondary); }
.err-ref { font-size: var(--text-xs); color: var(--color-text-muted); font-variant-numeric: tabular-nums; margin: 0; }

/* Badge: count or dot on an icon/link (notifications) */
.nbadge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-full); background: var(--color-primary); color: var(--color-text-on-primary); font-size: var(--text-xs); font-weight: var(--weight-bold); line-height: 1; font-variant-numeric: tabular-nums; }
.nbadge.is-dot { min-width: 8px; width: 8px; height: 8px; padding: 0; }
.nbadge[data-tone="warn"] { background: var(--color-warning); color: var(--admin-count-text); }
.nbadge[data-tone="danger"] { background: var(--color-danger); }
.has-badge { position: relative; }
.has-badge > .nbadge { position: absolute; top: -4px; right: -4px; }
.has-badge > .nbadge.is-dot { top: 2px; right: 2px; box-shadow: 0 0 0 2px var(--color-bg-raised); }

/* Menu (⋯ / popover): icon before every item, dividers between groups, destructive last in red */
.menu-wrap { position: relative; display: inline-flex; }
.menu-pop { right: 0; top: calc(100% + var(--space-1)); }
.menu-pop.is-left { right: auto; left: 0; }
.menu-pop .opt.is-danger, .menu-pop .opt.is-danger .icon { color: var(--color-danger); }
.menu-pop form { margin: 0; }
.menu-pop .opt:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px; }
.menu-pop .opt[aria-disabled="true"] { color: var(--color-text-muted); cursor: default; }

/* Combobox and chip input: shared suggestion list */
.cbx { position: relative; }
.cbx-control { position: relative; display: flex; align-items: center; }
.cbx-control .input { padding-right: var(--space-8); }
.cbx-control > .icon { position: absolute; right: var(--space-3); width: 16px; height: 16px; color: var(--color-text-muted); pointer-events: none; }
.cbx-list { left: 0; right: 0; top: calc(100% + var(--space-1)); max-height: 280px; overflow-y: auto; list-style: none; margin: 0; }
.cbx-list [role="option"] { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-3); row-gap: 2px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); cursor: pointer; }
.cbx-list [role="option"][aria-selected="true"], .cbx-list [role="option"]:hover { background: var(--color-bg-subtle); }
.cbx-list [role="option"] .icon { width: 16px; height: 16px; color: var(--color-text-muted); flex: none; }
/* Option layout: the shared .pop rules in «R: basics» (label grows, description on its own line). */
.cbx-list .cbx-note { padding: var(--space-2) var(--space-3); font-size: var(--text-sm); color: var(--color-text-muted); display: flex; align-items: center; gap: var(--space-2); }

/* People chips (from _design/mote.css + veiledning.css) */
.people-box { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-2); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-bg); position: relative; }
.people-box:focus-within { border-color: var(--color-border-focus); box-shadow: 0 0 0 3px var(--color-primary-subtle); }
.chip { position: relative; display: inline-flex; color: var(--color-text); font-family: inherit; align-items: center; gap: var(--space-2); padding: 2px var(--space-2) 2px 2px; border-radius: var(--radius-full); border: 1px solid var(--color-border); background: var(--color-bg-raised); font-size: var(--text-sm); white-space: nowrap; }
.chip .role { font-size: var(--text-xs); color: var(--color-text-muted); }
.chip .x { border: 0; background: none; color: var(--color-text-muted); width: 20px; height: 20px; display: grid; place-items: center; border-radius: var(--radius-full); cursor: pointer; padding: 0; }
.chip .x:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.chip .x:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
.chip .x .icon { width: 12px; height: 12px; }
.chip-input { border: 0; background: transparent; font: inherit; color: var(--color-text); padding: var(--space-1) var(--space-2); min-width: 12ch; flex: 1; outline: none; }
.chip-input::placeholder { color: var(--color-text-muted); }
.sug-list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); }
.sug-list .chip { border-style: dashed; cursor: pointer; }
.sug-list .chip:hover { border-color: var(--color-border-strong); }

/* Tabs and segmented control (from _design/mote.css) */
/* The base line is an inset shadow (not a border + negative margins), so the row never overflows
   vertically: overflow-x: auto alone made Edge show a small vertical scrollbar. */
.tabs { display: flex; gap: var(--space-1); box-shadow: inset 0 -1px 0 var(--color-border); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs [role="tab"], .tabs a { border: 0; background: none; font: inherit; padding: var(--space-2) var(--space-3); color: var(--color-text-secondary); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: var(--space-1); }
.tabs [aria-selected="true"], .tabs a[aria-current="page"] { color: var(--color-text); border-bottom-color: var(--color-primary); font-weight: var(--weight-medium); }
.tabs a:hover { text-decoration: none; color: var(--color-text); }
.tabs [role="tab"]:focus-visible, .tabs a:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px; border-radius: var(--radius-sm); }
.tabs .n { color: var(--color-text-muted); font-size: var(--text-xs); }
.tab-panel { padding-top: var(--space-4); }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-full); background: var(--color-bg-raised); margin: 0; }
.seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.seg label { font-size: var(--text-xs); padding: var(--space-1) var(--space-3); border-radius: var(--radius-full); color: var(--color-text-secondary); cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-1); }
.seg label:has(input:checked) { background: var(--color-primary-subtle); color: var(--color-text); font-weight: var(--weight-medium); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
.seg .icon { width: 14px; height: 14px; }

/* Hidden-but-focusable native inputs inside option chips, card options and the segmented control */
.choice-input, input[type="checkbox"].choice-input { position: absolute; opacity: 0; width: 1px; height: 1px; min-width: 0; margin: 0; padding: 0; border: 0; appearance: none; pointer-events: none; }
input[type="checkbox"].choice-input::after { display: none; }

/* Option chips (single/multi choice, e.g. dates and times; from _design/veiledning.css) */
.opts { display: flex; flex-wrap: wrap; gap: var(--space-2); border: 0; padding: 0; margin: 0; min-width: 0; }
.opts legend, .card-opts legend { font-weight: var(--weight-medium); margin-bottom: var(--space-2); padding: 0; }
.opt-btn { position: relative; border: 1px solid var(--color-border); background: var(--color-bg-raised); color: var(--color-text); font-size: var(--text-sm); padding: var(--space-2) var(--space-3); border-radius: var(--radius-full); cursor: pointer; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: var(--space-1); }
.opt-btn:hover { border-color: var(--color-border-strong); }
.opt-btn:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-subtle); font-weight: var(--weight-medium); }
.opt-btn:has(input:focus-visible) { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
.opt-btn .s { color: var(--color-text-muted); font-weight: var(--weight-normal); }
.opt-btn .icon { width: 14px; height: 14px; }

/* Card options (big choices with icon; from _design/veiledning.css) */
.card-opts { border: 0; padding: 0; margin: 0; min-width: 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.card-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) { .card-grid, .card-grid[data-cols="2"] { grid-template-columns: 1fr; } }
.card-opt { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-bg-raised); cursor: pointer; text-align: left; color: var(--color-text); }
.card-opt:hover { border-color: var(--color-border-strong); }
.card-opt:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-subtle); }
.card-opt:has(input:focus-visible) { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
.card-opt .icon { width: 22px; height: 22px; color: var(--color-primary); }
.card-opt b { font-weight: var(--weight-semibold); }
.card-opt .d { font-size: var(--text-xs); color: var(--color-text-secondary); }

/* Toasts: message + hint + optional action, bottom centre */
.toasts { position: fixed; z-index: var(--z-toast); left: 50%; bottom: var(--space-6); transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--space-2); width: min(480px, calc(100vw - 2 * var(--space-4))); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--toast-bg); color: var(--toast-text); box-shadow: var(--shadow-lg); font-size: var(--text-sm); animation: toast-in var(--transition-base) ease-out; }
.toast .msg { flex: 1; min-width: 0; }
.toast .msg b { display: block; font-weight: var(--weight-semibold); }
.toast .msg span { display: block; color: var(--toast-muted); }
.toast .act { color: inherit; font-weight: var(--weight-semibold); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; white-space: nowrap; }
.toast .x { border: 0; background: none; color: var(--toast-muted); cursor: pointer; width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--radius-full); flex: none; }
.toast .x:hover { color: var(--toast-text); }
.toast .x .icon { width: 14px; height: 14px; }
.toast > .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast[data-tone="ok"] > .icon { color: var(--color-success); }
.toast[data-tone="error"] > .icon { color: var(--color-danger); }
.toast-static { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Dialog: fikt dialog.dialog; cancel left, primary right (see .dialog-foot rule in R: basics) */
.dialog-head .icon-btn { margin-left: auto; }
dialog.dialog[data-size="sm"] { width: min(420px, calc(100vw - 2 * var(--space-4))); }
dialog.dialog[data-size="lg"] { width: min(760px, calc(100vw - 2 * var(--space-4))); }

/* Tip: shown once where the feature is (from _design/veiledning.css) */
.hint-tip { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-secondary); padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3); border-radius: var(--radius-full); background: var(--color-bg-subtle); width: fit-content; }
.hint-tip kbd { font-family: var(--font-mono); font-size: var(--text-xs); padding: 0 var(--space-1); border: 1px solid var(--color-border-strong); border-bottom-width: 2px; border-radius: var(--radius-sm); background: var(--color-bg); }
.hint-tip .x { border: 0; background: none; color: var(--color-text-muted); cursor: pointer; width: 22px; height: 22px; display: grid; place-items: center; border-radius: var(--radius-full); }
.hint-tip .x:hover { background: var(--color-bg); color: var(--color-text); }
.hint-tip .x .icon { width: 12px; height: 12px; }

/* Empty state sizes and the Figure sizes */
.empty .actions { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; justify-content: center; }
.mk.size-sm { width: 32px; height: 32px; overflow: visible; }
.mk.size-md { width: 64px; height: 64px; overflow: visible; }
.mk.size-lg { width: 120px; height: 120px; overflow: visible; }

/* Highlight + reason on a landing page (notifications, guidelines §7) */
.hl-note { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-primary-subtle); font-size: var(--text-sm); margin-bottom: var(--space-4); }
.hl-note .icon { width: 16px; height: 16px; color: var(--color-primary); flex: none; }
.is-highlighted { background: var(--color-primary-subtle); border-radius: var(--radius-md); box-shadow: 0 0 0 2px var(--color-primary-subtle); }

/* Loader: Bordet (table with six seats; the gold one is the chair). Reduced motion: still + text. */
.loader { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-secondary); font-size: var(--text-sm); }
.loader.is-block { flex-direction: column; justify-content: center; gap: var(--space-3); padding: var(--space-6) var(--space-4); text-align: center; width: 100%; }
.loader .mk { overflow: visible; flex: none; }
.loader .size-xs { width: 16px; height: 16px; }
.bd .table { fill: var(--fig-page); }
.bd .doc { fill: var(--fig-face); }
.bd .lines { fill: var(--fig-page); opacity: 0; }
.bd .s { fill: var(--seat); }
.bd .s.host { fill: var(--fig-accent); }
.bd .s, .bd .ln, .bd .doc { transform-box: fill-box; transform-origin: center; }
.bd .ln { transform-origin: 0 50%; }
.bd .seats, .bd .table { transform-box: view-box; transform-origin: 32px 32px; }
.bd .seats g:nth-child(1) .s { --d: 0; }
.bd .seats g:nth-child(2) .s { --d: 1; }
.bd .seats g:nth-child(3) .s { --d: 2; }
.bd .seats g:nth-child(4) .s { --d: 3; }
.bd .seats g:nth-child(5) .s { --d: 4; }
.bd .seats g:nth-child(6) .s { --d: 5; }
.a-spin .s { animation: bd-chase 1.2s linear infinite; animation-delay: calc(var(--d) * 0.2s - 1.2s); }
.a-orbit .seats { animation: bd-rot 2.4s linear infinite; }
.a-orbit .table { animation: bd-tpulse 1.2s ease-in-out infinite; }
.a-talk .s { animation: bd-talk 3.6s ease-in-out infinite; animation-delay: calc(var(--d) * 0.6s - 3.6s); }
.a-write .lines { opacity: 1; }
.a-write .ln { animation: bd-line 2.4s ease-out infinite; }
.a-write .ln:nth-child(2) { animation-delay: 0.35s; }
.a-write .ln:nth-child(3) { animation-delay: 0.7s; }
.a-write .s { animation: bd-chase 2.4s linear infinite; animation-delay: calc(var(--d) * 0.4s - 2.4s); }
.loader-text.is-quiet { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes bd-chase { 0% { opacity: 1; } 100% { opacity: 0.2; } }
@keyframes bd-rot { to { transform: rotate(360deg); } }
@keyframes bd-tpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.9); } }
@keyframes bd-talk { 0%, 18%, 100% { transform: scale(1); } 7% { transform: scale(1.45); } }
@keyframes bd-line { 0% { transform: scaleX(0); } 30%, 80% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

/* More Figure moods (R ported idle/joy/think). One-shot moods play when the class "on" is added. */
.a-nod.on .fig { animation: fg-nod 1s ease-in-out; }
.a-nod.on .eye { animation: fg-happy 1s; }
.a-shake.on .fig { animation: fg-shake 0.75s ease-out; }
.a-shake.on .eye { animation: fg-squint 0.75s; }
.a-wow.on .fig { animation: fg-wow 1.5s ease-out; }
.a-wow.on .eye { animation: fg-woweye 1.5s ease-out; }
.a-wow.on .mouth { animation: fg-hide 1.5s; }
.a-wow.on .o { animation: fg-show 1.5s; }
.a-wow.on .bang { animation: fg-bang 1.5s ease-out; }
.a-wink.on .fig { animation: fg-tilt 1.3s ease-in-out; }
.a-wink.on .eye.r { animation: fg-wink 1.3s ease-in-out; }
.a-wink.on .spark.s2 { animation: fg-sparkle 0.8s ease-out 0.25s backwards; }
.a-read .eyes { animation: fg-read 3.6s linear infinite; }
.a-read .fig { animation: fg-breathe 3.6s ease-in-out infinite; }
.a-sleep .fig { animation: fg-breathe 5s ease-in-out infinite; }
.a-sleep .eye { transform: scaleY(0.18) translateY(14px); animation: none; }
.a-sleep .mouth { transform: scale(0.6); }
.a-sleep .zzz text { animation: fg-zzz 3s ease-in infinite; }
.a-sleep .zzz text:nth-child(2) { animation-delay: 0.6s; }
.a-sleep .zzz text:nth-child(3) { animation-delay: 1.2s; }
.a-shake .bang { opacity: 0; }
.fg.a-boing.on .fig { animation: fg-boing 0.75s ease-out; }
@keyframes fg-nod { 0%, 40%, 80%, 100% { transform: translateY(0) scale(1, 1); } 20%, 60% { transform: translateY(4px) scale(1.02, 0.96); } }
@keyframes fg-shake { 0%, 100% { transform: translateX(0) rotate(0); } 10% { transform: translateX(-5px) rotate(-7deg); } 25% { transform: translateX(5px) rotate(7deg); } 40% { transform: translateX(-4px) rotate(-5deg); } 55% { transform: translateX(3px) rotate(3deg); } 70% { transform: translateX(-1px) rotate(-1deg); } }
@keyframes fg-squint { 0%, 100% { transform: scaleY(1); } 12%, 80% { transform: scaleY(0.45); } }
@keyframes fg-wow { 0%, 35%, 100% { transform: translateY(0) scale(1, 1); } 10% { transform: translateY(-8px) scale(0.96, 1.06); } 22% { transform: translateY(0) scale(1.05, 0.95); } }
@keyframes fg-woweye { 0%, 100% { transform: scale(1, 1); } 10%, 75% { transform: scale(1.3, 1.25); } }
@keyframes fg-hide { 0%, 100% { opacity: 1; } 8%, 80% { opacity: 0; } }
@keyframes fg-show { 0%, 100% { opacity: 0; } 8%, 80% { opacity: 1; } }
@keyframes fg-bang { 0% { opacity: 0; transform: scale(0); } 12% { opacity: 1; transform: scale(1.3); } 20%, 75% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes fg-tilt { 0%, 100% { transform: rotate(0); } 15%, 70% { transform: rotate(-7deg); } }
@keyframes fg-wink { 0%, 100% { transform: scaleY(1); } 15%, 65% { transform: scaleY(0.1); } }
@keyframes fg-read { 0% { transform: translate(-4px, -3px); } 30% { transform: translate(4px, -3px); } 33% { transform: translate(-4px, 0); } 63% { transform: translate(4px, 0); } 66% { transform: translate(-4px, 3px); } 96% { transform: translate(4px, 3px); } 100% { transform: translate(-4px, -3px); } }
@keyframes fg-zzz { 0% { opacity: 0; transform: translateY(5px); } 30% { opacity: 0.9; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes fg-boing { 0%, 100% { transform: scale(1, 1); } 20% { transform: scale(1.15, 0.85); } 40% { transform: scale(0.9, 1.1); } 60% { transform: scale(1.05, 0.95); } 80% { transform: scale(0.98, 1.02); } }

@media (prefers-reduced-motion: reduce) {
  .bd *, .bd, .toast { animation: none !important; transition: none !important; }
  .loader-text.is-quiet { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

/* Component catalogue (/dev/components) */
.cat { width: 100%; max-width: 980px; margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-12); }
.cat-head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-6); }
.cat-nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--text-sm); margin-bottom: var(--space-8); }
.cat-sec { padding: var(--space-6) 0; border-top: 1px solid var(--color-border); scroll-margin-top: var(--space-4); }
.cat-sec > h2 { font-size: var(--text-lg); margin: 0 0 var(--space-1); }
.cat-sec > p { margin: 0 0 var(--space-4); color: var(--color-text-secondary); font-size: var(--text-sm); }
.cat-sec code { font-family: var(--font-mono); font-size: var(--text-xs); }
.cat-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); }
.cat-col { display: flex; flex-direction: column; gap: var(--space-4); max-width: 520px; }
.cat-box { padding: var(--space-4); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-lg); }
.cat-label { font-size: var(--text-xs); color: var(--color-text-muted); }

/* --- track A: accounts and sign-in --- */

:root {
  /* Microsoft logo (brand colours, only used on the sign-in button) */
  --ms-red: #f25022;
  --ms-green: #7fba00;
  --ms-blue: #00a4ef;
  --ms-yellow: #ffb900;
}
/* Sign-in page (design 10) */
.login-page { background: var(--color-bg); }
.login { max-width: 380px; margin: 0 auto; padding: var(--space-10) var(--space-4) var(--space-12); display: flex; flex-direction: column; gap: var(--space-4); }
.login h1 { font-size: var(--text-2xl); text-align: center; margin: 0 0 var(--space-2); letter-spacing: -0.02em; }
.login-lead { text-align: center; margin: 0; }
.login-fig { width: 132px; margin: 0 auto; cursor: pointer; }
.login-fig .mk { width: 100%; height: auto; overflow: visible; display: block; }
.login-alt { display: flex; flex-direction: column; gap: var(--space-2); }
.login-alt .btn, .login-submit { justify-content: center; gap: var(--space-2); }
.login-or { display: flex; align-items: center; gap: var(--space-3); margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--color-border); }
.login-row { display: flex; justify-content: space-between; align-items: baseline; }
.login-row label { font-weight: var(--weight-medium); }
.login-show { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--color-text-secondary); }
.login-foot { text-align: center; margin: var(--space-2) 0 0; }
.login-hint[hidden], .login [hidden] { display: none; }
.login-recovery summary { cursor: pointer; font-size: var(--text-sm); color: var(--color-text-secondary); text-align: center; }
.login-recovery .field { margin-top: var(--space-2); }
.auth-fi { width: 22px; height: 22px; font-size: 10px; background: var(--org-0); }
.auth-ms .q1 { fill: var(--ms-red); }
.auth-ms .q2 { fill: var(--ms-green); }
.auth-ms .q3 { fill: var(--ms-blue); }
.auth-ms .q4 { fill: var(--ms-yellow); }
.auth-g { font-weight: var(--weight-bold); }
.form-row-end { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.form-row-end > :only-child { margin-left: auto; }
/* Two-factor: one digit per box */
.otp { display: flex; gap: var(--space-2); justify-content: center; }
.otp input { width: 44px; height: 52px; text-align: center; font-size: var(--text-xl); font-variant-numeric: tabular-nums; padding: 0; }
.totp-setup { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; }
.totp-qr { background: var(--color-bg-raised); border-radius: var(--radius-md); }
.totp-secret { font-size: var(--text-sm); letter-spacing: 0.08em; word-break: break-all; padding: var(--space-2) var(--space-3); background: var(--color-bg-subtle); border-radius: var(--radius-md); }
.totp-form { max-width: 420px; margin-top: var(--space-4); }
.recovery-codes { columns: 2; gap: var(--space-6); padding-left: var(--space-6); margin: 0; font-variant-numeric: tabular-nums; }
.recovery-codes li { padding: var(--space-1) 0; }
.token-once { display: block; font-family: var(--font-mono); font-size: var(--text-sm); word-break: break-all; user-select: all; background: var(--color-bg-subtle); padding: var(--space-2); border-radius: var(--radius-sm); }
.token-form fieldset { border: 0; padding: 0; margin: 0 0 var(--space-3); display: grid; gap: var(--space-2); }
/* Settings: «Slik logger du inn» */
.set-row .ctl { display: flex; align-items: center; gap: var(--space-3); flex: none; }
.set-row .ic .org-tile, .set-row .ic .auth-fi { width: 32px; height: 32px; }
.badge-s { font-size: var(--text-xs); padding: 0 var(--space-2); border-radius: var(--radius-full); border: 1px solid var(--color-border); color: var(--color-text-secondary); white-space: nowrap; font-weight: var(--weight-normal); }
.badge-s.ok { background: var(--color-success-subtle); border-color: transparent; color: var(--color-success); }
.set-more { position: relative; }
.set-more > summary { list-style: none; cursor: pointer; }
.set-more > summary::-webkit-details-marker { display: none; }
.set-pop { position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: 20; width: min(340px, 86vw); padding: var(--space-4); background: var(--color-bg-raised); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: var(--space-3); }
.set-add { margin-top: var(--space-4); }
.set-add .set-menu { position: absolute; left: 0; top: calc(100% + var(--space-2)); z-index: 20; min-width: 280px; }
.set-menu form { margin: 0; }
.set-menu .set-pop { position: static; width: auto; box-shadow: none; border: 0; padding: var(--space-2) var(--space-3); }
.invite-form { max-width: 420px; }
/* The Figure on the sign-in page: the ears (rings) become hands that cover the eyes */
.login-fig .ring { transition: transform 0.32s cubic-bezier(0.3, 1.5, 0.5, 1); }
.login-fig .covering .ring.l { transform: translate(3.75px, 23px) rotate(5deg) scale(1.55, 1.2); }
.login-fig .covering .ring.r { transform: translate(-3.25px, 23px) rotate(-5deg) scale(1.55, 1.2); }
.login-fig .covering.peeking .ring.l { transform: translate(4.25px, 29.5px) rotate(14deg) scale(1.55, 1.2); }
.login-fig .covering .eye { animation: none; }
.login-fig .covering .mouth { transform: scale(0.75); transition: transform 0.2s; }
.login-fig .a-nod.on .fig { animation: fga-nod 1s ease-in-out; }
.login-fig .a-nod.on .eye { animation: fg-happy 1s; }
.login-fig .a-shake.on .fig { animation: fga-shake 0.75s ease-out; }
.login-fig .a-shake.on .eye { animation: fga-squint 0.75s; }
.login-fig .a-wink.on .fig { animation: fga-tilt 1.3s ease-in-out; }
.login-fig .a-wink.on .eye.r { animation: fga-wink 1.3s ease-in-out; }
.login-fig .a-wink.on .spark.s2 { animation: fg-sparkle 0.8s ease-out 0.25s backwards; }
.login-fig .a-read .eyes { animation: fga-read 3.6s linear infinite; }
.login-fig .a-read .fig { animation: fg-breathe 3.6s ease-in-out infinite; }
@keyframes fga-nod { 0%, 40%, 80%, 100% { transform: translateY(0) scale(1, 1); } 20%, 60% { transform: translateY(4px) scale(1.02, 0.96); } }
@keyframes fga-shake { 0%, 100% { transform: translateX(0) rotate(0); } 10% { transform: translateX(-5px) rotate(-7deg); } 25% { transform: translateX(5px) rotate(7deg); } 40% { transform: translateX(-4px) rotate(-5deg); } 55% { transform: translateX(3px) rotate(3deg); } 70% { transform: translateX(-1px) rotate(-1deg); } }
@keyframes fga-squint { 0%, 100% { transform: scaleY(1); } 12%, 80% { transform: scaleY(0.45); } }
@keyframes fga-tilt { 0%, 100% { transform: rotate(0); } 15%, 70% { transform: rotate(-7deg); } }
@keyframes fga-wink { 0%, 100% { transform: scaleY(1); } 15%, 65% { transform: scaleY(0.1); } }
@keyframes fga-read { 0% { transform: translate(-4px, -3px); } 30% { transform: translate(4px, -3px); } 33% { transform: translate(-4px, 0); } 63% { transform: translate(4px, 0); } 66% { transform: translate(-4px, 3px); } 96% { transform: translate(4px, 3px); } 100% { transform: translate(-4px, -3px); } }
@media (prefers-reduced-motion: reduce) { .login-fig .ring, .login-fig .eyes { transition: none; } }

/* --- track B: organizations and series --- */
/* Home (02, 06), series page (03), My tasks; ported from _design/mote.css. */
.greet { font-size: var(--text-2xl); font-weight: var(--weight-semibold); margin: 0; }
.greet-sub { color: var(--color-text-secondary); margin: var(--space-1) 0 0; }
.home-head { display: flex; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; }
.home-head .spacer { flex: 1; }
.seg a { border: 0; background: none; font: inherit; font-size: var(--text-xs); padding: var(--space-1) var(--space-3); border-radius: var(--radius-full); color: var(--color-text-secondary); cursor: pointer; text-decoration: none; }
.seg a[aria-current] { background: var(--color-primary-subtle); color: var(--color-text); font-weight: var(--weight-medium); }
.date-box { width: 44px; text-align: center; flex-shrink: 0; line-height: 1.1; }
.date-box .d { display: block; font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--color-text); }
.date-box .m { display: block; font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; }
.row .lock, .next .lock { color: var(--color-text-muted); width: 14px; height: 14px; vertical-align: -2px; }
.avs { display: inline-flex; }
.avs .av { font-size: 9px; box-shadow: 0 0 0 2px var(--color-bg-raised); margin-left: -4px; }
.avs .av:first-child { margin-left: 0; }
.now { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); background: var(--color-primary-subtle); border: 1px solid color-mix(in srgb, var(--color-primary) 35%, transparent); }
.now .pulse { width: 10px; height: 10px; border-radius: var(--radius-full); background: var(--color-success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-success) 25%, transparent); flex-shrink: 0; }
.now .txt { flex: 1; min-width: 0; }
.now .t { font-weight: var(--weight-semibold); }
.now .s { color: var(--color-text-secondary); font-size: var(--text-xs); }
.card-head .link-more { font-size: var(--text-xs); }
.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.task { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-1) 0; }
.task .task-form { display: contents; }
.task input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; cursor: pointer; border: 1.5px solid var(--color-border-strong); border-radius: var(--radius-full); background: var(--color-bg-raised); display: grid; place-items: center; transition: background var(--transition-fast), border-color var(--transition-fast); }
.task input[type="checkbox"]:hover { border-color: var(--color-success); }
.task input[type="checkbox"]:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px; }
.task input[type="checkbox"]:checked { background: var(--color-success); border-color: var(--color-success); }
.task input[type="checkbox"]::after { content: none; }
.task input[type="checkbox"]:checked::after { content: ""; position: static; width: 5px; height: 9px; border-radius: 0; background: transparent; border: solid var(--color-text-inverse); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.task .task-nobox { width: 18px; flex-shrink: 0; }
.task .t { flex: 1; min-width: 0; }
.task .task-link { color: inherit; text-decoration: none; }
.task .task-link:hover { text-decoration: underline; }
.task .who { font-weight: var(--weight-medium); color: var(--color-primary); }
.task .due { font-size: var(--text-xs); color: var(--color-text-secondary); white-space: nowrap; }
.task .due[data-late] { color: var(--color-danger); font-weight: var(--weight-medium); }
.task .from { font-size: var(--text-xs); color: var(--color-text-muted); }
.task.done .t { color: var(--color-text-muted); text-decoration: line-through; }
.next { display: flex; gap: var(--space-5); align-items: flex-start; flex-wrap: wrap; }
/* a card that is one link (Hjem's next meeting): the whole card opens it */
a.card-link { display: block; color: inherit; text-decoration: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
a.card-link:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-md); text-decoration: none; }
.access-lock { display: inline-flex; align-items: center; vertical-align: middle; cursor: help; }
.next .big-date { text-align: center; padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--color-bg-subtle); }
.next .big-date .d { font-size: var(--text-3xl); font-weight: var(--weight-bold); line-height: 1; display: block; }
.next .big-date .m { font-size: var(--text-xs); color: var(--color-text-secondary); text-transform: uppercase; }
.next .info { flex: 1; min-width: 200px; }
.next .info .t { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.next ol { margin: var(--space-2) 0 0; padding-left: var(--space-5); color: var(--color-text-secondary); }
.hint { color: var(--color-text-muted); font-size: var(--text-xs); }
.row > .row-num { width: 44px; text-align: center; flex-shrink: 0; }
.b-members { margin: 0 0 var(--space-4); }
.b-inline { display: flex; align-items: center; gap: var(--space-1); }
.b-add { display: flex; align-items: flex-end; gap: var(--space-2); }
.b-add .field { flex: 1; }
.side-name-input { width: 100%; font: inherit; font-size: var(--text-sm); padding: 2px var(--space-2); border: 1px solid var(--color-border-focus); border-radius: var(--radius-sm); background: var(--color-bg-raised); color: var(--color-text); }
.side-series[draggable="true"] { cursor: grab; }
/* «Møter» (/o/{org}/meetings): the filter row and «Vis flere» */
.meetings-filter { flex-wrap: wrap; margin: var(--space-5) 0; }
.meetings-filter .search-box { min-width: 12rem; }
.meetings-filter .search-box .input { font-size: var(--text-base); }
.meetings-more { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: 0; }
/* «Vedtak» (G4): a decision row — the text clamped (three lines, two on Home), «Vis hele» opens it (no JS) */
.dec-filter .select { width: auto; }
.dec-row { align-items: flex-start; }
.dec-row .dec-icon { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--color-success); }
.dec-text { margin: 0; color: var(--color-text); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.dec-row.is-compact .dec-text { -webkit-line-clamp: 2; line-clamp: 2; }
.dec-row:has(.dec-more[open]) .dec-text { -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.dec-more > summary { display: inline-block; cursor: pointer; list-style: none; font-size: var(--text-xs); color: var(--color-primary); }
.dec-more > summary::-webkit-details-marker { display: none; }
.dec-more .when-open, .dec-more[open] .when-closed { display: none; }
.dec-more[open] .when-open { display: inline; }
.dec-meta { margin-top: var(--space-1); color: var(--color-text-secondary); font-size: var(--text-xs); }
.items > .item[id] { scroll-margin-top: var(--space-12); }
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .lead { flex-direction: column; gap: var(--space-3); }
  .lead .actions { margin-left: 0; }
}

/* --- track C: the meeting --- */
/* The meeting stands straight on the page background, like a document (01). */
/* The whole main area is the page: no box, border or shadow around the content (guidelines §2 item 24). */
:root { --sheet-width: 780px; }
.main:has(.sheet-wrap), .content.sheet-wrap { background: var(--color-bg); }
.content.sheet-wrap { padding: var(--space-8) var(--space-6) var(--space-12); }
.sheet { width: 100%; max-width: var(--sheet-width); margin: 0 auto; padding: var(--space-4) var(--space-6) var(--space-12); position: relative; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
@media (max-width: 720px) { .content.sheet-wrap { padding: var(--space-3) 0 var(--space-8); } .sheet { padding: var(--space-4); } }
/* Writing looks like writing on paper: inline fields get at most one subtle tint, never a frame. */
.sheet [contenteditable] { outline: none; border-radius: var(--radius-sm); }
.sheet [contenteditable]:hover { background: color-mix(in srgb, var(--color-bg-subtle) 60%, transparent); }
.sheet [contenteditable]:focus { background: color-mix(in srgb, var(--color-bg-subtle) 70%, transparent); box-shadow: none; }
.sheet .note [contenteditable], .sheet .note [contenteditable]:hover, .sheet .note [contenteditable]:focus,
.sheet .note [contenteditable]:focus-visible { background: transparent; box-shadow: none; outline: none; }
.inline-form { display: inline; margin: 0; }
.sheet [contenteditable][data-ph]:empty::before { content: attr(data-ph); color: var(--color-text-muted); }
.sheet .soft { color: var(--color-text-secondary); }
.sheet .small { font-size: var(--text-xs); }
.read-note { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-bg-subtle); color: var(--color-text-secondary); font-size: var(--text-sm); margin: 0 0 var(--space-4); }
.read-note .icon { width: 16px; height: 16px; flex: none; }

.eyebrow { display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-secondary); font-size: var(--text-xs); margin-bottom: var(--space-2); }
.eyebrow a { color: inherit; }
.eyebrow .sep { color: var(--color-text-muted); }
.eyebrow .spacer { flex: 1; }
.eyebrow .state { color: var(--color-text-muted); }
.eyebrow .state[data-state="in_progress"] { color: var(--color-success); font-weight: var(--weight-medium); }
.access { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-text-secondary); font-size: var(--text-xs); cursor: pointer; padding: 2px var(--space-2); border-radius: var(--radius-full); border: 1px solid transparent; background: none; font-family: inherit; }
button.access:hover { border-color: var(--color-border); }
button.access:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
.access .ic .icon { width: 14px; height: 14px; }
.eyebrow .menu-pop { min-width: 280px; }
.menu-pop .opt .k .icon { width: 14px; height: 14px; color: var(--color-primary); }
/* One quiet line above the title («Historisk møte», locked, read only) instead of a grey note and a crumb row. */
.m-status { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); color: var(--color-text-secondary); font-size: var(--text-sm); }
.m-status .icon { width: 16px; height: 16px; flex: none; }
.topbar .crumbs .current .d { color: var(--color-text-secondary); font-weight: var(--weight-normal); }
.access.is-static { cursor: default; padding-left: 0; }
.sheet .facts .access { margin-left: calc(var(--space-2) * -1); font-size: var(--text-sm); }
.sheet .facts .state[data-state="in_progress"] { color: var(--color-success); font-weight: var(--weight-medium); }
/* Leafing through meetings: the top bar's «‹ Forrige · 3 av 18 · Neste ›» and the cards at the bottom. */
.m-nav { display: inline-flex; align-items: stretch; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; font-size: var(--text-sm); white-space: nowrap; }
.m-nav > a, .m-nav > .off { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-3); color: var(--color-text-secondary); }
.m-nav > a:hover { background: var(--color-bg-subtle); color: var(--color-text); text-decoration: none; }
.m-nav > a:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px; }
.m-nav > .off { color: var(--color-text-muted); opacity: 0.5; }
.m-nav > * + * { border-left: 1px solid var(--color-border); }
.m-nav .pos { display: inline-flex; align-items: center; padding: 2px var(--space-3); font-size: var(--text-xs); color: var(--color-text-muted); }
@media (max-width: 720px) { .m-nav .lbl, .m-nav .pos { display: none; } }
.m-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-10); }
.m-pager a { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); color: var(--color-text); background: var(--color-bg-raised); min-width: 0; }
.m-pager a:hover { border-color: var(--color-border-strong); text-decoration: none; }
.m-pager a:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
.m-pager .next { grid-column: 2; text-align: right; }
.m-pager .k { font-size: var(--text-xs); color: var(--color-text-muted); }
.m-pager .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .m-pager { grid-template-columns: 1fr; } .m-pager .next { grid-column: 1; } }

.sheet .m-title { font-size: var(--text-3xl); font-weight: var(--weight-bold); letter-spacing: -0.01em; margin: 0 0 var(--space-4) calc(var(--space-1) * -1); padding: var(--space-1); }
.sheet .meta { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
/* Groups of different kinds get large gaps and a hairline (guidelines §2 item 1); a heading sits close to its content. */
.sheet .m-head { padding-bottom: var(--space-8); }
.sheet .m-sec, .sheet [data-part="follow-up"]:has(.sec-h) { margin-top: var(--space-2); padding-top: var(--space-10); border-top: 1px solid var(--color-border); }
.sheet [data-part="follow-up"]:has(.sec-h) + .m-sec { margin-top: var(--space-10); }
.sheet .m-sec > .sec-h, .sheet [data-part="follow-up"] > .sec-h { margin-top: 0; }
/* Empty fields are quiet affordances that open a small inline panel (shared option chips). */
.meta-ic { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 -5px; border: 0; background: none; border-radius: var(--radius-sm); color: var(--color-text-muted); cursor: pointer; flex: none; }
.meta-ic:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.meta-ic:focus-visible, .add-field:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
.meta-ic .icon { width: 18px; height: 18px; }
.add-field { border: 0; background: none; font: inherit; color: var(--color-text-muted); padding: var(--space-1) var(--space-2); margin-left: calc(var(--space-2) * -1); border-radius: var(--radius-sm); cursor: pointer; }
.add-field:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.add-field.is-quiet { font-size: var(--text-xs); margin-left: 0; }
.inline-panel { display: flex; flex-direction: column; gap: var(--space-3); margin: 0 0 var(--space-2) calc(18px + var(--space-3)); padding: var(--space-3) var(--space-4); background: var(--color-bg-subtle); border-radius: var(--radius-md); }
.inline-panel[hidden] { display: none; }
.topbar [data-primary][hidden] { display: none; }
.inline-panel .opts { display: flex; flex-wrap: wrap; gap: var(--space-2); border: 0; padding: 0; margin: 0; }
.inline-panel .opts legend { font-size: var(--text-xs); color: var(--color-text-secondary); margin-bottom: var(--space-1); padding: 0; }
.inline-panel .other { margin-top: calc(var(--space-2) * -1); }
.inline-panel .panel-foot { display: flex; align-items: center; gap: var(--space-3); }
.inline-panel .panel-foot .spacer { flex: 1; }
.inline-panel p { margin: 0; }
.meta-line { display: flex; align-items: center; gap: var(--space-3); min-height: 32px; color: var(--color-text); }
.meta-line > .icon { color: var(--color-text-muted); width: 18px; height: 18px; flex: none; }
.meta-line .inline-edit { padding: var(--space-1) var(--space-2); margin-left: calc(var(--space-2) * -1); cursor: text; min-width: 4ch; }
/* A value that opens its panel (the time): looks like the text it is, with the same quiet tint as text fields. */
.inline-edit.is-panel { border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-sm); }
.inline-edit.is-panel:hover, .inline-edit.is-panel[aria-expanded="true"] { background: color-mix(in srgb, var(--color-bg-subtle) 70%, transparent); }
.inline-edit.is-panel:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
.meta-line .inline-edit.is-link { color: var(--color-text-secondary); font-size: var(--text-sm); max-width: 32ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-line .inline-edit.is-link:focus { max-width: none; white-space: normal; overflow-wrap: anywhere; }
.meta-line .join { white-space: nowrap; }
@media (max-width: 720px) {
  .meta-line { flex-wrap: wrap; row-gap: var(--space-1); }
  .meta-line .inline-edit.is-link { max-width: 22ch; }
}
.join { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-3); border-radius: var(--radius-full); background: var(--color-primary-subtle); color: var(--color-text); font-weight: var(--weight-medium); font-size: var(--text-xs); border: 1px solid color-mix(in srgb, var(--color-primary) 40%, transparent); }
.join:hover { text-decoration: none; background: color-mix(in srgb, var(--color-primary) 22%, var(--color-bg)); }
.sheet .people { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); flex: 1; min-width: 0; position: relative; }
.sheet .people .chip { cursor: pointer; padding-right: var(--space-3); }
.sheet .people .chip:hover { border-color: var(--color-border-strong); }
.sheet .people .chip:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
/* Present (minutes): a green dot on the person's avatar; absent: the avatar greyed, the name struck through. */
.sheet .chip[data-state="yes"] .av::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: var(--radius-full); background: var(--color-success); box-shadow: 0 0 0 2px var(--color-bg-raised); }
.sheet .chip[data-state="no"] .av { opacity: 0.45; filter: grayscale(1); }
.sheet .chip[data-state="no"] { color: var(--color-text-muted); }
.sheet .chip[data-state="no"] .name { text-decoration: line-through; }
.sheet .people .menu-pop { min-width: 240px; }
.add-person { position: relative; flex: 1; min-width: 12ch; }
.add-person .chip-input { width: 100%; }
.add-person .cbx-list { min-width: 280px; right: auto; }
.sheet .more > summary { list-style: none; cursor: pointer; color: var(--color-text-muted); font-size: var(--text-xs); display: inline-flex; align-items: center; gap: var(--space-1); }
.sheet .more > summary::-webkit-details-marker { display: none; }
.sheet .more[open] > summary { margin-bottom: var(--space-3); }
/* «Vis mer» / «Vis mindre»: the label follows the state, the chevron turns. */
.sheet .more > summary .chev { width: 12px; height: 12px; transform: rotate(90deg); transition: transform var(--transition-fast); }
.sheet .more[open] > summary .chev { transform: rotate(-90deg); }
.sheet .more .more-open, .sheet .more[open] .more-closed { display: none; }
.sheet .more[open] .more-open { display: inline; }
.sheet .people .none { color: var(--color-text-muted); font-style: italic; font-size: var(--text-sm); }
/* A name from the minutes without an account in Møtebok: a dashed avatar. */
.sheet .chip.is-named { cursor: default; }
.sheet .chip.is-named .av:not([data-c]) { border: 1px dashed var(--color-border-strong); }
a.chip.is-named { cursor: pointer; color: inherit; text-decoration: none; }
a.chip.is-named:hover { border-color: var(--color-border-strong); }
a.chip.is-named:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
.sheet .more-people { display: inline-block; }
.sheet .more-people > summary { list-style: none; cursor: pointer; color: var(--color-text-muted); font-size: var(--text-sm); }
.sheet .more-people > summary::-webkit-details-marker { display: none; }
.sheet .more-people[open] > summary { margin-bottom: var(--space-2); }
.sheet .people-rest { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); }
/* Correcting a historical meeting: one bar on top — cancel far left, save far right (guidelines §2 item 5). */
.correct-bar { position: sticky; top: 72px; z-index: 5; display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-4); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--color-bg-subtle); border: 1px solid var(--color-border); font-size: var(--text-sm); }
.correct-bar form { margin: 0; }
.correct-bar .what { flex: 1; display: flex; align-items: center; gap: var(--space-2); margin: 0; min-width: 0; }
.correct-bar .what .icon { width: 16px; height: 16px; flex: none; }
.correct-bar .what .soft { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text-secondary); }
@media (max-width: 520px) { .correct-bar { flex-wrap: wrap; } .correct-bar .what { order: -1; flex-basis: 100%; } .correct-bar form:last-child { margin-left: auto; } }
.sheet .edited { display: flex; align-items: center; gap: var(--space-1); margin: var(--space-1) 0 0; color: var(--color-text-muted); font-size: var(--text-xs); }
.sheet .edited .icon { width: 12px; height: 12px; flex: none; }
.sheet .edited .btn-link { font-size: inherit; color: inherit; }
/* The history of corrections (a drawer like the item history; the original last). */
.revisions .w small { display: block; color: var(--color-text-muted); font-size: var(--text-xs); margin-top: 2px; }
.trail > li.is-fix::before { border-color: var(--color-primary); background: var(--color-primary); }
.revisions .diff { margin-top: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-subtle); font-size: var(--text-sm); overflow-wrap: anywhere; white-space: pre-wrap; }
.revisions del { background: var(--color-danger-subtle); color: var(--color-danger); text-decoration: line-through; }
.revisions ins { background: var(--color-success-subtle); color: var(--color-success); text-decoration: none; }
.revisions .original-text { margin-top: var(--space-2); font-size: var(--text-sm); }
.revisions .original-text > summary { cursor: pointer; color: var(--color-text-secondary); }
.revisions .orig-item h4 { margin: var(--space-3) 0 var(--space-1); font-size: var(--text-sm); }
.revisions .orig-item .note { min-height: 0; padding: 0; margin: 0; font-size: var(--text-sm); }
/* A person named in historical minutes (archive/person.html): a row list of meetings, newest first. */
.person-page { width: 100%; max-width: 760px; margin: 0 auto; }
.person-page h1 { font-size: var(--text-2xl); margin: 0 0 var(--space-1); }
.person-page .lead { margin: 0 0 var(--space-6); font-size: var(--text-sm); }
.sheet .facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); font-size: var(--text-sm); margin: 0; }
.sheet .facts dt { color: var(--color-text-secondary); }
.sheet .facts dd { margin: 0; padding: 0 var(--space-1); min-height: 1.4em; overflow-wrap: anywhere; }

.sec-h { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin: var(--space-8) 0 var(--space-4); }
.sec-h .count { font-weight: var(--weight-normal); text-transform: none; letter-spacing: 0; }
.sheet .task .from { font-size: var(--text-xs); color: var(--color-text-muted); }
.carry-note { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--color-primary-subtle); border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent); font-size: var(--text-sm); }
.carry-note span { flex: 1; }
.dialog .carry { list-style: none; padding: 0; margin: 0; }
.dialog .carry li label { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-2) 0; cursor: pointer; }
.dialog .carry .s { display: block; color: var(--color-text-secondary); font-size: var(--text-xs); }

/* Items (saker) with notes */
.sheet .items { list-style: none; margin: 0; padding: 0; }
.sheet .item { position: relative; padding: var(--space-6) 0 var(--space-6); border-top: 1px solid var(--color-border); }
.sheet .item:first-child { border-top: 0; padding-top: var(--space-1); }
/* Handle, number, title and ⋯ share the title's first line: each sits in a box exactly one title line high and
   centres its content there, so a long title wraps below without pulling the others down (or up). */
.sheet .items { --item-line: calc(var(--text-lg) * 1.45); --item-no-w: 2.25rem; }
.item-head { position: relative; display: flex; align-items: flex-start; gap: var(--space-3); }
.item-no { display: inline-flex; align-items: center; min-height: var(--item-line); font-variant-numeric: tabular-nums; color: var(--color-text-muted); font-weight: var(--weight-semibold); min-width: var(--item-no-w, 2.25rem); font-size: var(--text-sm); line-height: 1; flex: none; }
.item-title { flex: 1; min-width: 0; font-size: var(--text-lg); line-height: 1.45; font-weight: var(--weight-semibold); padding: 0 var(--space-1); overflow-wrap: anywhere; }
.item-side { display: flex; align-items: center; min-height: var(--item-line); gap: var(--space-2); flex-shrink: 0; color: var(--color-text-muted); font-size: var(--text-xs); }
.item-side .chip { padding: 1px; }
.item-side .icon-btn { width: 26px; height: 26px; opacity: 0.6; }
.item:hover .item-side .icon-btn, .item-side .icon-btn[aria-expanded="true"], .item-side .icon-btn:focus-visible { opacity: 1; }
.item .grip { position: absolute; left: calc(var(--space-6) * -1); top: 0; height: var(--item-line); display: flex; align-items: center; line-height: 1; color: var(--color-text-muted); opacity: 0; cursor: grab; user-select: none; }
.item:hover .grip { opacity: 1; }
.item.dragging { opacity: 0.5; }
.item.drop-before { box-shadow: 0 -2px 0 var(--color-primary); }
.item[data-status="closed"] .item-title, .item[data-status="moved"] .item-title { color: var(--color-text-secondary); }
/* The body's text lines up with the title's text: number column + gap + the title's own padding (the note's
   padding is cancelled by its negative margin). Fixed lengths, not ch: the number and the body differ in font size. */
.item-body { padding-left: calc(var(--item-no-w, 2.25rem) + var(--space-3) + var(--space-1)); margin-top: var(--space-2); }
.sheet .kind { font-size: var(--text-xs); color: var(--color-text-muted); }
.sheet .kind.is-status { border: 1px solid var(--color-border); border-radius: var(--radius-full); padding: 0 var(--space-2); }
/* K2 «+ Tilleggssak»: quiet, like the other side labels; G7 «Inhabil: …» a muted line under the item's head */
.sheet .kind.is-additional { color: var(--color-text-secondary); white-space: nowrap; }
.item-recusal { display: flex; align-items: center; gap: var(--space-1); margin: var(--space-1) 0 0; padding-left: calc(var(--item-no-w, 2.25rem) + var(--space-3) + var(--space-1)); color: var(--color-text-muted); font-size: var(--text-sm); }
.item-recusal .icon { width: 14px; height: 14px; flex: none; }
.recusal-people { border: 0; margin: 0 0 var(--space-4); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.recusal-people .check-row { display: flex; align-items: center; gap: var(--space-2); cursor: pointer; }
/* K3 «Meld forfall»: a quiet link at the end of the participant line; «Du har meldt forfall · Jeg kan likevel komme» */
.sheet .people .absence-open { font-size: var(--text-sm); }
.sheet .people .absence-mine { display: inline-flex; align-items: center; gap: var(--space-2); }
.sheet .people .absence-mine .btn-link { font-size: var(--text-sm); }
.guest-absence { display: flex; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); }
.guest-absence .field { margin: 0; }
.guest-absence p { margin: 0; flex-basis: 100%; }
.history { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-text-secondary); font-size: var(--text-xs); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.history:hover { color: var(--color-primary); }
.history:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.add-item { display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); padding: var(--space-3) 0; border: 0; background: none; font: inherit; cursor: pointer; }
.add-item:hover { color: var(--color-primary); }
.add-item:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.agenda-more { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5); margin-top: var(--space-4); }
.agenda-more .add-item .icon { width: 16px; height: 16px; }
.agenda-more .btn-link, .agenda-more .menu-wrap > .btn { font-size: var(--text-sm); color: var(--color-text-muted); }
.agenda-more .menu-wrap > .btn { border: 0; background: none; padding: var(--space-1) 0; box-shadow: none; font-weight: var(--weight-normal); }
.agenda-more .menu-wrap > .btn:hover { color: var(--color-primary); }
.agenda-more .menu-wrap > .btn .icon { width: 14px; height: 14px; }
.conn-state { color: var(--color-text-muted); font-size: var(--text-xs); min-height: 1.4em; margin: var(--space-2) 0 0; }
.conn-state[data-tone="warn"] { color: var(--color-warning); }
.conn-state[data-tone="error"] { color: var(--color-danger); }

/* The notes editor (TipTap/ProseMirror) */
.note { min-height: 1.6em; padding: var(--space-1); margin-left: calc(var(--space-1) * -1); font-size: var(--text-base); line-height: 1.65; border-radius: var(--radius-sm); }
.note .ProseMirror { outline: none; min-height: 1.6em; white-space: pre-wrap; overflow-wrap: anywhere; }
.note:focus-within { box-shadow: none; outline: none; }
.note p { margin: 0 0 var(--space-2); }
.note h3 { font-size: var(--text-base); font-weight: var(--weight-semibold); margin: var(--space-3) 0 var(--space-1); }
.note ul, .note ol { margin: 0 0 var(--space-2); padding-left: var(--space-5); }
.note blockquote { margin: 0 0 var(--space-2); padding-left: var(--space-3); border-left: 2px solid var(--color-border); color: var(--color-text-secondary); }
.note a { color: var(--color-primary); }
.note .ProseMirror p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--color-text-muted); float: left; height: 0; pointer-events: none; }
.note:empty::before { content: attr(data-ph); color: var(--color-text-muted); }
.note ul.checklist, .note ul[data-type="taskList"] { list-style: none; padding-left: 0; }
.note ul[data-type="taskList"] li { display: flex; gap: var(--space-2); align-items: flex-start; }
.note ul[data-type="taskList"] li > label { margin-top: 2px; }
.note ul[data-type="taskList"] li > div { flex: 1; }
.note .task { margin: var(--space-1) 0; }
.note .task .t { min-width: 2ch; }
.note .task .who { margin-right: var(--space-1); }
.note .task .due { border: 0; background: none; font: inherit; font-size: var(--text-xs); cursor: pointer; padding: 0 var(--space-1); border-radius: var(--radius-sm); color: var(--color-text-secondary); }
.note .task .due:hover { background: var(--color-bg-subtle); }
.note .task .due.is-empty { color: var(--color-text-muted); }
.decision { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); margin: var(--space-3) 0; border: 1px solid color-mix(in srgb, var(--color-success) 35%, transparent); background: var(--color-success-subtle); border-radius: var(--radius-md); }
.decision > .icon { color: var(--color-success); margin-top: 3px; width: 18px; height: 18px; flex: none; }
.decision .lbl { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-success); display: block; }
.decision .txt { flex: 1; min-width: 0; }
.confidential { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); margin: var(--space-3) 0; border: 1px dashed var(--color-border-strong); border-radius: var(--radius-md); color: var(--color-text-secondary); }
.confidential > .icon { width: 16px; height: 16px; flex: none; margin-top: 4px; }
.confidential .lbl { font-size: var(--text-xs); font-weight: var(--weight-semibold); display: block; }
.confidential .txt { flex: 1; min-width: 0; color: var(--color-text); }

/* Floating format bar on a selection (S-4) and the / and @ menus */
.fmt-bar { position: absolute; z-index: var(--z-dropdown); display: flex; gap: 2px; padding: var(--space-1); background: var(--color-text); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.fmt-bar[hidden] { display: none; }
.fmt-bar button { width: 32px; height: 30px; display: grid; place-items: center; border: 0; background: none; color: var(--color-bg); border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-weight: var(--weight-semibold); }
.fmt-bar button:hover, .fmt-bar button[aria-pressed="true"] { background: color-mix(in srgb, var(--color-bg) 18%, transparent); }
.fmt-bar button:focus-visible { outline: 2px solid var(--color-bg); outline-offset: -2px; }
.fmt-bar .sep { width: 1px; background: color-mix(in srgb, var(--color-bg) 25%, transparent); margin: var(--space-1) 2px; }
.ed-pop { position: absolute; max-height: 320px; overflow-y: auto; }
.ed-pop[hidden] { display: none; }
.ed-form { display: flex; gap: var(--space-2); align-items: center; padding: var(--space-2); }
.ed-form .input { flex: 1; min-width: 12ch; }

/* Presence (S-12): avatars in the topbar, "X skriver…" on the item, remote carets with names (S-10) */
/* data-p: the person's colour (app/avatars) for their caret, «skriver» dot and presence avatar. */
[data-p="0"] { --p: var(--person-0); }
[data-p="1"] { --p: var(--person-1); }
[data-p="2"] { --p: var(--person-2); }
[data-p="3"] { --p: var(--person-3); }
[data-p="4"] { --p: var(--person-4); }
[data-p="5"] { --p: var(--person-5); }
[data-p="6"] { --p: var(--person-6); }
[data-p="7"] { --p: var(--person-7); }
.presence { display: inline-flex; }
.presence[hidden] { display: none; }
.presence .av[data-me] { opacity: 0.55; }
.presence .av { box-shadow: 0 0 0 2px var(--color-bg-raised); margin-left: -6px; cursor: default; }
.presence .av:first-child { margin-left: 0; }
.presence .tip { position: absolute; top: calc(100% + 6px); right: 0; white-space: nowrap; background: var(--color-text); color: var(--color-bg); font-size: var(--text-xs); font-weight: var(--weight-normal); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); opacity: 0; pointer-events: none; transition: opacity var(--transition-fast); z-index: var(--z-dropdown); }
.presence .av:hover .tip, .presence .av:focus .tip { opacity: 1; }
.here { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-text-secondary); }
.here[hidden] { display: none; }
.here::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--p); }
.collab-caret { position: relative; margin-left: -1px; margin-right: -1px; border-left: 2px solid var(--p); word-break: normal; pointer-events: none; }
.collab-caret .flag { position: absolute; bottom: 100%; left: -2px; background: var(--p); color: var(--person-text); font-size: 10px; font-weight: var(--weight-medium); line-height: 1.4; padding: 0 var(--space-1); border-radius: var(--radius-sm) var(--radius-sm) var(--radius-sm) 0; white-space: nowrap; user-select: none; }
.collab-sel { background: color-mix(in srgb, var(--p) 22%, transparent); }
.saved-state { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); font-size: var(--text-xs); }
.saved-state .icon { width: 14px; height: 14px; }
.saved-state[data-state="saving"] .icon { opacity: 0.3; }
.saved-state[data-state="offline"] { color: var(--color-warning); }

/* Item history drawer (F-2) */
.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(440px, 100vw); border: 0; border-left: 1px solid var(--color-border); padding: 0; background: var(--color-bg-raised); color: var(--color-text); box-shadow: var(--shadow-lg); }
.drawer::backdrop { background: var(--color-bg-overlay); }
.drawer-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-5); border-bottom: 1px solid var(--color-border); }
.drawer-head h2 { flex: 1; font-size: var(--text-lg); margin: 0; }
.drawer-body { padding: var(--space-5); overflow-y: auto; }
.history-head { margin: 0 0 var(--space-4); }
.trail { list-style: none; margin: 0; padding: 0; position: relative; }
.trail::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; border-left: 2px solid var(--color-border); }
.trail > li { position: relative; padding-left: var(--space-6); padding-bottom: var(--space-5); }
.trail > li::before { content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: var(--radius-full); background: var(--color-bg-raised); border: 2px solid var(--color-border-strong); }
.trail > li[data-now]::before { border-color: var(--color-primary); background: var(--color-primary); }
.trail .when { font-size: var(--text-xs); color: var(--color-text-muted); }
.trail .what { font-weight: var(--weight-medium); }
.trail p { margin: var(--space-1) 0 0; color: var(--color-text-secondary); white-space: pre-line; }
.trail .soft { color: var(--color-text-muted); }
.trail-tasks { margin: var(--space-1) 0 0; padding-left: var(--space-5); color: var(--color-text-secondary); font-size: var(--text-sm); }
@media (max-width: 720px) {
  .item .grip { display: none; }
  .item-body, .item-recusal { padding-left: 0; }
  .item-head { gap: var(--space-2); }
  .item-no { min-width: 0; }
}

/* --- track D: sending and export --- */
/* «N endringer ikke sendt» pill in the meeting's top bar (templates/mail/send.html) */
.pending { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-secondary); padding: 2px var(--space-3); border-radius: var(--radius-full); background: var(--color-warning-subtle); border: 0; font-family: inherit; cursor: pointer; }
.pending[hidden] { display: none; }
.pending:hover { color: var(--color-text); }
.pending:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px; }
.pending .n { font-weight: var(--weight-bold); color: var(--color-text); }
/* «Send endringer» / «Send referat» (frontend/mail/main.js) */
dialog.dialog[data-size="lg"] .dialog-body:has(.send-plan) { max-height: min(70vh, 640px); overflow-y: auto; }
.send-plan { display: flex; flex-direction: column; gap: var(--space-2); }
.send-plan p { margin: 0; }
.send-plan .inv-lead { color: var(--color-text-secondary); }
.send-plan .inv-note { font-size: var(--text-sm); color: var(--color-text-secondary); }
.send-plan .changes { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); }
.send-plan .changes li { display: flex; gap: var(--space-2); align-items: baseline; }
.send-plan .changes .what { color: var(--color-text-muted); min-width: 11ch; }
.send-plan del { color: var(--color-text-muted); }
.send-plan .changes ins { text-decoration: none; font-weight: var(--weight-semibold); }
.send-plan .help-h { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .06em; margin-top: var(--space-2); }
.send-plan .grp { border-bottom: 1px solid var(--color-border); padding: var(--space-3) 0; }
.send-plan .grp-row { display: flex; align-items: center; gap: var(--space-3); }
.send-plan .grp-row label { flex: 1; min-width: 0; display: flex; gap: var(--space-3); align-items: center; cursor: pointer; }
.send-plan .grp-row input, .send-plan .who-pick input { accent-color: var(--color-primary); }
.send-plan .grp-row .txt { flex: 1; min-width: 0; }
.send-plan .grp-row .t { font-weight: var(--weight-medium); }
.send-plan .grp-row .s { font-size: var(--text-xs); color: var(--color-text-secondary); }
.send-plan .grp-row .warn { font-size: var(--text-xs); color: var(--color-warning); }
.send-plan .grp.off .t, .send-plan .grp.off .avs { opacity: .55; }
.send-plan .grp-row .btn-link { font-size: var(--text-xs); white-space: nowrap; }
.send-plan .who-pick { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0 0 var(--space-8); }
.send-plan .grp .who-pick + .mail, .send-plan .grp-row + .mail { margin-left: var(--space-8); }
.send-plan > .who-pick { margin-left: 0; }
.send-plan .who-pick label { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); padding: 2px var(--space-2) 2px var(--space-1); border: 1px solid var(--color-border); border-radius: var(--radius-full); cursor: pointer; }
.send-plan .who-pick label:has(input:not(:checked)) { color: var(--color-text-muted); text-decoration: line-through; }
.send-plan .who-pick label.is-disabled { text-decoration: none; cursor: default; }
.send-plan .mail { margin-top: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-bg-raised); font-size: var(--text-sm); overflow: hidden; }
.send-plan .mail-h { margin: 0; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); background: var(--color-bg-subtle); display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-3); }
.send-plan .mail-h dt { color: var(--color-text-muted); }
.send-plan .mail-h dd { margin: 0; }
.send-plan .mail-b { padding: var(--space-4); line-height: var(--leading-normal); }
.send-plan .mail-b p { margin: 0 0 var(--space-2); }
.send-plan .mail-b ul, .send-plan .mail-b ol { margin: 0 0 var(--space-2); padding-left: var(--space-5); }
.send-plan .mail-b ins { text-decoration: none; background: var(--color-warning-subtle); padding: 0 2px; border-radius: 2px; }
.send-plan .mail-b .mail-button { display: inline-block; padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); background: var(--color-primary-subtle); color: var(--color-primary); font-weight: var(--weight-semibold); text-decoration: none; }
.send-plan .mail-b .ics { display: inline-flex; gap: var(--space-2); align-items: center; font-size: var(--text-xs); color: var(--color-text-secondary); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-1) var(--space-2); margin-right: var(--space-2); }
.send-plan .inv-msg { margin-top: var(--space-3); }
.send-plan .inv-msg textarea { width: 100%; }
.send-plan .inv-rule { margin-top: var(--space-5); font-size: var(--text-xs); color: var(--color-text-muted); }
.send-plan .done-state { text-align: center; padding: var(--space-8) 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.send-plan .done-state .fig-slot { width: 96px; display: flex; justify-content: center; }
.send-plan .inv-title { margin-bottom: var(--space-4); }
.send-plan .done-state p { color: var(--color-text-secondary); }
.mail-demo { max-width: 640px; display: flex; flex-direction: column; gap: var(--space-3); }

/* --- track E: guidance --- */
/* Tour (V-3): one element at a time, the rest dimmed */
.tour-spot { position: fixed; z-index: var(--z-modal); border-radius: var(--radius-lg); box-shadow: 0 0 0 9999px var(--color-bg-overlay), 0 0 0 2px var(--color-primary); pointer-events: none; transition: all var(--transition-base); }
.tour-bubble { position: fixed; z-index: var(--z-modal); width: min(320px, calc(100vw - 24px)); padding: var(--space-8) var(--space-5) var(--space-4); background: var(--color-bg-raised); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); transition: top var(--transition-base), left var(--transition-base); }
.tour-fig { position: absolute; top: -26px; left: var(--space-4); width: 52px; }
.tour-fig .fig-wrap, .tour-fig .mk { display: block; width: 100%; height: auto; overflow: visible; }
.tour-bubble h2 { font-size: var(--text-lg); margin: 0 0 var(--space-1); }
.tour-bubble p { margin: 0; color: var(--color-text-secondary); font-size: var(--text-sm); line-height: var(--leading-normal); }
.tour-foot { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
.tour-foot .btn-link, .tour-foot .spacer { margin-right: auto; font-size: var(--text-sm); }
.tour-dots { position: absolute; top: var(--space-4); right: var(--space-5); display: inline-flex; gap: 5px; }
.tour-dots span { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--color-border-strong); }
.tour-dots span.on { background: var(--color-primary); width: 16px; }

/* Help panel (V-4): the drawer (.drawer, styled by track C) from the right; also the /help page */
.help-body { display: flex; flex-direction: column; gap: var(--space-5); }
.help-body [hidden] { display: none; }
.help-here { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-3); font-size: var(--text-sm); line-height: var(--leading-normal); }
.help-h { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 var(--space-2); }
.help-keys summary { cursor: pointer; }
.faq details { border-bottom: 1px solid var(--color-border); }
.faq summary { cursor: pointer; padding: var(--space-2) 0; font-size: var(--text-sm); }
.faq p { margin: 0 0 var(--space-3); font-size: var(--text-sm); color: var(--color-text-secondary); line-height: var(--leading-normal); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.keys kbd, .help-page kbd { font-family: var(--font-mono); font-size: var(--text-xs); padding: 0 var(--space-1); border: 1px solid var(--color-border-strong); border-bottom-width: 2px; border-radius: var(--radius-sm); background: var(--color-bg); }
.help-fig { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-lg); background: var(--color-bg-subtle); font-size: var(--text-sm); }
.help-fig .fig-slot { width: 44px; flex: none; }
.help-more { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: var(--text-sm); }
.help-none { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }
.help-page { width: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-6); }
.help-search { display: flex; gap: var(--space-2); }
.help-search .input { flex: 1; }

/* Reacting figure (V-7) and tips chosen by the server (V-5) */
.guide-react { display: inline-block; }
.guide-tip { margin: var(--space-2) 0; }

@media (prefers-reduced-motion: reduce) {
  .wiz-line, .wiz.is-js .wiz-q, .wiz.is-js .wiz-reveal, .tour-spot, .tour-bubble { animation: none; transition: none; }
}


/* --- track F: administration --- */
/* Admin page (sketch 17): rows, sub-panels, choices, swatches. Track A owns .badge-s/.badge-s.ok. */
.set-head { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.set-head h1 { font-size: var(--text-2xl); margin: 0; }
.set-sec { scroll-margin-top: var(--space-6); }
.sec-head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-3); }
.sec-head h2 { font-size: var(--text-lg); margin: 0; flex: 1; }
.set-row.off .t, .set-row.off .s { color: var(--color-text-muted); }
.set-row .ic .icon { width: 18px; height: 18px; }
.set-row .ic .mk { width: 24px; height: 24px; }
.set-row .btn-link { font-size: var(--text-sm); }
.set-row form { margin: 0; }
form.set-row { margin: 0; }
a.set-row { color: inherit; text-decoration: none; }
a.set-row:hover .t { text-decoration: underline; }
.set-sub { padding: var(--space-4) 0 var(--space-4) calc(32px + var(--space-4)); border-bottom: 1px solid var(--color-border); display: flex; flex-direction: column; gap: var(--space-3); font-size: var(--text-sm); }
.set-sub[hidden], .set-sub-field[hidden], .autosave-submit[hidden] { display: none; }
.set-sub .field { max-width: 420px; }
.set-sub .set-sub { padding: 0; border-bottom: 0; }
@media (max-width: 560px) { .set-sub { padding-left: 0; } }
.set-note { font-size: var(--text-xs); color: var(--color-text-muted); margin: var(--space-3) 0 0; }
.badge-s.wait { background: var(--color-warning-subtle); border-color: transparent; color: var(--color-text); }
.badge-s.err { background: var(--color-danger-subtle); border-color: transparent; color: var(--color-danger); }
.choice-col { display: flex; flex-direction: column; gap: var(--space-2); }
.choice-col > label, .choice-card > label { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; background: var(--color-bg-raised); }
.choice-col > label:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-subtle); }
.choice-col > label input[type="radio"], .choice-card > label input[type="radio"] { margin: 3px 0 0; accent-color: var(--color-primary); }
.choice-col > label .s, .choice-card > label .s { display: block; font-size: var(--text-xs); color: var(--color-text-secondary); }
/* A choice with its own settings: the fields sit inside the same card, right under the chosen option */
.choice-card { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-raised); }
.choice-card:has(> label input:checked) { border-color: var(--color-primary); }
.choice-col .choice-card > label { border: 0; border-radius: var(--radius-md); background: none; }
.choice-col .choice-card:has(> label input:checked) > label { background: var(--color-primary-subtle); }
.choice-card:has(.choice-panel:not([hidden])) > label { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.choice-col + h3 { margin-top: var(--space-6); }
.choice-panel { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4) var(--space-4) var(--space-5) calc(var(--space-4) + 13px + var(--space-3)); border-top: 1px solid var(--color-border); }
/* settings rows in a panel: the card is their frame (no lines above the first and below the last) */
.choice-panel:has(> .set-list) { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.choice-panel > .set-list { border-top: 0; }
.choice-panel > .set-list > :last-child, .choice-panel > .set-list > :has(+ [hidden]:last-child) { border-bottom: 0; }
.admin-form { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; }
.form-foot { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.form-foot .spacer { flex: 1; }
.autosave-submit { margin-top: var(--space-2); }
.js-admin .autosave-submit { display: none; }
.admin-error { margin-bottom: var(--space-3); }
.test-result { margin: 0; font-size: var(--text-sm); color: var(--color-text-secondary); }
.test-result:empty { display: none; }
.test-result[data-ok="false"] { color: var(--color-danger); }
/* the answer in a test dialog (components/dialog.html test_dialog): a clear box, green or red */
.dialog .test-result { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: var(--text-base); background: var(--color-bg-subtle); color: var(--color-text); }
.dialog .test-result[data-ok="true"] { background: var(--color-success-subtle); color: var(--color-success); }
.dialog .test-result[data-ok="false"] { background: var(--color-danger-subtle); color: var(--color-danger); }
.dialog .test-result[aria-busy="true"] { color: var(--color-text-secondary); }
.org-logo { width: 32px; height: 32px; flex: none; object-fit: contain; border-radius: var(--radius-md); background: var(--color-bg-subtle); }
.swatches { display: flex; gap: var(--space-2); border: 0; padding: 0; margin: 0; flex-wrap: wrap; }
.swatches legend { font-weight: var(--weight-medium); margin-bottom: var(--space-2); padding: 0; }
.swatch { position: relative; width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--org-0); cursor: pointer; display: grid; place-items: center; }
.swatch[data-c="1"] { background: var(--org-1); }
.swatch[data-c="2"] { background: var(--org-2); }
.swatch[data-c="3"] { background: var(--org-3); }
.swatch[data-c="4"] { background: var(--org-4); }
.swatch[data-c="5"] { background: var(--org-5); }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-text); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--color-border-focus); outline-offset: 4px; }
.select-sm { padding-top: var(--space-1); padding-bottom: var(--space-1); font-size: var(--text-sm); }
.member-invite { display: flex; flex-direction: column; gap: var(--space-3); }
/* «Krav til innlogging» (admin/_org_signin.html): two questions, each a fieldset of rows you can click */
.orgauth-form { display: flex; flex-direction: column; gap: var(--space-10); }
.set-sub.orgauth-form { gap: 0; }
.orgauth-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.orgauth-form legend { padding: 0; margin-bottom: var(--space-2); }
.orgauth-form legend h3 { font-size: var(--text-base); margin: 0; }
.orgauth-form label.set-row { cursor: pointer; }
.orgauth-form .set-row .t, .orgauth-form .set-row .s { display: block; }
.orgauth-form input[aria-disabled="true"] { cursor: not-allowed; }
details.more > summary { cursor: pointer; color: var(--color-text-secondary); font-size: var(--text-sm); }
/* New organization (sketch 16): the wizard layout, scoped so track E can style its own wizard */
.neworg { width: 100%; max-width: 760px; margin: 0 auto; padding: var(--space-10) var(--space-6) var(--space-12); }
@media (max-width: 720px) { .neworg { padding: var(--space-6) var(--space-4) var(--space-10); } }
.neworg .m-title { font-size: var(--text-3xl); letter-spacing: -0.02em; margin: 0 0 var(--space-2); }
.neworg .m-title.ph { color: var(--color-text-muted); }
.neworg .wiz-q { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--color-border); display: flex; flex-direction: column; gap: var(--space-4); }
.neworg .wiz-ask { display: flex; align-items: center; gap: var(--space-3); }
.neworg .wiz-ask .mk { width: 52px; height: 52px; flex: none; }
.neworg .wiz-ask h2 { font-size: var(--text-xl); margin: 0; }
.neworg .wiz-ask p { margin: var(--space-1) 0 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
.neworg .wiz-foot { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-2); flex-wrap: wrap; }
.neworg .wiz-foot .spacer { flex: 1; }
/* Search (A-1) */
.search-page { width: 100%; max-width: 820px; margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-12); }
@media (max-width: 720px) { .search-page { padding: var(--space-6) var(--space-4) var(--space-10); } }
.search-form { display: flex; gap: var(--space-3); align-items: center; margin-bottom: var(--space-6); }
.search-box { position: relative; flex: 1; }
.search-box .icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--color-text-muted); pointer-events: none; }
.search-box .input { width: 100%; padding-left: var(--space-10); font-size: var(--text-lg); }
.search-count { color: var(--color-text-secondary); font-size: var(--text-sm); margin: 0; }
.search-scope { color: var(--color-text-secondary); font-size: var(--text-sm); margin: 0 0 var(--space-4); }
.search-group { margin-top: var(--space-6); }
.search-group h2 { display: flex; align-items: center; gap: var(--space-2); }
.search-n { font-size: var(--text-xs); font-weight: var(--weight-normal); color: var(--color-text-muted); }
.search-hit .s { display: block; }
.search-hit mark, .search-pal mark { background: var(--color-warning-subtle); color: inherit; border-radius: 2px; padding: 0 1px; }
/* The app's own actions in the top bar (shell/macros.html top_tools): Søk, the bell, «+» Nytt møte. */
.top-tools { display: flex; align-items: center; gap: var(--space-1); flex: none; }
.top-tools:not(:has(*)) { display: none; }
.topbar:has(.top-actions a[href="/meetings/new"]) .top-new { display: none; } /* the page has its own «Nytt møte» */
/* The search dialog (shell/macros.html search_dialog, frontend/components/search_dialog.js). */
dialog.dialog[data-size="palette"] { width: min(640px, calc(100vw - 2 * var(--space-4))); margin-top: 10vh; }
.search-pal .search-box .input { font-size: var(--text-base); }
.search-pal-list { max-height: min(55vh, 480px); overflow-y: auto; margin-top: var(--space-2); }
.search-pal-list:empty { display: none; }
.search-pal-h { padding: var(--space-3) var(--space-3) var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.search-pal-hit { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-3); row-gap: 2px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none; }
.search-pal-hit:hover { text-decoration: none; }
.search-pal-hit[aria-selected="true"] { background: var(--color-bg-subtle); }
.search-pal-hit > .icon { width: 16px; height: 16px; flex: none; color: var(--color-text-muted); }
.search-pal-hit > .lbl { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.search-pal-hit > .d { flex: 0 0 100%; min-width: 0; padding-left: calc(16px + var(--space-3)); font-size: var(--text-sm); color: var(--color-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-pal-hint, .search-pal-status { margin: var(--space-3) var(--space-1) 0; font-size: var(--text-sm); color: var(--color-text-secondary); }
.search-pal-status:empty, .search-pal-hint[hidden] { display: none; }
.search-pal-foot { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-border); font-size: var(--text-xs); color: var(--color-text-muted); }
.search-pal-all { margin-left: auto; font-size: var(--text-sm); }
@media (hover: none), (max-width: 640px) { .search-pal-keys { display: none; } }

/* --- track I: integration --- */
/* Figuren's click gimmick (frontend/components/figure.js playClick), ported from _design/logo-anim.css. */
.fg.a-ring.on .fig { animation: fg-alarm 1.2s linear; transform-origin: 32px 40px; }
.fg.a-ring.on .ring.l { animation: fg-clang 1.2s linear; transform-box: fill-box; transform-origin: center bottom; }
.fg.a-ring.on .ring.r { animation: fg-clang 1.2s linear reverse; transform-box: fill-box; transform-origin: center bottom; }
.fg.a-ring.on .eye { animation: fg-woweye 1.2s ease-out; transform-box: fill-box; transform-origin: center; }
.fg.a-peek.on .fig { animation: fg-peek 3.4s ease-in-out; }
.fg.a-peek.on .eyes { animation: fg-peekeyes 3.4s ease-in-out; }
.fg.a-spin.on .fig { animation: fg-spin 0.9s ease-in-out; transform-box: fill-box; transform-origin: center; }
.fg.a-flip.on .fig { animation: fg-flip 1s ease-in-out; transform-box: fill-box; transform-origin: center; }
.fg.blinked .eye { transform: scaleY(0.1); transform-box: fill-box; transform-origin: center; }
@keyframes fg-alarm { 0%, 100% { transform: rotate(0); } 5%, 15%, 25%, 35%, 45%, 55%, 65% { transform: rotate(-5deg) translateY(-2px); } 10%, 20%, 30%, 40%, 50%, 60%, 70% { transform: rotate(5deg) translateY(-2px); } 80% { transform: rotate(0); } }
@keyframes fg-clang { 0%, 100% { transform: rotate(0); } 10%, 30%, 50%, 70% { transform: rotate(-20deg); } 20%, 40%, 60% { transform: rotate(20deg); } 80% { transform: rotate(0); } }
@keyframes fg-peek { 0% { transform: translateY(70px); } 18%, 70% { transform: translateY(34px); } 80% { transform: translateY(-6px); } 90% { transform: translateY(2px); } 100% { transform: translateY(0); } }
@keyframes fg-peekeyes { 0%, 30% { transform: translate(0, -3px); } 38%, 48% { transform: translate(-4px, -3px); } 56%, 66% { transform: translate(4px, -3px); } 72%, 100% { transform: translate(0, 0); } }
@keyframes fg-spin { to { transform: rotate(360deg); } }
@keyframes fg-flip { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }
/* Focus layout (shell/focus_layout.html): no sidebar for onboarding and wizards; centered column. */
.focus { min-height: 100vh; display: flex; flex-direction: column; background: var(--color-bg-subtle); }
.focus-top { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-6); }
.focus-top .side-brand { flex: none; }
.focus-top .spacer { flex: 1; }
.focus-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-12); }
@media (max-width: 720px) { .focus-top { padding: var(--space-3) var(--space-4); } }

.neworg > .wiz-q:first-child { border-top: 0; padding-top: 0; }
/* Input widths that fit the expected content (R2 field(size=…) or class="input size-…"). */
.input.size-s { width: 100%; max-width: 12rem; }
.input.size-m, .select.size-m { width: 100%; max-width: 28rem; }
.input.size-l { width: 100%; max-width: none; }
/* Focus layout column widths (render_page(..., mode="focus", width=…)): question, field and buttons follow it. */
.focus-main.focus-narrow { max-width: 32rem; }
/* One column, one width: in a narrow focus step or a dialog the text, the fields and the actions row line up on
   both edges. The column is already narrow, so a field fills it (size-s stays short: codes and times). */
.focus-main.focus-narrow .input.size-m, .focus-main.focus-narrow .input.size-l,
.dialog .input:not(.size-s):not([type="checkbox"]):not([type="radio"]), .dialog .select:not(.select-sm) { width: 100%; max-width: none; }
.focus-main.focus-normal { max-width: 48rem; }

/* --- integration I2: top-bar org switcher, stacked centered actions, members from meeting invitations --- */
.topbar .btn { flex: none; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.top-actions:empty { display: none; }
.top-org-wrap { position: relative; flex: none; }
.top-org { display: flex; align-items: center; gap: var(--space-2); max-width: 16rem; padding: var(--space-1) var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-raised); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text); cursor: pointer; }
.top-org:hover { background: var(--color-bg-subtle); }
.top-org .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-org .dd { width: 14px; height: 14px; color: var(--color-text-muted); transform: rotate(90deg); flex: none; }
.top-org-wrap .org-menu { left: auto; right: 0; top: calc(100% + var(--space-1)); min-width: 260px; }
.org-tile.add .icon { width: 14px; height: 14px; }
.pop .opt > span.org-tile { flex: none; }
@media (max-width: 640px) { .top-org .n { display: none; } }

/* Centered states stack their actions: primary button, then a quiet link below (guidelines §2). */
.empty .actions { flex-direction: column; }
.empty .actions-quiet { margin: 0; font-size: var(--text-sm); }
.empty .quiet { color: var(--color-text-muted); }
.empty-lg { max-width: 520px; margin: 0 auto; padding: var(--space-10) var(--space-4); gap: var(--space-4); }
.empty-lg .fig-slot { width: 120px; }
.empty-lg h1 { font-size: var(--text-3xl); letter-spacing: -0.02em; margin: 0; }
.empty-lg p { font-size: var(--text-base); max-width: 46ch; line-height: var(--leading-normal); }
.empty-lg .actions { width: min(340px, 100%); }
.empty-lg .actions .btn { width: 100%; justify-content: center; margin-top: 0; }

.guest-offer { display: flex; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-bg-subtle); text-align: left; }
.guest-offer .txt { flex: 1; min-width: 14rem; display: flex; flex-direction: column; gap: var(--space-1); }
.guest-offer .txt span { color: var(--color-text-secondary); font-size: var(--text-sm); }
.guest-offer form { margin-left: auto; display: flex; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; }
.guest-offer form .field { margin: 0; }
.guest-propose { display: flex; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); }
.guest-propose .field { margin: 0; }
.guest-meeting { padding-bottom: var(--space-10); }
.guest-meeting .eyebrow { margin: 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
.guest-meeting h1 { font-size: var(--text-3xl); letter-spacing: -0.02em; margin: var(--space-1) 0 var(--space-2); }
.guest-meeting h2 { font-size: var(--text-lg); margin: var(--space-6) 0 var(--space-2); }
.guest-facts { line-height: var(--leading-normal); }
.guest-agenda { margin: 0; padding-left: var(--space-6); line-height: var(--leading-normal); }
.guest-people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.guest-people li { display: flex; align-items: center; gap: var(--space-2); }
.guest-list { width: 100%; list-style: none; margin: 0; padding: 0; text-align: left; border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.guest-list li + li { border-top: 1px solid var(--color-border); }
.guest-list a { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); color: var(--color-text); }
.guest-list a:hover { background: var(--color-bg-subtle); text-decoration: none; }
.guest-list .d { color: var(--color-text-secondary); font-size: var(--text-sm); white-space: nowrap; }

/* --- bulk export (E): app/web/templates/export/ --- */
.bulk-lead { margin: 0; color: var(--color-text-secondary); max-width: 40rem; }
.bulk-form { display: flex; flex-direction: column; gap: var(--space-5); }
.bulk-form .field { margin: 0; }
.bulk-dates { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.bulk-form .bulk-scope { max-width: 28rem; }
.bulk-dates[hidden] { display: none; }
.bulk-estimate { margin: 0; min-height: 1.5em; font-weight: var(--weight-medium); }
.bulk-estimate.is-problem { color: var(--color-danger); }
.bulk-note { margin: 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
.bulk-list .set-row { padding-left: var(--space-2); padding-right: var(--space-2); }
.bulk-progress { display: block; width: 100%; max-width: 20rem; height: 6px; margin-top: var(--space-2); accent-color: var(--color-primary); }
.bulk-page-form .form-foot { margin-top: var(--space-6); }

/* --- archive (A): books of scanned pages, the page viewer, Administration → Arkiv (app/archive) --- */
.arch-head { margin-bottom: var(--space-6); }
.arch-head h1 { font-size: var(--text-2xl); font-weight: var(--weight-semibold); margin: 0; }
.arch-lead { color: var(--color-text-secondary); margin: var(--space-1) 0 0; }
.arch-desc { margin: var(--space-2) 0 0; max-width: 48rem; }
.arch-books { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: var(--space-6) var(--space-5); }
.arch-book-card { display: flex; flex-direction: column; gap: var(--space-1); color: var(--color-text); text-decoration: none; }
.arch-cover { aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-md); background: var(--color-bg-subtle); border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); color: var(--color-text-muted); transition: box-shadow var(--transition-fast), transform var(--transition-fast); }
.arch-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.arch-cover .icon { width: 40px; height: 40px; }
.arch-book-card:hover .arch-cover, .arch-book-card:focus-visible .arch-cover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.arch-book-card:focus-visible { outline: none; }
.arch-book-card:focus-visible .arch-cover { outline: 2px solid var(--color-border-focus); outline-offset: 2px; }
.arch-book-t { font-weight: var(--weight-medium); margin-top: var(--space-2); }
.arch-book-s { font-size: var(--text-xs); color: var(--color-text-muted); }
.arch-empty-action { display: flex; justify-content: center; }
.arch-years { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.arch-note { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); border-radius: var(--radius-md); background: var(--color-bg-subtle); }
.arch-note > div { flex: 1; min-width: 0; }
.arch-note p { margin: var(--space-1) 0 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
.arch-note .icon { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.arch-note.is-error { background: var(--color-danger-subtle); }
.arch-note.is-error .icon { color: var(--color-danger); }
.arch-drop { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; padding: var(--space-10) var(--space-6); border: 2px dashed var(--color-border-strong); border-radius: var(--radius-lg); }
.arch-drop .mk { width: 84px; margin-bottom: var(--space-2); }
.arch-drop p { margin: 0; color: var(--color-text-secondary); }
.arch-drop.is-over { border-color: var(--color-primary); background: var(--color-primary-subtle); }
.arch-drop.is-busy { opacity: .6; pointer-events: none; }
.arch-file-btn { margin-top: var(--space-2); cursor: pointer; }
.arch-file-btn:focus-within { outline: 2px solid var(--color-border-focus); outline-offset: 2px; }
/* the viewer: the scan is the main document, the text beside it (below it on narrow screens) */
.arch-viewer { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--space-6); align-items: start; }
.arch-stage { display: flex; flex-direction: column; min-width: 0; border-radius: var(--radius-lg); background: var(--color-bg-subtle); border: 1px solid var(--color-border); overflow: hidden; }
.arch-bar { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); background: var(--color-bg-raised); }
.arch-bar .spacer { flex: 1; }
.arch-bar .is-disabled { opacity: .35; pointer-events: none; }
.arch-flip { transform: scaleX(-1); }
.arch-pos { font-size: var(--text-sm); font-variant-numeric: tabular-nums; padding: 0 var(--space-2); white-space: nowrap; }
.arch-zoom { display: inline-flex; align-items: center; }
.arch-zoom .icon-btn { font-size: var(--text-lg); line-height: 1; }
.arch-zoom-level { min-width: 4rem; font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.arch-canvas { height: calc(100vh - 19rem); min-height: 22rem; overflow: auto; display: flex; padding: var(--space-4); touch-action: pan-x pan-y pinch-zoom; }
.arch-canvas:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px; }
.arch-img { display: block; margin: auto; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: var(--color-bg); box-shadow: var(--shadow-md); user-select: none; -webkit-user-drag: none; }
.arch-canvas.is-zoomed { cursor: grab; }
.arch-canvas.is-zoomed .arch-img { max-width: none; max-height: none; flex-shrink: 0; margin: 0 auto; }
.arch-canvas.is-dragging { cursor: grabbing; }
.arch-side { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.arch-side-head { display: flex; align-items: center; gap: var(--space-2); }
.arch-side-head h2, .arch-side-head h3 { font-size: var(--text-base); font-weight: var(--weight-semibold); margin: 0; }
.arch-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: var(--leading-normal); max-height: 50vh; overflow: auto; }
.arch-muted { color: var(--color-text-muted); margin: 0; }
.arch-side .help { margin: 0; }
.arch-side-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.arch-side-actions form { display: contents; }
.arch-proposal { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--color-border); }
.arch-prop-t { margin: 0; font-weight: var(--weight-medium); }
.arch-prop-items { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-1); }
.arch-prop-d { display: block; color: var(--color-text-secondary); font-size: var(--text-sm); }
.arch-prop-n { display: block; font-size: var(--text-sm); white-space: pre-line; }
.arch-prop-people { font-size: var(--text-sm); color: var(--color-text-secondary); white-space: pre-line; margin: var(--space-2) 0; }
.arch-prop-foot { display: flex; align-items: center; gap: var(--space-2); }
.arch-prop-foot .spacer { flex: 1; }
.arch-textarea { min-height: 20rem; font-family: var(--font-sans); line-height: var(--leading-normal); }
.arch-thumbs { position: relative; display: flex; gap: var(--space-2); overflow-x: auto; padding: var(--space-4) var(--space-1) var(--space-2); margin-top: var(--space-4); scrollbar-width: thin; }
.arch-thumb { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: var(--space-1); width: 4.5rem; color: var(--color-text-secondary); text-decoration: none; font-size: var(--text-xs); }
.arch-thumb img { width: 100%; height: 6rem; object-fit: cover; object-position: top; border-radius: var(--radius-sm); border: 1px solid var(--color-border); background: var(--color-bg-subtle); }
.arch-thumb[aria-current="page"] { color: var(--color-text); font-weight: var(--weight-semibold); }
.arch-thumb[aria-current="page"] img { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.arch-thumb:hover img { border-color: var(--color-border-strong); }
.arch-dot { display: inline-block; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--color-warning); vertical-align: middle; }
@media (max-width: 900px) {
  .arch-viewer { grid-template-columns: minmax(0, 1fr); }
  .arch-canvas { height: 70vh; padding: var(--space-2); }
}
@media (max-width: 600px) {
  .arch-zoom, .arch-bar .arch-open { display: none; } /* phones zoom with two fingers */
  .arch-bar { padding: var(--space-1) var(--space-2); }
}

/* --- track X: access in a meeting, guests, public meetings and public links --- */
.public-page { background: var(--color-bg); }
.public-page .side-brand { color: var(--color-text); font-weight: var(--weight-semibold); }
.public-foot { text-align: center; padding: var(--space-6) var(--space-4) var(--space-10); color: var(--color-text-muted); font-size: var(--text-sm); }
.public-meeting .eyebrow { margin: 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
.public-meeting h1, .public-org h1 { font-size: var(--text-3xl); letter-spacing: -0.02em; margin: var(--space-1) 0 var(--space-2); }
.public-meeting h2 { font-size: var(--text-lg); margin: var(--space-10) 0 var(--space-3); }
.public-facts { line-height: var(--leading-normal); margin: 0; }
.public-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-8); }
.public-item-head { display: flex; align-items: center; gap: var(--space-2); font-weight: var(--weight-semibold); font-size: var(--text-lg); }
.public-item .note { margin-top: var(--space-2); line-height: var(--leading-normal); }
.public-item.is-confidential .public-item-head { font-weight: var(--weight-normal); font-size: var(--text-base); color: var(--color-text-secondary); }
.confidential-label { display: inline-flex; align-items: center; gap: var(--space-2); }
.public-tasks { margin: var(--space-2) 0 0; padding-left: var(--space-6); }
.public-tasks li[data-done] { text-decoration: line-through; color: var(--color-text-muted); }
.public-tasks .who { font-weight: var(--weight-semibold); }
.public-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.public-files a { display: inline-flex; align-items: center; gap: var(--space-2); }
.public-back { margin: 0 0 var(--space-4); }
.public-back a { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); }
.public-back .icon { transform: rotate(180deg); }
.public-until { margin-top: var(--space-10); font-size: var(--text-sm); }
.public-search { display: flex; gap: var(--space-2); margin: var(--space-4) 0 var(--space-6); flex-wrap: wrap; }
.public-list .t { min-width: 0; }
.share-sec + .share-sec { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--color-border); }
.share-sec h3 { margin: 0 0 var(--space-1); font-size: var(--text-base); }
.share-link { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-3) 0; }
.share-link .input { flex: 1; min-width: 12rem; }
.share-link .hint { flex-basis: 100%; margin: 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
.share-link form { flex-basis: 100%; }
.share-new { display: flex; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }
.share-new .field { margin: 0; }
.check-list { display: flex; flex-direction: column; gap: var(--space-2); border: 0; padding: 0; margin: 0 0 var(--space-4); }
.check > span > .s { display: block; font-size: var(--text-xs); color: var(--color-text-secondary); }
.btn-link.is-danger { color: var(--color-danger); }

/* --- track S: shell, shared lists, personal settings --- */
/* Profile row in Settings: the person's avatar (same look as the account menu button). */
.set-add .set-more > summary.btn-link { font-size: var(--text-sm); }
/* Account menu: «Nedlastinger» with the export.ready count on the right; the avatar gets a dot (same counter). */
.menu-item > .nbadge { margin-left: auto; }
.avatar-menu > summary.has-badge > .nbadge.is-dot { top: -1px; right: -1px; box-shadow: 0 0 0 2px var(--color-bg-raised); }
/* Catalogue: an option list shown open (/dev/components#option_body). */
.pop.cat-pop { position: static; width: min(320px, 100%); }
/* Narrow screens: the top bar must fit (nothing cut off at the right edge, guidelines §19 keeps the org switcher
   there). The switcher shrinks to its tile, the save state to its icon (the text stays for screen readers), the
   gaps tighten, and the switcher menu is never wider than the screen. */
@media (max-width: 640px) {
  .topbar { gap: var(--space-2); }
  .top-org { padding: 2px; gap: 0; border-color: transparent; background: none; }
  .top-org .dd { display: none; }
  .top-org-wrap .org-menu { min-width: 0; width: min(320px, calc(100vw - 2 * var(--space-4))); }
  .topbar .saved-state > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.public-settings fieldset.choice-col { border: 0; padding: 0; margin: 0 0 var(--space-4); min-width: 0; }
.public-settings fieldset legend { padding: 0; margin-bottom: var(--space-2); font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.public-sub { font-size: var(--text-lg); margin: var(--space-10) 0 var(--space-3); }
.public-book-nav { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-4) 0; }
.public-book-page { display: block; max-width: 100%; height: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.public-book-text { white-space: pre-wrap; margin-top: var(--space-4); line-height: var(--leading-normal); }

/* --- dev sign-in page (/dev/login, dev only) --- */
.dev-login { max-width: 32rem; margin: var(--space-12) auto; padding: 0 var(--space-4); }
.dev-login h1 { font-size: var(--text-2xl); margin: 0 0 var(--space-2); }
.dev-login-list { list-style: none; padding: 0; margin: var(--space-6) 0 0; display: flex; flex-direction: column; gap: var(--space-2); }
.dev-login-list a { display: block; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-raised); }

/* Pulse monitoring (Administrasjon → Overvåking, app/integrations/pulse.py) */
.set-sec > h3 { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text-secondary); margin: var(--space-6) 0 var(--space-2); }

/* --- first-run setup (app/setup, templates/setup/setup.html): one question per step, focus layout --- */
.setup-q { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-8); }
.setup-ask { display: flex; align-items: center; gap: var(--space-3); }
.setup-ask .mk { width: 52px; height: 52px; flex: none; }
.setup-ask h1 { font-size: var(--text-xl); margin: 0; }
.setup-ask p { margin: var(--space-1) 0 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
.setup-code { font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.setup-foot { display: flex; flex-direction: row-reverse; align-items: center; gap: var(--space-4); margin-top: var(--space-2); flex-wrap: wrap; }
.setup-foot .spacer { flex: 1; }

/* --- settings subpages (auth/settings.html): sub-navigation left, the page right; on a phone the list first --- */
.content.settings-page, .set.settings-page { max-width: 1040px; padding-top: var(--space-8); }
.settings { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: var(--space-12); align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: var(--space-1); position: sticky; top: var(--space-6); }
.settings-nav-title { font-size: var(--text-xl); margin: 0 0 var(--space-4) var(--space-2); }
.settings-nav .side-link[aria-current="page"] { background: var(--color-bg-subtle); color: var(--color-text); font-weight: var(--weight-medium); }
.settings-body { min-width: 0; max-width: 46rem; display: flex; flex-direction: column; gap: var(--space-8); }
.settings-body .set-sec:first-child { margin-top: 0; }
.settings-back { display: none; align-items: center; gap: var(--space-1); }
.settings-back .icon { transform: rotate(180deg); width: 16px; height: 16px; }
.settings-head h2 { font-size: var(--text-2xl); margin: 0 0 var(--space-2); }
.settings-head p { margin: 0; color: var(--color-text-secondary); }
.set-group { display: flex; flex-direction: column; gap: var(--space-3); }
.set-group > h3, .set-group-head h3 { font-size: var(--text-base); margin: 0; }
.set-group > .set-note { margin: 0 0 var(--space-1); font-size: var(--text-sm); color: var(--color-text-secondary); }
.set-group-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.set-group .set-row { padding: var(--space-4) 0; }
.set-group .set-empty .s { font-size: var(--text-sm); }
.token-form { display: flex; flex-direction: column; gap: var(--space-5); }
.token-form fieldset { margin: 0; }
.token-once-row { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
.token-once-row .token-once { flex: 1; min-width: 0; }
.dialog-foot .btn-done[data-close] { margin-right: 0; margin-left: auto; }
/* one button left (the primary is hidden, e.g. «Lukk» after sending): it IS the primary — on the right, tinted */
.dialog-foot:has(.btn-primary-action[hidden]) .btn-cancel { margin-left: auto; margin-right: 0; background: var(--color-primary-subtle); border-color: var(--color-primary); }
.dialog-foot:has(.btn-primary-action[hidden]) .btn-cancel:hover { background: color-mix(in srgb, var(--color-primary) 25%, var(--color-bg)); }
/* /admin/… (dark admin mode): on a desktop the dark menu is the sub-navigation, so only the title stays here */
@media (min-width: 721px) {
  .admin .settings { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .admin .settings-nav { position: static; }
  .admin .settings-nav .side-link { display: none; }
  .admin .settings-nav-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
}
@media (max-width: 720px) {
  .content.settings-page, .set.settings-page { padding-top: var(--space-4); }
  .settings { display: block; }
  .settings-nav { position: static; }
  .settings-page:not(.is-index) .settings-nav { display: none; }
  .settings-page.is-index .settings-body { display: none; }
  .settings-page:not(.is-index) .settings-back { display: inline-flex; }
  .settings-nav .side-link { padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--color-border); border-radius: 0; }
  .settings-nav .side-link[aria-current="page"] { background: none; }
  .settings-body { gap: var(--space-8); }
}

/* G1 Brreg lookup: a field with its action beside it; the register's answer as a quiet suggestion to accept */
.field-action { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.brreg-found { margin: var(--space-2) 0 var(--space-4); padding: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.brreg-found .t { font-weight: var(--weight-semibold); }
.brreg-found .s { font-size: var(--text-xs); color: var(--color-text-secondary); }
.brreg-found .form-foot { margin-top: var(--space-2); }
[data-brreg-search] { position: relative; }
.neworg-number { margin-top: var(--space-2); }
.neworg-number > summary { list-style: none; cursor: pointer; display: inline-block; }
.neworg-number > summary::-webkit-details-marker { display: none; }
.neworg-number[open] > summary { margin-bottom: var(--space-3); }
/* ---- Årshjul (app/yearwheel): ring + month list; the list is the content and works on phones ---- */
.yw { max-width: 56rem; }
.yw-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.yw-head h1 { font-size: var(--text-2xl); font-weight: var(--weight-semibold); margin: 0; }
.yw-years { display: inline-flex; align-items: center; gap: var(--space-2); }
.yw-prev .icon { transform: rotate(90deg); }
.yw-next .icon { transform: rotate(-90deg); }
.yw-top { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: var(--space-8); align-items: start; margin-bottom: var(--space-10); }
.yw-ring { width: 100%; max-width: 15rem; height: auto; display: block; }
.yw-ring a { cursor: pointer; }
.yw-seg { fill: var(--color-bg-subtle); stroke: none; transition: fill var(--transition-fast); }
.yw-seg.is-open { fill: var(--color-primary-subtle); }
.yw-seg.is-done { fill: var(--color-success-subtle); }
.yw-seg.is-current { fill: var(--color-primary); }
.yw-ring a:hover .yw-seg, .yw-ring a:focus-visible .yw-seg { fill: var(--color-border-strong); }
.yw-seg-label { font-size: 9px; fill: var(--color-text-secondary); pointer-events: none; }
.yw-seg-label.is-current { fill: var(--color-text-on-primary); font-weight: var(--weight-semibold); }
.yw-ring-year { font-size: 18px; font-weight: var(--weight-semibold); fill: var(--color-text); }
.yw-soon h2, .yw-month h2, .yw-history h2 { font-size: var(--text-base); font-weight: var(--weight-semibold); margin: 0 0 var(--space-2); display: flex; align-items: center; gap: var(--space-2); }
.yw-months { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-8); }
.yw-month { scroll-margin-top: var(--space-10); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.yw-month.is-current h2 { color: var(--color-primary); }
.yw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.yw-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-2); border-radius: var(--radius-md); }
.yw-row:hover { background: var(--color-bg-subtle); }
.yw-row-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); column-gap: var(--space-3); color: var(--color-text); text-decoration: none; }
.yw-date { grid-row: span 2; color: var(--color-text-secondary); font-size: var(--text-sm); font-variant-numeric: tabular-nums; padding-top: 1px; }
.yw-t { font-weight: var(--weight-medium); overflow-wrap: anywhere; }
.yw-s { grid-column: 2; font-size: var(--text-xs); color: var(--color-text-secondary); }
.yw-s:empty { display: none; }
.yw-row.is-done .yw-t { color: var(--color-text-secondary); }
.yw-row form { margin: 0; }
.yw-none { color: var(--color-text-muted); font-size: var(--text-sm); margin: 0; }
.yw-starters { max-width: 44rem; margin: var(--space-6) auto 0; }
.yw-starters-foot { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin-top: var(--space-5); }
.yw-more-body { display: grid; gap: var(--space-4); padding-top: var(--space-3); }
.yw-more > summary { margin-top: var(--space-2); }
.yw-resp-text { display: none; margin-top: var(--space-3); }
.yw-resp:has(select option[value="other"]:checked) .yw-resp-text { display: block; }
.yw-check { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-sm); }
.yw-check input { margin-top: 3px; }
.yw-back { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.yw-back a { color: var(--color-text-secondary); }
.yw-facts { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-2); color: var(--color-text-secondary); }
.yw-facts li { display: flex; align-items: center; gap: var(--space-2); }
.yw-facts .icon { width: 16px; height: 16px; color: var(--color-text-muted); }
.yw-desc { max-width: 44rem; white-space: pre-line; margin: 0 0 var(--space-6); }
.yw-next-due { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; padding: var(--space-4); border-radius: var(--radius-lg); background: var(--color-bg-subtle); margin-bottom: var(--space-10); }
.yw-next-due p { margin: 0; }
.yw-history { margin-bottom: var(--space-10); }
.yw-delete { margin: 0; }
@media (max-width: 720px) {
  .yw-top { grid-template-columns: 1fr; gap: var(--space-6); }
  .yw-ring { max-width: 12rem; margin: 0 auto; }
}

/* --- notifications (app/notifications: the bell, its list, «Varsler») --- */
.notif-menu { position: relative; flex: none; }
.notif-menu > summary { list-style: none; }
.notif-menu > summary::-webkit-details-marker { display: none; }
.notif-menu > summary:hover, .notif-menu[open] > summary { background: var(--color-bg-subtle); color: var(--color-text); }
.notif-menu > summary:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px; }
.notif-menu .icon { width: 18px; height: 18px; }
.notif-pop { width: min(360px, calc(100vw - 2 * var(--space-4))); padding: 0; right: 0; }
.notif-pop[aria-busy="true"] { opacity: 0.7; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); }
.notif-head h2 { font-size: var(--text-base); margin: 0; }
.notif-head form { margin: 0; }
.notif-head .btn-link { font-size: var(--text-sm); }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-pop .notif-list { max-height: min(60vh, 28rem); overflow-y: auto; }
.notif-link { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); color: inherit; text-decoration: none; }
.notif-link:hover { background: var(--color-bg-subtle); text-decoration: none; }
.notif-item .ic { width: 28px; height: 28px; flex: none; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--color-bg-subtle); color: var(--color-text-secondary); }
.notif-item .ic .icon { width: 16px; height: 16px; }
.notif-item .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-item.is-unread .t { font-weight: var(--weight-medium); }
.notif-item .s, .notif-item .w { font-size: var(--text-xs); color: var(--color-text-secondary); }
.notif-dot { width: 8px; height: 8px; flex: none; margin-top: var(--space-2); border-radius: var(--radius-full); background: var(--color-primary); }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-6) var(--space-4); text-align: center; color: var(--color-text-secondary); }
.notif-empty p { margin: 0; }
.notif-error { margin: 0; padding: var(--space-4); color: var(--color-text-secondary); }
.notif-foot { border-top: 1px solid var(--color-border); padding: var(--space-1) 0; }
.notif-page { max-width: 44rem; }
.notif-page .notif-list { border-top: 1px solid var(--color-border); }
.notif-page .notif-item { border-bottom: 1px solid var(--color-border); }
.notif-page .notif-link { padding-left: var(--space-2); padding-right: var(--space-2); border-radius: var(--radius-md); }
.notif-page .notif-item .t { white-space: normal; }
.notif-more { margin: var(--space-4) 0 0; }
.notif-more .btn-link { display: inline-flex; align-items: center; gap: var(--space-2); }
.notif-settings { display: flex; flex-direction: column; gap: var(--space-8); }
.notif-table { width: 100%; border-collapse: collapse; }
.notif-table th, .notif-table td { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); text-align: left; font-weight: var(--weight-normal); vertical-align: middle; }
.notif-table thead th { font-size: var(--text-xs); color: var(--color-text-secondary); }
.notif-table thead h3 { margin: 0; font-size: var(--text-base); color: var(--color-text); }
.notif-table .ch { width: 6rem; text-align: center; }
.notif-table td.ch input { margin: 0 auto; }
.notif-settings [data-notif-save][hidden] { display: none; }
.notif-settings .set-row .t, .notif-settings .set-row .s { display: block; }
@media (max-width: 640px) {
  .notif-table .ch { width: 4.5rem; }
  .notif-pop { position: fixed; top: 56px; left: var(--space-4); right: var(--space-4); width: auto; }
}

/* --- calendar subscription (app/calendar: Innstillinger → «Kalender») --- */
.cal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.cal-howto { margin: var(--space-3) 0 0; padding-left: var(--space-5); font-size: var(--text-sm); color: var(--color-text-secondary); display: flex; flex-direction: column; gap: var(--space-1); }
.cal-manage { display: flex; flex-wrap: wrap; gap: var(--space-5); margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--color-border); font-size: var(--text-sm); }

/* ---- P1 everyday use: the meeting's corner (M5), «Slett kladden» (M4), phases (M2), «Nytt møte» (M1), G0 ---- */
/* The title row: the title, and top right who sees the meeting and its ⋯ menu (M5). */
.sheet .m-titlerow { display: flex; align-items: flex-start; gap: var(--space-3); }
.sheet .m-titlerow > .m-title { flex: 1; min-width: 0; }
.m-corner { display: flex; align-items: center; gap: var(--space-1); flex: none; padding-top: var(--space-2); }
.m-corner .access { white-space: nowrap; }
.m-corner .menu-pop { min-width: 280px; }
@media (max-width: 520px) { .m-corner .access .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
/* «Slett kladden»: quiet, at the very bottom of a draft. */
/* «Figuren suggests» (G0): Figuren, one sentence, «Ikke nå» and one action — quiet, on the page's own background. */
.suggestion { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--color-bg-subtle); margin: 0 0 var(--space-6); }
.suggestion .fig-wrap { flex: none; display: grid; place-items: center; }
.suggestion-text { flex: 1; min-width: 0; margin: 0; font-size: var(--text-sm); }
.suggestion-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.suggestion-actions form { margin: 0; }
.m-suggestion:empty { display: none; }
@media (max-width: 640px) {
  .suggestion { flex-wrap: wrap; }
  .suggestion-text { flex-basis: calc(100% - 48px); }
  .suggestion-actions { width: 100%; justify-content: space-between; }
}
/* The «Nytt møte» dialog (M1): the three choices, the series fields when chosen, the templates folded. */
.new-meeting { display: flex; flex-direction: column; gap: var(--space-4); }
.new-meeting .card-opts legend { font-size: var(--text-sm); color: var(--color-text-secondary); margin-bottom: var(--space-2); }
.new-meeting-series { display: flex; flex-direction: column; gap: var(--space-3); }
.new-meeting-series[hidden] { display: none; }
.new-meeting-tpl > summary { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; color: var(--color-text-secondary); font-size: var(--text-sm); list-style: none; }
.new-meeting-tpl > summary::-webkit-details-marker { display: none; }
.new-meeting-tpl > summary .icon { width: 16px; height: 16px; }
.new-meeting-tpl > summary .chev { width: 12px; height: 12px; transform: rotate(90deg); transition: transform var(--transition-fast); }
.new-meeting-tpl[open] > summary .chev { transform: rotate(-90deg); }
.new-meeting-tpl > .opts { margin-top: var(--space-3); }
.card-grid[data-cols="1"] { grid-template-columns: 1fr; }
/* One column: one option layout (guidelines §2 item 6) — icon, the label, the description under the label. */
.card-grid[data-cols="1"] .card-opt { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-3); row-gap: 2px; align-items: start; padding: var(--space-3) var(--space-4); }
.card-grid[data-cols="1"] .card-opt .icon { grid-row: span 2; margin-top: 1px; width: 20px; height: 20px; }
.card-grid[data-cols="1"] .card-opt .d { grid-column: 2; }

/* --- M6/M7/M8: templates, places, participants in one go --- */
/* «Maler»: the ordered list editor in the template dialog (agenda_templates/admin.html). */
.tpl-editor { border: 0; padding: 0; margin: var(--space-4) 0 0; min-width: 0; }
.tpl-editor legend { font-weight: var(--weight-medium); margin-bottom: var(--space-2); padding: 0; }
.tpl-items { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); counter-reset: tpl; }
.tpl-item { display: flex; align-items: center; gap: var(--space-2); counter-increment: tpl; }
.tpl-item .n { width: 1.75em; flex: none; text-align: right; color: var(--color-text-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.tpl-item .n::before { content: counter(tpl) "."; }
.tpl-item .input { flex: 1; min-width: 0; }
.tpl-tools { display: flex; gap: 2px; flex: none; }
.tpl-tools .icon-btn { width: 28px; height: 28px; }
.tpl-tools .icon.is-up { transform: rotate(-90deg); }
.tpl-tools .icon.is-down { transform: rotate(90deg); }
.tpl-item:first-child [data-tpl-move="-1"], .tpl-item:last-child [data-tpl-move="1"] { visibility: hidden; }
/* «Steder»: the default checkbox with its explanation under the label. */
.check-line { display: flex; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-3); cursor: pointer; }
.check-line input { margin-top: 3px; }
.check-line .d { display: block; font-size: var(--text-xs); color: var(--color-text-secondary); }
/* The meeting's location picker: the saved places first, one click each (option layout: icon, name, address under). */
.where-places { display: flex; flex-direction: column; gap: 2px; margin: 0 calc(var(--space-2) * -1); }
.where-place { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-3); row-gap: 2px; align-items: center; text-align: left; border: 0; background: none; color: var(--color-text); font: inherit; padding: var(--space-2); border-radius: var(--radius-sm); cursor: pointer; }
.where-place:hover, .where-place[aria-pressed="true"] { background: var(--color-bg-raised); }
.where-place:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px; }
.where-place .icon { width: 16px; height: 16px; color: var(--color-text-muted); }
.where-place .lbl { font-weight: var(--weight-medium); }
.where-place .d { grid-column: 2; font-size: var(--text-xs); color: var(--color-text-secondary); }
.meta-line .map-link { font-size: var(--text-sm); white-space: nowrap; }

/* Stamdata (app/stamdata): the last upload's counts in the row's dialog. */
.sd-counts { display: grid; grid-template-columns: 1fr max-content; gap: var(--space-1) var(--space-6); margin: 0 0 var(--space-4); font-size: var(--text-sm); }
.sd-counts div { display: contents; }
.sd-counts dt { color: var(--color-text-secondary); }
.sd-counts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* --- One control height (guidelines §2.33): inputs, selects, buttons and segmented controls are the same height,
   so anything placed on one line (a filter row, a field with its button) lines up. Small variants share the small height. */
:root { --control-h: 2.5rem; --control-h-sm: 2rem; }
input.input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select.select, select.input { height: var(--control-h); box-sizing: border-box; }
.btn { min-height: var(--control-h); box-sizing: border-box; }
.btn-small { min-height: var(--control-h-sm); }
select.select-sm, select.input.select-sm { height: var(--control-h-sm); }
.seg { box-sizing: border-box; height: var(--control-h); align-items: stretch; }
.seg a, .seg label { display: inline-flex; align-items: center; }
/* A toolbar row (search, filters, segmented choice, button): every control at the full control height */
.search-form select.select-sm, .search-form .btn-small { height: var(--control-h); min-height: var(--control-h); }

/* --- presentation mode (PR-1..PR-7): the big screen (templates/presentation/present.html) and /vis ---
   Everything grows with the screen so it reads from the back of the room; always light (static/presentation/light.js). */
body.present { margin: 0; background: var(--color-bg); overflow: hidden; }
.pr { --pr-foot-room: calc(var(--space-12) + var(--space-8)); height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--color-bg); color: var(--color-text); font-size: clamp(var(--text-base), 1.25vw, var(--text-2xl)); }
.pr-top { display: flex; align-items: center; gap: var(--space-6); padding: var(--space-4) var(--space-8); border-bottom: 1px solid var(--color-border); }
.pr-meeting { flex: 1; display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.pr-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-when { color: var(--color-text-secondary); font-size: 0.85em; white-space: nowrap; }
.pr-offline { margin: 0; font-size: 0.75em; white-space: nowrap; color: color-mix(in srgb, var(--color-warning) 65%, var(--color-text)); }
.pr-clock { font-variant-numeric: tabular-nums; font-weight: var(--weight-semibold); font-size: 1.2em; }
.pr-body { flex: 1; display: grid; grid-template-columns: minmax(16em, 28%) 1fr; min-height: 0; }
.pr-agenda { border-right: 1px solid var(--color-border); padding: var(--space-6) var(--space-4) var(--pr-foot-room) var(--space-6); overflow-y: auto; background: var(--color-bg-subtle); }
.pr-progress { display: flex; flex-direction: column; gap: var(--space-2); margin: 0 0 var(--space-5); font-size: 0.7em; color: var(--color-text-secondary); }
.pr-progress progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: var(--radius-full); background: var(--color-border); overflow: hidden; }
.pr-progress progress::-webkit-progress-bar { background: var(--color-border); }
.pr-progress progress::-webkit-progress-value { background: var(--color-success); transition: width var(--transition-slow); }
.pr-progress progress::-moz-progress-bar { background: var(--color-success); }
.pr-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.pr-items a { display: flex; align-items: baseline; gap: var(--space-3); padding: var(--space-3); border: 1px solid transparent; border-radius: var(--radius-md); color: var(--color-text-secondary); text-decoration: none; }
.pr-items a:hover { background: var(--color-bg-raised); text-decoration: none; }
.pr-items a:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 1px; }
.pr-items .no { min-width: 3.5em; font-size: 0.8em; font-variant-numeric: tabular-nums; color: var(--color-text-muted); }
.pr-items .no .icon { width: 1.1em; height: 1.1em; color: var(--color-success); vertical-align: -0.15em; }
.pr-items .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pr-items .lk { width: 0.85em; height: 0.85em; margin-right: var(--space-1); vertical-align: -0.05em; color: var(--color-text-muted); }
.pr-items .min { font-size: 0.7em; color: var(--color-text-muted); white-space: nowrap; }
.pr-items .is-done a { color: var(--color-text-muted); }
.pr-items .is-now a { background: var(--color-bg-raised); border-color: var(--color-primary); box-shadow: var(--shadow-md); color: var(--color-text); font-weight: var(--weight-semibold); }
.pr-items .is-now .no { color: var(--color-primary); }
.pr-items .is-next a { color: var(--color-text); }
.pr-items .tag { margin-left: var(--space-2); padding: 0 var(--space-2); border: 1px solid currentColor; border-radius: var(--radius-full); font-size: 0.6em; font-weight: var(--weight-medium); color: var(--color-primary); vertical-align: 0.15em; white-space: nowrap; }
.pr-main { padding: var(--space-10) clamp(var(--space-8), 6vw, var(--space-12)) var(--pr-foot-room); overflow-y: auto; }
.pr-item h1 { margin: var(--space-3) 0 var(--space-8); font-size: 2.4em; line-height: 1.15; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.pr-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-6); margin: 0; font-size: 0.8em; color: var(--color-text-secondary); }
.pr-no { font-variant-numeric: tabular-nums; }
.pr-time { margin-left: auto; font-variant-numeric: tabular-nums; }
/* Over the planned time: calm yellow, never red (PR-5) */
.pr-time.is-over { padding: 0 var(--space-2); border-radius: var(--radius-full); background: var(--color-warning-subtle); color: color-mix(in srgb, var(--color-warning) 65%, var(--color-text)); font-weight: var(--weight-semibold); }
/* The notes as on the meeting page (.note, tasks, decisions), larger */
.pr-content.note { max-width: 46em; margin: 0; padding: 0; font-size: 1.15em; line-height: 1.6; }
.pr-content.note h3 { font-size: 1em; }
.pr-content .task input[type="checkbox"] { font-size: inherit; width: 0.9em; height: 0.9em; margin-top: 0.35em; opacity: 1; cursor: default; }
.pr-content .task .due { font-size: 0.75em; }
.pr-content .decision { margin-top: var(--space-6); }
.pr-content .decision > .icon { width: 1em; height: 1em; }
.pr-content .decision .lbl { font-size: 0.7em; }
.pr-soft { color: var(--color-text-muted); }
.pr-hidden, .pr-empty { height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--color-text-secondary); }
.pr-hidden h1, .pr-empty h1 { margin: var(--space-3) 0; font-size: 2em; color: var(--color-text); }
.pr-hidden p, .pr-empty p { max-width: 30em; margin: 0; }
.pr-hidden .pr-no { margin-top: var(--space-4); color: var(--color-text-muted); }
.pr-lock { width: 3em; height: 3em; color: var(--color-text-muted); }
/* The controls show only while the mouse or the keyboard is used (frontend/presentation puts .awake on body) */
.pr-foot { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-8); border-top: 1px solid var(--color-border); background: color-mix(in srgb, var(--color-bg-raised) 92%, transparent); font-size: var(--text-sm); opacity: 0; transform: translateY(100%); transition: opacity var(--transition-base), transform var(--transition-base); }
.awake .pr-foot, .pr-foot:has(:focus-visible) { opacity: 1; transform: none; }
body.present:not(.awake) { cursor: none; }
.pr-state { display: flex; align-items: baseline; gap: var(--space-3); margin: 0; color: var(--color-text-secondary); white-space: nowrap; }
.pr[data-mode="lead"] .pr-state { display: none; }
.pr-next { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-next .k { color: var(--color-text-muted); }
.pr-buttons, .pr-nav { display: flex; align-items: center; gap: var(--space-2); }
.pr-buttons .btn .icon { width: 16px; height: 16px; }
.pr-foot .menu-pop { top: auto; bottom: calc(100% + var(--space-1)); min-width: 260px; }
/* Who steers decides which controls show: data-mode lead | follow | local */
.pr:not([data-mode="lead"]):not([data-mode="local"]) [data-show="steer"],
.pr:not([data-mode="follow"]) [data-show="follow"],
.pr:not([data-mode="local"]) [data-show="local"] { display: none; }
@media (prefers-reduced-motion: reduce) { .pr-foot, .pr-progress progress::-webkit-progress-value { transition: none; } }
@media (max-width: 720px) {
  .pr { font-size: var(--text-base); }
  .pr-top { flex-wrap: wrap; gap: var(--space-1) var(--space-4); padding: var(--space-3) var(--space-4); }
  .pr-meeting { flex-basis: 100%; }
  .pr-when { display: none; }
  .pr-state { flex-basis: 100%; }
  .pr-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .pr-agenda { max-height: 30vh; padding: var(--space-4); border-right: 0; border-bottom: 1px solid var(--color-border); }
  .pr-main { padding: var(--space-6) var(--space-4) var(--pr-foot-room); }
  .pr-foot { flex-wrap: wrap; padding: var(--space-3) var(--space-4); }
}
/* «Åpne på en annen skjerm …»: the address and the code, large */
.pr-address { margin: var(--space-3) 0 0; text-align: center; font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.pr-code { min-height: 1.3em; margin: var(--space-2) 0 var(--space-4); text-align: center; font-size: var(--text-3xl); font-weight: var(--weight-bold); letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
.pr-revoke { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin: var(--space-4) 0 0; }
/* /vis: the code field, large enough to type on the room's PC (the one-question look of the first-run setup) */
.screen-code { font-size: var(--text-xl); letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }

/* --- «Finn tid» (FT-1, app/timepoll): the poll on the meeting page (times × people), its dialog, the answer page --- */
.tp-slots { list-style: none; margin: 0; padding: 0; }
.tp-slot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding: var(--space-3); border-top: 1px solid var(--color-border); }
.tp-slot:first-child { border-top: 0; }
.tp-slot .when { flex: 1 1 12rem; min-width: 0; }
.tp-slot .when b { font-weight: var(--weight-medium); }
.tp-slot .when > span:not(.s):not(.tp-tag) { color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }
.tp-slot .when .s { display: block; margin-top: 2px; font-size: var(--text-xs); color: var(--color-text-secondary); }
.tp-grid .tp-slot.is-best { background: var(--color-success-subtle); border-radius: var(--radius-md); border-top-color: transparent; }
.tp-grid .tp-slot.is-best + .tp-slot { border-top-color: transparent; }
.tp-tag { display: inline-flex; align-items: center; margin-left: var(--space-1); padding: 0 var(--space-2); border-radius: var(--radius-full); border: 1px solid var(--color-success); background: var(--color-bg); color: var(--color-text); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.tp-missing { margin: calc(var(--space-2) * -1) 0 var(--space-3); }
/* Everyone as an avatar marked with their answer: a solid ring = passer, dashed = om nødvendig, struck = passer ikke,
   a faint dashed circle = not answered (shape as well as colour; the name and answer are the label) */
.tp-people { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.tp-people .av { width: 28px; height: 28px; box-sizing: border-box; border-radius: var(--radius-full); display: grid; place-items: center; font-size: 10px; font-weight: var(--weight-bold); border: 2px solid transparent; background: var(--color-bg-subtle); color: var(--color-text-secondary); cursor: default; }
.tp-people .av.is-yes { border-color: var(--color-success); background: var(--color-success-subtle); color: var(--color-text); }
.tp-people .av.is-maybe { border-color: var(--color-warning); border-style: dashed; background: var(--color-warning-subtle); color: var(--color-text); }
.tp-people .av.is-no { text-decoration: line-through; color: var(--color-text-muted); }
.tp-people .av.is-none { border: 1px dashed var(--color-border-strong); background: transparent; color: var(--color-text-muted); }
.tp-choose { margin: 0; width: 9.5rem; display: flex; justify-content: flex-end; } /* the avatars line up */
.tp-mine { margin-top: var(--space-6); }
.tp-mine > summary { cursor: pointer; font-weight: var(--weight-medium); padding: var(--space-2) 0; }
.tp-answers .tp-slot { padding-inline: 0; flex-wrap: nowrap; }
/* the answer sits beside its time (desktop): the time takes what it needs, the choice keeps its size */
.tp-answers .tp-slot .when { flex: 1 1 auto; min-width: 9rem; }
.tp-answers .tp-slot .seg { flex: none; }
/* «Ditt svar» on the meeting page is compact: the grid above already has the dividers */
.tp-mine .tp-answers .tp-slot { border-top: 0; padding-block: var(--space-1); }
.tp-answers .seg label { white-space: nowrap; }
.tp-answers .seg label:has(input[value="yes"]:checked) { background: var(--color-success-subtle); color: var(--color-text); }
.tp-answers .seg label:has(input[value="maybe"]:checked) { background: var(--color-warning-subtle); color: var(--color-text); }
.tp-answers .seg label:has(input[value="no"]:checked) { background: var(--color-bg-subtle); color: var(--color-text); }
.tp-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }
.tp-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.tp-foot form { margin: 0; }
.tp-foot .btn .icon { width: 16px; height: 16px; }
/* The dialog: one time = one row that never wraps, day | from – to | ✕, with the columns of the meeting's own time
   picker (.when-grid: a 12rem date, 7.5rem times); on a phone the day gets its own line above from – to */
.tp-rows { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.tp-row { display: grid; grid-template-columns: 12rem 7.5rem max-content 7.5rem 2.25rem; justify-content: start; gap: var(--space-2); align-items: center; }
.tp-row[hidden], .tp-dialog [hidden], .tp-mail[hidden] { display: none; }
.tp-dash { color: var(--color-text-muted); }
.tp-add { padding: var(--space-2) 0; }
.tp-to { display: flex; align-items: flex-start; flex-wrap: wrap; gap: var(--space-1) var(--space-2); margin: var(--space-5) 0 0; font-size: var(--text-sm); }
.tp-to .btn-link { margin-left: auto; }
.tp-to .icon { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--color-text-muted); }
.tp-error { margin: var(--space-3) 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-danger-subtle); }
/* The answer page (no sign-in, public layout): one column, the choices under each time on a phone */
.tp-page { max-width: 40rem; margin: 0 auto; }
.tp-page-title { margin: 0 0 var(--space-2); font-size: var(--text-2xl); font-weight: var(--weight-semibold); }
.tp-page .lead { margin: 0 0 var(--space-2); }
.tp-place { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.tp-place .icon, .tp-saved .icon { flex: none; width: 16px; height: 16px; }
.tp-saved { display: flex; align-items: flex-start; gap: var(--space-2); margin: var(--space-4) 0 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-success-subtle); }
.tp-saved .icon { margin-top: 3px; color: var(--color-success); }
.tp-answer-form { margin-top: var(--space-6); }
.tp-decided { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-8) 0; text-align: center; }
.tp-decided .tp-fig { width: 72px; height: 72px; }
@media (max-width: 37.5rem) {  /* below the dialog's 560 px plus its margins */
  .tp-row { grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr) 2.25rem; justify-content: stretch; }
  .tp-row > [data-component="date-field"] { grid-column: 1 / -1; }
  .tp-rows { gap: var(--space-4); }
}
@media (max-width: 34rem) {
  .tp-grid .tp-slot .when { flex-basis: 100%; }
  .tp-grid .tp-choose { width: auto; margin-left: auto; }
  .tp-answers .tp-slot { flex-direction: column; align-items: stretch; }
  .tp-answers .tp-slot .when { flex: none; }
  .tp-answers .seg { width: 100%; }
  .tp-answers .seg label { flex: 1; justify-content: center; padding-inline: var(--space-2); }
  .tp-page .tp-actions { flex-direction: column-reverse; align-items: stretch; }
}

/* --- avatars (app/avatars): components/avatar.html + frontend/lib/avatar.js, the only avatar markup --- */
.av { position: relative; width: 24px; height: 24px; flex: none; display: inline-grid; place-items: center; border-radius: var(--radius-full); background: var(--color-bg-subtle); color: var(--color-text-secondary); font-size: 10px; font-weight: var(--weight-bold); line-height: 1; letter-spacing: 0; text-decoration: none; user-select: none; vertical-align: middle; }
.av:where(:not([data-c])) { border: 1px solid var(--color-border); }
.av[data-c] { background: var(--person-0); color: var(--person-text); }
.av[data-c="1"] { background: var(--person-1); }
.av[data-c="2"] { background: var(--person-2); }
.av[data-c="3"] { background: var(--person-3); }
.av[data-c="4"] { background: var(--person-4); }
.av[data-c="5"] { background: var(--person-5); }
.av[data-c="6"] { background: var(--person-6); }
.av[data-c="7"] { background: var(--person-7); }
/* The photo covers the initials; if it cannot load (alt=""), the initials show through. */
.av > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: var(--color-bg-raised); }
.av-xs { width: 22px; height: 22px; font-size: 9px; }
.av-md { width: 28px; height: 28px; font-size: 11px; }
.av-lg { width: 32px; height: 32px; font-size: var(--text-xs); }
.av-xl { width: 40px; height: 40px; font-size: var(--text-sm); }
.av-xxl { width: 96px; height: 96px; font-size: var(--text-2xl); }
/* The account button (top right) is the person's avatar inside the menu's ring. */
.avatar-menu > summary:has(> .av) { background: none; color: inherit; }
.avatar-menu > summary > .av { width: 100%; height: 100%; }
/* «Profilbilde» (auth/_photo_dialog.html) */
.photo-pick { display: flex; flex-direction: column; gap: var(--space-3); }
.photo-preview { display: flex; justify-content: center; padding: var(--space-2) 0; }
/* A person at the top of their menu (the participant chip): the name, the email muted under it. */
.pop .hd:has(> .hd-sub) { color: var(--color-text); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.pop .hd > .hd-sub { display: block; margin-top: 2px; color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-normal); overflow-wrap: anywhere; }

/* --- Date and time fields (components/datetime.html): type, or the arrow for a calendar / the half hours --- */
/* Short content, short field (guidelines §2.36): a date 12rem, a time 7.5rem — in a grid the cell decides */
.dtf { position: relative; display: inline-flex; width: 12rem; max-width: 100%; }
.dtf-time { width: 7.5rem; }
.when-grid .dtf, .tp-row .dtf { width: 100%; }
/* «Arbeidstid» (admin/_org_general.html): from – to on one line */
.set-sub.work-hours-form { flex-direction: row; align-items: center; gap: var(--space-2); }
.dtf .input { width: 100%; padding-right: calc(var(--control-h) - 4px); }
.dtf-arrow { position: absolute; right: 2px; top: 2px; bottom: 2px; width: calc(var(--control-h) - 8px); display: grid; place-items: center; border: 0; background: none; color: var(--color-text-secondary); border-radius: var(--radius-sm); cursor: pointer; }
.dtf-arrow:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.dtf .input[aria-invalid="true"] { border-color: var(--color-danger); }
.dtf-pop { top: calc(100% + 4px); left: 0; z-index: var(--z-dropdown); }
/* the shared .pop styles make menu buttons full-width rows; the calendar's buttons are cells and arrows */
.dtf-pop button { width: auto; display: inline-grid; place-items: center; padding: 0; }
.dtf-cal-head .icon-btn { width: 2rem; height: 2rem; font-size: var(--text-lg); }
.dtf-cal-head b { white-space: nowrap; }
.dtf-cal-foot .btn-link { padding: 0; }
.dtf-time .dtf-arrow .icon { transform: rotate(90deg); }
.dtf-times { max-height: 15rem; overflow-y: auto; min-width: 10rem; margin: 0; list-style: none; }
.dtf-times li { padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtf-times li:hover, .dtf-times li[aria-selected="true"] { background: var(--color-bg-subtle); }
.dtf-times li[aria-selected="true"] { font-weight: var(--weight-semibold); }
.dtf-cal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-1); }
.dtf-cal-head b { text-transform: capitalize; font-size: var(--text-sm); }
.dtf-cal { display: grid; grid-template-columns: repeat(7, 2.25rem); gap: 2px; padding: var(--space-1); }
.dtf-cal i { font-style: normal; font-size: var(--text-xs); color: var(--color-text-muted); text-align: center; padding: var(--space-1) 0; }
.dtf-cal button { height: 2.25rem; border: 0; background: none; border-radius: var(--radius-full); font: inherit; font-size: var(--text-sm); color: var(--color-text); cursor: pointer; font-variant-numeric: tabular-nums; }
.dtf-cal button:hover { background: var(--color-bg-subtle); }
.dtf-cal button[data-today] { font-weight: var(--weight-bold); color: var(--color-primary); }
.dtf-cal button[aria-pressed="true"] { background: var(--color-primary); color: var(--color-text-inverse); }
.dtf-cal-foot { display: flex; justify-content: flex-start; padding: var(--space-1) var(--space-2) var(--space-2); }

/* The meeting's time panel (meetings/_macros.html): Start and Slutt like Outlook, «Hele dagen», «Gjenta …» */
.when-grid { display: grid; grid-template-columns: 3.5rem minmax(0, 12rem) 7.5rem auto; align-items: center; gap: var(--space-2) var(--space-3); }
.when-l { font-size: var(--text-sm); color: var(--color-text-secondary); }
.when-all-day { font-size: var(--text-sm); }
/* «Hele dagen»: the clock keeps its place (nothing moves), the Slutt row goes */
.when-panel.is-all-day .when-time { visibility: hidden; }
.when-panel.is-all-day .when-end { display: none; }
.when-repeat { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-3); }
.when-repeat label { font-size: var(--text-sm); color: var(--color-text-secondary); }
.when-repeat p { flex-basis: 100%; margin: 0; }
@media (max-width: 560px) { .when-grid { grid-template-columns: 3.5rem 1fr 6.5rem; } .when-all-day { grid-column: 2 / -1; } }

/* --- THE tooltip (frontend/components/tooltip.js): every title / data-tip, shown fast, never the native one --- */
.tooltip { position: fixed; z-index: var(--z-tooltip, 2000); max-width: 18rem; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--color-text); color: var(--color-bg); font-size: var(--text-xs); line-height: 1.4; box-shadow: var(--shadow-md); pointer-events: none; opacity: 0; transition: opacity 120ms ease; }
.tooltip.is-on { opacity: 1; }
.tooltip[hidden] { display: none; }

/* --- «Styre og verv» (G2, app/groups): the groups as rows (the ones under a group indented), a group's roles,
   «På valg», the term dialog and Brønnøysund's board --- */
.gr { width: 100%; max-width: 760px; margin: 0 auto; }
.gr-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.gr-head h1 { font-size: var(--text-2xl); font-weight: var(--weight-semibold); margin: 0; }
.gr-back { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.gr .tabs + .set-sec { margin-top: var(--space-2); }
.gr .tabs + .gr-until { margin-top: var(--space-5); }
.gr-list .set-row[data-depth="1"] { padding-left: var(--space-8); }
.gr-list .set-row[data-depth="2"] { padding-left: calc(var(--space-8) * 2); }
.gr-list .set-row[data-depth="3"] { padding-left: calc(var(--space-8) * 3); }
.gr-facts { margin-bottom: var(--space-8); }
.gr .set-group-head h3 a { color: inherit; text-decoration: none; }
.gr .set-group-head h3 a:hover { text-decoration: underline; }
.gr-compare { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0 0 var(--space-6); font-size: var(--text-sm); color: var(--color-text-secondary); }
.gr-compare[hidden] { display: none; }
.gr-compare .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.gr-compare a { white-space: nowrap; }
.gr-history > summary { margin-top: var(--space-3); }
.gr-history .set-list { margin-top: var(--space-2); }
.gr-until { flex-wrap: wrap; }
.gr-until label { font-size: var(--text-sm); color: var(--color-text-secondary); }
/* the term form: the custom role's name only with «Annet verv» (guidelines §2.30); Fra and Til side by side */
.gr-role { display: flex; flex-direction: column; gap: var(--space-4); }
.gr-role:not(:has(option[value="custom"]:checked)) .gr-role-title { display: none; }
.gr-period { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.gr-period .dtf { width: 100%; }
.gr-more .field { margin-top: var(--space-3); }
@media (max-width: 480px) { .gr-period { grid-template-columns: 1fr; } }
/* Brønnøysund's board in its dialog: a ticked row per person */
.gr-brreg { border: 0; margin: 0; padding: 0; min-width: 0; }
.gr-brreg label.set-row { cursor: pointer; }
.gr-brreg .set-row .t, .gr-brreg .set-row .s { display: block; }
.gr-brreg-h { font-size: var(--text-sm); margin: var(--space-2) 0 0; }
.gr-source { margin: 0; font-size: var(--text-xs); color: var(--color-text-secondary); }

/* --- The map (components/map_picker.html + frontend/components/map_picker.js, guidelines §2 item 46): one point on
   Kartverket's open map. Leaflet's own rules (leaflet/dist/leaflet.css 1.9.4) — only the parts this map uses, in
   tokens (no zoom animation: map_picker.js turns Leaflet's 3D transforms off) — then ours. The map is its own
   stacking context, so Leaflet's z-indexes never reach the top bar. --- */
.map-picker { position: relative; }
.map-box { position: relative; isolation: isolate; z-index: 0; height: 220px; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; background: var(--color-bg-subtle); }
.map-picker.is-sm .map-box { height: 180px; }
.map-picker.is-lg .map-box { height: min(420px, 60vh); }
.map-hint { position: absolute; z-index: 1; top: var(--space-2); left: 50%; transform: translateX(-50%); margin: 0; padding: var(--space-1) var(--space-3); border-radius: var(--radius-md); background: var(--color-bg-raised); color: var(--color-text); box-shadow: var(--shadow-md); font-size: var(--text-xs); white-space: nowrap; pointer-events: none; }
.map-hint[hidden] { display: none; }
.leaflet-pane, .leaflet-tile, .leaflet-marker-icon, .leaflet-tile-container, .leaflet-layer { position: absolute; left: 0; top: 0; }
.leaflet-container { overflow: hidden; -webkit-tap-highlight-color: transparent; font: inherit; font-size: var(--text-xs); line-height: 1.5; }
.leaflet-container:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px; }
.leaflet-tile, .leaflet-marker-icon { user-select: none; -webkit-user-drag: none; }
.leaflet-marker-icon { display: block; }
.leaflet-container .leaflet-tile-pane img, .leaflet-container .leaflet-tile { max-width: none !important; max-height: none !important; width: auto; padding: 0; }
.leaflet-container.leaflet-touch-zoom { touch-action: pan-x pan-y; }
.leaflet-container.leaflet-touch-drag { touch-action: pinch-zoom; }
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { touch-action: none; }
.leaflet-tile { filter: inherit; visibility: hidden; }
.leaflet-tile-loaded { visibility: inherit; }
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-top, .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }
.leaflet-top { top: 0; }
.leaflet-right { right: 0; }
.leaflet-bottom { bottom: 0; }
.leaflet-left { left: 0; }
.leaflet-control { position: relative; z-index: 800; float: left; clear: both; pointer-events: auto; cursor: auto; }
.leaflet-right .leaflet-control { float: right; }
.leaflet-top .leaflet-control { margin-top: var(--space-2); }
.leaflet-left .leaflet-control { margin-left: var(--space-2); }
.leaflet-interactive { cursor: pointer; }
.leaflet-grab { cursor: grab; }
.map-picker[data-edit] .leaflet-container { cursor: crosshair; }
.map-picker[data-edit] .leaflet-marker-draggable { cursor: grab; }
.leaflet-dragging .leaflet-grab, .leaflet-dragging .leaflet-marker-draggable, .map-picker[data-edit] .leaflet-dragging .leaflet-container { cursor: grabbing; }
.leaflet-marker-icon, .leaflet-tile-container { pointer-events: none; }
.leaflet-marker-icon.leaflet-interactive { pointer-events: auto; }
/* zoom: two small buttons, our look (one control height for the small variant) */
.leaflet-bar { display: flex; flex-direction: column; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg-raised); box-shadow: var(--shadow-sm); overflow: hidden; }
.leaflet-bar a { display: grid; place-items: center; width: var(--control-h-sm); height: var(--control-h-sm); color: var(--color-text); font-size: var(--text-lg); line-height: 1; text-decoration: none; }
.leaflet-bar a + a { border-top: 1px solid var(--color-border); }
.leaflet-bar a:hover { background: var(--color-bg-subtle); }
.leaflet-bar a:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px; }
.leaflet-bar a.leaflet-disabled { color: var(--color-text-muted); cursor: default; background: var(--color-bg-raised); }
/* «© Kartverket»: required, small and quiet in the corner */
.leaflet-control-attribution { margin: 0; padding: 0 var(--space-1); border-top-left-radius: var(--radius-sm); background: color-mix(in srgb, var(--color-bg) 80%, transparent); color: var(--color-text-secondary); font-size: var(--text-xs); line-height: 1.5; }
.leaflet-control-attribution a { color: inherit; text-decoration: none; }
.leaflet-control-attribution a:hover, .leaflet-control-attribution a:focus-visible { text-decoration: underline; }
/* the pin: the primary colour with a ring in the page colour, the tip on the point */
.map-pin { background: none; border: 0; }
.map-pin svg { display: block; width: 28px; height: 36px; overflow: visible; filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--color-text) 35%, transparent)); }
.map-pin-body { fill: var(--color-primary); stroke: var(--color-bg); stroke-width: 2; }
.map-pin-dot { fill: var(--color-bg); }
.map-pin:focus-visible { outline: none; }
.map-pin:focus-visible .map-pin-body { stroke: var(--color-border-focus); stroke-width: 3; }
/* dark theme: the grey map turned dark (roads light), the pin stays as it is */
:root[data-theme="dark"] .map-box .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9); }
/* «Steder»: the map under the address; «Marker i kartet» / «Fjern fra kartet» quiet under it */
.place-map { display: flex; flex-direction: column; gap: var(--space-2); }
.place-map[hidden], .place-map [hidden] { display: none; }
.place-map .btn-link { align-self: flex-start; font-size: var(--text-sm); }
/* the meeting's place panel: the map under the choices, the actions in the panel's foot */
.where-map { margin-top: var(--space-1); }
/* the component catalogue (/dev/components): two maps side by side */
.cat-box:has(> .map-picker) { flex: 1 1 280px; }
/* the map dialog: the address and «Åpne i OpenStreetMap» under the map */
.map-where { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-4); font-size: var(--text-sm); }
.map-where .s { color: var(--color-text-secondary); }
.map-where a { white-space: nowrap; }

/* --- the landing page (pages/landing.html, frontend/landing/main.js, guidelines §2.47). The figure's teal is the
   accent; actions stay the primary blue. Sections: top bar, hero (typed word, picture, example meeting, chip, the
   figure), «Laget for», features, one picture section, three steps, privacy + «Om denne tjenesten», the last call. */
.lp { --lp-teal: var(--fig-page); --lp-teal-subtle: #e7f3f1; --lp-wrap: 72rem; --lp-gutter: var(--space-4); background: var(--color-bg); font-size: var(--text-base); }
:root[data-theme="dark"] .lp { --lp-teal: #5eb8ac; --lp-teal-subtle: #10302d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lp { --lp-teal: #5eb8ac; --lp-teal-subtle: #10302d; } }
@media (min-width: 640px) { .lp { --lp-gutter: var(--space-6); } }
.lp-wrap { width: 100%; max-width: var(--lp-wrap); margin: 0 auto; padding: 0 var(--lp-gutter); box-sizing: border-box; }
.lp h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
.lp h3 { font-size: var(--text-base); margin: 0; }
.lp p { margin: 0; }
.lp-eyebrow { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--lp-teal); }
.lp-btn-lg { padding: var(--space-3) var(--space-5); font-size: var(--text-base); border-radius: var(--radius-lg); }
.lp-btn-quiet { border-color: transparent; background: transparent; }
.lp-btn-quiet:hover { background: var(--color-bg-subtle); }
.lp-ic { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: var(--radius-lg); background: var(--lp-teal-subtle); color: var(--lp-teal); }
.lp-ic .icon { width: 20px; height: 20px; }

/* top bar */
.lp-top { position: sticky; top: 0; z-index: var(--z-sticky, 20); background: color-mix(in srgb, var(--color-bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color var(--transition-base); }
.lp-top.is-scrolled { border-bottom-color: var(--color-border); }
.lp-top-in { display: flex; align-items: center; gap: var(--space-6); height: 64px; }
.lp-brand { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: var(--weight-bold); font-size: var(--text-lg); color: var(--color-text); }
.lp-brand:hover { text-decoration: none; }
.lp-brand .brand-fig { width: 28px; height: 28px; flex: none; overflow: visible; }
.lp-nav { display: flex; gap: var(--space-5); flex: 1; }
.lp-nav a { color: var(--color-text-secondary); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.lp-nav a:hover { color: var(--color-text); text-decoration: none; }
.lp-top-act { display: flex; gap: var(--space-2); margin-left: auto; }
@media (max-width: 820px) { .lp-nav { display: none; } }
@media (max-width: 420px) { .lp-top-in { gap: var(--space-3); } .lp-top-act .lp-btn-quiet { padding-inline: var(--space-2); } }

/* hero */
.lp-hero { position: relative; overflow: hidden; padding: var(--space-12) 0 calc(var(--space-12) * 1.5); }
.lp-hero::before { content: ""; position: absolute; inset: -20% -10% auto 40%; height: 120%; background: radial-gradient(closest-side, var(--lp-teal-subtle), transparent 70%); pointer-events: none; }
.lp-hero-in { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--space-12); align-items: center; }
.lp-hero-text { display: flex; flex-direction: column; gap: var(--space-5); }
.lp-title { display: flex; flex-direction: column; margin: 0; font-size: clamp(2.1rem, 5.2vw, 3.5rem); line-height: 1.08; letter-spacing: -0.03em; }
.lp-type { color: var(--lp-teal); white-space: nowrap; min-height: 1.08em; }
.lp-caret { display: inline-block; width: 0.06em; min-width: 3px; height: 0.9em; margin-left: 0.06em; vertical-align: -0.06em; background: currentColor; border-radius: 2px; animation: lp-caret 1s steps(1) infinite; }
.lp-type.is-typing .lp-caret { animation: none; } /* solid while it types, like a real caret */
@keyframes lp-caret { 50% { opacity: 0; } }
.lp-lead { font-size: var(--text-lg); line-height: 1.55; color: var(--color-text-secondary); max-width: 34rem; }
.lp-cta { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.lp-visual { position: relative; padding: var(--space-6) var(--space-6) var(--space-10) var(--space-8); }
.lp-photo { position: relative; aspect-ratio: 5 / 4; border-radius: 20px; overflow: hidden; background: var(--color-bg-subtle); box-shadow: var(--shadow-lg); }
.lp-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity 0.9s ease, transform 6s ease-out; }
.lp-photo img.is-on { opacity: 1; transform: scale(1); }
.lp-card { position: absolute; left: 0; bottom: 0; width: min(290px, 70%); padding: var(--space-4); border-radius: var(--radius-xl); background: var(--color-bg-raised); border: 1px solid var(--color-border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: var(--space-3); font-size: var(--text-sm); transition: opacity 0.25s, transform 0.25s; }
.lp-card.is-changing { opacity: 0; transform: translateY(6px); }
.lp-card-head { display: flex; gap: var(--space-3); align-items: flex-start; }
.lp-card-head b { display: block; font-size: var(--text-base); }
.lp-card-head span:not(.lp-card-state) { color: var(--color-text-muted); font-size: var(--text-xs); }
.lp-card-state { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; border: 2px solid var(--color-primary); flex: none; box-sizing: border-box; } /* «Kommende», like the state circle */
.lp-card-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.lp-card-items li { display: flex; gap: var(--space-2); padding: var(--space-1) 0; border-top: 1px solid var(--color-border); color: var(--color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-card-items .n { min-width: 3.2em; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.lp-card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.lp-avs { display: flex; }
.lp-avs .av { margin-right: -1px; box-shadow: 0 0 0 2px var(--color-bg-raised); }
.lp-avs .lp-more { font-size: 10px; }
.lp-badge { padding: 2px var(--space-2); border-radius: var(--radius-full); background: var(--color-success-subtle); color: var(--color-success); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.lp-chip { position: absolute; top: var(--space-2); right: 0; display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-full); background: var(--color-bg-raised); border: 1px solid var(--color-border); box-shadow: var(--shadow-md); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--color-text); }
.lp-chip .icon { color: var(--lp-teal); }
/* the figure peeks over the picture's top-left corner; its eyes follow the pointer (components/follow.js) */
.lp-fig { position: absolute; top: -14px; left: -4px; width: 104px; height: 104px; cursor: pointer; }
.lp-fig .mk { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 10px rgb(15 118 110 / 0.25)); }
@media (max-width: 900px) {
  .lp-hero { padding-top: var(--space-8); }
  .lp-hero-in { grid-template-columns: 1fr; gap: var(--space-8); }
  .lp-visual { padding: var(--space-5) 0 var(--space-12) var(--space-4); max-width: 560px; }
  .lp-fig { width: 80px; height: 80px; top: -10px; left: -8px; }
}
@media (max-width: 480px) {
  .lp-visual { padding-bottom: 0; }
  .lp-card { position: relative; width: auto; max-width: 300px; margin: -48px 0 0 var(--space-3); } /* under the picture, not over it */
  .lp-chip { display: none; }
  .lp-cta .btn { flex: 1 1 100%; }
}

/* «Laget for» */
.lp-for { border-block: 1px solid var(--color-border); background: var(--color-bg-subtle); }
.lp-for .lp-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); padding-block: var(--space-5); }
.lp-for p { font-size: var(--text-sm); color: var(--color-text-muted); }
.lp-for ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.lp-for li { font-weight: var(--weight-semibold); color: var(--color-text-secondary); }

/* sections */
.lp-sec { padding: calc(var(--space-12) * 1.5) 0; scroll-margin-top: 64px; }
.lp-sec-head { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; max-width: 40rem; margin: 0 auto var(--space-10); }
.lp-sec-head > p:last-child:not(.lp-eyebrow) { color: var(--color-text-secondary); font-size: var(--text-lg); }
.lp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.lp-feat { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); border: 1px solid var(--color-border); border-radius: var(--radius-xl); background: var(--color-bg-raised); transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base); }
.lp-feat:hover { border-color: color-mix(in srgb, var(--lp-teal) 40%, var(--color-border)); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lp-feat p { color: var(--color-text-secondary); line-height: 1.55; }
@media (max-width: 900px) { .lp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .lp-grid { grid-template-columns: 1fr; } }
.lp-split-sec { background: var(--color-bg-subtle); }
.lp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-12); align-items: center; }
.lp-split-img { margin: 0; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4 / 3; }
.lp-split-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-split-text { display: flex; flex-direction: column; gap: var(--space-4); }
.lp-split-text > p:not(.lp-eyebrow) { color: var(--color-text-secondary); font-size: var(--text-lg); line-height: 1.55; }
.lp-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.lp-checks li { display: flex; gap: var(--space-3); align-items: center; font-weight: var(--weight-medium); }
.lp-checks .icon { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--lp-teal); color: #fff; box-sizing: border-box; }
@media (max-width: 900px) { .lp-split { grid-template-columns: 1fr; gap: var(--space-8); } }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.lp-steps li { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6); border-radius: var(--radius-xl); background: var(--color-bg-subtle); }
.lp-steps p { color: var(--color-text-secondary); line-height: 1.55; }
.lp-step-n { width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: var(--space-2); border-radius: 50%; background: var(--color-primary); color: var(--color-text-on-primary); font-weight: var(--weight-bold); }
@media (max-width: 760px) { .lp-steps { grid-template-columns: 1fr; } }

/* privacy: what Møtebok always does, and «Om denne tjenesten» from the instance settings */
.lp-privacy { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-12); align-items: start; }
.lp-privacy.lp-privacy-solo { grid-template-columns: 1fr; }
.lp-privacy > div { display: flex; flex-direction: column; gap: var(--space-4); }
.lp-facts { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
.lp-facts li { display: flex; gap: var(--space-4); }
.lp-facts h3 { margin-bottom: var(--space-1); }
.lp-facts p { color: var(--color-text-secondary); line-height: 1.55; font-size: var(--text-sm); }
.lp-host { padding: var(--space-6); border: 1px solid var(--color-border); border-radius: var(--radius-xl); background: var(--color-bg-raised); display: flex; flex-direction: column; gap: var(--space-4); }
.lp-host dl { margin: 0; display: flex; flex-direction: column; }
.lp-host dl > div { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--color-border); font-size: var(--text-sm); }
.lp-host dt { color: var(--color-text-muted); }
.lp-host dd { margin: 0; font-weight: var(--weight-medium); text-align: right; overflow-wrap: anywhere; }
.lp-host-link { align-self: flex-start; }
@media (max-width: 900px) { .lp-privacy { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .lp-facts { grid-template-columns: 1fr; } }

/* the last call and the footer */
.lp-end { padding: 0 0 calc(var(--space-12) * 1.5); }
.lp-end-in { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); text-align: center; padding: var(--space-12) var(--lp-gutter); border-radius: 28px; background: linear-gradient(135deg, var(--lp-teal-subtle), color-mix(in srgb, var(--color-primary-subtle) 70%, var(--color-bg))); }
.lp-end-in > p { color: var(--color-text-secondary); font-size: var(--text-lg); max-width: 32rem; }
.lp-end-fig { width: 72px; height: 72px; }
.lp-end-fig .mk { width: 100%; height: 100%; overflow: visible; }
.lp-end .lp-cta { justify-content: center; }
.lp-foot { border-top: 1px solid var(--color-border); }
.lp-foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); padding-block: var(--space-6); font-size: var(--text-sm); color: var(--color-text-muted); }
.lp-foot .lp-brand { font-size: var(--text-base); }
.lp-foot .lp-brand .brand-fig { width: 24px; height: 24px; }
.lp-foot nav { display: flex; gap: var(--space-5); margin-left: auto; }
.lp-foot nav a { color: var(--color-text-secondary); }
.lp-credit { width: 100%; font-size: var(--text-xs); }
@media (max-width: 600px) { .lp-foot nav { margin-left: 0; width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .lp-caret { animation: none; }
  .lp-photo img, .lp-card, .lp-feat { transition: none; }
  .lp-photo img { transform: none; }
  .lp-feat:hover { transform: none; }
}
