/* Researcher UI. Calm, modern, system fonts (no external font requests). */
:root {
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --fg: #1c1c1a;
  --muted: #6b6b66;
  --subtle: #9a9a93;
  --accent: #2957a4;
  --accent-hover: #1f4787;
  --accent-soft: rgba(41, 87, 164, 0.10);
  /* AI actions: a light violet, clearly apart from the blue of ordinary buttons */
  --ai: #7a3fd1;
  --ai-soft: #f2ebfc;
  --ai-border: #d9c6f5;
  /* linked elements (app/linked.py): a petrol blue, apart from the blue of buttons and the green of constructs */
  --linked: #0b6e86;
  --linked-soft: rgba(11, 110, 134, 0.11);
  --on-accent: #ffffff;
  --surface-2: #f8f8f5;
  --surface-3: #efeee9;
  --header-bg: rgba(255, 255, 255, 0.92);
  --footer-bg: rgba(250, 250, 247, 0.95);
  --focus-ring: rgba(41, 87, 164, 0.3);
  --border: #e3e2dc;
  --border-strong: #cfcdc5;
  --danger: #b3261e;
  --danger-soft: rgba(179, 38, 30, 0.09);
  --on-danger: #ffffff;
  --ok: #1f6b2a;
  --ok-soft: rgba(31, 107, 42, 0.11);
  --warn: #7a5b00;
  --warn-soft: rgba(200, 150, 0, 0.13);
  --warn-border: rgba(200, 150, 0, 0.45);
  --warn-bar: #e0b400;
  --on-warn: #ffffff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 15, 0.05), 0 1px 1px rgba(20, 20, 15, 0.03);
  --shadow-pop: 0 10px 30px rgba(20, 20, 15, 0.12), 0 2px 6px rgba(20, 20, 15, 0.06);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); padding-bottom: 44px;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; }
/* Links: never underlined. Under the mouse a link gets darker (lighter in the dark mode); keyboard focus shows
   the focus ring. Text links (no class, or only "small") are semi-bold, so they stand out from the text around them by
   more than their colour (WCAG 1.4.1). Links that are a component (button, tab, card, chip) have a class
   or a rule of their own; :where() keeps these rules weak, so such a rule always wins. */
a { color: var(--accent); text-decoration: none; }
a:where(:not([class]), .small) { font-weight: 600; }
a:where(:not([class]), .small):where(:hover) { color: var(--accent-hover); }
.leaflet-container a { font-weight: inherit; }
.leaflet-container .leaflet-control-attribution a:hover, .leaflet-container .leaflet-control-attribution a:focus { text-decoration: none; }
h1 { font-size: 1.55rem; line-height: 1.25; letter-spacing: -0.01em; margin: 0.2em 0 0.6em; }
h2 { font-size: 1.05rem; margin: 0 0 12px; letter-spacing: -0.005em; }
code { font-size: 0.85rem; word-break: break-all; background: var(--surface-3); padding: 2px 6px; border-radius: 5px; }
.icon { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  height: 56px; padding: 0 20px; background: var(--header-bg); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); }
.site-header a { color: var(--fg); text-decoration: none; }
.brand { font-weight: 700; letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 8px; }
.site-header nav { display: flex; gap: 6px; align-items: center; }
/* Narrow windows and phones: the menu wraps below the name instead of running out of the window */
@media (max-width: 800px) {
  .site-header { height: auto; min-height: 56px; flex-wrap: wrap; padding: 6px 12px; row-gap: 2px; }
  .site-header nav { flex-wrap: wrap; row-gap: 2px; justify-content: flex-end; margin-left: auto; }
  .site-header nav a:not(.button), .site-header nav button.link { padding: 6px 8px; }
  .flashes { top: 8px; }
}
.site-header nav a:not(.button), .site-header nav button.link { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 0.925rem; }
/* icon links keep their square: the text-link padding would push the icon off centre */
.site-header nav a.icon-btn { padding: 0; }
.site-header nav a:not(.button):hover, .site-header nav button.link:hover { background: var(--surface-3); color: var(--fg); text-decoration: none; }
.site-header nav a:where(:not([class])), .site-header nav button.link { font-weight: 400; }
/* Signed in: work areas on the left, the rest on the right, the account in a menu at the name */
.site-header.signed-in { justify-content: flex-start; gap: 18px; }
.site-header .nav-tools { margin-left: auto; }
.site-header nav a[aria-current="page"] { background: var(--surface-3); color: var(--fg); font-weight: 600; }
.nav-wide { display: inline-flex; align-items: center; gap: 6px; }
.nav-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--border-strong); }
.nav-menu > summary { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border-radius: 8px;
  color: var(--muted); font-size: 0.925rem; white-space: nowrap; cursor: pointer; }
.nav-menu > summary:hover, .nav-menu[open] > summary { background: var(--surface-3); color: var(--fg); }
.nav-menu > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.nav-menu > summary > .icon:nth-child(2) { display: none; }  /* the three lines: narrow windows only */
.nav-menu-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.nav-menu-panel { position: absolute; z-index: 30; right: 0; top: calc(100% + 8px); min-width: 220px; display: grid; gap: 1px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); }
.site-header .nav-menu-panel a:not(.button), .nav-menu-panel button { display: flex; align-items: center; gap: 10px; box-sizing: border-box; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 0.925rem; font-weight: 400;
  color: var(--fg); text-align: left; cursor: pointer; }
.nav-menu-panel button:hover { background: var(--surface-3); }
.site-header .nav-menu-panel a[aria-current="page"] { background: var(--surface-3); font-weight: 600; }
.nav-menu-panel .icon { color: var(--muted); }
.nav-menu-panel hr { width: 100%; margin: 5px 0; border: 0; border-top: 1px solid var(--border); }
.nav-menu-panel form { margin: 0; }
.nav-menu-panel .theme-sun, :root[data-theme="dark"] .nav-menu-panel .theme-moon { display: none; }
:root[data-theme="dark"] .nav-menu-panel .theme-sun { display: block; }
.nav-narrow { display: none; }
@media (max-width: 1120px) { .nav-menu-name { display: none; } }
/* Narrow windows and phones: one line; the areas, Administration and prices are in the menu */
@media (max-width: 980px) {
  .site-header.signed-in { height: 56px; flex-wrap: nowrap; padding: 0 12px; }
  .site-header.signed-in nav { flex-wrap: nowrap; }
  .site-header .nav-areas, .nav-wide, .site-header .nav-tools > .donate-link { display: none; }
  .nav-narrow { display: grid; gap: 1px; }
  .nav-menu > summary { width: 32px; padding: 0; justify-content: center; }
  .nav-menu > summary > .icon { display: none; }
  .nav-menu > summary > .icon:nth-child(2) { display: block; }
  .site-header details.nav-menu { position: static; }
  .nav-menu-panel { left: 8px; right: 8px; top: calc(100% + 6px); max-height: calc(100vh - 120px); overflow-y: auto; }
  .site-header .nav-menu-panel a:not(.button), .nav-menu-panel button { padding: 11px 12px; font-size: 1rem; }
}
@media (max-width: 800px) { .signed-in ~ main .flashes { top: 64px; } }

.container { max-width: 1440px; margin: 0 auto; padding: 28px 20px 40px; }  /* a column of at most 1400 px, like .tabpage-single */

/* Footer: narrow, fixed */
.site-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: 34px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--footer-bg); backdrop-filter: blur(6px); border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.site-footer a { color: var(--muted); }
.footer-owner, .footer-stats { overflow: hidden; text-overflow: ellipsis; }
.footer-brand { font-family: var(--font-serif); font-weight: 600; font-size: 1rem; color: var(--fg); margin-right: 10px; }
.orcid-link { display: inline-flex; vertical-align: -2px; }

/* Buttons: one look for <a class="button"> and <button class="button"> */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box;
  height: 38px; padding: 0 16px; border: 1px solid var(--accent); border-radius: 8px;
  background: var(--accent); color: var(--on-accent) !important; text-decoration: none; white-space: nowrap;
  font: inherit; font-size: 0.925rem; font-weight: 550; cursor: pointer; vertical-align: middle;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s; }
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
/* one focus ring for everything one can tab to (UI/UX audit 2026-10-03, U32) */
.button:focus-visible, .icon-btn:focus-visible, .tab:focus-visible, .chip:focus-visible, .survey-tabs a:focus-visible,
.admin-tabs a:focus-visible, .facet-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.button-secondary { background: var(--surface); color: var(--fg) !important; border-color: var(--border-strong); }
.button-secondary:hover { background: var(--surface-3); border-color: var(--border-strong); }
.button-small { height: 32px; padding: 0 12px; font-size: 0.85rem; }
/* in a side column a long label wraps instead of making the column scroll sideways (Ralf, 2026-10-03) */
.editor-grid > .sidebar .button, .flow-side .button, .flow-palette .button, .board-side .button { max-width: 100%; white-space: normal; height: auto; min-height: 38px; padding-top: 4px; padding-bottom: 4px; text-align: left; }
.editor-grid > .sidebar .button-small, .flow-side .button-small, .flow-palette .button-small, .board-side .button-small { min-height: 32px; }
.button:disabled { opacity: 0.6; cursor: progress; }
button.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
button.link:hover { color: var(--accent-hover); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent;
  border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--fg); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.icon-btn.danger:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
form.inline { display: inline; margin: 0; }
.toolbar { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.toolbar .button { margin-right: 4px; }

/* Messages */
.flash { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius);
  margin: 0 0 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); font-size: 0.925rem; }
.flash-success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 24%, transparent); }
.flash-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.flash-warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn-bar) 30%, transparent); }
/* Messages after an action: below the header, also when the page opens at an anchor further down.
   The tint lies over the opaque surface colour, so the page does not show through. */
.flashes { position: sticky; top: 64px; z-index: 15; margin: 0 0 16px; display: grid; gap: 8px; }
.flashes .flash { margin: 0; box-shadow: var(--shadow); background: var(--surface); position: relative; overflow: hidden; }
.flashes .flash::before { content: ""; position: absolute; inset: 0; background: var(--accent-soft); pointer-events: none; }
.flashes .flash-success::before { background: var(--ok-soft); }
.flashes .flash-error::before { background: var(--danger-soft); }
.flashes .flash-warning::before { background: var(--warn-soft); }
.flashes .flash > * { position: relative; }
.flash-text { flex: 1; min-width: 0; }
.fl-node.is-here > .fl-head { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; transition: outline-color .6s; }
.fl-tools .icon-btn:disabled { opacity: .3; cursor: default; }
.badge-dirty { background: var(--warn-soft); color: var(--warn); margin-left: 8px; }
.flash-close { margin: -4px -6px -4px 0; flex: none; }
.flash-undo { margin: -3px 0; flex: none; }
.flash.is-leaving { opacity: 0; transition: opacity .4s; }
@media (prefers-reduced-motion: reduce) { .flash.is-leaving { transition: none; } }

/* Layout blocks */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head h1 { margin: 0; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.back-link:hover { color: var(--fg); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin: 16px 0; box-shadow: var(--shadow); }
.card-list, ul.plain, ol.plain { list-style: none; padding: 0; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px;
  box-shadow: var(--shadow); transition: border-color 0.12s; }
.card:hover { border-color: var(--border-strong); }
.card-title { font-weight: 650; font-size: 1.05rem; margin-right: 8px; color: var(--fg); text-decoration: none; }
.card-title:hover { color: var(--accent); }
.card-meta { color: var(--muted); font-size: 0.875rem; margin-top: 4px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 600; padding: 2px 9px;
  border-radius: 999px; background: var(--surface-3); color: var(--muted); vertical-align: middle; letter-spacing: 0.01em; }
.badge-running, .badge-approved { background: var(--ok-soft); color: var(--ok); }
.badge-closed { background: rgba(138, 75, 18, 0.13); color: #8a4b12; }
.badge-paused, .badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-error, .badge-rejected { background: var(--danger-soft); color: var(--danger); }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack label, .block-form label { display: flex; flex-direction: column; gap: 6px; }
.stack label, .label-title, legend { font-weight: 600; font-size: 0.925rem; }
.hint { font-size: 0.82rem; font-weight: 400; color: var(--muted); margin-left: 6px; }
label.check, .stack label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; flex-wrap: wrap; }
input, textarea, select { font: inherit; font-size: 0.95rem; padding: 8px 11px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--surface); color: var(--fg); max-width: 100%; transition: border-color 0.12s, box-shadow 0.12s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
input:disabled, textarea[readonly], input[readonly], select:disabled { background: var(--surface-3); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--accent); padding: 0; }
textarea { resize: vertical; }
input.narrow { width: 7em; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; }
legend { padding: 0 6px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
.row-fields { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.row-fields .link-mode { flex: 0 0 210px; min-width: 0; }
.row-fields .link-mode select { width: 100%; }
/* question texts in a row of fields: as wide as the row allows, the short labels beside them keep their width */
.row-fields > .wide-field { flex: 1 1 320px; min-width: 0; }
.row-fields > .wide-field input { width: 100%; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
/* a form that saves by itself: "Fertig" and what happened to the last change, in place of "Speichern" */
.autosave-bar { align-items: center; gap: 12px; }
.autosave-status { color: var(--muted); font-size: 0.875rem; }  /* as .small: a note next to it stands on the same line */
.autosave-status.is-ok::before { content: "✓ "; color: var(--ok); }
.autosave-status.is-warn, .autosave-status.is-error, .autosave-status.is-conflict, .autosave-status.is-invalid { color: var(--fg); font-weight: 600; }
.autosave-status.is-error::before, .autosave-status.is-conflict::before, .autosave-status.is-warn::before,
.autosave-status.is-invalid::before { content: "⚠ "; color: var(--danger); }
.fl-live { display: contents; }  /* a wrapper for redrawing a line after a save (data-live), invisible to the layout */

/* Segmented language switch */
.lang-switch { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 9px; gap: 2px; }
.lang-switch a { padding: 4px 12px; border-radius: 7px; text-decoration: none; color: var(--muted); font-size: 0.85rem; font-weight: 550; }
.lang-switch a.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 -20px 18px; padding: 0 20px; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; margin-bottom: -1px; border: 0;
  border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 0.925rem; font-weight: 550;
  color: var(--muted); cursor: pointer; border-radius: 8px 8px 0 0; }
.tab:hover { color: var(--fg); background: var(--surface-3); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: flex; flex-direction: column; gap: 14px; }
.tab-panel[hidden] { display: none; }

/* Drop zone */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 150px; padding: 20px; border: 2px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2);
  color: var(--muted); text-align: center; cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone strong { color: var(--fg); }
.dropzone-file { font-size: 0.85rem; color: var(--fg); font-weight: 600; }

/* Design check */
.finding { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: 0.925rem; }
.finding a { color: inherit; }
.finding-error { color: var(--danger); }
.finding-warning { color: var(--warn); }
.ok { color: var(--ok); margin: 0; display: flex; gap: 8px; align-items: center; }

/* Editor: blocks and items */
.block { padding: 0; overflow: visible; }
.block-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start;
  padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: 12px 12px 0 0; }
.block-form { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
/* Block header as a grid: the toolbar (Schleife, preview, move, delete) always sits top right next to the
   name; meta line and options below use the full width. The form's children join the grid (display: contents). */
.block-head:has(> .block-form) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 10px; }
.block-head > .block-form { display: contents; }
.block-head > .block-form > * { grid-column: 1; }
.block-head > .block-form > .block-meta, .block-head > .block-form > .block-options { grid-column: 1 / -1; }
.block-head > .block-form ~ .toolbar { grid-column: 2; grid-row: 1; flex-wrap: nowrap; }
.block-head > .block-form > .block-meta { margin: -4px 0 0; }
/* checkbox and its text stay together; long text wraps next to the box, not below it */
.block-options label.check { flex-wrap: nowrap; align-items: flex-start; }
.block-options label.check input { flex-shrink: 0; margin-top: 3px; }
.block-form input[name=title] { font-weight: 600; }
.block-options { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 0.9rem; }
.block-times { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.block-times label { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; margin: 0; font-weight: inherit; white-space: nowrap; }
.block-times input { width: 72px; padding: 3px 6px; font-size: inherit; }
.item-list { list-style: none; padding: 0 12px; margin: 0; }
.item-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--surface-3); flex-wrap: wrap; border-radius: 8px; }
.item-row:hover { background: var(--surface-2); }
.item-row .toolbar { opacity: 0.55; transition: opacity 0.12s; }
.item-row:hover .toolbar, .item-row:focus-within .toolbar { opacity: 1; }
@media (hover: none) { .item-row .toolbar, .fl-tools { opacity: 1 !important; } }  /* touch: nothing to hover, so not dimmed */
.item-main { flex: 1; min-width: 240px; display: flex; gap: 12px; align-items: flex-start; }
.item-body { min-width: 0; }
.item-code { font-weight: 650; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem; margin-right: 6px; color: var(--fg); text-decoration: none; }
.item-code:hover { color: var(--accent); }
.item-text { color: var(--muted); font-size: 0.9rem; margin-top: 1px; overflow-wrap: anywhere; }
.page-break-row { padding: 4px 8px; }
.page-break-line { display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: 0.72rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.08em; }
.page-break-line::before, .page-break-line::after { content: ""; flex: 1; border-top: 2px dashed var(--border-strong); }

