/* The look of Steg (docs/DESIGN.md). Redrawn as a whole in PLAN-11, at the owner's wish
   ("mach es mir einfach schöner"): a light ground, the content as one calm column of white
   surfaces with generous space, larger type, names beside the initials. The rules of
   PLAN-11 stand in their own part near the end and win over the older ones above them. */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

/* --- Tokens ---------------------------------------------------------------------- */
:root {
  --bg: #ffffff;           /* the surfaces: lists, pages, fields */
  --ground: #f5f7fa;       /* the ground of the page behind the surfaces (PLAN-11) */
  --soft: #f6f8fb;         /* a row or a button with the mouse over it */
  --active: #eef1f5;       /* the active entry of a menu */
  --rail: #e8eef8;         /* the ground of the rail: light blue (PLAN-07) */
  --rail-active: #d0dcf3;  /* the active module in the rail, the hairline of the active part */
  --nav: #f1f5fc;          /* the ground of the second column and of the group bars of a list */
  --text: #17191c;
  --muted: #6a707b;
  --faint: #9aa1ac;
  --line: #e7eaef;         /* hairlines */
  --border: #d6dbe3;       /* fields and buttons */
  --soon: #a65a00;         /* due within 7 days: orange, always with words */
  --chip: #dededb;
  --avatar: #e3e3e0;
  --blue: #2456c7;
  --blue-dark: #173b8c;
  --warn: #b3261e;         /* always with words, never colour alone */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --fs-text: 15px; --fs-small: 14px; --fs-tiny: 12.5px; --fs-title: 30px; --fs-big: 30px;
  --r: 10px; --r-chip: 6px; --r-card: 14px;
  --button: 40px; --field: 42px; --row: 56px; --head: 56px;
  --pad-x: 24px;           /* the room inside a surface */
  --nav-w: 232px;          /* the main navigation folded out (PLAN-08) */
  color-scheme: light;
}

/* --- Base ------------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-text)/1.5 var(--sans);
  font-feature-settings: "cv11"; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-weight: 600; }
p { margin: 0 0 12px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.count { font-size: var(--fs-tiny); font-weight: 400; color: var(--muted); }
.warn { color: var(--warn); font-weight: 500; }

/* --- The mark: a blue square with a white flag waving on a mast (PLAN-13) ---------- */
.mark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px;
  border-radius: 12px; background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(36, 86, 199, 0.3); }
.mark-big { width: 60px; height: 60px; border-radius: 16px; }
.mark-big svg { width: 40px; height: 40px; }

/* --- The frame: rail, parts of the module, content -------------------------------- */
.app { display: flex; min-height: 100vh; }

/* The main navigation (PLAN-08). Folded out, the default: the flag with "Steg", each module as its icon
   with its name beside it (always; the folding was taken out, the owner). Over a module the
   second navigation comes out at its right (.rail-fly). z-index: the rail is a layer above the content. */
.rail { flex: none; width: var(--nav-w); position: sticky; z-index: 15; top: 0; height: 100vh; display: flex; flex-direction: column;
  align-items: stretch; gap: 2px; padding: 12px 10px; background: var(--rail); border-right: 1px solid var(--line); }
.rail-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.rail-top { display: flex; align-items: center; color: var(--text); text-decoration: none; }
.rail-top:hover { color: var(--text); }
.rail-brand { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.rail-brand b { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.rail-module { position: relative; }
.rail-item { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 0; border-radius: var(--r);
  background: none; font: 500 var(--fs-text) var(--sans); color: var(--muted); text-decoration: none; cursor: pointer; width: 100%; }
.rail-item:hover, .rail-module:hover > .rail-item { background: var(--rail-active); color: var(--text); }
.rail-item[aria-current] { background: var(--rail-active); color: var(--text); }
.rail-end { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.rail-account .avatar { width: 28px; height: 28px; font-size: 11px; }
.rail-account-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The second navigation: a panel at the right of a module while the mouse or the focus is on it;
   the padding at its left bridges the way from the module, so it does not go away on the way */
.rail-fly { display: none; position: absolute; z-index: 30; top: -6px; left: 100%; padding-left: 14px; }
.rail-module:hover .rail-fly, .rail-module:focus-within .rail-fly { display: block; }
.rail-fly-box { width: 230px; padding: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); }
.fly-list { display: flex; flex-direction: column; gap: 2px; }
.fly-list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 8px;
  border-radius: var(--r); color: var(--text); text-decoration: none; }
.fly-list a:hover { background: var(--nav); }
.fly-list a[aria-current] { background: var(--nav); font-weight: 500; }

/* The parts of the active module as a column: on the narrow screen only (the tabs) */
.parts { display: none; }
.parts-name { display: flex; align-items: center; min-height: var(--head); padding: 0 10px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.parts-label { margin: 4px 0; padding: 0 10px; font-size: var(--fs-tiny); color: var(--muted); }
.parts-list { display: flex; flex-direction: column; gap: 2px; }
.parts-group { display: flex; flex-direction: column; gap: 2px; }
.parts-list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px;
  padding: 0 10px; color: var(--text); text-decoration: none; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* The header line: the title with a short count, the one main action at the right */
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--head); padding: 0 var(--pad-x); border-bottom: 1px solid var(--line); }
.head h1 { margin: 0; font-size: var(--fs-title); letter-spacing: -0.01em; line-height: 1.3; }
.head h1 .count { margin-left: 10px; font-size: var(--fs-small); }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.head-actions form { margin: 0; }

