/*
 * Innventa design tokens (brand kit tokens.json, 28.09.2026) on the D2 layout: colours light and
 * dark, chart and status colours, type, space and radius scales, shadows. Every page takes its
 * colours, sizes and radii from here; the shared components and the app frame are workflows.css,
 * the page layouts the page stylesheets. The --legacy-* names are the ones the pages have always
 * used; each carries the brand value named in its comment (brand token in brackets).
 * Fixed meanings (brand kit): lime = done by the Autopilot (never text in lime), coral and
 * human-tint = "Sie" (a person approves or must approve), violet/hl = AUTOMATISCH; status
 * colours only for states, always with symbol and word.
 * Dark: the device setting, or the choice in the person menu (html[data-theme]).
 * Fonts: Archivo (variable weight and width, Latin incl. Turkish; the brand's one typeface) and
 * Inter for Cyrillic (Ukrainian), both SIL OFL 1.1, self-hosted from @fontsource-variable 5.3.0
 * (no font service at runtime).
 */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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: "Inter";
  src: url("/fonts/inter-cyrillic-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-cyrillic-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

button, input, select, textarea { font: inherit; }

:root {
  --tabbar-height: 64px; /* shared phone frame height, before the device safe area */
  --legacy-blue: #4b3fe4; /* [violet-ink] links, text in violet */
  --legacy-blue-soft: #e4e1ff; /* [hl] highlight surface */
  --hl-ink: #2a1fb8; /* [hl-ink] text on hl */
  --legacy-ink: #111322; /* [ink] */
  --legacy-ink-soft: #5f6376; /* [ink-3] */
  --legacy-line: #e6e8ee; /* [line] */
  --legacy-line-strong: #d5d8e2; /* [line-2] */
  --legacy-paper: #f3f3f7; /* [panel] the canvas */
  --legacy-surface: #ffffff; /* [card] */
  --legacy-success: #17773f; /* [ok-ink] */
  --legacy-warning: #9e4f00; /* [warn-ink] */
  --legacy-danger: #b42329; /* [bad-ink] */
  --legacy-success-soft: #e7f5ec; /* [ok-tint] */
  --legacy-warning-soft: #fcf1e2; /* [warn-tint] */
  --legacy-danger-soft: #fbeaea; /* [bad-tint] */
  --legacy-on-blue: #ffffff; /* [on-violet] */
  /* D2: the accent as a fill (buttons, active marks), the canvas steps, field borders (3:1),
     the second ink, the info tint, the object colours and the dark sidebar. */
  --accent: #5b4ff5; /* [violet] */
  --accent-hover: #4a3fe0;
  --on-accent: #ffffff; /* [on-violet] */
  --lime: #d4f53c; /* [lime] */
  --on-lime: #1a2000; /* [on-lime] */
  --w2-target-highlight: #c9ef31; /* approved DESIGN-1101 selection */
  --w2-target-ink: #111827;
  --coral: #ff6b4a; /* [coral] "Sie": what a person approves or must approve */
  /* Rows waiting for this person: the brand's human-tint (#ffe9e3, dark #3a1a12) one step toward
     coral, so it is never read as bad-tint (ΔE ≥ 10 to bad- and warn-tint in both themes,
     test-charts.mjs; designer-r2-1). */
  --human-tint: #ffdccb;
  --human-ink: #b3341a; /* [human-ink] */
  --sunken: #f3f3f7; /* [panel] */
  --hover: #f9f9fc; /* [soft] */
  --field: #5f6376;
  --ink-2: #4d5163; /* [ink-2] */
  --info-soft: #e8efff; /* [info-tint] */
  --info: #1f5bd6; /* [info] */
  --bar-ink: #2e2596;
  --bar-ink-2: #7a3510;
  --object-1: #8e4ec6; /* not the accent: an object dot is never read as "active" */
  --object-2: #e0782c;
  --object-3: #16a06f;
  --object-4: #d69b00;
  --object-5: #d6528f;
  --object-6: #2a78d6;
  --object-7: #0e8577;
  --object-8: #9c6b30;
  --stage-dark: #0f0c26; /* [stage-dark] the night stage (sign-in) */
  --glow-violet: #8c7dff; /* [glow-violet] its light */
  --side: #ffffff; /* [side] */
  --side-line: #e6e8ee;
  --side-ink: #4d5163;
  --side-muted: #5f6376;
  --side-active: #eceaff;
  --side-active-ink: #2a1fb8;
  --side-accent: #5b4ff5;
  --side-card: #fafafc;
  --side-mark: #eceaff;
  --logo-tile: #ffffff; /* behind the Verwaltung's own logo, in both themes (logos are made for white) */
  --skeleton: #eceef3;
  --skeleton-shine: #f6f7fa;
  --scrim: rgb(16 18 34 / 35%);
  /* Chart colours (charts.mjs): categorical slots in this fixed order, colour-blind-safe by the
     dataviz validator (light on #ffffff, dark on #16171f); every chart also has a legend or its
     values written and a table. Status colours only for states, always with symbol and word. */
  --chart-1: #5b4ff5;
  --chart-2: #eb6834;
  --chart-3: #1baf7a;
  --chart-4: #eda100;
  --chart-5: #e87ba4;
  --chart-6: #008300;
  --chart-7: #2a78d6;
  --chart-8: #e34948;
  --status-good: #1f9254; /* [ok] */
  --status-warning: #db7a08; /* [warn] */
  --status-critical: #d9373d; /* [bad] */
  --legacy-shadow-sm: 0 1px 2px rgb(16 18 34 / 4%), 0 2px 8px rgb(16 18 34 / 3%);
  --legacy-shadow-lg: 0 18px 48px -12px rgb(16 18 34 / 22%), 0 2px 6px rgb(16 18 34 / 6%);
  --font: "Archivo", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Type (brand kit scale, set for the app's density): title = page heading, subtitle = card
     titles, section = a title inside a card, body, small = hints and meta, label = capitals
     labels, tag = status tags, figure = big numbers. Page headings (h1) and big figures condensed
     (brand: width 78 %, weight 700); card titles (h2, subtitle/600) stay at full width on purpose:
     the app's titles are long German nouns ("Eigentümerversammlung und Beschlüsse") and read
     better unstretched. Phones step body and small up (below). Only these sizes are used. */
  /* DESIGN-1029 approved semantic type scale. U1 reads these tokens directly; adding a
     rendered size therefore requires naming its product purpose here first. */
  --text-caption: 12px;
  --text-small: 14px;
  --text-label: 12px;
  --text-tag: 12px;
  --text-meta: 14px;
  --text-body: 15px;
  --text-control: 16px;
  --text-reading: 17px;
  --text-section: 22px;
  --text-subtitle: 24px;
  --text-display: 30px;
  --text-figure: 36px;
  --text-title-compact: 40px;
  --text-title: 44px;
  --text-figure-large: 64px;
  --font-display-stretch: 78%;
  /* Space and radius (brand kit): cards radius-xl, a panel inset in a card radius-lg, controls
     radius-md, tags radius-full. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --control-min: 44px;
  --control-tile: 76px;
  --motion-fast: 120ms;
  --radius-tag: 5px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;
  /* DESIGN-1101 portal components use only aliases of the approved scale. Keeping the aliases
     here makes every card/control declaration valid without introducing a second visual scale. */
  --radius-2: var(--radius-tag);
  --radius-4: var(--radius-tag);
  --radius-9: var(--radius-sm);
  --radius-10: var(--radius-md);
  --radius-14: var(--radius-lg);
  --radius-18: var(--radius-xl);
  --radius-22: var(--radius-xl);
  --radius-999: var(--radius-full);
  --space-unit-28: calc(var(--space-6) + var(--space-1));
  --space-unit-40: calc(var(--space-8) + var(--space-2));
  --space-unit-56: calc(var(--space-12) + var(--space-2));
  --w2-line: var(--legacy-line);
  --w2-line-faint: var(--sunken);
  --w2-shadow-04: rgb(16 18 34 / 4%);
  --w2-shadow-08: rgb(16 18 34 / 8%);
  --w2-shadow-14: rgb(16 18 34 / 14%);
  --w2-dark-control: color-mix(in srgb, var(--legacy-surface) 10%, transparent);
  --w2-dark-muted: color-mix(in srgb, var(--legacy-surface) 72%, transparent);
  --w2-control-fill: var(--sunken);
  --w2-action-fill: var(--legacy-blue-soft);
  --w2-action-ink: var(--side-active-ink);
  --w2-action-soft: var(--legacy-blue-soft);
  --w2-chart-soft: color-mix(in srgb, var(--accent) 28%, var(--legacy-surface));
  --w2-series-2: color-mix(in srgb, var(--accent) 55%, var(--legacy-surface));
  --w2-paid-fill: var(--lime);
  --w2-paid-soft: color-mix(in srgb, var(--lime) 28%, var(--legacy-surface));
  --w2-paid-ink: var(--on-lime);
  --w2-human-panel: var(--human-tint);
  --w2-human-line: color-mix(in srgb, var(--human-ink) 25%, var(--legacy-surface));
  --w2-human-soft: var(--human-tint);
  --w2-human-ink: var(--human-ink);
  --status-success: var(--status-good);
  --side-width: 248px;
  --side-width-compact: calc(var(--space-16) + var(--space-1));
  --subnav-width: 232px;
}

html[data-theme="dark"] {
  --legacy-ink: #f1f1f6;
  --legacy-ink-soft: #8e8fa3;
  --legacy-line: #282834;
  --legacy-line-strong: #383848;
  --legacy-paper: #15151d;
  --legacy-surface: #1a1a23;
  --legacy-blue-soft: #2a2560;
  --hl-ink: #c8c3ff;
  --human-tint: #45241a;
  --human-ink: #ffb29e;
  --legacy-shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
  --legacy-shadow-lg: 0 18px 48px -12px rgb(0 0 0 / 70%);
  --accent: #5b4ff5;
  --accent-hover: #4a3fe0;
  --sunken: #15151d;
  --hover: #1f1f29;
  --field: #afb1c0;
  --ink-2: #afb1c0;
  --info-soft: #141e36;
  --info: #7fa4ff;
  --bar-ink: #ffffff;
  --bar-ink-2: #ffffff;
  --object-1: #a77be0;
  --object-2: #e8813f;
  --object-3: #2fbf86;
  --object-4: #e0ad2a;
  --object-5: #e56aa2;
  --object-6: #4f95e6;
  --object-7: #2fa596;
  --object-8: #c08a4a;
  --side: #ffffff;
  --side-line: #e6e8ee;
  --side-ink: #4d5163;
  --side-muted: #5f6376;
  --side-active: #eceaff;
  --side-active-ink: #2a1fb8;
  --side-accent: #5b4ff5;
  --skeleton: #1c1d27;
  --skeleton-shine: #262837;
  --scrim: rgb(0 0 0 / 55%);
}

/* The plain pages (body.wf-body) are dark with data-theme="dark" and, unless the person chose
   light (data-theme="light"), on a device in dark mode. Links, buttons, states and charts get
   their dark steps (text at least 4.5:1 on the dark surface) and the browser's own controls
   follow. The media block below holds the same values as the two blocks above and this one
   together (test-charts.mjs checks it). */
html[data-theme="dark"]:has(> body.wf-body) {
  color-scheme: dark;
  --legacy-blue: #a9a3ff;
  --legacy-on-blue: #121217;
  --legacy-success: #44c882;
  --legacy-warning: #f2a43d;
  --legacy-danger: #f06a6e;
  --legacy-success-soft: #10261a;
  --legacy-warning-soft: #2a1f10;
  --legacy-danger-soft: #2c1616;
  --chart-1: #7c72ff;
  --chart-2: #d95926;
  --chart-3: #199e70;
  --chart-4: #c98500;
  --chart-5: #d55181;
  --chart-6: #008300;
  --chart-7: #3987e5;
  --chart-8: #e66767;
  --status-good: #44c882;
  --status-warning: #f2a43d;
  --status-critical: #f06a6e;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):has(> body.wf-body) {
    --legacy-ink: #f1f1f6;
    --legacy-ink-soft: #8e8fa3;
    --legacy-line: #282834;
    --legacy-line-strong: #383848;
    --legacy-paper: #15151d;
    --legacy-surface: #1a1a23;
    --legacy-blue-soft: #2a2560;
    --hl-ink: #c8c3ff;
    --human-tint: #45241a;
    --human-ink: #ffb29e;
    --legacy-shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
    --legacy-shadow-lg: 0 18px 48px -12px rgb(0 0 0 / 70%);
    --accent: #5b4ff5;
    --accent-hover: #4a3fe0;
    --sunken: #15151d;
    --hover: #1f1f29;
    --field: #afb1c0;
    --ink-2: #afb1c0;
    --info-soft: #141e36;
    --info: #7fa4ff;
    --bar-ink: #ffffff;
    --bar-ink-2: #ffffff;
    --object-1: #a77be0;
    --object-2: #e8813f;
    --object-3: #2fbf86;
    --object-4: #e0ad2a;
    --object-5: #e56aa2;
    --object-6: #4f95e6;
    --object-7: #2fa596;
    --object-8: #c08a4a;
    --side: #ffffff;
    --side-line: #e6e8ee;
    --side-ink: #4d5163;
    --side-muted: #5f6376;
    --side-active: #eceaff;
    --side-active-ink: #2a1fb8;
    --side-accent: #5b4ff5;
    --skeleton: #1c1d27;
    --skeleton-shine: #262837;
    --scrim: rgb(0 0 0 / 55%);
    color-scheme: dark;
    --legacy-blue: #a9a3ff;
    --legacy-on-blue: #121217;
    --legacy-success: #44c882;
    --legacy-warning: #f2a43d;
    --legacy-danger: #f06a6e;
    --legacy-success-soft: #10261a;
    --legacy-warning-soft: #2a1f10;
    --legacy-danger-soft: #2c1616;
    --chart-1: #7c72ff;
    --chart-2: #d95926;
    --chart-3: #199e70;
    --chart-4: #c98500;
    --chart-5: #d55181;
    --chart-6: #008300;
    --chart-7: #3987e5;
    --chart-8: #e66767;
    --status-good: #44c882;
    --status-warning: #f2a43d;
    --status-critical: #f06a6e;
  }
}

/* One geometry-aware loading treatment for every surface, including standalone legal pages. */
.wf-skel { display: grid; gap: var(--space-3); padding: var(--space-1) 0; }
.wf-skel i { display: block; height: 12px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--skeleton) 30%, var(--skeleton-shine) 50%, var(--skeleton) 70%) 0 0 / 300% 100%; animation: wf-shimmer 1.4s linear infinite; }
.wf-skel-rows i { width: 100%; height: 64px; border-radius: var(--radius-md); }
.wf-skel-card { min-height: 132px; box-sizing: border-box; padding: var(--space-4); border: 1px solid var(--legacy-line); border-radius: var(--radius-xl); }
.wf-skel i:nth-child(3) { width: 80%; }
.wf-skel i:nth-child(4) { width: 55%; }
.wf-skel-rows i:nth-child(n) { width: 100%; }
@keyframes wf-shimmer { to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .wf-skel i { animation: none; } }

/* Phones: body and small text one step up (16 px fields keep iOS from zooming). */
@media (max-width: 767px) {
  :root {
    --text-body: 15px;
    --text-small: 15px;
  }
}