/* "Add element" menu */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); width: min(560px, calc(100vw - 40px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 8px; }

/* Tables in item editors */
.edit-table { width: 100%; border-collapse: collapse; }
.edit-table th { text-align: left; font-size: 0.75rem; color: var(--muted); font-weight: 600; padding: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.edit-table td { padding: 3px 4px; }
.edit-table input:not([type=checkbox]) { width: 100%; }
.edit-table .narrow-col { width: 120px; }
.edit-table .center { text-align: center; }
/* Scientific sources next to a criterion (templates/_sources.html): folded away, set apart when open */
details.sources { margin: 4px 0 0; font-size: 0.82rem; }
details.sources > summary { display: inline-block; cursor: pointer; color: var(--accent); font-weight: 600; list-style: none;
  padding: 1px 0; border-radius: 4px; }
details.sources > summary::-webkit-details-marker { display: none; }
details.sources > summary::before { content: "▸"; display: inline-block; width: 1.1em; }
details.sources[open] > summary::before { content: "▾"; }
details.sources > summary:hover { color: var(--accent-hover); }
details.sources > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
details.sources > ul, details.sources > dl { margin: 6px 0 4px; padding: 8px 12px 8px 30px; background: var(--surface-2);
  border-left: 3px solid var(--border-strong); border-radius: 0 8px 8px 0; color: var(--muted); }
details.sources > dl { padding-left: 14px; }
details.sources dt { font-weight: 600; color: var(--fg); margin-top: 8px; }
details.sources dt:first-child { margin-top: 0; }
details.sources dd { margin: 0; }
details.sources dd > ul { margin: 2px 0 0; padding-left: 18px; }
#sources details.sources { margin: 0; font-size: 0.85rem; }
details.sources li { margin: 3px 0; overflow-wrap: anywhere; }
.criteria { list-style: none; margin: 12px 0 0; padding: 0; font-size: 0.9rem; }
.criteria > li { padding: 8px 0; border-top: 1px solid var(--border); }
.criteria > li > strong { display: block; }
.edit-table .check-col { width: 170px; }
.edit-table .check-col select { width: 100%; min-width: 0; }
.new-row input:not([type=checkbox]) { border-style: dashed; background: var(--surface-2); }
.scale-labels { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; padding: 0; margin: 12px 0 0; list-style: none; counter-reset: pt; }
.scale-labels li { counter-increment: pt; display: flex; flex-direction: column; gap: 3px; }
.scale-labels li::before { content: counter(pt); font-size: 0.72rem; color: var(--subtle); font-weight: 600; }
.scale-labels input { width: 100%; }
input.dimmed { opacity: 0.45; }

/* Preview frame */
.participant-frame { border: 1px solid var(--border); border-radius: 12px; padding: 20px; background: var(--surface); }

/* Image assets */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.asset { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.asset img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--surface-3); }
.asset figcaption { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.asset-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.asset-rejected img { opacity: 0.35; filter: grayscale(1); }
.asset-approved { border-color: color-mix(in srgb, var(--ok) 30%, transparent); }

/* Misc */
.results li, ul.plain li, ol.plain li { padding: 8px 0; border-bottom: 1px solid var(--surface-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.results li:last-child, ul.plain li:last-child, ol.plain li:last-child { border-bottom: 0; }
.stat-line { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.875rem; }

@media (max-width: 600px) {
  .container { padding: 20px 14px 32px; }
  .panel { padding: 16px; }
  .tabs { margin: 0 -16px 16px; padding: 0 16px; }
  .block-head { padding: 14px 16px; }
}

/* Three-column editor workspace */
.workspace { max-width: 1480px; margin: 0 auto; padding: 20px 20px 40px; }
.workspace-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.workspace-head h1 { margin: 0; }
.editor-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr) 270px; gap: 20px; align-items: start; }
.canvas .panel:first-child { margin-top: 0; }
.sidebar { position: sticky; top: 72px; max-height: calc(100vh - 72px - 50px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.sidebar h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 0 0 10px; }
.sidebar h2.mt { margin-top: 22px; }
.palette { list-style: none; padding: 0; margin: 10px 0 14px; display: flex; flex-direction: column; gap: 2px; }
.palette-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 9px;
  background: none; font: inherit; text-align: left; cursor: grab; color: var(--fg); }
.palette-item:hover, .palette-item:focus-visible { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); outline: none; }
.palette-item:active { cursor: grabbing; }
.palette-item strong { display: block; font-size: 0.875rem; line-height: 1.3; }
.palette-item .desc { display: block; font-size: 0.75rem; color: var(--muted); line-height: 1.3; margin-top: 1px; }
.palette-block { width: 100%; }
.item-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.item-icon.big { display: inline-grid; width: 38px; height: 38px; vertical-align: middle; margin-right: 4px; }

/* Blocks as drop targets */
.block.is-active { border-color: color-mix(in srgb, var(--accent) 35%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent), var(--shadow); }
.item-list { min-height: 12px; padding: 6px 12px 10px; }
.drop-hint { list-style: none; margin: 4px 0 0; padding: 14px; border: 2px dashed var(--border); border-radius: 10px;
  text-align: center; color: var(--subtle); font-size: 0.85rem; }
.item-list:has(.item-row) .drop-hint { display: none; }
.drag-handle { color: var(--subtle); cursor: grab; font-weight: 700; letter-spacing: -2px; padding: 0 2px; user-select: none; }
/* Dragging (app.js): an element is taken anywhere on its row, a block anywhere on its head, except on what is
   clicked or typed into. Nothing moves while dragging: lines show where the drop goes. */
.item-row[data-drag], .block-head:has([data-block-handle]) { cursor: grab; }
.item-row[data-drag] label, .block-head:has([data-block-handle]) label { cursor: default; }
.editor-grid .drag-handle { touch-action: none; }  /* a finger on the handle drags at once instead of scrolling */
@media (pointer: coarse) {
  .item-row .drag-handle { padding: 8px 6px; margin: -8px -4px; }
  /* holding a finger on a row drags it: no text selection, no link menu */
  .item-row[data-drag], .block-head:has([data-block-handle]), .palette-item { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}
body.drag-active, body.drag-active * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; max-width: min(380px, 80vw); padding: 8px 12px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--accent); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-size: 0.9rem; font-weight: 600; opacity: 0.96; }
.drag-ghost .item-main, .drag-ghost .palette-item { min-width: 0; padding: 0; font-weight: 400; }
.drag-ghost .item-text, .drag-ghost .desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row.is-dragged, .palette-item.is-dragged { opacity: 0.4; }
/* between two blocks: the element gets a new block of its own */
.block-gap-marker { position: absolute; z-index: 5; height: 0; border-top: 3px dashed var(--accent); pointer-events: none; }
.block-gap-marker span { position: absolute; left: 50%; top: -1px; transform: translate(-50%, -50%); padding: 2px 12px; border-radius: 999px;
  background: var(--accent); color: var(--surface); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.drop-marker { list-style: none; height: 0; border-top: 3px solid var(--accent); border-radius: 3px; margin: -1px 0; position: relative; }
.drop-marker::before { content: ""; position: absolute; left: -4px; top: -6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
/* Blocks are dragged by their head (the handle in its left margin shows that); meanwhile only the heads show */
.block-head { position: relative; }
.block-handle { position: absolute; left: 3px; top: 20px; padding: 6px 2px; line-height: 1; }
.block-pinned .block-handle { top: 50%; transform: translateY(-50%); }
.block-handle:hover { color: var(--accent); }
.block.is-dragged { opacity: 0.4; }
.block.is-here { outline: 2px solid var(--accent); outline-offset: 2px; }
.editor-grid.dragging-block .block > .item-list { display: none; }
.editor-grid.dragging-block .canvas { padding-bottom: 100vh; }  /* room to keep the dragged block under the pointer */
.editor-grid.dragging-block .block-head { border-bottom: 0; border-radius: 12px; }
.block-drop-marker { height: 0; border-top: 3px solid var(--accent); border-radius: 3px; margin: -10px 0 -9px; position: relative; }
.block-drop-marker::before { content: ""; position: absolute; left: -4px; top: -6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

/* Figures in the right sidebar */
.figures { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }  /* a long name wraps, the column never scrolls sideways */
.figures div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; }
.figures dt { font-size: 0.72rem; color: var(--muted); line-height: 1.25; overflow-wrap: break-word; hyphens: auto; }
.figures dt .hint { margin: 0; display: block; font-size: 0.68rem; }
.figures dd { margin: 2px 0 0; font-size: 1.2rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.figures .fig-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn-bar) 30%, transparent); }
.figures .fig-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.findings .finding { font-size: 0.85rem; border-bottom: 0; padding: 4px 0; }
.empty-state { text-align: center; padding: 36px 20px; color: var(--muted); }

/* Segmented control (answer mode) */
.field { display: flex; flex-direction: column; gap: 6px; }
.segmented { display: inline-flex; align-self: flex-start; padding: 3px; background: var(--surface-3); border-radius: 9px; gap: 2px; }
.segmented label { display: block; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 6px 14px; border-radius: 7px; font-size: 0.875rem; font-weight: 550; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus-ring); }
.segmented input:disabled + span { opacity: 0.6; cursor: default; }
.item-editor { margin-top: 12px; }

@media (max-width: 1000px) {
  .editor-grid { --left-shown: min(var(--left-w), 34vw); grid-template-columns: var(--left-shown) minmax(320px, 1fr); }
  .sidebar-right { grid-column: 1 / -1; position: static; max-height: none; order: -1; }
}
@media (max-width: 800px) {
  .editor-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .palette-item .desc { display: none; }
}
.consent-draft { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
[hidden] { display: none !important; }
.confirm-list li { display: grid; grid-template-columns: minmax(200px, 240px) 1fr; gap: 10px; align-items: center; }
@media (max-width: 600px) { .confirm-list li { grid-template-columns: 1fr; } }
.findings .finding, ul.plain li.finding { flex-wrap: nowrap; align-items: flex-start; } .finding .icon { margin-top: 3px; }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-row input { flex: 1; min-width: 240px; font-family: ui-monospace, monospace; font-size: 0.875rem; }
/* export page: groups of exports, each export a row (name, one line of explanation, a control of the same width) */
.export-groups { display: flex; flex-direction: column; gap: 22px; margin-top: 18px; }
.export-group h3 { font-size: 0.95rem; margin: 0 0 8px; }
.export-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.export-list li { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; align-items: center; padding: 10px 14px; }
.export-list li + li { border-top: 1px solid var(--border); }
.export-list strong { font-weight: 600; font-size: 0.925rem; }
.export-list .desc { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 400; line-height: 1.4; margin-top: 1px; }
.export-list .button, .export-list select { width: 100%; }
.export-note { margin: 8px 2px 0; }
@media (max-width: 600px) { .export-list li { grid-template-columns: 1fr; gap: 8px; } }
.member-list li { gap: 6px; }
.member-rank { width: 1.6em; color: var(--muted); font-variant-numeric: tabular-nums; }
.member-moves { display: inline-flex; gap: 0; }
.palette-row { display: flex; align-items: center; gap: 2px; }
.palette-row .palette-item { flex: 1; min-width: 0; }
.palette-add { flex: none; color: var(--accent); }
/* star on a construct: favourites are the constructs the editor lists (same yellow as the pinned surveys) */
.pg-constructs .palette-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px; align-items: center; }
.pg-constructs .palette-item { grid-row: 1 / span 2; }
/* long names ("Technikbereitschaft") break inside their column instead of running under star and plus */
.pg-constructs .palette-item > span:last-child { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.star-btn { height: 22px; align-self: end; color: var(--muted); }
.pg-constructs .palette-add { height: 26px; align-self: start; }
.star-btn:hover:not(:disabled), .star-btn[aria-pressed="true"] { color: #e0a800; background: transparent; }
.star-btn[aria-pressed="true"] .icon { fill: currentColor; }
.left-collapsed .star-btn { display: none; }
.palette-add:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.block-pinned { border-style: dashed; }
.block-pinned .block-head { background: var(--surface-2); align-items: center; }
.pinned-title { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.pinned-title .label-title { color: var(--fg); }

/* Left sidebar: resizable and collapsible */
/* sidebars never take more than about a quarter of the window each; the questionnaire keeps room */
.editor-grid { --left-w: 250px; --right-w: 270px;
  /* the widths as shown: the columns and the resize handles use the same capped values, so a handle never
     drifts into the questionnaire when the window is narrower than a remembered width */
  --left-shown: min(var(--left-w), 26vw); --right-shown: min(var(--right-w), 24vw);
  grid-template-columns: var(--left-shown) minmax(360px, 1fr) var(--right-shown); }
.sidebar-left { overflow: visible; }
.sidebar-left > .palette, .sidebar-left > form, .sidebar-left > .sidebar-help { position: relative; }
.sidebar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.sidebar-head h2 { margin: 0; }
.sidebar-toggle .icon { transition: transform 0.15s; }
.editor-grid { position: relative; }
.sidebar-resizer { position: absolute; top: 0; bottom: 0; left: var(--left-shown); width: 20px; cursor: col-resize; z-index: 3; }
.sidebar-resizer-right { left: auto; right: var(--right-shown); }
.sidebar-resizer::after { content: ""; position: sticky; display: block; top: 40vh; margin: 0 auto; height: 48px; width: 3px;
  border-radius: 1px; background: var(--border-strong); opacity: 0; transition: opacity 0.12s; }
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, .editor-grid.resizing .sidebar-resizer::after { opacity: 1; background: var(--accent); }
.sidebar-resizer:focus-visible { outline: none; }
.editor-grid.resizing { user-select: none; cursor: col-resize; }
.sidebar-left { max-height: calc(100vh - 72px - 50px); overflow-y: auto; }

/* Collapsed: icon rail */
.editor-grid.left-collapsed { --left-w: 64px; }
.left-collapsed .sidebar-left { padding: 12px 8px; }
.left-collapsed .sidebar-head { justify-content: center; }
.left-collapsed .sidebar-head h2, .left-collapsed .sidebar-help, .left-collapsed .palette-item > span:last-child,
.left-collapsed .palette-add, .left-collapsed .sidebar-resizer, .left-collapsed .palette-block span { display: none; }
.left-collapsed .sidebar-toggle .icon { transform: rotate(180deg); }
.left-collapsed .palette { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.left-collapsed .palette-item { justify-content: center; padding: 6px; }
.left-collapsed .palette-block { padding: 0; width: 40px; }
@media (max-width: 800px) { .sidebar-resizer, .sidebar-toggle { display: none; } }
.contact-safeguards { margin-top: 14px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; line-height: 1.45; }
.account-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.account-data { margin-top: 16px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent); border-radius: 10px; background: var(--danger-soft); }
.account-data h3 { margin-top: 0; }
.account-facts, .file-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 12px; }
.account-facts dt, .file-facts dt { color: var(--muted); }
.account-facts dd, .file-facts dd { margin: 0; }
.account-delete select { max-width: 100%; }
.admin-account { white-space: nowrap; }
.account-new, .account-form { max-width: 520px; }
.sign-in { max-width: 460px; margin: 0 auto; }
.sign-in .or { text-align: center; color: var(--muted); margin: 18px 0 6px; }
.one-time-link { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; width: 100%; }
.danger-button:hover { background: var(--danger-soft) !important; color: var(--danger) !important; border-color: var(--danger) !important; }

/* Right sidebar: collapse to a rail with preview and status */
.right-rail { display: flex; justify-content: flex-end; margin: -6px -6px 4px 0; }
.rail-only { display: none !important; }
.sidebar-right .sidebar-toggle .icon { transform: rotate(180deg); }
.editor-grid.right-collapsed { --right-w: 64px; }
.right-collapsed .sidebar-right { padding: 12px 8px; }
.right-collapsed .sidebar-right > :not(.right-rail), .right-collapsed .sidebar-resizer-right { display: none; }
.right-collapsed .right-rail { flex-direction: column; align-items: center; gap: 8px; margin: 0; }
.right-collapsed .rail-only { display: inline-grid !important; }
.right-collapsed .sidebar-right .sidebar-toggle .icon { transform: none; }
.rail-status { place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px; font-size: 0.8rem; font-weight: 700; }
.rail-status.bad { background: var(--danger-soft); color: var(--danger); }
.rail-status.good { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 1000px) { .sidebar-resizer-right, .sidebar-right .sidebar-toggle { display: none; } }

/* Flow tree (right sidebar) */
.flow-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.flow-badge { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); text-decoration: none; }
.flow-badge:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* Image style picker */
.style-contexts { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 4px; vertical-align: middle; }
.chip { font: inherit; font-size: 0.75rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; color: var(--muted); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.style-card { display: flex; flex-direction: column; gap: 4px; cursor: pointer; font-weight: 400 !important; }
.style-card input { position: absolute; opacity: 0; pointer-events: none; }
.style-frame { position: relative; display: block; aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--surface-3); }
.style-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity 0.7s ease; }
.style-frame img.on { opacity: 1; }
.style-frame-custom { display: grid; place-items: center; font-size: 2rem; color: var(--subtle); }
.style-card input:checked + .style-frame { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.style-card input:focus-visible + .style-frame { box-shadow: 0 0 0 3px var(--focus-ring); }
.style-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: none; place-items: center; font-size: 0.8rem; font-weight: 700; }
.style-card input:checked + .style-frame .style-check { display: grid; }
.style-label { font-weight: 650; font-size: 0.875rem; }
.style-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
section[id], [id^="item-"], [id^="block-"] { scroll-margin-top: 72px; }
.cj-attrs { display: flex; flex-direction: column; gap: 12px; }
.cj-attr { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.cj-attr.new-attr { border-style: dashed; }
.md-statements .md-num { width: 2.5rem; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.md-statements .cj-row-tools { white-space: nowrap; }
.cj-figures { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); margin-bottom: 12px; }
.cj-design-view { margin-top: 12px; font-size: 0.85rem; }
.cj-design-view table { margin-top: 8px; }
.cj-reverse { margin-bottom: 12px; font-size: 0.85rem; }
.cj-reverse label, .cj-reverse table { margin-top: 8px; }
.cj-reverse table { max-width: 560px; }
.cj-reverse td { font-variant-numeric: tabular-nums; }
.cj-reverse .is-current td { font-weight: 650; }
.cj-reverse .cj-long { color: var(--warn); }
.cj-reverse .cj-over { color: var(--muted); }
.batch-progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 0.875rem; }
.batch-progress .p-progress { flex: 0 1 320px; margin: 0; height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.batch-progress .p-progress span { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }
.batch-progress .p-progress { min-width: 120px; }
.batch-progress.is-failed .p-progress span { background: var(--danger); }
.batch-progress.is-failed [data-status] { color: var(--danger); }
/* no share known yet: a piece of the bar moves, so the page visibly waits for the server */
.batch-progress.is-waiting .p-progress span { width: 30% !important; transition: none; animation: progress-wait 1.3s ease-in-out infinite; }
@keyframes progress-wait { from { transform: translateX(-100%); } to { transform: translateX(334%); } }
.res-run .batch-progress { flex-basis: 100%; margin-top: 0; }
.hb-progress { margin: 6px 0 10px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .batch-progress.is-waiting .p-progress span { animation: none; width: 100% !important; opacity: 0.45; } }
.cj-gallery { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.cj-gallery .asset img { aspect-ratio: 1 / 1; }
.asset-missing { border-style: dashed; }
.asset-pending { border-color: color-mix(in srgb, var(--warn-bar) 42%, transparent); }
.prompt-text { white-space: pre-wrap; margin: 6px 0 0; }
.palette-search { width: 100%; margin: 4px 0 2px; font-size: 0.875rem; padding: 7px 10px; }
.left-collapsed .palette-search, .left-collapsed .palette-empty { display: none; }
.palette-row[hidden] { display: none; }
.cj-row-tools { width: 40px; text-align: center; }
.row-tools { width: 1%; white-space: nowrap; }
.row-tools .icon-btn:disabled { opacity: .3; cursor: default; }
.row-add { margin: 6px 0 8px; }
.cj-attr .row-fields { align-items: flex-end; }
.cj-remove { margin-left: auto; }
.cj-attr > .button-small { align-self: flex-start; }

/* Survey header with tabs (Fragebogen | Einstellungen | Daten | Vorschau) */
/* Breadcrumb header: ← Meine Befragungen / Title [status] in one line */
.survey-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.survey-head h1 { margin: 0; font-size: 1.35rem; }
.survey-head .crumb { margin: 0; }
/* ↶ ↷ and the list of the last changes (editor/_undo.html) */
.undo-bar { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.undo-bar form { margin: 0; }
.undo-bar .icon-btn:not(:disabled) { color: var(--accent); }  /* something to take back: in the accent colour, not grey */
.undo-menu > summary { width: 22px; cursor: pointer; }
.undo-panel { left: auto; right: 0; width: min(380px, calc(100vw - 40px)); }
.undo-head { margin: 4px 8px 6px; font-weight: 600; font-size: 0.9rem; }
.undo-head .hint { display: block; font-weight: 400; }
.undo-list { list-style: none; margin: 0; padding: 0; }
.undo-list button, .undo-more { display: flex; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px;
  background: none; font: inherit; font-size: 0.9rem; text-align: left; color: var(--fg); cursor: pointer; }
.undo-list button:hover, .undo-list button:focus-visible, .undo-more:hover { background: var(--surface-3); outline: none; }
/* everything a click takes back: the step under the pointer and those above it */
.undo-list li:has(~ li button:hover) button, .undo-list li:has(~ li button:focus-visible) button { background: var(--surface-3); }
.undo-time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.undo-more { color: var(--accent); font-weight: 600; }
.crumb-sep { color: var(--subtle); font-size: 1.1rem; }
/* horizontal scrolling only on narrow screens; never a vertical scrollbar (the tab underline overlaps the border by 1px) */
.survey-tabs { display: flex; gap: 2px; margin: 12px 0 20px; border-bottom: 1px solid var(--border);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.survey-tabs::-webkit-scrollbar { display: none; }
.survey-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; margin-bottom: 0; text-decoration: none;
  color: var(--muted); font-weight: 550; font-size: 0.925rem; border-bottom: 2px solid transparent; white-space: nowrap; border-radius: 8px 8px 0 0; }
.survey-tabs a:hover { color: var(--fg); background: var(--surface-3); }
.survey-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
.survey-tabs .survey-tabs-preview { margin-left: auto; }
.survey-tabs-sep { flex: 0 0 1px; align-self: center; height: 20px; margin: 0 6px; background: var(--border-strong); }
.workspace-head { align-items: flex-end; }
.workspace-title { flex: 1; min-width: 0; }
.workspace-title .survey-tabs { margin-bottom: 0; }

/* Editor as an app shell: three full-height areas (left | center | right), each scrolling on its own */
@media (min-width: 801px) {
  body:has(.workspace) { padding-bottom: 0; overflow: hidden; }
  main.workspace { max-width: none; margin: 0; padding: 0; height: calc(100vh - 56px - 34px);
    display: flex; flex-direction: column; }
  .workspace-head { padding: 10px 20px 0; margin: 0; background: var(--surface); border-bottom: 1px solid var(--border); }
  .workspace-head .back-link { margin-bottom: 2px; }
  .workspace-head .survey-tabs { border-bottom: 0; margin: 8px 0 0; }
  .workspace-head .lang-switch { margin-bottom: 8px; }
  .workspace > .flashes { position: static; margin: 8px 20px 0; }
  .editor-grid { flex: 1; min-height: 0; gap: 0; align-items: stretch;
    width: 100%; max-width: calc(var(--left-shown) + var(--page-col) + var(--right-shown)); margin: 0 auto; }
  .editor-grid > .sidebar { position: static; top: auto; max-height: none; height: 100%; overflow-y: auto;
    border: 0; border-radius: 0; box-shadow: none; background: var(--surface); padding: 16px; }
  .sidebar-left { border-right: 1px solid var(--border) !important; border-left: 1px solid var(--border) !important; }
  .sidebar-right { border-left: 1px solid var(--border) !important; border-right: 1px solid var(--border) !important; }
  .canvas { height: 100%; overflow-y: auto; padding: 20px; min-width: 0; }
  .sidebar-resizer { left: calc(var(--left-shown) - 6px); width: 12px; }
  .sidebar-resizer-right { left: auto; right: calc(var(--right-shown) - 6px); }
  .sidebar-resizer::after { position: absolute; top: 50%; left: 5px; margin: -24px 0 0; }
}
@media (min-width: 801px) and (max-width: 1000px) {
  /* two areas: palette | center; the right sidebar moves above the blocks, capped so it cannot push them away */
  .editor-grid > .sidebar-right { height: auto; max-height: 32vh; overflow-y: auto; border-left: 0 !important;
    border-bottom: 1px solid var(--border) !important; }
}

/* Loop & Merge */
.loop-table-wrap { overflow-x: auto; }
.loop-table th { vertical-align: top; min-width: 150px; }
.loop-table th .check { font-weight: 400; margin-top: 4px; text-transform: none; letter-spacing: 0; }
.loop-table .loop-rownum { min-width: 0; width: 36px; color: var(--subtle); text-align: center; }
.loop-table .loop-addcol { min-width: 0; width: 1%; }
.loop-colname { font-family: ui-monospace, monospace; font-weight: 600; }
.loop-badge { background: color-mix(in srgb, var(--ok) 9%, transparent); color: var(--ok); }
.loop-vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 0; padding: 10px 12px;
  background: color-mix(in srgb, var(--ok) 9%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 22%, transparent); border-radius: var(--radius); }
.loop-vars .chip { font-family: ui-monospace, monospace; cursor: grab; }
.loop-vars .chip:active { cursor: grabbing; }
.loop-vars .chip-answer { font-family: inherit; color: var(--fg); }
.loop-vars .chip-answer small { font-family: ui-monospace, monospace; color: var(--subtle); margin-left: 4px; }
/* while a loop variable is dragged: text fields show that they accept it */
body.dragging-var [data-var-target] {
  outline: 2px dashed var(--accent); outline-offset: 1px; background: var(--accent-soft); }
.style-card.just-switched .style-frame { animation: style-pulse 1.2s ease-out; }
@keyframes style-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); transform: scale(1); }
  30% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 25%, transparent); transform: scale(1.04); }
  100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .style-card.just-switched .style-frame { animation: none; } }