/* The function bar (PLAN-10, src/ui.ts actionBar): the main function at the far right, at most two
   beside it, the others in «Mehr»; on the narrow screen the main one as an icon, all others in «•••» */
.bar { position: relative; flex-wrap: nowrap; align-items: center; }
.bar .bar-more { position: relative; }
.bar .bar-more .menu-list { left: auto; right: 0; top: calc(100% + 4px); min-width: 220px; }
.bar-more-narrow, .menu-list .bar-narrow-only, .bar-dots { display: none; }
.bar-more-button { list-style: none; color: var(--text); }
.bar-more-button::-webkit-details-marker { display: none; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 4px; background: none;
  font: inherit; color: var(--text); text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer; }
.menu-item:hover { background: var(--soft); color: var(--text); }
.menu-item .button-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
.menu-list form { margin: 0; }
.menu-item.danger { color: var(--warn); }
.menu-list form:has(.danger), .menu-list a.danger { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 4px; }
.head-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
.crumbs { display: flex; gap: 8px; font-size: var(--fs-text); color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.head-title.with-crumbs h1 { font-size: var(--fs-text); font-weight: 400; }

.main { flex: 1; }
.body { max-width: 860px; padding: 32px var(--pad-x) 56px; }
.lead { margin: 0 0 24px; color: var(--muted); max-width: 60ch; }
.section-title { margin: 0 0 8px; font-size: var(--fs-small); font-weight: 600; }

/* Messages: words first, colour only beside them */
.alert { margin: 0; padding: 10px var(--pad-x); border-bottom: 1px solid var(--line); font-weight: 500; }
.alert-error { color: var(--warn); }

/* --- Buttons ---------------------------------------------------------------------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--button);
  padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); color: var(--text);
  font-size: var(--fs-text); font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--soft); color: var(--text); }
.button-main { border-color: var(--blue); background: var(--blue); color: #fff; }
.button-main:hover { border-color: var(--blue-dark); background: var(--blue-dark); color: #fff; }

/* --- Forms: labels above the fields, at most 640 px, buttons at the bottom left ------ */
.form { display: flex; flex-direction: column; gap: 20px; max-width: 640px; padding: 32px var(--pad-x) 56px; }
.form-part { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: var(--fs-small); font-weight: 500; }
.input { width: 100%; height: var(--field); padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--bg); font-size: var(--fs-text); color: var(--text); }
textarea.input { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.input:focus-visible { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
.input[aria-invalid="true"] { border-color: var(--warn); }
.hint { margin: 0; font-size: var(--fs-small); color: var(--muted); }
.field-error { margin: 0; font-size: var(--fs-small); font-weight: 500; color: var(--warn); }
.choices { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 0; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--r); }
.choices legend { padding: 0 6px; font-size: var(--fs-small); font-weight: 500; }
.choices[aria-invalid="true"] { border-color: var(--warn); }
.choice { display: flex; align-items: flex-start; gap: 10px; }
.choice input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--blue); }
.choice small { display: block; font-size: var(--fs-small); color: var(--muted); }
.form-buttons { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 16px; }
.tag-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-choices:empty { display: none; }
.tag-choice { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--chip); border-radius: var(--r-chip);
  font-size: var(--fs-small); color: var(--muted); cursor: pointer; }
.tag-choice input { width: 14px; height: 14px; margin: 0; accent-color: var(--blue); }
.tag-choice:has(input:checked) { border-color: var(--text); color: var(--text); }

