/* ==========================================================================
   Grytevakt v2 – shared stylesheet: tokens, base, buttons, forms, notices, cards, status words.
   Linked on every page. Public pages add /css/public.css; the admin adds /css/admin.css and the
   lane sheets (admin-daily, admin-setup, admin-account). Lane 0 split, 1 Dec 2026.
   Three token tiers, the Designsystemet way:
     1. seeds per organisation (concepts/v2/tools/theme.mjs)
     2. generated scales  --ds-color-<name>-<step>
     3. Grytevakt aliases --gv-*  (the only names components read)
   Locked for every organisation: type scale, spacing, target sizes, focus ring,
   motion, status colours and words, layout. A theme supplies colours, shape, heading font.
   Colour setup B (CORRECTIONS row 25): ink primary buttons and selected day;
   the brand colour is an accent only (top stripe, links, current-page marker).
   No inline styles: the CSP may block them. Place colours come from .swatch-* classes.
   Icons: Lucide (ISC), /icons.svg. Fonts: Inter 4.1 and Source Serif 4 (SIL OFL 1.1), /fonts.
   ========================================================================== */

@font-face { font-family: "InterVariable"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/InterVariable.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/source-serif-4-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Tier 2 (generated scales and the per-organisation themes) lives in /css/themes.css, linked first. */

/* ---------- Tier 3: aliases and locked tokens ---------- */
:root {
  /* colour roles */
  --gv-page: #ffffff;
  --gv-surface: #ffffff;
  /* Setup B: actions are ink. The brand colour is --gv-accent and never fills a button. */
  --gv-action: var(--ds-color-neutral-text-default);
  --gv-action-hover: color-mix(in srgb, var(--ds-color-neutral-text-default) 82%, #000);
  --gv-action-active: #000;
  --gv-on-action: #fff;
  --gv-accent: var(--ds-color-accent-base-default);
  --gv-link: var(--ds-color-accent-text-subtle);
  --gv-tint: var(--ds-color-accent-background-tinted);
  --gv-panel: var(--ds-color-support-background-tinted);
  --gv-band: var(--ds-color-support-surface-tinted);
  --gv-ink: var(--ds-color-neutral-text-default);
  --gv-muted: var(--ds-color-neutral-text-subtle);
  --gv-quiet: var(--ds-color-neutral-text-quiet);          /* muted but still >= 7:1 */
  --gv-line: var(--ds-color-neutral-border-subtle);         /* decorative */
  --gv-line-strong: var(--ds-color-neutral-border-default); /* identifies a control, >= 3:1 */
  --gv-sunken: var(--ds-color-neutral-surface-tinted);
  --gv-page-admin: var(--ds-color-neutral-background-tinted);
  --gv-focus: var(--ds-color-neutral-text-default);

  /* state roles: fixed status scales, never the brand */
  --gv-free-text: var(--ds-color-success-text-default);
  --gv-free-mark: var(--ds-color-success-border-strong);
  --gv-full-fill: var(--ds-color-neutral-surface-tinted);
  --gv-full-text: var(--ds-color-neutral-text-quiet);
  --gv-soon-mark: var(--ds-color-warning-border-strong);
  --gv-warn-bg: var(--ds-color-warning-background-tinted);
  --gv-warn-line: var(--ds-color-warning-border-default);
  --gv-warn-text: var(--ds-color-warning-text-default);
  --gv-ok-bg: var(--ds-color-success-background-tinted);
  --gv-ok-line: var(--ds-color-success-border-default);
  --gv-ok-text: var(--ds-color-success-text-default);
  --gv-danger-text: var(--ds-color-danger-text-subtle);
  --gv-danger-line: var(--ds-color-danger-border-strong);
  --gv-danger-bg: var(--ds-color-danger-background-tinted);
  --gv-info-bg: var(--ds-color-info-background-tinted);
  --gv-info-line: var(--ds-color-info-border-default);

  /* place swatches: a fixed, pre-checked set; shown only as a dot or a 4 px stripe */
  --gv-place-bla: #1f5fa8;
  --gv-place-plomme: #7a3e9d;
  --gv-place-petrol: #0b6e6e;
  --gv-place-oker: #8f5a00;
  --gv-place-rose: #a3366b;
  --gv-place-indigo: #4b4fb8;
  --gv-place-skifer: #4a5560;
  --gv-place-brun: #7a4a2b;

  /* type */
  --gv-font-body: "InterVariable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gv-fs-h1: 1.875rem;   --gv-lh-h1: 1.2;     /* 30/36 */
  --gv-fs-h2: 1.5rem;     --gv-lh-h2: 1.25;    /* 24/30 */
  --gv-fs-h3: 1.25rem;    --gv-lh-h3: 1.3;     /* 20/26 */
  --gv-fs-lead: 1.25rem;  --gv-lh-lead: 1.4;   /* 20/28 */
  --gv-fs-body: 1.125rem; --gv-lh-body: 1.5;   /* 18/27 */
  --gv-fs-small: 1rem;    --gv-lh-small: 1.5;  /* 16/24, the public floor */
  --gv-fs-time: 1.375rem;                      /* 22 */
  --gv-fs-button: 1.125rem;
  --gv-fs-button-primary: 1.25rem;
  --gv-fs-cal-num: 1.25rem;
  --gv-fs-cal-status: .875rem;                 /* 14 on phones, 16 from 600 px: the one public exception to 16 */

  /* spacing scale 4 8 12 16 24 32 48 64 */
  --gv-s1: .25rem; --gv-s2: .5rem; --gv-s3: .75rem; --gv-s4: 1rem;
  --gv-s5: 1.5rem; --gv-s6: 2rem; --gv-s7: 3rem; --gv-s8: 4rem;
  --gv-gutter: 1rem;
  --gv-measure: 42.5rem;                       /* 680 px text column */

  /* targets */
  --gv-target: 3rem;          /* 48 */
  --gv-target-primary: 3.5rem;/* 56 */
  --gv-target-row: 4rem;      /* 64 */
  --gv-target-admin: 2.75rem; /* 44 */

  /* motion */
  --gv-motion-0: 0ms; --gv-motion-fast: 100ms; --gv-motion-base: 200ms; --gv-motion-slow: 300ms;
  --gv-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --gv-ease-enter: cubic-bezier(0, 0, 0, 1);
  --gv-ease-exit: cubic-bezier(0.3, 0, 1, 1);
}
@media (min-width: 600px) {
  :root {
    --gv-fs-h1: 2.25rem; --gv-fs-h2: 1.75rem; --gv-fs-h3: 1.375rem; --gv-fs-lead: 1.375rem;
    --gv-fs-body: 1.25rem; --gv-fs-small: 1.0625rem; --gv-fs-time: 1.5rem;
    --gv-fs-button: 1.25rem; --gv-fs-cal-num: 1.375rem; --gv-fs-cal-status: 1rem;
    --gv-gutter: 1.5rem;
  }
}
@media (min-width: 840px) { :root { --gv-gutter: 2rem; } }

/* "Større tekst": everything is in rem, so one root change scales the whole page (x 1.17) */
html[data-size="lg"] { font-size: 116.67%; }

@media (prefers-reduced-motion: reduce) {
  :root { --gv-motion-fast: 0ms; --gv-motion-base: 0ms; --gv-motion-slow: 0ms; }
  html { scroll-behavior: auto; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--gv-page); color: var(--gv-ink);
  font-family: var(--gv-font-body); font-size: var(--gv-fs-body); line-height: var(--gv-lh-body);
  font-feature-settings: "cv05", "cv08"; /* l with a tail, I with serifs */
  font-weight: 400;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
h1, .h1 { font-family: var(--gv-font-heading); font-size: var(--gv-fs-h1); line-height: var(--gv-lh-h1); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h2, .h2 { font-family: var(--gv-font-heading); font-size: var(--gv-fs-h2); line-height: var(--gv-lh-h2); font-weight: 600; text-wrap: balance; }
h3, .h3 { font-size: var(--gv-fs-h3); line-height: var(--gv-lh-h3); font-weight: 600; }
a { color: var(--gv-link); text-decoration: underline; text-decoration-thickness: .0938em; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .16em; }
strong, b { font-weight: 600; }
.num, [data-time], time { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.small { font-size: var(--gv-fs-small); line-height: var(--gv-lh-small); }
.muted { color: var(--gv-muted); }
.lead { font-size: var(--gv-fs-lead); line-height: var(--gv-lh-lead); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--gv-focus); outline-offset: 2px; box-shadow: 0 0 0 2px #fff; }

.icon { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 1.25rem; height: 1.25rem; stroke-width: 2.4; }

.wrap { width: 100%; max-width: calc(var(--gv-measure) + 2 * var(--gv-gutter)); margin-inline: auto; padding-inline: var(--gv-gutter); }
.wrap--wide { max-width: 75rem; }
.mt-2 { margin-top: var(--gv-s2); } .mt-3 { margin-top: var(--gv-s3); } .mt-4 { margin-top: var(--gv-s4); } .mt-5 { margin-top: var(--gv-s5); }
[hidden] { display: none !important; }
.stack > * + * { margin-top: var(--gv-s4); }
.stack-lg > * + * { margin-top: var(--gv-s5); }
.section { margin-top: var(--gv-s6); }

.skip { position: absolute; left: var(--gv-s4); top: -6rem; z-index: 10; background: var(--gv-ink); color: #fff; padding: var(--gv-s3) var(--gv-s4); border-radius: var(--gv-radius-control); }
.skip:focus { top: var(--gv-s2); }

/* ---------- Buttons: filled or clearly bounded, never ghost ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--gv-s2);
  min-height: var(--gv-target-primary); padding: var(--gv-s2) var(--gv-s5);
  font: inherit; font-size: var(--gv-fs-button); line-height: 1.25; font-weight: 600; text-align: center;
  color: var(--gv-ink); background: var(--gv-surface);
  border: 2px solid var(--gv-line-strong); border-radius: var(--gv-radius-button);
  box-shadow: 0 2px 0 var(--gv-line);
  text-decoration: none; cursor: pointer;
  transition: background-color var(--gv-motion-fast) var(--gv-ease-standard), border-color var(--gv-motion-fast) var(--gv-ease-standard);
}
.btn:hover { background: var(--gv-sunken); border-color: var(--gv-ink); }
.btn:active { box-shadow: none; transform: translateY(1px); }
.btn--primary {
  font-size: var(--gv-fs-button-primary);
  color: var(--gv-on-action); background: var(--gv-action); border-color: var(--gv-action);
 
  box-shadow: 0 2px 0 var(--gv-action-active);
}
.btn--primary:hover { background: var(--gv-action-hover); border-color: var(--gv-action-hover); }
.btn--danger { color: var(--ds-color-danger-text-default); background: var(--gv-danger-bg); border-color: var(--gv-danger-line); box-shadow: 0 2px 0 var(--ds-color-danger-border-subtle); }
.btn--danger:hover { background: var(--ds-color-danger-surface-tinted); border-color: var(--gv-danger-line); }
.btn--block { display: flex; width: 100%; }
.btn--compact { min-height: var(--gv-target); padding-inline: var(--gv-s4); font-size: var(--gv-fs-small); }
.btn-row { display: flex; flex-direction: column; gap: var(--gv-s3); }
.btn-row--apart { gap: var(--gv-s5); } /* destructive and safe: at least 24 px apart */
@media (min-width: 600px) {
  .btn-row { flex-direction: row; flex-wrap: wrap; }
  .btn-row .btn--block { width: auto; flex: 1 1 14rem; }
}

.done { display: flex; align-items: flex-start; gap: var(--gv-s3); }
.done .icon { width: 2.25rem; height: 2.25rem; color: var(--gv-free-mark); }
main { display: block; padding-block: var(--gv-s5) var(--gv-s6); }
.back { display: inline-flex; align-items: center; gap: var(--gv-s1); min-height: var(--gv-target); margin: calc(-1 * var(--gv-s3)) 0 var(--gv-s2) calc(-1 * var(--gv-s1)); padding-right: var(--gv-s3); color: var(--gv-ink); font-size: var(--gv-fs-small); font-weight: 600; }
/* notice: status colours, always with a word and an icon */
.notice { display: flex; gap: var(--gv-s3); align-items: flex-start; padding: var(--gv-s3) var(--gv-s4); border-radius: var(--gv-radius-control); border: 2px solid var(--gv-info-line); background: var(--gv-info-bg); }
.notice .icon { margin-top: .1em; }
.notice--warn { border-color: var(--gv-warn-line); background: var(--gv-warn-bg); color: var(--gv-warn-text); }
.notice--ok { border-color: var(--gv-ok-line); background: var(--gv-ok-bg); color: var(--gv-ok-text); }
.notice a { color: inherit; font-weight: 600; }
.notice__link { display: inline-flex; align-items: center; min-height: var(--gv-target); margin-block: calc(-1 * var(--gv-s2)); }
.dot { display: inline-block; width: .625rem; height: .625rem; border-radius: 50%; background: var(--place, var(--gv-ink)); margin-right: var(--gv-s2); vertical-align: .05em; }
.tag { display: inline-flex; align-items: center; gap: var(--gv-s1); padding: .125rem .625rem; border-radius: 9999px; border: 1.5px solid var(--gv-warn-line); background: var(--gv-warn-bg); color: var(--gv-warn-text); font-size: var(--gv-fs-small); font-weight: 600; line-height: 1.4; white-space: nowrap; }
.tag--ok { border-color: var(--gv-ok-line); background: var(--gv-ok-bg); color: var(--gv-ok-text); }
.tag--plain { border-color: var(--gv-line-strong); background: var(--gv-surface); color: var(--gv-ink); }
/* ---------- Forms ---------- */
.field { display: grid; gap: var(--gv-s1); }
.field label, .field__label { font-weight: 600; line-height: 1.35; }
.field__hint { font-size: var(--gv-fs-small); color: var(--gv-quiet); line-height: 1.4; }
.input { width: 100%; min-height: var(--gv-target-primary); padding: var(--gv-s2) var(--gv-s4); font: inherit; font-feature-settings: inherit; color: var(--gv-ink); background: #fff; border: 2px solid var(--gv-line-strong); border-radius: var(--gv-radius-control); box-shadow: inset 0 2px 0 var(--gv-sunken); }
.input--num { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
textarea.input { min-height: 6rem; padding-block: var(--gv-s3); resize: vertical; }
.more { border: 2px solid var(--gv-line); border-radius: var(--gv-radius-control); background: var(--gv-surface); }
.more > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--gv-s3); min-height: var(--gv-target-primary); padding: var(--gv-s2) var(--gv-s4); cursor: pointer; font-weight: 600; list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: "Vis"; flex: none; font-size: var(--gv-fs-small); font-weight: 600; color: var(--gv-link); text-decoration: underline; text-underline-offset: .18em; }
.more[open] > summary::after { content: "Skjul"; }
:lang(uk) .more > summary::after { content: "Показати"; }
:lang(uk) .more[open] > summary::after { content: "Сховати"; }
:lang(en) .more > summary::after { content: "Show"; }
:lang(en) .more[open] > summary::after { content: "Hide"; }
.more__sub { display: block; font-size: var(--gv-fs-small); font-weight: 400; color: var(--gv-quiet); }
.more__body { padding: var(--gv-s2) var(--gv-s4) var(--gv-s4); border-top: 1px solid var(--gv-line); }
.radios { display: grid; gap: var(--gv-s2); border: 0; padding: 0; margin: 0; min-width: 0; }
.radios legend { padding: 0; font-weight: 600; margin-bottom: var(--gv-s2); }
.radio { display: flex; align-items: center; gap: var(--gv-s3); min-height: var(--gv-target-primary); padding: var(--gv-s2) var(--gv-s4); border: 2px solid var(--gv-line-strong); border-radius: var(--gv-radius-control); background: #fff; cursor: pointer; }
.radio input { flex: none; width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--gv-ink); }
.radio:has(input:checked) { border-color: var(--gv-ink); background: var(--gv-panel); font-weight: 600; }

/* ---------- Summary card, detail lists ---------- */
.card { background: var(--gv-surface); border: 1px solid var(--gv-line); border-radius: var(--gv-radius-card); padding: var(--gv-s4); }
.card--panel { background: var(--gv-panel); border-color: transparent; }
.card--strong { border: 2px solid var(--gv-ink); }
.shift-facts { display: grid; gap: var(--gv-s1); }
.shift-facts__day { font-family: var(--gv-font-heading); font-size: var(--gv-fs-h2); line-height: var(--gv-lh-h2); font-weight: 600; }
.shift-facts__time { font-size: var(--gv-fs-time); font-weight: 600; font-variant-numeric: tabular-nums; }
.with-icon { display: flex; align-items: flex-start; gap: var(--gv-s2); }
.with-icon .icon { margin-top: .12em; }
.divider { border: 0; border-top: 1px solid var(--gv-line); margin: var(--gv-s4) 0; }
.linklist { display: grid; }
.linklist a { display: inline-flex; align-items: center; gap: var(--gv-s2); min-height: var(--gv-target); font-weight: 600; }
/* ==========================================================================
   Added for the product build (not in the concept)
   ========================================================================== */

/* Ukrainian headings: frame.css loads the Cyrillic serif subset for the Frelsesarmeen theme; other themes keep their own heading face. */

/* Place swatches as classes (no inline styles). A place's swatch key picks one. */
.swatch-bla { --place: var(--gv-place-bla); }
.swatch-plomme { --place: var(--gv-place-plomme); }
.swatch-petrol { --place: var(--gv-place-petrol); }
.swatch-oker { --place: var(--gv-place-oker); }
.swatch-rose { --place: var(--gv-place-rose); }
.swatch-indigo { --place: var(--gv-place-indigo); }
.swatch-skifer { --place: var(--gv-place-skifer); }
.swatch-brun { --place: var(--gv-place-brun); }

/* Status words: word + shape + weight; hue comes last */
.status { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.status__mark { flex: none; width: .75rem; height: .75rem; border-radius: 50%; background: var(--gv-free-mark); }
.status--free { color: var(--gv-free-text); }
.status--soon { color: var(--gv-warn-text); }
.status--soon .status__mark { width: 1.25rem; height: .3125rem; border-radius: 1rem; background: var(--gv-soon-mark); }
.status--full, .status--taken { color: var(--gv-full-text); font-weight: 400; }
.status--full .status__mark, .status--taken .status__mark { border-radius: .1875rem; background: transparent; border: 2px solid var(--gv-full-text); }
.status--gap { color: var(--gv-warn-text); }
.status--mine { color: var(--gv-ink); }
.status .icon { width: 1.25rem; height: 1.25rem; stroke-width: 2.4; }
.tag .icon { width: 1rem; height: 1rem; stroke-width: 2.4; }

/* Errors: summary at the top of the form, message at the field */
.notice--error { border-color: var(--gv-danger-line); background: var(--gv-danger-bg); color: var(--ds-color-danger-text-default); }
.notice__body { min-width: 0; }
.error-summary { padding: var(--gv-s4); border: 3px solid var(--gv-danger-line); border-radius: var(--gv-radius-control); background: var(--gv-surface); }
.error-summary h2 { font-family: var(--gv-font-body); font-size: var(--gv-fs-h3); line-height: var(--gv-lh-h3); display: flex; align-items: center; gap: var(--gv-s2); color: var(--ds-color-danger-text-default); }
.error-summary ul { margin-top: var(--gv-s2); }
.error-summary a { display: inline-flex; align-items: center; min-height: var(--gv-target); color: var(--gv-danger-text); font-weight: 600; }
.adm .error-summary a { min-height: var(--gv-target-admin); }
.field__error { display: flex; align-items: flex-start; gap: var(--gv-s2); color: var(--gv-danger-text); font-weight: 600; line-height: 1.4; }
.field__error .icon { margin-top: .1em; width: 1.25rem; height: 1.25rem; }
.field__optional { font-weight: 400; color: var(--gv-quiet); }
.input[aria-invalid="true"] { border-color: var(--gv-danger-line); border-width: 3px; }
select.input { cursor: pointer; }

/* Card title, sheet and toast variants */
.card > * + * { margin-top: var(--gv-s3); }
.card__title { font-family: var(--gv-font-body); font-size: var(--gv-fs-h3); line-height: var(--gv-lh-h3); font-weight: 600; }
a.scrim { display: block; cursor: default; }
.sheet--inline { position: static; max-height: none; border: 1px solid var(--gv-line-strong); border-radius: 1.25rem; box-shadow: 0 6px 20px rgb(0 0 0 / .12); max-width: 28rem; }
.sheet__head h2 { font-family: var(--gv-font-body); font-size: var(--gv-fs-h2); }
.undo form { flex: none; margin: 0; }
.undo .icon { flex: none; }
.undo--plain { padding: var(--gv-s3) var(--gv-s4); }
.undo-dock--inline { position: static; width: auto; max-width: 30rem; margin-top: 0; }