/* Setup wizard */
.wizard-head h1 { margin-bottom: 4px; }
.wizard-steps { list-style: none; padding: 0; margin: 14px 0 18px; display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.wizard-steps::-webkit-scrollbar { display: none; }
.wizard-step { flex: 1; min-width: 92px; }
.wizard-step a, .wizard-step > span:first-child { text-decoration: none; font-weight: inherit; }
.wizard-step a, .wizard-step { color: var(--muted); }
.wizard-step > a, .wizard-step { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.wizard-step { border-top: 3px solid var(--border); padding-top: 8px; font-size: 0.8rem; }
.wizard-step.done { border-top-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.wizard-step.current { border-top-color: var(--accent); color: var(--fg); font-weight: 650; }
.wizard-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); font-size: 0.75rem; font-weight: 700; }
.wizard-step.done .wizard-num { background: var(--accent-soft); color: var(--accent); }
.wizard-step.current .wizard-num { background: var(--accent); color: var(--on-accent); }
/* .wizard-panel: as wide as the page's other blocks (Ralf, 2026-10-03: the file import below was wider) */
.wizard-nav { display: flex; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 8px; }
.wizard-spacer { flex: 1; }
.consent-preview { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; background: var(--surface-2); font-size: 0.9rem; max-height: 320px; overflow-y: auto; }
.consent-preview h3 { font-size: 0.95rem; margin: 12px 0 2px; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.summary dt { font-weight: 650; color: var(--muted); font-size: 0.875rem; }
.summary dd { margin: 0; }
@media (max-width: 600px) { .wizard-label { display: none; } .wizard-step.current .wizard-label { display: inline; } }
.zenodo-connections { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.zenodo-conn { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); font-size: 0.9rem; }

/* ------------------------------------------------------------------------------------------
   Night mode (researcher UI). Participant pages and previews stay light on purpose. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141517;
  --surface: #1c1e21;
  --surface-2: #212428;
  --surface-3: #2a2e33;
  --fg: #e7e5e0;
  --muted: #a4a29c;
  --subtle: #7e7c77;
  --accent: #7ea6e6;
  --accent-hover: #9ab9ec;
  --accent-soft: rgba(126, 166, 230, 0.14);
  --ai: #c4a2f3;
  --ai-soft: rgba(168, 120, 240, 0.16);
  --ai-border: rgba(196, 162, 243, 0.40);
  --linked: #6fc7dc;
  --linked-soft: rgba(111, 199, 220, 0.13);
  --on-accent: #0e1a2e;
  --border: #33363c;
  --border-strong: #464a51;
  --danger: #f08d86;
  --danger-soft: rgba(240, 141, 134, 0.12);
  --on-danger: #2a0d0b;
  --ok: #86d293;
  --ok-soft: rgba(134, 210, 147, 0.12);
  --warn: #e7c566;
  --warn-soft: rgba(231, 197, 102, 0.13);
  --warn-border: rgba(231, 197, 102, 0.40);
  --warn-bar: #c9a43a;
  --on-warn: #241a00;
  --header-bg: rgba(28, 30, 33, 0.92);
  --footer-bg: rgba(20, 21, 23, 0.95);
  --focus-ring: rgba(126, 166, 230, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.5);
}
:root[data-theme="dark"] .participant-frame { background: #fff; }
:root[data-theme="dark"] .style-frame { background: var(--surface-3); }
:root[data-theme="dark"] img { opacity: 0.94; }
.theme-toggle { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 8px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 1.05rem; }
.theme-toggle:hover { background: var(--surface-3); color: var(--fg); }
/* show the icon of the mode you switch TO */
.theme-toggle .theme-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
:root[data-theme="dark"] .badge-closed { color: #e0a878; }
:root[data-theme="dark"] .badge-paused, :root[data-theme="dark"] .badge-pending { color: var(--warn); }
:root[data-theme="dark"] input, :root[data-theme="dark"] textarea, :root[data-theme="dark"] select { background: var(--surface-2); }
:root[data-theme="dark"] input:disabled, :root[data-theme="dark"] textarea[readonly], :root[data-theme="dark"] input[readonly] { background: var(--surface-3); }
:root[data-theme="dark"] .participant-frame input, :root[data-theme="dark"] .participant-frame textarea { background: #fff; }
.panel-links { margin-top: 16px; }

/* Ablauf page: nested groups as boxes, drag before/after/into */
.flow-page { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
main.tabpage > .flow-page { max-width: min(calc(280px + var(--page-col) + 300px + 40px), calc(100% - 40px)); margin-left: auto; margin-right: auto; }
.flow-palette { position: sticky; top: 72px; }
.flow-palette .panel { margin: 0; }
.flow-side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 0; }
.flow-side .panel { margin: 0 0 16px; }
.flow-canvas { margin-top: 0; }
@media (max-width: 1200px) { .flow-page { grid-template-columns: 260px minmax(0, 1fr); } .flow-side { grid-column: 1 / -1; position: static; } }
@media (max-width: 1000px) { .flow-page { grid-template-columns: 1fr; } .flow-side, .flow-palette { position: static; } }
.fl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fl-node { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.fl-node.fl-block { background: var(--surface-2); }
.fl-node.fl-rand { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.fl-node.fl-branch { border-color: var(--warn-border); background: color-mix(in srgb, var(--warn-bar) 6%, transparent); }
/* a condition has two slots: "dann" and "sonst" */
.fl-slots { display: grid; gap: 8px; margin-top: 8px; }
.fl-slot { border: 1px dashed var(--warn-border); border-radius: 10px; padding: 6px 8px 8px; background: var(--surface-2); }
.fl-slot-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--warn); margin: 0 0 4px 2px; }
.fl-slot-label .hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.fl-slot-if { border-style: solid; background: color-mix(in srgb, var(--warn-bar) 8%, transparent); }
.fl-slot-if .fl-cond { text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--fg); margin-left: 4px; }
.fl-slot-if .fl-settings { margin: 2px 0 0 2px; }
.fl-slot.drop-into { background: color-mix(in srgb, var(--warn-bar) 12%, transparent); border-style: solid; }
.fl-slot .fl-list { margin: 0; }
.fl-node.fl-end { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 5%, transparent); }
.fl-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; flex-wrap: wrap; font-size: 0.9rem; }
.fl-head .hint { margin-left: 0; }
.fl-title { font-weight: 600; color: var(--fg); text-decoration: none; }
.fl-title:hover { color: var(--accent); }
.fl-icon { width: 20px; text-align: center; flex: none; }
.fl-tools { margin-left: auto; display: inline-flex; gap: 0; opacity: 0.4; }
.fl-head:hover .fl-tools, .fl-head:focus-within .fl-tools { opacity: 1; }
.fl-children { margin: 0 10px 10px 26px; }
.fl-empty { list-style: none; padding: 10px; border: 2px dashed var(--border); border-radius: 8px; color: var(--subtle); font-size: 0.8rem; text-align: center; }
.fl-children:has(> .fl-node) > .fl-empty { display: none; }
.flow-page.dragging .fl-children > .fl-empty { display: block; }
.fl-settings { margin: 0 10px 8px 38px; font-size: 0.85rem; }
.fl-settings summary { cursor: pointer; color: var(--muted); font-size: 0.8rem; }
.fl-settings .stack { gap: 8px; margin-top: 8px; }
.fl-node[draggable="true"] > .fl-head { cursor: grab; }
.fl-node.is-dragged { opacity: 0.4; }
.fl-node.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.fl-node.drop-after { box-shadow: 0 3px 0 var(--accent); }
.fl-node.drop-into > .fl-children { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 8px; }
.flow-add-grid { display: grid; gap: 6px; }
.fl-add { display: grid; grid-template-columns: 24px 1fr; gap: 0 8px; text-align: left; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface); cursor: pointer; font: inherit; color: var(--fg); }
.fl-add:hover { border-color: var(--accent); background: var(--accent-soft); }
/* the cards are dragged into the flow (app.js); onto a block, loop, randomizer and condition take it in */
.fl-add { cursor: grab; }
.fl-add.is-dragged { opacity: 0.4; }
@media (pointer: coarse) { .fl-add { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
.fl-node.drop-wrap { position: relative; outline: 2px dashed var(--accent); outline-offset: 2px; }
.fl-node.drop-wrap::after { content: attr(data-drop-note); position: absolute; right: 10px; top: 0; transform: translateY(-50%); padding: 2px 10px;
  border-radius: 999px; background: var(--accent); color: var(--surface); font-size: 0.75rem; font-weight: 600; white-space: nowrap; pointer-events: none; }
.fl-add span:first-child { grid-row: span 2; font-size: 1.1rem; }
.fl-add strong { font-size: 0.875rem; }
.fl-add .desc { font-size: 0.75rem; color: var(--muted); }

/* Einstellungen, Ablauf, Export: full width like the Fragebogen tab; panels in one linear column */
main.tabpage { max-width: none; margin: 0; padding: 0 0 40px; }
.tabpage-head { padding: 10px 20px 0; margin-bottom: 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.tabpage-head .survey-tabs { border-bottom: 0; margin: 8px 0 0; }
.tabpage > :not(.tabpage-head) { margin-left: 20px; margin-right: 20px; }
.tabpage-grid > .panel { margin-top: 0; }
/* pages with one column (Einstellungen, Quoten, Feld, Ergebnisse, ...): the column is centred like Stichprobengröße and
   Administration, at most --page-col wide; on pages with three columns (Fragebogen, Ablauf) the middle one has the same
   cap and the side columns move in (.editor-grid, .flow-page) */
:root { --page-col: 1400px; }
/* three-column pages (Fragebogen, Ablauf): the middle column keeps --page-col, so the outer ones stand where they are,
   but its content is at most --page-content wide in its middle (Ralf, 2026-10-03, as in the live views) */
:root { --page-content: 1200px; }
.canvas > * { max-width: var(--page-content); margin-left: auto; margin-right: auto; }
.flow-page > .flow-canvas { width: 100%; max-width: var(--page-content); justify-self: center; }
.tabpage-single > :not(.tabpage-head) { max-width: min(var(--page-col), calc(100% - 40px)); margin-left: auto; margin-right: auto; }
#settings-participation, #settings-privacy, #settings-quality, #settings-test { scroll-margin-top: 70px; }

/* Construct toolbox: section in the palette, note on the item page */
.palette-section { margin: 14px 8px 2px; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.construct-note { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin: 0 0 16px;
  padding: 12px 16px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.construct-note.is-adapted { border-left-color: var(--warn); }
.construct-note.linked-note { border-left-color: var(--linked); }
.linked-figures { margin-top: 18px; }
/* a bar per survey in the tables of the shared analysis: share of an answer, or the mean on the scale */
.lk-bar { display: block; height: 8px; width: 100%; min-width: 90px; margin: 2px 0 3px; border-radius: 4px;
  background: linear-gradient(90deg, var(--linked) var(--v), var(--linked-soft) var(--v)); }
.linked-figures th .hint { text-transform: none; letter-spacing: 0; }  /* "n = 25", not "N = 25" */
.construct-note.linked-note.is-adapted { border-left-color: var(--warn); }
.linked-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; flex-shrink: 0; }
.kind-fields-locked { opacity: 0.75; }
.construct-note p { margin: 4px 0 0; }
.construct-note strong { display: inline-flex; align-items: center; gap: 6px; }
.construct-explore { display: block; margin: 4px 8px 14px; }

/* Konstrukte page: search, facet chips, linear result list */
.construct-search { display: flex; gap: 8px; margin: 0 0 14px; }
.construct-search input[type=search] { flex: 1; font-size: 1rem; }
.facets { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.facet-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.facet-label { min-width: 96px; font-size: 0.8rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.facet-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--fg); font-size: 0.85rem; text-decoration: none; }
.facet-chip:hover { border-color: var(--border-strong); }
.facet-chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.facet-chip.is-empty { opacity: 0.5; }
.facet-count { font-size: 0.72rem; opacity: 0.75; }
.construct-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.construct-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.construct-card:hover { border-color: var(--border-strong); }
.construct-short { margin: 4px 0 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 0.75rem; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--fg); text-decoration: none; }
.tag-thema { background: var(--ok-soft); }
.tag-fach { background: var(--warn-soft); }
.tag-status { background: transparent; border: 1px solid var(--border-strong); font-weight: 600; }
.construct-facts { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; margin: 14px 0 0; }
.construct-facts dt { font-weight: 600; color: var(--muted); }
.construct-facts dd { margin: 0; }
@media (max-width: 600px) { .construct-facts { grid-template-columns: 1fr; } .facet-label { min-width: 0; width: 100%; } }

/* Nutzungsbedingungen */
.terms h1 { margin-top: 0; }
.terms h2 { font-size: 1.05rem; margin: 22px 0 6px; }
.terms p, .terms li { line-height: 1.6; }
.terms ul { padding-left: 20px; }
.terms li { margin-bottom: 6px; }
.terms-accept label.check { align-items: flex-start; flex-wrap: nowrap; }  /* the long sentence next to the box, wrapping in itself */
.terms-accept label.check input { flex: none; margin-top: 3px; }

/* Export page: timeline */
.timeline-svg { display: block; width: 100%; height: auto; margin: 10px 0 6px; overflow: visible; }
.timeline-svg .tl-bar, .tl-key.tl-bar { fill: var(--accent); background: var(--accent); }
.timeline-svg .tl-bar-other, .tl-key.tl-bar-other { fill: var(--accent-soft); background: var(--accent-soft); stroke: var(--accent); stroke-width: 0.5; }
.timeline-svg .tl-draft, .tl-key.tl-draft { fill: var(--border); background: var(--border); }
.timeline-svg .tl-running, .tl-key.tl-running { fill: var(--ok); background: var(--ok); }
.timeline-svg .tl-paused, .tl-key.tl-paused { fill: var(--warn); background: var(--warn); }
.timeline-svg .tl-closed, .tl-key.tl-closed { fill: var(--muted); background: var(--muted); }
.timeline-svg .tl-planned { fill: none; stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 4 3; }
.tl-key.tl-planned { border: 1.5px dashed var(--ok); }
.timeline-svg .tl-axis { stroke: var(--border-strong); }
.timeline-svg .tl-event { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.timeline-svg .tl-now { stroke: var(--danger); stroke-width: 1.5; }
.timeline-svg .tl-label { fill: var(--muted); font-size: 12px; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.8rem; color: var(--muted); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-key { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.tl-events { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; }
ol.plain.tl-events li { border: 0; padding: 0; }  /* plain dates and actions, no rule under each */

/* Palette: one highlight for the whole row (element and its "+") */
.palette-row { border: 1px solid transparent; border-radius: 9px; padding-right: 4px; }
.palette-row:hover, .palette-row:focus-within { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.palette-row .palette-item:hover, .palette-row .palette-item:focus-visible { background: transparent; border-color: transparent; }
.palette-row .palette-add:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.figures .fig-wide { grid-column: 1 / -1; }
.badge-construct { background: var(--ok-soft); color: var(--ok); text-decoration: none; }
.badge-construct.is-modified { background: var(--warn-soft); color: var(--warn); }
.badge-linked { background: var(--linked-soft); color: var(--linked); text-decoration: none; }
.badge-linked.is-modified { background: var(--warn-soft); color: var(--warn); }
.badge .icon { vertical-align: -1px; }

/* Block name as an editable heading */
.block-name { display: block; position: relative; }
.block-name input { width: 100%; font-size: 1.15rem; font-weight: 650; color: var(--fg); background: transparent;
  border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; margin-left: -8px; }
.block-name input:hover { border-color: var(--border); }
.block-name input:focus { border-color: var(--accent); background: var(--surface); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.block-name input::placeholder { font-weight: 500; color: var(--muted); }
.block-meta { display: block; margin: 0 0 6px; }
.reopen-box { margin: 10px 0; }
.reopen-box summary { cursor: pointer; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.start-check ul { margin: 6px 0; padding-left: 18px; }
.start-check p { margin: 0; }
p.start-check { margin: 0 0 12px; }
.reopen-box .flash { margin: 10px 0; align-items: flex-start; }
.reopen-box .flash ul { margin: 6px 0 0; padding-left: 18px; }
.reopen-box .flash p { margin: 0; }
.snapshot-list li { padding: 4px 0; }

/* absolutely positioned children must not escape the scrolling columns (else the page itself scrolls) */
.workspace .canvas, .workspace .sidebar { position: relative; }

/* "Fragebogen bearbeiten" on paused/closed surveys: a yellow (warning) button */
.reopen-box summary { list-style: none; padding: 8px 14px; border-radius: 8px; background: var(--warn-soft);
  color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); font-weight: 650; }
.reopen-box summary::-webkit-details-marker { display: none; }
.reopen-box summary:hover { border-color: var(--warn); }
.reopen-box[open] summary { margin-bottom: 4px; }
.reopen-box .button-secondary { background: var(--warn); color: var(--on-warn); border-color: var(--warn); }

/* Loop & Merge page */
.loop-intro p { margin-top: 0; }
.loop-example { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(200px, 1.2fr) minmax(240px, 1.6fr); gap: 16px; margin-top: 10px; }
.loop-example-q { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: 0.9rem; }
.loop-example table { margin-top: 6px; }
@media (max-width: 800px) { .loop-example { grid-template-columns: 1fr; } }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent);
  color: var(--on-accent); font-size: 0.8rem; margin-right: 6px; vertical-align: 2px; }
[data-loop-editor] h2 { margin-top: 18px; }
[data-loop-editor] h2:first-of-type { margin-top: 0; }
.copy-chip { cursor: pointer; }
.copy-chip.copied { background: var(--ok-soft); color: var(--ok); }
.copy-chip.copy-failed { background: var(--danger-soft); color: var(--danger); }
.copy-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.loop-usage li { display: flex; gap: 6px; align-items: center; padding: 2px 0; }
.loop-btn { white-space: nowrap; }
.loop-btn.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* product subtitle */
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.2rem; }
.page-subtitle { display: block; font-size: 1.05rem; font-weight: 500; color: var(--muted); margin-top: 4px; }

/* Palette groups: question types, validated constructs (green), feedback (yellow); collapsible */
.palette-group { margin: 10px 0; border-radius: 10px; }
.pg-head { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font: inherit; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.04em;
  text-transform: uppercase; cursor: pointer; text-align: left; }
.pg-head:hover { color: var(--fg); }
.pg-chevron { display: inline-block; transition: transform 0.15s; }
.palette-group.is-collapsed .pg-chevron { transform: rotate(-90deg); }
.palette-group.is-collapsed .pg-body { display: none; }
.pg-count { margin-left: auto; font-size: 0.7rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--bg); color: var(--muted); letter-spacing: 0; }
.pg-body { padding: 0 4px 6px; }
.pg-body .palette { margin: 2px 0 6px; }
.palette-group.no-hits .pg-head { opacity: 0.55; }
.pg-constructs { background: var(--ok-soft); }
.pg-feedback { background: var(--warn-soft); }
/* the same colours on the questionnaire canvas: validated constructs green, feedback yellow */
.item-row.row-construct { background: var(--ok-soft); box-shadow: inset 3px 0 0 var(--ok); margin: 2px 0; }
.item-row.row-feedback { background: var(--warn-soft); box-shadow: inset 3px 0 0 var(--warn); margin: 2px 0; }
.item-row.row-ai { background: var(--ai-soft); box-shadow: inset 3px 0 0 var(--ai); margin: 2px 0; }  /* AI-drafted scale */
.item-row.row-linked { background: var(--linked-soft); box-shadow: inset 3px 0 0 var(--linked); margin: 2px 0; }  /* linked element */
.item-row.row-linked:hover { filter: brightness(0.98); }
.item-row.row-construct:hover, .item-row.row-feedback:hover, .item-row.row-ai:hover { filter: brightness(0.98); }
.badge-ai { background: var(--ai-soft); color: var(--ai); }
.palette-ai { border-radius: 8px; }  /* the entry itself is in the AI violet, see below */
.pg-constructs .palette-row:hover, .pg-constructs .palette-row:focus-within,
.pg-feedback .palette-row:hover, .pg-feedback .palette-row:focus-within { background: var(--surface); }
.left-collapsed .palette-group .pg-head, .left-collapsed .construct-explore { display: none; }
.left-collapsed .palette-group.is-collapsed .pg-body { display: block; }

/* Feedback */
.feedback-btn { color: var(--muted); }
.feedback-btn:hover { color: var(--accent); }
.feedback-count { text-decoration: none; }
.feedback-dialog { width: min(560px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px;
  background: var(--surface); color: var(--fg); box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.feedback-dialog::backdrop { background: rgba(20, 20, 18, 0.35); }
/* The question before a step that cannot be taken back (askConfirm in app.js) */
.confirm-dialog { box-sizing: border-box; width: min(460px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px;
  background: var(--surface); color: var(--fg); box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.confirm-dialog::backdrop { background: rgba(20, 20, 18, 0.35); }
.confirm-dialog h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.confirm-dialog p { margin: 8px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.confirm-actions .button.is-danger { background: var(--danger); border-color: var(--danger); }
.feedback-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.feedback-dialog-head h2 { margin: 0; display: inline-flex; gap: 8px; align-items: center; font-size: 1.1rem; }
.severity-scale { border: 0; padding: 0; margin: 0; }
.severity-scale legend { font-weight: 600; margin-bottom: 6px; }
.severity-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.severity-option { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; padding: 8px 6px;
  text-align: center; cursor: pointer; font-size: 0.8rem; }
.severity-option input { position: absolute; opacity: 0; pointer-events: none; }
.severity-option .hint { display: block; font-size: 0.68rem; }
.severity-option:has(input:checked) { border-width: 2px; }
.sev-1:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.sev-2:has(input:checked) { background: var(--warn-soft); border-color: var(--warn); }
.sev-3:has(input:checked) { background: var(--danger-soft); border-color: var(--danger); }
@media (max-width: 520px) { .severity-options { grid-template-columns: 1fr; } }
/* own list, not ul.plain: its row rule would take the card padding away and put the text next to the head */
.feedback-list { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 12px; }
.feedback-item { margin: 0; padding: 16px 20px; }
.feedback-item.is-done { opacity: 0.6; }
.feedback-empty { padding: 8px 0; }
.feedback-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.feedback-source { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.feedback-meta form { margin: 0 0 0 auto; }
.feedback-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 0; }
.sev-badge.sev-1 { background: var(--accent-soft); color: var(--accent); }
.sev-badge.sev-2 { background: var(--warn-soft); color: var(--warn); }
.sev-badge.sev-3 { background: var(--danger-soft); color: var(--danger); }
.sev-badge.sev-4 { background: var(--danger); color: var(--on-danger); }
.feedback-item.is-complaint:not(.is-done) { box-shadow: inset 4px 0 0 var(--danger); }

/* landing page: wider, serif headings, sans-serif text */
.landing-page { max-width: 1200px; }
.landing-page h1, .landing-page h2 { font-family: var(--font-serif);
  font-weight: 600; letter-spacing: -0.01em; }
.landing-page h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.1; margin: 8px 0 12px; }
.landing-page h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 16px; }
.landing-intro { max-width: 760px; }
.landing-lead { font-size: 1.25rem; line-height: 1.5; margin: 0; }
.landing-cta { margin-top: 22px; }
.landing-owner { margin-top: 40px; font-size: 1.05rem; }
[data-description-count].is-ok { color: var(--ok); }
.duration-field { display: flex; flex-direction: column; gap: 4px; }
.inline-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.inline-controls .hint { margin: 0; }
.email-field { max-width: 360px; }

/* answer mode on each question in the questionnaire */
.mode-badge.mode-optional { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.mode-badge.mode-nudge { background: var(--warn-soft); color: var(--warn); }
.mode-badge.mode-required { background: var(--accent-soft); color: var(--accent); }

@media (min-width: 801px) and (max-width: 1000px) {
  .editor-grid { --left-shown: min(var(--left-w), 34vw); grid-template-columns: var(--left-shown) minmax(320px, 1fr); }
}
/* long design-check messages wrap inside their column */
.findings li, .finding { overflow-wrap: anywhere; }

/* Trash below the blocks: deleted questions, restorable for a week */
.trash-area .item-body .hint { margin-left: 6px; }

/* Mark an image: overview of all marks in the item editor */
.mark-pool { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.mark-pool img { max-width: 100%; height: auto; border-radius: 8px; }
.mark-pool canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Roles: settings forms locked for people who may not change them */
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; display: contents; }
.role-note { grid-column: 1 / -1; }
.role-badge { font-size: 0.72rem; }
.member-role select { font-size: 0.85rem; padding: 2px 6px; }

/* Export: completion times and speeder threshold */
/* the histogram on the left, threshold, result and explanation on the right (one above the other when narrow):
   the slider is no time axis of the chart, so it does not sit under it */
.speed-body { display: grid; grid-template-columns: minmax(0, 600px) minmax(240px, 420px); gap: 20px 28px; align-items: start;
  justify-content: start; }  /* the filter right next to the histogram, no gap in between */
.speed-body[hidden] { display: none; }
.speed-chart { max-width: 600px; }
.speed-side { min-width: 0; }
.speed-note { grid-column: 1 / -1; }  /* the explanation under chart and filter, across both columns */
.speed-note .muted.small { margin: 0; }
@media (max-width: 760px) { .speed-body { grid-template-columns: 1fr; } }
.speed-chart svg { width: 100%; height: auto; display: block; }
.speed-bar { fill: var(--accent); opacity: 0.55; }
.speed-bar.is-speeder { fill: var(--danger); opacity: 0.7; }
.speed-zone { fill: var(--danger-soft); }
.speed-median { stroke: var(--fg); stroke-dasharray: 3 3; }
.speed-cut { stroke: var(--danger); stroke-width: 2; }
.speed-axis { stroke: var(--border); }
.speed-tick, .speed-label { font-size: 11px; fill: var(--muted); }
.speed-slider { display: flex; flex-direction: column; gap: 6px; margin-top: 0; }
.speed-slider input { width: 100%; margin: 0; accent-color: var(--danger); }
.speed-summary { margin: 6px 0 0; }
.speed-rule { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.speed-base { margin-bottom: 8px; align-items: flex-start; flex-wrap: nowrap; }
.speed-base input { margin-top: 3px; flex-shrink: 0; }
.speed-base small { display: block; }

/* Sample size calculator */
.ss-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
/* one grid of two columns: a cell is name, field and hint below each other, and the cells of a row share their
   three lines (subgrid), so the fields of a row stand on one line whatever wraps above or below them. Every
   field, select and button has the height of the text fields and the width of its column. */
.ss-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.ss-inputs > * { margin: 0 0 10px; min-width: 0; }
.ss-inputs > label:not(.check) { display: flex; flex-direction: column; gap: 6px; }
.ss-inputs > .ss-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 6px; align-items: end; }
@supports (grid-template-rows: subgrid) {
  .ss-inputs > label:not(.check), .ss-inputs > .ss-presets { display: grid; grid-row: span 3; grid-template-rows: subgrid; }
  .ss-presets > .button { grid-row: 2; }
}
.ss-inputs > .ss-wide { grid-column: 1 / -1; }
.ss-inputs > label.check { display: flex; }
.ss-name { font-weight: 600; font-size: 0.925rem; align-self: end; }
.ss-inputs em { font-family: Georgia, serif; }
.ss-name sub { line-height: 0; }
.ss-inputs input:not([type=checkbox]), .ss-inputs select, .ss-presets > .button { width: 100%; height: 42px; }
.ss-presets > .button { padding: 0 6px; font-size: 0.85rem; }
.ss-inputs > label:not(.check) > .hint { margin: 0; }
/* one column: the buttons follow their field directly, without the empty line of a name */
@media (max-width: 520px) {
  .ss-inputs { grid-template-columns: minmax(0, 1fr); }
  .ss-inputs > .ss-presets { grid-row: auto; grid-template-rows: none; margin-top: -8px; }
  .ss-presets > .button { grid-row: auto; }
}
.ss-result { background: var(--accent-soft); border-radius: 12px; padding: 16px 18px; }
.ss-big { font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.ss-big small { display: block; font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.ss-detail { font-size: 0.9rem; color: var(--muted); }
.ss-invite { margin: 8px 0 12px; }
.ss-warning { font-size: 0.9rem; background: var(--warn-soft); border-radius: var(--radius); padding: 8px 10px; }
.ss-result [data-ss-apply][aria-disabled] { opacity: 0.5; pointer-events: none; }
@media (max-width: 800px) { .ss-grid { grid-template-columns: 1fr; } }

/* AI suggestions: construct ideas in the design check, the drafting dialog */
.ai-ideas { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.ai-ideas h2 { margin-top: 0; }
.ai-ideas .button { margin: 4px 0; white-space: normal; text-align: left; max-width: 100%; height: auto; }
.ai-idea-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ai-ideas .ai-idea-list li { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.ai-ideas .ai-idea-actions button.link { font-size: 0.875rem; }
.ai-idea-actions { display: flex; gap: 4px; align-items: baseline; flex-wrap: wrap; }
.ai-dialog { border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--fg); }
.ai-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.ai-dialog h2 { margin: 0; }
.ai-dialog textarea { width: 100%; }
.ai-note { background: var(--ai-soft); border-left: 3px solid var(--ai); }

/* Flow: a drop zone at the very end, only while dragging (also to move a node out of a group) */
.fl-root > .fl-root-end { display: none; }
.flow-page.dragging .fl-root > .fl-root-end { display: block; }
.fl-root-end.drop-into { background: color-mix(in srgb, var(--accent) 8%, transparent); border-color: var(--accent); }

/* Start page: own surveys, narrow column with running surveys of others */

/* Questionnaire editor: the separated section below a grey divider (a fixed divider), then the trash in the same grey */
.split-divider { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; margin: 28px -20px 0; padding: 10px 20px;
  background: var(--surface-3); border-top: 2px solid color-mix(in srgb, var(--muted) 45%, transparent);
  color: var(--muted); font-size: 0.9rem; }
.split-divider strong { color: var(--fg); }
.split-divider > span { flex: 1; min-width: 0; }
.split-divider form { flex: none; }
/* the trash: the same full-width band, the deleted questions below it */
/* below a band, the whole width is tinted: separated blocks, the trash */
.separated-area, .trash-area .item-list { margin: 0 -20px; padding: 18px 20px 20px; background: var(--surface-2); }
.separated-area > .block:last-child { margin-bottom: 0; }
.area-empty { list-style: none; margin: 0; padding: 6px 2px; color: var(--muted); font-size: 0.85rem; font-style: italic; }
.trash-area { margin-top: 10px; }
.trash-area .item-list { margin-bottom: -20px; padding-bottom: 28px; min-height: 60px; }
.trash-area .item-row { background: var(--surface); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); margin: 6px 0; }
.block.block-separated { border-color: var(--border); box-shadow: inset 4px 0 0 color-mix(in srgb, var(--muted) 40%, transparent); }
.split-empty { margin: -6px 0 14px; }
.split-add { margin: 18px 0 0; }
/* Flow page: the split as the same grey divider */
.fl-node.fl-split { background: var(--surface-3); border-color: var(--border); margin: 14px 0; }
.fl-node.fl-split strong, .fl-node.fl-split .fl-icon { color: var(--fg); }
.trash-area .item-row { border-color: var(--border); }

/* Results page (work in progress) */
.badge-wip { background: var(--warn-soft); color: var(--warn); font-size: 0.65rem; }
/* the results column is as wide as the other one-column pages (.tabpage-single); tables and figures inside a panel
   keep their own width, set by their content */
.res-scroll { overflow-x: auto; }  /* a table wider than its panel scrolls within it */
/* tables and figures stand in the middle of their panel, as in a publication (Ralf, 2026-10-03); the texts around
   them stay left. A table keeps its content width, a figure its own maximum width. */
.results-page .res-scroll { width: fit-content; max-width: 100%; margin-inline: auto; }
.results-page :is(.res-freq, .res-bars, .psm-chart, .res-map, .pos2d-res, .pw-chart) { margin-inline: auto; }
.results-page .res-freq { max-width: 640px; }
.results-page .acbc-results { max-width: none; }  /* its texts stay left; its stacked tables share one width */
.results-page .acbc-results .res-scroll { width: 100%; max-width: 720px; }
/* blocks that hold texts, figures and tables together take the whole width; their figures and tables are centred
   above (Van Westendorp/NMS), or here (text highlighting: the text with its bars, the legend, the top words) */
.results-page .psm-results { max-width: none; }
.results-page .psm-legend { max-width: 720px; margin-inline: auto; justify-content: center; }
.results-page :is(.res-hl-text, .res-hl-top) { max-width: 820px; margin-inline: auto; }
.results-page .res-hl-legend { justify-content: center; }
.results-filter .row-fields { align-items: center; }
/* results tables as wide as their content, not the window */
.res-table { width: auto; max-width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.res-table th, .res-table td { text-align: right; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.res-table th:first-child, .res-table td:first-child { text-align: left; }
.res-scale { margin: 0 0 10px; }
.res-bars { display: flex; flex-direction: column; gap: 4px; max-width: 640px; }
.results-page .res-bars > li { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 90px; gap: 10px; align-items: center; font-size: 0.9rem; }
.res-bar { height: 12px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.res-bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.res-bar-n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 95 % intervals of the shares (app/intervals.py): a wider number column; on a phone the interval goes below */
.res-bars.res-bars-ci { max-width: 760px; }
.results-page .res-bars.res-bars-ci > li { grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 230px; }
.res-ci { white-space: nowrap; }
@media (max-width: 640px) {
  .results-page .res-bars.res-bars-ci > li { grid-template-columns: minmax(90px, 140px) minmax(0, 1fr) 110px; }
  .res-bars-ci .res-ci { display: block; }
}
/* item analysis: what to look at again (r_it below 0.30, alpha higher without the statement) */
.res-flag { color: var(--warn); background: var(--warn-soft); font-weight: 600; }
.res-freq + .res-freq { margin-top: 12px; }
.res-freq-head { margin: 0 0 4px; }

.results-filter label.inline-label { flex-direction: row; align-items: center; gap: 6px; flex-wrap: wrap; }
.results-filter label.inline-label .hint { flex-basis: 100%; }
.res-group-head { margin: 14px 0 4px; font-weight: 650; font-size: 0.9rem; }
.res-run { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.res-run p { margin: 0; }
/* the line of a form that saves by itself next to a note (Qualitätskontrolle): one baseline, also when the note wraps */
.res-run:has(> .autosave-bar) { align-items: baseline; }
.res-run > .autosave-bar { padding-top: 0; }
/* Qualitätskontrolle: the save line stays out of sight unless a change was not saved */
.qc-save:not(:has(.autosave-status:is(.is-error, .is-conflict, .is-invalid, .is-warn))) { display: none; }
.res-fold-all { display: inline-flex; gap: 8px; }
/* Results: each item folds on its header */
.res-fold > summary { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.res-fold > summary::-webkit-details-marker { display: none; }
.res-fold > summary h2 { margin: 0; }
.res-fold[open] > summary { margin-bottom: 12px; }
.res-fold:not([open]) .area-caret { transform: rotate(-90deg); }

/* Participant link on the Feld page: QR codes, links per group */
.links-head { font-size: 1rem; margin: 18px 0 6px; }
.group-links { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.geo-counts-pair { display: flex; flex-wrap: wrap; gap: 12px 40px; align-items: flex-start; margin-bottom: 10px; }
.geo-counts { font-size: 0.9rem; min-width: 260px; }
.geo-counts th { text-align: left; font-weight: 650; }
.geo-counts :is(th, td):not(:first-child) { text-align: right; padding-left: 18px; padding-right: 8px; font-variant-numeric: tabular-nums; }
.group-links th, .group-links td { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.group-links th.num, .group-links td.num { text-align: right; width: 1%; white-space: nowrap; }
.group-links input { width: 100%; min-width: 180px; font-size: 0.8rem; }
.lang-links { margin: 4px 0 14px; }
.lang-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 16px; margin-bottom: 6px; }
.lang-checks .check { margin: 0; }
fieldset.option-group, div.option-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.option-group + .option-group { margin-top: 18px; }
.hint-more { margin: -4px 0 6px; }
.hint-more > summary { cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--accent); width: fit-content; }
.hint-more > .hint { display: block; margin: 4px 0 0; }
.group-links .nowrap { white-space: nowrap; width: 1%; }
.group-form { margin-top: 12px; }
.qr-page { max-width: 560px; margin: 0 auto; text-align: center; }
.qr-page h1 { font-size: 1.3rem; }
.qr-image { width: min(360px, 100%); height: auto; display: block; margin: 12px auto; background: #fff; }
.qr-url code { word-break: break-all; }
.qr-actions { justify-content: center; }
@media print {
  .qr-actions, .site-header, .site-footer, header, footer { display: none !important; }
  .qr-page { border: 0; box-shadow: none; }
}
/* label box in the settings and on creation */
.label-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.label-row .label-prefix { color: var(--muted); font-size: 0.9rem; }
.label-row input { max-width: 240px; }
.label-form { margin-top: 14px; }
.label-form p, [data-label-form] p { margin: 4px 0; }
.label-state:empty { display: none; }
.label-state.ok { color: var(--ok); }
.label-state.bad { color: var(--danger); }

/* Landing page: screenshot carousel below the illustration */
.shots { position: relative; margin: 32px auto 8px; max-width: 870px; }
.shots-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; gap: 16px;
  scrollbar-width: none; border-radius: 12px; }
.shots-track::-webkit-scrollbar { display: none; }
.shot { flex: 0 0 100%; margin: 0; scroll-snap-align: center; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08); }
.shot figcaption { margin-top: 12px; text-align: center; font-size: 1.15rem; }
.shots-nav { position: absolute; top: calc(50% - 40px); transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface, #fff); color: inherit; font-size: 1.5rem; line-height: 1;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.shots-prev { left: -20px; }
.shots-next { right: -20px; }
.shots-nav[disabled] { opacity: 0.35; cursor: default; }
.shots-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.shots-dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: var(--border-strong); cursor: pointer; }
.shots-dots button[aria-current="true"] { background: var(--accent, #2b55a1); }
@media (max-width: 1040px) { .shots-prev { left: 6px; } .shots-next { right: 6px; } }
@media (prefers-reduced-motion: reduce) { .shots-track { scroll-behavior: auto; } }

/* Landing page: feature list */
.features { max-width: 1160px; margin: 48px auto 0; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; }
.feature-list li { position: relative; padding-left: 24px; line-height: 1.5; font-size: 1.08rem; }
.feature-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700; }
@media (max-width: 700px) { .feature-list { grid-template-columns: 1fr; } }

/* landing page: pronunciation and origin of the name, two small grey lines next to the title */
.name-note { display: inline-flex; flex-direction: column; justify-content: center; gap: 0.12em; vertical-align: middle;
  margin-left: 0.35em; font-size: 0.3em; line-height: 1.15; font-weight: 400; letter-spacing: 0; color: var(--muted);
  font-family: var(--font-serif); }

/* Confetti after starting a survey (full window, does not block clicks) */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }

/* Comments from test runs: yellow flags in the editor and the list page */
.badge-comment { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); text-decoration: none; width: fit-content; justify-self: start; align-self: center; }
.item-row.has-comments { box-shadow: inset 3px 0 0 var(--warn-bar); }
.block.has-comments { border-color: var(--warn-border); box-shadow: 0 0 0 2px var(--warn-soft); }
.comments-link { margin: 0 0 14px; font-size: 0.9rem; font-weight: 600; }
.comments-link a.has-open { display: inline-block; padding: 4px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-border); text-decoration: none; font-weight: 600; }
.comment-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.comment { border: 1px solid var(--border); border-left: 4px solid var(--warn-bar); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
.comment-resolved { border-left-color: #3aa76d; opacity: 0.85; }
.comment-ignored { border-left-color: var(--border-strong); opacity: 0.7; }
.comment-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.comment-text { white-space: pre-wrap; margin: 6px 0; }
.comment-note { margin: 4px 0; font-size: 0.9rem; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.comment-actions input { flex: 1; min-width: 200px; }
.tabs-inline a[aria-current="page"] { font-weight: 700; }
.dur-range { font-size: 0.75em; font-weight: 400; color: var(--muted); }

/* Separated section and trash: collapsible (closed while empty) */
.area-toggle > summary { list-style: none; cursor: pointer; user-select: none; }
.area-toggle > summary::-webkit-details-marker { display: none; }
.area-toggle > summary:hover { filter: brightness(0.98); }
.area-caret { flex: none; color: var(--muted); transition: transform 0.15s; }
.area-toggle:not([open]) .area-caret { transform: rotate(-90deg); }
.area-state { color: var(--muted); font-weight: 400; }
.area-toggle:not([open]) + .area-toggle > summary { margin-top: 10px; }
input.is-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 2px var(--danger-soft); }
.varname-msg { display: block; margin-top: 3px; font-size: 0.78rem; font-weight: 400; color: var(--danger); }

/* Element editor: live preview frame */
.item-frame { display: block; width: 100%; min-height: 120px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.live-dirty { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 0.75rem; font-weight: 600; }

/* Conjoint: prohibited level pairs as a grid per attribute pair */
.cj-prohib-pair { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.cj-prohib-pair > summary { cursor: pointer; font-weight: 600; }
.cj-prohib-grid { border-collapse: collapse; margin: 8px 0 4px; font-size: 0.85rem; }
.cj-prohib-grid th, .cj-prohib-grid td { border: 1px solid var(--border); padding: 4px 8px; text-align: center; }
.cj-prohib-grid th[scope="row"] { text-align: left; font-weight: 500; }
.cj-prohib-cell { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; cursor: pointer; }
.cj-prohib-cell input { position: absolute; opacity: 0; pointer-events: none; }
.cj-prohib-cell span { color: transparent; font-weight: 700; }
.cj-prohib-cell input:checked + span { color: var(--danger); }
.cj-prohib-cell:hover span { color: var(--border-strong); }
.cj-prohib-cell input:checked + span, .cj-prohib-cell:hover input:checked + span { color: var(--danger); }
td:has(> .cj-prohib-cell input:checked) { background: var(--danger-soft); }

/* Conjoint editor tabs */
.cj-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--border); margin: 6px 0 4px; }
.cj-tabs button { border: 0; background: none; padding: 9px 14px 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 6px 6px 0 0; }
.cj-tabs button:hover { background: var(--surface-2); color: var(--fg); }
.cj-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Feld page: who is in the survey right now */
.live-strip { margin: 10px 0 14px; }
.live-strip svg { display: block; width: 100%; height: 124px; overflow: visible; }
.live-axis-title { font-weight: 600; fill: var(--fg); }
.live-axis { stroke: var(--border-strong); stroke-width: 2; }
.live-tick { stroke: var(--border-strong); stroke-width: 1.5; }
.live-label { font: 12px system-ui, -apple-system, 'Segoe UI', sans-serif; fill: var(--muted); text-anchor: middle; }
.live-start { text-anchor: start; }
.live-end { text-anchor: end; }
.live-person { fill: #173a7a; }
:root[data-theme="dark"] .live-person { fill: #9cc0ff; }
.live-legend { margin: 2px 0 0; }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #173a7a; vertical-align: -1px; margin-right: 5px; }
:root[data-theme="dark"] .live-dot { background: #9cc0ff; }
.live-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.live-key { display: inline-flex; align-items: center; }
/* red button behind a safety latch */
.close-latched { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.close-latched form { margin: 0; }
.button-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
.latch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; user-select: none; }
.latch input { position: absolute; opacity: 0; pointer-events: none; }
.latch-track { position: relative; width: 38px; height: 20px; border-radius: 999px; background: var(--border-strong); transition: background 0.15s; }
.latch-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left 0.15s; }
.latch input:checked + .latch-track { background: var(--danger); }
.latch input:checked + .latch-track .latch-knob { left: 20px; }
.latch input:focus-visible + .latch-track { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.button-danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.button-danger:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); filter: brightness(0.9); }
.button-danger:disabled { opacity: 0.4; cursor: not-allowed; }
/* the two locked buttons sit in a frame; the latch is next to it, outside */
.latched-box { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1.5px dashed var(--border-strong);
  border-radius: 10px; transition: border-color 0.15s, background 0.15s; }
.latched-box.is-open { border-style: solid; border-color: var(--danger); background: var(--danger-soft); }

/* Timeline: the drawing stretches in width, the labels on top stay normal text */
.timeline-wrap { position: relative; margin: 10px 0 6px; }
.timeline-wrap .timeline-svg { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; }
.tl-label-html { position: absolute; font-size: 12px; line-height: 1; color: var(--muted); white-space: nowrap; pointer-events: none; }
.timeline-svg .tl-event, .timeline-svg .tl-now, .timeline-svg .tl-axis, .timeline-svg .tl-planned { vector-effect: non-scaling-stroke; }
.close-latched .latch { flex-direction: row; display: inline-flex; align-items: center; margin: 0; font-weight: 400; }

/* Van Westendorp curves on the results page (categorical slots 1-4; "not" curves dashed) */
.psm-results { margin: 8px 0 16px; max-width: 720px; }
.psm-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 4px; font-size: 0.85rem; color: var(--muted); }
.psm-legend li { display: flex; align-items: center; gap: 6px; }
.psm-chart { position: relative; margin: 0 0 12px; max-width: 720px; }  /* the SVG scales with its box, text included */
.psm-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.psm-grid { stroke: var(--border); stroke-width: 1; }
.psm-axis { stroke: var(--border-strong); stroke-width: 1; }
.psm-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.psm-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.psm-too_cheap { stroke: #2a78d6; }
.psm-not_cheap { stroke: #eb6834; stroke-dasharray: 6 4; }
.psm-not_expensive { stroke: #1baf7a; stroke-dasharray: 6 4; }
.psm-too_expensive { stroke: #eda100; }
.psm-trial, .psm-revenue { stroke: #2a78d6; }
.psm-direct { fill: var(--fg); font-size: 11px; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.psm-mark { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.psm-mark-label { fill: var(--fg); font-size: 11px; font-weight: 600; }
.psm-cross { stroke: var(--muted); stroke-width: 1; }
/* Semantic differential: polarity profile (surveys/_profile_results.html). Poles left and right of a track with the
   scale points; per series a bar (quartiles or ± SD), a marker and a line through the markers. Series colours as
   the PSM curves. */
.sd-profile { --sd-row: 40px; max-width: 900px; margin: 8px 0 12px; }
.results-page .sd-profile { margin-inline: auto; }
.sd-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 0 0 8px; font-size: 0.85rem; color: var(--muted); }
.sd-legend li { display: flex; align-items: center; gap: 6px; }
.sd-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--sd); }
.sd-grid { display: grid; grid-template-columns: minmax(70px, max-content) minmax(160px, 1fr) minmax(70px, max-content); column-gap: 14px; }
.sd-axis { position: relative; height: 20px; font-size: 0.75rem; color: var(--muted); }
.sd-axis span { position: absolute; transform: translateX(-50%); }
.sd-poles { display: grid; grid-auto-rows: var(--sd-row); font-size: 0.9rem; }
.sd-poles span { display: flex; align-items: center; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; max-width: 220px; }
.sd-left span { justify-content: flex-end; text-align: right; }
.sd-track { position: relative; height: calc(var(--sd-rows) * var(--sd-row)); background-repeat: repeat-y; background-size: 100% var(--sd-row);
  background-image: linear-gradient(transparent calc(50% - 0.5px), var(--border) calc(50% - 0.5px), var(--border) calc(50% + 0.5px), transparent calc(50% + 0.5px)); }
.sd-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.sd-track svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sd-line { fill: none; stroke: var(--sd); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; opacity: 0.8; }
.sd-range { position: absolute; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--sd); opacity: 0.35; }
.sd-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--sd); border: 2px solid var(--surface); box-sizing: content-box; }
.sd-profile figcaption { text-align: center; margin-top: 6px; }
.sd-c0 { --sd: #2a78d6; } .sd-c1 { --sd: #eb6834; } .sd-c2 { --sd: #1baf7a; } .sd-c3 { --sd: #eda100; }
:root[data-theme="dark"] .sd-c0 { --sd: #3987e5; } :root[data-theme="dark"] .sd-c1 { --sd: #d95926; } :root[data-theme="dark"] .sd-c2 { --sd: #199e70; }
.res-dist > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--accent); width: fit-content; margin: 4px 0; }
.res-dist[open] > summary { margin-bottom: 10px; }
@media (max-width: 600px) {
  .sd-profile { --sd-row: 48px; }
  .sd-grid { grid-template-columns: minmax(56px, 26%) minmax(0, 1fr) minmax(56px, 26%); column-gap: 8px; }
  .sd-poles { font-size: 0.8rem; }
}
.psm-hit { fill: transparent; cursor: crosshair; }
.psm-tip { position: absolute; top: 0; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 6px 9px; font-size: 0.8rem; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); white-space: nowrap; }
.psm-tip b { font-variant-numeric: tabular-nums; }
.psm-points td:first-child, .psm-points th:first-child, .psm-points td:last-child, .psm-points th:last-child { text-align: left; }
.psm-table { margin: 8px 0; }
.psm-table summary { cursor: pointer; color: var(--accent); }
:root[data-theme="dark"] .psm-too_cheap, :root[data-theme="dark"] .psm-trial, :root[data-theme="dark"] .psm-revenue { stroke: #3987e5; }
:root[data-theme="dark"] .psm-not_cheap { stroke: #d95926; }
:root[data-theme="dark"] .psm-not_expensive { stroke: #199e70; }
:root[data-theme="dark"] .psm-too_expensive { stroke: #c98500; }

/* Map element: start view in the element editor (Leaflet); the cross marks the centre that is saved */
.map-editor { margin-bottom: 10px; }
.map-editor .p-map-search { display: flex; gap: 8px; margin-bottom: 8px; }
.map-editor .p-map-search[hidden], .map-editor .p-map-results[hidden] { display: none; }
.map-editor .p-map-search input { flex: 1; min-width: 0; }
.map-editor .p-map-results { list-style: none; margin: 0 0 8px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.map-editor .p-map-results button { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--fg); padding: 5px 8px; cursor: pointer; font: inherit; font-size: 0.9rem; }
.map-editor .p-map-results button:hover { background: var(--accent-soft); }
.map-editor .p-map-empty, .map-editor .p-map-credit { padding: 4px 8px; color: var(--muted); font-size: 0.8rem; }
.map-editor-canvas { position: relative; height: 320px; border: 1px solid var(--border); border-radius: 8px; z-index: 0; }
/* follow-up questions of a map: the ends of a scale, or the options of a single choice */
td[data-mq-kind] .mq-options { display: block; width: 100%; min-width: 10em; }
.edit-table input[name="mq_text"] { min-width: 10em; }
td[data-mq-kind="choice"] .mq-ends, td[data-mq-kind="text"] .mq-ends, td[data-mq-kind="scale"] .mq-options,
td[data-mq-kind="text"] .mq-options { display: none; }
.map-editor-cross { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; z-index: 500; pointer-events: none;
  background: linear-gradient(#d62828, #d62828) center / 2px 100% no-repeat, linear-gradient(#d62828, #d62828) center / 100% 2px no-repeat; }

/* Map element on the results page: heatmap or all markers (map_results.js) */
.res-map { margin: 8px 0 16px; max-width: 720px; }
.res-map-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.res-map-canvas { height: min(65vh, 480px); min-height: 280px; border: 1px solid var(--border); border-radius: 8px; z-index: 0; }
.res-map .q-map-icon { background: none; border: 0; }
.res-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.res-legend li { display: flex; align-items: center; gap: 5px; }
.res-swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(8, 48, 107, 0.5); }
.res-swatch.is-none { background: #ffffff; }  /* as the states nobody chose on the map (state_map.js) */
.res-map .q-map-icon svg { display: block; overflow: visible; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35)); }

/* Menu bar: "€" link to pricing and donations */
/* Pricing page */
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: stretch; }
.pricing .price-card { margin: 0; }
.price-card h2 { margin-top: 0; }
.price-card .price { font-family: var(--font-serif); font-size: 2rem; font-weight: 600; margin: 4px 0 12px; }
.price-card ul { padding-left: 20px; }
.price-card-donate { border-color: var(--accent); }

/* Method section page: facts in columns, then the AI description */
.mfacts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.mfacts-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mfacts > .panel { margin: 0; }
.mfacts h2 { margin-top: 0; }
.mfacts-list { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.mfacts-list dt { color: var(--muted); }
.mfacts-list dd { margin: 0; font-variant-numeric: tabular-nums; }
.mfacts-instrument { padding: 6px 0; border-top: 1px solid var(--surface-3); }
.mfacts-instrument:first-of-type { border-top: 0; }
.mgen { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.mgen-langs { flex-basis: 100%; display: flex; gap: 10px; }  /* the language buttons in a line of their own, under the length */
.methods-text { width: 100%; font: inherit; line-height: 1.5; }

/* Results: 2D positioning and free associations */
.pos2d-res { max-width: 480px; margin: 8px 0 16px; }
.pos2d-res svg { width: 100%; height: auto; display: block; overflow: visible; }
.pos2d-frame { fill: var(--surface-2, transparent); stroke: var(--border-strong); }
.pos2d-mid { stroke: var(--border); }
.pos2d-sd { stroke: var(--accent); stroke-opacity: 0.35; stroke-width: 2; }
.pos2d-dot { fill: var(--accent); }
.pos2d-label { font-size: 12px; fill: var(--fg); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.pos2d-end { font-size: 11px; fill: var(--muted); }
.pos2d-axis { font-size: 12px; font-weight: 600; fill: var(--fg); }
.res-terms td:nth-child(2), .res-terms td:nth-child(3) { white-space: nowrap; }
.res-terms-bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--accent); opacity: 0.6; margin-right: 6px; vertical-align: middle; }
.res-terms-val.is-neg { color: var(--danger, #b3261e); }
.res-terms-val.is-pos { color: var(--ok); }
/* Texts typed next to an answer option ("Anderes: ...") */
.res-texts { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 6px; font-size: 0.9rem; }
.res-texts > li { padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; overflow-wrap: anywhere; }
.landing-demo { margin: 14px 0 0; }

/* Conjoint (CBC, ACBC) on the results page: stacked tables with the same columns, as wide as the PSM charts */
.acbc-results { max-width: 720px; }
.acbc-results .res-table { width: 100%; margin: 0 0 12px; table-layout: fixed; }  /* stacked tables share their columns */
.acbc-results .res-table th:first-child { width: 38%; }
.acbc-results .acbc-counts th:first-child { width: 30%; }
.acbc-results .res-table th .hint { font-weight: 400; }

/* Conjoint part-worths: zero-centred bars (app/choice_model.py charts()) */
.pw-chart { display: block; width: 100%; max-width: 720px; height: auto; margin: 4px 0 2px; overflow: visible; }
.pw-grid { stroke: var(--border); stroke-width: 1; }
.pw-grid.pw-zero { stroke: var(--border-strong); stroke-width: 1.5; }
.pw-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.pw-label { fill: var(--fg); font-size: 13px; }
.pw-value { fill: var(--fg); font-size: 12px; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.pw-pos { fill: var(--accent); }
.pw-neg { fill: #d9822b; }
.pw-whisker { stroke: var(--fg); stroke-width: 1.2; opacity: 0.55; }
.cm-importance-bars { margin: 4px 0 2px; }
/* HB (app/conjoint_hb.py): value with its interval on one line; intervals and quartiles get the wider columns */
.results-page .res-bars.hb-importance > li { grid-template-columns: minmax(110px, 200px) minmax(0, 1fr) 150px; }
.hb-importance .res-bar-n { white-space: nowrap; }
.acbc-results .hb-utilities th:first-child { width: auto; }
/* the market simulator grows with its products: content width up to the whole column, then it scrolls (Ralf, 2026-10-04) */
.results-page .acbc-results .sim-fold .res-scroll { width: fit-content; max-width: 100%; }
.acbc-results .res-table.sim-table { width: auto; table-layout: auto; }
.acbc-results .sim-table th:first-child { width: auto; }
.sim-table td { white-space: nowrap; }
.hb-utilities .hb-c-label { width: 24%; }
.hb-utilities .hb-c-num { width: 10%; }
.hb-utilities .hb-c-range { width: 21.5%; }
.hb-utilities .hb-c-share { width: 13%; }
.hb-utilities th, .hb-utilities td { white-space: nowrap; }
.hb-utilities td:first-child { white-space: normal; }
.pw-head { margin: 16px 0 0; font-weight: 600; font-size: 0.9rem; }
/* MaxDiff MNL scores (app/maxdiff_analysis.py chart()): bars from 0, dashed anchor threshold */
.pw-pos.md-below { opacity: 0.45; }
.md-threshold { stroke: #d9822b; stroke-width: 1.5; stroke-dasharray: 5 3; }
.md-threshold-label { fill: #d9822b; }
/* MaxDiff HB (app/maxdiff_hb.py): distribution across persons, RLH histogram */
.res-run-hb { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }
.res-run-hb form { margin: 0; }
.md-dot { fill: var(--accent); opacity: 0.3; }
.md-range { stroke: var(--fg); stroke-width: 1.2; opacity: 0.6; }
.md-box { fill: var(--surface); fill-opacity: 0.75; stroke: var(--fg); stroke-width: 1.2; }
.md-median { stroke: var(--fg); stroke-width: 2.5; }
.md-mean { fill: #d9822b; }
.md-rlh { fill: var(--accent); }
.md-rlh-low { fill: #d9822b; }
.md-rlh-legend { margin: 2px 0 6px; }
.md-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.md-key-ok { background: var(--accent); }
.md-key-low { background: #d9822b; }
.md-key-line { display: inline-block; width: 14px; height: 0; vertical-align: 3px; border-top: 2px solid var(--muted); }
.md-key-limit { border-top: 2px dashed #d9822b; }
.md-hb td:not(:first-child), .md-hb th:not(:first-child) { white-space: nowrap; }
/* HB convergence (app/hb_convergence.py): log-likelihood trace, status */
.hb-trace { max-height: 110px; }
.hb-trace-line { fill: none; stroke: var(--accent); stroke-width: 1.2; }
.hb-conv-ok { color: var(--accent); }
.hb-conv-check { color: #d9822b; }

/* Admin: AI usage */
.aic-periods { margin: 0 0 16px; }
.aic-periods a { padding: 6px 14px; text-decoration: none; color: var(--fg); border-radius: 8px; }
.aic-periods a.is-active { background: var(--accent); color: var(--on-accent); border-radius: 8px; }
.aic-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.aic-kpis > div { display: flex; flex-direction: column; gap: 2px; }
.aic-big { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 600; }
.aic-chart { width: 100%; height: auto; display: block; }
.aic-axis { stroke: var(--border-strong); }
.aic-tick { font-size: 10px; fill: var(--muted); }
.aic-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.85rem; color: var(--muted); }
.aic-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.aic-table { margin: 4px 0 12px; }
.aic-table td:not(:first-child), .aic-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.aic-table input { width: 100%; }
.admin-tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--border); }
.admin-tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tabs a.is-active { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.admin-people td:nth-child(2), .admin-people td:nth-child(3), .admin-people td:nth-child(4), .admin-people th:nth-child(2), .admin-people th:nth-child(3), .admin-people th:nth-child(4) { text-align: left; white-space: normal; }
.admin-people { width: 100%; }
.aic-table.admin-people th, .aic-table.admin-ranking th { white-space: normal; vertical-align: bottom; line-height: 1.25; }  /* heads may break: narrow number columns */
.admin-people th:first-child { text-align: left; }
.admin-people td, .admin-people th { padding-right: 10px; }
.admin-people td:last-child, .admin-people th:last-child { padding-right: 0; }
.admin-people .admin-name { white-space: nowrap; }
/* Rows in two quiet shades, so the eye stays in its line across a wide table */
.zebra, .admin-people, .admin-ranking { border-collapse: collapse; }
:is(.zebra, .admin-people, .admin-ranking) :is(th, td) { padding-top: 6px; padding-bottom: 6px; }
:is(.zebra, .admin-people, .admin-ranking) :is(th, td):first-child { padding-left: 8px; }
.aic-table:is(.zebra, .admin-people, .admin-ranking) :is(th, td):last-child { padding-right: 8px; }
:is(.zebra, .admin-people, .admin-ranking) tbody tr:nth-child(even) { background: var(--surface-2); }
/* Long lists (app/tables.py, _listing.html): search field, column heads that sort, pages */
.list-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.list-search input[type=search] { flex: 1 1 260px; max-width: 520px; height: 38px; box-sizing: border-box; }
.sort-link { color: inherit; text-decoration: none; font-weight: inherit; }
.sort-link:hover, .sort-link.is-active { color: var(--accent); }
.sort-link:focus-visible, .pager-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); border-radius: 6px; }
.sort-arrow { margin-left: 4px; font-size: 0.7em; vertical-align: 1px; white-space: nowrap; }
.list-sort { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 4px; }
.list-sort .sort-link { font-weight: 600; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 12px 0; }
.pager-links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager-link { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 32px; height: 32px;
  padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--fg);
  font-size: 0.85rem; font-weight: 550; text-decoration: none; }
a.pager-link:hover { background: var(--surface-3); }
.pager-link.is-current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pager-link.is-off { color: var(--muted); border-color: var(--border); background: transparent; }
.pager-gap { color: var(--muted); padding: 0 2px; }

/* Survey wizard: no boxes around groups of fields; their legends become plain subheadings */
.wizard-panel fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.wizard-panel legend, .wizard-sub { font-size: 1rem; font-weight: 600; padding: 0; margin: 8px 0 6px; }
.wizard-step-sprachen legend { display: none; }  /* the step title already says "Sprachen" */
.reveal { margin: -4px 0 4px 28px; }
.reveal[hidden] { display: none; }
.cm-utilities td:not(:first-child) { white-space: nowrap; }  /* intervals on one line; long headers may break */
.consent-facts-summary .plain-inline { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 2px 16px; color: var(--muted); }

/* AI actions: violet buttons and the "being written" box while the AI works; the result itself looks normal */
.button.button-ai, .icon-btn.button-ai { background: var(--ai-soft); border-color: var(--ai-border); color: var(--ai) !important; }
.button.button-ai:hover:not(:disabled), .icon-btn.button-ai:hover { background: var(--ai-soft); border-color: var(--ai); color: var(--ai); filter: none; }
.button.button-ai .icon, .icon-btn.button-ai .icon { color: var(--ai); }
.ai-writing { border: 1px solid var(--ai-border); background: var(--ai-soft); border-radius: 8px; padding: 12px 14px; margin: 8px 0 12px; }
.ai-writing[hidden] { display: none; }
.ai-writing-head { color: var(--ai); font-size: 0.9rem; font-weight: 600; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.ai-writing-head::before { content: "✦"; animation: ai-pulse 1.2s ease-in-out infinite; }
.ai-writing-text { margin: 0; color: var(--ai); filter: blur(3.5px); line-height: 1.6; user-select: none; white-space: pre-wrap; }
@keyframes ai-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .ai-writing-head::before { animation: none; } }
/* an AI button while its request runs (app.js): a glint runs across it from left to right; without motion it pulses */
.button.button-ai.ai-busy { position: relative; overflow: hidden; cursor: progress; }
.button.button-ai.ai-busy::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 15%, rgba(255, 255, 255, 0.85) 50%, transparent 85%);
  transform: translateX(-100%); animation: ai-glint 1.1s linear infinite; }
.button.button-ai.ai-busy .icon { animation: ai-pulse 1.3s ease-in-out infinite; }
@keyframes ai-glint { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .button.button-ai.ai-busy::after { animation: none; transform: none; background: transparent; }
  .button.button-ai.ai-busy { animation: ai-pulse 2s ease-in-out infinite; }
}
/* the AI entry in the palette ("Skala mit KI entwerfen") in the AI violet */
.palette-row.palette-ai { background: var(--ai-soft); border: 1px solid var(--ai-border); border-radius: 10px; margin: 10px 0; padding-right: 4px; }
.palette-row.palette-ai:hover { border-color: var(--ai); }
.palette-row.palette-ai .palette-item { background: transparent; border-color: transparent; }
.palette-row.palette-ai .palette-item strong, .palette-row.palette-ai .palette-item .item-icon { color: var(--ai); }
.palette-row.palette-ai .palette-add.button-ai { background: transparent; border-color: transparent; }
/* the AI button under "Anregungen": as large and wide as "+ Neuer Block"; its longer text may wrap */
.palette-block.button-ai { white-space: normal; height: auto; min-height: 38px; padding-top: 7px; padding-bottom: 7px; text-align: center; }

/* Theme of the participant pages: summary in the settings, page "Erscheinungsbild" (settings left, live preview right) */
.theme-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.theme-summary .button { margin-left: auto; }
.theme-swatches { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; vertical-align: middle; }
.theme-swatches span { width: 18px; height: 18px; }
.design-title { margin-bottom: 14px; }
.design-page { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; padding-bottom: 24px; }
.design-page .panel { margin: 0 0 16px; }
.design-side { min-width: 0; }
.design-presets { display: flex; flex-direction: column; gap: 6px; }
.design-preset { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--fg); font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer; }
.design-preset:hover { border-color: var(--accent); }
.design-preset[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.design-preset .muted { font-weight: 400; }
.design-colours { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.design-colours legend { padding: 0; margin-bottom: 8px; }
.stack label.design-colour { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; font-weight: 400; }
.design-colour > span:first-child { display: flex; flex-direction: column; font-weight: 600; }
.design-colour .hint { margin-left: 0; }
.design-colour-inputs { display: flex; align-items: center; gap: 6px; flex: none; }
.design-colour-inputs input[type=color] { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }
.design-colour-inputs input[type=text] { width: 6.2em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; }
.design-colour-inputs input[type=text]:invalid { border-color: var(--danger); }
.design-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.design-widths { display: flex; gap: 6px; }
.design-widths .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.design-frame { display: block; width: 100%; height: 640px; margin: 0 auto 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; }
.design-frame.is-phone { width: 390px; max-width: 100%; }
.design-checks { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.design-checks li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; font-size: 0.9rem; }
.design-check-sample { display: grid; place-items: center; height: 28px; border: 1px solid var(--border); border-radius: 6px; font-weight: 700; font-size: 0.85rem; }
.design-check-ratio { font-variant-numeric: tabular-nums; color: var(--muted); }
.design-check-state { font-weight: 600; min-width: 6.5em; }
.design-checks .is-ok .design-check-state { color: var(--ok); }
.design-checks .is-error .design-check-state { color: var(--danger); }
.design-checks .is-warning .design-check-state { color: var(--warn); }
.design-check-fix { grid-column: 2 / -1; justify-self: start; }
@media (max-width: 1000px) { .design-page { grid-template-columns: 1fr; } .design-side { order: -1; } .design-frame { height: 520px; } }
.design-page { grid-template-areas: "form side" "logo side"; }
.design-form { grid-area: form; } .design-logo { grid-area: logo; } .design-side { grid-area: side; }
.design-logo-fields { border: 0; border-top: 1px solid var(--border); padding: 14px 0 0; margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.design-logo-fields legend { padding: 0 8px 0 0; }
.design-logo-fields .hint { margin-left: 0; }
.design-logo-slot + .design-logo-slot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.design-logo-slot h3 { font-size: 0.925rem; margin: 0 0 10px; }
.design-logo-current { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.design-logo-current.is-dark { background: #141517; }
.design-logo-current img { max-width: 60%; max-height: 64px; height: auto; width: auto; }
.design-logo-upload input[type=file] { font-size: 0.85rem; max-width: 100%; }
@media (max-width: 1000px) { .design-page { grid-template-areas: "side" "form" "logo"; } .design-side { order: 0; } }
.design-page .stack label.check { flex-wrap: nowrap; align-items: flex-start; }
.design-page .stack label.check input { flex: none; margin-top: 3px; }
.source-choice label.check { flex-wrap: nowrap; align-items: flex-start; }  /* a long label stays next to its box (phone) */
.source-choice label.check input { flex: none; margin-top: 3px; }
.design-fixed-note { margin: 0; }
.design-fixed-note[hidden] { display: none; }
.admin-theme-logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 12px; }
.admin-theme-logo h3 { font-size: 0.925rem; margin: 0 0 10px; }
.admin-ranking td:nth-child(2), .admin-ranking td:nth-child(4), .admin-ranking th:nth-child(2), .admin-ranking th:nth-child(4) { text-align: left; white-space: normal; }
.admin-ranking td:nth-child(3), .admin-ranking th:nth-child(3) { text-align: left; }
.admin-ranking code { white-space: nowrap; }
.admin-ranking td, .admin-ranking th { padding-right: 14px; }
.design-scheme { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.design-scheme legend { padding: 0; margin-bottom: 6px; }
.design-dark { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.design-dark[hidden] { display: none; }
.design-dark .hint { margin: 0; }
.design-widths .chip[hidden] { display: none; }
/* a message instead of construct ideas (e.g. context missing): clearly visible, not grey small print */
.ai-idea-list li.ai-idea-note { display: block; background: var(--warn-soft, #fdf3dc); border-left: 3px solid var(--warn, #9a6200); border-radius: 6px; padding: 8px 10px; font-size: 0.9rem; }
.design-page { grid-template-areas: "form side" "mine side" "logo side"; }
.design-mine { grid-area: mine; }
.design-apply { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.design-apply label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.925rem; flex: 1 1 180px; min-width: 0; }
@media (max-width: 1000px) { .design-page { grid-template-areas: "side" "form" "mine" "logo"; } }
.design-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.design-tile { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
/* the sample page at 40 % of its size: the frame is 2.5 times as wide and high as the tile's window and scaled down */
.design-tile-look { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 8px; }
.design-tile-look iframe { position: absolute; top: 0; left: 0; width: 250%; height: 250%; border: 0; transform: scale(0.4); transform-origin: 0 0; pointer-events: none; }
.design-tile-facts, .design-tile-title { margin: 0; }
.design-tile-name, .design-tile-share { display: flex; gap: 6px; }
.design-tile-name input, .design-tile-share input, .design-tile-share select { flex: 1; min-width: 0; }
.design-tile-share + .design-tile-share { margin-top: 6px; }
.design-tile-note { margin: 6px 0 0; }
.design-tile-shares li { flex-wrap: wrap; }
.design-right { padding: 1px 8px; font-size: 0.8rem; font-weight: 500; }
.group-list .group-name { font-weight: 600; }
.group-list .group-description { flex-basis: 100%; }
.design-tile-shares { font-size: 0.9rem; }
.design-tile-shares ul { list-style: none; margin: 4px 0 8px; padding: 0; }
.design-tile-shares li { display: flex; align-items: center; gap: 6px; }
.design-builtin { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.design-builtin li { display: flex; align-items: center; gap: 10px; }
.theme-choice { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.theme-choice-list { border: 0; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; min-width: 0; }
.theme-choice-list legend { padding: 0; margin-bottom: 8px; }
.theme-choice-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; font-size: 0.9rem; }
.theme-choice-item:hover { border-color: var(--accent); }
.theme-choice-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.theme-choice-item input { flex: none; margin: 0; }
/* Settings: seven groups, each folded to one line (name, what is set, lock); open, the group shows its forms */
.settings-tools { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.tabpage-grid > .settings-group { padding: 0; margin: 0 0 12px; }
.settings-group > summary { list-style: none; cursor: pointer; user-select: none; display: grid; align-items: center; gap: 4px 12px;
  grid-template-columns: 20px minmax(160px, 260px) minmax(0, 1fr) auto; padding: 14px 20px; border-radius: 12px; }
.settings-group > summary::-webkit-details-marker { display: none; }
.settings-group > summary:hover { background: var(--surface-2); }
.settings-group > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.settings-group[open] > summary { border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }
.settings-group > summary h2 { margin: 0; font-size: 1.05rem; }
.settings-caret { display: inline-flex; color: var(--muted); transition: transform 0.15s; }
.settings-group[open] .settings-caret { transform: rotate(90deg); }
.settings-sum { color: var(--muted); font-size: 0.88rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.settings-body > :first-child { margin-top: 0; }
.settings-body h3 { font-size: 1rem; margin: 8px 0 0; }
.settings-fold > summary { cursor: pointer; font-weight: 600; width: fit-content; }
.settings-fold[open] > summary { margin-bottom: 10px; }
.fixed-mark { display: inline-flex; vertical-align: -2px; color: var(--muted); opacity: 0.6; }
.fixed-mark.is-fixed { opacity: 1; }
.consent-mentions { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 0.9rem; }
.consent-mentions ul { margin: 6px 0 0; padding-left: 18px; }
.consent-mentions li { margin: 2px 0; }
@media (max-width: 700px) {
  .settings-group > summary { grid-template-columns: 18px minmax(0, 1fr) auto; padding: 12px 14px; }
  .settings-sum { grid-column: 2 / 4; grid-row: 2; white-space: normal; }
  .settings-body { padding: 14px; }
}
/* the page "Duplizieren": two panels side by side */
.settings-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.settings-pair > .panel { margin: 0; max-width: none; width: auto; }
@media (max-width: 1100px) { .settings-pair { grid-template-columns: 1fr; } }
.stack label.theme-choice-item { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }  /* in the wizard's form */
.design-logo-colours { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.design-logo-swatches { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 0.85rem; color: var(--muted); }
.design-logo-swatch { width: 34px; height: 34px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; padding: 0; }
.design-logo-swatch:hover { outline: 2px solid var(--accent); outline-offset: 2px; }
.design-logo-swatch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.design-page { grid-template-areas: "form side" "mine side" "logo side" "partner side"; }
.design-partner { grid-area: partner; }
.design-partner .design-logo-current img { max-width: 40%; }
.design-partner-name { flex: 1; min-width: 0; font-size: 0.9rem; }
@media (max-width: 1000px) { .design-page { grid-template-areas: "side" "form" "mine" "logo" "partner"; } }
.design-edit-head { margin: 20px 20px 14px; }
.design-edit-head h1 { margin: 0; }
.design-new { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.design-new input { flex: 1 1 220px; min-width: 0; max-width: 360px; }
.admin-groups { list-style: none; margin: 0; padding: 0; }
.admin-groups > li { padding: 14px 0; border-bottom: 1px solid var(--surface-3); display: flex; flex-direction: column; gap: 8px; }
.admin-groups > li:last-child { border-bottom: 0; padding-bottom: 0; }
.admin-group-name { max-width: 520px; }
.admin-group-facts { margin: 0; }
.admin-group-actions { justify-content: space-between; align-items: center; }
.admin-group-members { margin: 0; line-height: 1.7; }  /* all members visible, in one flowing line under the leads */
.admin-group-member { white-space: nowrap; }
.member-groups { margin: 14px 0 6px; padding-top: 10px; border-top: 1px solid var(--surface-3); }
.member-groups h3 { margin: 0 0 4px; font-size: 0.95rem; }
.member-group summary { cursor: pointer; }
.member-group ul { list-style: none; margin: 6px 0 0; padding: 0 0 0 18px; }
.member-group li { border: 0; padding: 2px 0; }
.member-group-add { flex-wrap: wrap; margin-top: 8px; }
.member-group-add select:first-of-type { flex: 1 1 200px; min-width: 0; }
.dash-groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; }
.dash-groups a { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.85rem; color: var(--muted); text-decoration: none; font-weight: 400; }
.dash-groups a:hover { color: var(--fg); border-color: var(--border-strong); }
.dash-groups a.is-active { color: var(--fg); border-color: var(--accent); font-weight: 600; }
/* Start page: pin (star) a survey to the top of the list */
.pin-form { margin-right: 4px; vertical-align: 1px; }
.pin-btn { border: 0; background: none; padding: 0 2px; font-size: 1.15rem; line-height: 1; color: var(--muted); cursor: pointer; }
.pin-btn:hover, .pin-btn[aria-pressed="true"] { color: #e0a800; }
.pin-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); border-radius: 4px; }
.card-list > .card { scroll-margin-top: 96px; }  /* a jump to a card (e.g. after pinning) clears the sticky header */
/* the parameter table in half width: the name column wide enough for its placeholder, the long select shrinks */
#panel .edit-table td:first-child input { min-width: 124px; }
#panel .edit-table select[name="param_mode"] { width: 100%; max-width: 100%; min-width: 0; }
#panel .edit-table td:nth-child(2) { width: 36%; }

/* Landing page: a highlighter note that the tool is still being built (light yellow, like a text marker) */
.dev-mark { padding: 0.05em 0.3em; border-radius: 0.3em 0.15em; color: #1c1c1a; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(100deg, rgba(255, 233, 80, 0.75), rgba(255, 238, 110, 0.9) 50%, rgba(255, 233, 80, 0.7)); }

/* Results: text highlighting (the text with a stacked bar under every word) and cloze gaps */
.hl-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border); vertical-align: middle; margin-right: 6px; }
.res-hl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.res-hl-key { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.res-hl-key i, .res-hl-top h4 i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, 0.2); }
.res-hl-text { white-space: pre-wrap; line-height: 2.5; font-size: 1.02rem; max-width: 820px; }
.res-hl-w { position: relative; display: inline-block; line-height: 1.4; padding-bottom: 8px; }
.res-hl-bar { position: absolute; left: 0; right: 0; bottom: 1px; height: 6px; display: flex; border-radius: 3px; overflow: hidden;
  background: var(--border); }
.res-hl-bar i { display: block; height: 100%; }
.res-hl-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; margin-top: 10px; }
.res-hl-top h4 { display: flex; align-items: center; gap: 6px; font-size: 0.95rem; margin: 0 0 6px; }
.res-hl-top ol { margin: 0; }
.res-cloze { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 28px; }
.res-cloze-gap h4 { font-size: 0.95rem; margin: 0 0 6px; }

/* Translation page (surveys/translation.html): source left, translation right, status per text */
.tr-head-row { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; justify-content: space-between; }
.tr-head-row h2 { margin: 0; }
.tr-progress { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); margin: 14px 0 10px; }
.tr-progress i, .tr-dot { display: block; }
.tr-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.is-ok.tr-dot, .tr-progress .is-ok { background: #3c9a5f; }
.is-validated.tr-dot, .tr-progress .is-validated { background: #2a5db0; }
.is-ai.tr-dot, .tr-progress .is-ai { background: var(--ai); }
.is-changed.tr-dot, .tr-progress .is-changed { background: #e0a800; }
.is-missing.tr-dot, .tr-progress .is-missing { background: #c9c9c2; }
.tr-filters { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.tr-chip { border: 1px solid var(--border); background: var(--bg); color: var(--fg); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 0.9rem; cursor: pointer; }
.tr-chip.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.tr-chip span { color: var(--muted); margin-left: 2px; }
.tr-actions { margin-top: 14px; align-items: center; }
.tr-ai-status { margin: 0; }
.tr-group-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.tr-group-head h2 { margin: 0; }
.tr-unit { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--surface-3); scroll-margin-top: 90px; }
.tr-unit h3 { font-size: 0.95rem; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.tr-unit h3 a { color: var(--fg); }
.tr-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr); gap: 6px 16px; padding: 7px 0; align-items: start; }
.tr-role { color: var(--muted); font-size: 0.85rem; padding-top: 6px; }
.tr-source { white-space: pre-wrap; padding: 6px 0; line-height: 1.5; }
.tr-target { display: flex; flex-direction: column; gap: 4px; }
.tr-target textarea { width: 100%; min-height: 0; resize: vertical; line-height: 1.5; }
.tr-validated { white-space: pre-wrap; padding: 6px 0; line-height: 1.5; }
.tr-fixed { white-space: pre-wrap; padding: 6px 8px; border-radius: 6px; background: var(--surface-2, var(--surface-3)); line-height: 1.5; }
.tr-status { align-self: flex-start; font-size: 0.78rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.tr-status.is-ok { background: rgba(60, 154, 95, 0.14); color: var(--ok); }
.tr-status.is-ai { background: var(--ai-soft); color: var(--ai); }
.tr-status.is-changed { background: var(--warn-soft); color: var(--warn); }
.tr-status.is-validated { background: var(--accent-soft); color: var(--accent); }
.tr-status.is-error { background: var(--danger-soft); color: var(--danger, #b3261e); }
.tr-diff { padding: 6px 8px; border-left: 3px solid var(--warn-bar); background: var(--warn-soft); border-radius: 0 6px 6px 0; }
.tr-diff-label { display: block; font-size: 0.78rem; color: var(--warn); margin-bottom: 2px; white-space: normal; }
.tr-n { font-weight: inherit; margin: 0; }
.tr-diff del { color: var(--danger, #b3261e); text-decoration: line-through; }
.tr-diff ins { text-decoration: none; background: rgba(60, 154, 95, 0.2); border-radius: 3px; }
.tr-row.is-saving textarea { opacity: 0.6; }
.tr-row.is-ai-working textarea { border-color: var(--ai-border); animation: tr-ai-shimmer 1.4s ease-in-out infinite; }
@keyframes tr-ai-shimmer { 0%, 100% { background: var(--ai-soft); } 50% { background: var(--bg); } }
@media (prefers-reduced-motion: reduce) { .tr-row.is-ai-working textarea { animation: none; background: var(--ai-soft); } }
@media (max-width: 900px) { .tr-row { grid-template-columns: minmax(0, 1fr); } .tr-role { padding-top: 0; } }
:root[data-theme="dark"] .tr-status.is-ok { color: #7fd09c; }
:root[data-theme="dark"] .tr-status.is-changed { color: #f0c94f; }
:root[data-theme="dark"] .tr-status.is-validated { color: #9cbcf0; }

/* quotas: the page "Quoten" (editor/quotas.html) and the state on the fieldwork page (surveys/_quotas.html) */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.quota-cells td { vertical-align: top; }
.quota-cells .quota-new td { padding-top: 10px; border-top: 1px dashed var(--border); }
/* one grid: every field of a row has the height of the text fields, and a line of answers to tick sits on the
   middle of the select next to it (further lines follow below) */
.quota-cells select, .quota-cells input:not([type=checkbox]) { height: 42px; }
.quota-options { display: flex; flex-wrap: wrap; gap: 2px 14px; line-height: 24px; }
.quota-special { display: inline-block; line-height: 24px; }
.quota-options .check, .quota-cat .check { margin: 0; font-weight: 400; }
.quota-range { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.edit-table .quota-range input:not([type=checkbox]), .quota-range input { width: 7em; }
.quota-special { font-size: 0.9rem; color: var(--muted); }
.quota-add { margin-top: 2px; }
.quota .quota-code-col { display: none; }
.quota.show-codes th.quota-code-col, .quota.show-codes td.quota-code-col { display: table-cell; }
.quota.show-codes label.quota-code-col { display: block; }
.quota-attr { padding: 8px 0; border-top: 1px solid var(--border); }
.quota-attr > label select { max-width: 420px; }
.quota-attr-cats { margin-top: 6px; }
.quota-cats { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.quota-cat { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; }
.quota-generate label.quota-share { display: none; flex-direction: row; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); font-weight: 400; }
.quota-generate label.quota-share input { width: 5.5em; }
.quota-generate .with-shares label.quota-share { display: inline-flex; }
.quota-delete { margin-top: 10px; }
.quota-state-actions { align-items: center; margin-bottom: 6px; }
.quota-state-name { margin: 18px 0 6px; font-size: 1rem; }
.quota-table { width: auto; max-width: 100%; border-collapse: collapse; font-size: 0.9rem; }  /* as wide as its content (Ralf, 2026-10-03) */
.quota-table th, .quota-table td { padding: 4px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.quota-table th { font-size: 0.75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.quota-table th.num, .quota-table td.num { text-align: right; white-space: nowrap; }  /* no width: 1%: in a table without a set width it would stretch the table to the panel */
.quota-table .quota-sum td { font-weight: 600; border-bottom: 0; }
.quota-bar { display: flex; width: 100%; min-width: 80px; max-width: 320px; height: 10px; border-radius: 5px; background: var(--border); overflow: hidden; }
.quota-bar-done { background: var(--accent); }
.quota-bar-running { background: var(--accent); opacity: 0.35; }
.quota-flag { font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.quota-flag-open { color: var(--muted); }
.quota-flag-full { color: var(--ok, #1a7f37); }
.quota-flag-word { display: block; font-size: 0.75rem; font-weight: 600; }
.quota-flag-closed { color: var(--danger, #b42318); }
.quota-totals { margin-top: 14px; }
/* an end: its triggers as cards, checked from the top; each with what holds it and what it does */
/* an external section in the flow: its fields in one grid, all of one height */
.ext-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; align-items: end; }
.ext-grid > label { min-width: 0; }
.ext-grid > .ext-wide { grid-column: 1 / -1; }
.ext-grid input, .ext-grid select, .ext-values input, .ext-values select { width: 100%; height: 42px; }
.ext-values td:last-child { width: 30%; }
.ext-help > summary { cursor: pointer; font-weight: 600; }
.ext-help ol { margin: 8px 0; padding-left: 22px; }
@media (max-width: 720px) { .ext-grid { grid-template-columns: minmax(0, 1fr); } }
.end-cases { display: flex; flex-direction: column; gap: 12px; counter-reset: end-case; }
.end-case { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); counter-increment: end-case; }
.end-case-head { align-items: flex-end; }
.end-case > summary { cursor: pointer; font-weight: 650; }
.end-case > summary::before { content: counter(end-case) ". "; }
.end-case:not([open]) { padding: 8px 14px; }
.end-case-tools { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; }
.end-case:first-of-type [data-case-up] { visibility: hidden; }
.end-case-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 14px; max-height: 260px; overflow: auto; }
.end-case:has([data-case-remove] input:checked) { opacity: 0.55; }
.quota-page .page-head h2 { margin: 0; }
/* the quota assistant "Bevölkerung Deutschland": the preview of the quotas */
.census-cross { display: flex; flex-direction: column; gap: 4px; }
.census-attrs { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.census-cross p { margin: 4px 0 0; }
.census-cross .check { margin: 0; font-weight: 400; }
.census-steps { margin: 4px 0 12px; padding-left: 20px; }
.census-steps li { margin: 3px 0; }
.census-scroll { overflow-x: auto; margin-bottom: 14px; }
/* scales in one table (results page): k, M, SD, α and ω are symbols, upper case would turn α into Α */
.scale-table th { text-transform: none; letter-spacing: 0; }
.scale-table th.stat { font-style: italic; }
.census-table { width: auto; min-width: 320px; }
.census-table tbody th { text-transform: none; letter-spacing: 0; font-size: 0.9rem; color: inherit; font-weight: 400; white-space: nowrap; }
.census-table th.num, .census-table td.num { width: auto; padding-left: 14px; }
.census-apply { margin: 6px 0 12px; }
.census-sources ul { margin: 2px 0 8px; padding-left: 20px; font-size: 0.9rem; }
.census-sources li { margin: 3px 0; }
.census-sources p { margin: 6px 0 0; }
.quota-cells { table-layout: fixed; }
.quota-cells th:nth-child(1) { width: 24%; }
.quota-cells th:nth-child(2) { width: 150px; }
.quota-cells th:nth-child(3) { width: 96px; }
.quota-cells th:nth-child(5) { width: 76px; }
.quota-provider { align-items: flex-end; margin: 6px 0; }
.quota-recount { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.quota-shares { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border); }
.quota-shares h3 { margin: 0 0 8px; font-size: 1rem; }
.quota-share-form { margin-top: 10px; }
.quota-steer td { vertical-align: middle; }
.quota-steer th.num, .quota-steer td.num { text-align: right; width: 1%; white-space: nowrap; }
.quota-print { background: var(--bg); }
.quota-print h1 { font-size: 1.4rem; }
@media print {
  .no-print, .quota-print .quota-state-actions { display: none !important; }
  .quota-print { background: #fff; color: #000; }
  .quota-print .quota-bar { border: 1px solid #999; }
}
.link-rules-head { margin: 14px 0 4px; font-size: 0.95rem; }
#panel fieldset { min-width: 0; }
.link-rule { padding: 8px 0 4px; border-top: 1px solid var(--border); }
.link-rule-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.link-rule-row select, .link-rule-row input { flex: 1 1 110px; min-width: 0; max-width: 100%; }
.link-rule-row select:first-child { flex: 1.5 1 150px; }
.link-rule-row .link-rule-item { flex: 3 1 220px; }
.link-rule-row .link-rule-value { flex: 1 1 90px; }
.link-rule-row .link-rule-url { flex: 3 1 220px; }
.link-rule-row select[name="rule_mode"] { flex: 2 1 170px; }
.link-rule-row [data-row-remove] { flex: 0 0 auto; }
.link-rule-word { flex: 0 0 2.6em; color: var(--muted); font-size: 0.85rem; }
.quota-generate { margin-top: 14px; }
.quota-generate summary { cursor: pointer; font-weight: 600; }
.quota-generate textarea { font-family: var(--mono); font-size: 0.85rem; }
.quota-matrix { margin: 6px 0 4px; }
.quota-matrix summary { cursor: pointer; font-size: 0.9rem; }
.quota-matrix-table { width: auto; margin-top: 6px; }
.quota-matrix-table th, .quota-matrix-table td { padding: 4px 12px; }
.quota-matrix-table td.quota-flag-open { color: inherit; }

/* Formatted texts (richtext.js): a field over the textarea that shows the text as participants see it */
.rt { display: flex; flex-direction: column; font-weight: 400; }
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 6px; border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--surface-2); }
.rt-btn { font: inherit; font-size: 0.85rem; font-weight: 400; min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--fg); cursor: pointer; line-height: 1; }
.rt-btn:hover:not(:disabled) { background: var(--surface-3); }
.rt-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.rt-btn:disabled { opacity: 0.45; cursor: default; }
.rt-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.rt-btn-b { font-weight: 700; }
.rt-btn-i { font-style: italic; font-family: var(--font-serif); }
.rt-btn-small { font-size: 0.75rem; }
.rt-btn-source { margin-left: auto; font-size: 0.78rem; color: var(--muted); }
.rt-ed { position: relative; font-size: 0.95rem; line-height: 1.5; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 0 0 8px 8px; background: var(--surface); color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; transition: border-color 0.12s, box-shadow 0.12s; }
.rt-ed:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.rt-ed.is-locked { border-radius: 8px; background: var(--surface-3); color: var(--muted); cursor: default; }
.rt-field { position: relative; }
.rt-placeholder { position: absolute; inset: 0; padding: 9px 12px; font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; overflow: hidden; color: var(--subtle); pointer-events: none; }
.rt-ed:not(.is-empty) + .rt-placeholder { display: none; }
.rt-ed small, .rt-placeholder small, .rt-shown small { font-size: 0.82em; }
.rt-ed p, .rt-ed ul, .rt-placeholder p, .rt-placeholder ul, .rt-shown p, .rt-shown ul { margin: 0 0 0.6em; }
.rt-ed ul, .rt-placeholder ul, .rt-shown ul { padding-left: 1.3em; }
.rt-ed h3, .rt-placeholder h3, .rt-shown h3 { font-size: 1.05rem; margin: 0 0 0.4em; }
.rt-ed > :last-child, .rt-shown > :last-child { margin-bottom: 0; }
.rt-shown .rt-gap { cursor: default; }
/* where many fields stand in rows (translations): the buttons appear over the field that is being edited */
.rt-float { position: relative; }
.rt-float .rt-bar { display: none; position: absolute; left: 0; right: 0; bottom: 100%; z-index: 5; border-bottom: 1px solid var(--border-strong); border-radius: 8px; margin-bottom: 4px; box-shadow: var(--shadow-pop); }
.rt-float:focus-within .rt-bar { display: flex; }
.rt-float .rt-ed, .rt-float textarea.rt-area { border-radius: 8px; }
.rt-var { color: #1c1c1a; cursor: default; }
/* a placeholder the page can name ("Antwort: Welche Marke?"): words instead of its code; a click sets the text for an empty value */
.rt-var.is-named { font-family: inherit; font-size: 0.88em; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.rt-ed:not(.is-locked) .rt-var { cursor: pointer; }
.rt-var.is-unknown { background: var(--danger-soft); color: var(--danger); }
/* a plain one-line field with chips (statements, answer options): looks like the input it stands for */
.rt-line-wrap { position: relative; width: 100%; }
.rt-line { font-size: 0.95rem; line-height: 1.5; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; min-height: calc(1.5em + 18px); box-sizing: border-box; transition: border-color 0.12s, box-shadow 0.12s; }
.rt-line:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.rt-line .rt-var { cursor: pointer; }
:root[data-theme="dark"] .rt-line { background: var(--surface-2); }
.rt { position: relative; }
.rt-btn-insert { margin-left: 6px; color: var(--accent); font-weight: 600; }
.rt-menu, .rt-pop { position: absolute; z-index: 20; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-pop); font-size: 0.88rem; font-weight: 400; }
.rt-menu { width: min(440px, 100%); padding: 6px; }
.rt-menu-search { width: 100%; margin: 0 0 6px; }
.rt-menu-list { max-height: 280px; overflow-y: auto; }
.rt-menu-title { padding: 6px 8px 2px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.rt-menu-item { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.rt-menu-item:hover, .rt-menu-item:focus-visible { background: var(--accent-soft); outline: none; }
.rt-menu-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rt-menu-name { flex: none; font-family: ui-monospace, monospace; font-size: 0.78rem; color: var(--subtle); }
.rt-menu-none { padding: 6px 8px; color: var(--muted); }
.rt-pop { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: min(340px, 100%); padding: 8px 10px; }
.rt-pop-title { flex: 1 0 100%; font-size: 0.78rem; color: var(--muted); }
.rt-pop input { flex: 1; min-width: 0; }
.rt-pop .rt-btn { border-color: var(--border-strong); }
.rt-gap { display: inline-block; height: 1.3em; vertical-align: text-bottom; margin: 0 2px; border: 1px solid var(--border-strong); border-bottom: 2px solid var(--muted); border-radius: 4px; background: var(--surface-2); cursor: pointer; }
.rt-gap.is-s { width: 3.5em; }
.rt-gap.is-m { width: 6em; }
.rt-gap.is-l { width: 9.5em; }
.rt .format-hint { margin: 6px 0 0; }
.rt textarea.rt-area { border-radius: 0 0 8px 8px; }
.rt textarea.rt-area[hidden] { display: none; }
:root[data-theme="dark"] .rt-ed { background: var(--surface-2); }
:root[data-theme="dark"] .rt-ed.is-locked, :root[data-theme="dark"] .rt-gap { background: var(--surface-3); }

/* Dashboards (app/boards.py): the list, and the designer with its form on the left and the preview on the right */
.board-index .board-list td { vertical-align: middle; }
.board-templates { display: flex; flex-wrap: wrap; gap: 10px; }
.board-template { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; flex: 1 1 180px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; font-weight: 400; }
.board-template:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.board-template .hint { display: block; margin: 0; }
/* three columns: the tiles with their settings | preview (at most --page-col) | name and links; the outer ones move in */
.board-designer { display: grid; grid-template-columns: 400px minmax(0, var(--page-col)) 340px; gap: 20px; align-items: start;
  justify-content: center; }
.board-side-pick { grid-column: 1; grid-row: 1; }
.board-preview { grid-column: 2; grid-row: 1; }
.board-side-tiles { grid-column: 3; grid-row: 1; }
.board-designer .panel { margin: 0 0 16px; }
.board-back { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.board-back .back-link { margin: 0; }
.board-side > .autosave-bar { margin: 0 0 8px; padding-top: 0; }
.board-side-tiles .row-fields { display: flex; flex-direction: column; align-items: stretch; }  /* the narrow right column: the link fields one under another */
.board-side-tiles .row-fields > label { width: 100%; }
/* the side columns are narrow: a tick stays beside its text, the hint goes under the text (no break after the box) */
.board-side label.check { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: start; }
.board-side label.check > input { margin-top: 3px; }
.board-side label.check > .hint { grid-column: 2; }
.board-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.board-form h2 { margin-top: 16px; }
.board-rows { list-style: none; margin: 0; padding: 0; }
.board-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border); }
.board-row.is-dragged { opacity: 0.4; }
.board-row .drag-handle { touch-action: none; padding: 2px 4px; }
.board-row-name { font-weight: 600; font-size: 0.92rem; line-height: 1.35; overflow-wrap: anywhere; }
.board-row-move { display: flex; gap: 2px; }
.board-row-move button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid transparent;
  border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.board-row-move button:hover:not(:disabled) { background: var(--surface-3); color: var(--fg); border-color: var(--border); }
.board-row-move button:disabled { opacity: 0.3; cursor: default; }
.board-row-settings { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 0.875rem; }
.board-row-settings label { display: flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.board-row-settings select { font-size: 0.875rem; padding: 3px 6px; max-width: 100%; min-width: 0; }
/* long question texts: the split takes a row of its own and its list stays inside the card */
.board-row-settings label.board-row-split { flex-basis: 100%; min-width: 0; }
.board-row-split select { flex: 1 1 0; width: 0; }
.board-row-title { flex-basis: 100%; }
.board-row-title summary { cursor: pointer; color: var(--muted); font-size: 0.82rem; }
.board-row-title input { width: 100%; margin-top: 4px; }
.board-drop-line { list-style: none; height: 3px; margin: -2px 0; border-radius: 2px; background: var(--accent); }
/* the elements not yet on the dashboard, below the tiles: one line each with its "+" */
.board-more-head { margin: 14px 0 4px; font-size: 0.9rem; font-weight: 600; }
.board-more-list { list-style: none; margin: 0; padding: 0; }
.board-more-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--border); font-size: 0.9rem; }
.board-more-row .board-row-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.board-more-row.board-off { color: var(--muted); }
.board-off { color: var(--muted); }
.board-preview { position: sticky; top: 12px; }
/* wide: every column scrolls on its own (Ralf, 2026-10-03), from where the columns start (--board-top, set by app.js)
   down to the footer (34 px); the page itself does not scroll */
@media (min-width: 1301px) {
  .board-side, .board-preview { position: static; max-height: calc(100vh - var(--board-top, 180px) - 46px); overflow-y: auto;
    overscroll-behavior: contain; padding-right: 4px; }
  .board-preview { display: flex; flex-direction: column; height: calc(100vh - var(--board-top, 180px) - 46px); }
  .board-frame { flex: 1 1 auto; height: auto; min-height: 360px; }  /* the preview fills its column below its head */
}
.board-preview-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; }
.board-preview-links { margin-left: auto; display: flex; gap: 6px; }
.board-frame { display: block; width: 100%; height: calc(100vh - 110px); min-height: 480px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
/* narrower: both lists in one column beside the preview (choose, then arrange), the preview over both rows */
@media (max-width: 1300px) {
  .board-designer { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .board-side-pick { grid-column: 1; grid-row: 1; }
  .board-side-tiles { grid-column: 1; grid-row: 2; }
  .board-preview { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 1000px) {
  .board-designer { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .board-side-pick, .board-side-tiles, .board-preview { grid-column: 1; grid-row: auto; }
  .board-preview { position: static; }
  .board-frame { height: 70vh; }
}
.board-links { list-style: none; margin: 0 0 16px; padding: 0; }
.board-links li { padding: 10px 0; border-top: 1px solid var(--border); }
.board-links li:first-child { border-top: 0; padding-top: 0; }
.board-links p { margin: 0 0 6px; }
.board-embed { margin: 0 0 6px; font-size: 0.875rem; }
.board-embed summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.board-links .copy-row { flex-wrap: nowrap; margin-bottom: 6px; }
.board-links .copy-row input { min-width: 0; }
.board-row-settings textarea { flex-basis: 100%; width: 100%; font-size: 0.875rem; }
.board-add { margin-top: 10px; align-items: center; }
/* AI suggestions (items/_suggestion.html): two rows each, above where and why, below the old text and the
   suggestion; the tick spans both; one light stripe per suggestion */
.review-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.review-table col.check-col { width: 44px; }
.review-table td { vertical-align: top; padding: 8px 10px; }
.review-table tbody:nth-of-type(even) { background: var(--surface-2); }
.review-table tbody + tbody tr.review-head td { border-top: 1px solid var(--border); }
.review-table .check-col { text-align: center; padding-top: 12px; }
.review-table .review-why { color: var(--muted); font-size: 0.9rem; }
.review-table tr.review-head td { padding-bottom: 2px; }
.review-table .review-old { color: var(--muted); font-size: 0.9rem; white-space: pre-wrap; }
.review-table .review-tag { display: block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--muted); margin-bottom: 4px; }
.review-table textarea { width: 100%; }
/* Export page: the draft of the methods section, right under the heading of the export */
.methods-callout { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 14px 0 6px;
  padding: 14px 16px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
.methods-callout .desc { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.methods-callout .button { flex: none; }
/* AI review of the texts: a button under the item form, and one in the design check */
.page-head-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; }  /* item page: AI check next to undo */
.ai-check-side { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 10px 0 0; }

/* Rows of a matrix shown only to some (items/_row_conditions.html): one line per row with its condition */
.row-conds summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.row-conds details[open] > summary { margin-bottom: 10px; }
.row-cond-all { display: block; text-align: left; margin-bottom: 12px; }
.row-cond-all select { display: block; height: 42px; width: 320px; max-width: 100%; margin: 4px 0; }
.row-cond-all .hint { display: block; margin: 0; }

/* Options carried from an earlier question (items/_carry.html) */
.carry-rows { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 10px 0 6px; }
.carry-row { border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: 0.9rem; }
.carry-row code { color: var(--muted); }
/* Quoten: the explanation folds once there is a quota; the quota comes with its flow elements (tick) */
.quota-intro > summary { cursor: pointer; }
.quota-intro > summary h2 { display: inline; margin: 0; }
.quota-add-form { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.facet-more > summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--accent); margin: 4px 0; width: fit-content; }

/* One condition, the same in the flow, the Teilquoten and the rows shown only to some (_condition.html) */
.cond-line { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-start; margin-bottom: 8px; }
.cond-line > select { flex: 0 1 260px; min-width: 0; height: 42px; }
.cond-line > select[data-cond-mode] { flex: 0 1 160px; }
.cond-line > select[data-cond-mode]:not(:has(option)) { display: none; }
.cond-value { flex: 1 1 220px; min-width: 0; min-height: 42px; }
.cond-value > .quota-options, .cond-value > .quota-special { padding: 9px 0 4px; }
.cond-value > input:not(.narrow) { width: 100%; }
.cond-value input:not([type=checkbox]) { height: 42px; }
.cond-line > [data-cond-remove] { flex: 0 0 auto; margin-top: 6px; }
.cond-name { flex: 0 0 220px; min-width: 0; padding-top: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-conds .cond-line { padding: 6px 0 0; margin: 0; border-top: 1px solid var(--border); }
.cond-list { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.cond-list > .label-title { margin-bottom: 4px; }
.cond-list > [data-add-cond], .cond-list > .cond-rule { align-self: flex-start; }
.cond-rule, .stack label.cond-rule { flex-direction: row; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 400; }
.cond-rule select { height: 42px; width: auto; }
@media (max-width: 700px) { .cond-name { flex-basis: 100%; padding-top: 0; white-space: normal; } }
/* instead of inline styles (UI/UX audit 2026-10-03, U51): how much of a row a field takes, a paragraph without margins, an empty state */
.grow-1 { flex: 1 1 0; min-width: 0; }
.grow-2 { flex: 2 1 0; min-width: 0; }
.flush { margin: 0; }
.space-above { margin-top: 14px; }  /* a part that follows a form or a list, set apart */
input.mono { font-family: var(--mono); }  /* code typed in (a regular expression) */
.empty-panel { text-align: center; padding: 40px 20px; }
.min-180 { min-width: 180px; }
.link-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.link-chips .hint { margin-right: 2px; }

/* Live votes (app/live.py): the presenter's page */
.live-run { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.live-run form.inline { display: inline-flex; gap: 8px; align-items: stretch; }  /* name field and button of the same height */
.live-run form.inline input, .live-run form.inline .button { height: auto; min-height: 0; margin: 0; }
.badge-live { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* "Meine Befragungen": a live vote stands apart, a red stripe on the left and an on-air mark in the top right corner */
.card.card-live { position: relative; border-left: 4px solid var(--danger); padding-right: 96px; }
.live-mark { position: absolute; top: 14px; right: 16px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px;
  border-radius: 6px; background: var(--danger); color: var(--surface); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; }
.live-mark i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .live-mark i { animation: none; } }
@media (max-width: 600px) { .card.card-live { padding-right: 18px; padding-top: 44px; } }
.live-state { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; }
.live-state.is-open { color: var(--accent); }
.live-state.is-closed { color: var(--muted); }

/* Live vote, editing page (live/manage.html): blocks and their questions on the left, the item editor on the right */
.live-work { display: grid; grid-template-columns: minmax(320px, 40%) 1fr; gap: 20px; align-items: start; }
.live-left { display: flex; flex-direction: column; gap: 12px; }
.live-block { padding: 12px 14px; }
.live-block.is-released { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.live-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.live-block-name { flex: 1; }
.live-block-name input { width: 100%; font-weight: 600; }
.live-items { list-style: none; margin: 0 0 8px; padding: 0; }
.live-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-top: 1px solid var(--border); }
.live-item:first-child { border-top: 0; }
.live-item.is-selected { background: var(--accent-soft); border-radius: 6px; }
.live-item .drag-handle { touch-action: none; padding: 4px 2px; }
.live-item-text { flex: 1; display: flex; flex-direction: column; color: inherit; text-decoration: none; min-width: 0; }
.live-item-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-break { padding: 2px 4px; }
.live-break-line { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.live-break-line::before, .live-break-line::after { content: ""; flex: 1; border-top: 1px dashed var(--border-strong); }
.live-item.is-dragging { opacity: 0.4; }
.live-item.drop-before { box-shadow: inset 0 3px 0 var(--accent); }
.live-item.drop-after { box-shadow: inset 0 -3px 0 var(--accent); }
.live-block.drop-into { outline: 2px dashed var(--accent); outline-offset: 2px; }
.live-add { display: flex; gap: 8px; align-items: center; }
.live-right { position: sticky; top: 12px; }
.live-editor { width: 100%; height: calc(100vh - 140px); min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.live-hint { color: var(--fg); }
@media (max-width: 900px) { .live-work { grid-template-columns: 1fr; } .live-right { position: static; } }
/* a page inside another one (?embed=1, base.html): no header and footer, less space around */
body.embedded > main.container { padding-top: 12px; }
/* Live votes, wizard and Präsentieren (concept mentimeter-abgleich.md 6.2/6.3): QR code beside the address */
.live-join-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.live-qr { width: 168px; flex: none; border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.live-qr svg { display: block; width: 100%; height: 100%; }
.live-big-url { font-size: 1.15rem; margin: 0; overflow-wrap: anywhere; }
.live-code { letter-spacing: 0.08em; }
.live-first .theme-choice-item { align-items: center; }
.live-first-icon { display: inline-flex; color: var(--accent); }

/* AI assistant of a live vote (live/assistant.html) */
.live-ai-link { align-self: flex-start; }
.live-ai-list { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; text-align: left; }
/* a suggestion: tick and type on the left, the texts across the rest of the width (to read and edit them) */
ol.plain li.live-ai-item { display: grid; grid-template-columns: 220px 1fr; gap: 8px 24px; align-items: start; justify-items: stretch;
  padding: 16px 12px; border-top: 1px solid var(--border); text-align: left; }
ol.plain li.live-ai-item:nth-child(even) { background: var(--surface-2); }
.live-ai-pick { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.live-ai-fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.live-ai-fields label { display: flex; flex-direction: column; gap: 4px; }
.live-ai-fields textarea { width: 100%; font: inherit; line-height: 1.45; resize: vertical; }
.live-ai-fields textarea[name$="_question"] { font-size: 1.05rem; font-weight: 600; }
@media (max-width: 720px) { ol.plain li.live-ai-item { grid-template-columns: 1fr; } }
.live-ai-item input[type=text], .live-ai-item input:not([type]), .live-ai-item textarea { width: 100%; }
/* live votes, moderation on Präsentieren (package D) */
.live-mod-list { list-style: none; margin: 8px 0 0; padding: 0; }
.live-mod { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); }
.live-mod-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.live-mod-status { font-size: 0.8rem; color: var(--muted); }
.live-mod.is-hidden .live-mod-text, .live-mod.is-filtered .live-mod-text { text-decoration: line-through; color: var(--muted); }
.live-mod.is-pending .live-mod-status { color: var(--warn); font-weight: 600; }
/* live votes, the quiz box above the question editor (package F) */
.live-quiz { margin: 0 0 12px; padding: 10px 14px; }
.live-quiz summary { cursor: pointer; }
.live-quiz form { margin-top: 10px; }
.live-quiz-row { display: flex; gap: 12px; flex-wrap: wrap; }
/* live votes: the choice of a run on the results page (L8) */
.res-runs { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.res-runs label { display: flex; align-items: center; gap: 10px; margin: 0; }
.live-own { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.live-own .link { font-weight: 600; }

/* Administration > Datenbank */
.db-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) repeat(3, minmax(0, 1.5fr)); gap: 12px; }
.db-fields input { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 760px) { .db-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.db-result { flex-direction: column; gap: 6px; margin: 12px 0; }
.db-result p { margin: 0; }
.db-steps { margin: 0 0 12px; padding-left: 1.4em; display: grid; gap: 4px; }
.db-tables table { margin-top: 8px; }
.db-tables td.num, .db-tables th.num { text-align: right; }

/* live vote settings: the reactions the phones offer, a grid of emojis to tick */
.live-emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; }
.live-emojis legend { margin-bottom: 6px; }
.live-emoji { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius); cursor: pointer; }
.live-emoji:hover { background: var(--surface-2); }
.live-emoji-face { font-size: 1.4rem; line-height: 1; }

/* live votes: the earlier runs on Präsentieren, each with its delete button */
.live-runs-old { list-style: none; margin: 10px 0; padding: 0; }
.live-runs-old li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); }

/* "Nach Gruppen aufteilen" on the results page (app/compare.py) */
.res-group-pick { margin: 0; }
.res-group-pick label { display: flex; align-items: center; gap: 10px; margin: 0; }
.res-group-note { flex-basis: 100%; }
.res-compare { margin-top: 12px; }
.res-cross td.num, .res-cross th.num { white-space: nowrap; }
/* the weighting on the page "Quoten": the attributes under their choice */
.weighting-sub { display: flex; flex-direction: column; gap: 4px; margin-left: 26px; }
/* footnotes of the results page: a superscript number links to its group in the fold of sources (results.footnotes) */
sup.fn { font-size: 0.7em; line-height: 0; margin-left: 1px; }
sup.fn a { font-weight: 600; }
.sources .src-number { display: inline-block; min-width: 1.4em; font-weight: 700; color: var(--accent); }
.sources dt:target { background: var(--accent-soft); border-radius: 4px; }