/* The form of a task (PLAN-06): two columns as the task page, the buttons below the left one */
.task-form { display: grid; max-width: 1200px; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto auto 1fr;
  grid-template-areas: "note note" "main side" "buttons side"; gap: 0; align-items: start; }
.form-note { grid-area: note; margin: 0 0 20px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); }
.form-main { grid-area: main; display: flex; flex-direction: column; gap: 20px; min-width: 0; padding-right: 40px; }
.form-side { grid-area: side; display: flex; flex-direction: column; gap: 24px; min-width: 0; padding-left: 32px; border-left: 1px solid var(--line); }
.task-form .form-buttons { grid-area: buttons; padding: 20px 40px 0 0; }
/* A group of choices without a box: its name as the label of a field */
.choices-plain { padding: 0; border: 0; gap: 8px; }
.choices-plain legend { padding: 0; margin-bottom: 8px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.quick-dates { display: flex; flex-wrap: wrap; gap: 6px; }
.button-small { height: 28px; padding: 0 9px; font-size: var(--fs-small); font-weight: 400; color: var(--muted); }
/* With the script: only the chosen tags show as chips (a click removes one); typing shows the known ones that fit */
.tags-live .tag-choice:not(:has(input:checked)) { border-style: dashed; }
.tags-live .tag-choice input { position: absolute; opacity: 0; pointer-events: none; }
.tags-live .tag-choice:has(input:checked)::after { content: "×"; margin-left: 2px; color: var(--muted); }
.tags-live .tag-choice:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 1px; }
.tag-choice { position: relative; }

/* --- Lists: slim rows separated by hairlines, never cards ------------------------------ */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px var(--pad-x); border-bottom: 1px solid var(--line); }
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: var(--row); padding: 0 var(--pad-x);
  border-bottom: 1px solid var(--line); }
.row-title { flex: 999 1 240px; min-width: 0; padding: 12px 0; font-weight: 500; color: var(--text); text-decoration: none; }
a.row-title:hover { color: var(--text); text-decoration: underline; }
.row-meta { font-size: var(--fs-small); color: var(--muted); }
.row-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.row.off .row-title { color: var(--muted); }
.group { display: flex; align-items: center; gap: 8px; height: 36px; margin: 0; padding: 0 var(--pad-x); background: var(--nav);
  border-bottom: 1px solid var(--line); font-size: var(--fs-small); font-weight: 500; }
.group .count { font-size: var(--fs-small); }
.empty { padding: 16px var(--pad-x); color: var(--muted); }

/* Rows of tasks in one line (PLAN-07): status, title with its tags right after it, then at the right
   the people as initials and the date with its word; the whole row is the link */
