:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --card: #fcfcfb;
  --card-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --axis: #c3c2b7;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --weekend: color-mix(in srgb, var(--ink) 7%, transparent);
  --ring: rgba(11, 11, 11, .10);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .05);
  --tip-bg: #ffffff;
  --tip-shadow: 0 4px 14px rgba(0, 0, 0, .16);
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
}
/* Dark: chosen explicitly (appearance «Dark») or automatically by device, as long as «Light» is not chosen */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --card: #1a1a19;
  --card-2: #232321;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #b0afa7;  /* lighter than in light mode: grey text stays readable on the dark areas (user 30 Oct «grauer text auf grau sehr schlecht. allgemein helleres grau für schrift») */
  --line: #2c2c2a;
  --axis: #383835;
  --accent: #3987e5;
  --good-ink: #0ca30c;
  --ring: rgba(255, 255, 255, .10);
  --shadow: none;
  --tip-bg: #2c2c2a;
  --tip-shadow: 0 4px 14px rgba(0, 0, 0, .6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --card: #1a1a19;
    --card-2: #232321;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #b0afa7;
    --line: #2c2c2a;
    --axis: #383835;
    --accent: #3987e5;
    --good-ink: #0ca30c;
    --ring: rgba(255, 255, 255, .10);
    --shadow: none;
    --tip-bg: #2c2c2a;
    --tip-shadow: 0 4px 14px rgba(0, 0, 0, .6);
  }
}
/* Font of the style «GreenState»: Satoshi as on greenstate.ch (Fontshare, ITF Free Font License – fonts/FFL.txt); the browser only loads
   it when the style is chosen */