.row-task { flex-wrap: nowrap; position: relative; }
.row-task:hover { background: var(--nav); }
.row-task .row-title { flex: 0 1 auto; }
.row-task a.row-title:hover { text-decoration: none; }
.row-task a.row-title::after { content: ""; position: absolute; inset: 0; }
.row-task .row-chips { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.row-people { position: relative; z-index: 1; display: flex; flex: 0 0 92px; min-width: 0; }
.row-people .avatar { width: 30px; height: 30px; border: 2px solid var(--bg); font-size: 11px; letter-spacing: 0.02em; }
.row-people .avatar + .avatar { margin-left: -6px; }
.row-task:hover .row-people .avatar { border-color: var(--nav); }
.avatar-more { background: var(--bg); color: var(--muted); outline: 1px solid var(--border); outline-offset: -3px; }
/* The tints of the people (src/ui.ts, avatarClass): soft grounds, the letters in the same hue, darker */
.avatar.avatar-c0 { background: #dbe6fb; color: #1d4ab0; }
.avatar.avatar-c1 { background: #d7efe2; color: #1b6b43; }
.avatar.avatar-c2 { background: #ece0f6; color: #6b3b8c; }
.avatar.avatar-c3 { background: #fde6cc; color: #8f4700; }
.avatar.avatar-c4 { background: #d3eef0; color: #0d6670; }
.avatar.avatar-c5 { background: #f8dce3; color: #9b2c48; }
.avatar.avatar-c6 { background: #f4ebc3; color: #6f5300; }
.avatar.avatar-c7 { background: #e1e5ed; color: #3a4659; }
.row-date { flex: 0 0 168px; display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; font-size: var(--fs-small);
  white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.row-date small { font-size: var(--fs-tiny); font-weight: 500; }

/* The filter line: the search field, menus of links (<details>), the reset */
.search { flex: 0 1 200px; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--r); color: var(--muted); }
.search:focus-within { border-color: var(--blue); outline: 1px solid var(--blue); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: var(--fs-text); color: var(--text); }
.filter-menus { display: contents; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.button-filter { height: 32px; font-weight: 400; color: var(--muted); }
.button-filter.on { color: var(--text); border-color: var(--text); }
.menu-list { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; min-width: 180px; max-height: 320px; overflow-y: auto;
  display: flex; flex-direction: column; padding: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); }
.menu-list a { display: block; padding: 7px 10px; border-radius: 4px; color: var(--text); text-decoration: none; white-space: nowrap; }
.menu-list a:hover { background: var(--soft); }
.menu-list a[aria-current] { background: var(--active); font-weight: 500; }
/* Termin von–bis (PLAN-07): two date fields below the fixed choices, sent with the filter line */
.menu-range { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding: 10px 10px 6px; border-top: 1px solid var(--line); }
.menu-range label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-tiny); color: var(--muted); }
.menu-range .button { align-self: flex-start; }
.menu-range .input { flex: none; width: 100%; height: 32px; }
.menu-list:has(.menu-range) { max-height: none; }
.menu-leads { margin-left: 8px; font-size: var(--fs-tiny); font-weight: 400; color: var(--muted); }
.filters-reset { font-size: var(--fs-small); }

/* --- Detail: title, text and comments at the left; Angaben and Verlauf at the right ------ */
.crumbs-here { font-size: var(--fs-text); color: var(--text); }
.detail { display: flex; flex-wrap: wrap; }
.detail-main { flex: 999 1 460px; min-width: 0; padding: 32px 40px 48px var(--pad-x); }
.detail-title { max-width: 680px; margin: 0 0 16px; font-size: var(--fs-big); letter-spacing: -0.02em; line-height: 1.2; }
.detail-text { max-width: 640px; margin: 0 0 36px; font-size: 15px; line-height: 1.65; }
.detail-text p { margin: 0 0 12px; }
.detail-side { flex: 1 1 300px; min-width: 0; padding: 28px 28px 48px; border-left: 1px solid var(--line); }
.detail-side .facts > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: start; gap: 4px 12px; padding: 6px 0; min-height: 0; }
.detail-side .facts dt { padding-top: 2px; }
.detail-side .facts dd { gap: 6px 10px; }
.comments { list-style: none; max-width: 680px; margin: 0; padding: 0; }
.comments li { padding: 14px 0; border-top: 1px solid var(--line); }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: var(--fs-tiny); }
.comment-body { margin: 6px 0 0 26px; line-height: 1.55; }
.comment-body p { margin: 0 0 8px; }
.comment-form { max-width: 680px; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.comment-form .form-buttons { justify-content: flex-end; padding: 0; }
.history { list-style: none; display: flex; flex-direction: column; gap: 14px; margin: 12px 0 0; padding: 0 0 0 14px;
  border-left: 1px solid var(--border); }
.history li { font-size: var(--fs-small); line-height: 1.45; }
.history-at { display: block; font-size: var(--fs-tiny); color: var(--muted); }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; flex-basis: 100%; min-width: 0; }
.input-small { flex: 1 1 96px; min-width: 0; width: auto; height: 30px; padding: 0 6px; font-size: var(--fs-small); }
.inline-form .button { height: 30px; font-size: var(--fs-small); }
.chip-link { text-decoration: none; }
.chip-link:hover .chip { color: var(--text); border-color: var(--muted); }

/* --- Small pieces: chip, person, status ------------------------------------------- */
.chip { display: inline-block; padding: 1px 7px; border: 1px solid var(--chip); border-radius: var(--r-chip);
  font-size: var(--fs-tiny); line-height: 1.5; color: var(--muted); white-space: nowrap; }
.person { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); color: var(--text); }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--avatar); color: var(--text); font-size: 10px; font-weight: 600; line-height: 1; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status svg, .icon { flex: none; }

/* --- Facts ("Angaben"): a label at the left, the value beside it ----------------------- */
.facts { margin: 0 0 28px; }
.facts > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 36px; }
.facts dt { flex: 0 0 120px; font-size: var(--fs-small); color: var(--muted); }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* The generated password, shown once */
.secret { display: inline-block; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r);
  font-size: 16px; font-weight: 600; letter-spacing: .04em; user-select: all; }

/* --- Sign-in ------------------------------------------------------------------------ */
.login { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.login-box { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 16px; }
.login-title { margin: 4px 0 8px; }
.login h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.01em; }
.login-title p { margin: 0; }
.login .button { width: 100%; height: var(--field); margin-top: 4px; }
.login .field-error { font-size: var(--fs-text); }
.foot { margin: 0; padding: 16px var(--pad-x); font-size: var(--fs-small); color: var(--muted); }
.form-more { margin-top: 16px; padding-top: 24px; border-top: 1px solid var(--line); }
.form .facts { margin: 0; }

/* === PLAN-11: the look redrawn ==========================================================
   One calm column on a light ground; white surfaces with room; larger type. */
body { background: var(--ground); }
.content { width: 100%; max-width: 1176px; margin: 0 auto; padding: 40px 48px 72px; }

.head { min-height: 0; margin-bottom: 28px; padding: 0; border: 0; gap: 16px 24px; align-items: center; }
.head h1 { font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.head h1 .count { display: block; margin: 6px 0 0; font-size: var(--fs-text); font-weight: 400; letter-spacing: 0; }
.crumbs, .crumbs-here, .head-title.with-crumbs h1 { font-size: var(--fs-text); }
.button { padding: 0 16px; font-weight: 600; }
.button-small, .inline-form .button { padding: 0 10px; font-weight: 500; }
.field > label, .label, .choices legend { font-size: var(--fs-small); font-weight: 600; }

/* The main navigation: roomier entries; the active one a white surface */
.rail { padding: 20px 14px; gap: 4px; border-right: 0; }
.rail-top { margin-bottom: 20px; padding: 0 6px; gap: 12px; }
.rail-brand b { font-size: 18px; font-weight: 700; }
.rail-item { min-height: 42px; gap: 12px; padding: 0 12px; border-radius: var(--r); color: #3a4250; }
.rail-item:hover, .rail-module:hover > .rail-item { background: rgba(255, 255, 255, 0.55); }
.rail-item[aria-current] { background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px #d3ddec; }
.rail-fly-box { padding: 8px; border-radius: 12px; }
.fly-list a { min-height: 40px; padding: 0 10px; }

/* The list: the views as tabs, the search, the button «Filter»; the menus show when it is open */
.filters { margin-bottom: 20px; padding: 0; border: 0; gap: 12px; }
.tabs { display: inline-flex; gap: 4px; margin-right: auto; padding: 4px; border-radius: 12px; background: #eaeef3; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 9px; font-size: var(--fs-small);
  font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-current] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(20, 30, 50, 0.08); }
.tab .count { font-weight: 600; }
.search { flex: 0 1 260px; height: var(--button); padding: 0 14px; background: var(--bg); }
.filter-box summary { list-style: none; gap: 8px; }
.filter-box summary::-webkit-details-marker { display: none; }
.filter-box[open] summary { border-color: var(--text); }
.filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 600; }
.filter-menus { display: none; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters:has(.filter-box[open]) .filter-menus { display: flex; }
@supports not selector(:has(a)) { .filter-menus { display: flex; } }
.button-filter { height: 36px; padding: 0 12px; font-size: var(--fs-small); }
.menu-list { padding: 6px; border-radius: 12px; }
.menu-list a { padding: 8px 10px; border-radius: 7px; }

/* The surfaces: a list, a page, a form */
.card, .main > .list, .empty, .form, .body, .box, .detail-main { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-card); }
.card, .main > .list { overflow: hidden; }
.list > .row:last-child { border-bottom: 0; }
.row { gap: 8px 16px; }
.row-title { font-size: var(--fs-text); font-weight: 600; }
.empty { margin: 0; padding: 32px var(--pad-x); }
.group { height: auto; padding: 18px var(--pad-x) 10px; gap: 10px; border: 0; border-top: 1px solid var(--line); background: none;
  font-size: var(--fs-tiny); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.card > section:first-child .group { border-top: 0; }
.group .count { font-size: var(--fs-tiny); font-weight: 600; letter-spacing: 0; color: var(--faint); }
.group-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.group-overdue { color: var(--warn); }
.group-overdue .group-dot { background: var(--warn); }
.group-soon { color: var(--soon); }
.group-soon .group-dot { background: var(--soon); }

/* A row of a task: the title, below it «In Arbeit» and the tags; at the right the people and the date */
.row-task { display: grid; grid-template-columns: minmax(0, 1fr) 190px 130px; align-items: center; gap: 24px; padding: 14px var(--pad-x); }
.row-task:hover { background: var(--soft); }
.row-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row-task .row-title { flex: none; padding: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-task .row-chips { flex: none; flex-wrap: wrap; overflow: visible; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-doing { background: #eaf0fc; color: var(--blue); }
.pill-open { background: #f0f2f5; color: #4b5260; }
.pill-done { background: #e5f4ec; color: #1f7a4d; }
.pill-dropped { background: #f0f2f5; color: var(--faint); text-decoration: line-through; }
.due-fact { display: flex; flex-direction: column; }
.due-fact b { font-weight: 600; }
.due-fact small { font-size: 12px; font-weight: 600; }
.due-fact.over { color: var(--warn); }
.due-fact.soon { color: var(--soon); }
.chip { height: 22px; padding: 0 8px; border: 0; border-radius: 6px; background: #f0f2f5; color: #4b5260; font-size: 12px; font-weight: 500; line-height: 22px; }
.chip-link:hover .chip { background: #e4e8ee; color: var(--text); }
.row-people { flex: none; flex-direction: column; gap: 6px; }
.row-people .avatar { width: 26px; height: 26px; border: 0; font-size: 10.5px; }
.row-people .avatar + .avatar { margin-left: 0; }
.person { gap: 8px; font-size: var(--fs-small); font-weight: 500; }
.person-more, .row-people.none { font-size: 13px; font-weight: 400; color: var(--faint); }
.row-date { flex: none; flex-direction: column; align-items: flex-end; gap: 0; font-size: var(--fs-small); color: var(--muted); }
.row-date b { font-size: var(--fs-text); font-weight: 600; color: var(--text); }
.row-date small { font-size: 12px; font-weight: 600; }
.row-date.over b, .row-date.over small { color: var(--warn); }
.row-date.soon b, .row-date.soon small { color: var(--soon); }
.row-date.none { color: var(--faint); }

/* A task: the text on one surface, Angaben and Verlauf in boxes of their own */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.detail-main { padding: 32px 36px; }
.detail-title { font-weight: 700; }
.detail-text { font-size: 16px; line-height: 1.7; }
.detail-side { display: flex; flex-direction: column; gap: 16px; padding: 0; border: 0; }
.box { padding: 20px 22px; }
.box .facts { margin: 0; }
.section-title { margin: 0 0 14px; font-size: var(--fs-tiny); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.detail-main .section-title { margin-top: 8px; }
.comment-head { font-size: 13px; }
.comment-body { margin-left: 28px; font-size: var(--fs-text); }
.history li { font-size: var(--fs-small); }

/* Forms and plain pages as surfaces */
.form { padding: 32px 36px; }
.task-form { max-width: none; }
.body { max-width: 760px; padding: 32px 36px; }
.form-note { border-radius: var(--r); }
.login-box { max-width: 400px; padding: 36px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; }

/* === PLAN-12: the finer points =============================================================
   A hint of depth below the surfaces, tags in colour, comments with
   their author's initials, the history as a timeline. */
.card, .main > .list, .form, .body, .box, .detail-main, .empty, .login-box { box-shadow: 0 1px 2px rgba(20, 30, 50, 0.05); }
.button-main { box-shadow: 0 1px 2px rgba(36, 86, 199, 0.3); }
.input:focus-visible { box-shadow: 0 0 0 3px rgba(36, 86, 199, 0.15); }
.row, .tab, .rail-item, .button { transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
@media (prefers-reduced-motion: reduce) { .row, .tab, .rail-item, .button { transition: none; } }

/* A tag: a dot in its own colour before the name */
.chip-tag { display: inline-flex; align-items: center; gap: 6px; }
.chip-tag::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.chip-c0::before { background: #2456c7; }
.chip-c1::before { background: #1f8a55; }
.chip-c2::before { background: #8a4bb5; }
.chip-c3::before { background: #c46a00; }
.chip-c4::before { background: #0f8a9c; }
.chip-c5::before { background: #c23b65; }
.chip-c6::before { background: #9a7b00; }
.chip-c7::before { background: #55637d; }
.row-task:hover .row-title { color: var(--blue); }

/* The status of a task: the four statuses as marks; the current one full, the others pale until the mouse is on them */
.status-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.status-pick .pill { height: 26px; padding: 0 10px; border: 0; cursor: pointer; opacity: 0.5; }
.status-pick .pill:hover, .status-pick .pill.on { opacity: 1; }
.status-pick .pill.on { box-shadow: 0 0 0 1.5px currentColor; text-decoration: none; }
.person .avatar { width: 24px; height: 24px; font-size: 10px; }
.detail-side .facts > div { grid-template-columns: 84px minmax(0, 1fr); gap: 4px 12px; padding: 8px 0; }
.detail-side .facts dd { font-size: var(--fs-small); }

/* Comments with the initials of their author; the history as a timeline */
.comments { max-width: none; }
.comments li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 16px 0; }
.comments .avatar { width: 34px; height: 34px; font-size: 12px; }
.comment-head { gap: 8px; font-size: 13px; }
.comment-head b { font-size: var(--fs-small); font-weight: 600; }
.comment-body { margin: 4px 0 0; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-form { max-width: none; margin-top: 8px; }
.history { position: relative; gap: 16px; margin: 0; padding: 0; border: 0; }
.history::before { content: ""; position: absolute; left: 3px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.history li { position: relative; padding-left: 20px; }
.history li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg);
  border: 1.5px solid var(--faint); }
.history li:first-child::before { background: var(--blue); border-color: var(--blue); }

/* --- The narrow screen (docs/design/aufgaben-handy.html) -----------------------------
   The rail becomes a bar at the bottom of the screen; the parts become tabs with
   an underline below the module's name, the main action a square button beside
   it. Buttons and fields are 44 px high. */
@media (max-width: 760px) {
  :root { --pad-x: 16px; --button: 44px; --field: 44px; }

  .app { display: block; padding-bottom: calc(57px + env(safe-area-inset-bottom)); }

  .rail { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; top: auto; width: auto; height: auto; overflow: visible;
    flex-direction: row; align-items: stretch; gap: 0; padding: 0 0 env(safe-area-inset-bottom);
    border-right: 0; border-top: 1px solid var(--line); }
  .rail .mark, .rail-top, .rail-fly, .rail-account-name { display: none !important; }
  .rail-end, .rail-module { display: contents; }
  .rail-item { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 3px; width: auto; min-width: 0;
    min-height: 56px; padding: 0; border-radius: 0; font-size: 11px; line-height: 1.2; text-align: center; }
  .rail-item:hover, .rail-module:hover > .rail-item { background: none; }
  .rail-item .icon { width: 22px; height: 22px; }
  .rail-item[aria-current] { background: none; font-weight: 600; }
  .rail-account .avatar { width: 26px; height: 26px; }
  .rail-account[aria-current] .avatar { outline: 2px solid var(--text); outline-offset: 2px; }

  /* With parts: the module's name and the main action in one line, the tabs below */
  .has-parts { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr;
    grid-template-areas: "name actions" "tabs tabs" "main main"; align-content: start; }
  .has-parts .parts, .has-parts .content, .has-parts .head { display: contents; }
  .has-parts .parts-name { grid-area: name; padding: 0 var(--pad-x); font-size: 20px; }
  .has-parts .parts-label { display: none; }
  /* The groups as one row of tabs; a hairline between them */
  .has-parts .parts-group { display: contents; }
  .has-parts .parts-group + .parts-group::before { content: ""; flex: none; align-self: center; width: 1px; height: 20px; background: var(--border); }
  .has-parts .parts-list { grid-area: tabs; flex-direction: row; gap: 0 22px; padding: 0 var(--pad-x); overflow-x: auto;
    border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .has-parts .parts-list a { flex: none; min-height: 0; height: 40px; padding: 0; margin-bottom: -1px; border-radius: 0;
    border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; white-space: nowrap; }
  .has-parts .parts-list a:hover { background: none; color: var(--text); }
  .has-parts .parts-list a[aria-current] { background: none; color: var(--text); border-bottom-color: var(--text); }
  .has-parts .parts-list .count { margin-left: 6px; }
  .has-parts .head-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .has-parts .head-actions { grid-area: actions; align-self: center; padding-right: var(--pad-x); }
  .has-parts .main { grid-area: main; min-width: 0; }

  .head h1 { font-size: 20px; }
  .with-icon { width: 44px; padding: 0; }
  .with-icon .icon { width: 20px; height: 20px; }
  .with-icon .button-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* The function bar: the main one as an icon, all others in «•••» */
  .bar-beside { display: none; }
  .bar-more-narrow { display: block; }
  .menu-list .bar-narrow-only { display: flex; }
  .bar-more-label, .bar-more-button .icon { display: none; }
  .bar-dots { display: inline; }
  .bar-more-button { width: 44px; padding: 0; }
  .bar .bar-more { position: relative; }
  .bar .bar-more .menu-list { left: auto; right: 0; top: calc(100% + 4px); margin-top: 0; }
  .bar-main:not(.button-main) .button-label { position: static; width: auto; height: auto; clip: auto; }
  .bar-main.with-icon:not(.button-main) { width: auto; padding: 0 12px; }
  /* In the menu a function shows its words beside its icon, also on the narrow screen */
  .menu-item.with-icon { width: 100%; height: auto; padding: 12px 10px; justify-content: flex-start; }
  .menu-item.with-icon .button-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }

  .body { padding-top: 24px; }
  .form { padding-top: 24px; }
  .facts dt { flex-basis: 100%; }
  .detail-main { padding: 24px var(--pad-x) 32px; }
  .detail-side { padding: 24px var(--pad-x) 32px; border-left: 0; border-top: 1px solid var(--line); }
  .detail-title { font-size: 22px; }
  .inline-form .button, .input-small { height: 44px; }
  .facts > div { padding: 6px 0; }
  .choice input { width: 20px; height: 20px; margin-top: 0; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  /* A row of a task in two lines: the status at the left, the title, below it tags, people and date */
  .row-task { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 12px var(--pad-x); }
  .row-task .row-title { grid-column: 1 / 3; padding: 0 0 2px; font-size: 15px; }
  .row-task .row-chips { grid-column: 1 / 3; }
  .row-task .row-chips:empty { display: none; }
  .row-people { grid-column: 1; flex: none; }
  .row-date { grid-column: 2; flex: none; }
  .filters .search { flex: 1 1 100%; height: 44px; }
  .button-filter { height: 44px; }
  /* The menus open below the whole filter line, as wide as it: none runs off the screen */
  .filters { position: relative; }
  /* The menus in one row to swipe, below the search; their lists open below the whole line */
  .filter-menus { flex: 1 1 100%; flex-wrap: nowrap; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .filter-menus::-webkit-scrollbar { display: none; }
  .filter-menus > * { flex: none; }
  .menu { position: static; }
  .menu-list { left: var(--pad-x); right: var(--pad-x); top: auto; margin-top: 4px; }
  .menu-list a { padding: 12px 10px; }
  .tag-choice { padding: 8px 10px; }
  .button-small { height: 36px; }

  /* PLAN-11 on the narrow screen: the surfaces from edge to edge, the rows in two lines */
  .content { padding: 20px 16px 32px; }
  .has-parts .main { padding: 16px 0 32px; }
  .head { margin-bottom: 20px; }
  .head h1 { font-size: 24px; }
  .has-parts .card, .has-parts .main > .list, .has-parts .empty, .has-parts .form, .has-parts .body, .has-parts .box, .has-parts .detail-main {
    border-left: 0; border-right: 0; border-radius: 0; }
  .filters { padding: 0 var(--pad-x); }
  .tabs { flex: 1 1 100%; margin: 0; }
  .tab { flex: 1 1 0; justify-content: center; padding: 0 8px; height: 40px; }
  .filters .search { flex: 1 1 0; }
  .group { padding: 16px var(--pad-x) 8px; }
  .row-task { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 14px var(--pad-x); }
  .row-main { grid-column: 1 / 3; }
  .row-task .row-title { white-space: normal; }
  .row-people { grid-column: 1; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
  .row-date { grid-column: 2; }
  .detail { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .detail-main { padding: 20px var(--pad-x) 24px; }
  .detail-side { padding: 0; border: 0; gap: 12px; }
  .form { padding: 20px var(--pad-x) 24px; }
  .rail { padding: 0 0 env(safe-area-inset-bottom); gap: 0; border-top: 1px solid var(--line); }
  .rail-item { gap: 3px; padding: 0; }
  .rail-item[aria-current] { box-shadow: none; }
}

/* The form of a task in one column below 960 px */
@media (max-width: 960px) {
  .task-form { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "note" "main" "side" "buttons"; }
  .form-main { padding-right: 0; }
  .form-side { padding: 24px 0 0; margin-top: 24px; border-left: 0; border-top: 1px solid var(--line); }
  .task-form .form-buttons { padding: 24px 0 0; }
  .detail { grid-template-columns: minmax(0, 1fr); }
}