@font-face { font-family: Satoshi; src: url("fonts/Satoshi-Variable.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
/* Style «GreenState» (Appearance → GreenState …): calm and neutral like greenstate.ch – white and grey areas, green only where intended
   (main buttons, links, focus, active menu item; light #1a7a35 from the logo, dark #60b946), plus the cube from the logo of GreenState AG
   instead of the app icon (brand/; the user removed the lettering at the bottom of the sidebar on 18 Oct). Only on screen, printed
   it stays plain (print.css). */
@media screen {
  :root[data-style="gs"] {
    color-scheme: light;
    --bg: #f7f7f7; --card: #ffffff; --card-2: #eff4ec; --ink: #1b1b1b; --ink-2: #464545; --muted: #6b7582; --line: #e1e1e1; --axis: #c8c8c8;
    --accent: #1a7a35; --accent-ink: #ffffff; --good-ink: #006300; --ring: rgba(11, 11, 11, .10);
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .05); --tip-bg: #ffffff; --tip-shadow: 0 4px 14px rgba(0, 0, 0, .16);
    --gs-timeline: linear-gradient(100deg, #005417, #1a7a35 40%, #5fb90a 82%, #b4eb03); --gs-font: linear-gradient(90deg, #005417, #1a7a35 55%, #4fa508);
    font-family: Satoshi, system-ui, -apple-system, "Segoe UI", sans-serif;
  }
  :root[data-style="gs"][data-theme="dark"] {
    color-scheme: dark;
    --bg: #0d0d0d; --card: #1a1a19; --card-2: #232321; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #b0afa7; --line: #2c2c2a; --axis: #383835;
    --accent: #60b946; --accent-ink: #042e0c; --good-ink: #0ca30c; --ring: rgba(255, 255, 255, .10);
    --shadow: none; --tip-bg: #2c2c2a; --tip-shadow: 0 4px 14px rgba(0, 0, 0, .6);
    --gs-font: linear-gradient(90deg, #5fb90a, #b4eb03);
  }
  :root[data-style="gs"] nav a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
  :root[data-style="gs"] nav a.active .nav-ico { background: var(--accent); color: #fff; }
  :root[data-style="gs"] .nav-group.open > button.nav-sep::after { color: var(--accent); }
  /* at the top above the sidebar a fine stripe in the green tones of the logo */
  :root[data-style="gs"] .brand { background-image: linear-gradient(90deg, #005417, #1a7a35 30%, #5fb90a 65%, #b4eb03); background-size: 100% 3px; background-repeat: no-repeat; }
  /* Main buttons («✓ Complete», Save …): 2 px border and text in the gradient of the logo green tones (proposal 12). The text is
     the only background (background-clip: text – with several layers Firefox paints the whole area), the border a masked ring in
     ::before; icons (SVG) in the accent green. Padding 1 px smaller so that they stay as high as the other buttons. */
  :root[data-style="gs"] .btn.primary { position: relative; border: 2px solid transparent; color: transparent; font-weight: 700;
    background: var(--gs-font) content-box no-repeat; -webkit-background-clip: text; background-clip: text; }
  :root[data-style="gs"] .btn.primary::before { content: ""; position: absolute; inset: -2px; padding: 2px; border-radius: inherit; background: var(--gs-timeline); pointer-events: none;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; }
  :root[data-style="gs"] .btn.primary:hover { filter: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
  :root[data-style="gs"] .btn.primary svg { color: var(--accent); }
  :where(:root[data-style="gs"]) .btn.primary { padding: 5px 11px; }
  :where(:root[data-style="gs"]) .btn.primary.small { padding: 2px 7px; }
  :where(:root[data-style="gs"]) .btn.primary.icon-btn { padding: 5px 8px; }
  :root[data-style="gs"] .logo { background: url("brand/greenstate-mark.svg") center/contain no-repeat; border-radius: 0; }
  :root[data-style="gs"] #auth { background: var(--bg); }
  :root[data-style="gs"] .pdf-figure, :root[data-style="gs"] .fb-button .figure:not(:empty) { color: var(--accent-ink); }
}
@media screen and (prefers-color-scheme: dark) {
  :root[data-style="gs"]:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d; --card: #1a1a19; --card-2: #232321; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #b0afa7; --line: #2c2c2a; --axis: #383835;
    --accent: #60b946; --accent-ink: #042e0c; --good-ink: #0ca30c; --ring: rgba(255, 255, 255, .10);
    --shadow: none; --tip-bg: #2c2c2a; --tip-shadow: 0 4px 14px rgba(0, 0, 0, .6);
    --gs-font: linear-gradient(90deg, #5fb90a, #b4eb03);
  }
}

* { box-sizing: border-box; }
/* An ultra-thin scrollbar everywhere (page, sidebar, tables, plan, dialogs) shows that more lies hidden – instead of fading the edges (user 31 Oct
   «schattierung bei scroll auch [entfernen]. ultradünne scrollleiste einblenden dafür», then «scrollleiste halb so breit», «immernoch zu breit … halb so breit»; before, user 26 Oct
   «scrollleisten nicht sichtbar»). ::-webkit-scrollbar for Chrome, Edge and Safari (1 px; Chrome ignores it as soon as scrollbar-width is set), scrollbar-width for Firefox */
:root { --scrollbar: color-mix(in srgb, var(--muted) 55%, transparent); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; } }
::-webkit-scrollbar { width: 1px; height: 1px; background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
/* Firefox cannot thin its own scrollbar below about 8 px (user 31 Oct «scrollbar immernoch gleichbreit wie vorher»): there thinbar.js hides it
   and draws a bar of 1 px over the edge of every area that scrolls */
html.thinbar, html.thinbar * { scrollbar-width: none; }
.thinbar-layer { position: fixed; inset: 0; pointer-events: none; z-index: 2147483000; overflow: hidden; }
.thinbar-layer > i { position: absolute; background: var(--scrollbar); }
body { margin: 0; background: var(--bg); color: var(--ink); display: flex; min-height: 100vh; line-height: 1.45; }
a { color: var(--accent); }
mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--ink); border-radius: 3px; padding: 0 2px; }  /* search hits highlighted in blue instead of browser yellow */
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 14px; margin: 0 0 10px; color: var(--ink-2); font-weight: 600; }
.sub { color: var(--ink-2); margin: 0 0 20px; max-width: 80ch; }

/* ---------- Navigation */
.sidebar { width: 220px; flex: none; background: var(--card); border-inline-end: 1px solid var(--line); padding: 0 12px 12px; position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; }
/* only the navigation scrolls; logo at the top and user menu at the bottom stay (user 26 Oct «user dropdown immer zuunterst anzeigen und nicht im scroll bereich») */
.sidebar nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
/* the logo area stays at the top when scrolling the navigation */
.brand { display: flex; gap: 10px; align-items: center; padding: 16px 20px 12px; margin: 0 -12px 8px; position: sticky; top: 0; z-index: 3; background: var(--card); border-bottom: 1px solid var(--line); }
.brand-name { min-width: 0; }
.brand-buttons { margin-inline-start: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
/* user menu with the settings at the very bottom (with a short navigation at the bottom edge) */
.sidebar-foot { margin-top: auto; flex: none; }
/* settings as a toolbar in the user menu: an invisible select field above each icon opens the list */
.cfg-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.cfg-icon { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 4px; border-radius: 8px; color: var(--ink-2); cursor: pointer; }
.cfg-icon:hover, .cfg-icon:focus-within { background: var(--card-2); color: var(--ink); }
.cfg-icon:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.cfg-icon select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.cfg-val { font-size: 10px; line-height: 1.2; font-weight: 600; color: var(--muted); min-height: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: #1baf7a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 25V13M16 15c0-4 3-7 8-7 0 5-3 8-8 7zM16 18c0-4-3-7-8-7 0 5 3 8 8 7z' stroke='white' stroke-width='2' fill='none' stroke-linejoin='round'/%3E%3C/svg%3E") center/cover; flex: none; }
.sidebar, nav { --nav-ink: color-mix(in srgb, var(--ink-2) 75%, var(--ink)); }
nav a { display: flex; align-items: center; gap: 9px; padding: 4px 10px; border-radius: 7px; color: var(--nav-ink); text-decoration: none; margin-bottom: 1px; }
/* every entry with its symbol in a grey tile (navicons.js); the active one dark */
.nav-ico { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--card-2); }
.nav-ico svg { width: 18px; height: 18px; display: block; }
nav a.active .nav-ico { background: var(--ink); color: var(--card); }
button.logo { border: 0; padding: 0; cursor: pointer; }
button.logo:hover { box-shadow: 0 0 0 3px var(--card-2); }
nav a:hover { background: var(--card-2); color: var(--ink); }
nav a.active { background: var(--card-2); color: var(--ink); font-weight: 600; }
.nav-sep { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 16px 10px 4px; }
button.nav-sep { width: 100%; text-align: left; background: none; border: 0; border-radius: 7px; font: inherit; text-transform: none; letter-spacing: normal; color: var(--nav-ink); padding: 7px 10px; margin-top: 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
button.nav-sep:hover { background: var(--card-2); color: var(--ink); }
.nav-items a { margin-inline-start: 12px; }
button.nav-sep::after { content: "▸"; font-size: 10px; transition: transform .15s; }
.nav-group.open > button.nav-sep::after { transform: rotate(90deg); }
.nav-group:not(.open) > .nav-items { display: none; }
/* Narrow navigation (click on the logo, app.js setNavNarrow): only the symbols, three per row under the short title of their group, the name in
   the tooltip; on the mobile not (there «☰» opens the menu) */
@media (min-width: 801px) {
  body.nav-narrow .sidebar { width: 136px; padding: 0 8px 10px; }
  body.nav-narrow .brand { margin: 0 -8px 8px; padding: 14px 10px 10px; justify-content: center; gap: 8px; }
  body.nav-narrow .brand-name { display: none; }
  body.nav-narrow .brand-buttons { margin-inline-start: 0; }
  body.nav-narrow nav { display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; gap: 2px; }
  body.nav-narrow nav > :not(a), body.nav-narrow .nav-items { grid-column: 1 / -1; }
  body.nav-narrow .nav-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
  body.nav-narrow nav a, body.nav-narrow .nav-items a { justify-content: center; padding: 3px 0; margin: 0; }
  body.nav-narrow nav a:hover, body.nav-narrow nav a.active, :root[data-style="gs"] body.nav-narrow nav a.active { background: none; }
  body.nav-narrow nav a:hover .nav-ico { box-shadow: 0 0 0 1px var(--line); }
  body.nav-narrow .nav-ico { width: 30px; height: 30px; }
  body.nav-narrow .nav-ico svg { width: 19px; height: 19px; }
  body.nav-narrow .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.nav-narrow nav button.nav-sep { justify-content: center; gap: 4px; margin-top: 4px; padding: 7px 2px 3px; border-top: 1px solid var(--line); border-radius: 0;
    font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
  body.nav-narrow nav button.nav-sep::after { font-size: 8px; }
  body.nav-narrow .user-box > button.nav-sep { justify-content: center; padding: 6px 0; }
  body.nav-narrow .user-box > button.nav-sep::after { display: none; }
  body.nav-narrow .user-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
  body.nav-narrow .user-act { justify-content: center; padding: 3px 0; }
  body.nav-narrow .user-act:hover { background: none; }
  body.nav-narrow .user-act:hover .nav-ico, body.nav-narrow .user-box > button.nav-sep:hover .nav-ico { box-shadow: 0 0 0 1px var(--line); }
  body.nav-narrow .user-box > button.nav-sep:hover { background: none; }
  body.nav-narrow .cfg-strip { grid-template-columns: repeat(2, 1fr); }
}
.lo-head { cursor: pointer; margin: 0; }
.lo-head::before { content: "▸"; font-size: 11px; color: var(--muted); transition: transform .15s; }
.lo-card.open .lo-head::before { transform: rotate(90deg); }
.lo-card.open > .lo-head { padding-bottom: 10px; }
.lo-card:not(.open) .lo-body { display: none; }
main { flex: 1; min-width: 0; --main-top: 8px; padding: var(--main-top) 32px 60px; outline: none; }  /* --main-top: the head of the view covers it (.page-head) */

/* ---------- Building blocks */
.link-x { background: none; border: 0; padding: 0 2px; cursor: pointer; color: var(--muted); font: inherit; }
.link-x:hover { color: var(--critical, #d03b3b); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.grid.two > * { min-width: 0; }  /* a card with a wide table scrolls inside (table-wrap) instead of widening the page on the phone */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .label { color: var(--ink-2); font-size: 12px; }
.tile .value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; }
.tile .hint { color: var(--muted); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.toolbar label { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-2); gap: 3px; }
/* Settings of a view (cfgCard() in app.js, model: trends): card below the header, per section its title (period, filter …) and the fields with their label in front; all fields and buttons equally high */
.cfg-card { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: start; gap: 10px 16px; padding: 12px 16px; margin: 8px 0 14px; }
/* … always one row (.cfg-line, user 30 Oct «nicht std! header teil2 2 zeilen!!!»): the sections side by side, a line between them; when it gets
   narrow, app.js cfgFit takes the steps fit1 (no section words) – fit2 (narrower drop-downs and inputs) – fit3 (no words in front of the
   fields, they go to the tip) – fit4 (the row scrolls sideways) */
.cfg-card.cfg-line { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px 12px; padding: 10px 16px; }
.cfg-line > * { flex: none; }
.cfg-line > .cfg-row:last-child { flex: 1 0 auto; }  /* its spacer pushes what follows it to the right */
.cfg-line > .cfg-head { padding-top: 0; }
.cfg-line > .cfg-row + .cfg-head, .cfg-line.fit1 > .cfg-row + .cfg-head + .cfg-row { border-inline-start: 1px solid var(--line); padding-inline-start: 14px; margin-inline-start: 4px; }
.cfg-line .cfg-row { flex-wrap: nowrap; gap: 8px 14px; }
.cfg-line .cfg-row > *, .cfg-line .cfg-row label > * { flex-shrink: 0; }
.cfg-line .seg { flex-wrap: nowrap; }
.cfg-line .cfg-row input[type=search] { width: 220px; }
.cfg-line.fit1 > .cfg-head, .cfg-line.fit3 .cfg-word { display: none; }
.cfg-line.fit2 select { max-width: 120px; }
.cfg-line.fit2 .cfg-row input:is([type=search], [type=text]) { width: 130px; }
.cfg-line.fit4 { overflow-x: auto; overscroll-behavior-x: contain; }
.cfg-head { padding-top: calc((var(--ctl-h, 34px) - 1lh) / 2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.cfg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; min-height: 34px; }
.cfg-row label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.cfg-row label > span { display: inline-flex; align-items: center; gap: 6px; }  /* label with «i» */
.cfg-row .info-i { margin-inline-start: 0; }
.cfg-row .spacer { flex: 1; }
.cfg-row input:not([type=checkbox]):not([type=radio]), .cfg-row select, .cfg-row .btn { box-sizing: border-box; height: 34px; }
.cfg-row .btn { display: inline-flex; align-items: center; justify-content: center; padding-block: 0; }
.cfg-row .btn.small { padding-inline: 10px; font-size: 13px; }
.cfg-row input[type=search] { width: min(240px, 100%); }
.cfg-row .field.check { padding-top: 0; }
/* segmented button, e.g. quick choice of the period */
.seg { display: inline-flex; flex-wrap: wrap; }
.seg .btn { border-radius: 0; margin-inline-start: -1px; }
.seg .btn:first-child { border-start-start-radius: 7px; border-end-start-radius: 7px; margin-inline-start: 0; }
.seg .btn:last-child { border-start-end-radius: 7px; border-end-end-radius: 7px; }
.seg .btn.primary { position: relative; }
@media (max-width: 700px) {
  .cfg-card:not(.cfg-line) { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .cfg-card:not(.cfg-line) > .cfg-head { padding-top: 0; }
  .cfg-card:not(.cfg-line) > .cfg-head:not(:first-child) { margin-top: 8px; }
}
@media print {
  .cfg-card { border: 0; padding: 0; margin: 0 0 3mm; gap: 1mm 4mm; }
  .cfg-head { padding-top: 0; }
  .cfg-line, .cfg-line .cfg-row { flex-wrap: wrap; overflow: visible; }  /* on paper everything with its words */
  .cfg-line.fit1 > .cfg-head { display: block; }
  .cfg-line.fit3 .cfg-word { display: inline; }
  .cfg-line.fit2 select { max-width: none; }
  .cfg-card .cfg-row input, .cfg-card .cfg-row select { appearance: none; -webkit-appearance: none; border: 0; background: none; padding: 0; height: auto; color: var(--ink); font: inherit; box-shadow: none; }
}
.page-head-buttons { display: contents; }
.fp-undo { display: inline-flex; gap: 4px; }  /* undo and redo (fpHeadUndo; .wr-undo in wiring.css) */  /* View header (header): wide, all buttons are in one row, the print button at the far right */
/* the head of a view stays at the top when the page scrolls (user 30 Oct); its wrapper is no box, so it sticks within the whole view */
.page-head-wrap { display: contents; }
/* bars that keep one row: the word of a button or field goes when narrow (.bar-txt), a short sign takes its place (.bar-ico) */
.bar-ico { display: none; }
/* Symbols instead of words in the plans and editors (app.js piize, planicons.js; user 22 Nov 2026, variant 9 «mit fusion gruppen aber in greenstate grün»):
   a dark line, the body in the green of GreenState, in every style and theme. The word stays hidden in the button; «+» bottom right = makes something new */
:root { --pi-fill: #60b946; --pi-plus: #1a7a35; }
/* dark: the line is white – on #60b946 it stood out only 2.3 : 1 (user 22 Nov 2026 «kontrast verbessern weiss zu grün»); the deep green of the logo gives
   5.4 : 1 and still stands out from the dark ground */
:root[data-theme="dark"] { --pi-fill: #1a7a35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pi-fill: #1a7a35; } }
.btn.pi { display: inline-flex; align-items: center; justify-content: center; gap: 0; position: relative; padding: 0 5px; min-width: var(--ctl-h, 28px); height: var(--ctl-h, 28px); line-height: 1; }
/* the word is a text node of the button (text matching finds it only there): size 0 hides it whatever the button rules say; what else shows keeps its size */
.btn.pi { font-size: 0 !important; }
.btn.pi > * { font-size: 12px; }
.btn.pi > :not(.pi-svg) { margin-inline-start: 2px; }
:root .btn.pi { padding-inline: 5px; }  /* also in a settings row and as .small, which give words 8-10 px */
.pi-svg { width: 16px; height: 16px; flex: none; display: block; }
/* the symbol of a button as big as its frame allows: 21 px in the 23 px high bars, at most 22 px (before 16; user 23 Nov 2026 «symbole jeweils grösser in
   gleichbleibendem rahmen»). A negative margin keeps its place in the layout at 16 px: it grows into the padding, every button and bar keeps its width
   (also where a bar gives its buttons a padding of its own) */
.btn.pi { --pi-ico: min(22px, calc(var(--ctl-h, 28px) - 2px)); }
.btn.pi > .pi-svg { width: var(--pi-ico); height: var(--pi-ico); margin: calc((16px - var(--pi-ico)) / 2); }
.pi-svg .pi-du { fill: var(--pi-fill); opacity: 1; }
.btn.pi:disabled .pi-svg { opacity: .45; }
.btn.pi .dd-arrow { font-size: 9px; }
.btn.pi.pi-plus::after { content: "+"; position: absolute; right: -4px; bottom: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--pi-plus); color: #fff;
  font: 700 10px/11px system-ui, sans-serif; text-align: center; pointer-events: none; }
/* on (the tool in use, editing): tinted green like the chosen tool in Fusion – also in the style «GreenState», whose main buttons have a ring in the logo colours */
:is(:root, :root[data-style="gs"]) .btn.pi:is(.primary, .on, [aria-pressed="true"]) { background: color-mix(in srgb, #60b946 22%, var(--card)); border-color: #60b946;
  color: var(--ink); -webkit-background-clip: border-box; background-clip: border-box; font-weight: inherit; box-shadow: none; }
:is(:root, :root[data-style="gs"]) .btn.pi.primary::before { display: none; }
/* groups like the tool bar of Fusion 360 (piGroup): the symbols in a row, a line between the groups – without the name and ▾ below them (user 22 Nov
   2026 «fusion 360 nav-bereiche weglassen»; until then 12 px below every group and beside it, --pi-cap-h) */
.pi-grp { position: relative; display: inline-flex; align-items: center; padding: 0 6px; flex: none; }
.pi-grp + .pi-grp, .pi-grp.pi-sep { border-inline-start: 1px solid var(--line); }
/* grid, undo and redo at the right end of part 2 of the head, in every plan alike (fpBarEnd, wrBarEnd; user 22 Nov 2026 «vor und zurück und raster
   in header teil 2 rechts bei allen plänen»): pushed to the right; when the row scrolls sideways (narrow) they stay in sight at its right edge */
.bar-end { margin-inline-start: auto; position: sticky; inset-inline-end: 0; z-index: 1; background: var(--card); }
.bar-end.pi-grp { border-inline-start: 1px solid var(--line); }
.bar-end .btn { padding-inline: 5px; }  /* the arrows as compact as the symbols beside them (.btn.pi): 28 instead of 40 px each */
.pi-row { display: inline-flex; align-items: center; gap: 4px; }
.pi-row > span:not(.pi-grp, [hidden]) { display: inline-flex; align-items: center; gap: 4px; }  /* buttons of a part of the group centred, not on the baseline */
.dd-menu button:has(> .pi-svg) { display: flex; align-items: center; gap: 8px; }  /* menus: symbol and word, like Fusion */
/* the word in bold on its own row, the hint below it with a little gap (user 22 Nov 2026 «tooltips korriegieren. Abstand nach titel»: «3DKappen ab Etage …»).
   The hint in an element of its own: :only-child counts no text nodes and held the word inline even with the hint behind it */
#tip .tip-head { display: block; font-weight: 700; }
#tip .tip-body { display: block; margin-top: 4px; }
/* it starts at the very top of the view and stands still when the page scrolls (user 30 Oct «scroll bewegt fixen header und schattiert! falsch»):
   it covers the space above it in main (--main-top) instead of moving up through it before it sticks */
.page-head { position: sticky; top: 0; z-index: 6; background: var(--bg); margin-top: calc(-1 * var(--main-top, 10px)); padding-top: var(--main-top, 10px); padding-bottom: 4px; }
/* the head keeps one row (user 30 Oct «zweite zeile im header teil1 verboten. lange titel gekürzt darstellen»): the buttons keep their width,
   a long title ends in «…» and shows in full in its tip (app.js header). On the phone the buttons go to the row below (@media 800px) */
.page-head { flex-wrap: nowrap; }
.page-head-title { flex: 0 1 auto; min-width: 56px; }  /* never less than a few letters and the «i» */
.page-head-title h1 { display: flex; align-items: center; }
.page-head-title h1 .info-i { flex: none; }
.page-head-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-head > .print-button, .page-head-buttons > * { flex: none; }
/* a choice in the head (the version of a plan) is as wide as its longest entry: it is held to a width and gives way like the title (user 30 Oct
   «header verschossen»: a long version name pushed the title with its «i» beneath «Projekt» and the buttons out at the right) */
.page-head-buttons > select { flex: 0 1 auto; min-width: 110px; max-width: 260px; }
@media print { .page-head { position: static; margin-top: 0; padding-top: 0; } .page-head-text { white-space: normal; } }
/* The head with part 2 – the tabs and the settings bar below it – as one box that sticks (app.js headJoin; user 30 Oct «header teil2 2 zeilen!!!
   und header immer fix auch nicht eingehalten»): the page shows neither between them nor at the rounded corners of the bar */
.page-top { position: sticky; top: 0; z-index: 6; background: var(--bg); margin-top: calc(-1 * var(--main-top, 10px)); padding-top: var(--main-top, 10px); padding-bottom: 4px; }
.page-top > .page-head { position: static; margin-top: 0; padding-top: 0; }
.page-top > .cfg-card { margin: 0; }
.page-top > .tabs { margin-bottom: 0; }
.page-top > .tabs + .cfg-card { margin-top: 4px; }
/* the head is compact (user 8 Nov «header bereich weniger hoch, 2/3. überall»; 22 Nov «alle header auf 2/3 höhe verkleinern», again two thirds):
   8 px above the title (--main-top), the title row only as high as its buttons, 4 px to the bars below it – the settings bar and the editing bars
   of the editors – with a thin padding. Buttons, drop-downs and fields of the head and its bars are 23 px high (--ctl-h, before 34), the title 18 px,
   the tabs in it have 2 px above and below their word; not in a menu that opens from the head */
.cfg-card.cfg-line { padding-block: 1px; }
:is(.page-head, .page-top, .fp-cfg, .wr-toolbar) { --ctl-h: 23px; }
:is(.page-head, .page-top) .dd { display: inline-flex; }  /* no line box around its button: the print button made the row 25 px */
:is(.page-head, .page-top, .fp-cfg, .wr-toolbar) :is(.btn, select, input:not([type=checkbox], [type=radio], [type=range], .active-switcher)):not(.dd-menu *, .hmi-legend-body *) { box-sizing: border-box; height: var(--ctl-h); padding-block: 0; line-height: calc(var(--ctl-h) - 2px); }
:is(.page-top, .fp-cfg, .wr-toolbar) .cfg-row { min-height: var(--ctl-h); }
:is(.page-top, .fp-cfg, .wr-toolbar) .cfg-row .btn.nav { width: var(--ctl-h); height: var(--ctl-h); font-size: 15px; }
.page-head-title h1 { font-size: 18px; line-height: var(--ctl-h); }
.page-top > .tabs button { padding-block: 2px; }
@media print { .page-top { position: static; margin-top: 0; padding: 0; } }
/* every card with a title and every section folds (user 30 Oct «bereiche immer einklappbar», app.js foldCards): click on the title, the state is
   kept per view and title. A card folds everything below its title, a section (.fold-head.folded) what follows it up to the next heading (.fold-off) */
.fold-head { cursor: pointer; user-select: none; }
.fold-head::before, details.card > summary::before { content: "▾"; display: inline-block; width: 1em; font-size: 11px; color: var(--muted); transition: transform .15s; }
.card.folded > .fold-head:first-child::before, .fold-head.folded::before, details.card:not([open]) > summary::before { transform: rotate(-90deg); }
[dir=rtl] .card.folded > .fold-head:first-child::before, [dir=rtl] .fold-head.folded::before, [dir=rtl] details.card:not([open]) > summary::before { transform: rotate(90deg); }
/* The titles of one level stand alike (user 31 Oct «alle titel der gleichen ebene ausgerichtet»): a card that is a «details» has a title like the
   cards beside it – the same arrow, size and colour (costs «Alle Sätze»); buttons in a title do not make it higher, so its text stands where the
   text of the titles beside it stands (overview «Alarme») */
details.card > summary { list-style: none; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 10px; }
.card > .fold-head .btn.small { margin-block: -4px; }
.fold-head:hover { color: var(--ink); }
.fold-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.card.folded > :not(.fold-head:first-child), .fold-off { display: none !important; }
.card.folded > .fold-head:first-child { margin-bottom: 0; }
/* section titles scroll along with their section (user 31 Oct «sticky titel wieder entfernen», app.js stuckHeads). A subtitle stands further in
   than the title above it (user 30 Oct «titel untertitel mehr einzug») */
.card > .fold-head:not(:first-child) { padding-inline-start: 14px; }
/* in a window: a group with a «legend» folds like a section (app.js foldCards); folded, only its title stays */
fieldset > legend.fold-head.folded { margin-bottom: 0; }
.btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 7px; padding: 6px 12px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--axis); background: var(--card-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--critical); }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:disabled:hover { border-color: var(--line); background: var(--card); }
/* ‹ / › (navBtn): square, the same size in every bar, at the end greyed out */
.btn.nav, .cfg-row .btn.nav { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 28px; height: 28px; padding: 0; font-size: 17px; line-height: 1; }
.cfg-row .btn.nav { width: 34px; height: 34px; font-size: 18px; }
.btn.nav:disabled { opacity: .35; }
.btn.icon-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 9px; }
.icon { display: inline-flex; }
/* undo and redo arrow (undoIcon): as high as a capital letter, both the same drawing */
.undo-icon { display: inline-flex; vertical-align: -0.15em; }
.undo-icon svg { width: 1.15em; height: 1.15em; }
.dd-arrow { font-size: 10px; color: var(--muted); }
.dd { position: relative; display: inline-block; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; min-width: 190px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 4px; }
.dd-menu button { display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-radius: 6px; padding: 7px 10px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.dd-menu button:hover, .dd-menu button:focus-visible { background: var(--card-2); outline: none; }
.dd-menu button.dd-sep { margin-top: 5px; position: relative; }
.dd-menu button.dd-sep::before { content: ''; position: absolute; left: 4px; right: 4px; top: -3px; border-top: 1px solid var(--line); }
/* PDF collection: number of collected views on the printer icon, list in the dialog */
.pdf-figure { min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.pdf-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.pdf-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.pdf-row .pdf-num { min-width: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pdf-row .pdf-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.icon { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-2); padding: 2px 6px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Fields filled in by the browser (login): Chrome and Edge lay a light yellow over them, in the dark theme a dirty olive (user 20 Oct: «gelbe
   felder hässlich») – hence the field colour as an inset shadow over them and the text in the text colour; Firefox likewise (:autofill), as a separate rule, because
   a browser that does not know a pseudo-class discards the whole rule */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, select:-webkit-autofill, textarea:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--card) inset; box-shadow: 0 0 0 1000px var(--card) inset; -webkit-text-fill-color: var(--ink); caret-color: var(--ink); transition: background-color 9999s ease-out 0s; }
input:autofill, select:autofill, textarea:autofill { box-shadow: 0 0 0 1000px var(--card) inset; -webkit-text-fill-color: var(--ink); caret-color: var(--ink); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
input[type=color] { padding: 2px; height: 34px; width: 60px; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-inline-end: 6px; }
.empty { color: var(--muted); text-align: center; padding: 20px !important; }
/* archived records (filter «Archivierte zeigen», app/archive.py): greyed out with a badge after the first cell */
tr.archived > td { color: var(--muted); }
.archived-badge { margin-left: 6px; }
.error { color: var(--critical); padding: 20px; }
.info { background: var(--card-2); border-radius: 7px; padding: 8px 10px; color: var(--ink-2); grid-column: 1 / -1; }
.guide p { margin: 0 0 6px; }
.guide ol, .guide ul { margin: 0 0 6px; padding-inline-start: 22px; }
.guide li { margin: 2px 0; }
.guide > :last-child { margin-bottom: 0; }
textarea::placeholder { color: var(--muted); opacity: .8; }
.warn-text { color: var(--critical); }

/* ---------- Tables */
/* The column heads stay at the top while a list scrolls – below the head of the view, which stays too (user 30 Oct «header bleibt oben bei scroll in
   allen ansichten»): --sticky-top is the height of that head (--head-h, app.js headStick), 0 inside every box that scrolls by itself. The frame of a list
   only clips (overflow: clip is no scroll box, the heads stick to the page); a list wider than its frame («wide», app.js wrapFit) scrolls sideways in it
   and, held to the height of the window, keeps its heads at its own top. Lists adapt to the width: the heads wrap on narrow screens */
main { --sticky-top: var(--head-h, 0px); }
dialog, .table-wrap.wide, .alarm-list .table-wrap, .plan, .fp-side, .wr-side, .hmi-side, .wr-el-list, .wr-pages, .wr-se-props, .gd-list, .tower-table-pick,
  .tr-selection, .tr-right, .device-group.mini .se-rows, .logtext, .mail_text { --sticky-top: 0px; }
.table-wrap { overflow: clip; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
/* while its column heads stick (app.js stuckHeads) the frame has no rounded top corners: they would cut notches into the heads (user 30 Oct
   «ecke oben im listenhead bei scroll») */
.table-wrap { position: relative; z-index: 1; }
.table-wrap.stuck { border-top-left-radius: 0; border-top-right-radius: 0; }
.table-wrap.wide { overflow: auto; max-height: calc(100vh - var(--head-h, 0px) - 24px); overscroll-behavior-x: contain; }
dialog .table-wrap.wide { max-height: none; }
/* «Anlagennetz und SPS» (plant.js): the view fills the window below the head and does not scroll; the titles of both cards stay, only their lists
   scroll (user 31 Oct «je bereich eine scroll bereich … beides soll bleiben und nur liste scrollen»). The devices take at most half the height
   while the tags are open, the tags the rest; a folded card only its title. A list wider than its card scrolls in its frame (wide) instead */
@media screen and (min-width: 901px) {
  main:has(.pn-layout) { padding-bottom: 16px; }
  .pn-layout { display: flex; flex-direction: column; gap: 16px; }
  .pn-layout > .card { display: flex; flex-direction: column; min-height: 0; margin: 0; }
  .pn-layout > .pn-net { flex: 0 1 auto; }
  .pn-layout > .pn-net:not(.folded):has(~ .pn-tags:not(.folded)) { max-height: 50%; }
  .pn-layout > .pn-tags { flex: 1 1 0; }
  .pn-layout > .pn-tags.folded { flex: none; }
  .pn-list { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; --sticky-top: 0px; }
  .pn-list > .table-wrap { flex: none; }
  .pn-list > .table-wrap.wide { flex: 0 1 auto; min-height: 0; max-height: none; }
}
/* Every list of a view on a wide window scrolls by itself, its column heads at its top (app.js listFitAll: max-height or the height the user
   dragged; user 11 Nov 2026 «jede liste beliebig ziehen können. wenn grösser als ansicht, scroll aktivieren»). Its corners stay in the visible part
   of the frame (sticky, as wide as the frame): the column button at the top right, the grip for the height at the bottom right – no line */
main:has(.table-wrap.fit) { padding-bottom: 16px; }
.table-wrap.fit { overflow: auto; overscroll-behavior-x: contain; --sticky-top: 0px; }
.list-deco { position: sticky; left: 0; height: 0; z-index: 3; pointer-events: none; }
.list-deco.list-top { top: var(--sticky-top, 0px); }
.list-deco.list-bottom { bottom: 0; }
.table-wrap:not(.sizable) > .list-bottom { display: none; }
.table-wrap.sizable:not(.fit):not(.wide) > .list-bottom { position: absolute; left: 0; right: 0; bottom: 0; }  /* a window: the list at full height, the grip at its end */
/* a section of a window scrolls by itself, its height is dragged at the grip (app.js secFitAll, user 21 Nov 2026 «einzelne scrollbare (höhenanpassbare) abschnitte») */
/* no overscroll-behavior here: without a height of its own the section is a scroll box at its end, and «contain» kept the wheel from scrolling the
   window (user 21 Nov 2026 «scrollen teils unmöglich jetzt in popups und listen») */
:is(.wr-sec-body, .fp-sec-body).sizable { position: relative; overflow: auto; --sticky-top: 0px; padding-bottom: 0; }
:is(.wr-sec-body, .fp-sec-body).sizable::after { content: ''; display: block; height: 6px; }  /* the room below the content (wiring.css: padding) as a block after the grip – a padding held the sticky grip 6 px above the bottom */
:is(.wr-sec-body, .fp-sec-body).sizable:not(.fit):not(.scrolls) > .list-bottom { position: absolute; left: 0; right: 0; bottom: 0; }
:is(.wr-sec-body, .fp-sec-body).sizable > .list-deco { margin: 0; }  /* the corner box with the grip: no margin of the body's children – the sticky grip stood 6 px above the bottom */
.list-deco > * { pointer-events: auto; position: absolute; right: 0; }
.list-top > .columns-btn { top: 0; height: var(--list-head-h, 33px); margin: 0; padding: 0 9px; align-items: center; border-radius: 0; background: var(--card-2); opacity: 1; }
.list-top > .columns-btn:hover { background: var(--line); }
table.data.has-columns-btn thead th:last-child { padding-right: 34px; }
.list-grip { bottom: 0; width: 16px; height: 16px; display: flex; align-items: flex-end; justify-content: flex-end; padding: 0 2px 2px 0; box-sizing: border-box; color: var(--muted); cursor: ns-resize; touch-action: none; }
.list-grip:hover, body.list-drags .list-grip { color: var(--ink); }
body.list-drags, body.list-drags * { cursor: ns-resize !important; user-select: none; }
table.data { border-collapse: collapse; width: 100%; }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data .num { text-align: right; }
table.data th { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--card-2); white-space: nowrap; }
/* only the column heads stick: a group row in the body (a th there, e.g. «Sofort beim Ereignis» in «Meine Meldungen») scrolls along like any section
   title – it stuck at the same height and covered the column heads (user 7 Nov «wieso hat es da noch sticky header? überall weg. prüfe überall») */
table.data thead th { position: sticky; top: var(--sticky-top, 0px); z-index: 1; }  /* z-index: the blinking dot of a badge scrolled below would show through */
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--card-2); }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data td.actions .btn { margin-inline-start: 4px; }
table.data tfoot td { font-weight: 600; background: var(--card-2); }
table.data input[type=number] { width: 90px; text-align: right; }
.clickable { cursor: pointer; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover, table.data th.sortable:focus-visible { color: var(--ink); background: color-mix(in srgb, var(--card-2) 70%, var(--axis)); outline: none; }
table.data th.sortable .th-in::after { content: "↕"; margin-inline-start: 4px; font-size: 11px; color: var(--muted); opacity: .5; }
table.data th.sortable[aria-sort=ascending] .th-in::after { content: "▲"; opacity: 1; color: var(--accent); font-size: 9px; }
table.data th.sortable[aria-sort=descending] .th-in::after { content: "▼"; opacity: 1; color: var(--accent); font-size: 9px; }
table.data .col-off { display: none !important; }
table.data th[draggable=true] { cursor: grab; }
table.data th.drags { opacity: .45; }
table.data th.drop-l { box-shadow: inset 3px 0 0 var(--accent); }
table.data th.drop-r { box-shadow: inset -3px 0 0 var(--accent); }
table.data th .columns-grip { position: absolute; top: 0; right: 0; width: 7px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }
table.data th .columns-grip::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 0; width: 2px; border-radius: 1px; background: var(--accent); opacity: 0; }
table.data thead:hover .columns-grip::after { opacity: .25; }
table.data th .columns-grip:hover::after, table.data.columns-drags .columns-grip::after { opacity: 1; }
table.data.columns-drags, table.data.columns-drags * { cursor: col-resize !important; user-select: none; }
table.data.columns-fix { table-layout: fixed; }
table.data.columns-fix th, table.data.columns-fix td { overflow: hidden; text-overflow: ellipsis; }
/* clipCell: one line with «…»; without own column widths at most 20em, with them the width of the column */
.cell-clip { max-width: 20em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data.columns-fix .cell-clip { max-width: none; }
.cell-list { list-style: none; margin: 0; padding: 0; white-space: nowrap; }  /* the products of an order unfolded, one per line (order list) */
.columns-btn { display: inline-flex; vertical-align: middle; margin-inline-start: 6px; padding: 2px; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; opacity: 0; }
table.data thead:hover .columns-btn, .columns-btn:focus-visible { opacity: 1; }
.columns-btn:hover { color: var(--ink); background: var(--line); }
@media (hover: none) { .columns-btn { opacity: .7; } }
.columns-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.columns-row label { flex: 1; }

/* ---------- Status badges (colour + symbol + text) */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 1px 8px 1px 6px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; color: var(--ink); }
.badge::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.badge.good::before { background: var(--good); }
.badge.warning::before { background: var(--warning); }
.badge.serious::before { background: var(--serious); }
.badge.critical::before { background: var(--critical); }
.badge.accent::before { background: var(--accent); }
/* coloured badges also tint frame and background, so the states differ at a glance (user 16 Nov «farb unterschiede markanter») */
.badge.good { border-color: color-mix(in srgb, var(--good) 60%, var(--line)); background: color-mix(in srgb, var(--good) 14%, transparent); }
.badge.warning { border-color: color-mix(in srgb, var(--warning) 60%, var(--line)); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.badge.serious { border-color: color-mix(in srgb, var(--serious) 60%, var(--line)); background: color-mix(in srgb, var(--serious) 14%, transparent); }
.badge.critical { border-color: color-mix(in srgb, var(--critical) 60%, var(--line)); background: color-mix(in srgb, var(--critical) 14%, transparent); }
.badge.accent { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: color-mix(in srgb, var(--accent) 14%, transparent); }
/* Alarm active and unacknowledged (ISA-18.2): the dot blinks until someone acknowledges */
.badge.blink-dot::before { animation: alarm-blink 1s steps(2, jump-none) infinite; }
@keyframes alarm-blink { from { opacity: 1; } to { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .badge.blink-dot::before { animation: none; } }

/* ---------- Forms & dialogs */
dialog.modal { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog.modal.wide { width: min(980px, calc(100vw - 32px)); }
dialog.modal.small { width: min(460px, calc(100vw - 32px)); }
dialog.modal.confirm header { border-bottom: 0; padding-bottom: 4px; }
dialog.modal.confirm footer { border-top: 0; padding-top: 4px; }
.confirm-text { white-space: pre-line; color: var(--ink-2); line-height: 1.55; }
.btn.danger-solid { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.08); background: var(--critical); }
.btn:focus-visible, dialog.confirm footer .btn:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
dialog.modal::backdrop { background: rgba(0, 0, 0, .35); }
dialog.modal[open] { display: flex; flex-direction: column; }
/* Header and action bar always stay visible, only the content scrolls (dvh: phone browser bars) */
dialog.modal > header, dialog.modal > footer { flex: none; }
dialog.modal { max-height: calc(100dvh - 48px); }
dialog header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
/* the room above and below the content lies inside the scroll box, not as its padding: Firefox holds sticky column heads below the padding,
   rows scrolled up showed above them (user 31 Oct «listenheader sticky falsch»); Chrome sticks them at the very top either way */
.modal-body { padding: 0 18px; overflow-y: auto; }
.modal-body::before, .modal-body::after { content: ''; display: block; height: 16px; }
dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
dialog footer .left { margin-inline-end: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 14px; }
.field select { min-width: 0; max-width: 100%; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field .incl-button { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }  /* Input field with a button next to it, e.g. «Next free date» */
.field .incl-button :is(input, select) { flex: 1; min-width: 140px; }
.field label { font-size: 12px; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 11px; }
.field.full { grid-column: 1 / -1; }
.field.check { flex-direction: row; align-items: center; gap: 8px; padding-top: 18px; }
.field.check label { font-size: 14px; color: var(--ink); }

/* ---------- tower table selection */
.tower-table-pick { grid-column: 1 / -1; display: grid; gap: 8px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.tower-table-pick[hidden] { display: none; }
.tower-table-pick .row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tower-table-pick .row b { width: 64px; font-size: 12px; color: var(--ink-2); }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; cursor: pointer; user-select: none; background: var(--card); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Occupancy plan */
.plan { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: auto; max-height: calc(100vh - 210px); }
.plan-inner { min-width: 900px; position: relative; cursor: grab; user-select: none; }
body.plan-drags, body.plan-drags * { cursor: grabbing !important; }
body.plan-drags #tip { display: none !important; }
.plan-row { display: flex; height: 22px; border-bottom: 1px solid var(--line); }
.plan-row .code { width: 72px; flex: none; font-size: 11px; color: var(--ink-2); padding: 3px 8px; position: sticky; left: 0; background: var(--card); z-index: 2; border-inline-end: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.plan-row.inactive .code { color: var(--muted); text-decoration: line-through; }
.plan-row .lane { position: relative; flex: 1; }
.plan-row .lane::after { content: ''; position: absolute; inset: 0; background: var(--we, none); pointer-events: none; z-index: 1; }
.plan-head { position: sticky; top: 0; z-index: 4; background: var(--card-2); height: 30px; }
.plan-head .code { background: var(--card-2); font-weight: 600; padding-top: 7px; }
.plan-head .wk { position: absolute; top: 0; bottom: 0; font-size: 11px; color: var(--ink-2); padding: 7px 4px 0; border-inline-start: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.plan-mod { height: 24px; background: var(--card-2); font-size: 12px; font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--line); position: sticky; left: 0; cursor: pointer;
  z-index: 3; }  /* the section title scrolls along (user 31 Oct «sticky titel wieder entfernen»), above the codes of the rows */
.plan-mod::before { content: "▸"; display: inline-block; width: 14px; text-align: center; font-size: 11px; color: var(--muted); transition: transform .15s; }
.plan-mod.open::before { transform: rotate(90deg); }
.gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.todayline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--critical); z-index: 1; opacity: .7; }
.bar { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; font-size: 11px; line-height: 14px; padding: 0 5px; overflow: hidden; white-space: nowrap; color: var(--ink); cursor: pointer; border-inline-start: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 42%, var(--card)); }
.bar.planned { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, var(--card)) 0 5px, color-mix(in srgb, var(--c) 32%, var(--card)) 5px 10px); }
.bar.harvested { background: var(--card-2); border-inline-start-color: var(--muted); color: var(--muted); }
.bar:hover { outline: 2px solid var(--c); z-index: 2; }
.bar .cut { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--card); opacity: .85; pointer-events: none; }
.plan-row.propagation { height: 34px; background: var(--card-2); }
.plan-row.propagation .code { background: var(--card-2); font-weight: 600; line-height: 1.2; }
.count-seg { position: absolute; top: 0; bottom: 0; overflow: hidden; }
.count-seg .how_many-fill { position: absolute; left: 0; right: 0; bottom: 2px; background: color-mix(in srgb, var(--good) 55%, var(--card)); border-radius: 2px 2px 0 0; box-shadow: inset 1px 0 var(--card-2); }
.count-seg.full .how_many-fill { background: var(--warning); }
.count-seg.over .how_many-fill { background: var(--critical); }
.count-seg span { position: absolute; left: 5px; bottom: 3px; font-size: 11px; line-height: 14px; white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan-mod .muted { font-weight: 400; }
.how_many-cap { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); align-items: center; }
.legend .pat { display: inline-block; width: 22px; height: 10px; border-radius: 3px; vertical-align: middle; margin-inline-end: 5px; border: 1px solid var(--axis); }

/* ---------- Utilisation chart */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 0 0 22px 34px; position: relative; }
.chart .axis { position: absolute; left: 34px; right: 0; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.chart .axis span { position: absolute; left: -34px; top: -8px; width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.chart .axis.base { border-top-color: var(--axis); }
.chart .col { flex: 1; height: 100%; position: relative; display: flex; align-items: flex-end; justify-content: center; }
.chart .col .b { width: min(70%, 44px); background: var(--accent); border-radius: 4px 4px 0 0; min-height: 1px; }
.chart .col.over .b { background: var(--critical); }
.chart .col:hover .b { filter: brightness(1.12); }
.chart .col .x { position: absolute; bottom: -20px; font-size: 11px; color: var(--muted); white-space: nowrap; }

#tip { position: fixed; z-index: 1000; background: var(--tip-bg); color: var(--ink); border: 1px solid var(--axis); font-size: 12px; line-height: 1.45; padding: 7px 10px; border-radius: 7px; pointer-events: none; max-width: 340px; white-space: pre-line; box-shadow: var(--tip-shadow); }

/* ---------- info icons, explanation boxes, help */
.info-i { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-inline-start: 5px; border-radius: 50%; border: 1px solid var(--axis); background: var(--card); color: var(--ink-2); font: italic 600 10px/1 Georgia, serif; cursor: help; padding: 0; vertical-align: middle; flex: none; }
.page-head-title h1 { margin-bottom: 0; }
.page-head-title h1 .info-i { width: 18px; height: 18px; margin-inline-start: 8px; font-size: 12px; }
.info-i:hover, .info-i:focus-visible { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); outline: none; }
.th-in { display: inline-flex; align-items: center; }
th.num .th-in { justify-content: flex-end; }
.dotted { border-bottom: 1px dotted var(--muted); cursor: help; }
.small { font-size: 12px; }
.full-row, .form-grid > .full { grid-column: 1 / -1; }  /* .full: the groups of a data source took one of two columns */
/* Sections of input areas and popups – one style everywhere: light grey area like the sections of the sensors page (.se-section), small light
   title. Forms (schema «section»), groups of the permissions, «send to user» of the feedback, settings cards, intermediate titles in popups. */
.form-grid > .form-section, .permissions fieldset, .fb-send { background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px 12px; margin: 0; }
.form-grid > .form-section { grid-column: 1 / -1; display: grid; grid-template-columns: inherit; gap: inherit; }
.form-section-title, .permissions legend, .fb-send legend, .cfg-head, .modal-body h4 { font-size: 13px; font-weight: 600; text-transform: none;
  letter-spacing: normal; color: var(--ink-2); color: light-dark(var(--ink-2), var(--ink)); }  /* one step below the card titles (h3 14 px); dark mode white */
.form-section > .form-section-title { grid-column: 1 / -1; margin: 0 0 -4px; }
.permissions legend, .fb-send legend { float: left; width: 100%; padding: 0; margin: 0 0 6px; }  /* title inside the area, not on its frame */
/* what follows starts below the title: a row of a permission (flex) may not flow beside the float and was squeezed to zero width
   next to its tile (user 7 Nov «texte nicht in kacheln!») */
.permissions legend ~ *, .fb-send legend ~ * { clear: both; }
:root[data-hints="off"] details.howto { display: none; }  /* setting «Hints: hide» */
details.howto { background: var(--card); border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); border-radius: 8px; margin: 0 0 16px; max-width: 110ch; }
details.howto summary { cursor: pointer; padding: 8px 12px; color: var(--ink-2); font-weight: 600; font-size: 13px; list-style-position: inside; }
details.howto[open] summary { border-bottom: 1px solid var(--line); }
.howto-body, .help section { padding: 4px 14px 10px; color: var(--ink-2); }
.howto-body p, .help p { margin: 8px 0; }
.howto-body ul, .help ul { margin: 6px 0; padding-inline-start: 20px; }
.howto-body li, .help li { margin: 3px 0; }
.formula { font: 500 13px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; background: var(--card-2); color: var(--ink); border-radius: 6px; padding: 4px 10px; margin: 4px 0; overflow-x: auto; white-space: pre-wrap; }
.help { max-width: 920px; }
.help section { margin-top: 14px; padding: 16px 20px; scroll-margin-top: 16px; }
.help h2 { font-size: 17px; margin-bottom: 6px; color: var(--ink); }
.help-toc > h3 { font-size: 17px; color: var(--ink); }
.help .help-toc { padding: 16px 20px; }  /* the contents are a box like the chapters below: its title stands like theirs (user 31 Oct «alle titel der gleichen ebene ausgerichtet») */
.help-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.toc { margin: 0; padding-inline-start: 20px; columns: 2; column-gap: 32px; }
.toc li { margin: 4px 0; }
.formulas input[type=search] { min-width: 280px; }
.formulas [hidden] { display: none; }

.card h3 { display: flex; align-items: center; }
.tile .label { display: flex; align-items: center; }
/* «View as»: coloured frame and hint bar as long as the admin views as another user */
body.view-as_user main { box-shadow: inset 0 0 0 3px var(--warning); }
body.view-as_user .page-head, body.view-as_user .page-top { box-shadow: inset 0 3px 0 var(--warning); }
body.view-as_user .page-top > .page-head { box-shadow: none; }  /* the head covers the top of the frame: it carries the line on */
#view-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 1500; display: flex; align-items: center; gap: 12px;
  background: var(--warning); color: #000; padding: 8px 10px 8px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px); }
@media print { #view-banner { display: none; } body.view-as_user main { box-shadow: none; } }
/* tab of an operator PC (app.js pcBanner): the same bar in the colour of the accent, above that of «View as» when both are there */
#pc-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 1500; display: flex; align-items: center; gap: 12px;
  background: var(--accent); color: #fff; padding: 8px 10px 8px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px); }
body.view-as_user #pc-banner { bottom: 64px; }
@media print { #pc-banner { display: none; } }
/* Popover (index.html): lies in the top layer above modal windows; the browser defaults for popovers (centre, border, background) are reset here */
#toast { position: fixed; inset: auto 20px 20px auto; margin: 0; border: 0; padding: 0; background: none; color: inherit; overflow: visible; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
#toast div { background: var(--ink); color: var(--card); padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); max-width: 420px; }
#toast div.err { background: var(--critical); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { font: inherit; border: 0; background: none; padding: 8px 12px; cursor: pointer; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

@media (max-width: 800px) {
  body { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; border-inline-end: 0; border-bottom: 1px solid var(--line); padding: 0 16px 10px; }
  .brand { padding: 10px 16px 8px; margin: 0 -16px; border-bottom: 0; }
  nav { display: flex; flex-direction: column; }  /* as on the desktop: the groups can be expanded and collapsed */
  button.nav-sep { padding: 10px 12px; margin-top: 2px; }
  main { --main-top: 6px; padding: var(--main-top) 16px 40px; }
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Login / registration / first setup */
body.auth-mode .sidebar, body.auth-mode main { display: none; }
#auth { position: fixed; inset: 0; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 40px;
  background: radial-gradient(1200px 600px at 20% -10%, color-mix(in srgb, #1baf7a 14%, var(--bg)), var(--bg)); }
#auth[hidden] { display: none; }
.auth-card { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px 22px; box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.auth-head { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-head .spacer { flex: 1; }
.auth-head small { display: block; color: var(--muted); font-size: 12px; }
.auth-head select { font-size: 12px; padding: 3px 6px; }
.auth-card h1 { font-size: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.auth-form .btn.primary { padding: 9px 14px; margin-top: 4px; }
.auth-error { background: color-mix(in srgb, var(--critical) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--critical) 40%, var(--card)); color: var(--ink); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.auth-ok { background: color-mix(in srgb, var(--good) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--good) 40%, var(--card)); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 6px; }
.auth-error[hidden], .auth-ok[hidden] { display: none; }
.auth-bottom { margin-top: 16px; text-align: center; font-size: 13px; }

/* ---------- user box in the sidebar */
.user-box { padding: 4px 0 0; border-top: 1px solid var(--line); }
.user-box[hidden] { display: none; }
.user-name strong { display: block; font-size: 13px; }
.user-name small { color: var(--muted); font-size: 12px; }
/* the menu opens upwards above the name: settings, then the account buttons */
.user-menu { display: grid; gap: 10px; padding: 8px 0 4px; }
/* the actions as entries like the navigation: symbol in its tile, then the name (narrow: three per row, style.css «Narrow navigation») */
.user-actions { display: flex; flex-direction: column; gap: 1px; }
.user-act { display: flex; align-items: center; gap: 9px; width: 100%; padding: 4px 6px; border: 0; border-radius: 7px; background: none; color: var(--nav-ink);
  font: inherit; font-size: 13px; text-align: start; white-space: nowrap; cursor: pointer; }
.user-act .nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.user-act:hover { background: var(--card-2); color: var(--ink); }
.user-box > button.nav-sep { display: flex; justify-content: flex-start; gap: 9px; padding: 6px; margin-top: 4px; }
.user-box > button.nav-sep::after { margin-inline-start: auto; }
.user-ini { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); }
.user-box.open > button.nav-sep::after { transform: rotate(-90deg); }
.user-box:not(.open) > .user-menu { display: none; }

/* ---------- users & permissions */
.hint-band { background: color-mix(in srgb, var(--warning) 16%, var(--card)); border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--card)); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.permissions { display: flex; flex-direction: column; gap: 10px; }
.permissions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.permission { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.permission label { cursor: pointer; }
.permission.from-group label { cursor: default; color: var(--muted); }  /* given by the permission group of the user (app.js permissionsMatrix) */
.pw-row { display: flex; gap: 6px; }
.totp-qr { display: block; width: 200px; max-width: 100%; margin: 0 auto; }
.totp-qr svg { display: block; width: 100%; height: auto; }
.totp-secret { font-family: ui-monospace, Menlo, monospace; user-select: all; }
.totp-form { grid-template-columns: 1fr; }
.totp-codes { columns: 2; white-space: nowrap; margin: 0; padding-inline-start: 28px; font-family: ui-monospace, Menlo, monospace; font-size: 15px; line-height: 1.8; }
.totp-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pw-row input { flex: 1; font-family: ui-monospace, Menlo, monospace; }

/* ---------- History */
ul.diff { list-style: none; margin: 0; padding: 0; font-size: 12px; line-height: 1.5; }
ul.diff del { color: var(--muted); }
.bar-cell { display: inline-flex; align-items: center; gap: 6px; }
.bar-cell .bar { display: inline-block; height: 8px; border-radius: 0 4px 4px 0; background: var(--accent); }
.chart.days { gap: 2px; }
.chart.days .col .b { width: 100%; max-width: 18px; border-radius: 3px 3px 0 0; }

/* ---------- System status (admin) */
.meter { height: 6px; border-radius: 3px; background: var(--card-2); margin-top: 8px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--good); }
.meter span.hint { background: var(--warning); }
.meter span.warning { background: var(--serious); }
.meter span.critical { background: var(--critical); }
.sys-card { margin: 16px 0; }
.sys-card .tiles { margin-bottom: 10px; }
.problems { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
table.kv td:first-child { width: 40%; }
table.kv td { word-break: break-word; }

/* ---------- print (button «Print» in the views): always a light layout, controls hidden */
#print-head, #print-content { display: none; }
@media print {
  .lo-card .lo-body { display: block !important; margin-top: 10px; } .lo-head::before { display: none; }
  /* The additions [data-theme] and :not(…) make the rule as specific as the dark colours above – otherwise those win and the printout becomes dark */
  :root, :root[data-theme], :root:not([data-theme="light"]) { color-scheme: light; --bg: #fff; --card: #fff; --card-2: #f3f2ee; --ink: #000; --ink-2: #444; --muted: #777; --line: #d6d5ce; --axis: #b5b4aa;
    --accent: #2a78d6; --good-ink: #006300; --ring: rgba(11, 11, 11, .10); --shadow: none; --tip-bg: #fff; --tip-shadow: none; font-size: 9pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { display: block; background: #fff; }
  .sidebar, #toast, #tip, #auth, dialog, #print-frame, .btn, a.btn, details.howto, .tabs, .info-i, td.actions, table.data th:last-child:empty, table.data th.page-head-empty, .columns-btn, .columns-grip,
  .toolbar > div > p.sub, label:has(input[type=search]:placeholder-shown) { display: none !important; }
  main { padding: 0; }
  body:not(.print-complete) main h1 { display: none; }
  body.print-complete main { display: none; }
  #print-content { display: block; }
  .print-part + .print-part { break-before: page; }
  /* PDF collection: every view with its own header (its label as the title) and its own format; its h1 is dropped */
  .pdf-part.landscape { page: pdf-landscape; } .pdf-part.portrait { page: pdf-portrait; }
  .pdf-part .toolbar h1 { display: none; }
  #print-head, .pdf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12mm; border-bottom: 2px solid #148a5f; padding-bottom: 2.5mm; margin-bottom: 5mm; }
  .print-mark { font-size: 8pt; font-weight: 700; color: #148a5f; letter-spacing: .06em; text-transform: uppercase; }
  .print-mark span { color: var(--muted); font-weight: 400; margin-inline-start: 6px; }
  .print-title { font-size: 15pt; font-weight: 700; margin-top: 1mm; }
  .print-info { color: var(--ink-2); margin-top: .5mm; }
  .print-state { text-align: right; font-size: 8pt; color: var(--muted); white-space: nowrap; }
  h1 { font-size: 13pt; }
  h2 { font-size: 12pt; margin: 0 0 3mm; }
  .toolbar { margin-bottom: 3mm; }
  .toolbar input, .toolbar select, .form-grid input, .form-grid textarea, td input[type=number] { appearance: none; -webkit-appearance: none; border: 0; background: none; padding: 0; color: var(--ink); font: inherit; box-shadow: none; }
  .form-grid textarea { resize: none; }
  .card, .table-wrap, .plan { box-shadow: none; border-radius: 0; }
  .table-wrap, .plan { overflow: visible; max-height: none !important; height: auto !important; }
  .list-deco { display: none; }
  table.data { font-size: 8.5pt; }
  table.data.columns-fix { table-layout: auto; width: 100% !important; }
  table.data.columns-fix th { width: auto !important; }
  table.data thead { display: table-header-group; }
  table.data tr, .tile, .plan-row, .sys-card, .grid.two > .card { break-inside: avoid; }
  .plan-inner { min-width: 0; }
  .plan-head, .plan-row .code, .plan-mod { position: static; }
  .bar { cursor: default; }
  .plan-mod::before { display: none; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

/* store & purchasing */
[hidden] { display: none !important; }
.good-text { color: var(--good); }
.nowrap { white-space: nowrap; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
dl.kv.two { grid-template-columns: max-content 1fr max-content 1fr; }
.kv dt { color: var(--ink-2); font-size: 12px; padding-top: 2px; }
.kv dd { margin: 0; }
@media (max-width: 760px) { dl.kv.two { grid-template-columns: max-content 1fr; } }
.mail_text, .logtext { white-space: pre-wrap; font: 12px/1.45 ui-monospace, Menlo, monospace; margin: 0; }
.mail_text { background: var(--card-2); border-radius: 7px; padding: 10px 12px; max-height: 42vh; overflow: auto; }
textarea.mail_text { width: 100%; box-sizing: border-box; min-height: 30vh; border: 1px solid var(--line); color: inherit; resize: vertical; }
.om-files { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.om-file { display: inline-flex; align-items: center; gap: 2px; }
.logtext { max-height: 9em; overflow: auto; }
.mail-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; font-size: 13px; }
.chk { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.chk-point { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ink-2); }
table.we input, table.we select { font-size: 13px; }
table.we input.short { width: 76px; }
table.we input.medium { width: 110px; }
table.we td.defect { min-width: 170px; }
table.we td.defect > * { display: block; width: 100%; margin-bottom: 3px; }
.storage { color: var(--accent); }
.scan-field { min-width: 220px; }
.hints { margin: 0; padding-inline-start: 0; list-style: none; display: grid; gap: 6px; }
.hints li { line-height: 1.45; }
table.log td { vertical-align: top; }

/* building plan */
/* Settings card (fpTool: view with version · filter) and while editing the row for editing below it; inside it groups with a fine divider in front */
.fp-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }  /* edit row: gaps of 10 px so that it fits into one row at 1400 px */
.fp-group { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
/* since 22 Nov 2026 the groups are those of the symbols (piGroup, «symbole anstatt texte»): their line parts them. A menu entry shows symbol and word side by side */
.fp .dd-menu button:has(> .pi-svg) { display: flex; align-items: center; gap: 8px; }
.fp-tools .fp-check { flex-direction: row; gap: 6px; margin: 0; font-size: 13px; color: var(--ink-2); }
.fp-plan { max-width: 240px; }
.fp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-legend-bottom { padding: 0 2px; }
/* Building plan: filter in the settings card (fpLegend) – the types as entries with ticks in the menu, «Dimensions» set apart at the end */
.fp-filter .pdf-figure { margin-inline-start: 6px; }
.fp-filter .dd-menu { min-width: 230px; max-height: min(70vh, 560px); overflow-y: auto; }
.fp-filter .dd-menu button { display: flex; align-items: center; gap: 8px; }
.fp-filter .dd-menu button::before { content: ''; flex: none; width: 14px; text-align: center; font-weight: 700; color: var(--accent); }
.fp-filter .dd-menu button.on::before { content: '✓'; }
.fp-filter .dd-menu button:not(.on) { color: var(--muted); }
.fp-filter .dd-menu button .muted { margin-inline-start: auto; padding-inline-start: 14px; }
.fp-filter .dd-menu .fp-chip-dims { margin-top: 5px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; }
.fp-chip .muted { font-size: 11px; }
.fp-icon { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.fp-zoom .fp-measure-button { min-width: 30px; padding-inline: 0; display: inline-flex; align-items: center; justify-content: center; }
.fp-chip { font: inherit; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; }
.fp-chip.on { color: var(--ink); border-color: var(--axis); }
.fp-chip:not(.on) .fp-point, .fp-chip:not(.on) .fp-icon { opacity: .3; }
.fp-point { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; flex: none; }
.fp-chip .fp-point { margin-inline-end: 0; }
.fp-floors { display: inline-flex; gap: 4px; }
.fp-floor-hits { margin-inline-start: 5px; padding: 0 5px; border-radius: 99px; background: var(--critical); color: #fff; font-size: 11px; }
.fp-grid { flex-direction: row !important; align-items: center; gap: 6px !important; }
/* Plan on the left, on the right the bar of the selected element, the dimension and the info and fields – as in the HMI and the wiring diagrams
   (user 26 Oct «gebäudeplan r&i und verdrahtungsplan gleich anordnen wie hmi. plan links … rechts. planbild immer a4 quer»): the picture is always
   A4 landscape (297 : 210), as large as the window allows – at most the height without header and settings card down to 16 px above the bottom
   of the window as in the wiring diagrams (--fp-reserved measures fpHeightUpdate), at least 340 px stay for the right column, which takes the
   rest of the width and scrolls by itself. The edit row is at the top of the right column (user 27 Oct «untere bearbeitenleiste auch rechts oben
   bei gp … plan nicht volle höhe») */
main:has(.fp-wrap) { padding-bottom: 16px; }
.fp-wrap { display: grid; grid-template-columns: minmax(0, max(450px, calc((100vh - var(--fp-reserved, 304px)) * 297 / 210))) minmax(340px, 1fr); gap: 12px; align-items: start; }
.fp-canvas { position: relative; padding: 0; overflow: hidden; width: 100%; aspect-ratio: 297 / 210; }
/* as high as the plan; the whole column scrolls (user 21 Nov 2026 «seitenleiste scrolbar machen»): the edit row, the bar of the selected element and
   the panel one below the other, their menus lie over everything (floorplan.js fpExpand); each section of the panel scrolls by itself once its
   height is dragged (app.js secFitAll) */
.fp-side { min-width: 0; align-self: stretch; contain: size; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; overscroll-behavior: contain; }
.fp-side > * { flex: none; }
.fp-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; cursor: grab; background: var(--card); }
.fp-svg:active { cursor: grabbing; }
/* 3D view (floorplan3d.js): the box lies above the plan, SVG and zoom buttons stay hidden in the DOM */
.fp-canvas.fp-3d > *:not(.fp-3d-box, .fp-3d-buttons) { display: none; }
.fp-3d-box { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; background: var(--card); }
.fp-3d-box canvas { display: block; width: 100%; height: 100%; outline: none; cursor: grab; }
.fp-3d-box.fp-3d-works canvas { cursor: crosshair; }
/* Frame for selecting several (Shift/Ctrl + dragging on empty space; fpFrameDraw, fp3FrameDraw) */
svg .fp-frame { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--accent); stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-dasharray: 4 3; }
.fp-3d-frame { position: absolute; pointer-events: none; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px dashed var(--accent); }
/* Crosshair in the centre of the walkthrough (floorplan3d.js, fp3Snap): white with a dark edge – visible on light and dark areas */
.fp-3d-cross { display: none; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); pointer-events: none; }
.fp-3d-box.fp-3d-works .fp-3d-cross { display: block; }
.fp-3d-cross::before, .fp-3d-cross::after { content: ''; position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55); }
.fp-3d-cross::before { left: 10px; top: 0; width: 2px; height: 22px; }
.fp-3d-cross::after { left: 0; top: 10px; width: 22px; height: 2px; }
.fp-3d-box.fp-3d-drags canvas { cursor: move; }
.fp-3d-box:focus-within { box-shadow: inset 0 0 0 2px var(--ring); }
.fp-3d-label { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: none; font-size: 12px; line-height: 1.3; padding: 1px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--card) 85%, transparent); color: var(--ink); white-space: nowrap; border: 1px solid var(--line); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.fp-3d-label.small { font-size: 10px; opacity: .85; }
.fp-3d-label.sel { font-weight: 600; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fp-3d-label.opening { font-size: 10px; opacity: .8; border-style: dashed; }
.fp-3d-buttons { position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; gap: 4px; justify-items: end; }  /* Camera in the picture (fp3Buttons), like .fp-zoom in the 2D plan */
.fp-3d-buttons .btn { min-width: 30px; }
.fp-3d-buttons .fp-measure-button { display: inline-flex; align-items: center; justify-content: center; padding-inline: 0; }
/* Measuring in 3D (floorplan_measure3d.js): lines, points and values over the picture; selection blue-green, under the pointer yellow, distance orange, XYZ legs like the
   arrows of the move cross (x red, y blue, height green) */
.fp-3d-box.fp-3d-measuring canvas { cursor: crosshair; }
.fp-3d-m3 { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.fp-3d-m3 path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.fp-3d-m3 path.thin { stroke-width: 1.5; }
.fp-3d-m3 path.hot { stroke-width: 4; }
.fp-3d-m3 .sel { stroke: #0a9fc0; }
.fp-3d-m3 circle.sel { fill: #0a9fc0; stroke: var(--card); stroke-width: 1.5; }
.fp-3d-m3 .hover { stroke: #ffc928; }
.fp-3d-m3 circle.hover { fill: #ffc928; stroke: #5c4a00; stroke-width: 1; }
.fp-3d-m3 circle.snap { fill: var(--card); stroke: #c79200; stroke-width: 1.5; }
.fp-3d-m3 .dist { stroke: #ff7a00; }
.fp-3d-m3 circle.dist { fill: #ff7a00; stroke: none; }
.fp-3d-m3 .cc { stroke: #8a4fd8; stroke-dasharray: 6 4; }
.fp-3d-m3 .leg.x { stroke: #e8352b; } .fp-3d-m3 .leg.y { stroke: #2f6fdc; } .fp-3d-m3 .leg.z { stroke: #2fa84f; }
.fp-3d-m3 text { font-size: 12px; font-weight: 600; text-anchor: middle; paint-order: stroke; stroke: var(--card); stroke-width: 3px; fill: var(--ink); }
.fp-3d-m3 text.hot { font-size: 14px; }
.fp-3d-m3 text.t-x { fill: #c42a22; } .fp-3d-m3 text.t-y { fill: #2a5fbf; } .fp-3d-m3 text.t-z { fill: #238a3f; }
.fp-measure-box.fp-m3 { display: block; }
.fp-measure-box.fp-m3 .fp-actions { margin: 4px 0 6px; }
.fp-measure-box.fp-m3 .kv .m3-val { font-variant-numeric: tabular-nums; text-align: left; }
/* View cube (fp3Cube): turns with the camera; faces in CSS 3D, each a 3 × 3 grid – middle = face, sides = edges, corners = corners; the cell under the pointer lights up */
.fp-3d-cube { width: 76px; height: 76px; perspective: 420px; display: grid; place-items: center; cursor: pointer; touch-action: none; user-select: none; margin-bottom: 2px; }
.fp-3d-cube-in { position: relative; width: 64px; height: 64px; transform-style: preserve-3d; pointer-events: none; }  /* its own plane through the middle of the cube would catch clicks meant for a face (Chrome) */
.fp-3d-cube-face { position: absolute; inset: 0; box-sizing: border-box; display: grid; pointer-events: auto; grid-template: 12px 1fr 12px / 12px 1fr 12px; backface-visibility: hidden;
  background: color-mix(in srgb, color-mix(in srgb, var(--card) 88%, var(--ink)) 40%, transparent); border: 1px solid color-mix(in srgb, color-mix(in srgb, var(--line) 50%, var(--ink)) 70%, transparent); }
/* see-through (user 21 Nov 2026 «würfel oben rechts durchsichtig machen»): the model shows through the faces, the names keep a halo in the colour of the page */
.fp-3d-cube-cell:hover { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.fp-3d-cube-cell.mid { display: grid; place-items: center; overflow: hidden; font-size: 9px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ink);
  text-shadow: 0 0 2px var(--card), 0 0 3px var(--card); }
.fp-3d-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.fp-eye-on { opacity: .55; }
/* Menu «3D» (fp3Tools): section, names, light & shadow below each other */
.fp-3d-dd .dd-menu { min-width: 220px; padding: 6px 12px; }
.fp-3d-dd .dd-menu > label { display: flex; margin: 0; padding: 5px 0; font-size: 13px; color: var(--ink-2); }
.fp-3d-dd .dd-menu > label:has(> input:disabled) { opacity: .5; }  /* room light without «Light & shadow» */
.fp-3d-dd .dd-menu > .fp-photo-btn { display: block; width: 100%; margin: 6px 0 4px; }
/* Photo over the picture (floorplan_photo.js): the mouse reaches the picture below – moving ends the photo; state, «Save» and «Close» at the bottom left */
.fp-photo-image { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.fp-photo-image[hidden] { display: none; }
.fp-photo-bar { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: flex; gap: 6px; align-items: center; padding: 4px 6px 4px 10px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.fp-3d-split { display: inline-flex; gap: 4px; }  /* 2D: button «3D» and its menu (fp3Pre) */
.fp-3d-pre > .btn { padding-inline: 8px; }
.fp-3d-pre .dd-menu > label:nth-child(2) { margin-bottom: 4px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }  /* orbit / walkthrough above the settings */
/* Fullscreen of the 3D view (fp3Fullscreen, class on <html>): the box fills the window – in the browser's fullscreen the screen –, the tools of the toolbar
   float at the top of the picture. Below the hint (#tip), the notifications and dialogs */
@media screen {
  html.fp-3d-full { overflow: hidden; }
  html.fp-3d-full .fp-canvas.fp-3d { position: fixed; inset: 0; z-index: 900; height: auto; min-height: 0; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; }
  html.fp-3d-full .fp-3d-box:focus-within { box-shadow: none; }
  html.fp-3d-full .fp-3d-tools { position: fixed; top: 8px; inset-inline-start: 8px; z-index: 901; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 6px 8px;
    border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--card) 88%, transparent); box-shadow: var(--shadow); }
}
.fp-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.fp-zoom .btn { min-width: 30px; }
.fp-panel { max-width: none; }  /* the right column (.fp-side) */
.fp-panel h3 { margin: 0 0 10px; display: flex; align-items: center; }
.fp-panel .table-wrap { margin: 8px 0; }
.fp-list, .fp-legend { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 5px; }
.fp-links li { display: flex; align-items: center; gap: 4px; }  /* section «Verknüpfungen» (wrPlanAll) */
.fp-link-kind .fp-list { margin: 4px 0 10px; }  /* per kind of link: R&I, wiring, what stands under the name */
.fp-shows li { flex-wrap: wrap; }
.fp-links li .btn { margin-left: auto; }
.fp-legend li { display: flex; align-items: center; }
.fp-note { white-space: pre-wrap; color: var(--ink-2); }
.fp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.fp-strip:not(:empty) { display: flex; }
.fp-strip { display: none; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 6px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }  /* at the top of the right column: hides nothing */
.fp-strip .fp-actions { margin: 0; }
.fp-strip > .fp-more-list { flex-basis: 100%; margin: 0; }  /* multiple selection: title, buttons and list in one box (user 19 Nov) */
/* Every box of the right column has a title that folds it (floorplan.js fpBoxHead; user 31 Oct «alle bereiche müssen titel haben und einklappbar
   sein!»); in the box that scrolls it sticks at the top, the sections right below it */
.fp-box-head { margin: 0; display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.fp-box.folded > :not(.fp-box-head) { display: none !important; }
.fp-row-new > .fp-box-head, .fp-strip > .fp-box-head, .fp-measure-box > .fp-box-head { flex-basis: 100%; }
/* All titles of one level stand alike (user 31 Oct «bereich bearbeiten darf nicht plötzlich eingeschoben sein. alle titel der gleichen ebene
   ausgerichtet»): the box that scrolls and the box of measuring have the inner space of the boxes above them (10 px at the sides, 6 px at the top –
   in the box that scrolls inside its title), and their titles the same size */
.fp-panel > .fp-box-head { margin: 0; padding: 6px 0; }
/* A box that scrolls by itself with a title at its top has no inner space above the title: a browser lets a title stick only below the padding
   of its scroll box, and what scrolls showed in that strip (user 31 Oct «scroll bewegt "allgemein" mit»); the space is inside the title */
.fp-side > .fp-panel, .gd-list.card { padding-top: 0; }
.fp-side > .fp-panel { padding-inline: 10px; padding-bottom: 10px; }
.gd-list > h3 { margin: 0; padding: 8px 4px 6px; background: var(--card); }
.fp-row-new { margin: 0; padding: 6px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }  /* edit row at the top of the right column: background like the bar below it */
.fp-actions .fp-zorder { width: auto; max-width: 150px; padding: 3px 6px; font-size: 13px; }
/* Editing (user 18 Oct: «Felder teils viel zu gross», «möglichst wenige Zeilen», «abschnitte aber untereinander»): the sections are below each other,
   the fields inside them flow and are as wide as their content: numbers 90 px, selections by the longest choice, text 200 px, ticks in the same row.
   Surface, opacity and colour as a row in fixed columns (fpPair), so the parts are aligned below each other */
.fp-sections { display: grid; gap: 8px; }
.fp-sections > .fp-section { min-width: 0; margin: 0; }
.fp-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 12px; margin-bottom: 8px; }
.fp-form .field, .fp-pair { flex: none; }
.fp-panel .field label { white-space: nowrap; }
.fp-form input[data-figure] { width: 90px; }
.fp-form .field > input:not([type=checkbox]):not([type=color]):not([data-figure]), .fp-panel .fp-form textarea { width: 200px; }
.fp-form select { max-width: 220px; }
.fp-form .fp-check { margin: 0; min-height: 26px; }
.fp-pair { display: grid; grid-template-columns: 170px 130px auto; gap: 12px; align-items: end; }
.fp-panel .field { gap: 2px; }
.fp-panel .field label { font-size: 11px; }
.fp-panel :is(input:not([type=checkbox]):not([type=color]), select, textarea) { padding: 3px 6px; font-size: 13px; border-radius: 6px; }
.fp-panel input[type=color] { height: 26px; }
.fp-corners, .fp-align { max-width: 560px; }
.fp-color { display: flex; gap: 6px; align-items: center; }
.fp-align-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }  /* «Ausrichten» of a multiple selection, as .wr-row */
.fp-check { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; }
.fp-panel > .field { margin-bottom: 10px; }
/* Sections of the side panel (fpSegment): one box each with a header bar for expanding and collapsing, the content indented (user 18 Oct: «Bereiche besser abgrenzen») */
.fp-section { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 8px; }
.fp-section > summary { cursor: pointer; padding: 6px 10px; background: var(--card-2); border-radius: 7px; color: var(--ink-2); font-weight: 600; font-size: 13px; list-style-position: inside; }
.fp-section[open] > summary { border-bottom: 1px solid var(--line); border-radius: 7px 7px 0 0; color: var(--ink); }
.fp-section > summary:hover { color: var(--ink); }
.fp-section > :not(summary) { margin-inline: 10px; }
.fp-section > summary + * { margin-top: 8px; }
.fp-section[open] { padding-bottom: 2px; }
details.fp-section details.fp-section { margin-inline-start: 14px; }  /* a section in a section stands further in (user 30 Oct «titel untertitel mehr einzug») */
.small { font-size: 12px; }
/* Lines of the plan keep their width in screen pixels at every zoom (user 2 Nov: «liniendicke auch beibehalten … für alle linien»): elements with
   non-scaling-stroke, the lines inside the patterns (grid, hatching) by --px (metres per pixel, fpViewBox; in the printout per print pixel) */
.fp-r1 { fill: none; stroke: var(--line); stroke-width: calc(var(--px, .066) * .3px); }
.fp-r5 { fill: none; stroke: var(--axis); stroke-width: calc(var(--px, .066) * .6px); }
.fp-bg { pointer-events: none; }
.fp-axis text { font-size: .6px; fill: var(--muted); text-anchor: middle; pointer-events: none; }
.fp-hall-wall { fill: var(--card-2); fill-opacity: .55; stroke: var(--ink-2); stroke-width: .6px; vector-effect: non-scaling-stroke; }
/* Wall as a band of its thickness: hall outside on the outline, room and hull inside (fpWallBand); outline and band with a fine line */
.fp-wall-band { fill-opacity: .8; stroke-width: .6px; vector-effect: non-scaling-stroke; }
.fp-hall-band { fill: var(--ink-2); stroke: var(--ink-2); }
svg .fp-el .fp-area.fp-incl-wall, svg .fp-passive .fp-area.fp-incl-wall { stroke-width: .6px; vector-effect: non-scaling-stroke; }
.fp-el.sel .fp-wall-band { fill: var(--accent); stroke: var(--accent); }
.fp-el.hits .fp-wall-band { fill: var(--critical); stroke: var(--critical); }
.fp-hall-name { font-size: .7px; fill: var(--muted); font-weight: 600; pointer-events: none; }
.fp-el { outline: none; }
.fp-el .fp-area { fill-opacity: .2; stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.fp-el .fp-dashed { fill-opacity: .12; }
/* Line style of the outline in pixels, as its width */
.fp-line-stroke { stroke-dasharray: 7 5; }
.fp-line-point { stroke-dasharray: .1 5; stroke-linecap: round; }
.fp-line-dash_dot { stroke-dasharray: 10 5 .1 5; stroke-linecap: round; }
.fp-el:not(.sel):not(.hits) .fp-line-no, .fp-passive .fp-line-no { stroke: none; }
.fp-hatch { stroke: var(--axis); stroke-width: calc(var(--px, .066) * .75px); }
.fp-pattern { opacity: .6; }
.fp-name { fill: var(--ink); text-anchor: middle; font-weight: 600; pointer-events: none; }
.fp-under { fill: var(--ink-2); text-anchor: middle; pointer-events: none; }
.fp-lock { text-anchor: end; pointer-events: none; }
.fp-bar-bg { fill: var(--line); }
/* Highlights (mouse, selection, hits, multiple selection) in screen pixels: in metres the frame of a small area grew with the zoom until it covered
   the whole area (user 2 Nov: «der dicke grüne rahmen») */
.fp-el:not(.fp-hall):hover .fp-area, .fp-el:focus-visible .fp-area { fill-opacity: .32; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.fp-el.sel .fp-area, .fp-el.sel .fp-hall-wall { stroke: var(--accent); stroke-width: 3px; vector-effect: non-scaling-stroke; fill-opacity: .35; }
.fp-el.draggable_item { cursor: move; }
.fp-el.dimmed { opacity: .22; }
.fp-el.hits .fp-area { stroke: var(--critical); stroke-width: 4px; vector-effect: non-scaling-stroke; fill-opacity: .4; }
.fp-ghost rect, .fp-ghost polygon, .fp-ghost ellipse { fill: none; stroke: var(--muted); stroke-width: .75px; stroke-dasharray: 5px 4px; vector-effect: non-scaling-stroke; }  /* thin at every zoom (user 2 Nov: «strichlinie anderer geschosse dünner») */
.fp-ghost text { fill: var(--muted); font-style: italic; }
.fp-corner { fill: #fff; stroke: var(--accent); stroke-width: 2px; vector-effect: non-scaling-stroke; cursor: move; }
.fp-edge { fill: var(--accent); fill-opacity: .45; stroke: #fff; stroke-width: 1px; vector-effect: non-scaling-stroke; cursor: copy; }
.fp-corners { margin: 0 0 10px; display: grid; gap: 4px; font-size: 13px; }
.fp-align { display: grid; gap: 6px; margin: 0 0 10px; font-size: 13px; }
.fp-align select { width: 100%; box-sizing: border-box; }
.fp-align .fp-actions { margin: 0; }
.fp-corners-head { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.fp-corner-row { display: grid; grid-template-columns: 18px 1fr 1fr auto; gap: 6px; align-items: center; }
.fp-corner-row input { width: 100%; box-sizing: border-box; }
.fp-svg.fp-measuring, .fp-svg.fp-measuring .fp-el { cursor: crosshair; }
/* Dimensioning according to the standard: thin extension and dimension lines, filled arrows at the ends, dimension above the line – everything in the text colour (black, white in dark mode) */
.fp-dim line, .fp-measurements line { stroke: var(--ink); stroke-width: .75px; fill: none; vector-effect: non-scaling-stroke; }
.fp-dim line.fp-dim-pending { stroke-dasharray: 6 4; }
.fp-dim polygon.fp-dim-arrow, .fp-measurements polygon.fp-dim-arrow { fill: var(--ink); stroke: none; }
.fp-dim line.fp-dim-part, .fp-measurements line.fp-dim-part { stroke-width: .5px; stroke-dasharray: 4 3; opacity: .8; }  /* legs of a slanted measurement */
.fp-dim polygon.fp-dim-part, .fp-measurements polygon.fp-dim-part { opacity: .8; }
.fp-dim line.fp-dim-snap { stroke-width: .75px; stroke-dasharray: 3 3; opacity: .7; }
/* Reference object under the mouse while measuring: outline, filled for the object centre; edge thick; triangle on the edge centre */
.fp-dim polygon.fp-dim-ref { fill: none; stroke: var(--accent); stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-dim polygon.fp-dim-ref-full { fill: var(--accent); fill-opacity: .22; }
.fp-dim line.fp-dim-ref-hem { stroke: var(--card); stroke-width: 7px; stroke-linecap: round; opacity: .9; }
.fp-dim line.fp-dim-ref-edge { stroke: var(--accent); stroke-width: 4px; stroke-linecap: round; }
.fp-dim polygon.fp-dim-ref-triangle { fill: var(--accent); stroke: var(--card); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.fp-dim polygon.fp-dim-ref-active { fill: #fff; stroke: var(--accent); stroke-width: 2px; }
.fp-dim rect.fp-dim-ref-square { fill: #fff; stroke: var(--accent); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.fp-dim circle.fp-dim-point, .fp-measurements circle.fp-dim-point { fill: none; stroke: var(--ink); stroke-width: .75px; vector-effect: non-scaling-stroke; }
.fp-dim text, .fp-measurements text { fill: var(--ink); stroke: var(--card); paint-order: stroke; stroke-linejoin: round; text-anchor: middle; font-weight: 500; font-family: system-ui, sans-serif; }
.fp-measurements line.fp-m-line { stroke: transparent; stroke-width: 14px; pointer-events: stroke; cursor: pointer; }
.fp-svg.fp-measuring .fp-measurements line.fp-m-line { pointer-events: none; }
.fp-measurements text.fp-m-hits { pointer-events: all; cursor: pointer; }
.fp-measurements .fp-m.sel .fp-m-hits { cursor: move; }  /* selected: dimension line and dimension can be dragged */
.fp-measurements .fp-m.sel line:not(.fp-m-line) { stroke-width: 1.5px; }
.fp-measurements .fp-m.sel text.fp-m-text { font-weight: 700; }
.fp-measurements .fp-m.fp-m-off text.fp-m-text { fill: var(--critical); }  /* driving dimension that does not hold (they contradict each other) */
.fp-dim-input { position: absolute; transform: translate(-50%, -50%); width: 7.5em; z-index: 5; padding: 1px 4px; font-size: 13px; text-align: center; }  /* value at the dimension (Fusion 360) */
.fp-dim-row { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.fp-dim-row .fp-dim-value { width: 7em; }
.fp-measure-box .fp-check { margin: 0; }
.fp-dim-off-note { color: var(--critical); font-size: 13px; }
.fp-m-del { pointer-events: all; cursor: pointer; }
.fp-measurements .fp-m-del circle.fp-m-del-circle { fill: var(--critical); stroke: #fff; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.fp-m-del-cross { fill: none; stroke: #fff !important; stroke-width: 2px; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-measure-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 6px 10px; }
.fp-measure-box h3 { margin: 0; }
.fp-measure-box .fp-actions { margin: 0; }
.fp-measure-box .kv { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; }
.fp-measure-box p { margin: 0; flex: 1 1 260px; }
.fp-measure-box[hidden], .fp-panel[hidden] { display: none; }
/* Flyover (floorplan_fly.js): boxes of the right column – the list of points takes the rest of the height and scrolls by itself – and the path in the floor plan
   (colours as in the old tool: path blue, points blue, the selected one orange, view handles violet / yellow, the camera at the time shown green) */
.fp-fly-box { padding: 6px 10px; display: flex; flex-direction: column; gap: 8px; }
.fp-fly-box[hidden] { display: none; }
.fp-fly-box .fp-actions { margin: 0; align-items: center; }
.fp-fly-form { gap: 6px 12px; }  /* two columns, the label beside its field: the point fits without pushing the list of points away */
.fp-fly-form .field { display: flex; flex-direction: row; align-items: center; gap: 6px; min-width: 0; }
.fp-fly-form .field > label { flex: none; margin: 0; white-space: nowrap; }
.fp-fly-form input:not([type=checkbox]) { flex: 1 1 auto; width: 100%; min-width: 0; }
.fp-side.fp-fly-side { overflow-y: auto; overscroll-behavior: contain; }  /* only if the window is very low: the column scrolls, the list keeps a few rows */
.fp-fly-choice { width: auto; max-width: 200px; }
.fp-fly-bar { display: flex; align-items: center; gap: 8px; }
.fp-fly-range { flex: 1; min-width: 0; }
.fp-fly-clock { font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fp-side > .fp-fly-list { flex: 1 1 auto; min-height: 150px; overflow: hidden; }
.fp-fly-rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.fp-fly-row { display: grid; grid-template-columns: 2.2em 4.6em 3.6em 3.9em 3.2em minmax(0, 1fr); gap: 6px; width: 100%; padding: 2px 4px; border: 0; border-radius: 4px;
  background: none; color: var(--ink); font: inherit; font-size: 12px; text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; }
.fp-fly-row:hover { background: var(--line); }
.fp-fly-row.sel { background: rgba(255, 140, 0, .2); font-weight: 600; }
.fp-fly-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-fly-layer .fp-fly-path { fill: none; stroke: #1f5fd6; stroke-width: 2.5px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-fly-layer .fp-fly-tick { fill: #1f5fd6; pointer-events: none; }
.fp-fly-layer .fp-fly-cone { fill: rgba(170, 60, 220, .18); pointer-events: none; }
.fp-fly-layer .sel .fp-fly-cone { fill: rgba(255, 190, 0, .25); }
.fp-fly-layer .fp-fly-aim { stroke: #a040d0; stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-fly-layer .sel .fp-fly-aim { stroke: #e8a000; }
.fp-fly-layer .fp-fly-handle { fill: #c070f0; stroke: #000; stroke-width: 1px; vector-effect: non-scaling-stroke; cursor: crosshair; }
.fp-fly-layer .sel .fp-fly-handle { fill: #ffc400; }
.fp-fly-layer .fp-fly-dot { fill: #1f5fd6; stroke: #fff; stroke-width: 1.5px; vector-effect: non-scaling-stroke; cursor: move; }
.fp-fly-layer .sel .fp-fly-dot { fill: #ff5a00; }
.fp-fly-layer .fp-fly-label { fill: var(--ink); paint-order: stroke; stroke: var(--card); stroke-width: 3px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-fly-layer .sel .fp-fly-label { font-weight: 700; }
.fp-fly-layer .fp-fly-now-cone { fill: rgba(0, 200, 120, .3); stroke: #00a060; stroke-width: 1px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-fly-layer .fp-fly-now { fill: #00c070; stroke: #000; stroke-width: 1px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-snap line { stroke: var(--critical); stroke-width: 1px; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.fp-handle { fill: var(--accent); stroke: #fff; stroke-width: 1px; vector-effect: non-scaling-stroke; cursor: nwse-resize; }
.fp-handle.fp-line-end { cursor: move; }  /* an end of a line: dragged along the line */
/* Move cross at the selection (fpGizmo2d), drawn like the manipulator of Fusion 360: block arrows light with a grey edge, a thin grey ring with a round knob, a
   small grey plate and a light point in the middle; the handle under the pointer and the one dragged GreenState green, the others dimmed while dragging. A wide
   transparent line makes the thin ones easy to grab */
.fp-gizmo { --gz-fill: #fafafa; --gz-edge: #4d4d4d; --gz-ring: #a3a3a3; --gz-plate: #dadada; --gz-dot: #6e6e6e; --gz-hot: #60b946; --gz-hot-edge: #1a7a35; }
.fp-gizmo-hit { stroke: transparent; stroke-width: 14px; vector-effect: non-scaling-stroke; fill: none; }
.fp-gizmo-head { fill: var(--gz-fill); stroke: var(--gz-edge); stroke-width: 2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.fp-gizmo-line { fill: none; stroke: var(--gz-ring); stroke-width: 1.2px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-gizmo-knob { fill: var(--gz-fill); stroke: var(--gz-edge); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.fp-gizmo-dot { fill: var(--gz-dot); pointer-events: none; }
.fp-gizmo-plane { fill: var(--gz-plate); stroke: var(--gz-edge); stroke-width: 1px; vector-effect: non-scaling-stroke; cursor: move; }
.fp-gizmo-mid { fill: var(--gz-fill); stroke: var(--gz-edge); stroke-width: 1.5px; vector-effect: non-scaling-stroke; cursor: move; }
.fp-gizmo-x { cursor: ew-resize; } .fp-gizmo-y { cursor: ns-resize; } .fp-gizmo-turn { cursor: grab; }
.fp-gizmo-arrow:hover .fp-gizmo-head, .fp-gizmo-turn:hover .fp-gizmo-knob, .fp-gizmo-plane:hover, .fp-gizmo-mid:hover,
.fp-gizmo.fp-gz-busy .fp-gz-on .fp-gizmo-head, .fp-gizmo.fp-gz-busy .fp-gz-on .fp-gizmo-knob, .fp-gizmo.fp-gz-busy .fp-gz-on.fp-gizmo-plane, .fp-gizmo.fp-gz-busy .fp-gz-on.fp-gizmo-mid {
  fill: var(--gz-hot); stroke: var(--gz-hot-edge); }
.fp-gizmo-turn:hover .fp-gizmo-line, .fp-gizmo.fp-gz-busy .fp-gz-on .fp-gizmo-line { stroke: var(--gz-hot); stroke-width: 2px; }
.fp-gizmo.fp-gz-busy [data-gizmo]:not(.fp-gz-on) { opacity: .25; }
/* Value box at the move cross (fpGizmoInput): small, beside the handle, over the plan or the 3D picture */
.fp-gz-box { position: absolute; z-index: 5; display: grid; gap: 3px; padding: 4px 6px; border-radius: 6px; background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25); font-size: 12px; pointer-events: auto; }
.fp-gz-row { display: grid; grid-template-columns: auto 64px auto; gap: 4px; align-items: center; margin: 0; }
.fp-gz-label { color: var(--ink-2); font-weight: 600; min-width: 18px; }
.fp-gz-field { width: 64px; padding: 2px 4px; font-size: 12px; text-align: right; }
.fp-gz-unit { color: var(--ink-2); }
/* Doors, gates, windows in the wall; furnishings in the detail plan. Stroke widths in screen pixels (non-scaling-stroke), so that they stay equally fine in the
   whole plan and in the strongly enlarged detail plan */
.fp-plan { max-width: 230px; }
.fp-opening-new { display: inline-flex; gap: 4px; }
.fp-opening polygon, .fp-opening polyline, .fp-opening path, .fp-kind .fp-area, .fp-passive .fp-area { vector-effect: non-scaling-stroke; }
.fp-gap { fill: var(--card); stroke-width: 1px; }
.fp-glass { fill: none; stroke-width: 2px; }
.fp-roller-door { fill: none; stroke-width: 3px; stroke-dasharray: 7 4; }
.fp-leaf { fill: none; stroke-width: 2px; stroke-linecap: round; }
.fp-door-handle { stroke-width: 2px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-swing { fill-opacity: .12; stroke-width: 1px; stroke-dasharray: 4 3; }
.fp-slide-path { fill: none; stroke-width: 1px; stroke-dasharray: 4 3; }
.fp-gate-name { font-weight: 600; pointer-events: none; }
.fp-gate-name.fp-title-drag { pointer-events: auto; cursor: move; }
.fp-opening:hover .fp-gap, .fp-opening:focus-visible .fp-gap { stroke-width: 2px; }
.fp-opening.sel .fp-gap { stroke: var(--accent); stroke-width: 2.5px; }
/* Multiple selection: unticked elements (in the list, not changed along) dashed; list in the side panel with its own scrollbar */
.fp-el.fp-more-off .fp-area, .fp-el.fp-more-off .fp-hall-wall { stroke: var(--accent); stroke-width: 2px; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.fp-opening.fp-more-off .fp-gap { stroke: var(--accent); stroke-dasharray: 3 3; }
.fp-el.fp-more-show .fp-area, .fp-el.fp-more-show .fp-hall-wall { stroke: var(--critical); stroke-width: 4px; vector-effect: non-scaling-stroke; }  /* mouse on the row of the list */
.fp-opening.fp-more-show .fp-gap { stroke: var(--critical); stroke-width: 4px; }
.fp-more-list { max-height: 240px; overflow: auto; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.fp-more-list .fp-check { margin: 0; align-items: flex-start; }
.fp-more-list .fp-point { flex: none; margin-top: 4px; }
.fp-more-choice { width: auto; max-width: 150px; padding: 3px 6px; font-size: 13px; }
.fp-opening.hits .fp-gap { stroke: var(--critical); stroke-width: 3px; }
.fp-passive .fp-area { fill-opacity: .3; stroke-width: .7px; }
.fp-el.fp-kind .fp-area { fill-opacity: .3; stroke-width: 1.5px; }
.fp-el.fp-kind:not(.fp-hall):hover .fp-area, .fp-el.fp-kind:focus-visible .fp-area { fill-opacity: .42; stroke-width: 2px; }
.fp-el.fp-kind.sel .fp-area { stroke-width: 3px; fill-opacity: .45; }
.fp-el.fp-kind.hits .fp-area { stroke-width: 3px; }
/* Sub-room (walls as a strong outline), wall (opaque), guide line (outline only; a wide invisible margin makes it clickable) */
.fp-el.fp-kind .fp-area.fp-masonry, .fp-passive .fp-area.fp-masonry { fill-opacity: .08; stroke-width: 3px; }
.fp-el.fp-kind:not(.fp-hall):hover .fp-area.fp-masonry, .fp-el.fp-kind:focus-visible .fp-area.fp-masonry { fill-opacity: .14; stroke-width: 3.5px; }
.fp-el.fp-kind.sel .fp-area.fp-masonry { fill-opacity: .16; stroke-width: 4px; }
.fp-el.fp-kind .fp-area.fp-solid, .fp-passive .fp-area.fp-solid { fill-opacity: .85; stroke-width: 1px; }
.fp-el.fp-kind:not(.fp-hall):hover .fp-area.fp-solid, .fp-el.fp-kind:focus-visible .fp-area.fp-solid { fill-opacity: 1; }
.fp-el.fp-kind.sel .fp-area.fp-solid { fill-opacity: .9; stroke-width: 2.5px; }
.fp-passive .fp-area.fp-help { stroke-width: 1px; }
/* Railing: line on the axis (fpRailing2d), stronger than an outline; posts as dots */
.fp-el.fp-kind .fp-area.fp-railing-line, .fp-passive .fp-area.fp-railing-line { stroke-width: 2.5px; stroke-linecap: round; }
.fp-el.fp-kind:hover .fp-area.fp-railing-line, .fp-el.fp-kind:focus-visible .fp-area.fp-railing-line { stroke-width: 3.5px; }
.fp-el.fp-kind.sel .fp-area.fp-railing-line { stroke-width: 4.5px; }
.fp-passive .fp-area.fp-railing-line { stroke-width: 1.5px; }
/* Pipe: strong line on the axis (fpPipe2d); cable tray: narrow area in its real width – both with a fixed stroke width, also free in the hall */
/* menus of the edit row (floorplan_items.js, fpMenus): sections side by side, each with the same light heading, as wide as their content (fixed columns
   had pushed a fourth one out sideways); the edit row is at the top of the right column (user 27 Oct): they open downwards over the panel and to the
   left over the plan, so that they stay inside the window; symbol, chair back and rim in the plan */
.fp-sec-dd .dd-menu { top: calc(100% + 4px); bottom: auto; inset-inline-start: auto; inset-inline-end: 0; max-width: 94vw; max-height: min(75vh, 640px); overflow: auto; }
.fp-sec-dd .dd-menu:not([hidden]) { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, max-content); gap: 0 8px; align-items: start; }
.fp-is-turned > .fp-handle:not(.fp-line-end) { display: none; }  /* turned object: the size handle would sit at the unturned corner – size in the side panel */
.fp-sec-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 10px 2px; }
/* 3D models (floorplan_models.js): search in the menu «+ Modell», library, 3D editor */
.fp-model-search { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 10px 6px; max-width: 380px; }
.fp-model-search .fp-model-q { flex: 1 1 calc(100% - 24px); min-width: 0; }
.fp-model-search > .pi-svg { align-self: center; }
.fp-lib-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
/* the menus in two columns, each block moves up below the one above when there is room – no gap below a folded one (user 21 Nov «blöcke immer nach oben
   nachschieben wenn platz. 2 spalten»): columns instead of a grid, whose rows are as high as their highest block */
.fp-lay { columns: 2 310px; column-gap: 12px; }
.fp-lay-menu { min-width: 0; break-inside: avoid; }
.fp-lay-menu > .wr-sec-body { padding-bottom: 4px; }
.fp-lay-sec { margin: 0 0 8px; }
.fp-lay-head { display: flex; align-items: center; gap: 4px; }
.fp-lay-label { flex: 1; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fp-lay-name { flex: 1; min-width: 0; }
.fp-lay-entries { list-style: none; margin: 2px 0 0; padding: 0 0 0 10px; }
.fp-lay-entries li { display: flex; align-items: center; gap: 4px; padding: 1px 0; }
.fp-lay-entry { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.fp-lay-entries select { max-width: 150px; }
/* library: the preview with the orbit beside each list, a selected row, the name as a field in a row (21 Nov 2026) */
/* the preview lies over the right part of the list and stays in view while the section scrolls – no column of its own (user 21 Nov 2026 «3d vorschau muss
   mitlaufen bei scroll nach unten, vorschau überlappen machen und nicht fix spalte»): a sticky box without height at the top of the list, the preview absolute
   in it, below the column heads (--pv-top: their height, set by the library) */
.fp-lib-split { position: relative; min-height: 320px; }
.fp-lib-pv-wrap { position: sticky; top: var(--pv-top, 38px); height: 0; z-index: 4; pointer-events: none; }
.fp-lib-pv { position: absolute; right: 4px; top: 4px; width: 300px; max-width: 45%; pointer-events: auto; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.fp-lib-pv > .fp-lib-canvas { height: 220px; }
.fp-lib-pv-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-lib-table tr.fp-lib-sel > td { box-shadow: inset 3px 0 0 var(--accent); }
.fp-lib-table input.fp-lay-name { width: 100%; min-width: 120px; }
.fp-src-list { list-style: none; margin: 0; padding: 0; }
.fp-src-list li { display: grid; grid-template-columns: minmax(100px, 180px) 1fr auto; gap: 6px; margin-bottom: 4px; }
.fp-me { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr); gap: 14px; }
.fp-me-view { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fp-me-canvas { width: 100%; height: 340px; border: 1px solid var(--line); border-radius: var(--radius); cursor: grab; touch-action: none; }
@media (max-width: 800px) { .fp-me { grid-template-columns: 1fr; } }
/* part editor (floorplan_parts.js): tool bar, the object large, the parts and the chosen one beside it */
dialog.modal.fp-pe-dialog { width: min(1600px, 96vw); max-width: 96vw; }  /* wider than .wide (980 px): the picture large */
/* the editor fills the window between header and action bar, the window itself does not scroll – the picture takes what is left
   (user 21 Nov 2026: «3d editor bildgrösse so dass kein äusserer scroll im popup») */
@media (min-width: 901px) {
  dialog.modal.fp-pe-dialog { height: calc(100dvh - 48px); }
  dialog.modal.fp-pe-dialog > .modal-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .fp-pe-dialog .fp-pe { flex: 1 1 auto; height: auto; }
}
.fp-pe { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto minmax(0, 1fr); gap: 8px; height: min(78vh, 900px); min-height: 300px; }
.fp-pe-bar { grid-column: 1 / -1; display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; min-width: 0; }  /* not clipped: the menus of the groups open below */
/* one row (user 21 Nov 2026): symbols in groups (22 Nov, piGroup); the steps of app.js cfgFit – fit2 without «Raster» and the grid narrower,
   fit4 the row scrolls sideways */
.fp-pe-bar > * { flex: none; }
.fp-pe-bar.fit2 .fp-grid .bar-txt { display: none; }
.fp-pe-bar.fit2 select { max-width: 90px; }
.fp-pe-bar.fit4 { overflow-x: auto; overscroll-behavior-x: contain; }
.fp-pe-view { position: relative; min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fp-pe-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
.fp-pe-view.fp-3d-measuring .fp-pe-canvas { cursor: crosshair; }  /* measuring (floorplan_measure3d.js), as in the 3D view of the plan */
.fp-pe-view.fp-3d-drags .fp-pe-canvas { cursor: move; }  /* dragging the move cross */
/* dimensions of the 3D editor (floorplan_parts.js «Bemassung»): line and value in the picture, driven in brackets, driving bold; a click on the value types it */
.fp-pe-dims path.dimline { stroke: #2a78d6; stroke-width: 1.5; }
.fp-pe-dims path.dimleg { stroke: #2a78d6; stroke-width: 1; stroke-dasharray: 4 3; }
.fp-pe-dims path.pending { stroke-dasharray: 6 4; }
.fp-pe-dims path.hot { stroke-width: 3; }
.fp-pe-dims circle.dimend { fill: #2a78d6; stroke: var(--card); stroke-width: 1; r: 3; }
.fp-pe-dims text.dimval { pointer-events: auto; cursor: text; font-weight: 500; }
.fp-pe-dims text.dimval.drive { font-weight: 700; }
.fp-pe-dim { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 2px 0; }
.fp-pe-dim input[type=text] { width: 6em; }
.fp-pe-dim-name { font-weight: 600; min-width: 2.5em; }
.fp-pe-frame { position: absolute; border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); pointer-events: none; }
.fp-pe-side { overflow: auto; min-height: 0; }
.fp-pe-list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow: auto; }
.fp-pe-list li { display: flex; align-items: center; gap: 6px; padding: 2px 6px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.fp-pe-list li:hover { background: var(--card-2); }
.fp-pe-list li.sel { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--ink); }
.fp-pe-fields { grid-template-columns: 1fr; }
.fp-pe-xyz { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
@media (max-width: 900px) { .fp-pe { grid-template-columns: 1fr; height: auto; } .fp-pe-view { height: 50vh; } }
.fp-inv-sym { fill: var(--ink); text-anchor: middle; font-weight: 600; pointer-events: none; }
.fp-inv-line { fill: #3d3d3d; opacity: .75; }
.fp-inv-rim { fill: none; stroke: #3d3d3d; stroke-width: 1px; vector-effect: non-scaling-stroke; opacity: .6; }
.fp-area.fp-pipe-line { fill: none; stroke-width: 3px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.fp-area.fp-tray-route { fill-opacity: .45; stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.fp-area.fp-air-route { fill-opacity: .3; stroke-dasharray: 6 3; }  /* air duct (30 Oct): like the tray, outline dashed */
.fp-step { stroke-width: 1px; vector-effect: non-scaling-stroke; }  /* stairs: step lines and arrow */
.fp-stairs-arrow { stroke-width: 2px; vector-effect: non-scaling-stroke; }
.fp-slope-arrow { stroke: var(--ink); stroke-width: 2px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }  /* sloped piece: arrow uphill */
.fp-el:hover .fp-area.fp-pipe-line, .fp-el:focus-visible .fp-area.fp-pipe-line, .fp-el:hover .fp-area.fp-tray-route, .fp-el:focus-visible .fp-area.fp-tray-route { stroke-width: 4px; }
.fp-el.sel .fp-area.fp-pipe-line, .fp-el.sel .fp-area.fp-tray-route, .fp-el.hits .fp-area.fp-pipe-line, .fp-el.hits .fp-area.fp-tray-route { stroke-width: 5px; }
.fp-passive .fp-area.fp-pipe-line { stroke-width: 2px; }
/* Riser pipe: circle of the pipe with a dot in the middle, stroke like the horizontal pipe */
.fp-area.fp-pipe-circle { fill-opacity: .35; stroke-width: 3px; vector-effect: non-scaling-stroke; }
.fp-pipe-point { fill: none; stroke-width: 5px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.fp-el:hover .fp-area.fp-pipe-circle, .fp-el:focus-visible .fp-area.fp-pipe-circle { stroke-width: 4px; }
.fp-el.sel .fp-area.fp-pipe-circle, .fp-el.hits .fp-area.fp-pipe-circle { stroke-width: 5px; }
.fp-passive .fp-area.fp-pipe-circle { stroke-width: 2px; }
.fp-el.sel .fp-post { fill: var(--accent); }
/* section line and section (floorplan_cut.js): line dash-dotted with arrows and letters; in the section the level lines dashed */
.fp-area.fp-cut-line { fill: none; stroke-width: 2.5px; stroke-dasharray: 16 5 2 5; vector-effect: non-scaling-stroke; }
.fp-el:hover .fp-area.fp-cut-line, .fp-el:focus-visible .fp-area.fp-cut-line { stroke-width: 3.5px; }
.fp-el.sel .fp-area.fp-cut-line { stroke-width: 4.5px; }
.fp-cut-arrow { stroke-width: 2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fp-cut-letter { font-weight: 700; text-anchor: middle; pointer-events: none; }
.fp-cut-level { stroke: var(--muted); stroke-width: 1px; stroke-dasharray: 8 4; }
.fp-cut-level-text, .fp-cut-wait { fill: var(--muted); }
.fp-cut-title { fill: var(--ink); font-weight: 600; }
.fp-help-grab { fill: none; stroke: transparent; stroke-width: 12px; vector-effect: non-scaling-stroke; pointer-events: stroke; }
.fp-passive .fp-help-grab { pointer-events: none; }
.fp-footprint { fill-opacity: .07; stroke: var(--ink-2); stroke-width: 3px; vector-effect: non-scaling-stroke; pointer-events: none; }
.fp-footprint.fp-incl-wall { stroke: none; }  /* Detail plan of a room: the wall band draws the outline (user 15 Oct: «wieso zwei farben im umriss?») */
.fp-room-name { fill: var(--muted); font-weight: 600; pointer-events: none; }
.fp-version { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; max-width: 100%; }
.fp-version label { min-width: 0; }
.fp-version select { max-width: 220px; min-width: 0; }
/* Settings card of the building plan always in one row (user 24 Oct «1 zeile!», 30 Oct «bearbeitungsbereich im header muss immer auf eine zeile
   passen»): instead of wrapping, the plan and version selections become narrower (down to 110 px); below 1000 px the words «Ansicht», «Plan» and
   «Version» go (their tips stay); only on a phone (below 600 px) the row wraps – its menus open below it. The buttons are symbols in groups (piGroup,
   user 22 Nov 2026 «symbole anstatt texte»): a group with a selection gives way, its row as wide as the group */
.fp-cfg { container-type: inline-size; padding-block: 1px; margin: 0 0 5px; }  /* compact like the head (.cfg-line) */
@container (max-width: 1000px) {
  .fp-cfg > .cfg-head { display: none; }
  .fp-cfg > .cfg-row { grid-column: 1 / -1; }
  .fp-cfg .bar-txt { display: none; }
}
@media (min-width: 600px) {  /* a phone (window below 600 px), not a narrow card: at 900 px the row wrapped (22 Nov 2026) */
  .fp-cfg .cfg-row, .fp-cfg .cfg-row :is(.fp-group, .fp-version, .fp-3d-tools, .pi-row, .seg) { flex-wrap: nowrap; }
  .fp-cfg .cfg-row > .pi-grp:has(.fp-plan, .fp-version) { flex: 0 1 auto; min-width: 0; align-items: stretch; }
  .fp-cfg .pi-row > :is(.fp-group, .fp-version), .fp-cfg .cfg-row :is(.fp-group, .fp-version) > label.fp-grid { flex: 0 1 auto; min-width: 0; }
  .fp-cfg :is(.fp-plan, .fp-version select) { flex: 0 1 auto; min-width: 110px; }
}
.fp-version-hint { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; margin-bottom: 8px; border-inline-start: 4px solid var(--warning); }
@media (max-width: 1100px) {  /* narrow: the plan over the whole width (still A4 landscape), the right column below it, the page scrolls */
  .fp-wrap { grid-template-columns: minmax(0, 1fr); }
  main:has(.fp-wrap) { padding-bottom: 40px; }
  .fp-canvas { width: min(100%, calc((60vh - 44px) * 297 / 210)); }  /* the toolbar wraps (version): the bar of the selected element below stays visible without scrolling */
  .fp-side { contain: none; overflow: visible; }
}
@media print {
  .fp-tools, .fp-3d-buttons, .fp-row-new, .fp-zoom, .fp-panel, .fp-strip, .fp-measure-box, .fp-version-hint { display: none !important; }
  .fp-wrap { display: block; }
  .fp-canvas { height: 170mm; border: 0; }
  .fp-print-sheet h2 { margin: 0 0 2mm; }
  .fp-print-svg { width: 100%; height: 138mm; display: block; border: 1px solid var(--line); }
  .fp-print-sheet-3d img { display: block; max-width: 100%; max-height: 150mm; width: auto; height: auto; margin: 0 auto; border: 1px solid var(--line); }  /* 3D: the picture as shown (fp3Snapshot) */
  .fp-print-legend { display: flex; flex-wrap: wrap; gap: 1mm 5mm; margin-top: 2mm; font-size: 8pt; }
  .fp-print-legend .fp-point { margin-inline-end: 1mm; }
}

/* Video tutorials: the video in the middle, the chapter list on the right (user 30 Oct «videobild mittig und kapitelwahl rechts volle höhe nicht
   mitscrollen. video bereich ohne texte unten und volle höhe») – at full height from 901 px, see the end of this block */
.gd-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; align-items: start; }
.gd-list { padding: 6px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.gd-cap { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 7px; color: var(--ink); text-decoration: none; }
.gd-cap:hover { background: var(--card-2); }
.gd-cap.active { background: var(--accent); color: var(--accent-ink); }
.gd-cap.active small { color: inherit; opacity: .85; }
.gd-group { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 8px 2px; }
.gd-group:first-child { padding-top: 4px; }
.gd-num { min-width: 1.6em; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; align-self: flex-start; }
.gd-cap.active .gd-num { color: inherit; opacity: .85; }
.gd-title { display: flex; flex-direction: column; line-height: 1.25; }
.gd-title small { color: var(--muted); font-size: 11px; }
.gd-video { display: block; width: 100%; max-height: 58vh; background: #000; cursor: pointer; }
.gd-stage { position: relative; background: #000; border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.gd-stage .gd-ut:not(.im-image) { margin: 0; border-radius: 0; }
/* own control bar below the video – covers neither picture nor text */
.gd-strip { display: flex; align-items: center; gap: 8px; padding: 5px 10px; background: #0f1412; color: #fff; }
.gd-button { flex: none; min-width: 36px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.gd-button:hover, .gd-button:focus-visible { background: rgba(255, 255, 255, .14); }
.gd-controller { flex: 1; min-width: 60px; accent-color: var(--accent); cursor: pointer; }
.gd-clock { flex: none; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gd-stage:fullscreen { display: flex; flex-direction: column; border-radius: 0; }
.gd-stage:fullscreen .gd-video { flex: 1; min-height: 0; max-height: none; }
/* Subtitles above the picture (videos from vrec2): the current sentence at the bottom of the picture, white with a light shadow – position and font size are set by tutorials.js */
.gd-ut.im-image { position: absolute; z-index: 1; margin: 0; padding: 0 4%; min-height: 0; border-radius: 0; background: transparent; line-height: 1.25; pointer-events: none; box-sizing: border-box; text-shadow: 0 1px 2px rgba(0, 0, 0, .8), 0 0 5px rgba(0, 0, 0, .55); }
.gd-video::cue { color: #fff; background: transparent; font-family: system-ui, sans-serif; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, .8), 0 0 5px rgba(0, 0, 0, .55); }  /* the same subtitles as a text track when the video plays alone in fullscreen – size: tutorials.js */
.gd-ut { background: #0f1412; color: #fff; font-weight: 600; text-align: center; padding: 8px 14px; min-height: 3.6em; border-radius: 0 0 8px 8px; margin-bottom: 10px; }
.gd-empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--axis); border-radius: 8px; }
/* the view fills the window and the page does not scroll: the video takes the whole height (picture centered), the chapter list scrolls by itself */
@media (min-width: 901px) {
  main:has(> .gd-view) { padding-bottom: 16px; }
  .gd-view { display: flex; flex-direction: column; height: calc(100vh - var(--main-top, 12px) - 16px); }  /* top and bottom padding of main */
  .gd-wrap { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .gd-content { display: flex; flex-direction: column; min-height: 0; }
  .gd-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0; }
  .gd-stage .gd-video { flex: 1; min-height: 0; max-height: none; }
}
@media (max-width: 900px) { .gd-wrap { grid-template-columns: 1fr; } }
.fp-form input:not([type=checkbox]), .fp-form select, .fp-panel textarea { box-sizing: border-box; }

/* ---------- notifications (bell) and phone menu */
.bell { position: relative; background: none; border: 1px solid transparent; border-radius: 8px; padding: 5px 6px; color: var(--ink-2); cursor: pointer; display: inline-flex; }
.bell:hover, .bell:focus-visible { background: var(--card-2); color: var(--ink); }
.bell .figure:not(:empty) { position: absolute; top: -3px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--warning); color: #111; font: 600 10px/16px system-ui, sans-serif; text-align: center; }
.bell.critical .figure:not(:empty) { background: var(--critical); color: #fff; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 18px; color: var(--ink); cursor: pointer; }
ul.notifications { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ul.notifications a { color: var(--ink); text-decoration: none; display: block; padding: 6px 8px; border-radius: 7px; }
ul.notifications a:hover { background: var(--card-2); }
.notification-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.notification-chips a { text-decoration: none; color: var(--ink); }

/* ---------- today (large controls for phone and tablet) */
.today-grid { columns: 380px; column-gap: 16px; }
.today-card { break-inside: avoid; margin-bottom: 16px; }
.today-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.today-row:first-of-type { border-top: 0; }
.today-row.over .today-text > strong, .today-row.over .today-text > a { color: var(--critical); }
.today-text { min-width: 0; flex: 1 1 220px; }
.today-buttons { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.today-buttons .btn { padding: 8px 12px; }
.today-fast { margin-bottom: 14px; flex-wrap: wrap; }
.today-days { margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.small { font-size: 12px; }

/* ---------- observations, check checklist, photo */
.obs-list { display: grid; gap: 12px; }
.card.obs { display: flex; gap: 14px; align-items: flex-start; }
.card.obs img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; flex: none; }
.obs-text { flex: 1; min-width: 0; }
.obs-text p { margin: 6px 0; }
.photo-preview img { max-width: 100%; max-height: 220px; border-radius: 8px; }
.photo-preview { grid-column: 1 / -1; }
.qa-list { display: grid; gap: 4px; }
.qa-point { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.qa-point input[type=checkbox] { width: 20px; height: 20px; flex: none; order: 2; }
.qa-point > span { flex: 1; }
.qa-point input[type=number] { width: 110px; }
.qa-point:has(input[type=checkbox]:checked) { border-color: var(--good); background: color-mix(in srgb, var(--good) 8%, var(--card)); }
.qa-point.nok { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 8%, var(--card)); }

/* ---------- sensors: tiles with sparkline, history with crosshair */
.sensor-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }  /* compact: more sensors at a glance */
.card.sensor { text-align: left; font: inherit; color: inherit; cursor: pointer; display: grid; gap: 2px; padding: 8px 10px; font-size: 13px; }
.card.sensor svg.sparkline { height: 24px; }
.card.sensor:hover { border-color: var(--axis); }
.card.sensor.alarm { border-color: var(--critical); }
.card.sensor.inactive { opacity: .6; }
.devices { display: grid; gap: 10px; margin-bottom: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }  /* one group per device: output (switch) and inputs (readings) */
.devices > * { grid-column: 1 / -1; }
.devices > .device-group.mini { grid-column: auto; }  /* minimised: a quarter of the width, four groups per row */
@media (max-width: 1100px) { .devices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .devices { grid-template-columns: minmax(0, 1fr); } }
.device-group { display: grid; gap: 4px; padding: 10px 12px; align-content: start; }
.device-group h3 { margin: 0; font-size: 15px; }
.device-group.mini h3 { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-group.mini { height: var(--se-group-h, 320px); grid-template-rows: auto minmax(0, 1fr); }  /* as high as when open (operations.js groupHeight) */
.device-group.mini .se-rows { overflow-y: auto; align-content: start; min-height: 0; }  /* many values: scroll */
.se-title-tap { cursor: pointer; user-select: none; }
.se-group-title { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 8em; }
.se-group-buttons { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.se-mini-button { min-width: 28px; justify-content: center; font-weight: 600; }
.se-handle { cursor: grab; touch-action: none; user-select: none; color: var(--muted); padding: 0 2px; font-size: 16px; line-height: 1; }
.device-group.drags { opacity: .45; }
.device-group.drop-prior { box-shadow: inset 4px 0 0 var(--accent); }
.device-group.drop-after { box-shadow: inset -4px 0 0 var(--accent); }
.devices > .device-group:not(.mini).drop-prior { box-shadow: inset 0 4px 0 var(--accent); }
.devices > .device-group:not(.mini).drop-after { box-shadow: inset 0 -4px 0 var(--accent); }
[dir=rtl] .device-group.mini.drop-prior { box-shadow: inset -4px 0 0 var(--accent); }
[dir=rtl] .device-group.mini.drop-after { box-shadow: inset 4px 0 0 var(--accent); }
.drop-end { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.se-drag, .se-drag *, .se-drag-b, .se-drag-b *, .se-drag-s, .se-drag-s * { cursor: grabbing; user-select: none; }
/* dragging a sensor in its group (operations.js dragSensor): a card – the line in the gap before or after the target, a row – above or below it */
.sensor-grid > .drags, .se-rows > .drags { opacity: .45; }
.sensor-grid > .drop-prior { box-shadow: -5px 0 0 var(--accent); }
.sensor-grid > .drop-after { box-shadow: 5px 0 0 var(--accent); }
[dir=rtl] .sensor-grid > .drop-prior { box-shadow: 5px 0 0 var(--accent); }
[dir=rtl] .sensor-grid > .drop-after { box-shadow: -5px 0 0 var(--accent); }
.se-rows > .drop-prior { box-shadow: inset 0 2px 0 var(--accent); }
.se-rows > .drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.se-empty { margin: 0; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius); }
.se-without-empty { display: none; }
.se-drag .se-without-empty { display: grid; }
.se-rows { display: grid; gap: 1px; }
.se-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; background: none; border: 0; border-radius: 6px; padding: 3px 4px;
  font: inherit; font-size: 13px; color: inherit; cursor: pointer; text-align: start; }
.se-row:hover { background: var(--card-2); }
.se-row.inactive { opacity: .6; }
.se-row-name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.se-row-val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.se-point { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.se-point.good { background: var(--good); }
.se-point.critical { background: var(--critical); }
.se-section { margin-bottom: 12px; padding: 6px 12px 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); }  /* raised: the group cards lie on it */
.se-section.shut { padding-bottom: 6px; }
.se-section.drags { opacity: .45; }
/* sensor window: its open alarms at the top, each with «Quittieren» */
.se-alarm-now { grid-column: 1 / -1; display: grid; gap: 6px; padding: 8px 10px; border: 1px solid var(--critical); border-radius: 7px; background: var(--card-2); }
.se-alarm-now-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.se-alarm-now-row > .btn { margin-inline-start: auto; }
.se-section.drop-prior { box-shadow: 0 -4px 0 var(--accent); }  /* dragging an area: the line in the gap before or after the target */
.se-section.drop-after { box-shadow: 0 4px 0 var(--accent); }
.se-section .devices { margin-bottom: 0; }
.se-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.se-section-title { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 16px; color: inherit; cursor: pointer; }
.se-arrow { display: inline-block; transition: transform .15s; color: var(--muted); }
.se-section.shut .se-arrow { transform: rotate(-90deg); }
[dir=rtl] .se-section.shut .se-arrow { transform: rotate(90deg); }
.se-section.shut .se-section-head { margin-bottom: 0; }
/* Page parts sensors / data sources / archive: each its own section with a heading line (data sources and archive collapsible) */
.se-fold { margin-top: 28px; }
.se-fold[data-fold=sensors], .se-fold[data-fold=alarms] { margin-top: 20px; }
/* alarm list (sensors page, overview): at most half the window high, scrolls with the header row standing */
/* the rows snap in below the header row (34 px, fixed): none is cut off half under it (user 27 Oct «immernoch komisch»); the fade
   starts below the header row and is short – it only hints at more above, the first row stays readable */
.alarm-list .table-wrap { max-height: 50vh; overflow-y: auto; scroll-snap-type: y mandatory; scroll-padding-top: 34px; }
.alarm-list th { height: 34px; box-sizing: border-box; }
.alarm-list tbody tr { scroll-snap-align: start; }
.se-fold > summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); list-style: none; cursor: pointer; }
.se-fold > summary::-webkit-details-marker { display: none; }
.se-fold-title { display: inline-flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 18px; }
.se-fold[open] > summary { margin-bottom: 10px; }
.se-fold:not([open]) .se-arrow { transform: rotate(-90deg); }
[dir=rtl] .se-fold:not([open]) .se-arrow { transform: rotate(90deg); }
.se-filter .cfg-row { gap: 8px 10px; }  /* filter bar like trends (trends.css .tr-filter) */
.se-filter input[type=search] { min-width: 14em; }
/* dialog of a data source, tab «Gruppen und Werte» (31 Oct 2026): the groups on the left, the chosen one with its values on the right; both lists
   scroll by themselves, their column heads stick at their top */
.dsrc-pane { min-height: min(62vh, 560px); align-content: start; }  /* the same height in both tabs: the dialog does not jump */
.dsrc-groups { display: grid; grid-template-columns: minmax(240px, 2fr) 3fr; gap: 20px; align-items: start; }
.dsrc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; min-height: 32px; }
.dsrc-head h4 { margin: 0; }
.dsrc-head input[type=search] { max-width: 16em; }
.dsrc-glist, .dsrc-values { max-height: 52vh; overflow: auto; --sticky-top: 0px; }
.dsrc-glist tr.clickable { cursor: pointer; }
.dsrc-glist tr.on td { background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
.dsrc-glist tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.dsrc-gedit { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.dsrc-gedit .field { flex: 1; margin: 0; }
.dsrc-move { margin-top: 8px; justify-content: flex-end; }
@media (max-width: 900px) { .dsrc-groups { grid-template-columns: 1fr; } }
/* tab «Gruppen und Werte» (two columns): the pane fills the dialog, the dialog itself does not scroll, only the list of the groups and the
   values do – the group fields above and «Verschieben» below stay in sight (user 31 Oct «werte dieser gruppe wird abgeschnitten») */
@media (min-width: 901px) {
  dialog.modal.dsrc-fill > .modal-body { display: flex; flex-direction: column; overflow: hidden; }
  .dsrc-fill .dsrc-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .dsrc-fill .dsrc-tabs { flex: none; }
  .dsrc-fill .dsrc-pgroups { flex: 0 1 auto; height: min(62vh, 560px); min-height: 0; display: flex; flex-direction: column; }
  .dsrc-fill .dsrc-groups { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .dsrc-fill .dsrc-col { display: flex; flex-direction: column; min-height: 0; }
  .dsrc-fill .dsrc-col > * { flex: none; }
  .dsrc-fill .dsrc-glist, .dsrc-fill .dsrc-values { flex: 0 1 auto; min-height: 0; max-height: none; }
}
.device-group .sensor-grid { margin-top: 4px; }
.device-group .card.sensor { background: var(--card-2); border-color: var(--axis); }  /* tiles stand out from the group card */
.device-group .card.sensor:hover { border-color: var(--muted); }
.device-group .card.sensor.alarm { border-color: var(--critical); }
.card.sensor.device-outgoing { border-style: dashed; }
.devices-other { margin: 4px 0 8px; }
.sensor-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; align-items: center; }  /* long name + status: the status moves to the next row instead of over the edge */
.sensor-val { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
svg.sparkline { width: 100%; height: 36px; }
svg.timeline { width: 100%; height: auto; max-height: 320px; margin: 8px 0; }
svg.sparkline .line, svg.timeline .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
svg.timeline .grid { stroke: var(--line); stroke-width: 1; }
svg.timeline .limit_value { stroke: var(--critical); stroke-width: 1; stroke-dasharray: 4 4; }
svg.timeline .limit_value.hard { stroke-width: 1.5; stroke-dasharray: none; }  /* LL/HH */
svg.timeline .axis { fill: var(--muted); font-size: 11px; }
svg.timeline .cross { stroke: var(--axis); stroke-width: 1; }
svg.timeline .point { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart .axis.capacity { border-top: 1px dashed var(--critical); }
.chart .axis.capacity span { color: var(--critical); }

/* ---------- Demand planning, invoice totals */
table.inquiry td.missing { background: color-mix(in srgb, var(--critical) 10%, var(--card)); }
table.inquiry td.missing > div:first-child { color: var(--critical); font-weight: 600; }
.totals { justify-self: end; min-width: 260px; display: grid; gap: 4px; }
.totals > div { display: flex; justify-content: space-between; gap: 20px; font-variant-numeric: tabular-nums; }
.totals .total { font-weight: 700; border-top: 2px solid var(--ink); padding-top: 4px; }

@media (max-width: 800px) {
  .menu-btn { display: inline-block; }
  .brand-buttons { flex-direction: row; gap: 4px; }
  .sidebar nav, .sidebar .sidebar-foot { display: none; }
  body.menu-pending .sidebar nav { display: flex; }
  body.menu-pending .sidebar .sidebar-foot { display: block; }
  nav a { padding: 10px 12px; }
  .today-grid { columns: 1; }
  .today-row { flex-wrap: wrap; }
  .today-buttons { width: 100%; justify-content: stretch; }
  .today-buttons .btn { flex: 1; padding: 11px 12px; font-size: 15px; }
  .card.obs { flex-direction: column; }
  .card.obs img { width: 100%; height: 180px; }
  .toolbar { flex-wrap: wrap; }
  /* View header: print button at the top right next to the title, the other buttons in the row below */
  .page-head > .spacer { display: none; }
  .page-head-title { flex: 1 1 0; min-width: 0; }
  .page-head-buttons { order: 1; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
  .page-head-buttons:empty { display: none; }
}
@media (max-width: 1100px) { table.data th { white-space: normal; } }
@media print { .bell, .menu-btn { display: none !important; } }

/* Arabic: only the script runs from right to left – layout, order and alignment of the interface stay as in the other languages.
   Every text follows its own language (hints can be in a different language than the interface); charts and the building plan stay untouched */
html { text-align: left; }
:where(input, textarea, select) { text-align: left; }
#tip, .howto-body, .help section, .field small { unicode-bidi: plaintext; }
:root:lang(ar) body * { unicode-bidi: plaintext; }
:root:lang(ar) svg *, :root:lang(ar) summary { unicode-bidi: normal; }

/* «Active» in lists: switch directly in the row */
input.active-switcher { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; margin: 0; border: 0; border-radius: 10px; background: var(--axis); position: relative; cursor: pointer; vertical-align: middle; transition: background .15s; }
input.active-switcher::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); transition: transform .15s; }
input.active-switcher:checked { background: var(--good); }
input.active-switcher:checked::after { transform: translateX(14px); }
input.active-switcher:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media print { input.active-switcher { appearance: auto; -webkit-appearance: auto; width: auto; height: auto; background: none; } input.active-switcher::after { content: none; } }

/* Conflict when saving (app.js conflictResolve): per field the input and the current value */
.conflict-table td:nth-child(2) { color: var(--muted, inherit); text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.conflict-table td:nth-child(3) { font-weight: 600; }

/* Live updates (live.js): bar above a view whose data changed meanwhile */
.live-hint { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin: 0 0 12px; padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--accent, #2a78d6) 45%, transparent); border-radius: var(--radius, 8px);
  background: color-mix(in srgb, var(--accent, #2a78d6) 10%, var(--card, transparent)); }
.fb-live-settings { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 10px; }

/* a writing request of this button is under way (app.js api): pulse lightly, only after 150 ms */
button.busy { cursor: progress; animation: fms-busy 1.1s .15s ease-in-out infinite; }
@keyframes fms-busy { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { button.busy { animation: none; opacity: .6; } }

/* presence (live.js): who else has the record open – below the head of the window */
dialog.modal > .presence { margin: 0 18px; padding: 6px 10px; border-radius: 6px; font-size: 13px;
  background: color-mix(in srgb, var(--warning, #b8860b) 14%, var(--card, transparent)); border: 1px solid color-mix(in srgb, var(--warning, #b8860b) 40%, transparent); }

/* links between P&ID, wiring and building plan (static/links.js): the filters of a kind are one group in the row, the cells a row of chips */
.lk-fields { display: contents; }
.lk-cell { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; max-width: 100%; }
.lk-chip { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; min-width: 0; max-width: 100%; }
/* in a narrow column the name ends with …, × stays visible (user 4 Nov «wie verknüpfungen entfernen? muss gehen» – it was cut off) */
.lk-chip > :not(.lk-x) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lk-chip > .lk-x { flex: none; }
.lk-cell .btn.small { padding: 0 6px; min-height: 0; line-height: 1.4; }
.lk-star { color: var(--accent); }
/* the choice (lkPick) takes several: the box in front of each row, a marked row tinted */
.lk-pick input.lk-sel, .lk-pick input.lk-sel-all { width: auto; min-height: 0; margin: 0; cursor: pointer; }
.lk-pick tr.lk-chosen > td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
@media print { .lk-cell .btn { display: none; } }
/* above the list of a choice (lkPickCtrl): the sensors chosen, in their order (the first the main value), the control elements chosen */
.lk-above { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 8px 0; }
.lk-machine { font-size: 12px; }
/* dragging a signal in the column «Sensoren» (links.js lkDrag): the chip dragged pale, the line before or after the target – beside it, or
   above and below when the chips stand one under the other */
.lk-cell > .lk-chip[data-i] { cursor: grab; }
.lk-cell > .lk-chip.drags { opacity: .45; }
.lk-cell > .lk-chip.drop-prior { box-shadow: -3px 0 0 var(--accent); }
.lk-cell > .lk-chip.drop-after { box-shadow: 3px 0 0 var(--accent); }
[dir=rtl] .lk-cell > .lk-chip.drop-prior { box-shadow: 3px 0 0 var(--accent); }
[dir=rtl] .lk-cell > .lk-chip.drop-after { box-shadow: -3px 0 0 var(--accent); }
.lk-cell > .lk-chip.lk-drop-v.drop-prior { box-shadow: 0 -2px 0 var(--accent); }
.lk-cell > .lk-chip.lk-drop-v.drop-after { box-shadow: 0 2px 0 var(--accent); }
.lk-dragging, .lk-dragging * { cursor: grabbing; user-select: none; }
body.lk-dragging #tip { display: none !important; }
/* column «Anzeige GP» (lkPickShow): what stands under the name, each with its own label and ▲▼ */
.lk-show-list { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.lk-show .lk-show-label { width: 12em; min-height: 0; padding: 1px 6px; margin-left: 6px; }
/* the further values of an item in the HMI (hmiMoreList) and the control elements on the sensors page */
.hmi-more li { display: flex; align-items: center; gap: 6px; }
.se-point.se-control { background: var(--accent); border-radius: 2px; }
.card.device-control .badge { font-weight: 400; }
/* the card of a control element of the controller: command, setting, feedback (operations.js ctlCard) */
.ct-card { display: flex; flex-direction: column; gap: 6px; cursor: default; }
.ct-card .ct-edit { margin-inline-start: auto; }
.ct-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ct-set { min-height: 28px; }
.ct-lock { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.ct-lock.ct-open .muted { color: var(--warn, #b45309); }
